From: <tr...@us...> - 2011-10-26 19:29:43
|
Revision: 7978 http://xoops.svn.sourceforge.net/xoops/?rev=7978&view=rev Author: trabis Date: 2011-10-26 19:29:35 +0000 (Wed, 26 Oct 2011) Log Message: ----------- Updating module methods Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_post.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/searchform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php XoopsCore/branches/2.6.x/2.6.0/htdocs/misc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/groupperm.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/maintenance/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/help.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/include/postcheck_functions.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -39,18 +39,17 @@ public function __construct() { - global $xoopsConfig; - + $xoops = Xoops::getInstance(); $this->left_delimiter = '<{'; $this->right_delimiter = '}>'; $this->template_dir = XOOPS_THEME_PATH; $this->cache_dir = XOOPS_VAR_PATH . '/caches/smarty_cache'; $this->compile_dir = XOOPS_VAR_PATH . '/caches/smarty_compile'; - $this->compile_check = ($xoopsConfig['theme_fromfile'] == 1); + $this->compile_check = ($xoops->config['theme_fromfile'] == 1); $this->plugins_dir = array(SMARTY_DIR . '/xoops_plugins', SMARTY_DIR . '/plugins'); - if ($xoopsConfig['debug_mode']) { + if ($xoops->config['debug_mode']) { $this->debugging_ctrl = 'URL'; - if ($xoopsConfig['debug_mode'] == 3) { + if ($xoops->config['debug_mode'] == 3) { $this->debugging = true; } } @@ -200,9 +199,7 @@ $xoopsTpl->caching = 2; for ($i = 0; $i < $count; $i++) { if ($block_arr[$i]->getVar('template') != '') { - $xoopsTpl->clear_cache( - 'db:' . $block_arr[$i]->getVar('template'), 'blk_' . $block_arr[$i]->getVar('bid') - ); + $xoopsTpl->clear_cache(XOOPS_ROOT_PATH . "/modules/" . $block_arr[$i]->getVar('dirname') . "/templates/blocks/" . $block_arr[$i]->getVar('template'), 'blk_' . $block_arr[$i]->getVar('bid')); } } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -23,7 +23,6 @@ $xoops->isModule() or die('Restricted access'); - include_once $xoops->path('include/comment_constants.php'); $op = 'delete'; @@ -42,9 +41,9 @@ if ('system' == $xoops->module->getVar('dirname')) { $comment_handler = xoops_gethandler('comment'); $comment = $comment_handler->get($com_id); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - /* @var $module XoopsModule */ - $module = $module_handler->get($comment->getVar('com_modid')); + $module = $module_handler->getById($comment->getVar('com_modid')); $comment_config = $module->getInfo('comments'); $com_modid = $module->getVar('mid'); $redirect_page = XOOPS_URL . '/modules/system/admin.php?fct=comments&com_modid=' . $com_modid . '&com_itemid'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_post.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_post.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_post.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -32,9 +32,10 @@ } $comment_handler = xoops_gethandler('comment'); $comment = $comment_handler->get($com_id); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); /* @var $module XoopsModule */ - $module = $module_handler->get($comment->getVar('com_modid')); + $module = $module_handler->getById($comment->getVar('com_modid')); $comment_config = $module->getInfo('comments'); $com_modid = $module->getVar('mid'); $redirect_page = XOOPS_URL . '/modules/system/admin.php?fct=comments&com_modid=' . $com_modid . '&com_itemid'; @@ -129,7 +130,7 @@ $noname = isset($noname) ? intval($noname) : 0; $com_text = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['com_text'])); if ($xoops->module->getVar('dirname') != 'system') { - include_once $xoops->path('header.php'); + $xoops->header(); if (!empty($captcha_message)) { xoops_error($captcha_message); } @@ -138,7 +139,7 @@ <tr><td><br />' . $p_comment . '<br /></td></tr> </table>'; include_once $xoops->path('include/comment_form.php'); - include_once $xoops->path('footer.php'); + $xoops->footer(); } else { xoops_cp_header(); echo '<table cellpadding="4" cellspacing="1" width="98%" class="outer"> @@ -297,9 +298,9 @@ $com_rootid = $newcid; if (!$comment_handler->updateByField($comment, 'com_rootid', $com_rootid)) { $comment_handler->delete($comment); - include $xoops->path('header.php'); + $xoops->header(); xoops_error($comment->getHtmlErrors()); - include $xoops->path('footer.php'); + $xoops->footer(); } } // call custom approve function if any @@ -376,10 +377,11 @@ // module). $comment_tags = array(); if ('system' == $xoops->module->getVar('dirname')) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $not_module = $module_handler->get($not_modid); + $not_module = $module_handler->getById($not_modid); } else { - $not_module = $xoopsModule; + $not_module = $xoops->module; } if (!isset($comment_url)) { $com_config = $not_module->getInfo('comments'); @@ -411,9 +413,9 @@ } } else { if (!isset($purge_comment_post_results)) { - include_once $xoops->path('header.php'); + $xoops->header(); xoops_error($comment->getHtmlErrors()); - include_once $xoops->path('footer'); + $xoops->footer(); } else { $comment_post_results = $comment->getErrors(); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -173,8 +173,9 @@ */ function xoops_setActiveModules() { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules_obj = $module_handler->getObjects(new Criteria('isactive', 1)); + $modules_obj = $module_handler->getObjectsArray(new Criteria('isactive', 1)); $modules_active = array(); foreach (array_keys($modules_obj) as $key) { $modules_active[] = $modules_obj[$key]->getVar('dirname'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -39,8 +39,9 @@ if (!isset($module_id)) { return false; } + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($module_id); + $module = $module_handler->getById($module_id); if (!empty($module) && $module->getVar('hasnotification') == 1) { /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); @@ -78,8 +79,9 @@ if (!isset($module_id)) { $module = $xoops->module; } else { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($module_id); + $module = $module_handler->getById($module_id); } $not_config = $module->getInfo('notification'); if (empty($category_name)) { @@ -146,8 +148,9 @@ $module_id = !$xoops->isModule() ? $xoops->module->getVar('mid') : 0; $module = $xoops->module; } else { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($module_id); + $module = $module_handler->getById($module_id); } $not_config = $module->getInfo('notification'); /* @var $config_handler XoopsConfigHandler */ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/searchform.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/searchform.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/searchform.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -40,8 +40,9 @@ if (!empty($available_modules)) { $criteria->add(new Criteria('mid', '(' . implode(',', $available_modules) . ')', 'IN')); } + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $mods_checkbox->addOptionArray($module_handler->getList($criteria)); + $mods_checkbox->addOptionArray($module_handler->getNameList($criteria)); } else { foreach ($modules as $mid => $module) { $module_array[$mid] = $module->getVar('name'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -126,10 +126,11 @@ case 'startpage': $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); + /* @var $module_handler XoopsModuleHandler */ $module_handler =& xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); - $moduleslist =& $module_handler->getList($criteria, true); + $moduleslist =& $module_handler->getNameList($criteria, true); $moduleslist['--'] = _MD_AM_NONE; $ele->addOptionArray($moduleslist); break; @@ -152,8 +153,9 @@ break; case 'module_cache': + /* @var $module_handler XoopsModuleHandler */ $module_handler =& xoops_gethandler('module'); - $modules =& $module_handler->getObjects(new Criteria('hasmain', 1), true); + $modules =& $module_handler->getObjectsArray(new Criteria('hasmain', 1), true); $currrent_val = $config[$i]->getConfValueForOutput(); $cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK); if (count($modules) > 0) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -72,8 +72,9 @@ } // Get installed modules + /* @var $module_handler XoopsModuleHandler */ $module_handler =& xoops_gethandler('module'); - $installed_mods =& $module_handler->getObjects(); + $installed_mods =& $module_handler->getObjectsArray(); $listed_mods = array(); foreach ($installed_mods as $module) { $listed_mods[] = $module->getVar('dirname'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -471,10 +471,11 @@ $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_BLOCKS_VISIBLE, 'visible', $this->getVar('visible'))); // Visible In $mod_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_VISIBLEIN, 'modules', $modules, 5, true); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); - $module_list = $module_handler->getList($criteria); + $module_list = $module_handler->getNameList($criteria); $module_list[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE; $module_list[0] = _AM_SYSTEM_BLOCKS_ALLPAGES; ksort($module_list); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -453,9 +453,9 @@ * Load a module from the database * * @param int $id ID of the module - * @return XoopsModule|false on fail + * @return XoopsModule|bool on fail */ - function get($id = null, $fields = null) + function getById($id = null) { static $_cachedModule_dirname; static $_cachedModule_mid; @@ -492,7 +492,7 @@ } else { $myts = MyTextSanitizer::getInstance(); $criteria = new Criteria('dirname', $myts->addSlashes($dirname)); - $modules = $this->getObjects($criteria); + $modules = $this->getObjectsArray($criteria); if (count($modules) == 1 && is_object($modules[0])) { $module = $modules[0]; } else { @@ -508,17 +508,18 @@ /** * Write a module to the database * - * @param XoopsModule &$module reference to a {@link XoopsModule} + * @param XoopsModule $module reference to a {@link XoopsModule} + * * @return bool */ - public function insert(XoopsObject $object, $force = true) + public function insertModule(XoopsModule &$module) { - if (!parent::insert($object)) { + if (!parent::insert($module)) { return false; } - $dirname = $object->getvar('dirname'); - $mid = $object->getvar('mid'); + $dirname = $module->getvar('dirname'); + $mid = $module->getvar('mid'); if (!empty($this->_cachedModule_dirname[$dirname])) { unset($this->_cachedModule_dirname[$dirname]); @@ -535,20 +536,20 @@ * @param XoopsModule &$module * @return bool */ - public function delete(XoopsObject $object, $force = false) + public function deleteModule(XoopsModule &$module) { - if (!parent::delete($object)) { + if (!parent::delete($module)) { return false; } // delete admin permissions assigned for this module - $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'module_admin' AND gperm_itemid = %u", $this->db->prefix('group_permission'), $object->getVar('mid')); + $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'module_admin' AND gperm_itemid = %u", $this->db->prefix('group_permission'), $module->getVar('mid')); $this->db->query($sql); // delete read permissions assigned for this module - $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'module_read' AND gperm_itemid = %u", $this->db->prefix('group_permission'), $object->getVar('mid')); + $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'module_read' AND gperm_itemid = %u", $this->db->prefix('group_permission'), $module->getVar('mid')); $this->db->query($sql); - $sql = sprintf("SELECT block_id FROM %s WHERE module_id = %u", $this->db->prefix('block_module_link'), $object->getVar('mid')); + $sql = sprintf("SELECT block_id FROM %s WHERE module_id = %u", $this->db->prefix('block_module_link'), $module->getVar('mid')); if ($result = $this->db->query($sql)) { $block_id_arr = array(); while ($myrow = $this->db->fetchArray($result)) { @@ -558,28 +559,28 @@ // loop through block_id_arr if (isset($block_id_arr)) { foreach ($block_id_arr as $i) { - $sql = sprintf("SELECT block_id FROM %s WHERE module_id != %u AND block_id = %u", $this->db->prefix('block_module_link'), $object->getVar('mid'), $i); + $sql = sprintf("SELECT block_id FROM %s WHERE module_id != %u AND block_id = %u", $this->db->prefix('block_module_link'), $module->getVar('mid'), $i); if ($result2 = $this->db->query($sql)) { if (0 < $this->db->getRowsNum($result2)) { // this block has other entries, so delete the entry for this module - $sql = sprintf("DELETE FROM %s WHERE (module_id = %u) AND (block_id = %u)", $this->db->prefix('block_module_link'), $object->getVar('mid'), $i); + $sql = sprintf("DELETE FROM %s WHERE (module_id = %u) AND (block_id = %u)", $this->db->prefix('block_module_link'), $module->getVar('mid'), $i); $this->db->query($sql); } else { // this block doesnt have other entries, so disable the block and let it show on top page only. otherwise, this block will not display anymore on block admin page! $sql = sprintf("UPDATE %s SET visible = 0 WHERE bid = %u", $this->db->prefix('newblocks'), $i); $this->db->query($sql); - $sql = sprintf("UPDATE %s SET module_id = -1 WHERE module_id = %u", $this->db->prefix('block_module_link'), $object->getVar('mid')); + $sql = sprintf("UPDATE %s SET module_id = -1 WHERE module_id = %u", $this->db->prefix('block_module_link'), $module->getVar('mid')); $this->db->query($sql); } } } } - if (!empty($this->_cachedModule_dirname[$object->getVar('dirname')])) { - unset($this->_cachedModule_dirname[$object->getVar('dirname')]); + if (!empty($this->_cachedModule_dirname[$module->getVar('dirname')])) { + unset($this->_cachedModule_dirname[$module->getVar('dirname')]); } - if (!empty($this->_cachedModule_mid[$object->getVar('mid')])) { - unset($this->_cachedModule_mid[$object->getVar('mid')]); + if (!empty($this->_cachedModule_mid[$module->getVar('mid')])) { + unset($this->_cachedModule_mid[$module->getVar('mid')]); } return true; } @@ -591,7 +592,7 @@ * @param boolean $id_as_key Use the ID as key into the array * @return array */ - public function getObjects(CriteriaElement $criteria = null, $id_as_key = false, $as_object = true) + public function getObjectsArray(CriteriaElement $criteria = null, $id_as_key = false) { $ret = array(); $limit = $start = 0; @@ -627,11 +628,10 @@ * if false, array keys will be module id * @return array */ - function getList(CriteriaElement $criteria = null, $dirname_as_key = false) + function getNameList(CriteriaElement $criteria = null, $dirname_as_key = false) { $ret = array(); - //TODO we could use getAll to save memory(trabis) - $modules = $this->getObjects($criteria, true); + $modules = $this->getObjectsArray($criteria, true); foreach (array_keys($modules) as $i) { if (!$dirname_as_key) { $ret[$i] = $modules[$i]->getVar('name'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -612,8 +612,9 @@ $class = get_class($this); if (!$modules_active = XoopsCache::read('system_modules_active')) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules_obj = $module_handler->getObjects(new Criteria('isactive', 1)); + $modules_obj = $module_handler->getObjectsArray(new Criteria('isactive', 1)); $modules_active = array(); foreach (array_keys($modules_obj) as $key) { $modules_active[] = $modules_obj[$key]->getVar('dirname'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/misc.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/misc.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/misc.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -181,8 +181,9 @@ $criteria->setStart($start); $onlines = $online_handler->getAll($criteria, null, false, false); $count = count($onlines); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules = $module_handler->getList(new Criteria('isactive', 1)); + $modules = $module_handler->getNameList(new Criteria('isactive', 1)); for ($i = 0; $i < $count; $i++) { if ($onlines[$i]['online_uid'] == 0) { $onlineUsers[$i]['user'] = ''; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -28,9 +28,9 @@ default: case "list": $fields = $profilefield_handler->getObjects(null, true, false); - + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules = $module_handler->getObjects(null, true); + $modules = $module_handler->getObjectsArray(null, true); $cat_handler = xoops_getmodulehandler('category'); $criteria = new CriteriaCompo(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -176,10 +176,11 @@ // Dynamic user profiles end if ($GLOBALS['xoopsModuleConfig']['profile_search']) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); $criteria->add(new Criteria('isactive', 1) ); - $modules = $module_handler->getObjects($criteria, true); + $modules = $module_handler->getObjectsArray($criteria, true); $mids = array_keys($modules); $myts = MyTextSanitizer::getInstance(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -80,13 +80,14 @@ $xoBreadCrumb->render(); // Initialize module handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $modules = $module_handler->getObjects(null, true); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); // Modules for blocks to be visible in - $display_list = $module_handler->getList($criteria); + $display_list = $module_handler->getNameList($criteria); unset($criteria); // Initialize blocks handler $block_handler = xoops_getHandler('block'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -78,8 +78,9 @@ if ($com_id > 0) { $comment = $comment_handler->get($com_id); if (is_object($comment)) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($comment->getVar('com_modid')); + $module = $module_handler->getById($comment->getVar('com_modid')); $comment_config = $module->getInfo('comments'); header('Location: '.XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$comment_config['pageName'].'?'.$comment_config['itemName'].'='.$comment->getVar('com_itemid').'&com_id='.$comment->getVar('com_id').'&com_rootid='.$comment->getVar('com_rootid').'&com_mode=thread&'.str_replace('&', '&', $comment->getVar('com_exparams')).'#comment'.$comment->getVar('com_id')); exit(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/groupperm.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/groupperm.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/groupperm.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -9,8 +9,9 @@ redirect_header(XOOPS_URL.'/index.php', 1, _NOPERM); exit(); } +/* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); -$module = $module_handler->get($modid); +$module = $module_handler->getById($modid); if (!is_object($module) || !$module->getVar('isactive')) { redirect_header(XOOPS_URL.'/admin.php', 1, _MODULENOEXIST); exit(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/maintenance/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/maintenance/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/maintenance/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -83,10 +83,11 @@ $dump_tray->addElement(new xoopsFormLabel(' '._AM_SYSTEM_MAINTENANCE_DUMP_OR.' ')); $ele = new XoopsFormSelect(' ', 'dump_modules', '', 7, true); - $module_handler = xoops_gethandler('module'); + /* @var $module_handler XoopsModuleHandler */ + $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); - $moduleslist = $module_handler->getList($criteria, true); + $moduleslist = $module_handler->getNameList($criteria, true); $ele->addOptionArray($moduleslist); $dump_tray->addElement($ele); $form_dump->addElement($dump_tray); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -72,11 +72,12 @@ $xoBreadCrumb->addTips( _AM_SYSTEM_MODULES_TIPS ); $xoBreadCrumb->render(); // Get Module Handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(); $criteria->setOrder('weight'); // Get all installed modules - $installed_mods = $module_handler->getObjects( $criteria ); + $installed_mods = $module_handler->getObjectsArray( $criteria ); $listed_mods = array(); $i = 0; $install_mods = array(); @@ -140,9 +141,10 @@ $xoBreadCrumb->addTips( _AM_SYSTEM_MODULES_TIPS ); $xoBreadCrumb->render(); // Get Module Handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); // Get all installed modules - $installed_mods = $module_handler->getObjects(); + $installed_mods = $module_handler->getObjectsArray(); foreach ( $installed_mods as $module ) { $install_mods[] = $module->getInfo('dirname'); } @@ -180,16 +182,17 @@ case 'order': // Get Module Handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); if ( isset($_POST['mod']) ) { $i=1; foreach ($_POST['mod'] as $order) { if( $order > 0 ) { - $module = $module_handler->get($order); + $module = $module_handler->getById($order); //Change order only for visible modules if ($module->getVar('weight') != 0) { $module->setVar('weight', $i); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $error=true; } $i++; @@ -245,15 +248,16 @@ case 'display': // Get module handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $block_handler = xoops_getHandler('block'); $module_id = system_CleanVars ( $_POST, 'mid', 0, 'int' ); if ( $module_id > 0 ) { - $module = $module_handler->get( $module_id ); + $module = $module_handler->getById( $module_id ); $old = $module->getVar('isactive'); // Set value $module->setVar('isactive', !$old ); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $error=true; } $blocks = $block_handler->getByModule($module_id); @@ -269,14 +273,15 @@ case 'display_in_menu': // Get module handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $module_id = system_CleanVars ( $_POST, 'mid', 0, 'int' ); if ( $module_id > 0 ) { - $module = $module_handler->get($module_id); + $module = $module_handler->getById($module_id); $old = $module->getVar('weight'); // Set value $module->setVar('weight', !$old ); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $error=true; } } @@ -491,7 +496,7 @@ $xoBreadCrumb->addLink( _AM_SYSTEM_MODULES_UPDATE ); $xoBreadCrumb->addHelp( system_adminVersion('modulesadmin', 'help') . '#update' ); $xoBreadCrumb->render(); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { echo '<p>Could not update '.$module->getVar('name').'</p>'; echo "<br /><div class='center'><a href='admin.php?fct=modulesadmin'>" . _AM_SYSTEM_MODULES_BTOMADMIN . "</a></div>"; } else { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -42,8 +42,10 @@ $dirname = trim($dirname); $db = $GLOBALS["xoopsDB"]; $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish'); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); if ($module_handler->getCount(new Criteria('dirname', $dirname)) == 0) { + /* @var $module XoopsModule */ $module = $module_handler->create(); $module->loadInfoAsVar($dirname); $module->setVar('weight', 1); @@ -140,7 +142,7 @@ } // if no error, save the module info and blocks info associated with it if ($error == false) { - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $errs[] = "<p>" . sprintf(_AM_SYSTEM_MODULES_INSERT_DATA_FAILD, "<strong>" . $module->getVar('name') . "</strong>"); foreach ($created_tables as $ct) { $db->query("DROP TABLE " . $db->prefix($ct)); @@ -478,6 +480,7 @@ global $xoopsConfig; $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish'); $db = XoopsDatabaseFactory::getDatabaseConnection(); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $module = $module_handler->getByDirname($dirname); include_once XOOPS_ROOT_PATH . '/class/template.php'; @@ -517,7 +520,7 @@ } } - if (false === $module_handler->delete($module)) { + if (false === $module_handler->deleteModule($module)) { $msgs[] = ' <span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_DELETE_ERROR, $module->getVar('name')) . '</span>'; } else { @@ -654,10 +657,11 @@ function xoops_module_activate( $mid ) { // Get module handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); /* @var $block_handler XoopsBlockHandler */ $block_handler = xoops_getHandler('block'); - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); include_once XOOPS_ROOT_PATH . '/class/template.php'; xoops_template_clear_module_cache($module->getVar('mid')); // Display header @@ -665,7 +669,7 @@ $msgs = $msgs + xoops_module_log_header( $module, _AM_SYSTEM_MODULES_ACTIVATE ); // Change value $module->setVar('isactive', 1); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $msgs[] = '<p>' . sprintf( _AM_SYSTEM_MODULES_FAILACT, '<strong>' . $module->getVar('name', 's') . '</strong>') . ' ' . _AM_SYSTEM_MODULES_ERRORSC . '<br />' . $module->getHtmlErrors() . '</p>'; } else { $blocks = $block_handler->getByModule($module->getVar('mid')); @@ -686,8 +690,9 @@ { global $xoopsConfig; // Get module handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); include_once XOOPS_ROOT_PATH . '/class/template.php'; xoops_template_clear_module_cache($mid); // Display header @@ -700,7 +705,7 @@ } elseif ($module->getVar('dirname') == $xoopsConfig['startpage']) { $msgs[] = '<p>' . sprintf(_AM_SYSTEM_MODULES_FAILDEACT, '<strong>' . $module->getVar('name') . '</strong>') . ' ' . _AM_SYSTEM_MODULES_ERRORSC . '<br /> - ' . _AM_SYSTEM_MODULES_STRTNO . '</p>'; } else { - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $msgs[] = '<p>' . sprintf(_AM_SYSTEM_MODULES_FAILDEACT, '<strong>' . $module->getVar('name') . '</strong>') . ' ' . _AM_SYSTEM_MODULES_ERRORSC . '<br />' . $module->getHtmlErrors() . '</p>'; } else { $blocks = $block_handler->getByModule($module->getVar('mid')); @@ -719,11 +724,12 @@ function xoops_module_change($mid, $name) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); $module->setVar('name', $name); $myts = MyTextSanitizer::getInstance(); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $ret = "<p>" . sprintf(_AM_SYSTEM_MODULES_FAILORDER, "<strong>" . $myts->stripSlashesGPC($name) . "</strong>") . " " . _AM_SYSTEM_MODULES_ERRORSC . "<br />"; $ret .= $module->getHtmlErrors() . "</p>"; return $ret; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -160,10 +160,11 @@ case 'startpage': $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); - $moduleslist = $module_handler->getList($criteria, true); + $moduleslist = $module_handler->getNameList($criteria, true); $moduleslist['--'] = _MD_AM_NONE; $ele->addOptionArray($moduleslist); break; @@ -186,8 +187,9 @@ break; case 'module_cache': + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules = $module_handler->getObjects(new Criteria('hasmain', 1), true); + $modules = $module_handler->getObjectsArray(new Criteria('hasmain', 1), true); $currrent_val = $config[$i]->getConfValueForOutput(); $cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK); if (count($modules) > 0) { @@ -257,8 +259,9 @@ redirect_header('admin.php?fct=preferences', 1); } $form = new XoopsThemeForm(_MD_AM_MODCONFIG, 'pref_form', 'admin.php?fct=preferences', 'post', true); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($mod); + $module = $module_handler->getById($mod); xoops_loadLanguage('modinfo', $module->getVar('dirname')); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -77,9 +77,10 @@ $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_TEMPLATES_FORCE_GENERATED, 'force_generated', 0, _YES, _NO), true); $modules = new XoopsFormSelect(_AM_SYSTEM_TEMPLATES_SELECT_MODULES, 'select_modules'); - $module_handler = xoops_gethandler('module'); + /* @var $module_handler XoopsModuleHandler */ + $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('isactive', 1)); - $moduleslist = $module_handler->getList($criteria, true); + $moduleslist = $module_handler->getNameList($criteria, true); $modules->addOption(0, _AM_SYSTEM_TEMPLATES_ALL_MODULES); $modules->addOptionArray($moduleslist); $form->addElement($modules, true); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -108,11 +108,12 @@ $block = array(); $block['lang_home'] = _MB_SYSTEM_HOME; $block['lang_close'] = _CLOSE; + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); $criteria->add(new Criteria('weight', 0, '>')); - $modules = $module_handler->getObjects($criteria, true); + $modules = $module_handler->getObjectsArray($criteria, true); $moduleperm_handler = xoops_gethandler('groupperm'); $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; $read_allowed = $moduleperm_handler->getItemIds('module_read', $groups); @@ -396,8 +397,9 @@ $comments = $comment_handler->getObjects($criteria, true); $member_handler = xoops_gethandler('member'); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules = $module_handler->getObjects(new Criteria('hascomments', 1), true); + $modules = $module_handler->getObjectsArray(new Criteria('hascomments', 1), true); $comment_config = array(); foreach (array_keys($comments) as $i) { $mid = $comments[$i]->getVar('com_modid'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -102,11 +102,12 @@ $a_mod_checkbox = new XoopsFormCheckBox( '', "admin_mids[]", $a_mod_value); $a_mod_checkbox->columns = 5; + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasadmin', 1)); $criteria->add(new Criteria('isactive', 1)); $criteria->add(new Criteria('dirname', 'system', '<>')); - $a_mod_checkbox->addOptionArray($module_handler->getList($criteria)); + $a_mod_checkbox->addOptionArray($module_handler->getNameList($criteria)); $admin_mids->addElement($a_mod_checkbox); $read_mids = new XoopsFormElementTray( _AM_SYSTEM_GROUPS_ACCESSRIGHTS, '' ); @@ -121,14 +122,14 @@ $r_mod_checkbox->columns = 5; $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); - $r_mod_checkbox->addOptionArray($module_handler->getList($criteria)); + $r_mod_checkbox->addOptionArray($module_handler->getNameList($criteria)); $read_mids->addElement($r_mod_checkbox); $criteria = new CriteriaCompo(new Criteria('isactive', 1)); $criteria->setSort("mid"); $criteria->setOrder("ASC"); - $module_list = $module_handler->getList($criteria); + $module_list = $module_handler->getNameList($criteria); $module_list[0] = _AM_SYSTEM_GROUPS_CUSTOMBLOCK; $block_handler = xoops_getHandler("block"); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/help.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/help.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/help.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -31,8 +31,9 @@ $xoBreadCrumb->addLink( _AM_SYSTEM_HELP, 'help.php' ); if ( $mid > 0 ) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); $xoBreadCrumb->addLink( $module->getVar('name'), 'help.php?mid=' . $module->getVar('mid', 's') ); $xoBreadCrumb->addLink( system_adminVersion( $page, 'name' ) ); @@ -97,11 +98,12 @@ } else { $xoBreadCrumb->render(); // Get Module Handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(); $criteria->setOrder('weight'); // Get all installed modules - $installed_mods = $module_handler->getObjects( $criteria ); + $installed_mods = $module_handler->getObjectsArray( $criteria ); $listed_mods = array(); $i = 0; $j = 0; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -41,9 +41,9 @@ } - function header() + function header($tpl_file = '') { - parent::header(); + parent::header($tpl_file); $xoops = Xoops::getInstance(); $tpl = $xoops->tpl; $xoTheme = $xoops->theme; @@ -141,12 +141,13 @@ $tpl->assign('moddir', $moddir); // add MODULES Menu items + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(); $criteria->add(new Criteria('hasadmin', 1)); $criteria->add(new Criteria('isactive', 1)); $criteria->setSort('mid'); - $mods = $module_handler->getObjects($criteria); + $mods = $module_handler->getObjectsArray($criteria); $menu = array(); /* @var $moduleperm_handler XoopsGrouppermHandler*/ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -68,6 +68,7 @@ $notifications = $notification_handler->getObjects($criteria); // Generate the info for the template + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); include_once $xoops->path('include/notification_functions.php'); $modules = array(); @@ -82,7 +83,7 @@ $prev_category = -1; $prev_item = -1; /* @var $module XoopsModule */ - $module = $module_handler->get($modid); + $module = $module_handler->getById($modid); $modules[$modid] = array( 'id' => $modid, 'name' => $module->getVar('name'), 'categories' => array() ); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -147,11 +147,12 @@ } switch ($action) { case "results": + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); $criteria->add(new Criteria('isactive', 1)); $criteria->add(new Criteria('mid', "(" . implode(',', $available_modules) . ")", 'IN')); - $modules = $module_handler->getObjects($criteria, true); + $modules = $module_handler->getObjectsArray($criteria, true); $mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array(); if (empty($mids) || !is_array($mids)) { unset($mids); @@ -226,8 +227,9 @@ case "showall": case 'showallbyuser': $xoops->header(); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); $results = $module->search($queries, $andor, 20, $start, $uid); $count = count($results); if (is_array($results) && $count > 0) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -160,6 +160,7 @@ if (!empty($date)) { $xoops->tpl->assign('user_lastlogin', formatTimestamp($date, "m")); } +/* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); $criteria->add(new Criteria('isactive', 1)); @@ -167,7 +168,7 @@ foreach ($mids as $mid) { if ($gperm_handler->checkRight('module_read', $mid, $groups)) { /* @var $module XoopsModule */ - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); $results = $module->search('', '', 5, 0, $thisUser->getVar('uid')); $count = count($results); if (is_array($results) && $count > 0) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/include/postcheck_functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/include/postcheck_functions.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/include/postcheck_functions.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -7,8 +7,9 @@ // patch for 2.2.x from xoops.org (I know this is not so beautiful...) if( substr( @XOOPS_VERSION , 6 , 3 ) > 2.0 && stristr( @$_SERVER['REQUEST_URI'] , 'modules/system/admin.php?fct=preferences' ) ) { - $module_handler = xoops_gethandler( 'module' ) ; - $module = $module_handler->get( intval( @$_GET['mod'] ) ) ; + /* @var $module_handler XoopsModuleHandler */ + $module_handler = xoops_gethandler( 'module' ) ; + $module = $module_handler->getById( intval( @$_GET['mod'] ) ) ; if( is_object( $module ) ) { $module->getInfo() ; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |