From fe7b0ddff602546df01efacc5bfe8374805df310 Mon Sep 17 00:00:00 2001 From: mambax7 Date: Mon, 4 Apr 2016 07:57:43 -0400 Subject: [PATCH 1/3] @version removed --- admin/about.php | 3 +- admin/admin.page.php | 1 - admin/admin_footer.php | 3 +- admin/admin_header.php | 3 +- admin/header.php | 1 - admin/index.php | 3 +- admin/menu.php | 1 - assets/js/jquery-treeview/jquery.treeview.js | 469 +++++++++---------- blocks/blocks.php | 1 - class/page.php | 1 - footer.php | 1 - header.php | 1 - include/blockform.php | 1 - include/form.page.php | 1 - include/functions.render.php | 3 +- include/vars.php | 1 - include/xoopsformloader.php | 1 - index.php | 1 - language/english/admin.php | 1 - language/english/blocks.php | 1 - language/english/main.php | 1 - language/english/modinfo.php | 1 - xoops_version.php | 9 +- 23 files changed, 243 insertions(+), 266 deletions(-) diff --git a/admin/about.php b/admin/about.php index 4d0fc45..273d2dd 100644 --- a/admin/about.php +++ b/admin/about.php @@ -10,12 +10,11 @@ */ /** - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright XOOPS Project (http://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @package * @since * @author XOOPS Development Team - * @version $Id $ */ include_once __DIR__ . '/admin_header.php'; diff --git a/admin/admin.page.php b/admin/admin.page.php index f82ecf9..425cbe7 100644 --- a/admin/admin.page.php +++ b/admin/admin.page.php @@ -15,7 +15,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: admin.page.php 1 2010-2-9 ezsky$ */ include __DIR__ . '/admin_header.php'; diff --git a/admin/admin_footer.php b/admin/admin_footer.php index 350bd55..fe2f88e 100644 --- a/admin/admin_footer.php +++ b/admin/admin_footer.php @@ -10,12 +10,11 @@ */ /** - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright XOOPS Project (http://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @package * @since * @author XOOPS Development Team - * @version $Id $ */ global $xoopsModule; diff --git a/admin/admin_header.php b/admin/admin_header.php index f6761f3..317310c 100644 --- a/admin/admin_header.php +++ b/admin/admin_header.php @@ -10,12 +10,11 @@ */ /** - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright XOOPS Project (http://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @package * @since * @author XOOPS Development Team - * @version $Id $ */ $moduleDirName = basename(dirname(__DIR__)); diff --git a/admin/header.php b/admin/header.php index 3bcb7aa..df1d1e9 100644 --- a/admin/header.php +++ b/admin/header.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: header.php 1 2010-2-9 ezsky$ */ include dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; diff --git a/admin/index.php b/admin/index.php index 2f593a1..f1f35f3 100644 --- a/admin/index.php +++ b/admin/index.php @@ -10,12 +10,11 @@ */ /** - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright XOOPS Project (http://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @package * @since * @author XOOPS Development Team - * @version $Id $ */ include_once __DIR__ . '/admin_header.php'; diff --git a/admin/menu.php b/admin/menu.php index 7e85a10..6f81431 100644 --- a/admin/menu.php +++ b/admin/menu.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: menu.php 1 2010-2-9 ezsky$ */ $moduleDirName = basename(dirname(__DIR__)); diff --git a/assets/js/jquery-treeview/jquery.treeview.js b/assets/js/jquery-treeview/jquery.treeview.js index bc5d9e4..78c97f3 100644 --- a/assets/js/jquery-treeview/jquery.treeview.js +++ b/assets/js/jquery-treeview/jquery.treeview.js @@ -1,6 +1,6 @@ /* * Treeview 1.4 - jQuery plugin to hide and show branches of a tree - * + * * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ * http://docs.jquery.com/Plugins/Treeview * @@ -9,243 +9,242 @@ * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html - * - * Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $ + * */ ;(function($) { - $.extend($.fn, { - swapClass: function(c1, c2) { - var c1Elements = this.filter('.' + c1); - this.filter('.' + c2).removeClass(c2).addClass(c1); - c1Elements.removeClass(c1).addClass(c2); - return this; - }, - replaceClass: function(c1, c2) { - return this.filter('.' + c1).removeClass(c1).addClass(c2).end(); - }, - hoverClass: function(className) { - className = className || "hover"; - return this.hover(function() { - $(this).addClass(className); - }, function() { - $(this).removeClass(className); - }); - }, - heightToggle: function(animated, callback) { - animated ? - this.animate({ height: "toggle" }, animated, callback) : - this.each(function(){ - jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ](); - if(callback) - callback.apply(this, arguments); - }); - }, - heightHide: function(animated, callback) { - if (animated) { - this.animate({ height: "hide" }, animated, callback); - } else { - this.hide(); - if (callback) - this.each(callback); - } - }, - prepareBranches: function(settings) { - if (!settings.prerendered) { - // mark last tree items - this.filter(":last-child:not(ul)").addClass(CLASSES.last); - // collapse whole tree, or only those marked as closed, anyway except those marked as open - this.filter((settings.collapsed ? "" : "." + CLASSES.closed) + ":not(." + CLASSES.open + ")").find(">ul").hide(); - } - // return all items with sublists - return this.filter(":has(>ul)"); - }, - applyClasses: function(settings, toggler) { - this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event) { - toggler.apply($(this).next()); - }).add( $("a", this) ).hoverClass(); - - if (!settings.prerendered) { - // handle closed ones first - this.filter(":has(>ul:hidden)") - .addClass(CLASSES.expandable) - .replaceClass(CLASSES.last, CLASSES.lastExpandable); - - // handle open ones - this.not(":has(>ul:hidden)") - .addClass(CLASSES.collapsable) - .replaceClass(CLASSES.last, CLASSES.lastCollapsable); - - // create hitarea - this.prepend("
").find("div." + CLASSES.hitarea).each(function() { - var classes = ""; - $.each($(this).parent().attr("class").split(" "), function() { - classes += this + "-hitarea "; - }); - $(this).addClass( classes ); - }); - } - - // apply event to hitarea - this.find("div." + CLASSES.hitarea).click( toggler ); - }, - treeview: function(settings) { - - settings = $.extend({ - cookieId: "treeview" - }, settings); - - if (settings.add) { - return this.trigger("add", [settings.add]); - } - - if ( settings.toggle ) { - var callback = settings.toggle; - settings.toggle = function() { - return callback.apply($(this).parent()[0], arguments); - }; - } - - // factory for treecontroller - function treeController(tree, control) { - // factory for click handlers - function handler(filter) { - return function() { - // reuse toggle event handler, applying the elements to toggle - // start searching for all hitareas - toggler.apply( $("div." + CLASSES.hitarea, tree).filter(function() { - // for plain toggle, no filter is provided, otherwise we need to check the parent element - return filter ? $(this).parent("." + filter).length : true; - }) ); - return false; - }; - } - // click on first element to collapse tree - $("a:eq(0)", control).click( handler(CLASSES.collapsable) ); - // click on second to expand tree - $("a:eq(1)", control).click( handler(CLASSES.expandable) ); - // click on third to toggle tree - $("a:eq(2)", control).click( handler() ); - } - - // handle toggle event - function toggler() { - $(this) - .parent() - // swap classes for hitarea - .find(">.hitarea") - .swapClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea ) - .swapClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea ) - .end() - // swap classes for parent li - .swapClass( CLASSES.collapsable, CLASSES.expandable ) - .swapClass( CLASSES.lastCollapsable, CLASSES.lastExpandable ) - // find child lists - .find( ">ul" ) - // toggle them - .heightToggle( settings.animated, settings.toggle ); - if ( settings.unique ) { - $(this).parent() - .siblings() - // swap classes for hitarea - .find(">.hitarea") - .replaceClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea ) - .replaceClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea ) - .end() - .replaceClass( CLASSES.collapsable, CLASSES.expandable ) - .replaceClass( CLASSES.lastCollapsable, CLASSES.lastExpandable ) - .find( ">ul" ) - .heightHide( settings.animated, settings.toggle ); - } - } - - function serialize() { - function binary(arg) { - return arg ? 1 : 0; - } - var data = []; - branches.each(function(i, e) { - data[i] = $(e).is(":has(>ul:visible)") ? 1 : 0; - }); - $.cookie(settings.cookieId, data.join("") ); - } - - function deserialize() { - var stored = $.cookie(settings.cookieId); - if ( stored ) { - var data = stored.split(""); - branches.each(function(i, e) { - $(e).find(">ul")[ parseInt(data[i]) ? "show" : "hide" ](); - }); - } - } - - // add treeview class to activate styles - this.addClass("treeview"); - - // prepare branches and find all tree items with child lists - var branches = this.find("li").prepareBranches(settings); - - switch(settings.persist) { - case "cookie": - var toggleCallback = settings.toggle; - settings.toggle = function() { - serialize(); - if (toggleCallback) { - toggleCallback.apply(this, arguments); - } - }; - deserialize(); - break; - case "location": - var current = this.find("a").filter(function() { return this.href.toLowerCase() == location.href.toLowerCase(); }); - if ( current.length ) { - current.addClass("selected").parents("ul, li").add( current.next() ).show(); - } - break; - } - - branches.applyClasses(settings, toggler); - - // if control option is set, create the treecontroller and show it - if ( settings.control ) { - treeController(this, settings.control); - $(settings.control).show(); - } - - return this.bind("add", function(event, branches) { - $(branches).prev() - .removeClass(CLASSES.last) - .removeClass(CLASSES.lastCollapsable) - .removeClass(CLASSES.lastExpandable) - .find(">.hitarea") - .removeClass(CLASSES.lastCollapsableHitarea) - .removeClass(CLASSES.lastExpandableHitarea); - $(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings, toggler); - }); - } - }); - - // classes used by the plugin - // need to be styled via external stylesheet, see first example - var CLASSES = $.fn.treeview.classes = { - open: "open", - closed: "closed", - expandable: "expandable", - expandableHitarea: "expandable-hitarea", - lastExpandableHitarea: "lastExpandable-hitarea", - collapsable: "collapsable", - collapsableHitarea: "collapsable-hitarea", - lastCollapsableHitarea: "lastCollapsable-hitarea", - lastCollapsable: "lastCollapsable", - lastExpandable: "lastExpandable", - last: "last", - hitarea: "hitarea" - }; - - // provide backwards compability - $.fn.Treeview = $.fn.treeview; - + $.extend($.fn, { + swapClass: function(c1, c2) { + var c1Elements = this.filter('.' + c1); + this.filter('.' + c2).removeClass(c2).addClass(c1); + c1Elements.removeClass(c1).addClass(c2); + return this; + }, + replaceClass: function(c1, c2) { + return this.filter('.' + c1).removeClass(c1).addClass(c2).end(); + }, + hoverClass: function(className) { + className = className || "hover"; + return this.hover(function() { + $(this).addClass(className); + }, function() { + $(this).removeClass(className); + }); + }, + heightToggle: function(animated, callback) { + animated ? + this.animate({ height: "toggle" }, animated, callback) : + this.each(function(){ + jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ](); + if(callback) + callback.apply(this, arguments); + }); + }, + heightHide: function(animated, callback) { + if (animated) { + this.animate({ height: "hide" }, animated, callback); + } else { + this.hide(); + if (callback) + this.each(callback); + } + }, + prepareBranches: function(settings) { + if (!settings.prerendered) { + // mark last tree items + this.filter(":last-child:not(ul)").addClass(CLASSES.last); + // collapse whole tree, or only those marked as closed, anyway except those marked as open + this.filter((settings.collapsed ? "" : "." + CLASSES.closed) + ":not(." + CLASSES.open + ")").find(">ul").hide(); + } + // return all items with sublists + return this.filter(":has(>ul)"); + }, + applyClasses: function(settings, toggler) { + this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event) { + toggler.apply($(this).next()); + }).add( $("a", this) ).hoverClass(); + + if (!settings.prerendered) { + // handle closed ones first + this.filter(":has(>ul:hidden)") + .addClass(CLASSES.expandable) + .replaceClass(CLASSES.last, CLASSES.lastExpandable); + + // handle open ones + this.not(":has(>ul:hidden)") + .addClass(CLASSES.collapsable) + .replaceClass(CLASSES.last, CLASSES.lastCollapsable); + + // create hitarea + this.prepend("
").find("div." + CLASSES.hitarea).each(function() { + var classes = ""; + $.each($(this).parent().attr("class").split(" "), function() { + classes += this + "-hitarea "; + }); + $(this).addClass( classes ); + }); + } + + // apply event to hitarea + this.find("div." + CLASSES.hitarea).click( toggler ); + }, + treeview: function(settings) { + + settings = $.extend({ + cookieId: "treeview" + }, settings); + + if (settings.add) { + return this.trigger("add", [settings.add]); + } + + if ( settings.toggle ) { + var callback = settings.toggle; + settings.toggle = function() { + return callback.apply($(this).parent()[0], arguments); + }; + } + + // factory for treecontroller + function treeController(tree, control) { + // factory for click handlers + function handler(filter) { + return function() { + // reuse toggle event handler, applying the elements to toggle + // start searching for all hitareas + toggler.apply( $("div." + CLASSES.hitarea, tree).filter(function() { + // for plain toggle, no filter is provided, otherwise we need to check the parent element + return filter ? $(this).parent("." + filter).length : true; + }) ); + return false; + }; + } + // click on first element to collapse tree + $("a:eq(0)", control).click( handler(CLASSES.collapsable) ); + // click on second to expand tree + $("a:eq(1)", control).click( handler(CLASSES.expandable) ); + // click on third to toggle tree + $("a:eq(2)", control).click( handler() ); + } + + // handle toggle event + function toggler() { + $(this) + .parent() + // swap classes for hitarea + .find(">.hitarea") + .swapClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea ) + .swapClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea ) + .end() + // swap classes for parent li + .swapClass( CLASSES.collapsable, CLASSES.expandable ) + .swapClass( CLASSES.lastCollapsable, CLASSES.lastExpandable ) + // find child lists + .find( ">ul" ) + // toggle them + .heightToggle( settings.animated, settings.toggle ); + if ( settings.unique ) { + $(this).parent() + .siblings() + // swap classes for hitarea + .find(">.hitarea") + .replaceClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea ) + .replaceClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea ) + .end() + .replaceClass( CLASSES.collapsable, CLASSES.expandable ) + .replaceClass( CLASSES.lastCollapsable, CLASSES.lastExpandable ) + .find( ">ul" ) + .heightHide( settings.animated, settings.toggle ); + } + } + + function serialize() { + function binary(arg) { + return arg ? 1 : 0; + } + var data = []; + branches.each(function(i, e) { + data[i] = $(e).is(":has(>ul:visible)") ? 1 : 0; + }); + $.cookie(settings.cookieId, data.join("") ); + } + + function deserialize() { + var stored = $.cookie(settings.cookieId); + if ( stored ) { + var data = stored.split(""); + branches.each(function(i, e) { + $(e).find(">ul")[ parseInt(data[i]) ? "show" : "hide" ](); + }); + } + } + + // add treeview class to activate styles + this.addClass("treeview"); + + // prepare branches and find all tree items with child lists + var branches = this.find("li").prepareBranches(settings); + + switch(settings.persist) { + case "cookie": + var toggleCallback = settings.toggle; + settings.toggle = function() { + serialize(); + if (toggleCallback) { + toggleCallback.apply(this, arguments); + } + }; + deserialize(); + break; + case "location": + var current = this.find("a").filter(function() { return this.href.toLowerCase() == location.href.toLowerCase(); }); + if ( current.length ) { + current.addClass("selected").parents("ul, li").add( current.next() ).show(); + } + break; + } + + branches.applyClasses(settings, toggler); + + // if control option is set, create the treecontroller and show it + if ( settings.control ) { + treeController(this, settings.control); + $(settings.control).show(); + } + + return this.bind("add", function(event, branches) { + $(branches).prev() + .removeClass(CLASSES.last) + .removeClass(CLASSES.lastCollapsable) + .removeClass(CLASSES.lastExpandable) + .find(">.hitarea") + .removeClass(CLASSES.lastCollapsableHitarea) + .removeClass(CLASSES.lastExpandableHitarea); + $(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings, toggler); + }); + } + }); + + // classes used by the plugin + // need to be styled via external stylesheet, see first example + var CLASSES = $.fn.treeview.classes = { + open: "open", + closed: "closed", + expandable: "expandable", + expandableHitarea: "expandable-hitarea", + lastExpandableHitarea: "lastExpandable-hitarea", + collapsable: "collapsable", + collapsableHitarea: "collapsable-hitarea", + lastCollapsableHitarea: "lastCollapsable-hitarea", + lastCollapsable: "lastCollapsable", + lastExpandable: "lastExpandable", + last: "last", + hitarea: "hitarea" + }; + + // provide backwards compability + $.fn.Treeview = $.fn.treeview; + })(jQuery); \ No newline at end of file diff --git a/blocks/blocks.php b/blocks/blocks.php index 1ce6a27..5417532 100644 --- a/blocks/blocks.php +++ b/blocks/blocks.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: blocks.php 1 2010-2-9 ezsky$ */ defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); diff --git a/class/page.php b/class/page.php index 82323cc..28b5ce1 100644 --- a/class/page.php +++ b/class/page.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: page.php 1 2010-2-9 ezsky$ */ defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); diff --git a/footer.php b/footer.php index 94894ff..9269f01 100644 --- a/footer.php +++ b/footer.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: footer.php 1 2010-2-9 ezsky$ */ if (count($xoBreadcrumbs) > 0) { diff --git a/header.php b/header.php index 442142a..047d283 100644 --- a/header.php +++ b/header.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: header.php 1 2010-2-9 ezsky$ */ include_once dirname(dirname(__DIR__)) . '/mainfile.php'; diff --git a/include/blockform.php b/include/blockform.php index 2e2d64f..0122793 100644 --- a/include/blockform.php +++ b/include/blockform.php @@ -15,7 +15,6 @@ * @package about * @since 1.0.0 * @author Susheng Yang - * @version $Id: blockform.php 1 2010-1-22 ezsky$ */ defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); diff --git a/include/form.page.php b/include/form.page.php index 50bb0f9..7c1ed13 100644 --- a/include/form.page.php +++ b/include/form.page.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: form.page.php 1 2010-2-9 ezsky$ */ if (!defined('XOOPS_ROOT_PATH')) { diff --git a/include/functions.render.php b/include/functions.render.php index b2bd86a..3fef903 100644 --- a/include/functions.render.php +++ b/include/functions.render.php @@ -9,12 +9,11 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright XOOPS Project (http://xoops.org) * @license http://www.fsf.org/copyleft/gpl.html GNU public license * @package article * @since 1.0 * @author Taiwen Jiang - * @version $Id: functions.render.php 2283 2008-10-12 03:36:13Z phppp $ */ defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); diff --git a/include/vars.php b/include/vars.php index c731048..f6c72a4 100644 --- a/include/vars.php +++ b/include/vars.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: vars.php 1 2010-2-9 ezsky$ */ $GLOBALS['artdirname'] = basename(dirname(__DIR__)); diff --git a/include/xoopsformloader.php b/include/xoopsformloader.php index 6484a54..26a2d43 100644 --- a/include/xoopsformloader.php +++ b/include/xoopsformloader.php @@ -15,7 +15,6 @@ * @package links * @since 1.0.0 * @author Mengjue Shao - * @version $Id: xoopsformloader.php 1 2010-1-22 ezsky$ */ defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); diff --git a/index.php b/index.php index df74479..394f185 100644 --- a/index.php +++ b/index.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: index.php 1 2010-2-9 ezsky$ */ include_once __DIR__ . '/header.php'; diff --git a/language/english/admin.php b/language/english/admin.php index f72823a..39c2146 100644 --- a/language/english/admin.php +++ b/language/english/admin.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: admin.php 1 2010-2-9 ezsky$ */ // _LANGCODE: zh-CN diff --git a/language/english/blocks.php b/language/english/blocks.php index 9010559..45b7d10 100644 --- a/language/english/blocks.php +++ b/language/english/blocks.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: blocks.php 1 2010-2-9 ezsky$ */ diff --git a/language/english/main.php b/language/english/main.php index c4a9c8e..b568652 100644 --- a/language/english/main.php +++ b/language/english/main.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: main.php 1 2010-2-9 ezsky$ */ // _LANGCODE: zh-CN diff --git a/language/english/modinfo.php b/language/english/modinfo.php index b6308c5..0c4824b 100644 --- a/language/english/modinfo.php +++ b/language/english/modinfo.php @@ -16,7 +16,6 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: modinfo.php 1 2010-2-9 ezsky$ */ // _LANGCODE: zh-CN diff --git a/xoops_version.php b/xoops_version.php index a0fafd5..b02353d 100644 --- a/xoops_version.php +++ b/xoops_version.php @@ -15,11 +15,10 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: xoops_version.php 1 2010-2-9 ezsky$ */ -$modversion['name'] = _MI_ABOUT_NAME; -$modversion['description'] = _MI_ABOUT_DESC; +$modversion['name'] = '_MI_ABOUT_NAME'; +$modversion['description'] = '_MI_ABOUT_DESC'; $modversion['author'] = 'Magic.Shao , ezsky '; $modversion['credits'] = 'xoops.org.cn'; $modversion['help'] = 'page=help'; @@ -88,7 +87,7 @@ $modversion['blocks'][1] = array( 'file' => 'blocks.php', - 'name' => _MI_ABOUT_ABOUTUS, + 'name' => '_MI_ABOUT_ABOUTUS', 'description' => '', 'show_func' => 'about_block_menu_show', 'options' => '', @@ -104,7 +103,7 @@ $modversion['blocks'][2] = array( 'file' => 'blocks.php', - 'name' => _MI_ABOUT_PAGE, + 'name' => '_MI_ABOUT_PAGE', 'description' => '', 'show_func' => 'about_block_page_show', 'options' => '1|0|[more]|0', From d2748de1bb03ee38d2a74246c7b395b38d658c50 Mon Sep 17 00:00:00 2001 From: mambax7 Date: Thu, 2 Jun 2016 02:43:47 -0400 Subject: [PATCH 2/3] 1.04 RC2 --- .codeclimate.yml | 31 ++++++++++++++++++ README.md | 10 +++--- admin/admin.page.php | 3 +- admin/admin_footer.php | 9 +++++- admin/menu.php | 15 +++++---- blocks/blocks.php | 22 ++++++------- class/page.php | 18 +++++------ class/tree.php | 34 ++++++++++---------- docs/changelog.txt | 12 +++++-- header.php | 3 +- include/action.module.php | 6 ++-- include/blockform.php | 7 ++++- include/form.page.php | 5 +-- index.php | 5 +-- language/english/blocks.php | 1 - language/english/help/help.html | 8 ++--- language/english/help/helpheader.html | 2 +- templates/about_admin_page.tpl | 2 +- templates/about_list.tpl | 16 +++++----- xoops_version.php | 45 ++++++++++++++++----------- 20 files changed, 159 insertions(+), 95 deletions(-) create mode 100644 .codeclimate.yml diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 0000000..703e755 --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,31 @@ +engines: + eslint: + enabled: true + csslint: + enabled: true + duplication: + enabled: true + config: + languages: + - javascript + - php + fixme: + enabled: true + phpmd: + enabled: true + config: + file_extensions: + - php + - inc + phpcodesniffer: + enabled: true + config: + file_extensions: "php,inc,lib" + standard: "PSR1,PSR2" +ratings: + paths: + - "**.inc" + - "**.js" + - "**.lib" + - "**.php" +exclude_paths: [] diff --git a/README.md b/README.md index 70e6b0c..8a24fbf 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,16 @@ ![alt XOOPS CMS](http://xoops.org/images/logoXoops4GithubRepository.png) ## About Us module for [XOOPS CMS 2.5.8+](https://xoops.org) [![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](LICENSE) -[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/mambax7/about.svg?style=flat)](https://scrutinizer-ci.com/g/mambax7/about/?branch=master) -[![Codacy Badge](https://api.codacy.com/project/badge/grade/2d27c0023ee54f0b9ba2b5d17a68b2a5)](https://www.codacy.com/app/mambax7/about) -[![Code Climate](https://img.shields.io/codeclimate/github/mambax7/about.svg?style=flat)](https://codeclimate.com/github/mambax7/about) +[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/XoopsModules25x/about.svg?style=flat)](https://scrutinizer-ci.com/g/XoopsModules25x/about/?branch=master) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2c1ce57c3e6f4d5b9b55198b4305cd14)](https://www.codacy.com/app/XoopsModules25x/about_2) +[![Code Climate](https://img.shields.io/codeclimate/github/XoopsModules25x/about.svg?style=flat)](https://codeclimate.com/github/XoopsModules25x/about) +[![SensioLabsInsight](https://insight.sensiolabs.com/projects/67dff878-c997-4264-a709-7dede15759d6/mini.png)](https://insight.sensiolabs.com/projects/67dff878-c997-4264-a709-7dede15759d6) [![Latest Pre-Resease](https://img.shields.io/github/tag/XoopsModules25x/about.svg?style=flat)](https://github.com/XoopsModules25x/about/tags/) [![Latest Version](https://img.shields.io/github/release/XoopsModules25x/about.svg?style=flat)](https://github.com/XoopsModules25x/about/releases/) About Us module for [XOOPS CMS](http://xoops.org) for adding a multi-page About Us section to your Website -[![Tutorial Available](http://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/xoops-about/) Tutorial: see [here](https://www.gitbook.com/book/xoops/xoops-about/). +[![Tutorial Available](http://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/xoops-about/) Tutorial: see [GitBook](https://www.gitbook.com/book/xoops/xoops-about/). To contribute to the Tutorial, [fork it on GitHub](https://github.com/XoopsDocs/about-tutorial) [![Translations on Transifex](http://xoops.org/images/translations-transifex-blue.svg)](https://www.transifex.com/xoops) @@ -17,4 +18,3 @@ To contribute to the Tutorial, [fork it on GitHub](https://github.com/XoopsDocs/ Please visit us on http://xoops.org The upcoming "next generation" version of XOOPS CMS is being crafted on GitHub at: https://github.com/XOOPS - diff --git a/admin/admin.page.php b/admin/admin.page.php index 425cbe7..7436335 100644 --- a/admin/admin.page.php +++ b/admin/admin.page.php @@ -71,7 +71,8 @@ 'page_status', 'page_order', 'page_index', - 'page_tpl'); + 'page_tpl' + ); $criteria = new CriteriaCompo(); $criteria->setSort('page_order'); diff --git a/admin/admin_footer.php b/admin/admin_footer.php index fe2f88e..d860898 100644 --- a/admin/admin_footer.php +++ b/admin/admin_footer.php @@ -20,6 +20,13 @@ global $xoopsModule; //$pathIcon32 = '../' . $xoopsModule->getInfo('icons32'); -echo "
\n" . "
\n" . " XOOPS\n" . "
\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '
'; +echo "
\n" . + "
\n" . + " XOOPS\n" . + "
\n" . + ' ' . + _AM_MODULEADMIN_ADMIN_FOOTER . + "\n" . + '
'; xoops_cp_footer(); diff --git a/admin/menu.php b/admin/menu.php index 6f81431..8d8f0ef 100644 --- a/admin/menu.php +++ b/admin/menu.php @@ -20,9 +20,9 @@ $moduleDirName = basename(dirname(__DIR__)); -$moduleHandler = xoops_gethandler('module'); -$module = $moduleHandler->getByDirname($moduleDirName); -$pathIcon32 = '../../' . $module->getInfo('sysicons32'); +$moduleHandler = xoops_getHandler('module'); +$module = $moduleHandler->getByDirname($moduleDirName); +$pathIcon32 = '../../' . $module->getInfo('sysicons32'); $pathModIcon32 = './' . $module->getInfo('modicons32'); xoops_loadLanguage('modinfo', $module->dirname()); @@ -35,14 +35,17 @@ $adminmenu[] = array( 'title' => _AM_MODULEADMIN_HOME, 'link' => 'admin/index.php', - 'icon' => $pathIcon32 . '/home.png'); + 'icon' => $pathIcon32 . '/home.png' +); $adminmenu[] = array( 'title' => _MI_ABOUT_PAGE, 'link' => 'admin/admin.page.php', - 'icon' => $pathIcon32 . '/manage.png'); + 'icon' => $pathIcon32 . '/manage.png' +); $adminmenu[] = array( 'title' => _AM_MODULEADMIN_ABOUT, 'link' => 'admin/about.php', - 'icon' => $pathIcon32 . '/about.png'); + 'icon' => $pathIcon32 . '/about.png' +); diff --git a/blocks/blocks.php b/blocks/blocks.php index 5417532..1bfb1cf 100644 --- a/blocks/blocks.php +++ b/blocks/blocks.php @@ -35,12 +35,12 @@ function about_block_menu_show() 'page_menu_title', 'page_blank', 'page_menu_status', - 'page_status'); + 'page_status' + ); $page_menu = $page_handler->getAll($menu_criteria, $fields, false); - - include dirname(__DIR__) . '/xoops_version.php'; + // include dirname(__DIR__) . '/xoops_version.php'; foreach ($page_menu as $k => $v) { - $page_menu[$k]['links'] = XOOPS_URL . '/modules/' . $modversion['dirname'] . '/index.php?page_id=' . $v['page_id']; + $page_menu[$k]['links'] = XOOPS_URL . '/modules/' . basename(dirname(__DIR__)) . '/index.php?page_id=' . $v['page_id']; } return $page_menu; @@ -52,7 +52,7 @@ function about_block_menu_show() */ function about_block_page_show($options) { - @include dirname(__DIR__) . '/xoops_version.php'; + // @include dirname(__DIR__) . '/xoops_version.php'; $myts = MyTextSanitizer::getInstance(); $block = array(); $page_handler = xoops_getModuleHandler('page', 'about'); @@ -62,7 +62,7 @@ function about_block_page_show($options) } $page_text = strip_tags($page->getVar('page_text', 'n')); if ($options[1] > 0) { - $url = XOOPS_URL . '/modules/' . $modversion['dirname'] . '/index.php?page_id=' . $options[0]; + $url = XOOPS_URL . '/modules/' . basename(dirname(__DIR__)) . '/index.php?page_id=' . $options[0]; $trimmarker = <<{$options[2]} EOF; @@ -70,7 +70,7 @@ function about_block_page_show($options) } $block['page_text'] = $myts->nl2br($page_text); - $block['page_image'] = $options[3] == 1 ? XOOPS_UPLOAD_URL . '/' . $modversion['dirname'] . '/' . $page->getVar('page_image', 's') : ''; + $block['page_image'] = $options[3] == 1 ? XOOPS_UPLOAD_URL . '/' . basename(dirname(__DIR__)) . '/' . $page->getVar('page_image', 's') : ''; return $block; } @@ -81,8 +81,8 @@ function about_block_page_show($options) */ function about_block_page_edit($options) { - @include dirname(__DIR__) . '/xoops_version.php'; xoops_loadLanguage('blocks', 'about'); + // @include dirname(__DIR__) . '/xoops_version.php'; $page_handler = xoops_getModuleHandler('page', 'about'); $criteria = new CriteriaCompo(); $criteria->add(new Criteria('page_status', 1), 'AND'); @@ -93,12 +93,12 @@ function about_block_page_edit($options) $pages = $page_handler->getAll($criteria, $fields, false); $page_title = ''; foreach ($pages as $k => $v) { - $page_title = '' . $v['page_title'] . ''; - $options_page[$k] = empty($v['page_image']) ? $page_title : $page_title . ''; + $page_title = '' . $v['page_title'] . ''; + $options_page[$k] = empty($v['page_image']) ? $page_title : $page_title . ''; } include_once dirname(__DIR__) . '/include/xoopsformloader.php'; $form = new XoopsBlockForm(); - $page_select = new XoopsFormRadio(_MB_ABOUT_BLOCKPAGE, 'options[0]', $options[0], '
'); + $page_select = new XoopsFormRadio(_MB_ABOUT_BLOCKPAGE, 'options[0]', $options[0], '
'); $page_select->addOptionArray($options_page); $form->addElement($page_select); $form->addElement(new XoopsFormText(_MB_ABOUT_TEXT_LENGTH, 'options[1]', 5, 5, $options[1])); diff --git a/class/page.php b/class/page.php index 28b5ce1..7baddb5 100644 --- a/class/page.php +++ b/class/page.php @@ -61,7 +61,7 @@ class AboutPageHandler extends XoopsPersistableObjectHandler { /** * AboutPageHandler constructor. - * @param null|object|XoopsDatabase $db + * @param null|XoopsDatabase $db */ public function __construct(XoopsDatabase $db) { @@ -85,19 +85,19 @@ public function &getTrees($pid = 0, $prefix = '--', $tags = array()) $criteria->setOrder('ASC'); $page_tree =& $this->getAll($criteria, $tags); require_once __DIR__ . '/tree.php'; - $tree = new aboutTree($page_tree); + $tree = new AboutTree($page_tree); $page_array =& $tree->makeTree($prefix, $pid, $tags); return $page_array; } /** - * @param array $pages - * @param int $key - * @param int $level + * @param array $pages + * @param int $key + * @param int $level * @return array|bool */ - public function &MenuTree($pages = array(), $key = 0, $level = 1) + public function &menuTree($pages = array(), $key = 0, $level = 1) { if (!is_array($pages) || 0 === count($pages)) { return false; @@ -108,7 +108,7 @@ public function &MenuTree($pages = array(), $key = 0, $level = 1) if ($v['page_pid'] == $key) { $menu[$k] = $v; $menu[$k]['level'] = $level; - $child =& $this->MenuTree($pages, $k, $level + 1); + $child =& $this->menuTree($pages, $k, $level + 1); if (!empty($child)) { $menu[$k]['child'] = $child; } @@ -119,8 +119,8 @@ public function &MenuTree($pages = array(), $key = 0, $level = 1) } /** - * @param array $pages - * @param int $key + * @param array $pages + * @param int $key * @return array|bool */ public function getBread($pages = array(), $key = 0) diff --git a/class/tree.php b/class/tree.php index 999f8d8..bada957 100644 --- a/class/tree.php +++ b/class/tree.php @@ -4,14 +4,14 @@ require_once XOOPS_ROOT_PATH . '/class/tree.php'; -if (!class_exists('aboutTree')) { +if (!class_exists('AboutTree')) { /** - * Class aboutTree + * Class AboutTree */ - class aboutTree extends XoopsObjectTree + class AboutTree extends XoopsObjectTree { /** - * aboutTree constructor. + * AboutTree constructor. * @param array $objectArr * @param null $rootId */ @@ -27,7 +27,7 @@ public function __construct(&$objectArr, $rootId = null) * @param string $prefix_curr * @param null $tags */ - public function _makeTreeItems($key, &$ret, $prefix_orig, $prefix_curr = '', $tags = null) + public function makeTreeItems($key, &$ret, $prefix_orig, $prefix_curr = '', $tags = null) { if ($key > 0) { if (count($tags) > 0) { @@ -42,7 +42,7 @@ public function _makeTreeItems($key, &$ret, $prefix_orig, $prefix_curr = '', $ta } if (isset($this->_tree[$key]['child']) && !empty($this->_tree[$key]['child'])) { foreach ($this->_tree[$key]['child'] as $childkey) { - $this->_makeTreeItems($childkey, $ret, $prefix_orig, $prefix_curr, $tags); + $this->makeTreeItems($childkey, $ret, $prefix_orig, $prefix_curr, $tags); } } } @@ -56,22 +56,22 @@ public function _makeTreeItems($key, &$ret, $prefix_orig, $prefix_curr = '', $ta public function &makeTree($prefix = '-', $key = 0, $tags = null) { $ret = array(); - $this->_makeTreeItems($key, $ret, $prefix, '', $tags); + $this->makeTreeItems($key, $ret, $prefix, '', $tags); return $ret; } /** * @param string $name - * @param string $fieldName + * @param string $fieldName * @param string $prefix * @param string $selected - * @param bool $addEmptyOption + * @param bool $addEmptyOption * @param int $key - * @param string $extra + * @param string $extra * @return string */ - public function makeSelBox($name, $fieldName, $prefix = '-', $selected = '', $addEmptyOption = false, $key = 0, $extra = '') + public function makeSelBox($name, $fieldName, $prefix = '-', $selected = '', $addEmptyOption = false, $key = 0, $extra = '') { $ret = '