diff --git a/README.md b/README.md index 8c82b11..8a24fbf 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ 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) 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..7436335 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'; @@ -72,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 350bd55..d860898 100644 --- a/admin/admin_footer.php +++ b/admin/admin_footer.php @@ -10,17 +10,23 @@ */ /** - * @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; //$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/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..8d8f0ef 100644 --- a/admin/menu.php +++ b/admin/menu.php @@ -16,14 +16,13 @@ * @since 1.0.0 * @author Mengjue Shao * @author Susheng Yang - * @version $Id: menu.php 1 2010-2-9 ezsky$ */ $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()); @@ -36,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/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..1745f8f 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'); @@ -36,12 +35,11 @@ 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'; 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; @@ -53,7 +51,6 @@ function about_block_menu_show() */ function about_block_page_show($options) { - @include dirname(__DIR__) . '/xoops_version.php'; $myts = MyTextSanitizer::getInstance(); $block = array(); $page_handler = xoops_getModuleHandler('page', 'about'); @@ -63,7 +60,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; @@ -71,7 +68,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; } @@ -82,7 +79,6 @@ function about_block_page_show($options) */ function about_block_page_edit($options) { - @include dirname(__DIR__) . '/xoops_version.php'; xoops_loadLanguage('blocks', 'about'); $page_handler = xoops_getModuleHandler('page', 'about'); $criteria = new CriteriaCompo(); @@ -94,12 +90,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 82323cc..7baddb5 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'); @@ -62,7 +61,7 @@ class AboutPageHandler extends XoopsPersistableObjectHandler { /** * AboutPageHandler constructor. - * @param null|object|XoopsDatabase $db + * @param null|XoopsDatabase $db */ public function __construct(XoopsDatabase $db) { @@ -86,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; @@ -109,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; } @@ -120,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 = '