From: <tr...@us...> - 2012-12-07 00:56:20
|
Revision: 10328 http://sourceforge.net/p/xoops/svn/10328 Author: trabis Date: 2012-12-07 00:56:07 +0000 (Fri, 07 Dec 2012) Log Message: ----------- -Changing $xoops->tpl, $xoops->preload, $xoops->theme, $xoops->security,$xoops->db, $xoops->registry to use get method ie: $xoops->db() This will allow to lazy load this services, allow latter modification of the bootstrap, implementation of events, etc - Removing almost all $GLOBALS left in the core. There are some left but they need extended review. -some bug fixes -xtranslate implementation on the XoopsLocal::convert_encoding and replacing define in template for $smarty variable -XoopsPreload now loads system preloads in the case that the cache file for active modules is missing -XoopsLogger is now using preload events instead of being directly called Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/extras/altsys_functions.php XoopsCore/branches/2.6.x/2.6.0/extras/modules/system/admin/filemanager/jquery.php XoopsCore/branches/2.6.x/2.6.0/extras/modules/system/admin/filemanager/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.ini.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/object.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/class/database/database.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/databasefactory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/manager.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/mysqldatabase.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/preload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/form.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcolorpicker.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdhtmltextarea.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhiddentoken.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectuser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtabtray.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtextdateselect.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslocal.php XoopsCore/branches/2.6.x/2.6.0/htdocs/comments.php XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/examples/form.php XoopsCore/branches/2.6.x/2.6.0/htdocs/footer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/imagemanager.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_view.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/cp_functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/findusers.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/formdhtmltextarea_preview.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/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/site-closed.php XoopsCore/branches/2.6.x/2.6.0/htdocs/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/class/pathcontroller.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/common.inc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/install_tpl.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/language/english/finish.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/language/english/welcome.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_configsave.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_configsite.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_dbconnection.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_dbsettings.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_end.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_extensioninstaller.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_langselect.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_modcheck.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_pathsettings.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_siteinit.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_start.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_tablescreate.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_tablesfill.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_theme.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/session.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.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/avatars/admin/avatar_custom.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/admin/avatar_system.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/include/install.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/banners.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/clients.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/bannerrender.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/include/install.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/admin/send_mails.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/center.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/admin/dump.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/content.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/permissions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/admin/related.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/blocks/page_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/page_content.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/class/page_related.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/include/search.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/page/rating.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/include/install.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/include/update.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/language/english/main.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/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/admin/category.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/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/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/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/protector/admin/advisory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/admin/center.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/admin/prefix_manager.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/ProtectorFilter.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/gtickets.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/protector.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_deny_by_rbl.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/include/postcheck_functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/smilies/admin/smilies.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/extensions/main.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/modulesadmin/main.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/jquery.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/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/menu.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/systembreadcrumb.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/functions.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/preloads/core.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/system_extensions.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/system_modules.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_imagemanager.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_imagemanager2.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_notification_select.html 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/modules/userrank/admin/userrank.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/api.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/blocks/xlanguage_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/class/xlanguage.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/include/vars.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xlanguage/preloads/core.php XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php XoopsCore/branches/2.6.x/2.6.0/htdocs/pda.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/themes/default/theme_onload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/themes/default/xotpl/theme_language.html 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/Xoops/Pdf.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/smarty/xoops_plugins/function.block.php XoopsCore/branches/2.6.x/2.6.0/upgrade/abstract.php XoopsCore/branches/2.6.x/2.6.0/upgrade/cnt-2.2.x-to-2.3.0/index.php XoopsCore/branches/2.6.x/2.6.0/upgrade/index.php XoopsCore/branches/2.6.x/2.6.0/upgrade/login.php XoopsCore/branches/2.6.x/2.6.0/upgrade/upd-2.0.13-to-2.0.14/index.php XoopsCore/branches/2.6.x/2.6.0/upgrade/upd-2.0.15-to-2.0.16/index.php XoopsCore/branches/2.6.x/2.6.0/upgrade/upd-2.0.16-to-2.0.17/index.php XoopsCore/branches/2.6.x/2.6.0/upgrade/upd-2.0.17-to-2.0.18/index.php XoopsCore/branches/2.6.x/2.6.0/upgrade/upd-2.0.18-to-2.3.0/index.php XoopsCore/branches/2.6.x/2.6.0/upgrade/upd-2.0.18-to-2.3.0/settings_db.php XoopsCore/branches/2.6.x/2.6.0/upgrade/upd-2.3.0-to-2.3.1/index.php XoopsCore/branches/2.6.x/2.6.0/upgrade/upd-2.3.3-to-2.4.0/index.php XoopsCore/branches/2.6.x/2.6.0/upgrade/upd-2.4.0a-to-2.4.0/index.php XoopsCore/branches/2.6.x/2.6.0/upgrade/upd-2.4.x-to-2.5.0/index.php XoopsModules/publisher/trunk/publisher/class/category.php XoopsModules/publisher/trunk/publisher/class/file.php XoopsModules/publisher/trunk/publisher/class/item.php XoopsModules/publisher/trunk/publisher/class/mimetype.php Modified: XoopsCore/branches/2.6.x/2.6.0/extras/altsys_functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/extras/altsys_functions.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/extras/altsys_functions.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -42,7 +42,7 @@ function altsys_include_language_file($type) { - $mylang = $GLOBALS['xoopsConfig']['language']; + $mylang = Xoops::getInstance()->getConfig('language'); if (file_exists(XOOPS_ROOT_PATH . '/modules/altsys/language/' . $mylang . '/' . $type . '.php')) { include_once XOOPS_ROOT_PATH . '/modules/altsys/language/' . $mylang . '/' . $type . '.php'; Modified: XoopsCore/branches/2.6.x/2.6.0/extras/modules/system/admin/filemanager/jquery.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/extras/modules/system/admin/filemanager/jquery.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/extras/modules/system/admin/filemanager/jquery.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -24,7 +24,7 @@ require dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/mainfile.php' ; $xoops = Xoops::getInstance(); -$xoops->logger->disable(); +$xoops->logger()->disable(); $system = System::getInstance(); Modified: XoopsCore/branches/2.6.x/2.6.0/extras/modules/system/admin/filemanager/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/extras/modules/system/admin/filemanager/main.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/extras/modules/system/admin/filemanager/main.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -42,17 +42,17 @@ // Call Header xoops_cp_header(); -$xoops->theme->addScript('media/jquery/ui/jquery.ui.js'); -$xoops->theme->addScript('media/jquery/jquery.js'); -$xoops->theme->addScript('media/jquery/plugins/jquery.easing.js'); -$xoops->theme->addScript('media/jquery/plugins/jqueryFileTree.js'); -$xoops->theme->addScript('modules/system/js/filemanager.js'); -$xoops->theme->addScript('modules/system/js/admin.js'); -$xoops->theme->addScript('modules/system/js/code_mirror/codemirror.js'); +$xoops->theme()->addScript('media/jquery/ui/jquery.ui.js'); +$xoops->theme()->addScript('media/jquery/jquery.js'); +$xoops->theme()->addScript('media/jquery/plugins/jquery.easing.js'); +$xoops->theme()->addScript('media/jquery/plugins/jqueryFileTree.js'); +$xoops->theme()->addScript('modules/system/js/filemanager.js'); +$xoops->theme()->addScript('modules/system/js/admin.js'); +$xoops->theme()->addScript('modules/system/js/code_mirror/codemirror.js'); // Define Stylesheet -$xoops->theme->addStylesheet('modules/system/css/admin.css'); -$xoops->theme->addStylesheet('modules/system/css/code_mirror/docs.css'); -$xoops->theme->addStylesheet('media/jquery/ui/' . $xoops->getModuleConfig('jquery_theme', 'system') . '/ui.all.css'); +$xoops->theme()->addStylesheet('modules/system/css/admin.css'); +$xoops->theme()->addStylesheet('modules/system/css/code_mirror/docs.css'); +$xoops->theme()->addStylesheet('media/jquery/ui/' . $xoops->getModuleConfig('jquery_theme', 'system') . '/ui.all.css'); // Define Breadcrumb and tips $system_breadcrumb->addLink(_AM_SYSTEM_FILEMANAGER_NAV_MAIN, system_adminVersion('filemanager', 'adminpath')); @@ -63,14 +63,14 @@ $system_breadcrumb->addTips(_AM_SYSTEM_FILEMANAGER_NAV_TIPS); $system_breadcrumb->render(); - $xoops->tpl->assign('index', true); - $xoops->tpl->debugging = false; + $xoops->tpl()->assign('index', true); + $xoops->tpl()->debugging = false; $nbcolonnes_file = 4; $width = 100 / $nbcolonnes_file; $root = XOOPS_ROOT_PATH . '/'; $url_file = XOOPS_URL . '/'; - $xoops->tpl->assign('width', $width); + $xoops->tpl()->assign('width', $width); if (file_exists($root)) { $files = scandir($root); @@ -164,8 +164,8 @@ $file_arr['file'] = htmlentities($file); $count_file++; $file_arr['newline'] = ($count_file % $nbcolonnes_file == 1) ? true : false; - $xoops->tpl->assign('newline', $file_arr['newline']); - $xoops->tpl->append('files', $file_arr); + $xoops->tpl()->assign('newline', $file_arr['newline']); + $xoops->tpl()->append('files', $file_arr); } $edit = false; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.ini.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.ini.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.ini.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -152,7 +152,7 @@ if ($isRel) { return $relative_name; } - return $xoops->db->prefix($relative_name); + return $xoops->db()->prefix($relative_name); } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/object.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/object.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/object.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -65,13 +65,13 @@ * @param object $db reference to the {@link XoopsDatabase} object **/ - function __construct(&$db, $table, $className, $keyName, $identifierName) + function __construct($db, $table, $className, $keyName, $identifierName) { $this->db = $db; parent::__construct($db, $table, $className, $keyName, $identifierName); } - function ArtObjectHandler(&$db, $table = "", $className = "", $keyName = "", $identifierName = false) + function ArtObjectHandler($db, $table = "", $className = "", $keyName = "", $identifierName = false) { $this->__construct( $db, $table, $className, $keyName, $identifierName ); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -72,7 +72,7 @@ if (strpos(XOOPS_VAR_PATH . '/', XOOPS_ROOT_PATH . '/') !== false || strpos(XOOPS_VAR_PATH . '/', $_SERVER['DOCUMENT_ROOT'] . '/') !== false) { $error_msg[] = sprintf(_AD_WARNINGXOOPSLIBINSIDE, XOOPS_VAR_PATH); } - $xoops->tpl->assign('error_msg', $error_msg); + $xoops->tpl()->assign('error_msg', $error_msg); } if (!empty($_GET['xoopsorgnews'])) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -21,7 +21,7 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->logger->disable(); +$xoops->logger()->disable(); if (function_exists('mb_http_output')) { mb_http_output('pass'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/database.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/database.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/database.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -48,28 +48,12 @@ public $prefix = ''; /** - * @var XoopsLogger - */ - public $logger; - - /** * If statements that modify the database are selected * * @var boolean */ public $allowWebChanges = false; - /** - * assign a {@link XoopsLogger} object to the database - * - * @see XoopsLogger - * - * @param XoopsLogger $logger reference to a {@link XoopsLogger} object - */ - public function setLogger(XoopsLogger $logger) - { - $this->logger = $logger; - } /** * set the prefix for tables in the database Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/databasefactory.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/databasefactory.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/databasefactory.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -51,7 +51,6 @@ $xoopsPreload->triggerEvent('core.class.database.databasefactory.connection', array(&$class)); /* @var $instance XoopsDatabase */ $instance = new $class(); - $instance->setLogger(XoopsLogger::getInstance()); $instance->setPrefix(XOOPS_DB_PREFIX); if (!$instance->connect()) { trigger_error('notrace:Unable to connect to database', E_USER_ERROR); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/manager.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/manager.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/manager.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -60,7 +60,6 @@ { $this->db = XoopsDatabaseFactory::getDatabase(); $this->db->setPrefix(XOOPS_DB_PREFIX); - $this->db->setLogger(XoopsLogger::getInstance()); } /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/mysqldatabase.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/mysqldatabase.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/mysqldatabase.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -59,12 +59,14 @@ } if (!$this->conn) { - $this->logger->addQuery('', $this->error(), $this->errno()); + $xoopsPreload = XoopsPreload::getInstance(); + $xoopsPreload->triggerEvent('core.database.noconn', array($this)); return false; } if ($selectdb != false) { if (!mysql_select_db(XOOPS_DB_NAME)) { - $this->logger->addQuery('', $this->error(), $this->errno()); + $xoopsPreload = XoopsPreload::getInstance(); + $xoopsPreload->triggerEvent('core.database.nodb'); return false; } } @@ -245,15 +247,16 @@ } $sql = $sql . ' LIMIT ' . (int) $start . ', ' . (int) $limit; } - $this->logger->startTime('query_time'); + $xoopsPreload = XoopsPreload::getInstance(); + $xoopsPreload->triggerEvent('core.database.query.start'); $result = mysql_query($sql, $this->conn); - $this->logger->stopTime('query_time'); - $query_time = $this->logger->dumpTime('query_time', true); + $xoopsPreload->triggerEvent('core.database.query.end'); + if ($result) { - $this->logger->addQuery($sql, null, null, $query_time); + $xoopsPreload->triggerEvent('core.database.query.success', (array($sql))); return $result; } else { - $this->logger->addQuery($sql, $this->error(), $this->errno(), $query_time); + $xoopsPreload->triggerEvent('core.database.query.failure', (array($sql, $this))); return false; } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -120,7 +120,7 @@ $object = $this->handler->create(false); while ($myrow = $this->handler->db->fetchArray($result)) { $object->assignVars($myrow); - $ret[$myrow[$this->handler->keyName]] = $object->toArray(); + $ret[$myrow[$this->handler->keyName]] = $object->getValues(); } unset($object); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -87,9 +87,9 @@ while ($myrow = $this->handler->db->fetchArray($result)) { $object->assignVars($myrow); if ($id_as_key) { - $ret[$myrow[$this->handler->keyName]] = $object->toArray(); + $ret[$myrow[$this->handler->keyName]] = $object->getValues(); } else { - $ret[] = $object->toArray(); + $ret[] = $object->getValues(); } } unset($object); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -89,7 +89,7 @@ { $xoops = Xoops::getInstance(); $this->_obj = $xoops->module; - $xoops->theme->addStylesheet('media/xoops/css/moduladmin.css'); + $xoops->theme()->addStylesheet('media/xoops/css/moduladmin.css'); } /** @@ -282,8 +282,8 @@ public function renderBreadcrumb() { $xoops = Xoops::getInstance(); - $xoops->tpl->assign('xo_admin_breadcrumb', $this->_bread); - return $xoops->tpl->fetch($this->getTplPath('bread')); + $xoops->tpl()->assign('xo_admin_breadcrumb', $this->_bread); + return $xoops->tpl()->fetch($this->getTplPath('bread')); } public function displayBreadcrumb() @@ -303,10 +303,10 @@ { $xoops = Xoops::getInstance(); - $xoops->tpl->assign('xo_admin_buttons_position', $position); - $xoops->tpl->assign('xo_admin_buttons_delim', $delimiter); - $xoops->tpl->assign('xo_admin_buttons', $this->_itemButton); - return $xoops->tpl->fetch($this->getTplPath('button')); + $xoops->tpl()->assign('xo_admin_buttons_position', $position); + $xoops->tpl()->assign('xo_admin_buttons_delim', $delimiter); + $xoops->tpl()->assign('xo_admin_buttons', $this->_itemButton); + return $xoops->tpl()->fetch($this->getTplPath('button')); } /** @@ -324,8 +324,8 @@ public function renderInfoBox() { $xoops = Xoops::getInstance(); - $xoops->tpl->assign('xo_admin_box', $this->_itemInfoBox); - return $xoops->tpl->fetch($this->getTplPath('infobox')); + $xoops->tpl()->assign('xo_admin_box', $this->_itemInfoBox); + return $xoops->tpl()->fetch($this->getTplPath('infobox')); } public function displayInfoBox() @@ -346,16 +346,16 @@ } else { $this->_obj->adminmenu[$i]['icon'] = $xoops->url("/modules/" . $xoops->module->dirname() . "/icons/32/" . $this->_obj->adminmenu[$i]['icon']); } - $xoops->tpl->append('xo_admin_index_menu', $this->_obj->adminmenu[$i]); + $xoops->tpl()->append('xo_admin_index_menu', $this->_obj->adminmenu[$i]); } if ($this->_obj->getInfo('help')) { $help = array(); $help['link'] = '../system/help.php?mid=' . $this->_obj->getVar('mid', 's') . "&" . $this->_obj->getInfo('help'); $help['icon'] = $xoops->url("/media/xoops/images/icons/32/help.png"); $help['title'] = _AM_SYSTEM_HELP; - $xoops->tpl->append('xo_admin_index_menu', $help); + $xoops->tpl()->append('xo_admin_index_menu', $help); } - $xoops->tpl->assign('xo_admin_box', $this->_itemInfoBox); + $xoops->tpl()->assign('xo_admin_box', $this->_itemInfoBox); // If you use a config label if ($this->_obj->getInfo('min_php') || $this->_obj->getInfo('min_xoops') || !empty($this->_itemConfigBoxLine)) { @@ -378,7 +378,7 @@ $dbCurrentVersion = mysqli_get_server_info(); break; case "pdo": - $dbCurrentVersion = $xoops->db->getAttribute(PDO::ATTR_SERVER_VERSION); + $dbCurrentVersion = $xoops->db()->getAttribute(PDO::ATTR_SERVER_VERSION); break; default: $dbCurrentVersion = '0'; @@ -415,9 +415,9 @@ $this->addConfigBoxLine(sprintf(_AM_MODULEADMIN_CONFIG_XOOPS, $this->_obj->getInfo('min_xoops'), substr(XOOPS_VERSION, 6, strlen(XOOPS_VERSION) - 6)), 'accept'); } } - $xoops->tpl->assign('xo_admin_index_config', $this->_itemConfigBoxLine); + $xoops->tpl()->assign('xo_admin_index_config', $this->_itemConfigBoxLine); } - return $xoops->tpl->fetch($this->getTplPath('index')); + return $xoops->tpl()->fetch($this->getTplPath('index')); } public function displayIndex() @@ -445,8 +445,8 @@ } else { $this->_obj->adminmenu[$i]['icon'] = $xoops->url("/modules/" . $xoops->module->dirname() . "/icons/32/" . $this->_obj->adminmenu[$i]['icon']); } - $xoops->tpl->assign('xo_sys_navigation', $this->_obj->adminmenu[$i]); - $ret[] = $xoops->tpl->fetch($this->getTplPath('nav')); + $xoops->tpl()->assign('xo_sys_navigation', $this->_obj->adminmenu[$i]); + $ret[] = $xoops->tpl()->fetch($this->getTplPath('nav')); } } return $ret; @@ -469,8 +469,8 @@ public function renderTips() { $xoops = Xoops::getInstance(); - $xoops->tpl->assign('xo_admin_tips', $this->_tips); - return $xoops->tpl->fetch($this->getTplPath('tips')); + $xoops->tpl()->assign('xo_admin_tips', $this->_tips); + return $xoops->tpl()->fetch($this->getTplPath('tips')); } public function displayTips() @@ -526,7 +526,7 @@ $this->_obj->setInfo('paypal', $this->_obj->getInfo('paypal')); } $this->_obj->setInfo('changelog', $changelog); - $xoops->tpl->assign('module', $this->_obj); + $xoops->tpl()->assign('module', $this->_obj); $this->addInfoBox(_AM_MODULEADMIN_ABOUT_MODULEINFO, 'info', 'id="xo-about"'); $this->addInfoBoxLine(_AM_MODULEADMIN_ABOUT_DESCRIPTION . ' ' . $this->_obj->getInfo("description"), 'info'); @@ -534,9 +534,9 @@ $this->addInfoBoxLine(_AM_MODULEADMIN_ABOUT_WEBSITE . ' <a class="xo-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>', 'info'); - $xoops->tpl->assign('xoops_logo', $logo_xoops); - $xoops->tpl->assign('xo_admin_box', $this->_itemInfoBox); - return $xoops->tpl->fetch($this->getTplPath('about')); + $xoops->tpl()->assign('xoops_logo', $logo_xoops); + $xoops->tpl()->assign('xo_admin_box', $this->_itemInfoBox); + return $xoops->tpl()->fetch($this->getTplPath('about')); } /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/preload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/preload.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/preload.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -59,7 +59,7 @@ /** * Allow one instance only! * - * @staticvar XoopsPreload + * @staticvar $instance XoopsPreload * @return XoopsPreload */ static function getInstance() @@ -79,18 +79,20 @@ */ private function _setPreloads() { - if ($modules_list = Xoops_Cache::read('system_modules_active')) { - $i = 0; - foreach ($modules_list as $module) { - if (is_dir($dir = XOOPS_ROOT_PATH . "/modules/{$module}/preloads/")) { - $file_list = XoopsLists::getFileListAsArray($dir); - foreach ($file_list as $file) { - if (preg_match('/(\.php)$/i', $file)) { - $file = substr($file, 0, -4); - $this->_preloads[$i]['module'] = $module; - $this->_preloads[$i]['file'] = $file; - $i++; - } + $modules_list = Xoops_Cache::read('system_modules_active'); + if (!$modules_list) { + $modules_list = array ('system'); + } + $i = 0; + foreach ($modules_list as $module) { + if (is_dir($dir = XOOPS_ROOT_PATH . "/modules/{$module}/preloads/")) { + $file_list = XoopsLists::getFileListAsArray($dir); + foreach ($file_list as $file) { + if (preg_match('/(\.php)$/i', $file)) { + $file = substr($file, 0, -4); + $this->_preloads[$i]['module'] = $module; + $this->_preloads[$i]['file'] = $file; + $i++; } } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/image.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/image.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -54,10 +54,10 @@ $ts->replacements[] = '<a href="' . XOOPS_URL . '/image.php?id=\\2" rel="external" title="\\3">\\3</a>'; } else { - if (!empty($config['resize']) && empty($config['clickable']) && !empty($config['max_width']) && !empty($xoops->theme)) { + if (!empty($config['resize']) && empty($config['clickable']) && !empty($config['max_width']) && is_object($xoops->theme())) { if (!$jsLoaded) { $jsLoaded = true; - $xoops->theme->addScript('/class/textsanitizer/image/image.js', array( + $xoops->theme()->addScript('/class/textsanitizer/image/image.js', array( 'type' => 'text/javascript' )); } @@ -69,10 +69,10 @@ ? " onload=\"javascript:imageResize(this, " . $config['max_width'] . ")\"" : "") . "/>"; } else { - if (!empty($config['clickable']) && !empty($config['max_width']) && !empty($xoops->theme)) { + if (!empty($config['clickable']) && !empty($config['max_width']) && is_object($xoops->theme())) { if (!$jsLoaded) { $jsLoaded = true; - $xoops->theme->addScript('/class/textsanitizer/image/image.js', array( + $xoops->theme()->addScript('/class/textsanitizer/image/image.js', array( 'type' => 'text/javascript' )); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -361,11 +361,13 @@ if ($this->bufferOutput) { ob_start(); } - $xoops->theme = $this; - $xoops->tpl = $this->template; - $GLOBALS['xoTheme'] =& $xoops->theme; - $GLOBALS['xoopsTpl'] =& $xoops->tpl; + $xoops->setTheme($this); + $xoops->setTpl($this->template); + //For legacy only, never use this Globals + $GLOBALS['xoTheme'] = $xoops->theme(); + $GLOBALS['xoopsTpl'] = $xoops->tpl(); + //to control order of loading JS and CSS if (file_exists($this->path ."/theme_onload.php")) @@ -443,8 +445,7 @@ } $this->contentCacheId = $this->generateCacheId('page_' . substr(md5($uri), 0, 8)); if ($this->template->is_cached($template, $this->contentCacheId)) { - XoopsLogger::getInstance() - ->addExtra($template, sprintf('Cached (regenerates every %d seconds)', $this->contentCacheLifetime)); + Xoops::getInstance()->preload()->triggerEvent('core.theme.checkcache.success', array($template, $this)); $this->render(null, null, $template); return true; } @@ -472,7 +473,7 @@ return false; } $xoops = Xoops::getInstance(); - $xoops->logger->startTime('Page rendering'); + $xoops->preload()->triggerEvent('core.theme.render.start', array($this)); //Get meta information for cached pages if ($this->contentCacheLifetime && $this->contentCacheId && $content = Xoops_Cache::read($this->contentCacheId, $this->headersCacheEngine)) { @@ -534,7 +535,7 @@ $this->template->caching = 0; $this->template->display($this->path . '/' . $this->canvasTemplate); $this->renderCount++; - $xoops->logger->stopTime('Page rendering'); + $xoops->preload()->triggerEvent('core.theme.render.end', array($this)); return true; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -116,7 +116,7 @@ } $block_handler = $xoops->getHandlerBlock(); $block_arr = $block_handler->getAllByGroupModule($groups, $mid, $isStart, XOOPS_BLOCK_VISIBLE); - $xoops->preload->triggerEvent('core.class.theme_blocks.retrieveBlocks', array(&$this, &$template, &$block_arr)); + $xoops->preload()->triggerEvent('core.class.theme_blocks.retrieveBlocks', array(&$this, &$template, &$block_arr)); foreach ($block_arr as $block) { /* @var $block XoopsBlock */ $side = $oldzones[$block->getVar('side')]; @@ -172,6 +172,8 @@ : "module:system|system_block_dummy.html"; $cacheid = $this->generateCacheId('blk_' . $xobject->getVar('bid')); + Xoops::getInstance()->preload()->triggerEvent('core.themeblocks.buildblock.start', array($xobject, $template->is_cached($tplName, $cacheid))); + if (!$bcachetime || !$template->is_cached($tplName, $cacheid)) { //Get theme metas @@ -183,7 +185,6 @@ } //build block - XoopsLogger::getInstance()->addBlock($xobject->getVar('name')); if ($bresult = $xobject->buildBlock()) { $template->assign('block', $bresult); $block['content'] = $template->fetch($tplName, $cacheid); @@ -205,7 +206,6 @@ } } } else { - XoopsLogger::getInstance()->addBlock($xobject->getVar('name'), true, $bcachetime); $block['content'] = $template->fetch($tplName, $cacheid); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/form.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/form.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/form.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -453,7 +453,7 @@ * @param XoopsTpl $tpl * @return void */ - public function assign(XoopsTpl &$tpl) + public function assign(XoopsTpl $tpl) { $i = -1; $elements = array(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcolorpicker.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcolorpicker.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcolorpicker.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -42,8 +42,8 @@ public function render() { $xoops = Xoops::getInstance(); - if (isset($xoops->theme)) { - $xoops->theme->addScript('include/color-picker.js'); + if ($xoops->theme()) { + $xoops->theme()->addScript('include/color-picker.js'); } else { echo '<script type="text/javascript" src="' . XOOPS_URL . '/include/color-picker.js"></script>'; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdhtmltextarea.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdhtmltextarea.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdhtmltextarea.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -187,12 +187,12 @@ $ret .= "<textarea" . $class . " id='" . $this->getName() . "' name='" . $this->getName() . "' title='" . $this->getTitle() . "' onselect=\"xoopsSavePosition('" . $this->getName() . "');\" onclick=\"xoopsSavePosition('" . $this->getName() . "');\" onkeyup=\"xoopsSavePosition('" . $this->getName() . "');\" rows='" . $this->getRows() . "'" . $extra . $required . ">" . $this->getValue() . "</textarea><br />\n"; if (empty($this->skipPreview)) { - if (empty($xoops->theme)) { + if (!$xoops->theme()) { $this->js .= implode("", file(XOOPS_ROOT_PATH . "/class/textsanitizer/image/image.js")); } else { - $xoops->theme->addScript('/class/textsanitizer/image/image.js', array('type' => 'text/javascript')); + $xoops->theme()->addScript('/class/textsanitizer/image/image.js', array('type' => 'text/javascript')); } - $button = "<input id='" . $this->getName() . "_preview_button' " . "type='button' " . "class='btn' value='" . _PREVIEW . "' " . "onclick=\"form_instantPreview('" . XOOPS_URL . "', '" . $this->getName() . "','" . XOOPS_URL . "/images', " . intval($this->doHtml) . ", '" . $xoops->security->createToken() . "')\"" . " />"; + $button = "<input id='" . $this->getName() . "_preview_button' " . "type='button' " . "class='btn' value='" . _PREVIEW . "' " . "onclick=\"form_instantPreview('" . XOOPS_URL . "', '" . $this->getName() . "','" . XOOPS_URL . "/images', " . intval($this->doHtml) . ", '" . $xoops->security()->createToken() . "')\"" . " />"; $ret .= "<br />" . "<div id='" . $this->getName() . "_hidden' style='display: block;'> " . "<fieldset>" . "<legend>" . $button . "</legend>" . "<div id='" . $this->getName() . "_hidden_data'>" . _XOOPS_FORM_PREVIEW_CONTENT . "</div>" . "</fieldset>" . "</div>"; } // Load javascript Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhiddentoken.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhiddentoken.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhiddentoken.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -37,6 +37,6 @@ public function __construct($name = 'XOOPS_TOKEN', $timeout = 0) { $xoops = Xoops::getInstance(); - parent::__construct($name . '_REQUEST', $xoops->security->createToken($timeout, $name)); + parent::__construct($name . '_REQUEST', $xoops->security()->createToken($timeout, $name)); } } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectuser.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectuser.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectuser.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -97,7 +97,7 @@ return true; } </script>"; - $token = $xoops->security->createToken(); + $token = $xoops->security()->createToken(); $action_tray = new XoopsFormElementTray("", " | "); $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="var sel = xoopsGetElementById(\'' . $name . '\');for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;">' . _MA_USER_REMOVE . "</a>")); $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="openWithSelfMain(\'' . XOOPS_URL . '/include/findusers.php?target=' . $name . '&multiple=' . $multiple . '&token=' . $token . '\', \'userselect\', 800, 600, null); return false;" >' . _MA_USER_MORE . "</a>" . $js_addusers)); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtabtray.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtabtray.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtabtray.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -54,10 +54,10 @@ public function render() { $xoops = Xoops::getInstance(); - $xoops->theme->addScript('media/jquery/jquery.js'); - $xoops->theme->addScript('media/jquery/ui/jquery.ui.js'); - $xoops->theme->addStylesheet('media/jquery/ui/' . $this->_uiTheme . '/ui.all.css'); - $xoops->theme->addScript('', '', ' + $xoops->theme()->addScript('media/jquery/jquery.js'); + $xoops->theme()->addScript('media/jquery/ui/jquery.ui.js'); + $xoops->theme()->addStylesheet('media/jquery/ui/' . $this->_uiTheme . '/ui.all.css'); + $xoops->theme()->addScript('', '', ' $(function() { $("#tabs_' . $this->getName() . '").tabs(); }); 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 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtextdateselect.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -58,11 +58,11 @@ } $jstime = XoopsLocal::formatTimestamp($ele_value, _SHORTDATESTRING); - $xoops->theme->addScript('include/calendar.js'); - $xoops->theme->addStylesheet('include/calendar-blue.css'); + $xoops->theme()->addScript('include/calendar.js'); + $xoops->theme()->addStylesheet('include/calendar-blue.css'); if (!$included) { $included = true; - $xoops->theme->addScript('','', ' + $xoops->theme()->addScript('','', ' var calendar = null; function selected(cal, date) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -56,31 +56,31 @@ public function render() { $xoops = Xoops::getInstance(); - $xoops->theme->addStylesheet('media/xoops/css/form.css'); + $xoops->theme()->addStylesheet('media/xoops/css/form.css'); switch ($this->getDisplay()) { case '': case 'horizontal': default: - $xoops->tpl->assign('type', 'horizontal'); + $xoops->tpl()->assign('type', 'horizontal'); break; case 'vertical': - $xoops->tpl->assign('type', 'vertical'); + $xoops->tpl()->assign('type', 'vertical'); break; case 'inline': - $xoops->tpl->assign('type', 'inline'); + $xoops->tpl()->assign('type', 'inline'); break; case 'personalized': - $xoops->tpl->assign('type', 'personalized'); + $xoops->tpl()->assign('type', 'personalized'); break; } - $xoops->tpl->assign('title', $this->getTitle()); - $xoops->tpl->assign('name', $this->getName()); - $xoops->tpl->assign('action', $this->getAction()); - $xoops->tpl->assign('method', $this->getMethod()); - $xoops->tpl->assign('extra', $this->getExtra()); + $xoops->tpl()->assign('title', $this->getTitle()); + $xoops->tpl()->assign('name', $this->getName()); + $xoops->tpl()->assign('action', $this->getAction()); + $xoops->tpl()->assign('method', $this->getMethod()); + $xoops->tpl()->assign('extra', $this->getExtra()); $hidden = ''; foreach ($this->getElements() as $ele) { /* @var $ele XoopsFormElement */ @@ -92,17 +92,17 @@ $input['required'] = $ele->isRequired(); $input['pattern_description'] = $ele->getPatternDescription(); $input['datalist'] = $ele->getDatalist(); - $xoops->tpl->append_by_ref('xo_input', $input); + $xoops->tpl()->append_by_ref('xo_input', $input); unset($input); } else { $hidden .= $ele->render(). NWLINE; } } - $xoops->tpl->assign('hidden', $hidden); - $xoops->tpl->assign('validationJS', $this->renderValidationJS(true)); - $ret = $xoops->tpl->fetch('module:system|system_form.html'); - $xoops->tpl->clear_assign('xo_input'); + $xoops->tpl()->assign('hidden', $hidden); + $xoops->tpl()->assign('validationJS', $this->renderValidationJS(true)); + $ret = $xoops->tpl()->fetch('module:system|system_form.html'); + $xoops->tpl()->clear_assign('xo_input'); return $ret; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslocal.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslocal.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslocal.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -76,11 +76,17 @@ */ static function convert_encoding($text, $to = 'utf-8', $from = '') { + $xoops = Xoops::getInstance(); + $xlanguage = $xoops->registry()->get('XLANGUAGE'); + $charset = false; + if (is_array($xlanguage)) { + $charset = $xlanguage['charset_base']; + } if (empty($text)) { return $text; } if (empty($from)) { - $from = empty($GLOBALS['xlanguage']['charset_base']) ? _CHARSET : $GLOBALS['xlanguage']['charset_base']; + $from = $charset ? $charset :_CHARSET; } if (empty($to) || !strcasecmp($to, $from)) { return $text; @@ -254,7 +260,9 @@ */ public function __call($name, $args) { + exit($name); if (function_exists($name)) { + exit($name); return call_user_func_array($name, $args); } return null; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/comments.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/comments.php 2012-12-06 14:57:05 UTC (rev 10327) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/comments.php 2012-12-07 00:56:07 UTC (rev 10328) @@ -1,7 +1,6 @@ <?php /** * XOOPS feed creator - * * You may not change or alter any portion of this comment or credits * of supporting developers from this source code or any supporting source code * which is considered copyrighted (c) material of the original comment or credit authors. @@ -15,24 +14,26 @@ * @version $Id$ */ if (!function_exists('xoopsTweetString')) { - function xoopsTweetString($title, $doit=false, $wordlen=4) { - if ($doit==true) { - $title_array = explode(' ', $title); - $title = ''; - foreach($title_array as $item) { - if (strlen($item)>$wordlen) - $title .= ' #'.$item; - else - $title .= ' '.$item; - } - } - return trim($title); - } + function xoopsTweetString($title, $doit = false, $wordlen = 4) + { + if ($doit == true) { + $title_array = explode(' ', $title); + $title = ''; + foreach ($title_array as $item) { + if (strlen($item) > $wordlen) { + $title .= ' #' . $item; + } else { + $title .= ' ' . $item; + } + } + } + return trim($title); + } } include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->logger->disable(); +$xoops->logger()->disable(); if (function_exists('mb_http_output')) { mb_http_output('pass'); @@ -66,31 +67,34 @@ } $tpl->assign('image_width', $width); $tpl->assign('image_height', $height); - + $comments_handler = $xoops->getHandler('comment'); $criteria = new CriteriaCompo(new Criteria('com_status', 2)); - if (isset($_REQUEST['modid'])&&is_numeric($_REQUEST['modid'])) - $criteria->add(new Criteria('`com_modid`', intval($_REQUEST['modid']))); - if (isset($_REQUEST['uid'])&&is_numeric($_REQUEST['uid'])) - $criteria->add(new Criteria('`com_uid`', intval($_REQUEST['uid']))); - $criteria->setLimit(((isset($_REQUEST['num'])&&is_numeric($_REQUEST['num'])&&intval($_REQUEST['num'])>0)?intval($_REQUEST['num']):10)); + if (isset($_REQUEST['modid']) && is_numeric($_REQUEST['modid'])) { + $criteria->add(new Criteria('`com_modid`', intval($_REQUEST['modid']))); + } + if (isset($_REQUEST['uid']) && is_numeric($_REQUEST['uid'])) { + $criteria->add(new Criteria('`com_uid`', intval($_REQUEST['uid']))); + } + $criteria->setLimit(((isset($_REQUEST['num']) && is_numeric($_REQUEST['num']) && intval($_REQUEST['num']) > 0) ? intval($_REQUEST['num']) : 10)); $criteria->setSort('`com_created`'); $criteria->setOrder('DESC'); - + $module_handler = $xoops->getModuleHandler(); $comments = $comments_handler->getObjects($criteria); if (!empty($comments) && is_array($comments)) { - $myts =& MyTextSanitizer::getInstance(); + $myts =& MyTextSanitizer::getInstance(); foreach ($comments as $comment) { - $xoModule = $module_handler->get($comment->getVar('com_modid')); - $comment_config = $xoModule->getInfo('comments'); + $xoModule = $module_handler->get($comment->getVar('com_modid')); + $comment_config = $xoModule->getInfo('comments'); $tpl->append('items', array( - 'title' => XoopsLocal::convert_encoding(htmlspecialchars(xoopsTweetString($comment->getVar('com_title'), isset($_REQUEST['tweet']), ((isset($_REQUEST['tweetlen'])&&is_numeric($_REQUEST['tweetlen'])&&intval($_REQUEST['tweetlen'])>0)?intval($_REQUEST['tweetlen']):4)), ENT_QUOTES)) , - 'link' => htmlspecialchars(XOOPS_URL . '/modules/'.$xoModule->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='.$GLOBALS['xoopsConfig']['com_mode'].'&com_order=0'.(strlen($comment->getVar('com_exparams'))>0?'&'.$comment->getVar('com_exparams'):'').'#comment'.$comment->getVar('com_id')), - 'guid' => htmlspecialchars(XOOPS_URL . '/modules/'.$xoModule->getVar('dirname').'/'.$comment_config['pageName'].'?'.$comment_config['itemName'].'='.$comment->getVar('com_... [truncated message content] |