From: <tr...@us...> - 2011-10-29 19:12:48
|
Revision: 7995 http://xoops.svn.sourceforge.net/xoops/?rev=7995&view=rev Author: trabis Date: 2011-10-29 19:12:38 +0000 (Sat, 29 Oct 2011) Log Message: ----------- More refactoring... Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php XoopsCore/branches/2.6.x/2.6.0/htdocs/banners.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/mail/xoopsmultimailer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/rpc/xmlrpcapi.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtextdateselect.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.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_edit.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_new.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_post.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_reply.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_view.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/cp_header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/findusers.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/notification_select.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_update.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/xoopslocal.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/member.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.php XoopsCore/branches/2.6.x/2.6.0/htdocs/misc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/prune.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/class/message.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/pmlite.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/preloads/core.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/preloads/system.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/activate.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/category.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/deactivate.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/admin/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/permissions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/step.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/user.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/visibility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changemail.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changepass.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/field.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/profile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/regstep.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/footer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/include/forms.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/include/install.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/include/update.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/lostpass.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/register.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/search.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/user.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/avatars/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/banners/main.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/admin_header.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/groups/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/images/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/mailusers/main.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/smilies/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/admin/userrank/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/users/jquery.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/users/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/users/users.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin.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/avatar.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/banner.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/class/gui.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/maintenance.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/menu.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/users.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/header.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/include/update.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/menu.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/modules/system/themes/default/menu.php XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php XoopsCore/branches/2.6.x/2.6.0/htdocs/pmlite.php XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php XoopsCore/branches/2.6.x/2.6.0/htdocs/user.php XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/admin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/private/smarty/xoops_plugins/function.xoInboxCount.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/private/smarty/xoops_plugins/resource.db.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -353,9 +353,9 @@ $date = explode('/',$this->_obj->getInfo('release_date')); $author = explode(',',$this->_obj->getInfo('author')); $nickname = explode(',',$this->_obj->getInfo('nickname')); - $release_date = formatTimestamp(mktime(0, 0, 0, $date[1], $date[2], $date[0]), 's'); + $release_date = $xoops->formatTimestamp(mktime(0, 0, 0, $date[1], $date[2], $date[0]), 's'); $module_info = '<div id="about"><label>' . _AM_MODULEADMIN_ABOUT_DESCRIPTION . '</label><text>' . $this->_obj->getInfo("description") . '</text><br /> - <label>' . _AM_MODULEADMIN_ABOUT_UPDATEDATE . '</label><text class="bold">' . formatTimestamp($this->_obj->getVar("last_update"),"m") . '</text><br /> + <label>' . _AM_MODULEADMIN_ABOUT_UPDATEDATE . '</label><text class="bold">' . $xoops->formatTimestamp($this->_obj->getVar("last_update"),"m") . '</text><br /> <label>' . _AM_MODULEADMIN_ABOUT_MODULESTATUS . '</label><text>' . $this->_obj->getInfo("module_status") . '</text><br /> <label>' . _AM_MODULEADMIN_ABOUT_WEBSITE . '</label><text><a class="tooltip" href="http://' . $this->_obj->getInfo("module_website_url") . '" rel="external" title="'. $this->_obj->getInfo("module_website_name") . ' - ' . $this->_obj->getInfo("module_website_url") . '"> ' . $this->_obj->getInfo("module_website_name") . '</a></text></div>'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -16,9 +16,8 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; -xoops_loadLanguage('admin'); - $xoops = Xoops::getInstance(); +$xoops->loadLanguage('admin'); include_once $xoops->path('include/cp_functions.php'); /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -31,9 +31,9 @@ $tpl->assign('channel_title', XoopsLocal::convert_encoding(htmlspecialchars($xoops->config['sitename'], ENT_QUOTES))); $tpl->assign('channel_link', XOOPS_URL . '/'); $tpl->assign('channel_desc', XoopsLocal::convert_encoding(htmlspecialchars($xoops->config['slogan'], ENT_QUOTES))); - $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss')); - $tpl->assign('channel_webmaster', checkEmail($xoops->config['adminmail'], true)); - $tpl->assign('channel_editor', checkEmail($xoops->config['adminmail'], true)); + $tpl->assign('channel_lastbuild', $xoops->formatTimestamp(time(), 'rss')); + $tpl->assign('channel_webmaster', $xoops->checkEmail($xoops->config['adminmail'], true)); + $tpl->assign('channel_editor', $xoops->checkEmail($xoops->config['adminmail'], true)); $tpl->assign('channel_category', 'News'); $tpl->assign('channel_generator', 'XOOPS'); $tpl->assign('channel_language', _LANGCODE); @@ -61,7 +61,7 @@ 'title' => XoopsLocal::convert_encoding(htmlspecialchars($story->title(), ENT_QUOTES)), 'link' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), 'guid' => XOOPS_URL . '/modules/news/article.php?storyid=' . $story->storyid(), - 'pubdate' => formatTimestamp($story->published(), 'rss'), + 'pubdate' => $xoops->formatTimestamp($story->published(), 'rss'), 'description' => XoopsLocal::convert_encoding(htmlspecialchars($story->hometext(), ENT_QUOTES)) )); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/banners.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/banners.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/banners.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -22,9 +22,9 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; -xoops_loadLanguage('banners'); +$xoops = Xoops::getInstance(); +$xoops->loadLanguage('banners'); - /** * Function to let your client login to see the stats * @@ -218,15 +218,14 @@ <td>{$impressions}</td> <td>{$clicks}</td> <td>{$percent}%</td> - <td>" . formatTimestamp($datestart) . "</td> - <td>" . formatTimestamp($dateend) . "</td></tr></tbody>"; + <td>" . $xoops->formatTimestamp($datestart) . "</td> + <td>" . $xoops->formatTimestamp($dateend) . "</td></tr></tbody>"; } echo "</table></div>"; } $xoops->footer(); } else { - redirect_header("banners.php", 2); - exit(); + $xoops->redirect("banners.php", 2); } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -66,7 +66,11 @@ $this->_tpl = $tpl; $this->_useIcons = $use_icons; $this->_doIconCheck = $do_iconcheck; - $this->_statusText = array(XOOPS_COMMENT_PENDING => '<span style="text-decoration: none; font-weight: bold; color: #00ff00;">' . _CM_PENDING . '</span>', XOOPS_COMMENT_ACTIVE => '<span style="text-decoration: none; font-weight: bold; color: #ff0000;">' . _CM_ACTIVE . '</span>', XOOPS_COMMENT_HIDDEN => '<span style="text-decoration: none; font-weight: bold; color: #0000ff;">' . _CM_HIDDEN . '</span>'); + $this->_statusText = array( + XOOPS_COMMENT_PENDING => '<span style="text-decoration: none; font-weight: bold; color: #00ff00;">' . _CM_PENDING . '</span>', + XOOPS_COMMENT_ACTIVE => '<span style="text-decoration: none; font-weight: bold; color: #ff0000;">' . _CM_ACTIVE . '</span>', + XOOPS_COMMENT_HIDDEN => '<span style="text-decoration: none; font-weight: bold; color: #0000ff;">' . _CM_HIDDEN . '</span>' + ); } /** @@ -80,7 +84,8 @@ */ static public function instance(XoopsTpl &$tpl, $use_icons = true, $do_iconcheck = false) { - XoopsLogger::getInstance()->addDeprecated(__CLASS__ . "::" . __FUNCTION__ . "() is deprecated since 2.6.0, use XoopsCommentRenderer::getInstance() instead"); + XoopsLogger::getInstance() + ->addDeprecated(__CLASS__ . "::" . __FUNCTION__ . "() is deprecated since 2.6.0, use XoopsCommentRenderer::getInstance() instead"); return XoopsCommentRenderer::getInstance($tpl, $use_icons, $do_iconcheck); } @@ -119,6 +124,7 @@ */ public function renderFlatView($admin_view = false) { + $xoops = Xoops::getInstance(); foreach ($this->_comments as $i => $comment) { /* @var $comment XoopsComment */ if (false != $this->_useIcons) { @@ -138,7 +144,12 @@ } } $this->_comments[$i] = $comment; - $this->_tpl->append('comments', array('id' => $comment->getVar('com_id'), 'title' => $title, 'text' => $text, 'date_posted' => formatTimestamp($comment->getVar('com_created'), 'm'), 'date_modified' => formatTimestamp($comment->getVar('com_modified'), 'm'), 'poster' => $poster)); + $this->_tpl->append('comments', array( + 'id' => $comment->getVar('com_id'), 'title' => $title, 'text' => $text, + 'date_posted' => $xoops->formatTimestamp($comment->getVar('com_created'), 'm'), + 'date_modified' => $xoops->formatTimestamp($comment->getVar('com_modified'), 'm'), + 'poster' => $poster + )); } } @@ -153,6 +164,7 @@ */ public function renderThreadView($comment_id = 0, $admin_view = false, $show_nav = true) { + $xoops = Xoops::getInstance(); // construct comment tree $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid'); $tree = $xot->getTree(); @@ -189,7 +201,16 @@ $replies = array(); $this->_renderThreadReplies($tree, $comment_id, $replies, ' ', $admin_view); $show_replies = (count($replies) > 0) ? true : false; - $this->_tpl->append('comments', array('pid' => $tree[$comment_id]['obj']->getVar('com_pid'), 'id' => $tree[$comment_id]['obj']->getVar('com_id'), 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid'), 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, 'date_posted' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), 'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid')), 'replies' => $replies, 'show_replies' => $show_replies)); + $this->_tpl->append('comments', array( + 'pid' => $tree[$comment_id]['obj']->getVar('com_pid'), + 'id' => $tree[$comment_id]['obj']->getVar('com_id'), + 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid'), + 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, + 'date_posted' => $xoops->formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), + 'date_modified' => $xoops->formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), + 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid')), 'replies' => $replies, + 'show_replies' => $show_replies + )); } /** @@ -206,6 +227,7 @@ */ private function _renderThreadReplies($thread, $key, $replies, $prefix, $admin_view, $depth = 0, $current_prefix = '') { + $xoops = Xoops::getInstance(); if ($depth > 0) { if (false != $this->_useIcons) { $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')) . ' ' . $thread[$key]['obj']->getVar('com_title'); @@ -213,8 +235,14 @@ $title = $thread[$key]['obj']->getVar('com_title'); } $title = (false != $admin_view) - ? $title . ' ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] : $title; - $replies[] = array('id' => $key, 'prefix' => $current_prefix, 'date_posted' => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), 'title' => $title, 'root_id' => $thread[$key]['obj']->getVar('com_rootid'), 'status' => $this->_statusText[$thread[$key]['obj']->getVar('com_status')], 'poster' => $this->_getPosterName($thread[$key]['obj']->getVar('com_uid'))); + ? $title . ' ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] : $title; + $replies[] = array( + 'id' => $key, 'prefix' => $current_prefix, + 'date_posted' => $xoops->formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), 'title' => $title, + 'root_id' => $thread[$key]['obj']->getVar('com_rootid'), + 'status' => $this->_statusText[$thread[$key]['obj']->getVar('com_status')], + 'poster' => $this->_getPosterName($thread[$key]['obj']->getVar('com_uid')) + ); $current_prefix .= $prefix; } if (isset($thread[$key]['child']) && !empty($thread[$key]['child'])) { @@ -244,6 +272,7 @@ */ public function renderNestView($comment_id = 0, $admin_view = false) { + $xoops = Xoops::getInstance(); $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid'); $tree = $xot->getTree(); if (false != $this->_useIcons) { @@ -269,7 +298,15 @@ } $replies = array(); $this->_renderNestReplies($tree, $comment_id, $replies, 25, $admin_view); - $this->_tpl->append('comments', array('pid' => $tree[$comment_id]['obj']->getVar('com_pid'), 'id' => $tree[$comment_id]['obj']->getVar('com_id'), 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid'), 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, 'date_posted' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), 'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid')), 'replies' => $replies)); + $this->_tpl->append('comments', array( + 'pid' => $tree[$comment_id]['obj']->getVar('com_pid'), + 'id' => $tree[$comment_id]['obj']->getVar('com_id'), + 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid'), + 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, + 'date_posted' => $xoops->formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), + 'date_modified' => $xoops->formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), + 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid')), 'replies' => $replies + )); } /** @@ -285,6 +322,7 @@ */ private function _renderNestReplies($thread, $key, $replies, $prefix, $admin_view, $depth = 0) { + $xoops = Xoops::getInstance(); if ($depth > 0) { if (false != $this->_useIcons) { $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')) . ' ' . $thread[$key]['obj']->getVar('com_title'); @@ -292,9 +330,16 @@ $title = $thread[$key]['obj']->getVar('com_title'); } $text = (false != $admin_view) - ? $thread[$key]['obj']->getVar('com_text') . '<div style="text-align:right; margin-top: 2px; margin-right: 2px;">' . _CM_STATUS . ': ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] . '<br />IP: <span style="font-weight: bold;">' . $thread[$key]['obj']->getVar('com_ip') . '</span></div>' - : $thread[$key]['obj']->getVar('com_text'); - $replies[] = array('id' => $key, 'prefix' => $prefix, 'pid' => $thread[$key]['obj']->getVar('com_pid'), 'itemid' => $thread[$key]['obj']->getVar('com_itemid'), 'rootid' => $thread[$key]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, 'date_posted' => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), 'date_modified' => formatTimestamp($thread[$key]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($thread[$key]['obj']->getVar('com_uid'))); + ? $thread[$key]['obj']->getVar('com_text') . '<div style="text-align:right; margin-top: 2px; margin-right: 2px;">' . _CM_STATUS . ': ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] . '<br />IP: <span style="font-weight: bold;">' . $thread[$key]['obj']->getVar('com_ip') . '</span></div>' + : $thread[$key]['obj']->getVar('com_text'); + $replies[] = array( + 'id' => $key, 'prefix' => $prefix, 'pid' => $thread[$key]['obj']->getVar('com_pid'), + 'itemid' => $thread[$key]['obj']->getVar('com_itemid'), + 'rootid' => $thread[$key]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, + 'date_posted' => $xoops->formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), + 'date_modified' => $xoops->formatTimestamp($thread[$key]['obj']->getVar('com_modified'), 'm'), + 'poster' => $this->_getPosterArray($thread[$key]['obj']->getVar('com_uid')) + ); $prefix = $prefix + 25; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -276,27 +276,27 @@ /** * @var string */ - protected $prefix; + public $prefix; /** * @var string */ - protected $function; + public $function; /** * @var string */ - protected $column; + public $column; /** * @var string */ - protected $operator; + public $operator; /** * @var mixed */ - protected $value; + public $value; /** * Constructor Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/mail/xoopsmultimailer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/mail/xoopsmultimailer.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/mail/xoopsmultimailer.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -122,9 +122,7 @@ public function __construct() { $xoops = Xoops::getInstance(); - /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $xoopsMailerConfig = $config_handler->getConfigsByCat(XOOPS_CONF_MAILER); + $xoopsMailerConfig = $xoops->getConfigs(XOOPS_CONF_MAILER); $this->From = $xoopsMailerConfig['from']; if ($this->From == '') { $this->From = $xoops->config['adminmail']; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/rpc/xmlrpcapi.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/rpc/xmlrpcapi.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/rpc/xmlrpcapi.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -57,7 +57,6 @@ var $isadmin = false; - function XoopsXmlRpcApi(&$params, &$response, &$module) { $this->params = $params; @@ -75,16 +74,17 @@ function _checkUser($username, $password) { + $xoops = Xoops::getInstance(); if (isset($this->user)) { return true; } - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getMemberHandler(); $this->user = $member_handler->loginUser(addslashes($username), addslashes($password)); if (!is_object($this->user)) { unset($this->user); return false; } - $moduleperm_handler = xoops_gethandler('groupperm'); + $moduleperm_handler = $xoops->getGrouppermHandler(); if (!$moduleperm_handler->checkRight('module_read', $this->module->getVar('mid'), $this->user->getGroups())) { unset($this->user); return false; @@ -149,7 +149,7 @@ { $ret = ''; $match = array(); - if (preg_match("/\<".$tag."\>(.*)\<\/".$tag."\>/is", $text, $match)) { + if (preg_match("/\<" . $tag . "\>(.*)\<\/" . $tag . "\>/is", $text, $match)) { if ($remove) { $text = str_replace($match[0], '', $text); } @@ -163,11 +163,12 @@ function _getXoopsApi(&$params) { if (strtolower(get_class($this)) != 'xoopsapi') { - require_once(XOOPS_ROOT_PATH.'/class/xml/rpc/xoopsapi.php'); + require_once(XOOPS_ROOT_PATH . '/class/xml/rpc/xoopsapi.php'); return new XoopsApi($params, $this->response, $this->module); } else { return $this; } } } + ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -683,7 +683,7 @@ * @param string|null $name * @param string|null $module_dir * @param bool $optional - * @return bool + * @return XoopsObjectHandler|XoopsPersistableObjectHandler|bool */ public function getHandler($name = null, $module_dir = null, $optional = false) { @@ -796,8 +796,7 @@ */ public function setActiveModules() { - /* @var $module_handler XoopsModuleHandler */ - $module_handler = xoops_gethandler('module'); + $module_handler = Xoops::getInstance()->getModuleHandler(); $modules_active = $module_handler->getAll(new Criteria('isactive', 1), array('dirname'), false, false); XoopsCache::write('system_modules_active', $modules_active); return $modules_active; @@ -823,9 +822,8 @@ */ public function simpleHeader($closehead = true) { - /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $xoopsConfigMetaFooter = $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER); + $xoops = Xoops::getInstance(); + $xoopsConfigMetaFooter = $xoops->getConfigs(XOOPS_CONF_METAFOOTER); if (!headers_sent()) { header('Content-Type:text/html; charset=' . _CHARSET); @@ -1242,9 +1240,9 @@ public function getCss($theme = '') { if ($theme == '') { - $theme = $this->config['theme_set']; + $theme = $this->getConfig('theme_set'); } - $uagent = xoops_getenv('HTTP_USER_AGENT'); + $uagent = $this->getEnv('HTTP_USER_AGENT'); if (stristr($uagent, 'mac')) { $str_css = 'styleMAC.css'; } elseif (preg_match("/MSIE ([0-9]\.[0-9]{1,2})/i", $uagent)) { @@ -1380,9 +1378,8 @@ function getConfigs($type = 'XOOPS_CONF') { - /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $configs = $config_handler->getConfigsByCat((is_array($type)) ? $type : constant($type)); + $configs = $this->getConfigHandler()->getConfigsByCat((is_array($type)) ? $type : (!defined($type) ? $type + : constant($type))); $this->_systemConfigs = array_merge($this->_systemConfigs, $configs); $this->config =& $this->_systemConfigs; //for compatibilty return $this->_systemConfigs; @@ -1444,13 +1441,9 @@ } $this->_moduleConfigs[$dirname] = array(); - /* @var $module_handler XoopsModuleHandler */ - $module_handler = xoops_gethandler('module'); - $module = $module_handler->getByDirname($dirname); - /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); + $module = $this->getModuleHandler()->getByDirname($dirname); if (is_object($module)) { - $this->_moduleConfigs[$dirname] = $config_handler->getConfigsByCat(0, $module->getVar('mid')); + $this->_moduleConfigs[$dirname] = $this->getConfigHandler()->getConfigsByCat(0, $module->getVar('mid')); } if ($this->isModule()) { $this->moduleConfig =& $this->_moduleConfigs[$module->getVar('dirname')]; @@ -1562,7 +1555,8 @@ */ public function templateTouch($tpl_id, $clear_old = true) { - $tplfile_handler = xoops_gethandler('tplfile'); + $xoops = Xoops::getInstance(); + $tplfile_handler = $xoops->getTplfileHandler(); $tplfile = $tplfile_handler->get($tpl_id); if (is_object($tplfile)) { @@ -1676,7 +1670,7 @@ } } - $member_handler = xoops_gethandler('member'); + $member_handler = $this->getMemberHandler(); foreach ($deleted_num as $user_id => $post_num) { // update user posts /* @var $member_handler XoopsMemberHandler */ @@ -1706,7 +1700,7 @@ return false; } /* @var $gperm_handler XoopsGrouppermHandler */ - $gperm_handler = xoops_gethandler('groupperm'); + $gperm_handler = $this->getGrouppermHandler(); return $gperm_handler->deleteByModule($module_id, $perm_name, $item_id); } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtextdateselect.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtextdateselect.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtextdateselect.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -50,7 +50,7 @@ $display_value = date("Y-m-d", $ele_value); } - $jstime = formatTimestamp($ele_value, 'F j Y, H:i:s'); + $jstime = XoopsLocal::formatTimestamp($ele_value, 'F j Y, H:i:s'); include_once XOOPS_ROOT_PATH . '/include/calendarjs.php'; return "<input type='text' name='" . $ele_name . "' id='" . $ele_name . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $display_value . "'" . $this->getExtra() . " /><input type='reset' value=' ... ' onclick='return showCalendar(\"" . $ele_name . "\");'>"; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -269,7 +269,8 @@ */ static function getCountryList() { - xoops_loadLanguage('countries'); + $xoops = Xoops::getInstance(); + $xoops->loadLanguage('countries'); $country_list = array( "" => "-", "AD" => _COUNTRY_AD, "AE" => _COUNTRY_AE, "AF" => _COUNTRY_AF, "AG" => _COUNTRY_AG, "AI" => _COUNTRY_AI, "AL" => _COUNTRY_AL, "AM" => _COUNTRY_AM, "AN" => _COUNTRY_AN, "AO" => _COUNTRY_AO, Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -150,7 +150,7 @@ */ public function checkReferer($docheck = 1) { - $ref = xoops_getenv('HTTP_REFERER'); + $ref = Xoops::getInstance()->getEnv('HTTP_REFERER'); if ($docheck == 0) { return true; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -21,7 +21,7 @@ $xoops = Xoops::getInstance(); $xoops->preload->triggerEvent('core.edituser.start'); -xoops_loadLanguage('user'); +$xoops->loadLanguage('user'); // If not a user, redirect if (!$xoops->isUser()) { @@ -184,7 +184,7 @@ XOOPS_COMMENT_NEW1ST => _NEWESTFIRST)); // RMV-NOTIFY // TODO: add this to admin user-edit functions... - xoops_loadLanguage('notification'); + $xoops->loadLanguage('notification'); include_once $xoops->path('include/notification_constants.php'); $notify_method_select = new XoopsFormSelect(_NOT_NOTIFYMETHOD, 'notify_method', $xoops->user->getVar('notify_method')); $notify_method_select->addOptionArray(array( 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-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -38,18 +38,15 @@ } 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'); - $module = $module_handler->getById($comment->getVar('com_modid')); + $comment = $xoops->getCommentHandler()->get($com_id); + $module = $xoops->getModuleHandler()->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'; $moddir = $module->getVar('dirname'); unset($comment); } else { - if (XOOPS_COMMENT_APPROVENONE == $xoops->moduleConfig['com_rule']) { + if (XOOPS_COMMENT_APPROVENONE == $xoops->getModuleConfig('com_rule')) { exit(); } $comment_config = $xoops->module->getInfo('comments'); @@ -82,8 +79,7 @@ /* @var $xoopsUser XoopsUser */ if (!$xoops->user->isAdmin($com_modid)) { include_once $xoops->path('modules/system/constants.php'); - /* @var $sysperm_handler XoopsGrouppermHandler */ - $sysperm_handler = xoops_gethandler('groupperm'); + $sysperm_handler = $xoops->getGrouppermHandler(); if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, $xoops->user->getGroups())) { $accesserror = true; } @@ -91,25 +87,24 @@ } if (false != $accesserror) { - $ref = xoops_getenv('HTTP_REFERER'); + $ref = $xoops->getEnv('HTTP_REFERER'); if ($ref != '') { - redirect_header($ref, 2, _NOPERM); + $xoops->redirect($ref, 2, _NOPERM); } else { - redirect_header($redirect_page . '?' . $comment_config['itemName'] . '=' . intval($com_itemid), 2, _NOPERM); + $xoops->redirect($redirect_page . '?' . $comment_config['itemName'] . '=' . intval($com_itemid), 2, _NOPERM); } - exit(); } -xoops_loadLanguage('comment'); +$xoops->loadLanguage('comment'); switch ($op) { case 'delete_one': /* @var $comment_handler XoopsCommentHandler */ - $comment_handler = xoops_gethandler('comment'); + $comment_handler = $xoops->getCommentHandler(); /* @var $comment XoopsComment */ $comment = $comment_handler->get($com_id); if (!$comment_handler->delete($comment)) { $xoops->header(); - xoops_error(_CM_COMDELETENG . ' (ID: ' . $comment->getVar('com_id') . ')'); + $xoops->error(_CM_COMDELETENG . ' (ID: ' . $comment->getVar('com_id') . ')'); $xoops->footer(); } @@ -141,8 +136,7 @@ // update user posts if its not an anonymous post if ($comment->getVar('com_uid') != 0) { - /* @var $member_handler XoopsMemberHandler */ - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getMemberHandler(); $com_poster = $member_handler->getUser($comment->getVar('com_uid')); if (is_object($com_poster)) { $member_handler->updateUserByField($com_poster, 'posts', $com_poster->getVar('posts') - 1); @@ -206,7 +200,7 @@ $child_comments[$com_id] = $comment; $msgs = array(); $deleted_num = array(); - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getMemberHandler(); foreach (array_keys($child_comments) as $i) { if (!$comment_handler->delete($child_comments[$i])) { $msgs[] = _CM_COMDELETENG . ' (ID: ' . $child_comments[$i]->getVar('com_id') . ')'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_edit.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_edit.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_edit.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -29,7 +29,7 @@ redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM); } -xoops_loadLanguage('comment'); +$xoops->loadLanguage('comment'); $com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0; $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : ''; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_new.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_new.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_new.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -26,7 +26,7 @@ redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM); } -xoops_loadLanguage('comment'); +$xoops->loadLanguage('comment'); $com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0; if ($com_itemid > 0) { 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-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_post.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -23,19 +23,15 @@ include_once $xoops->path('include/comment_constants.php'); -xoops_loadLanguage('comment'); +$xoops->loadLanguage('comment'); if ('system' == $xoops->module->getVar('dirname')) { $com_id = isset($_POST['com_id']) ? intval($_POST['com_id']) : 0; if (empty($com_id)) { exit(); } - $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->getById($comment->getVar('com_modid')); + $comment = $xoops->getCommentHandler()->get($com_id); + $module = $xoops->getModuleHandler()->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'; @@ -43,7 +39,7 @@ unset($comment); } else { $com_id = isset($_POST['com_id']) ? intval($_POST['com_id']) : 0; - if (XOOPS_COMMENT_APPROVENONE == $xoops->moduleConfig['com_rule']) { + if (XOOPS_COMMENT_APPROVENONE == $xoops->getModuleConfig('com_rule')) { exit(); } $comment_config = $xoops->module->getInfo('comments'); @@ -116,8 +112,7 @@ if ($xoops->isUser()) { if (!$xoops->user->isAdmin($com_modid)) { include_once $xoops->path('modules/system/constants.php'); - /* @var $sysperm_handler XoopsGrouppermHandler */ - $sysperm_handler = xoops_gethandler('groupperm'); + $sysperm_handler = $xoops->getGrouppermHandler(); if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, $xoops->user->getGroups())) { $dohtml = 0; } @@ -166,7 +161,7 @@ if ($xoops->isUser()) { include_once $xoops->path('modules/system/constants.php'); - $sysperm_handler = xoops_gethandler('groupperm'); + $sysperm_handler = $xoops->getGrouppermHandler(); if ($xoops->user->isAdmin($com_modid) || $sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, $xoops->user->getGroups())) { if (!empty($com_status) && $com_status != XOOPS_COMMENT_PENDING) { $old_com_status = $comment->getVar('com_status'); @@ -212,10 +207,10 @@ $comment->setVar('com_pid', $com_pid); $comment->setVar('com_itemid', $com_itemid); $comment->setVar('com_rootid', $com_rootid); - $comment->setVar('com_ip', xoops_getenv('REMOTE_ADDR')); + $comment->setVar('com_ip', $xoops->getEnv('REMOTE_ADDR')); if ($xoops->isUser()) { include_once $xoops->path('modules/system/constants.php'); - $sysperm_handler = xoops_gethandler('groupperm'); + $sysperm_handler = $xoops->getGrouppermHandler(); if ($xoops->user->isAdmin($com_modid) || $sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, $xoops->user->getGroups())) { $comment->setVar('com_status', XOOPS_COMMENT_ACTIVE); $add_userpost = true; @@ -355,8 +350,7 @@ // increment user post if needed $uid = $comment->getVar('com_uid'); if ($uid > 0 && false != $add_userpost) { - /* @var $member_handler XoopsMemberHandler */ - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getMemberHandler(); $poster = $member_handler->getUser($uid); if ($poster instanceof XoopsUser) { $member_handler->updateUserByField($poster, 'posts', $poster->getVar('posts') + 1); @@ -378,8 +372,7 @@ $comment_tags = array(); if ('system' == $xoops->module->getVar('dirname')) { /* @var $module_handler XoopsModuleHandler */ - $module_handler = xoops_gethandler('module'); - $not_module = $module_handler->getById($not_modid); + $not_module = $xoops->getModuleHandler()->getById($not_modid); } else { $not_module = $xoops->module; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_reply.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_reply.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_reply.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -27,7 +27,7 @@ redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM); } -xoops_loadLanguage('comment'); +$xoops->loadLanguage('comment'); $com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0; $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : ''; @@ -50,7 +50,7 @@ $comment_handler = xoops_gethandler('comment'); $comment = $comment_handler->get($com_id); $r_name = XoopsUser::getUnameFromId($comment->getVar('com_uid')); -$r_text = _CM_POSTER . ': <strong>' . $r_name . '</strong> ' . _CM_POSTED . ': <strong>' . formatTimestamp($comment->getVar('com_created')) . '</strong><br /><br />' . $comment->getVar('com_text'); +$r_text = _CM_POSTER . ': <strong>' . $r_name . '</strong> ' . _CM_POSTED . ': <strong>' . XoopsLocal::formatTimestamp($comment->getVar('com_created')) . '</strong><br /><br />' . $comment->getVar('com_text'); $com_title = $comment->getVar('com_title', 'E'); if (!preg_match("/^" . _RE . "/i", $com_title)) { $com_title = _RE . " " . xoops_substr($com_title, 0, 56); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_view.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_view.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_view.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -27,12 +27,11 @@ if (XOOPS_COMMENT_APPROVENONE != $xoops->moduleConfig['com_rule']) { include_once $xoops->path('modules/system/constants.php'); - /* @var $gperm_handler XoopsGrouppermHandler */ - $gperm_handler = xoops_gethandler('groupperm'); + $gperm_handler = $xoops->getGrouppermHandler(); $groups = $xoops->isUser() ? $xoops->user->getGroups() : XOOPS_GROUP_ANONYMOUS; $xoops->tpl->assign('xoops_iscommentadmin', $gperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, $groups)); - xoops_loadLanguage('comment'); + $xoops->loadLanguage('comment'); $comment_config = $xoopsModule->getInfo('comments'); $com_itemid = (trim($comment_config['itemName']) != '' && isset($_GET[$comment_config['itemName']])) ? intval($_GET[$comment_config['itemName']]) : 0; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/cp_header.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/cp_header.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/cp_header.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -23,39 +23,26 @@ include_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'mainfile.php'; -xoops_loadLanguage('admin'); - $xoops = Xoops::getInstance(); +$xoops->loadLanguage('admin'); include_once $xoops->path('include/cp_functions.php'); -/* @var $moduleperm_handler XoopsGrouppermHandler */ -$moduleperm_handler = xoops_gethandler('groupperm'); +$moduleperm_handler = $xoops->getGrouppermHandler(); if ($xoops->isUser()) { $url_arr = explode('/', strstr($_SERVER['REQUEST_URI'], '/modules/')); - /* @var $module_handler XoopsModuleHandler */ - $module_handler = xoops_gethandler('module'); - $xoops->module = $module_handler->getByDirname($url_arr[2]); + $xoops->module = $xoops->getModuleHandler()->getByDirname($url_arr[2]); unset($url_arr); if (!$moduleperm_handler->checkRight('module_admin', $xoops->module->getVar('mid'), $xoops->user->getGroups())) { - redirect_header(XOOPS_URL, 1, _NOPERM); - exit(); + $xoops->redirect(XOOPS_URL, 1, _NOPERM); } } else { - redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM); - exit(); + $xoops->redirect(XOOPS_URL . '/user.php', 1, _NOPERM); } // set config values for this module if ($xoops->module->getVar('hasconfig') == 1 || $xoops->module->getVar('hascomments') == 1) { - /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $xoops->moduleConfig = $config_handler->getConfigsByCat(0, $xoops->module->getVar('mid')); + $xoops->moduleConfig = $xoops->getModuleConfigs(); } // include the default language file for the admin interface -if (file_exists($file = $xoops->path('modules/' . $xoops->module->getVar('dirname') . '/language/' . $xoops->config['language'] . '/admin.php'))) { - include_once $file; -} else if (file_exists($file = $xoops->path('modules/' . $xoops->module->getVar('dirname') . '/language/english/admin.php'))) { - include_once $file; -} -?> \ No newline at end of file +$xoops->loadLanguage('admin', $xoops->module->getVar('dirname')); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/findusers.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/findusers.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/findusers.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -40,7 +40,7 @@ $name_userid = 'uid' . (!empty($_REQUEST['multiple']) ? '[]' : ''); $name_username = 'uname' . (!empty($_REQUEST['multiple']) ? '[]' : ''); -xoops_loadLanguage('findusers'); +$xoops->loadLanguage('findusers'); //todo Move this classes to kernel @@ -407,7 +407,7 @@ 3 => _MA_USER_LEVEL_DISABLED); $level_radio->addOptionArray($levels); - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getMemberHandler(); $groups = $member_handler->getGroupList(); $groups[0] = _ALL; $group_select = new XoopsFormSelect(_MA_USER_GROUP, 'groups', @$_POST['groups'], 3, true); 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-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -26,7 +26,7 @@ function xoops_getHandler($name, $optional = false) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated('xoops_getHandler(\'' . $name . '\') is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $method = 'get' . ucfirst(strtolower(trim($name))) . 'Handler'; return $xoops->$method($optional); } 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-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -39,13 +39,9 @@ if (!isset($module_id)) { return false; } - /* @var $module_handler XoopsModuleHandler */ - $module_handler = xoops_gethandler('module'); - $module = $module_handler->getById($module_id); + $module = $xoops->getModuleHandler()->getById($module_id); if (!empty($module) && $module->getVar('hasnotification') == 1) { - /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $config = $config_handler->getConfigsByCat(0, $module_id); + $config = $xoops->getConfigHandler()->getConfigsByCat(0, $module_id); $status = $config['notification_enabled']; } else { return false; @@ -79,9 +75,7 @@ if (!isset($module_id)) { $module = $xoops->module; } else { - /* @var $module_handler XoopsModuleHandler */ - $module_handler = xoops_gethandler('module'); - $module = $module_handler->getById($module_id); + $module = $xoops->getModuleHandler()->getById($module_id); } $not_config = $module->getInfo('notification'); if (empty($category_name)) { @@ -148,9 +142,7 @@ $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->getById($module_id); + $module = $xoops->getModuleHandler()->getById($module_id); } $not_config = $module->getInfo('notification'); /* @var $config_handler XoopsConfigHandler */ @@ -186,7 +178,7 @@ } } - xoops_loadLanguage('notification'); + $xoops->loadLanguage('notification'); // Insert comment info if applicable if ($module->getVar('hascomments')) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_select.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_select.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_select.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -25,7 +25,7 @@ $xoops_notification = array(); $xoops_notification['show'] = $xoops->isModule() && $xoops->isUser() && notificationEnabled('inline') ? 1 : 0; if ($xoops_notification['show']) { - xoops_loadLanguage('notification'); + $xoops->loadLanguage('notification'); $categories = notificationSubscribableCategoryInfo(); $event_count = 0; if (!empty($categories)) { @@ -55,7 +55,7 @@ $xoops_notification['categories'][$category['name']] = $section; } $xoops_notification['target_page'] = 'notification_update.php'; - $xoops_notification['redirect_script'] = xoops_getenv('PHP_SELF'); + $xoops_notification['redirect_script'] = $xoops->getEnv('PHP_SELF'); $xoops->tpl->assign(array( 'lang_activenotifications' => _NOT_ACTIVENOTIFICATIONS, 'lang_notificationoptions' => _NOT_NOTIFICATIONOPTIONS, 'lang_updateoptions' => _NOT_UPDATEOPTIONS, Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_update.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_update.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_update.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -40,7 +40,7 @@ include_once $xoops->path('include/notification_constants.php'); include_once $xoops->path('include/notification_functions.php'); -xoops_loadLanguage('notification'); +$xoops->loadLanguage('notification'); if (!isset($_POST['not_submit'])) { redirect_header($_POST['not_redirect'], 3, _NOPERM); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/xoopslocal.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/xoopslocal.php 2011-10-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/xoopslocal.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -31,7 +31,8 @@ } require_once Xoops::getInstance()->path('class/xoopslocal.php'); //XoopsLocal is inside language file, let us load it - xoops_loadLanguage('locale'); + $xoops = Xoops::getInstance(); + $xoops->loadLanguage('locale'); return true; } 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-29 18:50:43 UTC (rev 7994) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-29 19:12:38 UTC (rev 7995) @@ -384,7 +384,7 @@ } // must get lang files b4 including the file // some modules require it for code that is outside the function - xoops_loadLanguage('blocks', $this->getVar('dirname')); + $xoops->loadLanguage('blocks', $this->getVar('dirname')); include_once $func_file; if (function_exists($show_func)) { @@ -415,7 +415,7 @@ public function getForm($mode = 'edit') { $xoops = Xoops::getInstance(); - xoops_loadLanguage('blocks', 'system'); + $xoops->loadLanguage('blocks', 'system'); if ($this->isNew()) { $title = _AM_SYSTEM_BLOCKS_ADDBLOCK; $modules = array(-1); @@ -426,15 +426,14 @@ } else { // Search modules /* @var $blocklinkmodule_handler SystemBlocklinkmoduleHandler */ - $blocklinkmodule_handler = xoops_getModuleHandler('blocklinkmodule', 'system'); + $blocklinkmodule_handler = $xoops->getHandler('blocklinkmodule', 'system'); $criteria = new CriteriaCompo(new Criteria('block_id', $this->getVar('bid'))); $blocklinkmodule = $blocklinkmodule_handler->getObjects($criteria); foreach ($blocklinkmodule as $link) { $modules[] = $link->getVar('module_id'); } // Search perms - /* @var $groupperm_handler XoopsGrouppermHandler */ - $groupperm_handler = xoops_gethandler('groupperm'); + $gro... [truncated message content] |