Skip to content

Commit

Permalink
Merge branch 'revamp-scripts-class'
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Nov 18, 2017
2 parents 94c3ce6 + e60bfe1 commit 6207a2c
Show file tree
Hide file tree
Showing 42 changed files with 23,487 additions and 69 deletions.
Empty file added data/cache/index.html
Empty file.
1 change: 1 addition & 0 deletions public_html/admin/clearctl.php
Expand Up @@ -45,3 +45,4 @@
*/
CTL_clearCache();
COM_redirect($_CONF['site_admin_url'] . '/index.php?msg=500');
Geeklog\Cache::clear();
9 changes: 4 additions & 5 deletions public_html/admin/group.php
Expand Up @@ -2,13 +2,13 @@

/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
// | Geeklog 2.1 |
// | Geeklog 2.2 |
// +---------------------------------------------------------------------------+
// | group.php |
// | |
// | Geeklog group administration page. |
// +---------------------------------------------------------------------------+
// | Copyright (C) 2000-2011 by the following authors: |
// | Copyright (C) 2000-2017 by the following authors: |
// | |
// | Authors: Tony Bibbs - tony AT tonybibbs DOT com |
// | Mark Limburg - mlimburg AT users DOT sourceforge DOT net |
Expand Down Expand Up @@ -263,16 +263,15 @@ function editgroup($grp_id = '')

if ($A['grp_gl_core'] == 1) {
$inclause = str_replace(' ', ',', $selected);
$sql = "SELECT grp_id, grp_name, grp_descr FROM {$_TABLES['groups']} WHERE grp_id <> $grp_id AND grp_id IN ($inclause)";
$sql = "SELECT grp_id, grp_name, grp_descr, grp_gl_core FROM {$_TABLES['groups']} WHERE grp_id <> $grp_id AND grp_id IN ($inclause)";
} else {
$xsql = '';
if (!empty($grp_id)) {
$xsql = " AND (grp_id <> $grp_id)";
}
$sql = "SELECT grp_id, grp_name, grp_descr FROM {$_TABLES['groups']} WHERE (grp_name <> 'Root')" . $xsql . ' AND ' . $whereGroups;
$sql = "SELECT grp_id, grp_name, grp_descr, grp_gl_core FROM {$_TABLES['groups']} WHERE (grp_name <> 'Root')" . $xsql . ' AND ' . $whereGroups;
}


// Create a complete list of inherited groups for this group being edited so we know what needs to be disabled on screen
$resultA = DB_query($sql, 1);
$nrowsA = DB_numRows($resultA);
Expand Down
82 changes: 57 additions & 25 deletions public_html/javascript/profile_editor.js
@@ -1,13 +1,11 @@
/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
// | Geeklog 1.6 |
// | Geeklog 2.2 |
// +---------------------------------------------------------------------------+
// | Copyright (C) 2003-2009 by the following authors: |
// | Version 1.0 Date: Jun 24, 2006 |
// | Authors: Blaine Lang - blaine@portalparts.com |
// | |
// | Javascript functions for Account Profile Editor |
// | |
// +---------------------------------------------------------------------------+
// | |
// | This program is free software; you can redistribute it and/or |
Expand All @@ -26,51 +24,85 @@
// | |
// +---------------------------------------------------------------------------+

// @param string selected Name of div that has been selected
// @param int selindex index id of the selected tab as in 1 - 7 used to set the selected tab
function showhideProfileEditorDiv(selected, selindex) {

// @param string selected Name of div that has been selected
// @param int selectedIndex index id of the selected tab as in 1 - 7 used to set the selected tab
function showhideProfileEditorDiv(selected, selectedIndex) {
'use strict';
// Reset the current selected navbar tab
var cnavbar = document.getElementById('current');
if (cnavbar) cnavbar.id = '';
var cNavbar = document.getElementById('current');

if (cNavbar) {
cNavbar.id = '';
}

// Cycle thru the navlist child elements - buiding an array of just the link items
// Cycle thru the navlist child elements - building an array of just the link items
var navbar = document.getElementById('navlist');
var menuitems = new Array(7);
var menuItems = new Array(7);
var item = 0;
for (var i=0 ;i < navbar.childNodes.length ; i++ ) {
if (navbar.childNodes[i].nodeName.toLowerCase() == 'li') {
menuitems[item] = navbar.childNodes[i];
for (var i = 0; i < navbar.childNodes.length; i++) {
if (navbar.childNodes[i].nodeName.toLowerCase() === 'li') {
menuItems[item] = navbar.childNodes[i];
item++;
}
}

// Now that I have just the link items I can set the selected tab using the passed selected Item number
// Set the <a tag to have an id called 'current'
var menuitem = menuitems[selindex];
for (var j=0 ;j < menuitem.childNodes.length ; j++ ) {
if (menuitem.childNodes[j].nodeName.toLowerCase() == 'a') menuitem.childNodes[j].id = 'current';
var menuItem = menuItems[selectedIndex];
for (var j = 0; j < menuItem.childNodes.length; j++) {
if (menuItem.childNodes[j].nodeName.toLowerCase() === 'a') {
menuItem.childNodes[j].id = 'current';
}
}

// Reset or show all the main divs - editor tab sections
// Object profilepanels defined in profile.thtml after page is generated
for( var divid in profilepanels){
if (selected != divid) {
document.getElementById(divid).style.display = 'none';
} else {
document.getElementById(divid).style.display = '';
for (var divId in window.profilepanels) {
if (window.profilepanels.hasOwnProperty(divId)) {
if (selected !== divId) {
document.getElementById(divId).style.display = 'none';
} else {
document.getElementById(divId).style.display = '';
}
}
}

document.getElementById('pe_preview').style.display = 'none';

if (selected != 'pe_preview') {
if (selected !== 'pe_preview') {
document.getElementById('save_button').style.display = '';
} else if (selected == 'pe_preview') {
} else if (selected === 'pe_preview') {
document.getElementById('pe_preview').style.display = '';
document.getElementById('save_button').style.display = 'none';
} else {
document.getElementById('pe_preview').style.display = '';
document.getElementById('save_button').style.display = 'none';
}

}

(function () {
'use strict';
/* Initially the navbar is hidden - in case JS is disabled. Enable it now */
document.getElementById('pe_navbar').style.display = '';

/* Now cycle through the profile tabs as the number in the template could have been modified (personalized)
If you add custom panels, just ensure you use the class jsenabled_hide or jsenabled_show
Build an object that can then be referenced in the function showhideProfileEditorDiv
*/

var profilePanels = {};
var el = document.getElementsByTagName("div");

for (var i = 0; i < el.length; i++) {
var divName = el[i].id;
if (el[i].className === "jsenabled_show") {
el[i].style.display = "";
profilePanels[divName] = "show";
} else if (el[i].className === "jsenabled_hide") {
el[i].style.display = "none";
profilePanels[divName] = "hidden";
}
}

window.profilepanels = profilePanels;
})();
12 changes: 5 additions & 7 deletions public_html/layout/denim/functions.php
Expand Up @@ -191,7 +191,11 @@ function theme_js_libs_denim()
array(
'library' => 'jquery',
'footer' => false // Not required, default = true
)
),
array(
'library' => 'uikit',
'footer' => false, // Not required, default = true
),
);
}

Expand All @@ -205,12 +209,6 @@ function theme_js_files_denim()
$theme_var = theme_config_denim();

$result = array();
$result[] = array(
'file' => '/vendor/uikit/js/uikit.js',
'footer' => false, // Not required, default = true
'priority' => 100 // Not required, default = 100
);

$result[] = array(
'file' => '/layout/' . $_CONF['theme'] . '/javascript/script.js',
'footer' => true, // Not required, default = true
Expand Down
12 changes: 11 additions & 1 deletion public_html/lib-common.php
Expand Up @@ -107,6 +107,9 @@
// Get features that has ft_name like 'config%'
$_CONF_FT = $config->_get_config_features();

// Load Cache class
Geeklog\Cache::init();

// Load in Geeklog Variables Table

/**
Expand Down Expand Up @@ -301,7 +304,7 @@
*
* @global $_SCRIPTS Scripts
*/
$_SCRIPTS = new Scripts();
//$_SCRIPTS = new Scripts();

// Include theme functions file which may/may not do anything
if (file_exists($_CONF['path_layout'] . 'functions.php')) {
Expand Down Expand Up @@ -341,6 +344,13 @@
}
}

/**
* This provides the ability to set css and javascript.
*
* @global $_SCRIPTS Geeklog\Resource
*/
$_SCRIPTS = new Geeklog\Resource($_CONF);

/**
* themes can specify the default image type
* fall back to 'gif' if they don't
Expand Down
58 changes: 58 additions & 0 deletions public_html/r.php
@@ -0,0 +1,58 @@
<?php

/**
* @var $_CONF
*/
require_once __DIR__ . DIRECTORY_SEPARATOR . 'siteconfig.php';

if (!isset($_CONF['path'], $_CONF['path_system']) ||
(isset($_CONF['site_enabled']) && !$_CONF['site_enabled'])) {
exit;
}

// Register autoloader
require_once $_CONF['path_system'] . 'classes/Autoload.php';
Geeklog\Autoload::initialize();
Geeklog\Cache::init();

// Get cache key
$key = Geeklog\Input::fGet('k');
if (empty($key)) {
exit;
}

// Get cached data
$data = Geeklog\Cache::get($key, null);
if (empty($data)) {
exit;
}

// Check if eTags match
$eTag = md5($data['createdAt']);
$clientETag = trim(Geeklog\Input::server('HTTP_IF_NONE_MATCH', ''), '"\'');
if ($clientETag === $eTag) {
header('HTTP/1.1 304 Not Modified');
header('Status: 304 Not Modified');
exit;
}

// Send correct header type
switch($data['type']) {
case 'c':
header('Content-Type: text/css; charset=UTF-8');
break;

case 'j':
header('Content-Type: text/javascript; charset=UTF-8');
break;

default:
exit();
break;
}

// Add Cache Expire in 1 week
header('Cache-control: must-revalidate');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + Geeklog\Resource::DEFAULT_CACHE_LIFESPAN) . ' GMT');
header('ETag: "' . $eTag . '"');
echo $data['data'];
1 change: 1 addition & 0 deletions public_html/siteconfig.php.dist
Expand Up @@ -66,6 +66,7 @@ $_CONF['site_enabled'] = true;
// $_CONF['developer_mode_log']['common'] = true; // lib-common.php
// $_CONF['developer_mode_log']['database'] = true; // lib-database.php
// $_CONF['developer_mode_log']['deprecated'] = true; // deprecated features
// $_CONF['developer_mode_log']['resource'] = true; // Resource class
// $_CONF['developer_mode_log']['security'] = true; // lib-security.php
// $_CONF['developer_mode_log']['session'] = true; // lib-session.php
// $_CONF['developer_mode_log']['template'] = true; // Template class
Expand Down
32 changes: 2 additions & 30 deletions public_html/usersettings.php
Expand Up @@ -2,13 +2,13 @@

/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
// | Geeklog 2.1 |
// | Geeklog 2.2 |
// +---------------------------------------------------------------------------+
// | usersettings.php |
// | |
// | Geeklog user settings page. |
// +---------------------------------------------------------------------------+
// | Copyright (C) 2000-2010 by the following authors: |
// | Copyright (C) 2000-2017 by the following authors: |
// | |
// | Authors: Tony Bibbs - tony AT tonybibbs DOT com |
// | Mark Limburg - mlimburg AT users DOT sourceforge DOT net |
Expand Down Expand Up @@ -94,34 +94,6 @@ function edituser()
// Add JavaScript
$_SCRIPTS->setJavaScriptFile('profile_editor', '/javascript/profile_editor.js');

$js = '<!-- JS Functions which will execute only if JS enabled will un-hide the special features that enhance the profile editor -->
<script type="text/JavaScript">
//<![CDATA[
/* Initially the navbar is hidden - in case JS is disabled. Enable it now */
document.getElementById("pe_navbar").style.display="";
/* Now cycle through the profile tabs as the number in the template could have been modified (personalized)
If you add custom panels, just ensure you use the class jsenabled_hide or jsenabled_show
Build an object that can then be referenced in the functon showhideProfileEditorDiv
*/
var profilepanels = new Object;
var el;
el=document.getElementsByTagName("div");
for(i=0;i<el.length;i++) {
var divname = el[i].id
if(el[i].className == "jsenabled_show"){
el[i].style.display = "";
profilepanels[divname] = "show";
} else if(el[i].className == "jsenabled_hide"){
el[i].style.display = "none";
profilepanels[divname] = "hidden";
}
}
//]]>
</script>';
$_SCRIPTS->setJavaScript($js);

// some trickery to ensure alternating colors with the available options ...
if ($_CONF['allow_username_change'] == 1) {
$first = 1;
Expand Down
43 changes: 43 additions & 0 deletions public_html/vendor/jquery-ui/LICENSE.txt
@@ -0,0 +1,43 @@
Copyright jQuery Foundation and other contributors, https://jquery.org/

This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery-ui

The following license applies to all parts of this software except as
documented below:

====

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

====

Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code contained within the demos directory.

CC0: http://creativecommons.org/publicdomain/zero/1.0/

====

All files located in the node_modules and external directories are
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6207a2c

Please sign in to comment.