From: <tr...@us...> - 2011-10-08 18:30:43
|
Revision: 7813 http://xoops.svn.sourceforge.net/xoops/?rev=7813&view=rev Author: trabis Date: 2011-10-08 18:30:34 +0000 (Sat, 08 Oct 2011) Log Message: ----------- More updated kernel classes Modified Paths: -------------- 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/object.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/online.php XoopsCore/branches/2.6.x/2.6.0/htdocs/misc.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/system/admin/blocksadmin/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/member.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/member.php 2011-10-08 13:56:08 UTC (rev 7812) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/member.php 2011-10-08 18:30:34 UTC (rev 7813) @@ -59,8 +59,10 @@ /** * Constructor + * + * @param XoopsDatabase|null $db */ - public function __construct($db) + public function __construct($db = null) { $this->_gHandler = new XoopsGroupHandler($db); $this->_uHandler = new XoopsUserHandler($db); @@ -383,10 +385,10 @@ * * @param string $fieldName name of the field to update * @param string $fieldValue updated value for the field - * @param object $criteria {@link CriteriaElement} object + * @param CriteriaElement|null $criteria {@link CriteriaElement} object * @return bool TRUE if success or unchanged, FALSE on failure */ - public function updateUsersByField($fieldName, $fieldValue, $criteria = null) + public function updateUsersByField($fieldName, $fieldValue, CriteriaElement $criteria = null) { return $this->_uHandler->updateAll($fieldName, $fieldValue, $criteria); } @@ -410,7 +412,7 @@ * Get a list of users belonging to certain groups and matching criteria * Temporary solution * - * @param int $groups IDs of groups + * @param array $groups IDs of groups * @param CriteriaElement|null $criteria {@link CriteriaElement} object * @param bool $asobject return the users as objects? * @param bool $id_as_key use the UID as key for the array if $asobject is TRUE @@ -463,7 +465,7 @@ * Get count of users belonging to certain groups and matching criteria * Temporary solution * - * @param int $groups IDs of groups + * @param array $groups IDs of groups * @param CriteriaElement|null $criteria * @return int count of users */ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-08 13:56:08 UTC (rev 7812) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-08 18:30:34 UTC (rev 7813) @@ -26,25 +26,25 @@ class XoopsModule extends XoopsObject { /** - * * @var string */ - var $modinfo; + public $modinfo; + /** * * @var string */ - var $adminmenu; + public $adminmenu; /** * * @var array */ - var $_msg; + private $_msg; /** * Constructor */ - function __construct() + public function __construct() { $this->initVar('mid', XOBJ_DTYPE_INT, null, false); $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, true, 150); @@ -68,9 +68,9 @@ * @param string $dirname Directory Name * @param boolean $verbose */ - function loadInfoAsVar($dirname, $verbose = true) + public function loadInfoAsVar($dirname, $verbose = true) { - $dirname = basename($dirname); + $dirname = basename($dirname); if (!isset($this->modinfo)) { $this->loadInfo($dirname, $verbose); } @@ -99,7 +99,7 @@ * @param string $str message to add * @access public */ - function setMessage($str) + public function setMessage($str) { $this->_msg[] = trim($str); } @@ -110,7 +110,7 @@ * @return array an array of messages * @access public */ - function getMessages() + public function getMessages() { return $this->_msg; } @@ -122,7 +122,7 @@ * @param mix $value * @return bool **/ - function setInfo($name, $value) + public function setInfo($name, $value) { if (empty($name)) { $this->modinfo = $value; @@ -139,7 +139,7 @@ * @return array |string Array of module information. * If {@link $name} is set, returns a single module information item as string. */ - function getInfo($name = null) + public function getInfo($name = null) { if (!isset($this->modinfo)) { $this->loadInfo($this->getVar('dirname')); @@ -159,7 +159,7 @@ * * @return string FALSE on fail */ - function mainLink() + public function mainLink() { if ($this->getVar('hasmain') == 1) { $ret = '<a href="' . XOOPS_URL . '/modules/' . $this->getVar('dirname') . '/">' . $this->getVar('name') . '</a>'; @@ -173,7 +173,7 @@ * * @return string */ - function subLink() + public function subLink() { $ret = array(); if ($this->getInfo('sub') && is_array($this->getInfo('sub'))) { @@ -189,7 +189,7 @@ /** * Load the admin menu for the module */ - function loadAdminMenu() + public function loadAdminMenu() { if ($this->getInfo('adminmenu') && $this->getInfo('adminmenu') != '' && file_exists(XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/' . $this->getInfo('adminmenu'))) { $adminmenu = array(); @@ -203,7 +203,7 @@ * * @return string */ - function getAdminMenu() + public function getAdminMenu() { if (!isset($this->adminmenu)) { $this->loadAdminMenu(); @@ -216,8 +216,9 @@ * * @param string $dirname Module directory * @param bool $verbose Give an error on fail? + * @return bool */ - function loadInfo($dirname, $verbose = true) + public function loadInfo($dirname, $verbose = true) { $dirname = basename($dirname); global $xoopsConfig; @@ -248,7 +249,7 @@ * @param integer $userid * @return mixed Search result. */ - function search($term = '', $andor = 'AND', $limit = 0, $offset = 0, $userid = 0) + public function search($term = '', $andor = 'AND', $limit = 0, $offset = 0, $userid = 0) { if ($this->getVar('hassearch') != 1) { return false; @@ -263,125 +264,143 @@ return false; } if (function_exists($search['func'])) { - $func = $search['func']; + $func = (string)$search['func']; return $func($term, $andor, $limit, $offset, $userid); } return false; } /** - * Returns Class Base Variable mid + * @param string $format + * @return mixed */ - function id($format = 'N') + public function id($format = 'n') { return $this->getVar('mid', $format); } /** - * Returns Class Base Variable mid + * @param string $format + * @return mixed */ - function mid($format = '') + public function mid($format = '') { return $this->getVar('mid', $format); } /** - * Returns Class Base Variable name + * @param string $format + * @return mixed */ - function name($format = '') + public function name($format = '') { return $this->getVar('name', $format); } /** - * Returns Class Base Variable version + * @param string $format + * @return mixed */ - function version($format = '') + public function version($format = '') { return $this->getVar('version', $format); } /** - * Returns Class Base Variable last_update + * @param string $format + * @return mixed */ - function last_update($format = '') + public function last_update($format = '') { return $this->getVar('last_update', $format); } /** - * Returns Class Base Variable weight + * @param string $format + * @return mixed */ - function weight($format = '') + public function weight($format = '') { return $this->getVar('weight', $format); } /** - * Returns Class Base Variable isactive + * @param string $format + * @return mixed */ - function isactive($format = '') + public function isactive($format = '') { return $this->getVar('isactive', $format); } /** - * Returns Class Base Variable dirname + * @param string $format + * @return mixed */ - function dirname($format = '') + public function dirname($format = '') { return $this->getVar('dirname', $format); } /** - * Returns Class Base Variable hasmain + * @param string $format + * @return mixed */ - function hasmain($format = '') + public function hasmain($format = '') { return $this->getVar('hasmain', $format); } /** - * Returns Class Base Variable hasadmin + * @param string $format + * @return mixed */ - function hasadmin($format = '') + public function hasadmin($format = '') { return $this->getVar('hasadmin', $format); } /** - * Returns Class Base Variable hassearch + * @param string $format + * @return mixed */ - function hassearch($format = '') + public function hassearch($format = '') { return $this->getVar('hassearch', $format); } /** - * Returns Class Base Variable hasconfig + * @param string $format + * @return mixed */ - function hasconfig($format = '') + public function hasconfig($format = '') { return $this->getVar('hasconfig', $format); } /** - * Returns Class Base Variable hascomments + * @param string $format + * @return mixed */ - function hascomments($format = '') + public function hascomments($format = '') { return $this->getVar('hascomments', $format); } /** - * Returns Class Base Variable hasnotification + * @param string $format + * @return mixed */ - function hasnotification($format = '') + public function hasnotification($format = '') { return $this->getVar('hasnotification', $format); } - function getByDirName($dirname) + /** + * @param $dirname + * @return XoopsModule + */ + public function getByDirName($dirname) { $modhandler = xoops_gethandler('module'); $inst = $modhandler->getByDirname($dirname); @@ -399,7 +418,7 @@ * @author Kazumi Ono <on...@xo...> * @copyright (c) 2000-2003 The Xoops Project - www.xoops.org */ -class XoopsModuleHandler extends XoopsObjectHandler +class XoopsModuleHandler extends XoopsPersistableObjectHandler { /** * holds an array of cached module references, indexed by module id @@ -407,7 +426,7 @@ * @var array * @access private */ - var $_cachedModule_mid = array(); + private $_cachedModule_mid = array(); /** * holds an array of cached module references, indexed by module dirname @@ -415,55 +434,43 @@ * @var array * @access private */ - var $_cachedModule_dirname = array(); + private $_cachedModule_dirname = array(); /** - * Create a new {@link XoopsModule} object + * Constructor * - * @param boolean $isNew Flag the new object as "new" - * @return object + * @param XoopsDatabase|null $db {@link XoopsDatabase} */ - function create($isNew = true) + public function __construct(XoopsDatabase $db = null) { - $module = new XoopsModule(); - if ($isNew) { - $module->setNew(); - } - return $module; + parent::__construct($db, 'modules', 'XoopsModule', 'mid', 'dirname'); } /** * Load a module from the database * * @param int $id ID of the module - * @return object FALSE on fail + * @return XoopsModule|false on fail */ function get($id) { static $_cachedModule_dirname; static $_cachedModule_mid; $id = intval($id); - $module = false; if ($id > 0) { if (!empty($_cachedModule_mid[$id])) { return $_cachedModule_mid[$id]; } else { - $sql = 'SELECT * FROM ' . $this->db->prefix('modules') . ' WHERE mid = ' . $id; - if (!$result = $this->db->query($sql)) { - return $module; + $module = parent::get($id); + if (!is_object($module)) { + return false; } - $numrows = $this->db->getRowsNum($result); - if ($numrows == 1) { - $module = new XoopsModule(); - $myrow = $this->db->fetchArray($result); - $module->assignVars($myrow); - $_cachedModule_mid[$id] = &$module; - $_cachedModule_dirname[$module->getVar('dirname')] = &$module; - return $module; - } + $_cachedModule_mid[$id] = $module; + $_cachedModule_dirname[$module->getVar('dirname')] = $module; + return $module; } } - return $module; + return false; } /** @@ -472,31 +479,24 @@ * @param string $dirname * @return object FALSE on fail */ - function getByDirname($dirname) + public function getByDirname($dirname) { - $dirname = basename($dirname); - //could not we check for spaces instead?? - if (strpos(strtolower($dirname), ' union ')) { - return false; - } + $dirname = basename(trim($dirname)); static $_cachedModule_mid; static $_cachedModule_dirname; if (!empty($_cachedModule_dirname[$dirname])) { return $_cachedModule_dirname[$dirname]; } else { - $module = false; - $sql = "SELECT * FROM " . $this->db->prefix('modules') . " WHERE dirname = '" . trim($dirname) . "'"; - if (!$result = $this->db->query($sql)) { - return $module; + $myts = MyTextSanitizer::getInstance(); + $criteria = new Criteria('dirname', $myts->addSlashes($dirname)); + $modules = $this->getObjects($criteria); + if (count($modules) == 1 && is_object($modules[0])) { + $module = $modules[0]; + } else { + return false; } - $numrows = $this->db->getRowsNum($result); - if ($numrows == 1) { - $module = new XoopsModule(); - $myrow = $this->db->fetchArray($result); - $module->assignVars($myrow); - $_cachedModule_dirname[$dirname] = $module; - $_cachedModule_mid[$module->getVar('mid')] = $module; - } + $_cachedModule_dirname[$dirname] = $module; + $_cachedModule_mid[$module->getVar('mid')] = $module; return $module; } } @@ -504,40 +504,18 @@ /** * Write a module to the database * - * @param object $ &$module reference to a {@link XoopsModule} + * @param XoopsModule &$module reference to a {@link XoopsModule} * @return bool */ - function insert(&$module) + public function insert(XoopsModule &$module) { - /** - * - * @TODO : Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($module, 'xoopsmodule')) { + if (!parent::insert($module)) { return false; } - if (!$module->isDirty()) { - return true; - } - if (!$module->cleanVars()) { - return false; - } - foreach ($module->cleanVars as $k => $v) { - ${$k} = $v; - } - if ($module->isNew()) { - $mid = $this->db->genId('modules_mid_seq'); - $sql = sprintf("INSERT INTO %s (mid, name, version, last_update, weight, isactive, dirname, hasmain, hasadmin, hassearch, hasconfig, hascomments, hasnotification) VALUES (%u, %s, %u, %u, %u, %u, %s, %u, %u, %u, %u, %u, %u)", $this->db->prefix('modules'), $mid, $this->db->quoteString($name), $version, time(), $weight, 1, $this->db->quoteString($dirname), $hasmain, $hasadmin, $hassearch, $hasconfig, $hascomments, $hasnotification); - } else { - $sql = sprintf("UPDATE %s SET name = %s, dirname = %s, version = %u, last_update = %u, weight = %u, isactive = %u, hasmain = %u, hasadmin = %u, hassearch = %u, hasconfig = %u, hascomments = %u, hasnotification = %u WHERE mid = %u", $this->db->prefix('modules'), $this->db->quoteString($name), $this->db->quoteString($dirname), $version, time(), $weight, $isactive, $hasmain, $hasadmin, $hassearch, $hasconfig, $hascomments, $hasnotification, $mid); - } - if (!$result = $this->db->query($sql)) { - return false; - } - if (empty($mid)) { - $mid = $this->db->getInsertId(); - } - $module->assignVar('mid', $mid); + + $dirname = $module->getvar('dirname'); + $mid = $module->getvar('mid'); + if (!empty($this->_cachedModule_dirname[$dirname])) { unset($this->_cachedModule_dirname[$dirname]); } @@ -550,22 +528,15 @@ /** * Delete a module from the database * - * @param object $ &$module + * @param XoopsModule &$module * @return bool */ - function delete(&$module) + public function delete(XoopsModule &$module) { - /** - * - * @TODO : Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($module, 'xoopsmodule')) { + if (!parent::delete($module)) { return false; } - $sql = sprintf("DELETE FROM %s WHERE mid = %u", $this->db->prefix('modules'), $module->getVar('mid')); - if (!$result = $this->db->query($sql)) { - return false; - } + // delete admin permissions assigned for this module $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'module_admin' AND gperm_itemid = %u", $this->db->prefix('group_permission'), $module->getVar('mid')); $this->db->query($sql); @@ -612,11 +583,11 @@ /** * Load some modules * - * @param object $criteria {@link CriteriaElement} + * @param CriteriaElement|null $criteria {@link CriteriaElement} * @param boolean $id_as_key Use the ID as key into the array * @return array */ - function getObjects($criteria = null, $id_as_key = false) + public function getObjects(CriteriaElement $criteria = null, $id_as_key = false) { $ret = array(); $limit = $start = 0; @@ -645,35 +616,17 @@ } /** - * Count some modules - * - * @param object $criteria {@link CriteriaElement} - * @return int - */ - function getCount($criteria = null) - { - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('modules'); - if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { - $sql .= ' ' . $criteria->renderWhere(); - } - if (!$result = $this->db->query($sql)) { - return 0; - } - list ($count) = $this->db->fetchRow($result); - return $count; - } - - /** * returns an array of module names * - * @param bool $criteria + * @param CriteriaElement|null $criteria * @param boolean $dirname_as_key if true, array keys will be module directory names * if false, array keys will be module id * @return array */ - function getList($criteria = null, $dirname_as_key = false) + function getList(CriteriaElement $criteria = null, $dirname_as_key = false) { $ret = array(); + //TODO we could use getAll to save memory(trabis) $modules = $this->getObjects($criteria, true); foreach (array_keys($modules) as $i) { if (!$dirname_as_key) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-08 13:56:08 UTC (rev 7812) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-08 18:30:34 UTC (rev 7813) @@ -29,17 +29,16 @@ * @package kernel * @subpackage notification * - * @author Michael van Dam <mv...@ca...> - * @copyright copyright (c) 2000-2003 XOOPS.org + * @author Michael van Dam <mv...@ca...> + * @copyright copyright (c) 2000-2003 XOOPS.org */ class XoopsNotification extends XoopsObject { /** * Constructor **/ - function XoopsNotification() + public function __construct() { - $this->XoopsObject(); $this->initVar('not_id', XOBJ_DTYPE_INT, NULL, false); $this->initVar('not_modid', XOBJ_DTYPE_INT, NULL, false); $this->initVar('not_category', XOBJ_DTYPE_TXTBOX, null, false, 30); @@ -58,65 +57,73 @@ /** - * Returns Class Base Variable not_id + * @param string $format + * @return mixed */ - function id($format = 'N') + public function id($format = 'n') { return $this->getVar('not_id', $format); } /** - * Returns Class Base Variable not_id + * @param string $format + * @return mixed */ - function not_id($format = '') + public function not_id($format = '') { return $this->getVar('not_id', $format); } /** - * Returns Class Base Variable not_modid + * @param string $format + * @return mixed */ - function not_modid($format = '') + public function not_modid($format = '') { return $this->getVar('not_modid', $format); } /** - * Returns Class Base Variable mid + * @param string $format + * @return mixed */ - function not_category($format = '') + public function not_category($format = '') { return $this->getVar('not_category', $format); } /** - * Returns Class Base Variable not_itemid + * @param string $format + * @return mixed */ - function not_itemid($format = '') + public function not_itemid($format = '') { return $this->getVar('not_itemid', $format); } /** - * Returns Class Base Variable not_event + * @param string $format + * @return mixed */ - function not_event($format = '') + public function not_event($format = '') { return $this->getVar('not_event', $format); } /** - * Returns Class Base Variable not_uid + * @param string $format + * @return mixed */ - function not_uid($format = '') + public function not_uid($format = '') { return $this->getVar('not_uid', $format); } /** - * Returns Class Base Variable not_mode + * @param string $format + * @return mixed */ - function not_mode($format = '') + public function not_mode($format = '') { return $this->getVar('not_mode', $format); } @@ -129,11 +136,16 @@ * @param string $subject Subject line for notification message * @param array $tags Array of substitutions for template variables * - * @return bool true if success, false if error + * @return bool true if success, false if error **/ - function notifyUser($template_dir, $template, $subject, $tags) + public function notifyUser($template_dir, $template, $subject, $tags) { - // Check the user's notification preference. + /** + * @var $member_handler XoopsMemberHandler + * @var $config_handler XoopsConfigHandler + */ + + // Check the user's notification preference. $member_handler = xoops_gethandler('member'); $user = $member_handler->getUser($this->getVar('not_uid')); if (!is_object($user)) { @@ -144,24 +156,24 @@ $xoopsMailer = xoops_getMailer(); include_once $GLOBALS['xoops']->path('include/notification_constants.php'); switch ($method) { - case XOOPS_NOTIFICATION_METHOD_PM: - $xoopsMailer->usePM(); - $config_handler = xoops_gethandler('config'); - $xoopsMailerConfig = $config_handler->getConfigsByCat(XOOPS_CONF_MAILER); - $xoopsMailer->setFromUser($member_handler->getUser($xoopsMailerConfig['fromuid'])); - foreach ($tags as $k => $v) { - $xoopsMailer->assign($k, $v); - } - break; - case XOOPS_NOTIFICATION_METHOD_EMAIL: - $xoopsMailer->useMail(); - foreach ($tags as $k => $v) { - $xoopsMailer->assign($k, preg_replace("/&/i", '&', $v)); - } - break; - default: - return true; // report error in user's profile?? - break; + case XOOPS_NOTIFICATION_METHOD_PM: + $xoopsMailer->usePM(); + $config_handler = xoops_gethandler('config'); + $xoopsMailerConfig = $config_handler->getConfigsByCat(XOOPS_CONF_MAILER); + $xoopsMailer->setFromUser($member_handler->getUser($xoopsMailerConfig['fromuid'])); + foreach ($tags as $k => $v) { + $xoopsMailer->assign($k, $v); + } + break; + case XOOPS_NOTIFICATION_METHOD_EMAIL: + $xoopsMailer->useMail(); + foreach ($tags as $k => $v) { + $xoopsMailer->assign($k, preg_replace("/&/i", '&', $v)); + } + break; + default: + return true; // report error in user's profile?? + break; } // Set up the mailer @@ -204,124 +216,29 @@ * @package kernel * @subpackage notification * - * @author Michael van Dam <mv...@ca...> - * @copyright copyright (c) 2000-2003 XOOPS.org + * @author Michael van Dam <mv...@ca...> + * @copyright copyright (c) 2000-2003 XOOPS.org */ -class XoopsNotificationHandler extends XoopsObjectHandler +class XoopsNotificationHandler extends XoopsPersistableObjectHandler { /** - * Create a {@link XoopsNotification} + * Constructor * - * @param bool $isNew Flag the object as "new"? - * - * @return object + * @param XoopsDatabase|null $db {@link XoopsDatabase} */ - function create($isNew = true) + public function __construct(XoopsDatabase $db = null) { - $notification = new XoopsNotification(); - if ($isNew) { - $notification->setNew(); - } - return $notification; + parent::__construct($db, 'xoopsnotifications', 'XoopsNotification', 'not_id', 'not_itemid'); } /** - * Retrieve a {@link XoopsNotification} - * - * @param int $id ID - * - * @return object {@link XoopsNotification}, FALSE on fail - **/ - function get($id) - { - $notification = false; - $id = intval($id); - if ($id > 0) { - $sql = 'SELECT * FROM ' . $this->db->prefix('xoopsnotifications') . ' WHERE not_id=' . $id; - if (!$result = $this->db->query($sql)) { - return $notification; - } - $numrows = $this->db->getRowsNum($result); - if ($numrows == 1) { - $notification = new XoopsNotification(); - $notification->assignVars($this->db->fetchArray($result)); - } - } - return $notification; - } - - /** - * Write a notification(subscription) to database - * - * @param object &$notification - * - * @return bool - **/ - function insert(&$notification) - { - /** - * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($notification, 'xoopsnotification')) { - return false; - } - if (!$notification->isDirty()) { - return true; - } - if (!$notification->cleanVars()) { - return false; - } - foreach ($notification->cleanVars as $k => $v) { - ${$k} = $v; - } - if ($notification->isNew()) { - $not_id = $this->db->genId('xoopsnotifications_not_id_seq'); - $sql = sprintf("INSERT INTO %s (not_id, not_modid, not_itemid, not_category, not_uid, not_event, not_mode) VALUES (%u, %u, %u, %s, %u, %s, %u)", $this->db->prefix('xoopsnotifications'), $not_id, $not_modid, $not_itemid, $this->db->quoteString($not_category), $not_uid, $this->db->quoteString($not_event), $not_mode); - } else { - $sql = sprintf("UPDATE %s SET not_modid = %u, not_itemid = %u, not_category = %s, not_uid = %u, not_event = %s, not_mode = %u WHERE not_id = %u", $this->db->prefix('xoopsnotifications'), $not_modid, $not_itemid, $this->db->quoteString($not_category), $not_uid, $this->db->quoteString($not_event), $not_mode, $not_id); - } - if (!$result = $this->db->query($sql)) { - return false; - } - if (empty($not_id)) { - $not_id = $this->db->getInsertId(); - } - $notification->assignVar('not_id', $not_id); - return true; - } - - /** - * Delete a {@link XoopsNotification} from the database - * - * @param object &$notification - * - * @return bool - **/ - function delete(&$notification) - { - /** - * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($notification, 'xoopsnotification')) { - return false; - } - - $sql = sprintf("DELETE FROM %s WHERE not_id = %u", $this->db->prefix('xoopsnotifications'), $notification->getVar('not_id')); - if (!$result = $this->db->query($sql)) { - return false; - } - return true; - } - - /** * Get some {@link XoopsNotification}s * - * @param object $criteria + * @param CriteriaElement|null $criteria * @param bool $id_as_key Use IDs as keys into the array? - * * @return array Array of {@link XoopsNotification} objects - **/ - function getObjects($criteria = null, $id_as_key = false) + */ + public function getObjects(CriteriaElement $criteria = null, $id_as_key = false) { $ret = array(); $limit = $start = 0; @@ -350,50 +267,19 @@ return $ret; } - // TODO: Need this?? /** - * Count Notifications + * @todo rename this + * Also, should we have get by module, get by category, etc...?? * - * @param object $criteria {@link CriteriaElement} - * - * @return int Count - **/ - function getCount($criteria = null) + * @param int $module_id + * @param string $category + * @param int $item_id + * @param string $event + * @param int $user_id + * @return array|bool + */ + public function getNotification($module_id, $category, $item_id, $event, $user_id) { - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('xoopsnotifications'); - if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { - $sql .= ' ' . $criteria->renderWhere(); - } - if (!$result = $this->db->query($sql)) { - return 0; - } - list ($count) = $this->db->fetchRow($result); - return $count; - } - - /** - * Delete multiple notifications - * - * @param object $criteria {@link CriteriaElement} - * - * @return bool - **/ - function deleteAll($criteria = null) - { - $sql = 'DELETE FROM ' . $this->db->prefix('xoopsnotifications'); - if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { - $sql .= ' ' . $criteria->renderWhere(); - } - if (!$result = $this->db->query($sql)) { - return false; - } - return true; - } - - // TODO: rename this... - // Also, should we have get by module, get by category, etc...?? - function getNotification($module_id, $category, $item_id, $event, $user_id) - { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('not_modid', intval($module_id))); $criteria->add(new Criteria('not_category', mysql_real_escape_string($category))); @@ -417,9 +303,9 @@ * @param string $event Event * @param int $module_id ID of module (default current module) * @param int $user_id ID of user (default current user) - * return int 0 if not subscribe; non-zero if subscribed + * @return int 0 if not subscribe; non-zero if subscribed */ - function isSubscribed($category, $item_id, $event, $module_id, $user_id) + public function isSubscribed($category, $item_id, $event, $module_id, $user_id) { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('not_modid', intval($module_id))); @@ -431,12 +317,13 @@ } - // TODO: how about a function to subscribe a whole group of users??? - // e.g. if we want to add all moderators to be notified of subscription - // of new threads... /** * Subscribe for notification for an event(s) * + * @todo: how about a function to subscribe a whole group of users??? + * e.g. if we want to add all moderators to be notified of subscription + * of new threads... + * * @param string $category category of notification * @param int $item_id ID of the item * @param mixed $events event string or array of events @@ -444,8 +331,9 @@ * (e.g. once_only) (default to current user preference) * @param int $module_id ID of the module (default to current module) * @param int $user_id ID of the user (default to current user) - **/ - function subscribe($category, $item_id, $events, $mode = null, $module_id = null, $user_id = null) + * @return bool + */ + public function subscribe($category, $item_id, $events, $mode = null, $module_id = null, $user_id = null) { if (!isset($user_id)) { global $xoopsUser; @@ -485,31 +373,39 @@ $this->insert($notification); } } + return true; } - // TODO: this will be to provide a list of everything a particular - // user has subscribed to... e.g. for on the 'Profile' page, similar - // to how we see the various posts etc. that the user has made. - // We may also want to have a function where we can specify module id + /** * Get a list of notifications by user ID * - * @param int $user_id ID of the user + * @todo this will be to provide a list of everything a particular + * user has subscribed to... e.g. for on the 'Profile' page, similar + * to how we see the various posts etc. that the user has made. + * We may also want to have a function where we can specify module id * + * @param int $user_id ID of the user * @return array Array of {@link XoopsNotification} objects **/ - function getByUser($user_id) + public function getByUser($user_id) { $criteria = new Criteria('not_uid', $user_id); return $this->getObjects($criteria, true); } - // TODO: rename this?? /** * Get a list of notification events for the current item/mod/user * - **/ - function getSubscribedEvents($category, $item_id, $module_id, $user_id) + * @todo rename this? + * + * @param string $category + * @param int $item_id + * @param int $module_id + * @param int $user_id + * @return array + */ + public function getSubscribedEvents($category, $item_id, $module_id, $user_id) { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('not_modid', intval($module_id))); @@ -526,17 +422,18 @@ return $ret; } - // TODO: is this a useful function?? (Copied from comment_handler) /** * Retrieve items by their ID * + * @todo is this a useful function?? (Copied from comment_handler) + * * @param int $module_id Module ID * @param int $item_id Item ID * @param string $order Sort order - * + * @param int $status * @return array Array of {@link XoopsNotification} objects - **/ - function getByItemId($module_id, $item_id, $order = null, $status = null) + */ + public function getByItemId($module_id, $item_id, $order = null, $status = null) { $criteria = new CriteriaCompo(new Criteria('com_modid', intval($module_id))); $criteria->add(new Criteria('com_itemid', intval($item_id))); @@ -552,22 +449,23 @@ /** * Send notifications to users * + * @todo(?) - pass in an event LIST. This will help to avoid + * problem of sending people multiple emails for similar events. + * BUT, then we need an array of mail templates, etc... Unless + * mail templates can include logic in the future, then we can + * tailor the mail so it makes sense for any of the possible + * (or combination of) events. + * * @param string $category notification category * @param int $item_id ID of the item - * @param string $event notification event + * @param string $events notification event * @param array $extra_tags array of substitutions for template to be * merged with the one from function.. * @param array $user_list only notify the selected users * @param int $module_id ID of the module * @param int $omit_user_id ID of the user to omit from notifications. (default to current user). set to 0 for all users to receive notification. - **/ - // TODO:(?) - pass in an event LIST. This will help to avoid - // problem of sending people multiple emails for similar events. - // BUT, then we need an array of mail templates, etc... Unless - // mail templates can include logic in the future, then we can - // tailor the mail so it makes sense for any of the possible - // (or combination of) events. - function triggerEvents($category, $item_id, $events, $extra_tags = array(), $user_list = array(), $module_id = null, $omit_user_id = null) + */ + public function triggerEvents($category, $item_id, $events, $extra_tags = array(), $user_list = array(), $module_id = null, $omit_user_id = null) { if (!is_array($events)) { $events = array($events); @@ -578,8 +476,6 @@ } /** - * Enter description here... - * * @param int $category * @param int $item_id * @param int $event @@ -587,15 +483,18 @@ * @param array $user_list * @param int $module_id * @param int $omit_user_id - * @return unknown + * @return bool */ - function triggerEvent($category, $item_id, $event, $extra_tags = array(), $user_list = array(), $module_id = null, $omit_user_id = null) + public function triggerEvent($category, $item_id, $event, $extra_tags = array(), $user_list = array(), $module_id = null, $omit_user_id = null) { + /** + * @var $config_handler XoopsConfigHandler + */ if (!isset($module_id)) { global $xoopsModule; $module = $xoopsModule; - $module_id =! empty($xoopsModule) ? $xoopsModule->getVar('mid') : 0; + $module_id = !empty($xoopsModule) ? $xoopsModule->getVar('mid') : 0; } else { $module_handler = xoops_gethandler('module'); $module = $module_handler->get($module_id); @@ -640,7 +539,7 @@ } $notifications = $this->getObjects($criteria); if (empty($notifications)) { - return; + return false; } // Add some tag substitutions here @@ -653,7 +552,7 @@ if (file_exists($tags_file)) { include_once $tags_file; if (!empty($not_config['tags_func'])) { - $tags_func = $not_config['tags_func']; + $tags_func = (string)$not_config['tags_func']; if (function_exists($tags_func)) { $tags = $tags_func($category, intval($item_id), $event); } @@ -661,12 +560,12 @@ } } // RMV-NEW - if (! empty($not_config['lookup_file'])) { + if (!empty($not_config['lookup_file'])) { $lookup_file = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname') . '/' . $not_config['lookup_file']); if (file_exists($lookup_file)) { include_once $lookup_file; if (!empty($not_config['lookup_func'])) { - $lookup_func = $not_config['lookup_func']; + $lookup_func = (string)$not_config['lookup_func']; if (function_exists($lookup_func)) { $item_info = $lookup_func($category, intval($item_id)); } @@ -674,9 +573,10 @@ } } } - $tags['X_ITEM_NAME'] = ! empty($item_info['name']) ? $item_info['name'] : '[' . _NOT_ITEMNAMENOTAVAILABLE . ']'; - $tags['X_ITEM_URL'] = ! empty($item_info['url']) ? $item_info['url'] : '[' . _NOT_ITEMURLNOTAVAILABLE . ']'; - $tags['X_ITEM_TYPE'] = ! empty($category_info['item_name']) ? $category_info['title'] : '[' . _NOT_ITEMTYPENOTAVAILABLE . ']'; + $tags['X_ITEM_NAME'] = !empty($item_info['name']) ? $item_info['name'] : '[' . _NOT_ITEMNAMENOTAVAILABLE . ']'; + $tags['X_ITEM_URL'] = !empty($item_info['url']) ? $item_info['url'] : '[' . _NOT_ITEMURLNOTAVAILABLE . ']'; + $tags['X_ITEM_TYPE'] = !empty($category_info['item_name']) ? $category_info['title'] + : '[' . _NOT_ITEMTYPENOTAVAILABLE . ']'; $tags['X_MODULE'] = $module->getVar('name'); $tags['X_MODULE_URL'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/'; $tags['X_NOTIFY_CATEGORY'] = $category; @@ -687,6 +587,7 @@ $subject = $event_info['mail_subject']; foreach ($notifications as $notification) { + /* @var $notification XoopsNotification */ if (empty($omit_user_id) || $notification->getVar('not_uid') != $omit_user_id) { // user-specific tags //$tags['X_UNSUBSCRIBE_URL'] = 'TODO'; @@ -696,6 +597,7 @@ $notification->notifyUser($template_dir, $template, $subject, $tags); } } + return true; } /** @@ -704,16 +606,17 @@ * @param int $user_id ID of the user * @return bool **/ - function unsubscribeByUser($user_id) + public function unsubscribeByUser($user_id) { $criteria = new Criteria('not_uid', intval($user_id)); return $this->deleteAll($criteria); } - // TODO: allow these to use current module, etc... /** * Unsubscribe notifications for an event(s). * + * @todo allow these to use current module, etc... + * * @param string $category category of the events * @param int $item_id ID of the item * @param mixed $events event string or array of events @@ -721,8 +624,8 @@ * @param int $user_id UID of the user (default current user) * * @return bool - **/ - function unsubscribe($category, $item_id, $events, $module_id = null, $user_id = null) + */ + public function unsubscribe($category, $item_id, $events, $module_id = null, $user_id = null) { if (!isset($user_id)) { global $xoopsUser; @@ -752,16 +655,15 @@ return $this->deleteAll($criteria); } - // TODO: When 'update' a module, may need to switch around some - // notification classes/IDs... or delete the ones that no longer - // exist. /** * Delete all notifications for a particular module * + * @todo When 'update' a module, may need to switch around some + * * @param int $module_id ID of the module * @return bool **/ - function unsubscribeByModule($module_id) + public function unsubscribeByModule($module_id) { $criteria = new Criteria('not_modid', intval($module_id)); return $this->deleteAll($criteria); @@ -776,7 +678,7 @@ * * @return bool **/ - function unsubscribeByItem($module_id, $category, $item_id) + public function unsubscribeByItem($module_id, $category, $item_id) { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('not_modid', intval($module_id))); @@ -793,7 +695,7 @@ * * @param int $user_id ID of the user being logged in **/ - function doLoginMaintenance($user_id) + public function doLoginMaintenance($user_id) { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('not_uid', intval($user_id))); @@ -801,6 +703,7 @@ $notifications = $this->getObjects($criteria, true); foreach ($notifications as $n) { + /* @var $n XoopsNotification*/ $n->setVar('not_mode', XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT); $this->insert($n); } @@ -809,13 +712,13 @@ /** * Update * - * @param object &$notification {@link XoopsNotification} object + * @param XoopsNotification &$notification {@link XoopsNotification} object * @param string $field_name Name of the field * @param mixed $field_value Value to write * * @return bool **/ - function updateByField(&$notification, $field_name, $field_value) + public function updateByField(XoopsNotification &$notification, $field_name, $field_value) { $notification->unsetNew(); $notification->setVar($field_name, $field_value); @@ -823,4 +726,5 @@ } } + ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2011-10-08 13:56:08 UTC (rev 7812) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2011-10-08 18:30:34 UTC (rev 7813) @@ -292,7 +292,9 @@ if (isset($this->vars[$key])) { if (is_object($this->vars[$key]) && is_a($this->vars[$key], 'XoopsObject')) { if ($maxDepth) { - $vars[$key] = $this->vars[$key]->getValues(null, $format, $maxDepth - 1); + /* @var $obj XoopsObject */ + $obj = $this->vars[$key]; + $vars[$key] = $obj->getValues(null, $format, $maxDepth - 1); } } else { $vars[$key] = $this->getVar($key, $format); @@ -637,6 +639,7 @@ */ public function xoopsClone() { + /* @var $clone XoopsObject */ $class = get_class($this); $clone = null; $clone = new $class(); @@ -719,7 +722,7 @@ /** * called from child classes only * - * @param object $db reference to the {@link XoopsDatabase} object + * @param XoopsDatabase $db reference to the {@link XoopsDatabase} object * @access protected */ function __construct($db) @@ -945,6 +948,7 @@ */ function create($isNew = true) { + /* @var $obj XoopsObject */ $obj = new $this->className(); if ($isNew === true) { $obj->setNew(); @@ -1006,6 +1010,7 @@ */ function insert(XoopsObject $object, $force = true) { + /* @var $handler XoopsModelWrite */ $handler = $this->loadHandler('write'); return $handler->insert($object, $force); } @@ -1019,6 +1024,7 @@ */ function delete(XoopsObject $object, $force = false) { + /* @var $handler XoopsModelWrite */ $handler = $this->loadHandler('write'); return $handler->delete($object, $force); } @@ -1033,6 +1039,7 @@ */ function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false) { + /* @var $handler XoopsModelWrite */ $handler = $this->loadHandler('write'); return $handler->deleteAll($criteria, $force, $asObject); } @@ -1048,6 +1055,7 @@ */ function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false) { + /* @var $handler XoopsModelWrite */ $handler = $this->loadHandler('write'); return $handler->updateAll($fieldname, $fieldvalue, $criteria, $force); } @@ -1071,6 +1079,7 @@ */ function getObjects(CriteriaElement $criteria = null, $id_as_key = false, $as_object = true) { + /* @var $handler XoopsModelRead */ $handler = $this->loadHandler('read'); $ret = $handler->getObjects($criteria, $id_as_key, $as_object); return $ret; @@ -1087,6 +1096,7 @@ */ function getAll(CriteriaElement $criteria = null, $fields = null, $asObject = true, $id_as_key = true) { + /* @var $handler XoopsModelRead */ $handler = $this->loadHandler('read'); $ret = $handler->getAll($criteria, $fields, $asObject, $id_as_key); return $ret; @@ -1102,6 +1112,7 @@ */ function getList(CriteriaElement $criteria = null, $limit = 0, $start = 0) { + /* @var $handler XoopsModelRead */ $handler = $this->loadHandler('read'); $ret = $handler->getList($criteria, $limit, $start); return $ret; @@ -1115,31 +1126,13 @@ */ function getIds(CriteriaElement $criteria = null) { + /* @var $handler XoopsModelRead */ $handler = $this->loadHandler('read'); $ret = $handler->getIds($criteria); return $ret; } /** - * get a limited list of objects matching a condition - * - * {@link CriteriaCompo} - * - * @param int $limit Max number of objects to fetch - * @param int $start Which record to start at - * @param CriteriaElement|null $criteria {@link CriteriaElement} to match - * @param array $fields variables to fetch - * @param bool $asObject flag indicating as object, otherwise as array - * @return array of objects {@link XoopsObject} - */ - function getByLimit($limit = 0, $start = 0, CriteriaElement $criteria = null, $fields = null, $asObject = true) - { - $handler = $this->loadHandler('read'); - $ret = $handler->getByLimit($limit, $start, $criteria, $fields, $asObject); - return $ret; - } - - /** * *#@- */ @@ -1155,6 +1148,7 @@ */ function getCount(CriteriaElement $criteria = null) { + /* @var $handler XoopsModelStats */ $handler = $this->loadHandler('stats'); return $handler->getCount($criteria); } @@ -1167,6 +1161,7 @@ */ function getCounts(CriteriaElement $criteria = null) { + /* @var $handler XoopsModelStats*/ $handler = $this->loadHandler('stats'); return $handler->getCounts($criteria); } @@ -1191,6 +1186,7 @@ */ function getByLink(CriteriaElement $criteria = null, $fields = null, $asObject = true, $field_link = null, $field_object = null) { + /* @var $handler XoopsModelJoint */ $handler = $this->loadHandler('joint'); $ret = $handler->getByLink($criteria, $fields, $asObject, $field_link, $field_object); return $ret; @@ -1204,6 +1200,7 @@ */ function getCountByLink(CriteriaElement $criteria = null) { + /* @var $handler XoopsModelJoint */ $handler = $this->loadHandler('joint'); $ret = $handler->getCountByLink($criteria); return $ret; @@ -1217,6 +1214,7 @@ */ function getCountsByLink(CriteriaElement $criteria = null) { + /* @var $handler XoopsModelJoint */ $handler = $this->loadHandler('joint'); $ret = $handler->getCountsByLink($criteria); return $ret; @@ -1231,6 +1229,7 @@ */ function updateByLink($data, CriteriaElement $criteria = null) { + /* @var $handler XoopsModelJoint */ $handler = $this->loadHandler('joint'); $ret = $handler->updateByLink($data, $criteria); return $ret; @@ -1244,6 +1243,7 @@ */ function deleteByLink(CriteriaElement $criteria = null) { + /* @var $handler XoopsModelJoint */ $handler = $this->loadHandler('joint'); $ret = $handler->deleteByLink($criteria); return $ret; @@ -1267,6 +1267,7 @@ */ function cleanOrphan($table_link = '', $field_link = '', $field_object = '') { + /* @var $handler XoopsModelSync */ $handler = $this->loadHandler('sync'); $ret = $handler->cleanOrphan($table_link, $field_link, $field_object); return $ret; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/online.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/online.php 2011-10-08 13:56:08 UTC (rev 7812) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/online.php 2011-10-08 18:30:34 UTC (rev 7813) @@ -19,45 +19,104 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** - * A handler for "Who is Online?" information + * Online object * - * @package kernel + * @author trabis <lus...@gm...> + * @copyright copyright (c) 2000 XOOPS.org * - * @author Kazumi Ono <on...@xo...> - * @copyright copyright (c) 2000-2003 XOOPS.org + * @package kernel */ -class XoopsOnlineHandler +class XoopsOnline extends XoopsObject { /** - * Database connection - * - * @var object - * @access private + * Constructor */ - var $db; + function __construct() + { + $this->initVar('online_uid', XOBJ_DTYPE_INT, null, false); + $this->initVar('online_uname', XOBJ_DTYPE_TXTBOX, null, true); + $this->initVar('online_updated', XOBJ_DTYPE_INT, null, true); + $this->initVar('online_module', XOBJ_DTYPE_INT, null, true); + $this->initVar('online_ip', XOBJ_DTYPE_TXTBOX, null, true); + } /** + * @param string $format + * @return mixed + */ + public function online_uid($format = 'n') + { + return $this->getVar('online_uid', $format); + } + + /** + * @param string $format + * @return mixed + */ + public function online_uname($format = '') + { + return $this->getVar('online_uname', $format); + } + + /** + * @param string $format + * @return mixed + */ + public function online_updated($format = '') + { + return $this->getVar('online_updated', $format); + } + + /** + * @param string $format + * @return mixed + */ + public function online_module($format = '') + { + return $this->getVar('online_module', $format); + } + + /** + * @param string $format + * @return mixed + */ + public function online_ip($format = '') + { + return $this->getVar('online_ip', $format); + } + +} +/** + * A handler for "Who is Online?" information + * + * @package kernel + * + * @author Kazumi Ono <on...@xo...> + * @copyright copyright (c) 2000-2003 XOOPS.org + */ +class XoopsOnlineHandler extends XoopsPersistableObjectHandler +{ + /** * Constructor * - * @param object &$db {@link XoopsHandlerFactory} + * @param XoopsDatabase|null $db {@link XoopsDatabase} */ - function XoopsOnlineHandler(&$db) + public function __construct(XoopsDatabase $db = null) { - $this->db = $db; + parent::__construct($db, 'online', 'XoopsOnline', 'online_uid', 'online_uname'); } /** * Write online information to the database * - * @param int $uid UID of the active user - * @param string $uname Username - * @param string $timestamp - * @param string $module Current module - * @param string $ip User's IP adress - * - * @return bool TRUE on success + * @param int $uid UID of the active user + * @param string $uname Username + * @param string $time + * @param string $module Current module + * @param string $ip User's IP adress + * @return bool TRUE on success */ - function write($uid, $uname, $time, $module, $ip) + public function write($uid, $uname, $time, $module, $ip) { $uid = intval($uid); if ($uid > 0) { @@ -83,14 +142,13 @@ /** * Delete online information for a user * - * @param int $uid UID - * - * @return bool TRUE on success + * @param int $uid UID + * @return bool TRUE on success */ - function destroy($uid) + public function destroy($uid) { - $sql = sprintf("DELETE FROM %s WHERE online_uid = %u", $this->db->prefix('online'), $uid); - if (!$result = $this->db->queryF($sql)) { + $criteria = new Criteria('online_uid', intval($uid)); + if (!$this->deleteAll($criteria)) { return false; } return true; @@ -101,57 +159,18 @@ * * Delete all online information that has not been updated for a certain time * - * @param int $expire Expiration time in seconds + * @param int $expire Expiration time in seconds + * @return bool */ - function gc($expire) + public function gc($expire) { - $sql = sprintf("DELETE FROM %s WHERE online_updated < %u", $this->db->prefix('online'), time() - intval($expire)); - $this->db->queryF($sql); - } - - /** - * Get an array of online information - * - * @param object $criteria {@link CriteriaElement} - * @return array Array of associative arrays of online information - */ - function getAll($criteria = null) - { - $ret = array(); - $limit = $start = 0; - $sql = 'SELECT * FROM ' . $this->db->prefix('online'); - if (is_object($criteria) && is_subclass_of($criteria, 'criteriaelement')) { - $sql .= ' ' . $criteria->renderWhere(); - $limit = $criteria->getLimit(); - $start = $criteria->getStart(); - } - $result = $this->db->query($sql, $limit, $start); - if (!$result) { + $criteria = new CriteriaCompo('online_updated', time() - intval($expire), '<'); + if (!$this->deleteAll($criteria)) { return false; } - while ($myrow = $this->db->fetchArray($result)) { - $ret[] = $myrow; - unset($myrow); - } - return $ret; + return true; } - /** - * Count the number of online users - * - * @param object $criteria {@link CriteriaElement} - */ - function getCount($criteria = null) - { - $sql = 'SELEC... [truncated message content] |
From: <tr...@us...> - 2011-10-08 20:35:47
|
Revision: 7814 http://xoops.svn.sourceforge.net/xoops/?rev=7814&view=rev Author: trabis Date: 2011-10-08 20:35:39 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Finishing kernel and class/model refactoring Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/database.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/model/stats.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/sync.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/module.textsanitizer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/resource.db.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/avatar.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/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.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/kernel/tplset.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php 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 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/database.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -135,6 +135,7 @@ /** * @param $result + * @return array * @abstract */ function fetchArray($result) 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 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -41,8 +41,9 @@ * Validate information for the linkship * * @access private + * @return bool|null */ - function validateLinks() + private function validateLinks() { if (empty($this->handler->table_link) || empty($this->handler->field_link)) { trigger_error("The linked table is not set yet.", E_USER_WARNING); @@ -57,14 +58,14 @@ /** * get a list of objects matching a condition joint with another related object * - * @param object $criteria {@link CriteriaElement} to match + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match * @param array $fields variables to fetch * @param bool $asObject flag indicating as object, otherwise as array * @param string $field_link field of linked object for JOIN; deprecated, for backward compat * @param string $field_object field of current object for JOIN; deprecated, for backward compat * @return array of objects {@link XoopsObject} */ - function getByLink($criteria = null, $fields = null, $asObject = true, $field_link = null, $field_object = null) + public function getByLink(CriteriaElement $criteria = null, $fields = null, $asObject = true, $field_link = null, $field_object = null) { if (!empty($field_link)) { $this->handler->field_link = $field_link; @@ -125,10 +126,10 @@ /** * Count of objects matching a condition * - * @param object $criteria {@link CriteriaElement} to match + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match * @return int count of objects */ - function getCountByLink($criteria = null) + public function getCountByLink(CriteriaElement $criteria = null) { if (!$this->validateLinks()) { return null; @@ -150,10 +151,10 @@ /** * array of count of objects matching a condition of, groupby linked object keyname * - * @param object $criteria {@link CriteriaElement} to match + * @param CriteriaElement $criteria {@link CriteriaElement} to match * @return int count of objects */ - function getCountsByLink($criteria = null) + public function getCountsByLink(CriteriaElement $criteria = null) { if (!$this->validateLinks()) { return null; @@ -179,10 +180,10 @@ * upate objects matching a condition against linked objects * * @param array $data array of key => value - * @param object $criteria {@link CriteriaElement} to match + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match * @return int count of objects */ - function updateByLink($data, $criteria = null) + function updateByLink($data, CriteriaElement $criteria = null) { if (!$this->validateLinks()) { return null; @@ -203,10 +204,10 @@ /** * Delete objects matching a condition against linked objects * - * @param object $criteria {@link CriteriaElement} to match + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match * @return int count of objects */ - function deleteByLink($criteria = null) + function deleteByLink(CriteriaElement $criteria = null) { if (!$this->validateLinks()) { return null; 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 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -32,13 +32,13 @@ /** * get all objects matching a condition * - * @param object $criteria {@link CriteriaElement} to match + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match * @param array $fields variables to fetch * @param bool $asObject flag indicating as object, otherwise as array * @param bool $id_as_key use the ID as key for the array * @return array of objects/array {@link XoopsObject} */ - function getAll(CriteriaElement $criteria = null, $fields = null, $asObject = true, $id_as_key = true) + public function getAll(CriteriaElement $criteria = null, $fields = null, $asObject = true, $id_as_key = true) { if (is_array($fields) && count($fields) > 0) { if (!in_array($this->handler->keyName, $fields)) { @@ -99,12 +99,12 @@ * * For performance consideration, getAll() is recommended * - * @param object $criteria {@link CriteriaElement} conditions to be met + * @param CriteriaElement|null $criteria {@link CriteriaElement} conditions to be met * @param bool $id_as_key use the ID as key for the array * @param bool $as_object return an array of objects? * @return array */ - function getObjects(CriteriaElement $criteria = null, $id_as_key = false, $as_object = true) + public function getObjects(CriteriaElement $criteria = null, $id_as_key = false, $as_object = true) { $objects = $this->getAll($criteria, null, $as_object, $id_as_key); return $objects; @@ -113,12 +113,12 @@ /** * Retrieve a list of objects data * - * @param object $criteria {@link CriteriaElement} conditions to be met + * @param CriteriaElement|null $criteria {@link CriteriaElement} conditions to be met * @param int $limit Max number of objects to fetch * @param int $start Which record to start at * @return array */ - function getList(CriteriaElement $criteria = null, $limit = 0, $start = 0) + public function getList(CriteriaElement $criteria = null, $limit = 0, $start = 0) { $ret = array(); if ($criteria == null) { @@ -154,7 +154,7 @@ /** * get IDs of objects matching a condition * - * @param object $criteria {@link CriteriaElement} to match + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match * @return array of object IDs */ function getIds(CriteriaElement $criteria = null) Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/stats.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/stats.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/stats.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -32,10 +32,10 @@ /** * count objects matching a condition * - * @param object $criteria {@link CriteriaElement} to match + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match * @return int count of objects */ - function getCount($criteria = null) + public function getCount(CriteriaElement $criteria = null) { $field = ''; $groupby = false; @@ -69,10 +69,10 @@ /** * get counts matching a condition * - * @param object $criteria {@link CriteriaElement} to match - * @return array of conunts + * @param CriteriaElement|null $criteria {@link CriteriaElement} to match + * @return array of counts */ - function getCounts($criteria = null) + public function getCounts(CriteriaElement $criteria = null) { $ret = array(); $sql_where = ''; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/sync.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/sync.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/sync.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -46,7 +46,7 @@ * @param string $field_object field of current object for JOIN; deprecated, for backward compat * @return bool true on success */ - function cleanOrphan($table_link = '', $field_link = '', $field_object = '') + public function cleanOrphan($table_link = '', $field_link = '', $field_object = '') { if (!empty($table_link)) { $this->handler->table_link = $table_link; @@ -75,7 +75,7 @@ . " LEFT JOIN `{$this->handler->table_link}` AS aa ON `{$this->handler->table}`.`{$this->handler->field_object}` = aa.`{$this->handler->field_link}`" . " WHERE (aa.`{$this->handler->field_link}` IS NULL)"; } - if (!$result = $this->handler->db->queryF($sql)) { + if (!$this->handler->db->queryF($sql)) { return false; } return true; @@ -84,10 +84,10 @@ /** * Synchronizing objects * @deprecated - * + * * @return bool true on success */ - function synchronization() + public function synchronization() { $retval = $this->cleanOrphan(); return $retval; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -37,10 +37,12 @@ * CleanVars only contains changed and cleaned variables * Reference is used for PHP4 compliance * + * @param XoopsObject$object + * * @return bool true if successful * @access public */ - function cleanVars(XoopsObject &$object) + public function cleanVars(XoopsObject &$object) { $ts = MyTextSanitizer::getInstance(); $errors = array(); @@ -91,8 +93,6 @@ $cleanv = trim($cleanv); if (!$v['not_gpc']) { $cleanv = $ts->stripSlashesGPC($cleanv); - } else { - $cleanv = $cleanv; } $cleanv = str_replace('\\"', '"', $this->handler->db->quote($cleanv)); break; @@ -178,11 +178,11 @@ /** * insert an object into the database * - * @param object $object {@link XoopsObject} reference to object + * @param XoopsObject $object {@link XoopsObject} reference to object * @param bool $force flag to force the query execution despite security settings * @return mixed object ID */ - function insert(XoopsObject &$object, $force = true) + public function insert(XoopsObject &$object, $force = true) { if (!(class_exists($this->handler->className) && $object instanceof $this->handler->className)) { trigger_error("Object '" . get_class($object) . "' is not an instance of '" . $this->handler->className . "'", E_USER_NOTICE); @@ -208,7 +208,7 @@ trigger_error("Data entry is not inserted - no variable is changed in object of '" . get_class($object) . "'", E_USER_NOTICE); return $object->getVar($this->handler->keyName); } - if (!$result = $this->handler->db->{$queryFunc}($sql)) { + if (!$this->handler->db->{$queryFunc}($sql)) { return false; } if (!$object->getVar($this->handler->keyName) && $object_id = $this->handler->db->getInsertId()) { @@ -220,7 +220,7 @@ $keys[] = " `{$k}` = {$v}"; } $sql = "UPDATE `" . $this->handler->table . "` SET " . implode(",", $keys) . " WHERE `" . $this->handler->keyName . "` = " . $this->handler->db->quote($object->getVar($this->handler->keyName)); - if (!$result = $this->handler->db->{$queryFunc}($sql)) { + if (!$this->handler->db->{$queryFunc}($sql)) { return false; } } @@ -230,11 +230,11 @@ /** * delete an object from the database * - * @param object $object {@link XoopsObject} reference to the object to delete + * @param XoopsObject $object {@link XoopsObject} reference to the object to delete * @param bool $force * @return bool FALSE if failed. */ - function delete(XoopsObject &$object, $force = false) + public function delete(XoopsObject &$object, $force = false) { if (!(class_exists($this->handler->className) && $object instanceof $this->handler->className)) { trigger_error("Object '" . get_class($object) . "' is not an instance of '" . $this->handler->className . "'", E_USER_NOTICE); @@ -258,12 +258,12 @@ /** * delete all objects matching the conditions * - * @param object $criteria {@link CriteriaElement} with conditions to meet + * @param CriteriaElement|null $criteria {@link CriteriaElement} with conditions to meet * @param bool $force force to delete * @param bool $asObject delete in object way: instantiate all objects and delte one by one * @return bool */ - function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false) + public function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false) { if ($asObject) { $objects = $this->handler->getAll($criteria); @@ -290,11 +290,11 @@ * * @param string $fieldname Name of the field * @param mixed $fieldvalue Value to write - * @param object $criteria {@link CriteriaElement} + * @param CriteriaElement|null $criteria {@link CriteriaElement} * @param bool $force force to query * @return bool */ - function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false) + public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false) { $set_clause = "`{$fieldname}` = "; if (is_numeric($fieldvalue)) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -102,8 +102,7 @@ /** * holds referenced to handler object * - * @var object - * @param object $handler reference to {@link XoopsPersistableObjectHandler} + * @var XoopsPersistableObjectHandler $handler reference to {@link XoopsPersistableObjectHandler} * @access protected */ protected $handler; @@ -111,8 +110,8 @@ /** * XoopsModelAbstract::setHandler() * - * @param object $handler reference to {@link XoopsPersistableObjectHandler} - * @return + * @param XoopsPersistableObjectHandler $handler reference to {@link XoopsPersistableObjectHandler} + * @return true */ function setHandler(XoopsPersistableObjectHandler $handler) { @@ -124,7 +123,7 @@ * XoopsModelAbstract::setVars() * * @param mixed $args - * @return + * @return true */ function setVars($args) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/module.textsanitizer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/module.textsanitizer.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/module.textsanitizer.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -532,7 +532,6 @@ * * @param string $text * @return string - * @deprecated */ function censorString(&$text) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/resource.db.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/resource.db.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/resource.db.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -21,6 +21,7 @@ return false; } if (is_object($tpl)) { + /* @var $tpl XoopsTplfile */ $tpl_source = $tpl->getVar('tpl_source', 'n'); } else { $fp = fopen($tpl, 'r'); @@ -37,6 +38,7 @@ return false; } if (is_object($tpl)) { + /* @var $tpl XoopsTplfile */ $tpl_timestamp = $tpl->getVar('tpl_lastmodified', 'n'); } else { $tpl_timestamp = filemtime($tpl); @@ -65,7 +67,8 @@ } $tplset = $xoopsConfig['template_set']; $theme = isset($xoopsConfig['theme_set']) ? $xoopsConfig['theme_set'] : 'default'; - $tplfile_handler =& xoops_gethandler('tplfile'); + /* @var $tplfile_handler XoopsTplfileHandler */ + $tplfile_handler = xoops_gethandler('tplfile'); // If we're not using the "default" template set, then get the templates from the DB if ($tplset != "default") { $tplobj = $tplfile_handler->find($tplset, null, null, null, $tpl_name, true); @@ -79,6 +82,7 @@ if (!count($tplobj)) { return $cache[$tpl_name] = false; } + /* @var $tplobj XoopsTplfile */ $tplobj = $tplobj[0]; $module = $tplobj->getVar('tpl_module', 'n'); $type = $tplobj->getVar('tpl_type', 'n'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/avatar.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/avatar.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/avatar.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -225,7 +225,7 @@ $sql = sprintf("DELETE FROM %s WHERE user_id = %u", $this->db->prefix('avatar_user_link'), $user_id); $this->db->query($sql); $sql = sprintf("INSERT INTO %s (avatar_id, user_id) VALUES (%u, %u)", $this->db->prefix('avatar_user_link'), $avatar_id, $user_id); - if (!$result = $this->db->query($sql)) { + if (!$this->db->query($sql)) { return false; } 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-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -30,7 +30,7 @@ /** * Constructor * - * @param int $id + * @param int|array $id **/ public function __construct($id = null) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -92,6 +92,7 @@ */ public function getConfig($id, $withoptions = false) { + /* @var $config XoopsConfigItem */ $config = $this->_cHandler->get($id); if ($withoptions == true) { $config->setConfOptions($this->getConfigOptions(new Criteria('conf_id', $id))); @@ -162,11 +163,10 @@ * * @param CriteriaElement|null $criteria {@link CriteriaElement} * @param bool $id_as_key Use the configs' ID as keys? - * @param bool $with_options get the options now? * * @return array Array of {@link XoopsConfigItem} objects */ - public function getConfigs(CriteriaElement $criteria = null, $id_as_key = false, $with_options = false) + public function getConfigs(CriteriaElement $criteria = null, $id_as_key = false) { return $this->_cHandler->getObjects($criteria, $id_as_key); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/image.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/image.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -210,7 +210,7 @@ if ($image->isNew()) { $image_id = $this->db->genId('image_image_id_seq'); $sql = sprintf("INSERT INTO %s (image_id, image_name, image_nicename, image_mimetype, image_created, image_display, image_weight, imgcat_id) VALUES (%u, %s, %s, %s, %u, %u, %u, %u)", $this->db->prefix('image'), $image_id, $this->db->quoteString($image_name), $this->db->quoteString($image_nicename), $this->db->quoteString($image_mimetype), time(), $image_display, $image_weight, $imgcat_id); - if (!$result = $this->db->query($sql)) { + if (!$this->db->query($sql)) { return false; } if (empty($image_id)) { @@ -218,7 +218,7 @@ } if (isset($image_body) && $image_body != '') { $sql = sprintf("INSERT INTO %s (image_id, image_body) VALUES (%u, %s)", $this->db->prefix('imagebody'), $image_id, $this->db->quoteString($image_body)); - if (!$result = $this->db->query($sql)) { + if (!$this->db->query($sql)) { $sql = sprintf("DELETE FROM %s WHERE image_id = %u", $this->db->prefix('image'), $image_id); $this->db->query($sql); return false; @@ -227,12 +227,12 @@ $image->assignVar('image_id', $image_id); } else { $sql = sprintf("UPDATE %s SET image_name = %s, image_nicename = %s, image_display = %u, image_weight = %u, imgcat_id = %u WHERE image_id = %u", $this->db->prefix('image'), $this->db->quoteString($image_name), $this->db->quoteString($image_nicename), $image_display, $image_weight, $imgcat_id, $image_id); - if (!$result = $this->db->query($sql)) { + if (!$this->db->query($sql)) { return false; } if (isset($image_body) && $image_body != '') { $sql = sprintf("UPDATE %s SET image_body = %s WHERE image_id = %u", $this->db->prefix('imagebody'), $this->db->quoteString($image_body), $image_id); - if (!$result = $this->db->query($sql)) { + if (!$this->db->query($sql)) { $this->db->query(sprintf("DELETE FROM %s WHERE image_id = %u", $this->db->prefix('image'), $image_id)); return false; } @@ -258,7 +258,7 @@ $id = $image->getVar('image_id'); $sql = sprintf("DELETE FROM %s WHERE image_id = %u", $this->db->prefix('image'), $id); - if (!$result = $this->db->query($sql)) { + if (!$this->db->query($sql)) { return false; } $sql = sprintf("DELETE FROM %s WHERE image_id = %u", $this->db->prefix('imagebody'), $id); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -452,7 +452,7 @@ * @param int $id ID of the module * @return XoopsModule|false on fail */ - function get($id) + function get($id = null) { static $_cachedModule_dirname; static $_cachedModule_mid; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -826,9 +826,29 @@ /** * @var string */ + public $table_link; + + /** + * @var string + */ public $identifierName; + /** + * @var string + */ + public $field_link; + + /** + * @var string + */ + public $field_object; + /** + * @var string + */ + public $keyName_link; + + /** * Constructor * * @access protected Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -31,9 +31,8 @@ /** * constructor **/ - function XoopsPrivmessage() + public function __construct() { - $this->XoopsObject(); $this->initVar('msg_id', XOBJ_DTYPE_INT, null, false); $this->initVar('msg_image', XOBJ_DTYPE_OTHER, null, false, 100); $this->initVar('subject', XOBJ_DTYPE_TXTBOX, null, true, 255); @@ -45,73 +44,82 @@ } /** - * Returns Class Base Variable msg_id + * @param string $format + * @return mixed */ - function id($format = 'N') + public function id($format = 'n') { return $this->getVar('msg_id', $format); } /** - * Returns Class Base Variable msg_id + * @param string $format + * @return mixed */ - function msg_id($format = '') + public function msg_id($format = '') { return $this->getVar('msg_id', $format); } /** - * Returns Class Base Variable msg_image + * @param string $format + * @return mixed */ - function msg_image($format = '') + public function msg_image($format = '') { return $this->getVar('msg_image', $format); } /** - * Returns Class Base Variable subject + * @param string $format + * @return mixed */ - function subject($format = '') + public function subject($format = '') { return $this->getVar('subject', $format); } /** - * Returns Class Base Variable not_id + * @param string $format + * @return mixed */ - function from_userid($format = '') + public function from_userid($format = '') { return $this->getVar('from_userid', $format); } /** - * Returns Class Base Variable to_userid + * @param string $format + * @return mixed */ - function to_userid($format = '') - { + public function to_userid($format = '') + { return $this->getVar('to_userid', $format); - } + } /** - * Returns Class Base Variable msg_time + * @param string $format + * @return mixed */ - function msg_time($format = '') + public function msg_time($format = '') { return $this->getVar('msg_time', $format); } /** - * Returns Class Base Variable msg_text + * @param string $format + * @return mixed */ - function msg_text($format = '') + public function msg_text($format = '') { return $this->getVar('msg_text', $format); } /** - * Returns Class Base Variable read_msg + * @param string $format + * @return mixed */ - function read_msg($format = '') + public function read_msg($format = '') { return $this->getVar('read_msg', $format); } @@ -124,131 +132,43 @@ * This class is responsible for providing data access mechanisms to the data source * of XOOPS private message class objects. * - * @package kernel + * @package kernel * - * @author Kazumi Ono <on...@xo...> - * @copyright copyright (c) 2000-2003 The XOOPS Project (http://www.xoops.org) + * @author Kazumi Ono <on...@xo...> + * @copyright copyright (c) 2000-2003 The XOOPS Project (http://www.xoops.org) * - * @version $Revision: 1217 $ - $Date: 2008-01-02 01:04:41 +0800 (星期三, 02 一月 2008) $ + * @version $Revision: 1217 $ - $Date: 2008-01-02 01:04:41 +0800 (星期三, 02 一月 2008) $ */ -class XoopsPrivmessageHandler extends XoopsObjectHandler +class XoopsPrivmessageHandler extends XoopsPersistableObjectHandler { /** - * Create a new {@link XoopsPrivmessage} object - * @param bool $isNew Flag as "new"? - * @return object - **/ - function create($isNew = true) - { - $pm = new XoopsPrivmessage(); - if ($isNew) { - $pm->setNew(); - } - return $pm; - } - - /** - * Load a {@link XoopsPrivmessage} object - * @param int $id ID of the message - * @return object - **/ - function get($id) - { - $pm = false; - $id = intval($id); - if ($id > 0) { - $sql = 'SELECT * FROM ' . $this->db->prefix('priv_msgs') . ' WHERE msg_id=' . $id; - if (!$result = $this->db->query($sql)) { - return $pm; - } - $numrows = $this->db->getRowsNum($result); - if ($numrows == 1) { - $pm = new XoopsPrivmessage(); - $pm->assignVars($this->db->fetchArray($result)); - } - } - return $pm; - } - - /** - * Insert a message in the database + * Constructor * - * @param object $pm {@link XoopsPrivmessage} object - * @param bool $force flag to force the query execution skip request method check, which might be required in some situations - * @return bool - **/ - function insert(&$pm, $force = false) + * @param XoopsDatabase|null $db {@link XoopsDatabase} + */ + public function __construct(XoopsDatabase $db = null) { - /** - * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($pm, 'xoopsprivmessage')) { - return false; - } - - if (!$pm->isDirty()) { - return true; - } - if (!$pm->cleanVars()) { - return false; - } - foreach ($pm->cleanVars as $k => $v) { - ${$k} = $v; - } - if ($pm->isNew()) { - $msg_id = $this->db->genId('priv_msgs_msg_id_seq'); - $sql = sprintf("INSERT INTO %s (msg_id, msg_image, subject, from_userid, to_userid, msg_time, msg_text, read_msg) VALUES (%u, %s, %s, %u, %u, %u, %s, %u)", $this->db->prefix('priv_msgs'), $msg_id, $this->db->quoteString($msg_image), $this->db->quoteString($subject), $from_userid, $to_userid, time(), $this->db->quoteString($msg_text), 0); - } else { - $sql = sprintf("UPDATE %s SET msg_image = %s, subject = %s, from_userid = %u, to_userid = %u, msg_text = %s, read_msg = %u WHERE msg_id = %u", $this->db->prefix('priv_msgs'), $this->db->quoteString($msg_image), $this->db->quoteString($subject), $from_userid, $to_userid, $this->db->quoteString($msg_text), $read_msg, $msg_id); - } - $queryFunc = empty($force) ? "query" : "queryF"; - if (!$result = $this->db->{$queryFunc}($sql)) { - return false; - } - if (empty($msg_id)) { - $msg_id = $this->db->getInsertId(); - } - $pm->assignVar('msg_id', $msg_id); - return true; + parent::__construct($db, 'priv_msgs', 'XoopsPrivmessage', 'msg_id', 'subject'); } /** - * Delete from the database - * @param object $pm {@link XoopsPrivmessage} object - * @return bool - **/ - function delete(&$pm) - { - /** - * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($pm, 'xoopsprivmessage')) { - return false; - } - - if (!$result = $this->db->query(sprintf("DELETE FROM %s WHERE msg_id = %u", $this->db->prefix('priv_msgs'), $pm->getVar('msg_id')))) { - return false; - } - return true; - } - - /** * Load messages from the database - * @param object $criteria {@link CriteriaElement} object - * @param bool $id_as_key use ID as key into the array? - * @return array Array of {@link XoopsPrivmessage} objects + * + * @param CriteriaElement|null $criteria {@link CriteriaElement} object + * @param bool $id_as_key use ID as key into the array? + * @return array Array of {@link XoopsPrivmessage} objects **/ - function getObjects($criteria = null, $id_as_key = false) + public function getObjects(CriteriaElement $criteria = null, $id_as_key = false) { $ret = array(); $limit = $start = 0; $sql = 'SELECT * FROM ' . $this->db->prefix('priv_msgs'); if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { $sql .= ' ' . $criteria->renderWhere(); - $sort = ! in_array($criteria->getSort(), array( - 'msg_id' , - 'msg_time' , - 'from_userid')) ? 'msg_id' : $criteria->getSort(); + $sort = !in_array($criteria->getSort(), array( + 'msg_id', + 'msg_time', + 'from_userid')) ? 'msg_id' : $criteria->getSort(); $sql .= ' ORDER BY ' . $sort . ' ' . $criteria->getOrder(); $limit = $criteria->getLimit(); $start = $criteria->getStart(); @@ -271,37 +191,13 @@ } /** - * Count message - * @param object $criteria = null {@link CriteriaElement} object - * @return int - **/ - function getCount($criteria = null) - { - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('priv_msgs'); - if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { - $sql .= ' ' . $criteria->renderWhere(); - } - if (!$result = $this->db->query($sql)) { - return 0; - } - list ($count) = $this->db->fetchRow($result); - return $count; - } - - /** * Mark a message as read - * @param object $pm {@link XoopsPrivmessage} object - * @return bool + * + * @param XoopsPrivmessage $pm {@link XoopsPrivmessage} object + * @return bool **/ - function setRead(&$pm) + public function setRead(XoopsPrivmessage &$pm) { - /** - * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($pm, 'xoopsprivmessage')) { - return false; - } - $sql = sprintf("UPDATE %s SET read_msg = 1 WHERE msg_id = %u", $this->db->prefix('priv_msgs'), $pm->getVar('msg_id')); if (!$this->db->queryF($sql)) { return false; @@ -309,4 +205,5 @@ return true; } } + ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/session.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/session.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/session.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -36,7 +36,7 @@ * @var object * @access private */ - var $db; + private $db; /** * Security checking level @@ -51,7 +51,7 @@ * @var int * @access public */ - var $securityLevel = 3; + public $securityLevel = 3; /** * Enable regenerate_id @@ -59,15 +59,15 @@ * @var bool * @access public */ - var $enableRegenerateId = false; + public $enableRegenerateId = false; /** * Constructor * - * @param object $db reference to the {@link XoopsDatabase} object + * @param XoopsDatabase $db reference to the {@link XoopsDatabase} object * */ - function XoopsSessionHandler(&$db) + public function __construct($db) { $this->db = $db; } @@ -80,7 +80,7 @@ * * @return bool */ - function open($save_path, $session_name) + public function open($save_path, $session_name) { return true; } @@ -90,7 +90,7 @@ * * @return bool */ - function close() + public function close() { $this->gc_force(); return true; @@ -99,11 +99,11 @@ /** * Read a session from the database * - * @param string &sess_id ID of the session + * @param string $sess_id ID of the session * - * @return array Session data + * @return string Session data */ - function read($sess_id) + public function read($sess_id) { $sql = sprintf('SELECT sess_data, sess_ip FROM %s WHERE sess_id = %s', $this->db->prefix('session'), $this->db->quoteString($sess_id)); if (false != $result = $this->db->query($sql)) { @@ -128,7 +128,7 @@ * * @return bool **/ - function write($sess_id, $sess_data) + public function write($sess_id, $sess_data) { $sess_id = $this->db->quoteString($sess_id); $sql = sprintf('UPDATE %s SET sess_updated = %u, sess_data = %s WHERE sess_id = %s', $this->db->prefix('session'), time(), $this->db->quoteString($sess_data), $sess_id); @@ -147,10 +147,10 @@ * * @return bool **/ - function destroy($sess_id) + public function destroy($sess_id) { $sql = sprintf('DELETE FROM %s WHERE sess_id = %s', $this->db->prefix('session'), $this->db->quoteString($sess_id)); - if (!$result = $this->db->queryF($sql)) { + if (!$this->db->queryF($sql)) { return false; } return true; @@ -162,7 +162,7 @@ * @param int $expire Time in seconds until a session expires * @return bool **/ - function gc($expire) + public function gc($expire) { if (empty($expire)) { return true; @@ -176,7 +176,7 @@ /** * Force gc for situations where gc is registered but not executed **/ - function gc_force() + public function gc_force() { if (rand(1, 100) < 11) { $expire = @ini_get('session.gc_maxlifetime'); @@ -193,7 +193,7 @@ * @param bool $delete_old_session * @return bool **/ - function regenerate_id($delete_old_session = false) + public function regenerate_id($delete_old_session = false) { $phpversion = phpversion(); @@ -249,7 +249,7 @@ * @param int $expire Time in seconds until a session expires * @return bool **/ - function update_cookie($sess_id = null, $expire = null) + public function update_cookie($sess_id = null, $expire = null) { global $xoopsConfig; $session_name = ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') ? $xoopsConfig['session_name'] : session_name(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplfile.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -34,7 +34,7 @@ * * @return XoopsTplfile */ - function __construct() + public function __construct() { $this->initVar('tpl_id', XOBJ_DTYPE_INT, null, false); $this->initVar('tpl_refid', XOBJ_DTYPE_INT, 0, false); @@ -49,89 +49,100 @@ } /** - * Returns Class Base Variable tpl_id + * @param string $format + * @return mixed */ - function id($format = 'N') + public function id($format = 'n') { return $this->getVar('tpl_id', $format); } /** - * Returns Class Base Variable tpl_id + * @param string $format + * @return mixed */ - function tpl_id($format = '') + public function tpl_id($format = '') { return $this->getVar('tpl_id', $format); } /** - * Returns Class Base Variable tpl_refid + * @param string $format + * @return mixed */ - function tpl_refid($format = '') + public function tpl_refid($format = '') { return $this->getVar('tpl_refid', $format); } /** - * Returns Class Base Variable tpl_tplset + * @param string $format + * @return mixed */ - function tpl_tplset($format = '') + public function tpl_tplset($format = '') { return $this->getVar('tpl_tplset', $format); } /** - * Returns Class Base Variable tpl_file + * @param string $format + * @return mixed */ - function tpl_file($format = '') + public function tpl_file($format = '') { return $this->getVar('tpl_file', $format); } /** - * Returns Class Base Variable tpl_desc + * @param string $format + * @return mixed */ - function tpl_desc($format = '') + public function tpl_desc($format = '') { return $this->getVar('tpl_desc', $format); } /** - * Returns Class Base Variable tpl_lastmodified + * @param string $format + * @return mixed */ - function tpl_lastmodified($format = '') + public function tpl_lastmodified($format = '') { return $this->getVar('tpl_lastmodified', $format); } /** - * Returns Class Base Variable tpl_lastimported + * @param string $format + * @return mixed */ - function tpl_lastimported($format = '') + public function tpl_lastimported($format = '') { return $this->getVar('tpl_lastimported', $format); } /** - * Returns Class Base Variable tpl_module + * @param string $format + * @return mixed */ - function tpl_module($format = '') + public function tpl_module($format = '') { return $this->getVar('tpl_module', $format); } /** - * Returns Class Base Variable tpl_type + * @param string $format + * @return mixed */ - function tpl_type($format = '') + public function tpl_type($format = '') { return $this->getVar('tpl_type', $format); } /** - * Returns Class Base Variable tpl_source + * @param string $format + * @return mixed */ - function tpl_source($format = '') + public function tpl_source($format = '') { return $this->getVar('tpl_source', $format); } @@ -142,7 +153,7 @@ * * @return unknown */ - function getSource() + public function getSource() { return $this->getVar('tpl_source'); } @@ -152,7 +163,7 @@ * * @return unknown */ - function getLastModified() + public function getLastModified() { return $this->getVar('tpl_lastmodified'); } @@ -166,32 +177,27 @@ * * @author Kazumi Ono <on...@xo...> */ -class XoopsTplfileHandler extends XoopsObjectHandler +class XoopsTplfileHandler extends XoopsPersistableObjectHandler { + /** - * create a new Tplfile + * Constructor * - * @see XoopsBlock - * @param bool $isNew is the new Tplfile new?? - * @return object XoopsTplfile reference to the new Tplfile - **/ - function create($isNew = true) + * @param XoopsDatabase|null $db {@link XoopsDatabase} + */ + public function __construct(XoopsDatabase $db = null) { - $tplfile = new XoopsTplfile(); - if ($isNew) { - $tplfile->setNew(); - } - return $tplfile; + parent::__construct($db, 'tplfile', 'XoopsTplfile', 'tpl_id', 'tpl_refid'); } /** * retrieve a specific {@link XoopsTplfile} * - * @see XoopsBlock * @param int $id tpl_id of the block to retrieve - * @return object XoopsTplfile reference to the Tplfile - **/ - function get($id, $getsource = false) + * @param bool $getsource + * @return XoopsTplfile|false + */ + public function get($id, $getsource = false) { $tplfile = false; $id = intval($id); @@ -214,20 +220,11 @@ } /** - * Enter description here... - * - * @param unknown_type $tplfile - * @return unknown + * @param XoopsTplfile $tplfile + * @return bool */ - function loadSource(&$tplfile) + public function loadSource(XoopsTplFile &$tplfile) { - /** - * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($tplfile, 'xoopstplfile')) { - return false; - } - if (!$tplfile->getVar('tpl_source')) { $sql = 'SELECT tpl_source FROM ' . $this->db->prefix('tplsource') . ' WHERE tpl_id=' . $tplfile->getVar('tpl_id'); if (!$result = $this->db->query($sql)) { @@ -242,17 +239,11 @@ /** * write a new Tplfile into the database * - * @param object XoopsTplfile $block reference to the Tplfile to insert - * @return bool TRUE if succesful - **/ - function insert(&$tplfile) + * @param XoopsTplfile $tplfile + * @return bool + */ + public function insert(XoopsTplfile &$tplfile) { - /** - * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($tplfile, 'xoopstplfile')) { - return false; - } if (!$tplfile->isDirty()) { return true; } @@ -265,7 +256,7 @@ if ($tplfile->isNew()) { $tpl_id = $this->db->genId('tpltpl_file_id_seq'); $sql = sprintf("INSERT INTO %s (tpl_id, tpl_module, tpl_refid, tpl_tplset, tpl_file, tpl_desc, tpl_lastmodified, tpl_lastimported, tpl_type) VALUES (%u, %s, %u, %s, %s, %s, %u, %u, %s)", $this->db->prefix('tplfile'), $tpl_id, $this->db->quoteString($tpl_module), $tpl_refid, $this->db->quoteString($tpl_tplset), $this->db->quoteString($tpl_file), $this->db->quoteString($tpl_desc), $tpl_lastmodified, $tpl_lastimported, $this->db->quoteString($tpl_type)); - if (!$result = $this->db->query($sql)) { + if (!$this->db->query($sql)) { return false; } if (empty($tpl_id)) { @@ -273,7 +264,7 @@ } if (isset($tpl_source) && $tpl_source != '') { $sql = sprintf("INSERT INTO %s (tpl_id, tpl_source) VALUES (%u, %s)", $this->db->prefix('tplsource'), $tpl_id, $this->db->quoteString($tpl_source)); - if (!$result = $this->db->query($sql)) { + if (!$this->db->query($sql)) { $this->db->query(sprintf("DELETE FROM %s WHERE tpl_id = %u", $this->db->prefix('tplfile'), $tpl_id)); return false; } @@ -281,12 +272,12 @@ $tplfile->assignVar('tpl_id', $tpl_id); } else { $sql = sprintf("UPDATE %s SET tpl_tplset = %s, tpl_file = %s, tpl_desc = %s, tpl_lastimported = %u, tpl_lastmodified = %u WHERE tpl_id = %u", $this->db->prefix('tplfile'), $this->db->quoteString($tpl_tplset), $this->db->quoteString($tpl_file), $this->db->quoteString($tpl_desc), $tpl_lastimported, $tpl_lastmodified, $tpl_id); - if (!$result = $this->db->query($sql)) { + if (!$this->db->query($sql)) { return false; } if (isset($tpl_source) && $tpl_source != '') { $sql = sprintf("UPDATE %s SET tpl_source = %s WHERE tpl_id = %u", $this->db->prefix('tplsource'), $this->db->quoteString($tpl_source), $tpl_id); - if (!$result = $this->db->query($sql)) { + if (!$this->db->query($sql)) { return false; } } @@ -295,19 +286,11 @@ } /** - * Enter description here... - * - * @param unknown_type $tplfile - * @return unknown + * @param XoopsTplfile $tplfile + * @return bool */ - function forceUpdate(&$tplfile) + public function forceUpdate(XoopsTplfile &$tplfile) { - /** - * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($tplfile, 'xoopstplfile')) { - return false; - } if (!$tplfile->isDirty()) { return true; } @@ -319,12 +302,12 @@ } if (!$tplfile->isNew()) { $sql = sprintf("UPDATE %s SET tpl_tplset = %s, tpl_file = %s, tpl_desc = %s, tpl_lastimported = %u, tpl_lastmodified = %u WHERE tpl_id = %u", $this->db->prefix('tplfile'), $this->db->quoteString($tpl_tplset), $this->db->quoteString($tpl_file), $this->db->quoteString($tpl_desc), $tpl_lastimported, $tpl_lastmodified, $tpl_id); - if (!$result = $this->db->queryF($sql)) { + if (!$this->db->queryF($sql)) { return false; } if (isset($tpl_source) && $tpl_source != '') { $sql = sprintf("UPDATE %s SET tpl_source = %s WHERE tpl_id = %u", $this->db->prefix('tplsource'), $this->db->quoteString($tpl_source), $tpl_id); - if (!$result = $this->db->queryF($sql)) { + if (!$this->db->queryF($sql)) { return false; } } @@ -337,17 +320,11 @@ /** * delete a block from the database * - * @param object XoopsBlock $block reference to the block to delete - * @return bool TRUE if succesful - **/ - function delete(&$tplfile) + * @param XoopsTplfile $tplfile + * @return bool + */ + public function delete(XoopsTplfile &$tplfile) { - /** - * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($tplfile, 'xoopstplfile')) { - return false; - } $id = $tplfile->getVar('tpl_id'); $sql = sprintf("DELETE FROM %s WHERE tpl_id = %u", $this->db->prefix('tplfile'), $id); if (!$result = $this->db->query($sql)) { @@ -359,12 +336,12 @@ } /** - * retrieve array of {@link XoopsBlock}s meeting certain conditions - * @param object $criteria {@link CriteriaElement} with conditions for the blocks - * @param bool $id_as_key should the blocks' bid be the key for the returned array? - * @return array {@link XoopsBlock}s matching the conditions - **/ - function getObjects($criteria = null, $getsource = false, $id_as_key = false) + * @param CriteriaElement|null $criteria + * @param bool $getsource + * @param bool $id_as_key + * @return array + */ + public function getObjects(CriteriaElement $criteria = null, $getsource = false, $id_as_key = false) { $ret = array(); $limit = $start = 0; @@ -396,34 +373,15 @@ } /** - * Get count - * - * @param array $criteria - * @return int - */ - function getCount($criteria = null) - { - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('tplfile'); - if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { - $sql .= ' ' . $criteria->renderWhere(); - } - if (!$result = $this->db->query($sql)) { - return 0; - } - list ($count) = $this->db->fetchRow($result); - return $count; - } - - /** * getModuleTplCount * * @param string $tplset * @return array */ - function getModuleTplCount($tplset) + public function getModuleTplCount($tplset) { $ret = array(); - $sql = "SELECT tpl_module, COUNT(tpl_id) AS count FROM " . $this->db->prefix('tplfile') . " WHERE tpl_tplset='" . $tplset . "' GROUP BY tpl_module"; + $sql = "SELECT tpl_module, COUNT(tpl_id) AS count FROM " . $this->db->prefix('tplfile') . " WHERE tpl_tplset='" . $this->db->quoteString($tplset) . "' GROUP BY tpl_module"; $result = $this->db->query($sql); if (!$result) { return $ret; @@ -439,15 +397,15 @@ /** * Find Template File * - * @param string $tplset - * @param string $type - * @param string $refid - * @param string $module - * @param string $file - * @param string $getsource - * @return object + * @param string|null $tplset + * @param string|null $type + * @param string|null $refid + * @param string|null $module + * @param string|null $file + * @param bool $getsource + * @return array */ - function find($tplset = null, $type = null, $refid = null, $module = null, $file = null, $getsource = false) + public function find($tplset = null, $type = null, $refid = null, $module = null, $file = null, $getsource = false) { $criteria = new CriteriaCompo(); if (isset($tplset)) { @@ -479,11 +437,11 @@ /** * Template Exists * - * @param string $tplname - * @param string $tplset_name - * @return unknown + * @param $tplname + * @param $tplset_name + * @return bool */ - function templateExists($tplname, $tplset_name) + public function templateExists($tplname, $tplset_name) { $criteria = new CriteriaCompo(new Criteria('tpl_file', trim($tplname))); $criteria->add(new Criteria('tpl_tplset', trim($tplset_name))); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplset.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplset.php 2011-10-08 18:30:34 UTC (rev 7813) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/tplset.php 2011-10-08 20:35:39 UTC (rev 7814) @@ -29,6 +29,7 @@ **/ class XoopsTplset extends XoopsObject { + /** * constructor **/ @@ -42,15 +43,17 @@ } /** - * Returns Class Base Variable tplset_id + * @param string $format + * @return mixed */ - function id($format = 'N') + function id($format = 'n') { return $this->getVar('tplset_id', $format); } /** - * Returns Class Base Variable tplset_id + * @param string $format + * @return mixed */ function tplset_id($format = '') { @@ -58,7 +61,8 @@ } /** - * Returns Class Base Variable tplset_name + * @param string $format + * @return mixed */ function tplset_name($format = '') { @@ -66,7 +70,8 @@ } /** - * Returns Class Base Variable tplset_desc + * @param string $format + * @return mixed */ function tplset_desc($format = '') { @@ -74,7 +79,8 @@ } /** - * Returns Class Base Variable tplset_credits + * @param string $format + * @return mixed */ function tplset_credits($format = '') { @@ -82,7 +88,8 @@ } /** - * Returns Class Base Variable tplset_created + * @param string $format + * @return mixed */ function tplset_created($format = '') { @@ -98,64 +105,31 @@ * * @author Kazumi Ono <on...@xo...> */ -class XoopsTplsetHandler extends XoopsObjectHandler +class XoopsTplsetHandler extends XoopsPersistableObjectHandler { - /** - * create a new block - * - * @see XoopsTplset - * @param bool $isNew is the new tplsets new?? - * @return object XoopsTplset reference to the new tplsets - **/ - function create($isNew = true) - { - $tplset = new XoopsTplset(); - if ($isNew) { - $tplset->setNew(); - } - return $tplset; - } /** - * retrieve a specific {@link XoopsBlock} + * Constructor * - * @see XoopsTplset - * @param int $id tplset_id of the tplsets to retrieve - * @return object XoopsTplset reference to the tplsets - **/ - function get($id) + * @param XoopsDatabase|null $db {@link XoopsDatabase} + */ + public function __construct(XoopsDatabase $db = null) { - $tplset = false; - $id = intval($id); - if ($id > 0) { - $sql = 'SELECT * FROM ' . $this->db->prefix('tplset') . ' WHERE tplset_id=' . $id; - if (!$result = $this->db->query($sql)) { - return $tplset; - } - $numrows = $this->db->getRowsNum($result); - if ($numrows == 1) { - $tplset = new XoopsTplset(); - $tplset->assignVars($this->db->fetchArray($result)); - } - } - return $tplset; + parent::__construct($db, 'tplset', 'XoopsTplset', 'tplset_id', 'tplset_name'); } /** - * retrieve a specific {@link XoopsBlock} - * - * @see XoopsTplset - * @param int $id tplset_id of the block to retrieve - * @return object XoopsTplset reference to the tplsets - **/ - function getByName($tplset_name) + * @param string $tplset_name of the block to retrieve + * @return XoopsTplset|falsereference to the tplsets + */ + public function getByName($tplset_name) { $tplset = false; $tplset_name = trim($tplset_name); if ($tplset_name != '') { $sql = 'SELECT * FROM ' . $this->db->prefix('tplset') . ' WHERE tplset_name=' . $this->db->quoteString($tplset_name); if (!$result = $this->db->query($sql)) { - return $tplset; + return false; } $numrows = $this->db->getRowsNum($result); if ($numrows == 1) { @@ -167,127 +141,12 @@ } /** - * write a new block into the database + * get a list of tplsets matching certain conditions * - * @param object XoopsTplset $block reference to the tplsets to insert - * @return bool TRUE if succesful - **/ - function insert(&$tplset) - { - /** - * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 - */ - if (!is_a($tplset, 'xoopstplset')) { - return false; - } - if (!$tplset->isDirty()) { - return true; - } - i... [truncated message content] |
From: <tr...@us...> - 2011-10-09 16:14:18
|
Revision: 7842 http://xoops.svn.sourceforge.net/xoops/?rev=7842&view=rev Author: trabis Date: 2011-10-09 16:14:08 +0000 (Sun, 09 Oct 2011) Log Message: ----------- Start class refactoring, added modules admin Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.tar.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.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/model/stats.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/online.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/1day.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/ASC.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/DESC.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/attach.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/close12.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/delete.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/down.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/down.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/download.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/edit.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/editcopy.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/editcut.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/editpaste.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/film.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/forum.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/green.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/green_off.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/inserttable.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_delete.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_forward.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_generic.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_new.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_replay.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/off.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/on.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/open12.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/pdf.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/pixel.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/printer.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/red.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/red_off.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/rss.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/search.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/topic.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/up.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/about.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/add.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/addlink.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/administration.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/album.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/alert.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/attach.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/bg_button.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/block.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/brokenlink.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/button_ok.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/calculator.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/cart_add.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/cash_stack.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/category.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/compfile.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/content.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/delete.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/delivery.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/digest.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/discount.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/download.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/event.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/exec.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/export.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/extention.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/faq.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/fileshare.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/firewall.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/folder1_html.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/folder_txt.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/forums.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/globe.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/groupmod.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/help.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/highlight.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/home.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/identity.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/index.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/insert_table_row.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/languages.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/list.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/mail_country.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/mail_foward.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/manage.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/marquee.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/metagen.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/modifiedlink.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/newsletter.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/permissions.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/photo.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/poll.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/prune.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/security.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/slideshow.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/stats.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/submittedlink.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/synchronized.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/type.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/update.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/user-icon.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/users.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/view_detailed.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/view_text.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/watermark.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/xoopsmicrobutton.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/balatarin.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/blinklist.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/delicious.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/designfloat.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/diggman.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/facebook_share_icon.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/fark.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/furl.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/google-icon.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/google-reader-icon.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/google_buzz_icon.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/mixx.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/myspace.jpg XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/newsvine.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/reddit.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/scriptandstyle.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/sel.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/simpy.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/spurl.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/stumbleupon.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/technorati.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/twitter_share_icon.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/xnewsvine.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/yahoomyweb.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/css/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/css/admin.css XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/css/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/doc/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/doc/Frameworks_moduleadmin_en.pdf XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/doc/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/images/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/images/bg_button.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/images/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/english/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/english/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/english/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/french/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/french/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/french/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/german/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/german/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/german/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/russian/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/russian/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/language/russian/main.php 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/xoops_version.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/compiler.xoModuleIcons16.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/compiler.xoModuleIcons32.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/compiler.xoModuleIconsBookmarks.php Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/1day.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/1day.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/ASC.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/ASC.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/DESC.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/DESC.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/attach.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/attach.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/close12.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/close12.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/delete.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/delete.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/down.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/down.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/down.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/down.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/download.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/download.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/edit.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/edit.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/editcopy.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/editcopy.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/editcut.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/editcut.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/editpaste.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/editpaste.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/film.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/film.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/forum.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/forum.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/green.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/green.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/green_off.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/green_off.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/index.html 2011-10-09 16:14:08 UTC (rev 7842) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/inserttable.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/inserttable.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_delete.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_delete.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_forward.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_forward.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_generic.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_generic.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_new.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_new.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_replay.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/mail_replay.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/off.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/off.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/on.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/on.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/open12.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/open12.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/pdf.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/pdf.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/pixel.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/pixel.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/printer.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/printer.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/red.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/red.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/red_off.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/red_off.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/rss.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/rss.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/search.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/search.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/topic.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/topic.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/up.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/up.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/about.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/about.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/add.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/add.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/addlink.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/addlink.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/administration.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/administration.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/album.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/album.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/alert.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/alert.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/attach.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/attach.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/bg_button.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/bg_button.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/block.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/block.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/brokenlink.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/brokenlink.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/button_ok.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/button_ok.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/calculator.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/calculator.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/cart_add.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/cart_add.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/cash_stack.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/cash_stack.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/category.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/category.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/compfile.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/compfile.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/content.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/content.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/delete.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/delete.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/delivery.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/delivery.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/digest.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/digest.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/discount.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/discount.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/download.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/download.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/event.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/event.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/exec.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/exec.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/export.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/export.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/extention.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/extention.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/faq.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/faq.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/fileshare.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/fileshare.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/firewall.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/firewall.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/folder1_html.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/folder1_html.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/folder_txt.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/folder_txt.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/forums.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/forums.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/globe.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/globe.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/groupmod.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/groupmod.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/help.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/help.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/highlight.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/highlight.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/home.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/home.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/identity.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/identity.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/index.html 2011-10-09 16:14:08 UTC (rev 7842) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/index.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/index.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/insert_table_row.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/insert_table_row.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/languages.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/languages.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/list.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/list.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/mail_country.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/mail_country.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/mail_foward.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/mail_foward.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/manage.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/manage.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/marquee.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/marquee.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/metagen.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/metagen.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/modifiedlink.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/modifiedlink.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/newsletter.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/newsletter.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/permissions.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/permissions.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/photo.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/photo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/poll.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/poll.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/prune.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/prune.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/security.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/security.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/slideshow.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/slideshow.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/stats.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/stats.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/submittedlink.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/submittedlink.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/synchronized.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/synchronized.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/type.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/type.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/update.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/update.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/user-icon.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/user-icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/users.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/users.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/view_detailed.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/view_detailed.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/view_text.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/view_text.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/watermark.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/watermark.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/xoopsmicrobutton.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/xoopsmicrobutton.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/balatarin.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/balatarin.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/blinklist.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/blinklist.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/delicious.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/delicious.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/designfloat.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/designfloat.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/diggman.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/diggman.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/facebook_share_icon.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/facebook_share_icon.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/fark.gif =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/bookmarks/fark.gif... [truncated message content] |
From: <for...@us...> - 2011-10-10 19:23:29
|
Revision: 7856 http://xoops.svn.sourceforge.net/xoops/?rev=7856&view=rev Author: forxoops Date: 2011-10-10 19:23:23 +0000 (Mon, 10 Oct 2011) Log Message: ----------- Delete unused directory Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/cache/ XoopsCore/branches/2.6.x/2.6.0/htdocs/templates_c/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-15 15:18:04
|
Revision: 7887 http://xoops.svn.sourceforge.net/xoops/?rev=7887&view=rev Author: trabis Date: 2011-10-15 15:17:55 +0000 (Sat, 15 Oct 2011) Log Message: ----------- finishing class folder refactoring (root) Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.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/uploader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslocal.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/zipdownloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/imagemanager.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/commentform.inc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.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/old_functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/registerform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/searchform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/site-closed.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/xoops13_header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/locale.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/header.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/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/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/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/category.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/include/forms.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/search.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/users/users.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/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/pmlite.php Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopstree.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-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -23,10 +23,9 @@ } header('Content-Type:text/xml; charset=utf-8'); -include_once $GLOBALS['xoops']->path('class/template.php'); $tpl = new XoopsTpl(); -$tpl->xoops_setCaching(2); -$tpl->xoops_setCacheTime(3600); +$tpl->caching = 2; +$tpl->cache_lifetime = 3600; if (!$tpl->is_cached('db:system_rss.html')) { $tpl->assign('channel_title', XoopsLocal::convert_encoding(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); $tpl->assign('channel_link', XOOPS_URL . '/'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -63,7 +63,7 @@ /** * Returns a singleton instance * - * @return object + * @return XoopsCache * @access public */ static function getInstance() Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -1,5 +1,6 @@ <?php // $Id$ + /** * package::i.tools * 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-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -142,7 +142,6 @@ */ public function renderThreadView($comment_id = 0, $admin_view = false, $show_nav = true) { - include_once $GLOBALS['xoops']->path('class/tree.php'); // construct comment tree $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid'); $tree = $xot->getTree(); @@ -234,7 +233,6 @@ */ public function renderNestView($comment_id = 0, $admin_view = false) { - include_once $GLOBALS['xoops']->path('class/tree.php'); $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid'); $tree = $xot->getTree(); if (false != $this->_useIcons) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -18,15 +18,6 @@ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -/** - * base class - */ -include_once XOOPS_ROOT_PATH . '/class/downloader.php'; -/** - * Class to handle tar files - */ -include_once XOOPS_ROOT_PATH . '/class/class.tar.php'; - class XoopsTarDownloader extends XoopsDownloader { /** @@ -35,7 +26,7 @@ * @param string $ext file extension * @param string $mimyType Mimetype */ - function __construct($ext = '.tar.gz', $mimyType = 'application/x-gzip') + public function __construct($ext = '.tar.gz', $mimyType = 'application/x-gzip') { $this->archiver = new tar(); $this->ext = trim($ext); @@ -48,7 +39,7 @@ * @param string $filepath Full path to the file * @param string $newfilename Filename (if you don't want to use the original) */ - function addFile($filepath, $newfilename = null) + public function addFile($filepath, $newfilename = null) { $this->archiver->addFile($filepath); if (isset($newfilename)) { @@ -68,7 +59,7 @@ * @param string $filepath Full path to the file * @param string $newfilename Filename (if you don't want to use the original) */ - function addBinaryFile($filepath, $newfilename = null) + public function addBinaryFile($filepath, $newfilename = null) { $this->archiver->addFile($filepath, true); if (isset($newfilename)) { @@ -89,7 +80,7 @@ * @param string $filename Name for the file in the archive * @param integer $time */ - function addFileData(&$data, $filename, $time = 0) + public function addFileData(&$data, $filename, $time = 0) { $dummyfile = XOOPS_CACHE_PATH . '/dummy_' . time() . '.html'; $fp = fopen($dummyfile, 'w'); @@ -116,7 +107,7 @@ * @param string $filename Name for the file in the archive * @param integer $time */ - function addBinaryFileData(&$data, $filename, $time = 0) + public function addBinaryFileData(&$data, $filename, $time = 0) { $dummyfile = XOOPS_CACHE_PATH . '/dummy_' . time() . '.html'; $fp = fopen($dummyfile, 'wb'); @@ -142,7 +133,7 @@ * @param string $name Filename * @param boolean $gzip Use GZ compression */ - function download($name, $gzip = true) + public function download($name, $gzip = true) { $this->_header($name . $this->ext); echo $this->archiver->toTarOutput($name . $this->ext, $gzip); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -20,11 +20,8 @@ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -/** - * Base class: Smarty template engine - */ + define('SMARTY_DIR', XOOPS_ROOT_PATH . '/class/smarty/'); -require_once SMARTY_DIR . 'Smarty.class.php'; /** * Template engine @@ -39,7 +36,7 @@ /** * @var xos_opal_Theme */ - var $currentTheme = null; + public $currentTheme = null; public function __construct() { 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 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -396,9 +396,9 @@ /** * xos_opal_Theme::checkCache() * - * @return + * @return bool */ - function checkCache() + public function checkCache() { if ($_SERVER['REQUEST_METHOD'] != 'POST' && $this->contentCacheLifetime) { $template = $this->contentTemplate ? $this->contentTemplate : 'db:system_dummy.html'; @@ -433,8 +433,10 @@ * @param string $pageTpl The page template, if different from the theme default (unsupported, 2.3+ only) * @param string $contentTpl The content template * @param array $vars Template variables to send to the template engine + * + * @return bool */ - function render($canvasTpl = null, $pageTpl = null, $contentTpl = null, $vars = array()) + public function render($canvasTpl = null, $pageTpl = null, $contentTpl = null, $vars = array()) { if ($this->renderCount) { return false; @@ -521,8 +523,11 @@ * <li>style.css - localization stylesheet</li> * <li>script.js - localization script</li> * </ul> + * + * @param string $type + * @return bool */ - function loadLocalization($type = "main") + public function loadLocalization($type = "main") { $language = xoops_getConfigOption('language'); // Load global localization stylesheet if available @@ -545,14 +550,14 @@ * * @param string $type language type, like 'main', 'admin'; Needs to be declared in theme xo-info.php * @param string $language specific language + * + * @return bool|mixed */ - function addLanguage($type = "main", $language = null) + public function addLanguage($type = "main", $language = null) { $language = is_null($language) ? $GLOBALS["xoopsConfig"]["language"] : $language; - if (!file_exists($fileinc = $GLOBALS['xoops']->path($this->resourcePath("/language/{$language}/{$type}.php"))) - ) { - if (!file_exists($fileinc = $GLOBALS['xoops']->path($this->resourcePath("/language/english/{$type}.php"))) - ) { + if (!file_exists($fileinc = $GLOBALS['xoops']->path($this->resourcePath("/language/{$language}/{$type}.php")))) { + if (!file_exists($fileinc = $GLOBALS['xoops']->path($this->resourcePath("/language/english/{$type}.php")))) { return false; } } @@ -591,7 +596,7 @@ * @param string $content Code snippet to output within the <script> tag * @return void */ - function addScript($src = '', $attributes = array(), $content = '') + public function addScript($src = '', $attributes = array(), $content = '') { if (empty($attributes)) { $attributes = array(); @@ -618,7 +623,7 @@ * @param string $content CSS code to output between the <style> tags (in case $src is empty) * @return void */ - function addStylesheet($src = '', $attributes = array(), $content = '') + public function addStylesheet($src = '', $attributes = array(), $content = '') { if (empty($attributes)) { $attributes = array(); @@ -643,7 +648,7 @@ * @param string $href URI of the anchored document * @param array $attributes Additional attributes to add to the <link> element */ - function addLink($rel, $href = '', $attributes = array()) + public function addLink($rel, $href = '', $attributes = array()) { if (empty($attributes)) { $attributes = array(); @@ -657,19 +662,29 @@ /** * Set a meta http-equiv value + * + * @param string $name + * @param null $value + * @return bool|string */ - function addHttpMeta($name, $value = null) + public function addHttpMeta($name, $value = null) { if (isset($value)) { return $this->addMeta('http', $name, $value); } unset($this->metas['http'][$name]); + return false; } /** * Change output page meta-information + * + * @param string $type + * @param string $name + * @param string $value + * @return string */ - function addMeta($type = 'meta', $name = '', $value = '') + public function addMeta($type = 'meta', $name = '', $value = '') { if (!isset($this->metas[$type])) { $this->metas[$type] = array(); @@ -685,13 +700,13 @@ /** * xos_opal_Theme::headContent() * - * @param mixed $params - * @param mixed $content - * @param mixed $smarty - * @param mixed $repeat - * @return + * @param $params + * @param $content + * @param $smarty + * @param $repeat + * @return void */ - function headContent($params, $content, &$smarty, &$repeat) + public function headContent($params, $content, &$smarty, &$repeat) { if (!$repeat) { $this->htmlHeadStrings[] = $content; @@ -701,11 +716,11 @@ /** * xos_opal_Theme::renderMetas() * - * @param mixed $type - * @param mixed $return - * @return + * @param null $type + * @param bool|string $return + * @return bool|string */ - function renderMetas($type = null, $return = false) + public function renderMetas($type = null, $return = false) { $str = ''; if (!isset($type)) { @@ -765,7 +780,7 @@ * @param string $tagName * @return string */ - function genElementId($tagName = 'xos') + public function genElementId($tagName = 'xos') { static $cache = array(); if (!isset($cache[$tagName])) { @@ -780,7 +795,7 @@ * @param array $coll * @return string */ - function renderAttributes($coll) + public function renderAttributes($coll) { $str = ''; foreach ($coll as $name => $val) { @@ -797,7 +812,7 @@ * @param string $path * @return string */ - function resourcePath($path) + public function resourcePath($path) { if (substr($path, 0, 1) == '/') { $path = substr($path, 1); 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 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -22,8 +22,6 @@ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -include_once $GLOBALS['xoops']->path('class/template.php'); - /** * xos_logos_PageBuilder main class * @@ -85,12 +83,11 @@ */ public function retrieveBlocks() { - global $xoopsConfig; $xoopsPreload = XoopsPreload::getInstance(); if (isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule'])) { $mid = $GLOBALS['xoopsModule']->getVar('mid'); - $isStart = (substr($_SERVER['PHP_SELF'], -9) == 'index.php' && $xoopsConfig['startpage'] == $GLOBALS['xoopsModule']->getVar('dirname') && empty($_SERVER['QUERY_STRING'])); + $isStart = (substr($_SERVER['PHP_SELF'], -9) == 'index.php' && $GLOBALS['xoopsConfig']['startpage'] == $GLOBALS['xoopsModule']->getVar('dirname') && empty($_SERVER['QUERY_STRING'])); } else { $mid = 0; $isStart = !empty($GLOBALS['xoopsOption']['show_cblock']); @@ -213,7 +210,6 @@ } } if (count($metas)) { - /* @var $cache XoopsCache */ $cache = XoopsCache::getInstance(); $cache->write($cacheid, $metas); @@ -226,7 +222,6 @@ //add block cached metas if ($this->theme && $bcachetime) { - $cache = XoopsCache::getInstance(); if ($metas = $cache->read($cacheid)) { foreach ($metas as $type => $value) { @@ -234,9 +229,7 @@ } } } - $template->setCompileId(); - return $block; } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -75,109 +75,109 @@ * * @var bool */ - var $allowUnknownTypes = false; + public $allowUnknownTypes = false; /** * @var string */ - var $mediaName; + public $mediaName; /** * @var string */ - var $mediaType; + public $mediaType; /** * @var int */ - var $mediaSize; + public $mediaSize; /** * @var string */ - var $mediaTmpName; + public $mediaTmpName; /** * @var string */ - var $mediaError; + public $mediaError; /** * @var string */ - var $mediaRealType = ''; + public $mediaRealType = ''; /** * @var string */ - var $uploadDir = ''; + public $uploadDir = ''; /** * @var array */ - var $allowedMimeTypes = array(); + public $allowedMimeTypes = array(); /** * @var array */ - var $deniedMimeTypes = array( + public $deniedMimeTypes = array( 'application/x-httpd-php' ); /** * @var int */ - var $maxFileSize = 0; + public $maxFileSize = 0; /** * @var int */ - var $maxWidth; + public $maxWidth; /** * @var int */ - var $maxHeight; + public $maxHeight; /** * @var string */ - var $targetFileName; + public $targetFileName; /** * @var */ - var $prefix; + public $prefix; /** * @var array */ - var $errors = array(); + public $errors = array(); /** * @var string */ - var $savedDestination; + public $savedDestination; /** * @var string */ - var $savedFileName; + public $savedFileName; /** * @var array|mixed */ - var $extensionToMime = array(); + public $extensionToMime = array(); /** * @var bool */ - var $checkImageType = true; + public $checkImageType = true; /** * @var array */ - var $extensionsToBeSanitized = array( + public $extensionsToBeSanitized = array( 'php', 'phtml', 'phtm', 'php3', 'php4', 'cgi', 'pl', 'asp', 'php5' ); @@ -186,7 +186,7 @@ * * @var array */ - var $imageExtensions = array( + public $imageExtensions = array( 1 => 'gif', 2 => 'jpg', 3 => 'png', 4 => 'swf', 5 => 'psd', 6 => 'bmp', 7 => 'tif', 8 => 'tif', 9 => 'jpc', 10 => 'jp2', 11 => 'jpx', 12 => 'jb2', 13 => 'swc', 14 => 'iff', 15 => 'wbmp', 16 => 'xbm' ); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -35,14 +35,12 @@ */ static function sendWelcome($user) { - global $xoopsConfigUser, $xoopsConfig; - - if (empty($xoopsConfigUser)) { + if (empty($GLOBALS['xoopsConfigUser'])) { /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); - $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER); + $GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER); } - if (empty($xoopsConfigUser['welcome_type'])) { + if (empty($GLOBALS['xoopsConfigUser']['welcome_type'])) { return true; } @@ -57,17 +55,17 @@ xoops_loadLanguage('user'); $xoopsMailer = xoops_getMailer(); - if ($xoopsConfigUser['welcome_type'] == 1 || $xoopsConfigUser['welcome_type'] == 3) { + if ($GLOBALS['xoopsConfigUser']['welcome_type'] == 1 || $GLOBALS['xoopsConfigUser']['welcome_type'] == 3) { $xoopsMailer->useMail(); } - if ($xoopsConfigUser['welcome_type'] == 2 || $xoopsConfigUser['welcome_type'] == 3) { + if ($GLOBALS['xoopsConfigUser']['welcome_type'] == 2 || $GLOBALS['xoopsConfigUser']['welcome_type'] == 3) { $xoopsMailer->usePM(); } $xoopsMailer->setTemplate('welcome.tpl'); - $xoopsMailer->setSubject(sprintf(_US_WELCOME_SUBJECT, $xoopsConfig['sitename'])); + $xoopsMailer->setSubject(sprintf(_US_WELCOME_SUBJECT, $GLOBALS['xoopsConfig']['sitename'])); $xoopsMailer->setToUsers($user); - if ($xoopsConfigUser['reg_dispdsclmr'] && $xoopsConfigUser['reg_disclaimer']) { - $xoopsMailer->assign('TERMSOFUSE', $xoopsConfigUser['reg_disclaimer']); + if ($GLOBALS['xoopsConfigUser']['reg_dispdsclmr'] && $GLOBALS['xoopsConfigUser']['reg_disclaimer']) { + $xoopsMailer->assign('TERMSOFUSE', $GLOBALS['xoopsConfigUser']['reg_disclaimer']); } else { $xoopsMailer->assign('TERMSOFUSE', ''); } @@ -81,9 +79,6 @@ */ static function validate() { - /* @var $xoopsUser XoopsUser|null */ - global $xoopsUser; - $args = func_get_args(); $args_num = func_num_args(); @@ -117,11 +112,11 @@ /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); - $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER); + $GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER); xoops_loadLanguage('user'); - $xoopsUser_isAdmin = is_object($xoopsUser) && $xoopsUser->isAdmin(); + $xoopsUser_isAdmin = is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->isAdmin(); $stop = ''; // Invalid email address if (!checkEmail($email)) { @@ -132,7 +127,7 @@ } // Check forbidden email address if current operator is not an administrator if (!$xoopsUser_isAdmin) { - foreach ($xoopsConfigUser['bad_emails'] as $be) { + foreach ($GLOBALS['xoopsConfigUser']['bad_emails'] as $be) { if (!empty($be) && preg_match('/' . $be . '/i', $email)) { $stop .= _US_INVALIDMAIL . '<br />'; break; @@ -141,7 +136,7 @@ } $uname = xoops_trim($uname); $restriction = ''; - switch ($xoopsConfigUser['uname_test_level']) { + switch ($GLOBALS['xoopsConfigUser']['uname_test_level']) { case 0: // strict $restriction = '/[^a-zA-Z0-9\_\-]/'; @@ -160,13 +155,13 @@ } // Check uname settings if current operator is not an administrator if (!$xoopsUser_isAdmin) { - if (strlen($uname) > $xoopsConfigUser['maxuname']) { - $stop .= sprintf(_US_NICKNAMETOOLONG, $xoopsConfigUser['maxuname']) . '<br />'; + if (strlen($uname) > $GLOBALS['xoopsConfigUser']['maxuname']) { + $stop .= sprintf(_US_NICKNAMETOOLONG, $GLOBALS['xoopsConfigUser']['maxuname']) . '<br />'; } - if (strlen($uname) < $xoopsConfigUser['minuname']) { - $stop .= sprintf(_US_NICKNAMETOOSHORT, $xoopsConfigUser['minuname']) . '<br />'; + if (strlen($uname) < $GLOBALS['xoopsConfigUser']['minuname']) { + $stop .= sprintf(_US_NICKNAMETOOSHORT, $GLOBALS['xoopsConfigUser']['minuname']) . '<br />'; } - foreach ($xoopsConfigUser['bad_unames'] as $bu) { + foreach ($GLOBALS['xoopsConfigUser']['bad_unames'] as $bu) { if (!empty($bu) && preg_match('/' . $bu . '/i', $uname)) { $stop .= _US_NAMERESERVED . '<br />'; break; @@ -209,8 +204,8 @@ if ((isset($pass)) && ($pass != $vpass)) { $stop .= _US_PASSNOTSAME . '<br />'; } else { - if (($pass != '') && (strlen($pass) < $xoopsConfigUser['minpass'])) { - $stop .= sprintf(_US_PWDTOOSHORT, $xoopsConfigUser['minpass']) . '<br />'; + if (($pass != '') && (strlen($pass) < $GLOBALS['xoopsConfigUser']['minpass'])) { + $stop .= sprintf(_US_PWDTOOSHORT, $GLOBALS['xoopsConfigUser']['minpass']) . '<br />'; } } return $stop; 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-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -16,381 +16,377 @@ * @version $Id$ */ - defined('XOOPS_ROOT_PATH') or die('Restricted access'); -if (!defined('XOOPS_LISTS_INCLUDED')) { - define('XOOPS_LISTS_INCLUDED', 1); - +/** + * XoopsLists + * + * @author John Neill <cat...@xo...> + * @copyright copyright (c) XOOPS.org + * @package kernel + * @subpackage form + * @access public + */ +class XoopsLists +{ /** - * XoopsLists - * - * @author John Neill <cat...@xo...> - * @copyright copyright (c) XOOPS.org - * @package kernel - * @subpackage form - * @access public + * @static + * @return array */ - class XoopsLists + static function getTimeZoneList() { - /** - * @static - * @return array - */ - static function getTimeZoneList() - { - xoops_loadLanguage('timezone'); + xoops_loadLanguage('timezone'); - $time_zone_list = array( - '-12' => _TZ_GMTM12, '-11' => _TZ_GMTM11, '-10' => _TZ_GMTM10, '-9' => _TZ_GMTM9, '-8' => _TZ_GMTM8, - '-7' => _TZ_GMTM7, '-6' => _TZ_GMTM6, '-5' => _TZ_GMTM5, '-4' => _TZ_GMTM4, '-3.5' => _TZ_GMTM35, - '-3' => _TZ_GMTM3, '-2' => _TZ_GMTM2, '-1' => _TZ_GMTM1, '0' => _TZ_GMT0, '1' => _TZ_GMTP1, - '2' => _TZ_GMTP2, '3' => _TZ_GMTP3, '3.5' => _TZ_GMTP35, '4' => _TZ_GMTP4, '4.5' => _TZ_GMTP45, - '5' => _TZ_GMTP5, '5.5' => _TZ_GMTP55, '6' => _TZ_GMTP6, '7' => _TZ_GMTP7, '8' => _TZ_GMTP8, - '9' => _TZ_GMTP9, '9.5' => _TZ_GMTP95, '10' => _TZ_GMTP10, '11' => _TZ_GMTP11, '12' => _TZ_GMTP12 - ); + $time_zone_list = array( + '-12' => _TZ_GMTM12, '-11' => _TZ_GMTM11, '-10' => _TZ_GMTM10, '-9' => _TZ_GMTM9, '-8' => _TZ_GMTM8, + '-7' => _TZ_GMTM7, '-6' => _TZ_GMTM6, '-5' => _TZ_GMTM5, '-4' => _TZ_GMTM4, '-3.5' => _TZ_GMTM35, + '-3' => _TZ_GMTM3, '-2' => _TZ_GMTM2, '-1' => _TZ_GMTM1, '0' => _TZ_GMT0, '1' => _TZ_GMTP1, + '2' => _TZ_GMTP2, '3' => _TZ_GMTP3, '3.5' => _TZ_GMTP35, '4' => _TZ_GMTP4, '4.5' => _TZ_GMTP45, + '5' => _TZ_GMTP5, '5.5' => _TZ_GMTP55, '6' => _TZ_GMTP6, '7' => _TZ_GMTP7, '8' => _TZ_GMTP8, + '9' => _TZ_GMTP9, '9.5' => _TZ_GMTP95, '10' => _TZ_GMTP10, '11' => _TZ_GMTP11, '12' => _TZ_GMTP12 + ); - return $time_zone_list; - } + return $time_zone_list; + } - /** - * gets list of themes folder from themes directory - * - * @static - * @return array - */ - static function getThemesList() - { - return XoopsLists::getDirListAsArray(XOOPS_THEME_PATH . '/'); - } + /** + * gets list of themes folder from themes directory + * + * @static + * @return array + */ + static function getThemesList() + { + return XoopsLists::getDirListAsArray(XOOPS_THEME_PATH . '/'); + } - /** - * gets a list of module folders from the modules directory - * - * @static - * @return array - */ - static function getModulesList() - { - return XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/modules/'); - } + /** + * gets a list of module folders from the modules directory + * + * @static + * @return array + */ + static function getModulesList() + { + return XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/modules/'); + } - /** - * gets list of editors folder from xoopseditor directory - * - * @static - * @return array - */ - static function getEditorList() - { - return XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/class/xoopseditor/'); - } + /** + * gets list of editors folder from xoopseditor directory + * + * @static + * @return array + */ + static function getEditorList() + { + return XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/class/xoopseditor/'); + } - /** - * gets list of name of directories inside a directory - * - * @static - * @param string $dirname - * @return array - */ - static function getDirListAsArray($dirname) - { - $ignored = array( - 'cvs', '_darcs' - ); - $list = array(); - if (substr($dirname, -1) != '/') { - $dirname .= '/'; - } - if ($handle = opendir($dirname)) { - while ($file = readdir($handle)) { - if (substr($file, 0, 1) == '.' || in_array(strtolower($file), $ignored)) { - continue; - } - if (is_dir($dirname . $file)) { - $list[$file] = $file; - } + /** + * gets list of name of directories inside a directory + * + * @static + * @param string $dirname + * @return array + */ + static function getDirListAsArray($dirname) + { + $ignored = array( + 'cvs', '_darcs' + ); + $list = array(); + if (substr($dirname, -1) != '/') { + $dirname .= '/'; + } + if ($handle = opendir($dirname)) { + while ($file = readdir($handle)) { + if (substr($file, 0, 1) == '.' || in_array(strtolower($file), $ignored)) { + continue; } - closedir($handle); - asort($list); - reset($list); + if (is_dir($dirname . $file)) { + $list[$file] = $file; + } } - return $list; + closedir($handle); + asort($list); + reset($list); } + return $list; + } - /** - * gets list of all files in a directory - * - * @static - * @param string $dirname - * @param string $prefix - * @return array - */ - static function getFileListAsArray($dirname, $prefix = '') - { - $filelist = array(); - if (substr($dirname, -1) == '/') { - $dirname = substr($dirname, 0, -1); - } - if (is_dir($dirname) && $handle = opendir($dirname)) { - while (false !== ($file = readdir($handle))) { - if (!preg_match('/^[\.]{1,2}$/', $file) && is_file($dirname . '/' . $file)) { - $file = $prefix . $file; - $filelist[$file] = $file; - } + /** + * gets list of all files in a directory + * + * @static + * @param string $dirname + * @param string $prefix + * @return array + */ + static function getFileListAsArray($dirname, $prefix = '') + { + $filelist = array(); + if (substr($dirname, -1) == '/') { + $dirname = substr($dirname, 0, -1); + } + if (is_dir($dirname) && $handle = opendir($dirname)) { + while (false !== ($file = readdir($handle))) { + if (!preg_match('/^[\.]{1,2}$/', $file) && is_file($dirname . '/' . $file)) { + $file = $prefix . $file; + $filelist[$file] = $file; } - closedir($handle); - asort($filelist); - reset($filelist); } - return $filelist; + closedir($handle); + asort($filelist); + reset($filelist); } + return $filelist; + } - /** - * gets list of image file names in a directory - * - * @static - * @param string $dirname - * @param string $prefix - * @return array - */ - static function getImgListAsArray($dirname, $prefix = '') - { - $filelist = array(); - if ($handle = opendir($dirname)) { - while (false !== ($file = readdir($handle))) { - if (preg_match('/(\.gif|\.jpg|\.png)$/i', $file)) { - $file = $prefix . $file; - $filelist[$file] = $file; - } + /** + * gets list of image file names in a directory + * + * @static + * @param string $dirname + * @param string $prefix + * @return array + */ + static function getImgListAsArray($dirname, $prefix = '') + { + $filelist = array(); + if ($handle = opendir($dirname)) { + while (false !== ($file = readdir($handle))) { + if (preg_match('/(\.gif|\.jpg|\.png)$/i', $file)) { + $file = $prefix . $file; + $filelist[$file] = $file; } - closedir($handle); - asort($filelist); - reset($filelist); } - return $filelist; + closedir($handle); + asort($filelist); + reset($filelist); } + return $filelist; + } - /** - * gets list of html file names in a certain directory - * - * @static - * @param string $dirname - * @param string $prefix - * @return array - */ - static function getHtmlListAsArray($dirname, $prefix = '') - { - $filelist = array(); - if ($handle = opendir($dirname)) { - while (false !== ($file = readdir($handle))) { - if ((preg_match('/(\.htm|\.html|\.xhtml)$/i', $file) && !is_dir($file))) { - $file = $prefix . $file; - $filelist[$file] = $prefix . $file; - } + /** + * gets list of html file names in a certain directory + * + * @static + * @param string $dirname + * @param string $prefix + * @return array + */ + static function getHtmlListAsArray($dirname, $prefix = '') + { + $filelist = array(); + if ($handle = opendir($dirname)) { + while (false !== ($file = readdir($handle))) { + if ((preg_match('/(\.htm|\.html|\.xhtml)$/i', $file) && !is_dir($file))) { + $file = $prefix . $file; + $filelist[$file] = $prefix . $file; } - closedir($handle); - asort($filelist); - reset($filelist); } - return $filelist; + closedir($handle); + asort($filelist); + reset($filelist); } + return $filelist; + } - /** - * gets list of avatar file names in a certain directory - * if directory is not specified, default directory will be searched - * - * @static - * @param string $avatar_dir - * @return array - */ - static function getAvatarsList($avatar_dir = '') - { - if ($avatar_dir != '') { - $avatars = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/' . $avatar_dir . '/', $avatar_dir . '/'); - } else { - $avatars = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/'); - } - return $avatars; + /** + * gets list of avatar file names in a certain directory + * if directory is not specified, default directory will be searched + * + * @static + * @param string $avatar_dir + * @return array + */ + static function getAvatarsList($avatar_dir = '') + { + if ($avatar_dir != '') { + $avatars = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/' . $avatar_dir . '/', $avatar_dir . '/'); + } else { + $avatars = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/'); } + return $avatars; + } - /** - * gets list of all avatar image files inside default avatars directory - * - * @static - * @return array|false - */ - static function getAllAvatarsList() - { - $avatars = array(); - $dirlist = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/images/avatar/'); - if (count($dirlist) > 0) { - foreach ($dirlist as $dir) { - $avatars[$dir] = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/' . $dir . '/', $dir . '/'); - } - } else { - return false; + /** + * gets list of all avatar image files inside default avatars directory + * + * @static + * @return array|false + */ + static function getAllAvatarsList() + { + $avatars = array(); + $dirlist = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/images/avatar/'); + if (count($dirlist) > 0) { + foreach ($dirlist as $dir) { + $avatars[$dir] = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/' . $dir . '/', $dir . '/'); } - return $avatars; + } else { + return false; } + return $avatars; + } - /** - * gets list of subject icon image file names in a certain directory - * if directory is not specified, default directory will be searched - * - * @static - * @param string $sub_dir - * @return array - */ - static function getSubjectsList($sub_dir = '') - { - if ($sub_dir != '') { - $subjects = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/subject/' . $sub_dir, $sub_dir . '/'); - } else { - $subjects = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/subject/'); - } - return $subjects; + /** + * gets list of subject icon image file names in a certain directory + * if directory is not specified, default directory will be searched + * + * @static + * @param string $sub_dir + * @return array + */ + static function getSubjectsList($sub_dir = '') + { + if ($sub_dir != '') { + $subjects = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/subject/' . $sub_dir, $sub_dir . '/'); + } else { + $subjects = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/subject/'); } + return $subjects; + } - /** - * gets list of language folders inside default language directory - * - * @static - * @return array - */ - public static function getLangList() - { - $lang_list = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/language/'); - return $lang_list; - } + /** + * gets list of language folders inside default language directory + * + * @static + * @return array + */ + public static function getLangList() + { + $lang_list = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/language/'); + return $lang_list; + } - /** - * XoopsLists::getCountryList() - * - * @static - * @return array - */ - static function getCountryList() - { - 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, - "AQ" => _COUNTRY_AQ, "AR" => _COUNTRY_AR, "AS" => _COUNTRY_AS, "AT" => _COUNTRY_AT, "AU" => _COUNTRY_AU, - "AW" => _COUNTRY_AW, "AX" => _COUNTRY_AX, "AZ" => _COUNTRY_AZ, "BA" => _COUNTRY_BA, "BB" => _COUNTRY_BB, - "BD" => _COUNTRY_BD, "BE" => _COUNTRY_BE, "BF" => _COUNTRY_BF, "BG" => _COUNTRY_BG, "BH" => _COUNTRY_BH, - "BI" => _COUNTRY_BI, "BJ" => _COUNTRY_BJ, "BL" => _COUNTRY_BL, "BM" => _COUNTRY_BM, "BN" => _COUNTRY_BN, - "BO" => _COUNTRY_BO, "BR" => _COUNTRY_BR, "BS" => _COUNTRY_BS, "BT" => _COUNTRY_BT, "BV" => _COUNTRY_BV, - "BW" => _COUNTRY_BW, "BY" => _COUNTRY_BY, "BZ" => _COUNTRY_BZ, "CA" => _COUNTRY_CA, "CC" => _COUNTRY_CC, - "CD" => _COUNTRY_CD, "CF" => _COUNTRY_CF, "CG" => _COUNTRY_CG, "CH" => _COUNTRY_CH, "CI" => _COUNTRY_CI, - "CK" => _COUNTRY_CK, "CL" => _COUNTRY_CL, "CM" => _COUNTRY_CM, "CN" => _COUNTRY_CN, "CO" => _COUNTRY_CO, - "CR" => _COUNTRY_CR, "CS" => _COUNTRY_CS, // Not listed in ISO 3166 - "CU" => _COUNTRY_CU, "CV" => _COUNTRY_CV, "CX" => _COUNTRY_CX, "CY" => _COUNTRY_CY, "CZ" => _COUNTRY_CZ, - "DE" => _COUNTRY_DE, "DJ" => _COUNTRY_DJ, "DK" => _COUNTRY_DK, "DM" => _COUNTRY_DM, "DO" => _COUNTRY_DO, - "DZ" => _COUNTRY_DZ, "EC" => _COUNTRY_EC, "EE" => _COUNTRY_EE, "EG" => _COUNTRY_EG, "EH" => _COUNTRY_EH, - "ER" => _COUNTRY_ER, "ES" => _COUNTRY_ES, "ET" => _COUNTRY_ET, "FI" => _COUNTRY_FI, "FJ" => _COUNTRY_FJ, - "FK" => _COUNTRY_FK, "FM" => _COUNTRY_FM, "FO" => _COUNTRY_FO, "FR" => _COUNTRY_FR, "FX" => _COUNTRY_FX, - // Not listed in ISO 3166 - "GA" => _COUNTRY_GA, "GB" => _COUNTRY_GB, "GD" => _COUNTRY_GD, "GE" => _COUNTRY_GE, "GF" => _COUNTRY_GF, - "GG" => _COUNTRY_GG, "GH" => _COUNTRY_GH, "GI" => _COUNTRY_GI, "GL" => _COUNTRY_GL, "GM" => _COUNTRY_GM, - "GN" => _COUNTRY_GN, "GP" => _COUNTRY_GP, "GQ" => _COUNTRY_GQ, "GR" => _COUNTRY_GR, "GS" => _COUNTRY_GS, - "GT" => _COUNTRY_GT, "GU" => _COUNTRY_GU, "GW" => _COUNTRY_GW, "GY" => _COUNTRY_GY, "HK" => _COUNTRY_HK, - "HM" => _COUNTRY_HM, "HN" => _COUNTRY_HN, "HR" => _COUNTRY_HR, "HT" => _COUNTRY_HT, "HU" => _COUNTRY_HU, - "ID" => _COUNTRY_ID, "IE" => _COUNTRY_IE, "IL" => _COUNTRY_IL, "IM" => _COUNTRY_IM, "IN" => _COUNTRY_IN, - "IO" => _COUNTRY_IO, "IQ" => _COUNTRY_IQ, "IR" => _COUNTRY_IR, "IS" => _COUNTRY_IS, "IT" => _COUNTRY_IT, - "JM" => _COUNTRY_JM, "JO" => _COUNTRY_JO, "JP" => _COUNTRY_JP, "KE" => _COUNTRY_KE, "KG" => _COUNTRY_KG, - "KH" => _COUNTRY_KH, "KI" => _COUNTRY_KI, "KM" => _COUNTRY_KM, "KN" => _COUNTRY_KN, "KP" => _COUNTRY_KP, - "KR" => _COUNTRY_KR, "KW" => _COUNTRY_KW, "KY" => _COUNTRY_KY, "KZ" => _COUNTRY_KZ, "LA" => _COUNTRY_LA, - "LB" => _COUNTRY_LB, "LC" => _COUNTRY_LC, "LI" => _COUNTRY_LI, "LK" => _COUNTRY_LK, "LR" => _COUNTRY_LR, - "LS" => _COUNTRY_LS, "LT" => _COUNTRY_LT, "LU" => _COUNTRY_LU, "LV" => _COUNTRY_LV, "LY" => _COUNTRY_LY, - "MA" => _COUNTRY_MA, "MC" => _COUNTRY_MC, "MD" => _COUNTRY_MD, "ME" => _COUNTRY_ME, "MF" => _COUNTRY_MF, - "MG" => _COUNTRY_MG, "MH" => _COUNTRY_MH, "MK" => _COUNTRY_MK, "ML" => _COUNTRY_ML, "MM" => _COUNTRY_MM, - "MN" => _COUNTRY_MN, "MO" => _COUNTRY_MO, "MP" => _COUNTRY_MP, "MQ" => _COUNTRY_MQ, "MR" => _COUNTRY_MR, - "MS" => _COUNTRY_MS, "MT" => _COUNTRY_MT, "MU" => _COUNTRY_MU, "MV" => _COUNTRY_MV, "MW" => _COUNTRY_MW, - "MX" => _COUNTRY_MX, "MY" => _COUNTRY_MY, "MZ" => _COUNTRY_MZ, "NA" => _COUNTRY_NA, "NC" => _COUNTRY_NC, - "NE" => _COUNTRY_NE, "NF" => _COUNTRY_NF, "NG" => _COUNTRY_NG, "NI" => _COUNTRY_NI, "NL" => _COUNTRY_NL, - "NO" => _COUNTRY_NO, "NP" => _COUNTRY_NP, "NR" => _COUNTRY_NR, "NT" => _COUNTRY_NT, - // Not listed in ISO 3166 - "NU" => _COUNTRY_NU, "NZ" => _COUNTRY_NZ, "OM" => _COUNTRY_OM, "PA" => _COUNTRY_PA, "PE" => _COUNTRY_PE, - "PF" => _COUNTRY_PF, "PG" => _COUNTRY_PG, "PH" => _COUNTRY_PH, "PK" => _COUNTRY_PK, "PL" => _COUNTRY_PL, - "PM" => _COUNTRY_PM, "PN" => _COUNTRY_PN, "PR" => _COUNTRY_PR, "PS" => _COUNTRY_PS, "PT" => _COUNTRY_PT, - "PW" => _COUNTRY_PW, "PY" => _COUNTRY_PY, "QA" => _COUNTRY_QA, "RE" => _COUNTRY_RE, "RO" => _COUNTRY_RO, - "RS" => _COUNTRY_RS, "RU" => _COUNTRY_RU, "RW" => _COUNTRY_RW, "SA" => _COUNTRY_SA, "SB" => _COUNTRY_SB, - "SC" => _COUNTRY_SC, "SD" => _COUNTRY_SD, "SE" => _COUNTRY_SE, "SG" => _COUNTRY_SG, "SH" => _COUNTRY_SH, - "SI" => _COUNTRY_SI, "SJ" => _COUNTRY_SJ, "SK" => _COUNTRY_SK, "SL" => _COUNTRY_SL, "SM" => _COUNTRY_SM, - "SN" => _COUNTRY_SN, "SO" => _COUNTRY_SO, "SR" => _COUNTRY_SR, "ST" => _COUNTRY_ST, "SU" => _COUNTRY_SU, - // Not listed in ISO 3166 - "SV" => _COUNTRY_SV, "SY" => _COUNTRY_SY, "SZ" => _COUNTRY_SZ, "TC" => _COUNTRY_TC, "TD" => _COUNTRY_TD, - "TF" => _COUNTRY_TF, "TG" => _COUNTRY_TG, "TH" => _COUNTRY_TH, "TJ" => _COUNTRY_TJ, "TK" => _COUNTRY_TK, - "TL" => _COUNTRY_TL, "TM" => _COUNTRY_TM, "TN" => _COUNTRY_TN, "TO" => _COUNTRY_TO, "TP" => _COUNTRY_TP, - // Not listed in ISO 3166 - "TR" => _COUNTRY_TR, "TT" => _COUNTRY_TT, "TV" => _COUNTRY_TV, "TW" => _COUNTRY_TW, "TZ" => _COUNTRY_TZ, - "UA" => _COUNTRY_UA, "UG" => _COUNTRY_UG, "UK" => _COUNTRY_UK, // Not listed in ISO 3166 - "UM" => _COUNTRY_UM, "US" => _COUNTRY_US, "UY" => _COUNTRY_UY, "UZ" => _COUNTRY_UZ, "VA" => _COUNTRY_VA, - "VC" => _COUNTRY_VC, "VE" => _COUNTRY_VE, "VG" => _COUNTRY_VG, "VI" => _COUNTRY_VI, "VN" => _COUNTRY_VN, - "VU" => _COUNTRY_VU, "WF" => _COUNTRY_WF, "WS" => _COUNTRY_WS, "YE" => _COUNTRY_YE, "YT" => _COUNTRY_YT, - "YU" => _COUNTRY_YU, // Not listed in ISO 3166 - "ZA" => _COUNTRY_ZA, "ZM" => _COUNTRY_ZM, "ZR" => _COUNTRY_ZR, // Not listed in ISO 3166 - "ZW" => _COUNTRY_ZW - ); - asort($country_list); - reset($country_list); - return $country_list; - } + /** + * XoopsLists::getCountryList() + * + * @static + * @return array + */ + static function getCountryList() + { + 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, + "AQ" => _COUNTRY_AQ, "AR" => _COUNTRY_AR, "AS" => _COUNTRY_AS, "AT" => _COUNTRY_AT, "AU" => _COUNTRY_AU, + "AW" => _COUNTRY_AW, "AX" => _COUNTRY_AX, "AZ" => _COUNTRY_AZ, "BA" => _COUNTRY_BA, "BB" => _COUNTRY_BB, + "BD" => _COUNTRY_BD, "BE" => _COUNTRY_BE, "BF" => _COUNTRY_BF, "BG" => _COUNTRY_BG, "BH" => _COUNTRY_BH, + "BI" => _COUNTRY_BI, "BJ" => _COUNTRY_BJ, "BL" => _COUNTRY_BL, "BM" => _COUNTRY_BM, "BN" => _COUNTRY_BN, + "BO" => _COUNTRY_BO, "BR" => _COUNTRY_BR, "BS" => _COUNTRY_BS, "BT" => _COUNTRY_BT, "BV" => _COUNTRY_BV, + "BW" => _COUNTRY_BW, "BY" => _COUNTRY_BY, "BZ" => _COUNTRY_BZ, "CA" => _COUNTRY_CA, "CC" => _COUNTRY_CC, + "CD" => _COUNTRY_CD, "CF" => _COUNTRY_CF, "CG" => _COUNTRY_CG, "CH" => _COUNTRY_CH, "CI" => _COUNTRY_CI, + "CK" => _COUNTRY_CK, "CL" => _COUNTRY_CL, "CM" => _COUNTRY_CM, "CN" => _COUNTRY_CN, "CO" => _COUNTRY_CO, + "CR" => _COUNTRY_CR, "CS" => _COUNTRY_CS, // Not listed in ISO 3166 + "CU" => _COUNTRY_CU, "CV" => _COUNTRY_CV, "CX" => _COUNTRY_CX, "CY" => _COUNTRY_CY, "CZ" => _COUNTRY_CZ, + "DE" => _COUNTRY_DE, "DJ" => _COUNTRY_DJ, "DK" => _COUNTRY_DK, "DM" => _COUNTRY_DM, "DO" => _COUNTRY_DO, + "DZ" => _COUNTRY_DZ, "EC" => _COUNTRY_EC, "EE" => _COUNTRY_EE, "EG" => _COUNTRY_EG, "EH" => _COUNTRY_EH, + "ER" => _COUNTRY_ER, "ES" => _COUNTRY_ES, "ET" => _COUNTRY_ET, "FI" => _COUNTRY_FI, "FJ" => _COUNTRY_FJ, + "FK" => _COUNTRY_FK, "FM" => _COUNTRY_FM, "FO" => _COUNTRY_FO, "FR" => _COUNTRY_FR, "FX" => _COUNTRY_FX, + // Not listed in ISO 3166 + "GA" => _COUNTRY_GA, "GB" => _COUNTRY_GB, "GD" => _COUNTRY_GD, "GE" => _COUNTRY_GE, "GF" => _COUNTRY_GF, + "GG" => _COUNTRY_GG, "GH" => _COUNTRY_GH, "GI" => _COUNTRY_GI, "GL" => _COUNTRY_GL, "GM" => _COUNTRY_GM, + "GN" => _COUNTRY_GN, "GP" => _COUNTRY_GP, "GQ" => _COUNTRY_GQ, "GR" => _COUNTRY_GR, "GS" => _COUNTRY_GS, + "GT" => _COUNTRY_GT, "GU" => _COUNTRY_GU, "GW" => _COUNTRY_GW, "GY" => _COUNTRY_GY, "HK" => _COUNTRY_HK, + "HM" => _COUNTRY_HM, "HN" => _COUNTRY_HN, "HR" => _COUNTRY_HR, "HT" => _COUNTRY_HT, "HU" => _COUNTRY_HU, + "ID" => _COUNTRY_ID, "IE" => _COUNTRY_IE, "IL" => _COUNTRY_IL, "IM" => _COUNTRY_IM, "IN" => _COUNTRY_IN, + "IO" => _COUNTRY_IO, "IQ" => _COUNTRY_IQ, "IR" => _COUNTRY_IR, "IS" => _COUNTRY_IS, "IT" => _COUNTRY_IT, + "JM" => _COUNTRY_JM, "JO" => _COUNTRY_JO, "JP" => _COUNTRY_JP, "KE" => _COUNTRY_KE, "KG" => _COUNTRY_KG, + "KH" => _COUNTRY_KH, "KI" => _COUNTRY_KI, "KM" => _COUNTRY_KM, "KN" => _COUNTRY_KN, "KP" => _COUNTRY_KP, + "KR" => _COUNTRY_KR, "KW" => _COUNTRY_KW, "KY" => _COUNTRY_KY, "KZ" => _COUNTRY_KZ, "LA" => _COUNTRY_LA, + "LB" => _COUNTRY_LB, "LC" => _COUNTRY_LC, "LI" => _COUNTRY_LI, "LK" => _COUNTRY_LK, "LR" => _COUNTRY_LR, + "LS" => _COUNTRY_LS, "LT" => _COUNTRY_LT, "LU" => _COUNTRY_LU, "LV" => _COUNTRY_LV, "LY" => _COUNTRY_LY, + "MA" => _COUNTRY_MA, "MC" => _COUNTRY_MC, "MD" => _COUNTRY_MD, "ME" => _COUNTRY_ME, "MF" => _COUNTRY_MF, + "MG" => _COUNTRY_MG, "MH" => _COUNTRY_MH, "MK" => _COUNTRY_MK, "ML" => _COUNTRY_ML, "MM" => _COUNTRY_MM, + "MN" => _COUNTRY_MN, "MO" => _COUNTRY_MO, "MP" => _COUNTRY_MP, "MQ" => _COUNTRY_MQ, "MR" => _COUNTRY_MR, + "MS" => _COUNTRY_MS, "MT" => _COUNTRY_MT, "MU" => _COUNTRY_MU, "MV" => _COUNTRY_MV, "MW" => _COUNTRY_MW, + "MX" => _COUNTRY_MX, "MY" => _COUNTRY_MY, "MZ" => _COUNTRY_MZ, "NA" => _COUNTRY_NA, "NC" => _COUNTRY_NC, + "NE" => _COUNTRY_NE, "NF" => _COUNTRY_NF, "NG" => _COUNTRY_NG, "NI" => _COUNTRY_NI, "NL" => _COUNTRY_NL, + "NO" => _COUNTRY_NO, "NP" => _COUNTRY_NP, "NR" => _COUNTRY_NR, "NT" => _COUNTRY_NT, + // Not listed in ISO 3166 + "NU" => _COUNTRY_NU, "NZ" => _COUNTRY_NZ, "OM" => _COUNTRY_OM, "PA" => _COUNTRY_PA, "PE" => _COUNTRY_PE, + "PF" => _COUNTRY_PF, "PG" => _COUNTRY_PG, "PH" => _COUNTRY_PH, "PK" => _COUNTRY_PK, "PL" => _COUNTRY_PL, + "PM" => _COUNTRY_PM, "PN" => _COUNTRY_PN, "PR" => _COUNTRY_PR, "PS" => _COUNTRY_PS, "PT" => _COUNTRY_PT, + "PW" => _COUNTRY_PW, "PY" => _COUNTRY_PY, "QA" => _COUNTRY_QA, "RE" => _COUNTRY_RE, "RO" => _COUNTRY_RO, + "RS" => _COUNTRY_RS, "RU" => _COUNTRY_RU, "RW" => _COUNTRY_RW, "SA" => _COUNTRY_SA, "SB" => _COUNTRY_SB, + "SC" => _COUNTRY_SC, "SD" => _COUNTRY_SD, "SE" => _COUNTRY_SE, "SG" => _COUNTRY_SG, "SH" => _COUNTRY_SH, + "SI" => _COUNTRY_SI, "SJ" => _COUNTRY_SJ, "SK" => _COUNTRY_SK, "SL" => _COUNTRY_SL, "SM" => _COUNTRY_SM, + "SN" => _COUNTRY_SN, "SO" => _COUNTRY_SO, "SR" => _COUNTRY_SR, "ST" => _COUNTRY_ST, "SU" => _COUNTRY_SU, + // Not listed in ISO 3166 + "SV" => _COUNTRY_SV, "SY" => _COUNTRY_SY, "SZ" => _COUNTRY_SZ, "TC" => _COUNTRY_TC, "TD" => _COUNTRY_TD, + "TF" => _COUNTRY_TF, "TG" => _COUNTRY_TG, "TH" => _COUNTRY_TH, "TJ" => _COUNTRY_TJ, "TK" => _COUNTRY_TK, + "TL" => _COUNTRY_TL, "TM" => _COUNTRY_TM, "TN" => _COUNTRY_TN, "TO" => _COUNTRY_TO, "TP" => _COUNTRY_TP, + // Not listed in ISO 3166 + "TR" => _COUNTRY_TR, "TT" => _COUNTRY_TT, "TV" => _COUNTRY_TV, "TW" => _COUNTRY_TW, "TZ" => _COUNTRY_TZ, + "UA" => _COUNTRY_UA, "UG" => _COUNTRY_UG, "UK" => _COUNTRY_UK, // Not listed in ISO 3166 + "UM" => _COUNTRY_UM, "US" => _COUNTRY_US, "UY" => _COUNTRY_UY, "UZ" => _COUNTRY_UZ, "VA" => _COUNTRY_VA, + "VC" => _COUNTRY_VC, "VE" => _COUNTRY_VE, "VG" => _COUNTRY_VG, "VI" => _COUNTRY_VI, "VN" => _COUNTRY_VN, + "VU" => _COUNTRY_VU, "WF" => _COUNTRY_WF, "WS" => _COUNTRY_WS, "YE" => _COUNTRY_YE, "YT" => _COUNTRY_YT, + "YU" => _COUNTRY_YU, // Not listed in ISO 3166 + "ZA" => _COUNTRY_ZA, "ZM" => _COUNTRY_ZM, "ZR" => _COUNTRY_ZR, // Not listed in ISO 3166 + "ZW" => _COUNTRY_ZW + ); + asort($country_list); + reset($country_list); + return $country_list; + } - /** - * XoopsLists::getHtmlList() - * - * This Function is no longer being used by the core - * - * @static - * @return array - */ - static function getHtmlList() - { - $html_list = array( - 'a' => '<a>', 'abbr' => '<abbr>', 'acronym' => '<acronym>', - 'address' => '<address>', 'b' => '<b>', 'bdo' => '<bdo>', 'big' => '<big>', - 'blockquote' => '<blockquote>', 'br' => '<br>', 'caption' => '<caption>', - 'cite' => '<cite>', 'code' => '<code>', 'col' => '<col>', - 'colgroup' => '<colgroup>', 'dd' => '<dd>', 'del' => '<del>', 'dfn' => '<dfn>', - 'div' => '<div>', 'dl' => '<dl>', 'dt' => '<dt>', 'em' => '<em>', - 'font' => '<font>', 'h1' => '<h1>', 'h2' => '<h2>', 'h3' => '<h3>', - 'h4' => '<h4>', 'h5' => '<h5>', 'h6' => '<h6>', 'hr' => '<hr>', - 'i' => '<i>', 'img' => '<img>', 'ins' => '<ins>', 'kbd' => '<kbd>', - 'li' => '<li>', 'map' => '<map>', 'object' => '<object>', 'ol' => '<ol>', - 'p' => '<p>', 'pre' => '<pre>', 's' => '<s>', 'samp' => '<samp>', - 'small' => '<small>', 'span' => '<span>', 'strike' => '<strike>', - 'strong' => '<strong>', 'sub' => '<sub>', 'sup' => '<sup>', - 'table' => '<table>', 'tbody' => '<tbody>', 'td' => '<td>', - 'tfoot' => '<tfoot>', 'th' => '<th>', 'thead' => '<thead>', 'tr' => '<tr>', - 'tt' => '<tt>', 'u' => '<u>', 'ul' => '<ul>', 'var' => '<var>' - ); - asort($html_list); - reset($html_list); - return $html_list; - } + /** + * XoopsLists::getHtmlList() + * + * This Function is no longer being used by the core + * + * @static + * @return array + */ + static function getHtmlList() + { + $html_list = array( + 'a' => '<a>', 'abbr' => '<abbr>', 'acronym' => '<acronym>', + 'address' => '<address>', 'b' => '<b>', 'bdo' => '<bdo>', 'big' => '<big>', + 'blockquote' => '<blockquote>', 'br' => '<br>', 'caption' => '<caption>', + 'cite' => '<cite>', 'code' => '<code>', 'col' => '<col>', + 'colgroup' => '<colgroup>', 'dd' => '<dd>', 'del' => '<del>', 'dfn' => '<dfn>', + 'div' => '<div>', 'dl' => '<dl>', 'dt' => '<dt>', 'em' => '<em>', + 'font' => '<font>', 'h1' => '<h1>', 'h2' => '<h2>', 'h3' => '<h3>', + 'h4' => '<h4>', 'h5' => '<h5>', 'h6' => '<h6>', 'hr' => '<hr>', + 'i' => '<i>', 'img' => '<img>', 'ins' => '<ins>', 'kbd' => '<kbd>', + 'li' => '<li>', 'map' => '<map>', 'object' => '<object>', 'ol' => '<ol>', + 'p' => '<p>', 'pre' => '<pre>', 's' => '<s>', 'samp' => '<samp>', + 'small' => '<small>', 'span' => '<span>', 'strike' => '<strike>', + 'strong' => '<strong>', 'sub' => '<sub>', 'sup' => '<sup>', + 'table' => '<table>', 'tbody' => '<tbody>', 'td' => '<td>', + 'tfoot' => '<tfoot>', 'th' => '<th>', 'thead' => '<thead>', 'tr' => '<tr>', + 'tt' => '<tt>', 'u' => '<u>', 'ul' => '<ul>', 'var' => '<var>' + ); + asort($html_list); + reset($html_list); + return $html_list; + } - /** - * XoopsLists::getUserRankList() - * - * @todo create handler for ranks - * @static - * @return array - ... [truncated message content] |
From: <tr...@us...> - 2011-10-15 15:40:18
|
Revision: 7888 http://xoops.svn.sourceforge.net/xoops/?rev=7888&view=rev Author: trabis Date: 2011-10-15 15:40:10 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Fixing @package for class/kernel Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.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/downloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/pagenav.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/preload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.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/tree.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsformloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopskernel.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslocal.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/zipdownloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/configitem.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/configoption.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/group.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/groupperm.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imagecategory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imageset.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imagesetimg.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/online.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/membership.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -25,7 +25,6 @@ * Official ZIP file format: http://www.pkware.com/appnote.txt * * @copyright (c) 2002 - www.ipunkt.biz (rok) - * @access public * @package class */ class zipfile 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-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,8 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @subpackage comment + * @package class * @since 2.0.0 * @author Kazumi Ono <on...@xo...> * @version $Id$ @@ -24,7 +23,7 @@ * Display comments * * @author Kazumi Ono <on...@xo...> - * @access public + * @package class */ class XoopsCommentRenderer { 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-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,8 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @subpackage database + * @package class * @since 2.0.0 * @author Kazumi Ono <on...@xo...> * @author Nathan Dial @@ -27,6 +26,7 @@ * Abstract base class should never be instantiated directly. * * @abstract + * @package class */ abstract class CriteriaElement { @@ -178,6 +178,7 @@ /** * Collection of multiple {@link CriteriaElement}s * + * @package class */ class CriteriaCompo extends CriteriaElement { @@ -281,6 +282,7 @@ /** * A single criteria * + * @package class */ class Criteria extends CriteriaElement { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/downloader.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/downloader.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/downloader.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.0.0 * @author Kazumi Ono <on...@xo...> * @version $Id$ @@ -22,6 +22,7 @@ /** * Sends non HTML files through a http socket * + * @package class */ abstract class XoopsDownloader { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/pagenav.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/pagenav.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/pagenav.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.0.0 * @author Kazumi Ono (http://www.myweb.ne.jp/, http://jp.xoops.org/) * @version $Id$ 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 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/preload.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,12 +11,10 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @subpackage class + * @package class * @since 2.4.0 * @author trabis <lus...@gm...> * @version $Id: preload.php 3437 2009-08-27 13:52:28Z trabis $ - * @deprecated To be deprecated in XOOPS 3 */ /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,11 +11,12 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.0.0 * @author Kazumi Ono (http://www.myweb.ne.jp/, http://jp.xoops.org/) * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); class XoopsTarDownloader extends XoopsDownloader Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -14,8 +14,7 @@ * @author Kazumi Ono <on...@xo...> * @author Skalpa Keo <sk...@xo...> * @author Taiwen Jiang <ph...@us...> - * @package kernel - * @subpackage core + * @package class * @version $Id$ */ 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 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -14,8 +14,7 @@ * @author Skalpa Keo <sk...@xo...> * @author Taiwen Jiang <ph...@us...> * @since 2.3.0 - * @package kernel - * @subpackage xos_opal_Theme + * @package class * @version $Id$ */ 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 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -13,7 +13,7 @@ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @author Skalpa Keo <sk...@xo...> * @since 2.3.0 - * @package kernel + * @package class * @version $Id$ */ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tree.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tree.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tree.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.0.0 * @author Kazumi Ono (http://www.myweb.ne.jp/, http://jp.xoops.org/) * @version $Id$ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.0.0 * @author Kazumi Ono (http://www.myweb.ne.jp/, http://jp.xoops.org/) * @author Taiwen Jiang <ph...@us...> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsformloader.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsformloader.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsformloader.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.0.0 * @version $Id$ */ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopskernel.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopskernel.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopskernel.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -13,10 +13,9 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.0.0 * @version $Id$ - * @deprecated */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); 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-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.0.0 * @version $Id$ */ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -15,8 +15,8 @@ * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ - * @todo For PHP 5 compliant */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); class XoopsLoad 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 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslocal.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ 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-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.0.0 * @version $Id$ */ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/zipdownloader.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/zipdownloader.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/zipdownloader.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ @@ -26,7 +26,6 @@ * @author John Neill <cat...@xo...> * @copyright copyright (c) XOOPS.org * @package class - * @access public */ class XoopsZipDownloader extends XoopsDownloader { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/configitem.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/configitem.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/configitem.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -16,6 +16,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /**#@+ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/configoption.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/configoption.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/configoption.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -16,6 +16,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/group.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/group.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/group.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -16,6 +16,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -108,91 +109,4 @@ } } -/** - * membership of a user in a group - * - * @author Kazumi Ono <on...@xo...> - * @copyright copyright (c) 2000-2003 XOOPS.org - * @package kernel - */ -class XoopsMembership extends XoopsObject -{ - /** - * Constructor - */ - public function __construct() - { - $this->initVar('linkid', XOBJ_DTYPE_INT, null, false); - $this->initVar('groupid', XOBJ_DTYPE_INT, null, false); - $this->initVar('uid', XOBJ_DTYPE_INT, null, false); - } -} - -/** - * XOOPS membership handler class. (Singleton) - * - * This class is responsible for providing data access mechanisms to the data source - * of XOOPS group membership class objects. - * - * @author Kazumi Ono <on...@xo...> - * @copyright copyright (c) 2000-2003 XOOPS.org - * @package kernel - */ -class XoopsMembershipHandler extends XoopsPersistableObjectHandler -{ - /** - * Constructor - * - * @param XoopsDatabase|null $db {@link XoopsDatabase} - */ - public function __construct(XoopsDatabase $db = null) - { - parent::__construct($db, 'groups_users_link', 'XoopsMembership', 'linkid', 'groupid'); - } - - /** - * retrieve groups for a user - * - * @param int $uid ID of the user - * objects? FALSE returns associative array. - * @return array array of groups the user belongs to - */ - public function getGroupsByUser($uid) - { - $ret = array(); - $sql = 'SELECT groupid FROM ' . $this->db->prefix('groups_users_link') . ' WHERE uid=' . intval($uid); - $result = $this->db->query($sql); - if (!$result) { - return $ret; - } - while ($myrow = $this->db->fetchArray($result)) { - $ret[] = $myrow['groupid']; - } - return $ret; - } - - /** - * retrieve users belonging to a group - * - * @param int $groupid ID of the group - * FALSE will return arrays - * @param int $limit number of entries to return - * @param int $start offset of first entry to return - * @return array array of users belonging to the group - */ - public function getUsersByGroup($groupid, $limit = 0, $start = 0) - { - $ret = array(); - $sql = 'SELECT uid FROM ' . $this->db->prefix('groups_users_link') . ' WHERE groupid=' . intval($groupid); - $result = $this->db->query($sql, $limit, $start); - if (!$result) { - return $ret; - } - while ($myrow = $this->db->fetchArray($result)) { - $ret[] = $myrow['uid']; - } - return $ret; - } -} - ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/groupperm.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/groupperm.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/groupperm.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -16,6 +16,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/image.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/image.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -16,6 +16,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imagecategory.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imagecategory.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imagecategory.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -16,6 +16,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imageset.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imageset.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imageset.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -16,6 +16,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imagesetimg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imagesetimg.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/imagesetimg.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -16,6 +16,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/member.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/member.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/member.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -16,11 +16,9 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once $GLOBALS['xoops']->path('kernel/user.php'); -require_once $GLOBALS['xoops']->path('kernel/group.php'); - /** * XOOPS member handler class. * This class provides simple interface (a facade class) for handling groups/users/ @@ -37,17 +35,22 @@ /**#@+ * holds reference to group handler(DAO) class + * @var XoopsGrouppermHandler * @access private */ private $_gHandler; /** * holds reference to user handler(DAO) class + * + * @var XoopsUserHandler */ private $_uHandler; /** * holds reference to membership handler(DAO) class + * + * @var XoopsMembershipHandler */ private $_mHandler; @@ -64,9 +67,9 @@ */ public function __construct($db = null) { - $this->_gHandler = new XoopsGroupHandler($db); - $this->_uHandler = new XoopsUserHandler($db); - $this->_mHandler = new XoopsMembershipHandler($db); + $this->_gHandler = xoops_getHandler('group'); + $this->_uHandler = xoops_getHandler('user'); + $this->_mHandler = xoops_getHandler('membership'); } /** Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/membership.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/membership.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/membership.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -0,0 +1,109 @@ +<?php +/** + * XOOPS Kernel Class + * + * 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. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.6.0 + * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ + * @version $Id: $ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * membership of a user in a group + * + * @author Kazumi Ono <on...@xo...> + * @copyright copyright (c) 2000-2003 XOOPS.org + * @package kernel + */ +class XoopsMembership extends XoopsObject +{ + /** + * Constructor + */ + public function __construct() + { + $this->initVar('linkid', XOBJ_DTYPE_INT, null, false); + $this->initVar('groupid', XOBJ_DTYPE_INT, null, false); + $this->initVar('uid', XOBJ_DTYPE_INT, null, false); + } +} + +/** + * XOOPS membership handler class. (Singleton) + * + * This class is responsible for providing data access mechanisms to the data source + * of XOOPS group membership class objects. + * + * @author Kazumi Ono <on...@xo...> + * @copyright copyright (c) 2000-2003 XOOPS.org + * @package kernel + */ +class XoopsMembershipHandler extends XoopsPersistableObjectHandler +{ + /** + * Constructor + * + * @param XoopsDatabase|null $db {@link XoopsDatabase} + */ + public function __construct(XoopsDatabase $db = null) + { + parent::__construct($db, 'groups_users_link', 'XoopsMembership', 'linkid', 'groupid'); + } + + /** + * retrieve groups for a user + * + * @param int $uid ID of the user + * objects? FALSE returns associative array. + * @return array array of groups the user belongs to + */ + public function getGroupsByUser($uid) + { + $ret = array(); + $sql = 'SELECT groupid FROM ' . $this->db->prefix('groups_users_link') . ' WHERE uid=' . intval($uid); + $result = $this->db->query($sql); + if (!$result) { + return $ret; + } + while ($myrow = $this->db->fetchArray($result)) { + $ret[] = $myrow['groupid']; + } + return $ret; + } + + /** + * retrieve users belonging to a group + * + * @param int $groupid ID of the group + * FALSE will return arrays + * @param int $limit number of entries to return + * @param int $start offset of first entry to return + * @return array array of users belonging to the group + */ + public function getUsersByGroup($groupid, $limit = 0, $start = 0) + { + $ret = array(); + $sql = 'SELECT uid FROM ' . $this->db->prefix('groups_users_link') . ' WHERE groupid=' . intval($groupid); + $result = $this->db->query($sql, $limit, $start); + if (!$result) { + return $ret; + } + while ($myrow = $this->db->fetchArray($result)) { + $ret[] = $myrow['uid']; + } + return $ret; + } +} + +?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -15,6 +15,7 @@ * @since 2.0.0 * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -17,6 +17,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); // RMV-NOTIFY Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/online.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/online.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/online.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -16,6 +16,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -16,6 +16,7 @@ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php 2011-10-15 15:17:55 UTC (rev 7887) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php 2011-10-15 15:40:10 UTC (rev 7888) @@ -35,12 +35,6 @@ private $_groups = array(); /** - * @var bool is the user admin? - * @access private - */ - private $_isAdmin = null; - - /** * @var string user's rank * @access private */ @@ -258,8 +252,9 @@ public function isOnline() { if (!isset($this->_isOnline)) { - $onlinehandler = xoops_gethandler('online'); - $this->_isOnline = ($onlinehandler->getCount(new Criteria('online_uid', $this->getVar('uid'))) > 0) ? true : false; + /* @var $online_handler XoopsOnlineHandler */ + $online_handler = xoops_gethandler('online'); + $this->_isOnline = ($online_handler->getCount(new Criteria('online_uid', $this->getVar('uid'))) > 0) ? true : false; } return $this->_isOnline; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-15 18:33:22
|
Revision: 7889 http://xoops.svn.sourceforge.net/xoops/?rev=7889&view=rev Author: trabis Date: 2011-10-15 18:33:14 +0000 (Sat, 15 Oct 2011) Log Message: ----------- refactoring class/cache Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/browse.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/file/file.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/file/xoopsfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/preload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/utility/xoopsutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/group.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/cachemodel.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/browse.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/browse.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/browse.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -29,7 +29,6 @@ include_once XOOPS_ROOT_PATH . DS . 'include' . DS . 'version.php'; require_once XOOPS_ROOT_PATH . DS . 'class' . DS . 'xoopsload.php'; -XoopsLoad::load('xos_kernel_Xoops2'); $xoops = new xos_kernel_Xoops2(); $xoops->pathTranslation(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage auth * @since 2.0 * @author Pierre-Eric MENUET <pe...@fr...> @@ -22,7 +22,7 @@ /** * - * @package kernel + * @package class * @subpackage auth * @description Authentification base class * @author Pierre-Eric MENUET <pe...@fr...> @@ -30,35 +30,48 @@ */ class XoopsAuth { - var $_dao; - var $_errors; + /** + * @var XoopsDatase|null + */ + protected $_dao; /** + * @var array + */ + protected $_errors; + + /** + * @var string + */ + protected $auth_method; + + /** * Authentication Service constructor + * + * @param XoopsDatabase|null $dao */ - function XoopsAuth(&$dao) + public function __construct($dao) { $this->_dao = $dao; } /** + * need to be write in the derived class * - * @abstract need to be write in the dervied class + * @return bool */ - function authenticate() + public function authenticate() { $authenticated = false; - return $authenticated; } /** - * add an error - * - * @param string $value error to add - * @access public + * @param int $err_no + * @param string $err_str + * @return void */ - function setErrors($err_no, $err_str) + public function setErrors($err_no, $err_str) { $this->_errors[$err_no] = trim($err_str); } @@ -69,7 +82,7 @@ * @return array an array of errors * @access public */ - function getErrors() + public function getErrors() { return $this->_errors; } @@ -80,11 +93,10 @@ * @return string html listing the errors * @access public */ - function getHtmlErrors() + public function getHtmlErrors() { - global $xoopsConfig; - $ret = '<br>'; - if ($xoopsConfig['debug_mode'] == 1 || $xoopsConfig['debug_mode'] == 2) { + $ret = '<br />'; + if ($GLOBALS['xoopsConfig']['debug_mode'] == 1 || $GLOBALS['xoopsConfig']['debug_mode'] == 2) { if (!empty($this->_errors)) { foreach ($this->_errors as $errstr) { $ret .= $errstr . '<br/>'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage auth * @since 2.0 * @author Pierre-Eric MENUET <pe...@fr...> @@ -21,45 +21,38 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** + * XoopsAuthAds * - * @package kernel + * @package class * @subpackage auth * @description Authentification class for Active Directory * @author Pierre-Eric MENUET <pe...@fr...> * @copyright copyright (c) 2000-2003 XOOPS.org */ -include_once $GLOBALS['xoops']->path('class/auth/auth_ldap.php'); - -/** - * XoopsAuthAds - * - * @package - * @author John - * @copyright Copyright (c) 2009 - * @version $Id$ - * @access public - */ class XoopsAuthAds extends XoopsAuthLdap { /** * Authentication Service constructor + * + * @param XoopsDatabase|null $dao + * @return void */ - function XoopsAuthAds(&$dao) + public function _construct(XoopsDatabase $dao = null) { - parent::XoopsAuthLdap($dao); + parent::__construct($dao); } /** * Authenticate user again LDAP directory (Bind) * 2 options : - * Authenticate directly with uname in the DN - * Authenticate with manager, search the dn + * Authenticate directly with uname in the DN + * Authenticate with manager, search the dn * * @param string $uname Username * @param string $pwd Password * @return bool */ - function authenticate($uname, $pwd = null) + public function authenticate($uname, $pwd = null) { $authenticated = false; if (!extension_loaded('ldap')) { @@ -81,7 +74,7 @@ if (!$userUPN) { return false; } - // We bind as user to test the credentials + // We bind as user to test the credentials $authenticated = ldap_bind($this->_ds, $userUPN, $this->cp1252_to_utf8(stripslashes($pwd))); if ($authenticated) { // We load the Xoops User database @@ -107,13 +100,14 @@ * looks like an email address. Very useful for logging on especially in * a large Forest. Note UPN must be unique in the forest. * - * @return userDN or false + * @param $uname + * @return string userDN */ - function getUPN($uname) + public function getUPN($uname) { $userDN = $uname . '@' . $this->ldap_domain_name; return $userDN; } -} // end class +} ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage auth * @since 2.0 * @author Pierre-Eric MENUET <pe...@fr...> @@ -20,140 +20,193 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** + * XoopsAuthLdap * - * @package kernel + * @package class * @subpackage auth * @description Authentification class for standard LDAP Server V2 or V3 * @author Pierre-Eric MENUET <pe...@fr...> * @copyright copyright (c) 2000-2003 XOOPS.org */ -if (file_exists($file = $GLOBALS['xoops']->path('class/auth/auth_provisionning.php'))) { - include_once $file; -} - -if (!class_exists('XoopsAuthProvisionning')) { - trigger_error('Required class XoopsAuthProvisionning was not found at line ' . __FILE__ . ' at line ' . __LINE__, E_USER_WARNING); - return false; -} - -/** - * XoopsAuthLdap - * - * @package - * @author John - * @copyright Copyright (c) 2009 - * @version $Id$ - * @access public - */ class XoopsAuthLdap extends XoopsAuth { - var $cp1252_map = array("\xc2\x80" => "\xe2\x82\xac" , /** - * EURO SIGN + public $cp1252_map = array( + "\xc2\x80" => "\xe2\x82\xac", /** + * EURO SIGN + */ + "\xc2\x82" => "\xe2\x80\x9a", /** + * SINGLE LOW-9 QUOTATION MARK + */ + "\xc2\x83" => "\xc6\x92", /** + * LATIN SMALL LETTER F WITH HOOK + */ + "\xc2\x84" => "\xe2\x80\x9e", /** + * DOUBLE LOW-9 QUOTATION MARK + */ + "\xc2\x85" => "\xe2\x80\xa6", /** + * HORIZONTAL ELLIPSIS + */ + "\xc2\x86" => "\xe2\x80\xa0", /** + * DAGGER + */ + "\xc2\x87" => "\xe2\x80\xa1", /** + * DOUBLE DAGGER + */ + "\xc2\x88" => "\xcb\x86", /** + * MODIFIER LETTER CIRCUMFLEX ACCENT + */ + "\xc2\x89" => "\xe2\x80\xb0", /** + * PER MILLE SIGN + */ + "\xc2\x8a" => "\xc5\xa0", /** + * LATIN CAPITAL LETTER S WITH CARON + */ + "\xc2\x8b" => "\xe2\x80\xb9", /** + * SINGLE LEFT-POINTING ANGLE QUOTATION + */ + "\xc2\x8c" => "\xc5\x92", /** + * LATIN CAPITAL LIGATURE OE + */ + "\xc2\x8e" => "\xc5\xbd", /** + * LATIN CAPITAL LETTER Z WITH CARON + */ + "\xc2\x91" => "\xe2\x80\x98", /** + * LEFT SINGLE QUOTATION MARK + */ + "\xc2\x92" => "\xe2\x80\x99", /** + * RIGHT SINGLE QUOTATION MARK + */ + "\xc2\x93" => "\xe2\x80\x9c", /** + * LEFT DOUBLE QUOTATION MARK + */ + "\xc2\x94" => "\xe2\x80\x9d", /** + * RIGHT DOUBLE QUOTATION MARK + */ + "\xc2\x95" => "\xe2\x80\xa2", /** + * BULLET + */ + "\xc2\x96" => "\xe2\x80\x93", /** + * EN DASH + */ + "\xc2\x97" => "\xe2\x80\x94", /** + * EM DASH + */ + "\xc2\x98" => "\xcb\x9c", /** + * SMALL TILDE + */ + "\xc2\x99" => "\xe2\x84\xa2", /** + * TRADE MARK SIGN + */ + "\xc2\x9a" => "\xc5\xa1", /** + * LATIN SMALL LETTER S WITH CARON + */ + "\xc2\x9b" => "\xe2\x80\xba", /** + * SINGLE RIGHT-POINTING ANGLE QUOTATION + */ + "\xc2\x9c" => "\xc5\x93", /** + * LATIN SMALL LIGATURE OE + */ + "\xc2\x9e" => "\xc5\xbe", /** + * LATIN SMALL LETTER Z WITH CARON + */ + "\xc2\x9f" => "\xc5\xb8" + ); + /** + * LATIN CAPITAL LETTER Y WITH DIAERESIS */ - "\xc2\x82" => "\xe2\x80\x9a" , /** - * SINGLE LOW-9 QUOTATION MARK + + /** + * @var */ - "\xc2\x83" => "\xc6\x92" , /** - * LATIN SMALL LETTER F WITH HOOK + public $ldap_server; + + /** + * @var string */ - "\xc2\x84" => "\xe2\x80\x9e" , /** - * DOUBLE LOW-9 QUOTATION MARK + + public $ldap_port = '389'; + /** + * @var string */ - "\xc2\x85" => "\xe2\x80\xa6" , /** - * HORIZONTAL ELLIPSIS + public $ldap_version = '3'; + + /** + * @var */ - "\xc2\x86" => "\xe2\x80\xa0" , /** - * DAGGER + public $ldap_base_dn; + + /** + * @var */ - "\xc2\x87" => "\xe2\x80\xa1" , /** - * DOUBLE DAGGER + public $ldap_loginname_asdn; + + /** + * @var */ - "\xc2\x88" => "\xcb\x86" , /** - * MODIFIER LETTER CIRCUMFLEX ACCENT + public $ldap_loginldap_attr; + + /** + * @var */ - "\xc2\x89" => "\xe2\x80\xb0" , /** - * PER MILLE SIGN + public $ldap_mail_attr; + + /** + * @var */ - "\xc2\x8a" => "\xc5\xa0" , /** - * LATIN CAPITAL LETTER S WITH CARON + public $ldap_name_attr; + + /** + * @var */ - "\xc2\x8b" => "\xe2\x80\xb9" , /** - * SINGLE LEFT-POINTING ANGLE QUOTATION + public $ldap_surname_attr; + + /** + * @var */ - "\xc2\x8c" => "\xc5\x92" , /** - * LATIN CAPITAL LIGATURE OE + public $ldap_givenname_attr; + + /** + * @var */ - "\xc2\x8e" => "\xc5\xbd" , /** - * LATIN CAPITAL LETTER Z WITH CARON + public $ldap_manager_dn; + + /** + * @var */ - "\xc2\x91" => "\xe2\x80\x98" , /** - * LEFT SINGLE QUOTATION MARK + public $ldap_manager_pass; + + /** + * @var */ - "\xc2\x92" => "\xe2\x80\x99" , /** - * RIGHT SINGLE QUOTATION MARK + public $_ds; + + /** + * @var */ - "\xc2\x93" => "\xe2\x80\x9c" , /** - * LEFT DOUBLE QUOTATION MARK + public $ldap_use_TLS; + + /** + * @var */ - "\xc2\x94" => "\xe2\x80\x9d" , /** - * RIGHT DOUBLE QUOTATION MARK - */ - "\xc2\x95" => "\xe2\x80\xa2" , /** - * BULLET - */ - "\xc2\x96" => "\xe2\x80\x93" , /** - * EN DASH - */ - "\xc2\x97" => "\xe2\x80\x94" , /** - * EM DASH - */ - "\xc2\x98" => "\xcb\x9c" , /** - * SMALL TILDE - */ - "\xc2\x99" => "\xe2\x84\xa2" , /** - * TRADE MARK SIGN - */ - "\xc2\x9a" => "\xc5\xa1" , /** - * LATIN SMALL LETTER S WITH CARON - */ - "\xc2\x9b" => "\xe2\x80\xba" , /** - * SINGLE RIGHT-POINTING ANGLE QUOTATION - */ - "\xc2\x9c" => "\xc5\x93" , /** - * LATIN SMALL LIGATURE OE - */ - "\xc2\x9e" => "\xc5\xbe" , /** - * LATIN SMALL LETTER Z WITH CARON - */ - "\xc2\x9f" => "\xc5\xb8"); + public $ldap_domain_name; + /** - * LATIN CAPITAL LETTER Y WITH DIAERESIS + * @var */ + public $ldap_filter_person; - var $ldap_server; - var $ldap_port = '389'; - var $ldap_version = '3'; - var $ldap_base_dn; - var $ldap_loginname_asdn; - var $ldap_loginldap_attr; - var $ldap_mail_attr; - var $ldap_name_attr; - var $ldap_surname_attr; - var $ldap_givenname_attr; - var $ldap_manager_dn; - var $ldap_manager_pass; - var $_ds; - /** * Authentication Service constructor + * + * @param XoopsDatabase|null $dao */ - function XoopsAuthLdap(&$dao) + public function __construct(XoopsDatabase $dao = null) { $this->_dao = $dao; // The config handler object allows us to look at the configuration options that are stored in the database + /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); $config = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH); - $confcount = count($config); foreach ($config as $key => $val) { $this->$key = $val; } @@ -162,10 +215,10 @@ /** * XoopsAuthLdap::cp1252_to_utf8() * - * @param mixed $str - * @return + * @param string $str + * @return string */ - function cp1252_to_utf8($str) + public function cp1252_to_utf8($str) { return strtr(utf8_encode($str), $this->cp1252_map); } @@ -173,14 +226,14 @@ /** * Authenticate user again LDAP directory (Bind) * 2 options : - * Authenticate directly with uname in the DN - * Authenticate with manager, search the dn + * Authenticate directly with uname in the DN + * Authenticate with manager, search the dn * * @param string $uname Username * @param string $pwd Password * @return bool */ - function authenticate($uname, $pwd = null) + public function authenticate($uname, $pwd = null) { $authenticated = false; if (!extension_loaded('ldap')) { @@ -201,7 +254,7 @@ if (!$userDN) { return false; } - // We bind as user to test the credentials + // We bind as user to test the credentials $authenticated = ldap_bind($this->_ds, $userDN, stripslashes($pwd)); if ($authenticated) { // We load the Xoops User database @@ -219,9 +272,10 @@ /** * Compose the user DN with the configuration. * - * @return userDN or false + * @param $uname + * @return bool|string userDN or false */ - function getUserDN($uname) + public function getUserDN($uname) { $userDN = false; if (!$this->ldap_loginname_asdn) { @@ -247,11 +301,11 @@ /** * Load user from XOOPS Database * - * @return XoopsUser object + * @param string $uname + * @return mixed|string */ - function getFilter($uname) + public function getFilter($uname) { - $filter = ''; if ($this->ldap_filter_person != '') { $filter = str_replace('@@loginname@@', $uname, $this->ldap_filter_person); } else { @@ -263,13 +317,14 @@ /** * XoopsAuthLdap::loadXoopsUser() * - * @param mixed $userdn - * @param mixed $uname - * @param mixed $pwd - * @return + * @param string $userdn + * @param string $uname + * @param string $pwd + * @return bool|XoopsUser */ - function loadXoopsUser($userdn, $uname, $pwd = null) + public function loadXoopsUser($userdn, $uname, $pwd = null) { + $xoopsUser = false; $provisHandler = XoopsAuthProvisionning::getInstance($this); $sr = ldap_read($this->_ds, $userdn, '(objectclass=*)'); $entries = ldap_get_entries($this->_ds, $sr); @@ -280,6 +335,6 @@ } return $xoopsUser; } -} // end class +} ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -11,34 +11,59 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage auth * @since 2.0 * @author Pierre-Eric MENUET <pe...@fr...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** + * provide synchronisation method to Xoops User Database * - * @package kernel + * @package class * @subpackage auth * @description Authentification provisionning class. This class is responsible to - * provide synchronisation method to Xoops User Database * @author Pierre-Eric MENUET <pe...@fr...> * @copyright copyright (c) 2000-2003 XOOPS.org */ class XoopsAuthProvisionning { - var $_auth_instance; + /** + * @var XoopsAuth + */ + protected $_auth_instance; /** + * @var bool + */ + public $ldap_provisionning; + + /** + * @var bool + */ + public $ldap_provisionning_upd; + + /** + * var array + */ + public $ldap_field_mapping; + + /** + * @var array + */ + public $ldap_provisionning_group; + + /** * XoopsAuthProvisionning::getInstance() * - * @param mixed $auth_instance - * @return + * @static + * @param XoopsAuth $auth_instance + * @return XoopsAuthProvisionning */ - function getInstance(&$auth_instance) + static function getInstance(XoopsAuth &$auth_instance) { static $provis_instance; if (!isset($provis_instance)) { @@ -49,10 +74,13 @@ /** * Authentication Service constructor + * + * @param XoopsAuth $auth_instance */ - function XoopsAuthProvisionning(&$auth_instance) + public function __construct(XoopsAuth &$auth_instance) { $this->_auth_instance = $auth_instance; + /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); $config = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH); foreach ($config as $key => $val) { @@ -68,10 +96,12 @@ /** * Return a Xoops User Object * - * @return XoopsUser or false + * @param $uname + * @return bool|XoopsUser */ - function getXoopsUser($uname) + public function getXoopsUser($uname) { + /* @var $member_handler XoopsMemberHandler */ $member_handler = xoops_gethandler('member'); $criteria = new Criteria('uname', $uname); $getuser = $member_handler->getUsers($criteria); @@ -85,9 +115,12 @@ /** * Launch the synchronisation process * - * @return bool + * @param $datas + * @param $uname + * @param null $pwd + * @return bool|XoopsUser */ - function sync($datas, $uname, $pwd = null) + public function sync($datas, $uname, $pwd = null) { $xoopsUser = $this->getXoopsUser($uname); if (!$xoopsUser) { // Xoops User Database not exists @@ -109,9 +142,16 @@ * * @return bool */ - function add($datas, $uname, $pwd = null) + /** + * @param array $datas + * @param string $uname + * @param string $pwd + * @return bool|XoopsUser + */ + public function add($datas, $uname, $pwd = null) { $ret = false; + /* @var $member_handler XoopsMemberHandler */ $member_handler = xoops_gethandler('member'); // Create XOOPS Database User $newuser = $member_handler->createUser(); @@ -126,11 +166,12 @@ $tab_mapping = explode('|', $this->ldap_field_mapping); foreach ($tab_mapping as $mapping) { $fields = explode('=', trim($mapping)); - if ($fields[0] && $fields[1]) + if ($fields[0] && $fields[1]) { $newuser->setVar(trim($fields[0]), utf8_decode($datas[trim($fields[1])][0])); + } } if ($member_handler->insertUser($newuser)) { - foreach($this->ldap_provisionning_group as $groupid) { + foreach ($this->ldap_provisionning_group as $groupid) { $member_handler->addUserToGroup($groupid, $newuser->getVar('uid')); } $newuser->unsetNew(); @@ -144,11 +185,16 @@ /** * Modify user information * - * @return bool + * @param XoopsUser $xoopsUser + * @param array $datas + * @param string $uname + * @param string $pwd + * @return bool|XoopsUser */ - function change(&$xoopsUser, $datas, $uname, $pwd = null) + public function change(&$xoopsUser, $datas, $uname, $pwd = null) { $ret = false; + /* @var $member_handler XoopsMemberHandler */ $member_handler = xoops_gethandler('member'); $xoopsUser->setVar('pass', md5(stripslashes($pwd))); $tab_mapping = explode('|', $this->ldap_field_mapping); @@ -171,7 +217,7 @@ * * @return bool */ - function delete() + public function delete() { } @@ -180,7 +226,7 @@ * * @return bool */ - function suspend() + public function suspend() { } @@ -189,7 +235,7 @@ * * @return bool */ - function restore() + public function restore() { } @@ -198,9 +244,9 @@ * * @return bool */ - function resetpwd() + public function resetpwd() { } -} // end class +} ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage auth * @since 2.0 * @author Pierre-Eric MENUET <pe...@fr...> @@ -22,7 +22,7 @@ /** * - * @package kernel + * @package class * @subpackage auth * @description Authentification class for Native XOOPS * @author Pierre-Eric MENUET <pe...@fr...> @@ -32,8 +32,10 @@ { /** * Authentication Service constructor + * + * @param XoopsDatabase|null $dao */ - function XoopsAuthXoops(&$dao) + public function __construct($dao = null) { $this->_dao = $dao; $this->auth_method = 'xoops'; @@ -46,8 +48,9 @@ * @param string $pwd * @return bool */ - function authenticate($uname, $pwd = null) + public function authenticate($uname, $pwd = null) { + /* @var $member_handler XoopsMemberHandler */ $member_handler = xoops_gethandler('member'); $user = $member_handler->loginUser($uname, $pwd); if ($user == false) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage auth * @since 2.0 * @author Pierre-Eric MENUET <pe...@fr...> @@ -36,18 +36,16 @@ * if the class has not been instantiated yet, this will also take * care of that * - * @static - * @return object Reference to the only instance of authentication class + * @param string $uname + * @return XoopsAuth|bool Reference to the only instance of authentication class */ - function getAuthConnection($uname) + static function getAuthConnection($uname) { static $auth_instance; if (!isset($auth_instance)) { + /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); $authConfig = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH); - - include_once $GLOBALS['xoops']->path('class/auth/auth.php'); - if (empty($authConfig['auth_method'])) { // If there is a config error, we use xoops $xoops_auth_method = 'xoops'; } else { @@ -65,7 +63,7 @@ $class = 'XoopsAuth' . ucfirst($xoops_auth_method); if (!class_exists($class)) { - $GLOBALS['xoopsLogger']->triggerError($class, _XO_ER_CLASSNOTFOUND, __FILE__, __LINE__, E_USER_ERROR ); + $GLOBALS['xoopsLogger']->triggerError($class, _XO_ER_CLASSNOTFOUND, __FILE__, __LINE__, E_USER_ERROR); return false; } switch ($xoops_auth_method) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -17,6 +17,7 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -57,10 +58,10 @@ /** * Instance of File class * - * @var object + * @var XoopsFileHandler * @access private */ - var $file = null; + private $file = null; /** * settings @@ -73,7 +74,7 @@ * @see CacheEngine::__defaults * @access public */ - var $settings = array(); + public $settings = array(); /** * Set to true if FileEngine::init(); and FileEngine::active(); do not fail. @@ -81,7 +82,7 @@ * @var boolean * @access private */ - var $active = false; + private $active = false; /** * True unless FileEngine::active(); fails @@ -89,7 +90,7 @@ * @var boolean * @access private */ - var $init = true; + private $init = true; /** * Initialize the Cache Engine @@ -97,17 +98,19 @@ * Called automatically by the cache frontend * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array()); * - * @param array $setting array of setting for the engine - * @return boolean True if the engine has been successfully initialized, false if not + * @param array $settings array of setting for the engine + * @return bool True if the engine has been successfully initialized, false if not * @access public */ - function init($settings = array()) + public function init($settings = array()) { parent::init($settings); - $defaults = array('path' => XOOPS_VAR_PATH . '/caches/xoops_cache' , 'extension' => '.php' , 'prefix' => 'xoops_' , 'lock' => false , 'serialize' => false , 'duration' => 31556926); + $defaults = array( + 'path' => XOOPS_VAR_PATH . '/caches/xoops_cache', 'extension' => '.php', 'prefix' => 'xoops_', + 'lock' => false, 'serialize' => false, 'duration' => 31556926 + ); $this->settings = array_merge($defaults, $this->settings); if (!isset($this->file)) { - XoopsLoad::load('XoopsFile'); $this->file = XoopsFile::getHandler('file', $this->settings['path'] . '/index.html', true); } $this->settings['path'] = $this->file->folder->cd($this->settings['path']); @@ -123,7 +126,7 @@ * @return boolean True if garbage collection was succesful, false on failure * @access public */ - function gc() + public function gc() { return $this->clear(true); } @@ -137,9 +140,9 @@ * @return boolean True if the data was succesfully cached, false on failure * @access public */ - function write($key, $data = null, $duration = null) + public function write($key, $data = null, $duration = null) { - if (!isset($data) || ! $this->init) { + if (!isset($data) || !$this->init) { return false; } @@ -184,9 +187,9 @@ * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it * @access public */ - function read($key) + public function read($key) { - if ($this->setKey($key) === false || ! $this->init) { + if ($this->setKey($key) === false || !$this->init) { return false; } if ($this->settings['lock']) { @@ -206,11 +209,12 @@ $data = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $data); $data = unserialize($data); if (is_array($data)) { - XoopsLoad::load('XoopsUtility'); $data = XoopsUtility::recursive('stripslashes', $data); } - } else if ($data && empty($this->settings['serialize'])) { - $data = eval($data); + } else { + if ($data && empty($this->settings['serialize'])) { + $data = eval($data); + } } $this->file->close(); return $data; @@ -223,9 +227,9 @@ * @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed * @access public */ - function delete($key) + public function delete($key) { - if ($this->setKey($key) === false || ! $this->init) { + if ($this->setKey($key) === false || !$this->init) { return false; } return $this->file->delete(); @@ -238,16 +242,16 @@ * @return boolean True if the cache was succesfully cleared, false otherwise * @access public */ - function clear($check = true) + public function clear($check = true) { if (!$this->init) { return false; } + $dir = dir($this->settings['path']); - if ($check) { - $now = time(); - $threshold = $now - $this->settings['duration']; - } + $now = time(); + $threshold = $now - $this->settings['duration']; + while (($entry = $dir->read()) !== false) { if ($this->setKey(str_replace($this->settings['prefix'], '', $entry)) === false) { continue; @@ -279,7 +283,7 @@ * @return mixed Absolute cache file for the given key or false if erroneous * @access private */ - function setKey($key) + public function setKey($key) { $this->file->folder->cd($this->settings['path']); $this->file->name = $this->settings['prefix'] . $key . $this->settings['extension']; @@ -288,7 +292,9 @@ if (!$this->file->folder->inPath($this->file->pwd(), true)) { return false; } + return true; } + /** * Determine is cache directory is writable * @@ -297,7 +303,7 @@ */ function active() { - if (!$this->active && $this->init && ! is_writable($this->settings['path'])) { + if (!$this->active && $this->init && !is_writable($this->settings['path'])) { $this->init = false; trigger_error(sprintf('%s is not writable', $this->settings['path']), E_USER_WARNING); } else { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -16,8 +16,8 @@ * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ + */ - */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -45,21 +45,16 @@ * @lastmodified $Date: 2008-01-02 00:33:52 -0600 (Wed, 02 Jan 2008) $ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -/** - * Memcache storage engine for cache - * - * @package cake - * @subpackage cake.cake.libs.cache - */ class XoopsCacheMemcache extends XoopsCacheEngine { /** * Memcache wrapper. * - * @var object + * @var Memcache * @access private */ - var $memcache = null; + private $memcache = null; + /** * settings * servers = string or array of memcache servers, default => 127.0.0.1 @@ -68,18 +63,19 @@ * @var array * @access public */ - var $settings = array(); + public $settings = array(); + /** * Initialize the Cache Engine * * Called automatically by the cache frontend * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array()); * - * @param array $setting array of setting for the engine + * @param array $settings array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not * @access public */ - function init($settings = array()) + public function init($settings = array()) { if (!class_exists('Memcache')) { return false; @@ -87,8 +83,9 @@ parent::init($settings); $defaults = array( 'servers' => array( - '127.0.0.1') , - 'compress' => false); + '127.0.0.1' + ), 'compress' => false + ); $this->settings = array_merge($defaults, $this->settings); if (!$this->settings['compress']) { @@ -96,7 +93,8 @@ } if (!is_array($this->settings['servers'])) { $this->settings['servers'] = array( - $this->settings['servers']); + $this->settings['servers'] + ); } $this->memcache = null; $this->memcache = new Memcache(); @@ -113,6 +111,7 @@ } return false; } + /** * Write data for key into cache * @@ -122,10 +121,11 @@ * @return boolean True if the data was succesfully cached, false on failure * @access public */ - function write($key, &$value, $duration) + public function write($key, &$value, $duration) { return $this->memcache->set($key, $value, $this->settings['compress'], $duration); } + /** * Read a key from the cache * @@ -133,10 +133,11 @@ * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it * @access public */ - function read($key) + public function read($key) { return $this->memcache->get($key); } + /** * Delete a key from the cache * @@ -144,20 +145,22 @@ * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed * @access public */ - function delete($key) + public function delete($key) { return $this->memcache->delete($key); } + /** * Delete all keys from the cache * * @return boolean True if the cache was succesfully cleared, false otherwise * @access public */ - function clear() + public function clear() { return $this->memcache->flush(); } + /** * Connects to a server in connection pool * @@ -166,7 +169,7 @@ * @return boolean True if memcache server was connected * @access public */ - function connect($host, $port = 11211) + public function connect($host, $port = 11211) { if ($this->memcache->getServerStatus($host, $port) === 0) { if ($this->memcache->connect($host, $port)) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -17,6 +17,7 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -44,12 +45,6 @@ * @lastmodified $Date: 2008-01-02 00:33:52 -0600 (Wed, 02 Jan 2008) $ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -/** - * Database Storage engine for cache - * - * @package cake - * @subpackage cake.cake.libs.cache - */ class XoopsCacheModel extends XoopsCacheEngine { /** @@ -60,15 +55,15 @@ * @var array * @access public */ - var $settings = array(); + public $settings = array(); /** * Model instance. * - * @var object + * @var XoopsCachemodelHandler * @access private */ - var $model = null; + private $model = null; /** * Model instance. @@ -76,7 +71,7 @@ * @var object * @access private */ - var $fields = array(); + private $fields = array(); /** * Initialize the Cache Engine @@ -84,19 +79,17 @@ * Called automatically by the cache frontend * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array()); * - * @param array $setting array of setting for the engine + * @param array $settings array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not * @access public */ - function init($settings) + public function init($settings) { - $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection(); - parent::init($settings); - $defaults = array('fields' => array('data' , 'expires')); + $defaults = array('fields' => array('data', 'expires')); $this->settings = array_merge($defaults, $this->settings); $this->fields = $this->settings['fields']; - $this->model = new XoopsCacheModelHandler($xoopsDB); + $this->model = xoops_getHandler('cachemodel'); return true; } @@ -104,8 +97,10 @@ * Garbage collection. Permanently remove all expired and deleted data * * @access public + * + * @return bool */ - function gc() + public function gc() { return $this->model->deleteAll(new Criteria($this->fields[1], time, '<= ')); } @@ -119,16 +114,14 @@ * @return boolean True if the data was succesfully cached, false on failure * @access public */ - function write($key, $data, $duration) + public function write($key, $data, $duration) { - // if (isset($this->settings['serialize'])) { $data = serialize($data); - // } - if (! $data) { + if (!$data) { return false; } $cache_obj = $this->model->create(); - $cache_obj->setVar($this->model::KEYNAME, $key); + $cache_obj->setVar($this->model->keyName, $key); $cache_obj->setVar($this->fields[0], $data); $cache_obj->setVar($this->fields[1], time() + $duration); return $this->model->insert($cache_obj); @@ -141,9 +134,9 @@ * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it * @access public */ - function read($key) + public function read($key) { - $criteria = new CriteriaCompo(new Criteria($this->model::KEYNAME, $key)); + $criteria = new CriteriaCompo(new Criteria($this->model->keyName, $key)); $criteria->add(new Criteria($this->fields[1], time(), ">")); $criteria->setLimit(1); $data = $this->model->getAll($criteria); @@ -160,9 +153,10 @@ * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed * @access public */ - function delete($key) + public function delete($key) { - return $this->model->delete($key); + $criteria = new CriteriaCompo(new Criteria($this->model->keyName, $key)); + return $this->model->deleteAll($criteria); } /** @@ -177,45 +171,4 @@ } } -/** - * XoopsCacheModelObject - * - * @package - * @author John - * @copyright Copyright (c) 2009 - * @version $Id$ - * @access public - */ -class XoopsCacheModelObject extends XoopsObject -{ - function XoopsCacheModelObject() - { - $this->__construct(); - } - - function __construct() - { - parent::__construct(); - $this->initVar('key', XOBJ_DTYPE_TXTBOX); - $this->initVar('data', XOBJ_DTYPE_SOURCE); - $this->initVar('expires', XOBJ_DTYPE_INT); - } -} - -/** - * XoopsCacheModelHandler - * - * @package - * @author John - * @copyright Copyright (c) 2009 - * @version $Id$ - * @access public - */ -class XoopsCacheModelHandler extends XoopsPersistableObjectHandler -{ - const TABLE = 'cache_model'; - const CLASSNAME = 'XoopsCacheModelObject'; - const KEYNAME = 'key'; -} - ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -17,6 +17,7 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -44,13 +45,6 @@ * @lastmodified $Date: 2008-01-02 00:33:52 -0600 (Wed, 02 Jan 2008) $ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -/** - * Xcache storage engine for cache - * - * @link http://trac.lighttpd.net/xcache/ Xcache - * @package cake - * @subpackage cake.cake.libs.cache - */ class XoopsCacheXcache extends XoopsCacheEngine { /** @@ -61,7 +55,7 @@ * @var array * @access public */ - var $settings = array(); + public $settings = array(); /** * Initialize the Cache Engine @@ -69,11 +63,11 @@ * Called automatically by the cache frontend * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array()); * - * @param array $setting array of setting for the engine - * @return boolean True if the engine has been successfully initialized, false if not + * @param array $settings array of setting for the engine + * @return bool True if the engine has been successfully initialized, false if not * @access public */ - function init($settings) + public function init($settings) { parent::init($settings); $defaults = array('PHP_AUTH_USER' => 'cake' , 'PHP_AUTH_PW' => 'cake'); @@ -90,7 +84,7 @@ * @return boolean True if the data was succesfully cached, false on failure * @access public */ - function write($key, &$value, $duration) + public function write($key, &$value, $duration) { return xcache_set($key, $value, $duration); } @@ -102,7 +96,7 @@ * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it * @access public */ - function read($key) + public function read($key) { if (xcache_isset($key)) { return xcache_get($key); @@ -117,7 +111,7 @@ * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed * @access public */ - function delete($key) + public function delete($key) { return xcache_unset($key); } @@ -128,7 +122,7 @@ * @return boolean True if the cache was succesfully cleared, false otherwise * @access public */ - function clear() + public function clear() { $result = true; $this->__auth(); @@ -149,10 +143,10 @@ * This has to be done because xcache_clear_cache() needs to pass Basic Http Auth * (see xcache.admin configuration settings) * - * @param boolean $ Revert changes + * @param boolean $reverse Revert changes * @access private */ - function __auth($reverse = false) + private function __auth($reverse = false) { static $backup = array(); $keys = array('PHP_AUTH_USER' , 'PHP_AUTH_PW'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -17,6 +17,7 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -30,37 +31,26 @@ /** * Cache engine to use * - * @var object + * @var XoopsCacheEngine * @access protected */ - var $engine = null; - // static $engine = null; + protected $engine = null; - /** * Cache configuration stack * * @var array - * @access private */ - var $configs = array(); + protected $configs = array(); /** * Holds name of the current configuration being used * * @var array - * @access private */ - var $name = null; + protected $name = null; /** - * XoopsCache::__construct() - */ - function __construct() - { - } - - /** * Returns a singleton instance * * @return XoopsCache @@ -80,10 +70,10 @@ * Tries to find and include a file for a cache engine and returns object instance * * @param $name Name of the engine - * @return mixed $engine object or null + * @return XoopsCacheEngine|bool * @access private */ - function loadEngine($name) + private function loadEngine($name) { if (!class_exists('XoopsCache' . ucfirst($name))) { if (file_exists($file = dirname(__FILE__) . '/' . strtolower($name) . '.php')) { @@ -104,7 +94,7 @@ * @return array (engine, settings) on success, false on failure * @access public */ - function config($name = 'default', $settings = array()) + public function config($name = 'default', $settings = array()) { $_this = XoopsCache::getInstance(); if (is_array($name)) { @@ -113,18 +103,23 @@ if (isset($_this->configs[$name])) { $settings = array_merge($_this->configs[$name], $settings); - } else if (!empty($settings)) { - $_this->configs[$name] = $settings; - } else if ($_this->configs !== null && isset($_this->configs[$_this->name])) { - $name = $_this->name; - $settings = $_this->configs[$_this->name]; } else { - $name = 'default'; - if (!empty($_this->configs['default'])) { - $settings = $_this->configs['default']; + if (!empty($settings)) { + $_this->configs[$name] = $settings; } else { - $settings = array( - 'engine' => 'file'); + if ($_this->configs !== null && isset($_this->configs[$_this->name])) { + $name = $_this->name; + $settings = $_this->configs[$_this->name]; + } else { + $name = 'default'; + if (!empty($_this->configs['default'])) { + $settings = $_this->configs['default']; + } else { + $settings = array( + 'engine' => 'file' + ); + } + } } } $engine = 'file'; @@ -153,7 +148,7 @@ * @return boolean True on success, false on failure * @access public */ - function engine($name = 'file', $settings = array()) + public function engine($name = 'file', $settings = array()) { if (!$name) { return false; @@ -168,10 +163,11 @@ } $_this->engine[$name] = new $cacheClass(); } - - if ($_this->engine[$name]->init($settings)) { - if (time() % $_this->engine[$name]->settings['probability'] == 0) { - $_this->engine[$name]->gc(); + /* @var $engine XoopsCacheEngine */ + $engine = $_this->engine[$name]; + if ($engine->init($settings)) { + if (time() % $engine->settings['probability'] == 0) { + $engine->gc(); } return true; } @@ -191,8 +187,9 @@ { $_this = XoopsCache::getInstance(); $config = $_this->config(); - extract($config); - $_this->engine[$engine]->gc(); + /* @var $engine XoopsCacheEngine */ + $engine = $_this->engine[$config['engine']]; + $engine->gc(); } /** @@ -212,19 +209,20 @@ $config = null; if (is_array($duration)) { extract($duration); - } else if (isset($_this->configs[$duration])) { - $config = $duration; - $duration = null; + } else { + if (isset($_this->configs[$duration])) { + $config = $duration; + $duration = null; + } } $config = $_this->config($config); if (!is_array($config)) { return null; } - extract($config); - if (!$_this->isInitialized($engine)) { - trigger_error('Cache write not initialized: ' . $engine); + if (!$_this->isInitialized($config['engine'])) { + trigger_error('Cache write not initialized: ' . $config['engine']); return false; } @@ -237,15 +235,18 @@ } if (!$duration) { - $duration = $settings['duration']; + $duration = $config['settings']['duration']; } $duration = is_numeric($duration) ? intval($duration) : strtotime($duration) - time(); if ($duration < 1) { return false; } - $_this->engine[$engine]->init($settings); - $success = $_this->engine[$engine]->write($key, $value, $duration); + + /* @var $engine XoopsCacheEngine */ + $engine = $_this->engine[$config['engine']]; + $engine->init($config['settings']); + $success = $engine->write($key, $value, $duration); return $success; } @@ -269,14 +270,17 @@ extract($config); - if (!$_this->isInitialized($engine)) { + if (!$_this->isInitialized($config['engine'])) { return false; } if (!$key = $_this->key($key)) { return false; } - $_this->engine[$engine]->init($settings); - $success = $_this->engine[$engine]->read($key); + + /* @var $engine XoopsCacheEngine */ + $engine = $_this->engine[$config['engine']]; + $engine->init($config['settings']); + $success = $engine->read($key); return $success; } @@ -290,13 +294,12 @@ */ static function delete($key, $config = null) { - $key .= '_'.urlencode(XOOPS_URL); + $key .= '_' . urlencode(XOOPS_URL); $_this = XoopsCache::getInstance(); $config = $_this->config($config); - extract($config); - if (!$_this->isInitialized($engine)) { + if (!$_this->isInitialized($config['engine'])) { return false; } @@ -304,8 +307,10 @@ return false; } - $_this->engine[$engine]->init($settings); - $success = $_this->engine[$engine]->delete($key); + /* @var $engine XoopsCacheEngine */ + $engine = $_this->engine[$config['engine']]; + $engine->init($config['settings']); + $success = $engine->delete($key); return $success; } @@ -321,23 +326,24 @@ { $_this = XoopsCache::getInstance(); $config = $_this->config($config); - extract($config); - if (!$_this->isInitialized($engine)) { + if (!$_this->isInitialized($config['engine'])) { return false; } - $success = $_this->engine[$engine]->clear($check); - $_this->engine[$engine]->init($settings); + + /* @var $engine XoopsCacheEngine */ + $engine = $_this->engine[$config['engine']]; + $success = $engine->clear($check); + $engine->init($config['settings']); return $success; } /** * Check if Cache has initialized a working storage engine * - * @param string $engine Name of the engine - * @param string $config Name of the configuration setting + * @static + * @param string $engine * @return bool - * @access public */ static function isInitialized($engine = null) { @@ -362,8 +368,10 @@ if (!$engine && isset($_this->configs[$_this->name]['engine'])) { $engine = $_this->configs[$_this->name]['engine']; } - if (isset($_this->engine[$engine]) && ! is_null($_this->engine[$engine])) { - return $_this->engine[$engine]->settings(); + if (isset($_this->engine[$engine]) && !is_null($_this->engine[$engine])) { + /* @var $engine XoopsCacheEngine */ + $engine = $_this->engine[$engine]; + return $engine->settings(); } return array(); } @@ -396,25 +404,24 @@ /** * settings of current engine instance * - * @var int + * @var array * @access public */ - var $settings; + public $settings; /** - * Iitialize the cache engine + * Initialize the cache engine * * Called automatically by the cache frontend * - * @param array $params Associative array of parameters for the engine - * @return boolean True if the engine has been succesfully initialized, false if not - * @access public + * @param array $settings Associative array of parameters for the engine + * @return bool True if the engine has been succesfully initialized, false if not */ - function init($settings = array()) + public function init($settings = array()) { $this->settings = array_merge(array( - 'duration' => 31556926 , - 'probability' => 100), $settings); + 'duration' => 31556926, 'probability' => 100 + ), $settings); return true; } @@ -425,7 +432,7 @@ * * @access public */ - function gc() + public function gc() { } @@ -438,9 +445,9 @@ * @return boolean True if the data was succesfully cached, false on failure * @access public */ - function write($key, &$value, $duration) + public function write($key, &$value, $duration) { - trigger_error(sprintf(__('Method write() not implemented in %s', true), get_class($this)), E_USER_ERROR); + trigger_error(sprintf('Method write() not implemented in %s', get_class($this)), E_USER_ERROR); } /** @@ -450,9 +457,9 @@ * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it * @access public */ - function read($key) + public function read($key) { - trigger_error(sprintf(__('Method read() not implemented in %s', true), get_class($this)), E_USER_ERROR); + trigger_error(sprintf('Method read() not implemented in %s', get_class($this)), E_USER_ERROR); } /** @@ -462,7 +469,7 @@ * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed * @access public */ - function delete($key) + public function delete($key) { } @@ -473,7 +480,7 @@ * @return boolean True if the cache was succesfully cleared, false otherwise * @access public */ - function clear($check) + public function clear($check) { } @@ -483,7 +490,7 @@ * @return array settings * @access public */ - function settings() + public function settings() { return $this->settings; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/file/file.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/file/file.php 2011-10-15 15:40:10 UTC (rev 7888) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/file/file.php 2011-10-15 18:33:14 UTC (rev 7889) @@ -55,7 +55,7 @@ ... [truncated message content] |
From: <tr...@us...> - 2011-10-15 23:19:01
|
Revision: 7891 http://xoops.svn.sourceforge.net/xoops/?rev=7891&view=rev Author: trabis Date: 2011-10-15 23:18:53 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Refactoring class/database Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.text.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.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/mysqldatabase.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/sqlutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 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-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/admin.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -20,8 +20,8 @@ /** * Admin Authentication */ -if ($xoopsUser) { - if (!$xoopsUser->isAdmin(-1)) { +if ($GLOBALS['xoopsUser']) { + if (!$GLOBALS['xoopsUser']->isAdmin(-1)) { redirect_header('index.php', 2, _AD_NORIGHT); exit(); } @@ -35,7 +35,7 @@ /** * Error warning messages */ -if (!isset($xoopsConfig['admin_warnings_enable']) || $xoopsConfig['admin_warnings_enable']) { +if (!isset($GLOBALS['xoopsConfig']['admin_warnings_enable']) || $GLOBALS['xoopsConfig']['admin_warnings_enable']) { if (is_dir(XOOPS_ROOT_PATH . '/install/')) { xoops_error(sprintf(_AD_WARNINGINSTALL, XOOPS_ROOT_PATH . '/install/')); echo '<br />'; @@ -84,9 +84,6 @@ $items = array(); if (!$items = XoopsCache::read($rssfile)) { - require_once $GLOBALS['xoops']->path('class/snoopy.php'); - include_once $GLOBALS['xoops']->path('class/xml/rss/xmlrss2parser.php'); - $snoopy = new Snoopy(); $cnt = 0; foreach ($rssurl as $url) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -14,7 +14,7 @@ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package class - * @subpackage CAPTCHA + * @subpackage captcha * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -12,7 +12,7 @@ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package class - * @subpackage CAPTCHA + * @subpackage captcha * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -12,7 +12,7 @@ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package class - * @subpackage CAPTCHA + * @subpackage captcha * @since 2.5.2 * @author trabis <lus...@gm...> * @version $Id: config.recaptcha.php 7695 2011-09-22 23:03:33Z trabis $ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.text.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.text.php 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.text.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -12,7 +12,7 @@ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package class - * @subpackage CAPTCHA + * @subpackage captcha * @since 2.5.2 * @author trabis <lus...@gm...> * @version $Id: config.text.php 7695 2011-09-22 23:03:33Z trabis $ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -14,7 +14,7 @@ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package class - * @subpackage CAPTCHA + * @subpackage captcha * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -12,7 +12,7 @@ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package class - * @subpackage CAPTCHA + * @subpackage captcha * @since 2.5.2 * @author trabis <lus...@gm...> * @version $Id: recaptcha.php 7695 2011-09-22 23:03:33Z trabis $ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.php 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -12,7 +12,7 @@ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package class - * @subpackage CAPTCHA + * @subpackage captcha * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ 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 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/database.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -11,7 +11,7 @@ * * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage database * @since 1.0.0 * @author Kazumi Ono <on...@xo...> @@ -21,15 +21,6 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** - * make sure this is only included once! - */ -if (defined('XOOPS_C_DATABASE_INCLUDED')) { - return; -} - -define('XOOPS_C_DATABASE_INCLUDED', 1); - -/** * Abstract base class for Database access classes * * @abstract @@ -37,47 +28,34 @@ * @package kernel * @subpackage database */ -class XoopsDatabase +abstract class XoopsDatabase { /** * Prefix for tables in the database * * @var string */ - var $prefix = ''; + public $prefix = ''; - /** - * reference to a {@link XoopsLogger} object - * - * @see XoopsLogger - * @var object XoopsLogger - */ - var $logger; + /** + * @var XoopsLogger + */ + public $logger; /** * If statements that modify the database are selected * * @var boolean */ - var $allowWebChanges = false; + public $allowWebChanges = false; /** - * constructor - * - * will always fail, because this is an abstract class! - */ - public function __construct() - { - // exit('Cannot instantiate this class directly'); - } - - /** * assign a {@link XoopsLogger} object to the database * * @see XoopsLogger - * @param object $logger reference to a {@link XoopsLogger} object + * @param XoopsLogger $logger reference to a {@link XoopsLogger} object */ - function setLogger($logger) + public function setLogger(XoopsLogger $logger) { $this->logger = $logger; } @@ -87,7 +65,7 @@ * * @param string $value table prefix */ - function setPrefix($value) + public function setPrefix($value) { $this->prefix = $value; } @@ -100,7 +78,7 @@ * @param string $tablename tablename * @return string prefixed tablename, just prefix if tablename is empty */ - function prefix($tablename = '') + public function prefix($tablename = '') { if ($tablename != '') { return $this->prefix . '_' . $tablename; @@ -110,120 +88,91 @@ } /** - * @param $selectdb * @abstract + * @param bool $selectdb + * @return void */ - function connect($selectdb) - { - } + abstract function connect($selectdb = true); /** * @param $sequence * @abstract */ - function genId($sequence) - { - } + abstract function genId($sequence); /** * @param $result * @abstract */ - function fetchRow($result) - { - } + abstract function fetchRow($result); /** * @param $result * @return array * @abstract */ - function fetchArray($result) - { - } + abstract function fetchArray($result); /** * @param $result * @abstract */ - function fetchBoth($result) - { - } + abstract function fetchBoth($result); /** * @param $result * @abstract */ - function fetchObject($result) - { - } + abstract function fetchObject($result); /** * @abstract */ - function getInsertId() - { - } + abstract function getInsertId(); /** * @param $result * @abstract */ - function getRowsNum($result) - { - } + abstract function getRowsNum($result); /** * @abstract */ - function getAffectedRows() - { - } + abstract function getAffectedRows(); /** * @abstract */ - function close() - { - } + abstract function close(); /** * @param $result * @abstract */ - function freeRecordSet($result) - { - } + abstract function freeRecordSet($result); /** * @abstract */ - function error() - { - } + abstract function error(); /** * @abstract */ - function errno() - { - } + abstract function errno(); /** * @param $str * @abstract */ - function quoteString($str) - { - } + abstract function quoteString($str); /** * @param $string * @abstract */ - function quote($string) - { - } + abstract function quote($string); /** * @param $sql @@ -231,9 +180,7 @@ * @param int $start * @abstract */ - function queryF($sql, $limit = 0, $start = 0) - { - } + abstract function queryF($sql, $limit = 0, $start = 0); /** * @param $sql @@ -241,57 +188,33 @@ * @param int $start * @abstract */ - function query($sql, $limit = 0, $start = 0) - { - } + abstract function query($sql, $limit = 0, $start = 0); /** * @param $file * @abstract */ - function queryFromFile($file) - { - } + abstract function queryFromFile($file); /** * @param $result * @param $offset * @abstract */ - function getFieldName($result, $offset) - { - } + abstract function getFieldName($result, $offset); /** * @param $result * @param $offset * @abstract */ - function getFieldType($result, $offset) - { - } + abstract function getFieldType($result, $offset); /** * @param $result * @abstract */ - function getFieldsNum($result) - { - } + abstract function getFieldsNum($result); } -/** - * Only for backward compatibility - * - * @deprecated - */ -class Database -{ - function getInstance() - { - $inst = XoopsDatabaseFactory::getDatabaseConnection(); - return $inst; - } -} - ?> \ No newline at end of file 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 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/databasefactory.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -11,10 +11,11 @@ * * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage database * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -52,7 +53,7 @@ $xoopsPreload = XoopsPreload::getInstance(); $xoopsPreload->triggerEvent('core.class.database.databasefactory.connection', array(&$class)); - + /* @var $instance XoopsDatabase */ $instance = new $class(); $instance->setLogger(XoopsLogger::getInstance()); $instance->setPrefix(XOOPS_DB_PREFIX); @@ -71,10 +72,10 @@ * only being used within the installer. * * @static - * @staticvar object The only instance of database class - * @return object Reference to the only instance of database class + * @staticvar XoopsDatabase The only instance of database class + * @return XoopsDatabase Reference to the only instance of database class */ - function getDatabase() + static function getDatabase() { static $database; if (!isset($database)) { 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 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/mysqldatabase.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -11,34 +11,22 @@ * * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage database * @since 1.0.0 * @author Kazumi Ono <on...@xo...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** - * - * @package kernel - * @subpackage database - * @author Kazumi Ono <on...@xo...> - * @copyright copyright (c) 2000-2003 XOOPS.org - */ - -/** - * base class - */ -include_once XOOPS_ROOT_PATH . '/class/database/database.php'; -// xoops_load( 'xoopsdatabase' ); -/** * connection to a mysql database * * @abstract * @author Kazumi Ono <on...@xo...> * @copyright copyright (c) 2000-2003 XOOPS.org - * @package kernel + * @package class * @subpackage database */ class XoopsMySQLDatabase extends XoopsDatabase @@ -48,7 +36,7 @@ * * @var resource */ - var $conn; + private $conn; /** * connect to the database @@ -56,7 +44,7 @@ * @param bool $selectdb select the database now? * @return bool successful? */ - function connect($selectdb = true) + public function connect($selectdb = true) { static $db_charset_set; @@ -100,7 +88,7 @@ * @param string $sequence name of the sequence from which to get the next ID * @return int always 0, because mysql has support for autoincrement */ - function genId($sequence) + public function genId($sequence) { return 0; // will use auto_increment } @@ -111,7 +99,7 @@ * @param resource $result * @return array */ - function fetchRow($result) + public function fetchRow($result) { return @mysql_fetch_row($result); } @@ -119,9 +107,10 @@ /** * Fetch a result row as an associative array * + * @param resource $result * @return array */ - function fetchArray($result) + public function fetchArray($result) { return @mysql_fetch_assoc($result); } @@ -129,9 +118,10 @@ /** * Fetch a result row as an associative array * + * @param resource $result * @return array */ - function fetchBoth($result) + public function fetchBoth($result) { return @mysql_fetch_array($result, MYSQL_BOTH); } @@ -139,10 +129,10 @@ /** * XoopsMySQLDatabase::fetchObjected() * - * @param mixed $result - * @return + * @param resource $result + * @return object|stdClass */ - function fetchObject($result) + public function fetchObject($result) { return @mysql_fetch_object($result); } @@ -152,7 +142,7 @@ * * @return int */ - function getInsertId() + public function getInsertId() { return mysql_insert_id($this->conn); } @@ -160,10 +150,10 @@ /** * Get number of rows in result * - * @param resource $ query result + * @param resource $result * @return int */ - function getRowsNum($result) + public function getRowsNum($result) { return @mysql_num_rows($result); } @@ -173,15 +163,17 @@ * * @return int */ - function getAffectedRows() + public function getAffectedRows() { return mysql_affected_rows($this->conn); } /** * Close MySQL connection + * + * @return void */ - function close() + public function close() { mysql_close($this->conn); } @@ -189,10 +181,10 @@ /** * will free all memory associated with the result identifier result. * - * @param resource $ query result + * @param resource $result query result * @return bool TRUE on success or FALSE on failure. */ - function freeRecordSet($result) + public function freeRecordSet($result) { return mysql_free_result($result); } @@ -202,7 +194,7 @@ * * @return bool Returns the error text from the last MySQL function, or '' (the empty string) if no error occurred. */ - function error() + public function error() { return @mysql_error(); } @@ -212,7 +204,7 @@ * * @return int Returns the error number from the last MySQL function, or 0 (zero) if no error occurred. */ - function errno() + public function errno() { return @mysql_errno(); } @@ -223,15 +215,18 @@ * @param string $str unescaped string text * @return string escaped string text with single quotes around */ - function quoteString($str) + public function quoteString($str) { return $this->quote($str); } /** * Quotes a string for use in a query. + * + * @param $string + * @return string */ - function quote($string) + public function quote($string) { return "'" . str_replace("\\\"", '"', str_replace("\\"", '"', mysql_real_escape_string($string, $this->conn))) . "'"; } @@ -245,7 +240,7 @@ * @return resource query result or FALSE if successful * or TRUE if successful and no result */ - function queryF($sql, $limit = 0, $start = 0) + public function queryF($sql, $limit = 0, $start = 0) { if (!empty($limit)) { if (empty($start)) { @@ -277,7 +272,7 @@ * @param int $start offset of first record to return * @abstract */ - function query($sql, $limit = 0, $start = 0) + public function query($sql, $limit = 0, $start = 0) { } @@ -287,10 +282,9 @@ * @param string $file file path to an SQL dump file * @return bool FALSE if failed reading SQL file or TRUE if the file has been read and queries executed */ - function queryFromFile($file) + public function queryFromFile($file) { if (false !== ($fp = fopen($file, 'r'))) { - include_once XOOPS_ROOT_PATH . '/class/database/sqlutility.php'; $sql_queries = trim(fread($fp, filesize($file))); SqlUtility::splitMySqlFile($pieces, $sql_queries); foreach ($pieces as $query) { @@ -310,10 +304,10 @@ * Get field name * * @param resource $result query result - * @param int $ numerical field index + * @param int $offset numerical field index * @return string */ - function getFieldName($result, $offset) + public function getFieldName($result, $offset) { return mysql_field_name($result, $offset); } @@ -325,7 +319,7 @@ * @param int $offset numerical field index * @return string */ - function getFieldType($result, $offset) + public function getFieldType($result, $offset) { return mysql_field_type($result, $offset); } @@ -336,7 +330,7 @@ * @param resource $result query result * @return int */ - function getFieldsNum($result) + public function getFieldsNum($result) { return mysql_num_fields($result); } @@ -361,7 +355,7 @@ * @return resource query result or FALSE if successful * or TRUE if successful and no result */ - function query($sql, $limit = 0, $start = 0) + public function query($sql, $limit = 0, $start = 0) { return $this->queryF($sql, $limit, $start); } @@ -390,14 +384,13 @@ * @param int $start offset of first record to return * @return resource query result or FALSE if unsuccessful */ - function query($sql, $limit = 0, $start = 0) + public function query($sql, $limit = 0, $start = 0) { $sql = ltrim($sql); if (!$this->allowWebChanges && strtolower(substr($sql, 0, 6)) != 'select') { trigger_error('Database updates are not allowed during processing of a GET request', E_USER_WARNING); return false; } - return $this->queryF($sql, $limit, $start); } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/sqlutility.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/sqlutility.php 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/sqlutility.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -11,7 +11,7 @@ * * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage database * @author Kazumi Ono <on...@xo...> * @version $Id$ @@ -26,20 +26,21 @@ * @package kernel * @subpackage database */ -class SqlUtility { +class SqlUtility +{ /** - * Function from phpMyAdmin (http://phpwizard.net/projects/phpMyAdmin/) - * - * Removes comment and splits large sql files into individual queries - * - * Last revision: September 23, 2001 - gandon - * - * @param array $ the splitted sql commands - * @param string $ the sql commands - * @return boolean always true - * @access public - */ - function splitMySqlFile(&$ret, $sql) + * Function from phpMyAdmin (http://phpwizard.net/projects/phpMyAdmin/) + * + * Removes comment and splits large sql files into individual queries + * + * Last revision: September 23, 2001 - gandon + * + * @param array $ret the splitted sql commands + * @param string $sql the sql commands + * @return bool always true + * @access public + */ + static function splitMySqlFile(&$ret, $sql) { $sql = trim($sql); $sql_len = strlen($sql); @@ -52,87 +53,91 @@ // We are in a string, check for not escaped end of // strings except for backquotes that can't be escaped if ($in_string) { - for (;;) { + for (; ;) { $i = strpos($sql, $string_start, $i); // No end of string found -> add the current // substring to the returned array if (!$i) { $ret[] = $sql; return true; - } - // Backquotes or no backslashes before - // quotes: it's indeed the end of the - // string -> exit the loop - else if ($string_start == '`' || $sql[$i-1] != '\\') { - $string_start = ''; - $in_string = false; - break; - } - // one or more Backslashes before the presumed - // end of string... + } // Backquotes or no backslashes before + // quotes: it's indeed the end of the + // string -> exit the loop else { - // first checks for escaped backslashes - $j = 2; - $escaped_backslash = false; - while ($i - $j > 0 && $sql[$i - $j] == '\\') { - $escaped_backslash = !$escaped_backslash; - $j++; - } - // ... if escaped backslashes: it's really the - // end of the string -> exit the loop - if ($escaped_backslash) { + if ($string_start == '`' || $sql[$i - 1] != '\\') { $string_start = ''; $in_string = false; break; - } - // ... else loop + } // one or more Backslashes before the presumed + // end of string... else { - $i++; + // first checks for escaped backslashes + $j = 2; + $escaped_backslash = false; + while ($i - $j > 0 && $sql[$i - $j] == '\\') { + $escaped_backslash = !$escaped_backslash; + $j++; + } + // ... if escaped backslashes: it's really the + // end of the string -> exit the loop + if ($escaped_backslash) { + $string_start = ''; + $in_string = false; + break; + } // ... else loop + else { + $i++; + } } } // end if...elseif...else } // end for } // end if (in string) - // We are not in a string, first check for delimiter... - else if ($char == ';') { - // if delimiter found, add the parsed part to the returned array - $ret[] = substr($sql, 0, $i); - $sql = ltrim(substr($sql, min($i + 1, $sql_len))); - $sql_len = strlen($sql); - if ($sql_len) { - $i = -1; - } else { - // The submited statement(s) end(s) here - return true; + // We are not in a string, first check for delimiter... + else { + if ($char == ';') { + // if delimiter found, add the parsed part to the returned array + $ret[] = substr($sql, 0, $i); + $sql = ltrim(substr($sql, min($i + 1, $sql_len))); + $sql_len = strlen($sql); + if ($sql_len) { + $i = -1; + } else { + // The submited statement(s) end(s) here + return true; + } + } // end else if (is delimiter) + // ... then check for start of a string,... + else { + if (($char == '"') || ($char == '\'') || ($char == '`')) { + $in_string = true; + $string_start = $char; + } // end else if (is start of string) + // for start of a comment (and remove this comment if found)... + else { + if ($char == '#' || ($char == ' ' && $i > 1 && $sql[$i - 2] . $sql[$i - 1] == '--')) { + // starting position of the comment depends on the comment type + $start_of_comment = (($sql[$i] == '#') ? $i : $i - 2); + // if no "\n" exits in the remaining string, checks for "\r" + // (Mac eol style) + $end_of_comment = (strpos(' ' . $sql, "\012", $i + 2)) ? strpos(' ' . $sql, "\012", $i + 2) + : strpos(' ' . $sql, "\015", $i + 2); + if (!$end_of_comment) { + // no eol found after '#', add the parsed part to the returned + // array and exit + // RMV fix for comments at end of file + //$last = trim(substr($sql, 0, $i-1)); + //if (!empty($last)) { + // $ret[] = $last; + //} + return true; + } else { + $sql = substr($sql, 0, $start_of_comment) . ltrim(substr($sql, $end_of_comment)); + $sql_len = strlen($sql); + $i--; + } // end if...else + } + } } - } // end else if (is delimiter) - // ... then check for start of a string,... - else if (($char == '"') || ($char == '\'') || ($char == '`')) { - $in_string = true; - $string_start = $char; - } // end else if (is start of string) - // for start of a comment (and remove this comment if found)... - else if ($char == '#' || ($char == ' ' && $i > 1 && $sql[$i-2] . $sql[$i-1] == '--')) { - // starting position of the comment depends on the comment type - $start_of_comment = (($sql[$i] == '#') ? $i : $i-2); - // if no "\n" exits in the remaining string, checks for "\r" - // (Mac eol style) - $end_of_comment = (strpos(' ' . $sql, "\012", $i + 2)) - ? strpos(' ' . $sql, "\012", $i + 2) - : strpos(' ' . $sql, "\015", $i + 2); - if (!$end_of_comment) { - // no eol found after '#', add the parsed part to the returned - // array and exit - // RMV fix for comments at end of file - //$last = trim(substr($sql, 0, $i-1)); - //if (!empty($last)) { - // $ret[] = $last; - //} - return true; - } else { - $sql = substr($sql, 0, $start_of_comment) . ltrim(substr($sql, $end_of_comment)); - $sql_len = strlen($sql); - $i--; - } // end if...else } // end else if (is comment) } // end for // add any rest to the returned array @@ -143,13 +148,13 @@ } /** - * add a prefix.'_' to all tablenames in a query - * - * @param string $query valid SQL query string - * @param string $prefix prefix to add to all table names - * @return mixed FALSE on failure - */ - function prefixQuery($query, $prefix) + * add a prefix.'_' to all tablenames in a query + * + * @param string $query valid SQL query string + * @param string $prefix prefix to add to all table names + * @return mixed FALSE on failure + */ + static function prefixQuery($query, $prefix) { $pattern = "/^(INSERT[\s]+INTO|CREATE[\s]+TABLE|ALTER[\s]+TABLE|UPDATE)(\s)+([`]?)([^`\s]+)\\3(\s)+/siU"; $pattern2 = "/^(DROP TABLE)(\s)+([`]?)([^`\s]+)\\3(\s)?$/siU"; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2011-10-15 19:16:16 UTC (rev 7890) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2011-10-15 23:18:53 UTC (rev 7891) @@ -166,6 +166,7 @@ 'mytextsanitizerextension' => XOOPS_ROOT_PATH . '/class/module.textsanitizer.php', 'smarty' => XOOPS_ROOT_PATH . '/class/smarty/Smarty.class.php', 'snoopy' => XOOPS_ROOT_PATH . '/class/snoopy.php', + 'sqlutility' => XOOPS_ROOT_PATH . '/class/database/sqlutility.php', 'tar' => XOOPS_ROOT_PATH . '/class/class.tar.php', 'xoopsauth' => XOOPS_ROOT_PATH . '/class/auth/auth.php', 'xoopsauthfactory' => XOOPS_ROOT_PATH . '/class/auth/auth_ldap.php', @@ -176,6 +177,7 @@ 'xoopscalendar' => XOOPS_ROOT_PATH . '/class/calendar/xoopscalendar.php', 'xoopscaptcha' => XOOPS_ROOT_PATH . '/class/captcha/xoopscaptcha.php', 'xoopscommentrenderer' => XOOPS_ROOT_PATH . '/class/commentrenderer.php', + 'xoopsdatabase' => XOOPS_ROOT_PATH . '/class/database/database.php', 'xoopsdownloader' => XOOPS_ROOT_PATH . '/class/downloader.php', 'xoopslists' => XOOPS_ROOT_PATH . '/class/xoopslists.php', 'xoopslocal' => XOOPS_ROOT_PATH . '/include/xoopslocal.php', @@ -231,6 +233,7 @@ 'xoopsthemeform' => XOOPS_ROOT_PATH . '/class/xoopsform/themeform.php', 'xoopsuserutility' => XOOPS_ROOT_PATH . '/class/userutility.php', 'xoopsutility' => XOOPS_ROOT_PATH . '/class/utility/xoopsutility.php', + 'xoopsxmlrss2parser' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', 'xoopszipdownloader' => XOOPS_ROOT_PATH . '/class/zipdownloader.php', 'xos_opal_adminthemefactory' => XOOPS_ROOT_PATH . '/class/theme.php', 'xos_logos_pagebuilder' => XOOPS_ROOT_PATH . '/class/theme_blocks.php', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-16 17:48:31
|
Revision: 7900 http://xoops.svn.sourceforge.net/xoops/?rev=7900&view=rev Author: trabis Date: 2011-10-16 17:48:24 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Refactoring class/model Modified Paths: -------------- 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/model/stats.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/sync.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/maintenance.php 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 2011-10-16 16:15:42 UTC (rev 7899) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php 2011-10-16 17:48:24 UTC (rev 7900) @@ -11,12 +11,13 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage model * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -25,8 +26,7 @@ * @author Taiwen Jiang <ph...@us...> * * {@link XoopsObjectAbstract} - */ -/** + * * Usage of methods provided by XoopsModelJoint: * * Step #1: set linked table and adjoint fields through XoopsPersistableObjectHandler: @@ -88,9 +88,7 @@ $limit = null; $start = null; // $field_object = empty($field_object) ? $field_link : $field_object; - $sql = " SELECT {$select}" - . " FROM {$this->handler->table} AS o" - . " LEFT JOIN {$this->handler->table_link} AS l ON o.{$this->handler->field_object} = l.{$this->handler->field_link}"; + $sql = " SELECT {$select}" . " FROM {$this->handler->table} AS o" . " LEFT JOIN {$this->handler->table_link} AS l ON o.{$this->handler->field_object} = l.{$this->handler->field_link}"; if (isset($criteria) && is_subclass_of($criteria, "criteriaelement")) { $sql .= " " . $criteria->renderWhere(); if ($sort = $criteria->getSort()) { @@ -135,9 +133,7 @@ return null; } - $sql = " SELECT COUNT(DISTINCT {$this->handler->keyName}) AS count" - . " FROM {$this->handler->table} AS o" - . " LEFT JOIN {$this->handler->table_link} AS l ON o.{$this->handler->field_object} = l.{$this->handler->field_link}"; + $sql = " SELECT COUNT(DISTINCT {$this->handler->keyName}) AS count" . " FROM {$this->handler->table} AS o" . " LEFT JOIN {$this->handler->table_link} AS l ON o.{$this->handler->field_object} = l.{$this->handler->field_link}"; if (isset($criteria) && is_subclass_of($criteria, "criteriaelement")) { $sql .= " " . $criteria->renderWhere(); } @@ -159,9 +155,7 @@ if (!$this->validateLinks()) { return null; } - $sql = " SELECT l.{$this->handler->keyName_link}, COUNT(*)" - . " FROM {$this->handler->table} AS o" - . " LEFT JOIN {$this->handler->table_link} AS l ON o.{$this->handler->field_object} = l.{$this->handler->field_link}"; + $sql = " SELECT l.{$this->handler->keyName_link}, COUNT(*)" . " FROM {$this->handler->table} AS o" . " LEFT JOIN {$this->handler->table_link} AS l ON o.{$this->handler->field_object} = l.{$this->handler->field_link}"; if (isset($criteria) && is_subclass_of($criteria, "criteriaelement")) { $sql .= " " . $criteria->renderWhere(); } @@ -177,13 +171,13 @@ } /** - * upate objects matching a condition against linked objects + * update objects matching a condition against linked objects * * @param array $data array of key => value * @param CriteriaElement|null $criteria {@link CriteriaElement} to match * @return int count of objects */ - function updateByLink($data, CriteriaElement $criteria = null) + public function updateByLink($data, CriteriaElement $criteria = null) { if (!$this->validateLinks()) { return null; @@ -192,9 +186,7 @@ foreach ($data as $key => $val) { $set[] = "o.{$key}=" . $this->handler->db->quoteString($val); } - $sql = " UPDATE {$this->handler->table} AS o" - . " SET " . implode(", ", $set) - . " LEFT JOIN {$this->handler->table_link} AS l ON o.{$this->handler->field_object} = l.{$this->handler->field_link}"; + $sql = " UPDATE {$this->handler->table} AS o" . " SET " . implode(", ", $set) . " LEFT JOIN {$this->handler->table_link} AS l ON o.{$this->handler->field_object} = l.{$this->handler->field_link}"; if (isset($criteria) && is_subclass_of($criteria, "criteriaelement")) { $sql .= " " . $criteria->renderWhere(); } @@ -207,13 +199,12 @@ * @param CriteriaElement|null $criteria {@link CriteriaElement} to match * @return int count of objects */ - function deleteByLink(CriteriaElement $criteria = null) + public function deleteByLink(CriteriaElement $criteria = null) { if (!$this->validateLinks()) { return null; } - $sql = "DELETE FROM {$this->handler->table} AS o " - . " LEFT JOIN {$this->handler->table_link} AS l ON o.{$this->handler->field_object} = l.{$this->handler->field_link}"; + $sql = "DELETE FROM {$this->handler->table} AS o " . " LEFT JOIN {$this->handler->table_link} AS l ON o.{$this->handler->field_object} = l.{$this->handler->field_link}"; if (isset($criteria) && is_subclass_of($criteria, "criteriaelement")) { $sql .= " " . $criteria->renderWhere(); } 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 2011-10-16 16:15:42 UTC (rev 7899) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php 2011-10-16 17:48:24 UTC (rev 7900) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage model * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> @@ -26,7 +26,6 @@ * * {@link XoopsObjectAbstract} */ - class XoopsModelRead extends XoopsModelAbstract { /** @@ -146,7 +145,8 @@ $myts = MyTextSanitizer::getInstance(); while ($myrow = $this->handler->db->fetchArray($result)) { // identifiers should be textboxes, so sanitize them like that - $ret[$myrow[$this->handler->keyName]] = empty($this->handler->identifierName) ? 1 : $myts->htmlSpecialChars($myrow[$this->handler->identifierName]); + $ret[$myrow[$this->handler->keyName]] = empty($this->handler->identifierName) ? 1 + : $myts->htmlSpecialChars($myrow[$this->handler->identifierName]); } return $ret; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/stats.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/stats.php 2011-10-16 16:15:42 UTC (rev 7899) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/stats.php 2011-10-16 17:48:24 UTC (rev 7900) @@ -11,12 +11,13 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage model * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -87,10 +88,7 @@ $groupby_key = $groupby; } } - $sql = "SELECT {$groupby_key}, COUNT(*) AS count" - . " FROM `{$this->handler->table}`" - . " {$sql_where}" - . " GROUP BY {$groupby_key}"; + $sql = "SELECT {$groupby_key}, COUNT(*) AS count" . " FROM `{$this->handler->table}`" . " {$sql_where}" . " GROUP BY {$groupby_key}"; if (!$result = $this->handler->db->query($sql, $limit, $start)) { return $ret; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/sync.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/sync.php 2011-10-16 16:15:42 UTC (rev 7899) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/sync.php 2011-10-16 17:48:24 UTC (rev 7900) @@ -11,12 +11,13 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage model * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -25,8 +26,7 @@ * @author Taiwen Jiang <ph...@us...> * * {@link XoopsObjectAbstract} - */ -/** + * * Usage of methods provided by XoopsModelSync: * * Step #1: set linked table and adjoint fields through XoopsPersistableObjectHandler: @@ -35,7 +35,6 @@ * $handler->field_object = "the_object_field"; // name of field in current table that will be used to link the linked table with current table; linked field name will be used if the field name is not set * Step #2: perform query */ - class XoopsModelSync extends XoopsModelAbstract { /** @@ -80,18 +79,6 @@ } return true; } - - /** - * Synchronizing objects - * @deprecated - * - * @return bool true on success - */ - public function synchronization() - { - $retval = $this->cleanOrphan(); - return $retval; - } } ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php 2011-10-16 16:15:42 UTC (rev 7899) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php 2011-10-16 17:48:24 UTC (rev 7900) @@ -11,12 +11,13 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class * @subpackage model * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -27,7 +28,6 @@ * * {@link XoopsObjectAbstract} */ - class XoopsModelWrite extends XoopsModelAbstract { /** @@ -145,9 +145,9 @@ break; case XOBJ_DTYPE_ARRAY: - $cleanv = (array) $cleanv; + $cleanv = (array)$cleanv; if (!$v['not_gpc']) { - $cleanv = array_map(array(&$ts , "stripSlashesGPC"), $cleanv); + $cleanv = array_map(array(&$ts, "stripSlashesGPC"), $cleanv); } foreach (array_keys($cleanv) as $key) { $cleanv[$key] = str_replace('\\"', '"', addslashes($cleanv[$key])); @@ -208,21 +208,23 @@ trigger_error("Data entry is not inserted - no variable is changed in object of '" . get_class($object) . "'", E_USER_NOTICE); return $object->getVar($this->handler->keyName); } - if (!$this->handler->db->{$queryFunc}($sql)) { + if (!$this->handler->db->$queryFunc($sql)) { return false; } if (!$object->getVar($this->handler->keyName) && $object_id = $this->handler->db->getInsertId()) { $object->assignVar($this->handler->keyName, $object_id); } - } else if (!empty($object->cleanVars)) { - $keys = array(); - foreach ($object->cleanVars as $k => $v) { - $keys[] = " `{$k}` = {$v}"; + } else { + if (!empty($object->cleanVars)) { + $keys = array(); + foreach ($object->cleanVars as $k => $v) { + $keys[] = " `{$k}` = {$v}"; + } + $sql = "UPDATE `" . $this->handler->table . "` SET " . implode(",", $keys) . " WHERE `" . $this->handler->keyName . "` = " . $this->handler->db->quote($object->getVar($this->handler->keyName)); + if (!$this->handler->db->$queryFunc($sql)) { + return false; + } } - $sql = "UPDATE `" . $this->handler->table . "` SET " . implode(",", $keys) . " WHERE `" . $this->handler->keyName . "` = " . $this->handler->db->quote($object->getVar($this->handler->keyName)); - if (!$this->handler->db->{$queryFunc}($sql)) { - return false; - } } return $object->getVar($this->handler->keyName); } @@ -251,7 +253,7 @@ } $sql = "DELETE FROM `" . $this->handler->table . "` WHERE " . $whereclause; $queryFunc = empty($force) ? "query" : "queryF"; - $result = $this->handler->db->{$queryFunc}($sql); + $result = $this->handler->db->$queryFunc($sql); return empty($result) ? false : true; } @@ -279,7 +281,7 @@ if (!empty($criteria)) { $sql .= ' ' . $criteria->renderWhere(); } - if (!$this->handler->db->{$queryFunc}($sql)) { + if (!$this->handler->db->$queryFunc($sql)) { return false; } return $this->handler->db->getAffectedRows(); @@ -299,17 +301,19 @@ $set_clause = "`{$fieldname}` = "; if (is_numeric($fieldvalue)) { $set_clause .= $fieldvalue; - } else if (is_array($fieldvalue)) { - $set_clause .= $this->handler->db->quote(implode(',', $fieldvalue)); } else { - $set_clause .= $this->handler->db->quote($fieldvalue); + if (is_array($fieldvalue)) { + $set_clause .= $this->handler->db->quote(implode(',', $fieldvalue)); + } else { + $set_clause .= $this->handler->db->quote($fieldvalue); + } } $sql = 'UPDATE `' . $this->handler->table . '` SET ' . $set_clause; if (isset($criteria)) { $sql .= ' ' . $criteria->renderWhere(); } $queryFunc = empty($force) ? 'query' : 'queryF'; - $result = $this->handler->db->{$queryFunc}($sql); + $result = $this->handler->db->$queryFunc($sql); return empty($result) ? false : true; } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php 2011-10-16 16:15:42 UTC (rev 7899) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php 2011-10-16 17:48:24 UTC (rev 7900) @@ -17,9 +17,11 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); include_once XOOPS_ROOT_PATH . '/kernel/object.php'; + /** * Factory for object handlers * @@ -34,13 +36,6 @@ static private $handlers = array(); /** - * XoopsModelFactory::__construct() - */ - private function __construct() - { - } - - /** * Get singleton instance * * @access public @@ -50,7 +45,8 @@ { static $instance; if (!isset($instance)) { - $instance = new XoopsModelFactory(); + $class = __CLASS__; + $instance = new $class(); } return $instance; } @@ -74,8 +70,10 @@ include_once $file; $className = 'XoopsModel' . ucfirst($name); $handler = new $className(); - } else if (xoops_load('model', 'framework')) { - $handler = XoopsModel::loadHandler($name); + } else { + if (xoops_load('model', 'framework')) { + $handler = XoopsModel::loadHandler($name); + } } if (!is_object($handler)) { trigger_error('Handler not found in file ' . __FILE__ . 'at line ' . __LINE__, E_USER_WARNING); Modified: 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/maintenance.php 2011-10-16 16:15:42 UTC (rev 7899) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/maintenance.php 2011-10-16 17:48:24 UTC (rev 7900) @@ -33,7 +33,7 @@ * Constructor */ function SystemMaintenance() { - $db = Database::getInstance(); + $db = XoopsDatabaseFactory::getDatabaseConnection(); $this->db = $db; $this->prefix = $this->db->prefix.'_'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-22 14:22:44
|
Revision: 7922 http://xoops.svn.sourceforge.net/xoops/?rev=7922&view=rev Author: trabis Date: 2011-10-22 14:22:35 +0000 (Sat, 22 Oct 2011) Log Message: ----------- refactoring class/xoopsforms Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/xoopseditor.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/formbutton.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formbuttontray.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcheckbox.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/formdatetime.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/formeditor.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formelement.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formelementtray.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhidden.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/formlabel.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formpassword.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formradio.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formradioyn.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselect.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectcheckgroup.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectcountry.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselecteditor.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectgroup.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectlang.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectmatchoption.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselecttheme.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselecttimezone.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/formtext.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtextarea.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/grouppermform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/simpleform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/tableform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/xoopseditor.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/xoopseditor.php 2011-10-21 20:15:00 UTC (rev 7921) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/xoopseditor.php 2011-10-22 14:22:35 UTC (rev 7922) @@ -159,7 +159,7 @@ * @param bool $noHtml * @param string $OnFailure a pre-validated editor that will be used if the required editor is failed to create * @param bool $noHtml dohtml disabled - * @return null + * @return null|XoopsEditor */ public function get($name = '', $options = null, $noHtml = false, $OnFailure = '') { @@ -235,7 +235,7 @@ * * @param string $name * @param mixed $options - * @return + * @return XoopsEditor|null */ private function _loadEditor($name, $options = null) { 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 2011-10-21 20:15:00 UTC (rev 7921) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/form.php 2011-10-22 14:22:35 UTC (rev 7922) @@ -11,100 +11,75 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @subpackage form + * @package class + * @subpackage xoopsform * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); -/** - * Abstract base class for forms - * - * @author Kazumi Ono <on...@xo...> - * @author Taiwen Jiang <ph...@us...> - * @package kernel - * @subpackage form - * @access public - */ -class XoopsForm +abstract class XoopsForm implements XoopsFormContainer { /** - * *#@+ - * - * @access private - */ - /** * "action" attribute for the html form * * @var string */ - var $_action; + private $_action; /** * "method" attribute for the form. * * @var string */ - var $_method; + private $_method; /** * "name" attribute of the form * * @var string */ - var $_name; + private $_name; /** * title for the form * * @var string */ - var $_title; + private $_title; /** * summary for the form (WGAC2 Requirement) * * @var string */ - var $_summary = ''; + private $_summary = ''; /** * array of {@link XoopsFormElement} objects * * @var array */ - var $_elements = array(); + private $_elements = array(); /** * extra information for the <form> tag * * @var array */ - var $_extra = array(); + private $_extra = array(); /** * required elements * * @var array */ - var $_required = array(); + private $_required = array(); - /** - * additional seralised object checksum (ERM Analysis - Requirement) - * @deprecated - * @access private - */ - var $_objid = 'da39a3ee5e6b4b0d3255bfef95601890afd80709'; - - /** - * *#@- - */ - - /** * constructor * * @param string $title title of the form @@ -112,108 +87,38 @@ * @param string $action "action" attribute for the <form> tag * @param string $method "method" attribute for the <form> tag * @param bool $addtoken whether to add a security token to the form + * @param string $summary */ - function XoopsForm($title, $name, $action, $method = 'post', $addtoken = false, $summary = '') + public function __construct($title, $name, $action, $method = 'post', $addtoken = false, $summary = '') { $this->_title = $title; $this->_name = $name; $this->_action = $action; $this->_method = $method; - $this->_summary = $summary; + $this->_summary = $summary; if ($addtoken != false) { $this->addElement(new XoopsFormHiddenToken()); } } - /** - * *#@+ - * retrieves object serialisation/identification id (sha1 used) - * - * each object has serialisation<br /> - * - legal requirement of enterprise relational management (ERM) - * - * @deprecated - * @access public - */ - function getObjectID($object, $hashinfo = 'sha1') - { - if (!is_object($object)) - $object = $this; - - switch($hashinfo) { - case "md5": - - @$var['name'] = md5(get_class($object)); - - foreach(get_object_vars($object) as $key => $value) - if ($key != '_objid') - @$var['value'] = $this->getArrayID($value, $key, $var['value'], $hashinfo); - - foreach(get_class_methods($object) as $key => $value) - @$var['func'] = $this->getArrayID($value, $key, $var['func'], $hashinfo); - - @$this->_objid = md5($var['name'].":".$var['func'].":".$var['value']); - return $this->_objid; - break; - - default: - - @$var['name'] = sha1(get_class($object)); - - foreach(get_object_vars($object) as $key => $value) - if ($key != '_objid') - @$var['value'] = $this->getArrayID($value, $key, $var['value'], $hashinfo); - - foreach(get_class_methods($object) as $key => $value) - @$var['func'] = $this->getArrayID($value, $key, $var['func'], $hashinfo); - - @$this->_objid = sha1($var['name'].":".$var['func'].":".$var['value']); - return $this->_objid; - - } - } - - function getArrayID($value, $key, $ret, $hashinfo = 'sha1') { - switch($hashinfo) { - case "md5": - if (is_array($value)) { - foreach ($value as $keyb => $valueb) - @$ret = md5($ret.":".$this->getArrayID($valueb, $keyb, $ret, $hashinfo)); - } else { - @$ret = md5($ret.":".$key.":".$value); - } - return $ret; - break; - default: - if (is_array($value)) { - foreach ($value as $keyb => $valueb) - @$ret = sha1($ret.":".$this->getArrayID($valueb, $keyb, $ret, $hashinfo)); - } else { - @$ret = sha1($ret.":".$key.":".$value); - } - return $ret; - break; - } - } - - /** + /** * return the summary of the form * * @param bool $encode To sanitizer the text? * @return string */ - function getSummary($encode = false) + public function getSummary($encode = false) { return $encode ? htmlspecialchars($this->_summary, ENT_QUOTES) : $this->_summary; } - /** + /** * return the title of the form * * @param bool $encode To sanitizer the text? * @return string */ - function getTitle($encode = false) + public function getTitle($encode = false) { return $encode ? htmlspecialchars($this->_title, ENT_QUOTES) : $this->_title; } @@ -226,7 +131,7 @@ * @param bool $encode To sanitizer the text? * @return string */ - function getName($encode = true) + public function getName($encode = true) { return $encode ? htmlspecialchars($this->_name, ENT_QUOTES) : $this->_name; } @@ -237,7 +142,7 @@ * @param bool $encode To sanitizer the text? * @return string */ - function getAction($encode = true) + public function getAction($encode = true) { // Convert & to & for backward compatibility return $encode ? htmlspecialchars(str_replace('&', '&', $this->_action), ENT_QUOTES) : $this->_action; @@ -248,7 +153,7 @@ * * @return string */ - function getMethod() + public function getMethod() { return (strtolower($this->_method) == 'get') ? 'get' : 'post'; } @@ -256,56 +161,54 @@ /** * Add an element to the form * - * @param object $ &$formElement reference to a {@link XoopsFormElement} + * @param XoopsFormElement $formElement * @param bool $required is this a "required" element? + * @return void */ - function addElement(&$formElement, $required = false) + public function addElement(XoopsFormElement &$formElement, $required = false) { - if (is_string($formElement)) { - $this->_elements[] = $formElement; - } elseif (is_subclass_of($formElement, 'xoopsformelement')) { - $this->_elements[] = $formElement; - if (! $formElement->isContainer()) { - if ($required) { - $formElement->_required = true; - $this->_required[] = $formElement; - } - } else { - $required_elements = $formElement->getRequired(); - $count = count($required_elements); - for($i = 0; $i < $count; $i ++) { - $this->_required[] = $required_elements[$i]; - } + /* @var XoopsFormElement $formElement */ + $this->_elements[] = $formElement; + if ($formElement instanceof XoopsFormContainer) { + /* @var $formElement XoopsFormContainer */ + $required_elements = $formElement->getRequired(); + $count = count($required_elements); + for ($i = 0; $i < $count; $i++) { + $this->_required[] = $required_elements[$i]; } + } else { + if ($required && !$formElement instanceof XoopsFormRaw) { + $formElement->setRequired(); + $this->_required[] = $formElement; + } } } /** * get an array of forms elements * - * @param bool $ get elements recursively? + * @param bool $recurse get elements recursively? * @return array array of {@link XoopsFormElement}s */ - function getElements($recurse = false) + public function getElements($recurse = false) { - if (! $recurse) { + if (!$recurse) { return $this->_elements; } else { $ret = array(); - $count = count($this->_elements); - for($i = 0; $i < $count; $i ++) { - if (is_object($this->_elements[$i])) { - if (! $this->_elements[$i]->isContainer()) { - $ret[] = $this->_elements[$i]; - } else { - $elements = $this->_elements[$i]->getElements(true); - $count2 = count($elements); - for($j = 0; $j < $count2; $j ++) { - $ret[] = $elements[$j]; - } - unset($elements); + foreach ($this->_elements as $ele) { + if ($ele instanceof XoopsFormContainer) { + /* @var $ele XoopsFormContainer */ + $elements = $ele->getElements(true); + foreach ($elements as $ele2) { + $ret[] = $ele2; } + unset($elements); + unset($ele2); + } else { + $ret[] = $ele; } + unset($ele); } return $ret; } @@ -316,13 +219,14 @@ * * @return array array of form element names */ - function getElementNames() + public function getElementNames() { $ret = array(); $elements = $this->getElements(true); - $count = count($elements); - for($i = 0; $i < $count; $i ++) { - $ret[] = $elements[$i]->getName(); + foreach ($elements as $ele) { + /* @var $ele XoopsFormElement */ + $ret[] = $ele->getName(); + unset($ele); } return $ret; } @@ -331,33 +235,32 @@ * get a reference to a {@link XoopsFormElement} object by its "name" * * @param string $name "name" attribute assigned to a {@link XoopsFormElement} - * @return object reference to a {@link XoopsFormElement}, false if not found + * + * @return null|XoopsFormElement */ - function getElementByName($name) + public function getElementByName($name) { $elements = $this->getElements(true); - $count = count($elements); - for($i = 0; $i < $count; $i ++) { - if ($name == $elements[$i]->getName(false)) { - return $elements[$i]; + foreach ($elements as $ele) { + /* @var XoopsFormElement $ele */ + if ($name == $ele->getName(false)) { + return $ele; } } - $elt = null; - return $elt; + $ele = null; + return $ele; } - /** + /** * Sets the "value" attribute of a form element * * @param string $name the "name" attribute of a form element * @param string $value the "value" attribute of a form element */ - function setElementValue($name, $value) + public function setElementValue($name, $value) { $ele = $this->getElementByName($name); - if (is_object($ele) && method_exists($ele, 'setValue')) { - $ele->setValue($value); - } + $ele->setValue($value); } /** @@ -365,16 +268,16 @@ * * @param array $values array of name/value pairs to be assigned to form elements */ - function setElementValues($values) + public function setElementValues($values) { - if (is_array($values) && ! empty($values)) { + if (is_array($values) && !empty($values)) { // will not use getElementByName() for performance.. $elements = $this->getElements(true); - $count = count($elements); - for($i = 0; $i < $count; $i ++) { - $name = $elements[$i]->getName(false); - if ($name && isset($values[$name]) && method_exists($elements[$i], 'setValue')) { - $elements[$i]->setValue($values[$name]); + foreach ($elements as $ele) { + /* @var $ele XoopsFormElement */ + $name = $ele->getName(false); + if ($name && isset($values[$name])) { + $ele->setValue($values[$name]); } } } @@ -385,15 +288,12 @@ * * @param string $name the "name" attribute of a form element * @param bool $encode To sanitizer the text? - * @return string the "value" attribute assigned to a form element, null if not set + * @return string|null the "value" attribute assigned to a form element, null if not set */ - function getElementValue($name, $encode = false) + public function getElementValue($name, $encode = false) { $ele = $this->getElementByName($name); - if (is_object($ele) && method_exists($ele, 'getValue')) { - return $ele->getValue($encode); - } - return; + return $ele->getValue($encode); } /** @@ -402,16 +302,16 @@ * @param bool $encode To sanitizer the text? * @return array array of name/value pairs assigned to form elements */ - function getElementValues($encode = false) + public function getElementValues($encode = false) { // will not use getElementByName() for performance.. $elements = $this->getElements(true); - $count = count($elements); $values = array(); - for($i = 0; $i < $count; $i ++) { - $name = $elements[$i]->getName(false); - if ($name && method_exists($elements[$i], 'getValue')) { - $values[$name] = $elements[$i]->getValue($encode); + foreach ($elements as $ele) { + /* @var XoopsFormElement $ele */ + $name = $ele->getName(false); + if ($name) { + $values[$name] = $ele->getValue($encode); } } return $values; @@ -422,22 +322,23 @@ * * @param string $extra extra attributes for the <form> tag */ - function setExtra($extra) + public function setExtra($extra) { - if (! empty($extra)) { + if (!empty($extra)) { $this->_extra[] = $extra; } } - /** + /** * set the summary tag for the <form> tag * - * @param string $extra extra attributes for the <form> tag + * @param $summary + * @return void */ - function setSummary($summary) + public function setSummary($summary) { - if (! empty($summary)) { - $this->summary = strip_tags($summary); + if (!empty($summary)) { + $this->_summary = strip_tags($summary); } } @@ -446,7 +347,7 @@ * * @return string */ - function getExtra() + public function getExtra() { $extra = empty($this->_extra) ? '' : ' ' . implode(' ', $this->_extra); return $extra; @@ -455,9 +356,10 @@ /** * make an element "required" * - * @param object $ &$formElement reference to a {@link XoopsFormElement} + * @param XoopsFormElement $formElement + * @return void */ - function setRequired(&$formElement) + public function setRequired(XoopsFormElement &$formElement) { $this->_required[] = $formElement; } @@ -467,38 +369,24 @@ * * @return array array of {@link XoopsFormElement}s */ - function getRequired() + public function getRequired() { return $this->_required; } /** - * insert a break in the form - * - * This method is abstract. It must be overwritten in the child classes. - * - * @param string $extra extra information for the break - * @abstract - */ - function insertBreak($extra = null) - { - } - - /** * returns renderered form * * This method is abstract. It must be overwritten in the child classes. * * @abstract */ - function render() - { - } + abstract function render(); /** * displays rendered form */ - function display() + public function display() { echo $this->render(); } @@ -524,8 +412,10 @@ * </code> * * @param boolean $withtags Include the < javascript > tags in the returned string + * + * @return string */ - function renderValidationJS($withtags = true) + public function renderValidationJS($withtags = true) { $js = ''; if ($withtags) { @@ -534,10 +424,9 @@ $formname = $this->getName(); $js .= "function xoopsFormValidate_{$formname}() { var myform = window.document.{$formname}; "; $elements = $this->getElements(true); - foreach($elements as $elt) { - if (method_exists($elt, 'renderValidationJS')) { - $js .= $elt->renderValidationJS(); - } + foreach ($elements as $ele) { + /* @var XoopsFormElement $ele */ + $js .= $ele->renderValidationJS(); } $js .= "return true;\n}\n"; if ($withtags) { @@ -549,22 +438,19 @@ /** * assign to smarty form template instead of displaying directly * - * @param object $ &$tpl reference to a {@link Smarty} object - * @see Smarty + * @param XoopsTpl $tpl + * @return void */ - function assign(&$tpl) + public function assign(XoopsTpl &$tpl) { - $i = - 1; + $i = -1; $elements = array(); if (count($this->getRequired()) > 0) { - $this->_elements[] = "<tr class='foot'><td colspan='2'>* = " . _REQUIRED . "</td></tr>"; + $this->_elements[] = new XoopsFormRaw("<tr class='foot'><td colspan='2'>* = " . _REQUIRED . "</td></tr>"); } - foreach($this->getElements() as $ele) { - ++ $i; - if (is_string($ele)) { - $elements[$i]['body'] = $ele; - continue; - } + foreach ($this->getElements() as $ele) { + ++$i; + /* @var XoopsFormElement $ele */ $ele_name = $ele->getName(); $ele_description = $ele->getDescription(); $n = $ele_name ? $ele_name : $i; @@ -579,13 +465,11 @@ } $js = $this->renderValidationJS(); $tpl->assign($this->getName(), array( - 'title' => $this->getTitle() , - 'name' => $this->getName() , - 'action' => $this->getAction() , - 'method' => $this->getMethod() , - 'extra' => 'onsubmit="return xoopsFormValidate_' . $this->getName() . '();"' . $this->getExtra() , - 'javascript' => $js , - 'elements' => $elements)); + 'title' => $this->getTitle(), 'name' => $this->getName(), 'action' => $this->getAction(), + 'method' => $this->getMethod(), + 'extra' => 'onsubmit="return xoopsFormValidate_' . $this->getName() . '();"' . $this->getExtra(), + 'javascript' => $js, 'elements' => $elements + )); } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formbutton.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formbutton.php 2011-10-21 20:15:00 UTC (rev 7921) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formbutton.php 2011-10-22 14:22:35 UTC (rev 7922) @@ -11,104 +11,59 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @subpackage form + * @package class + * @subpackage xoopsform * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); -/** - * - * - * @package kernel - * @subpackage form - * - * @author Kazumi Ono <on...@xo...> - * @copyright copyright (c) 2000-2003 XOOPS.org - */ -/** - * A button - * - * @author Kazumi Ono <on...@xo...> - * @copyright copyright (c) 2000-2003 XOOPS.org - * - * @package kernel - * @subpackage form - */ class XoopsFormButton extends XoopsFormElement { - /** - * Value - * @var string - * @access private - */ - var $_value; - - /** + /** * Type of the button. This could be either "button", "submit", or "reset" - * @var string - * @access private - */ - var $_type; + * @var string + */ + protected $_type; - /** - * Constructor + /** + * Constructor * - * @param string $caption Caption - * @param string $name - * @param string $value - * @param string $type Type of the button. Potential values: "button", "submit", or "reset" - */ - function XoopsFormButton($caption, $name, $value = "", $type = "button") - { - $this->setCaption($caption); - $this->setName($name); - $this->_type = $type; - $this->setValue($value); - } + * @param string $caption Caption + * @param string $name + * @param string $value + * @param string $type Type of the button. Potential values: "button", "submit", or "reset" + */ + public function __construct($caption, $name, $value = "", $type = "button") + { + $this->setCaption($caption); + $this->setName($name); + $this->_type = $type; + $this->setValue($value); + } - /** - * Get the initial value - * - * @param bool $encode To sanitizer the text? - * @return string - */ - function getValue($encode = false) - { - return $encode ? htmlspecialchars($this->_value, ENT_QUOTES) : $this->_value; - } + /** + * Get the type + * + * @return string + */ + public function getType() + { + return in_array(strtolower($this->_type), array("button", "submit", "reset")) ? $this->_type : "button"; + } - /** - * Set the initial value - * - * @return string - */ - function setValue($value) - { - $this->_value = $value; - } - - /** - * Get the type - * - * @return string - */ - function getType() - { - return in_array( strtolower($this->_type), array("button", "submit", "reset") ) ? $this->_type : "button"; - } - - /** - * prepare HTML for output - * - * @return string - */ - function render() - { - return "<input type='" . $this->getType() . "' class='formButton' name='" . $this->getName() . "' id='" . $this->getName() . "' value='" . $this->getValue() . "' title='" . $this->getValue() . "'" . $this->getExtra() . " />"; - } + /** + * prepare HTML for output + * + * @return string + */ + public function render() + { + return "<input type='" . $this->getType() . "' class='formButton' name='" . $this->getName() . "' id='" . $this->getName() . "' value='" . $this->getValue() . "' title='" . $this->getValue() . "'" . $this->getExtra() . " />"; + } } + ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formbuttontray.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formbuttontray.php 2011-10-21 20:15:00 UTC (rev 7921) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formbuttontray.php 2011-10-22 14:22:35 UTC (rev 7922) @@ -1,105 +1,77 @@ <?php /** - * XOOPS Form Class Elements + * XOOPS Form element of button tray * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * 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. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @subpackage form + * @package class + * @subpackage xoopsform * @since 2.4.0 * @author John Neill <cat...@xo...> * @version $Id: formbuttontray.php 0000 14/04/2009 16:16:22 John Neill $ - * */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); -/** - * XoopsFormButtonTray - * - * @author John Neill <cat...@xo...> - * @package kernel - * @subpackage form - * @access public - */ -class XoopsFormButtonTray extends XoopsFormElement { - /** - * Value - * - * @var string - * @access private - */ - var $_value; +class XoopsFormButtonTray extends XoopsFormElement +{ - /** - * Type of the button. This could be either "button", "submit", or "reset" - * - * @var string - * @access private - */ - var $_type; + /** + * Type of the button. This could be either "button", "submit", or "reset" + * + * @var string + */ + private $_type; - /** - * XoopsFormButtonTray::XoopsFormButtonTray() - * - * @param mixed $name - * @param string $value - * @param string $type - * @param string $onclick - */ - function XoopsFormButtonTray( $name, $value = '', $type = '', $onclick = '', $showDelete = false ) { - $this->setName( $name ); - $this->setValue( $value ); - $this->_type = ( !empty( $type ) ) ? $type : 'submit'; - $this->_showDelete = $showDelete; - if ( $onclick ) { - $this->setExtra( $onclick ); - } else { - $this->setExtra( '' ); - } - } + /** + * XoopsFormButtonTray::XoopsFormButtonTray() + * + * @param mixed $name + * @param string $value + * @param string $type + * @param string $onclick + * @param bool $showDelete + */ + function __construct($name, $value = '', $type = '', $onclick = '', $showDelete = false) + { + $this->setName($name); + $this->setValue($value); + $this->_type = (!empty($type)) ? $type : 'submit'; + $this->_showDelete = $showDelete; + if ($onclick) { + $this->setExtra($onclick); + } else { + $this->setExtra(''); + } + } - /** - * XoopsFormButtonTray::getValue() - * - * @return - */ - function getValue() { - return $this->_value; - } + /** + * @return string + */ + public function getType() + { + return $this->_type; + } - /** - * XoopsFormButtonTray::setValue() - * - * @param mixed $value - * @return - */ - function setValue( $value ) { - $this->_value = $value; - } - - /** - * XoopsFormButtonTray::getType() - * - * @return - */ - function getType() { - return $this->_type; - } - - /** - * XoopsFormButtonTray::render() - * - * @return - */ - function render() { - // onclick="this.form.elements.op.value=\'delfile\'; - $ret = ''; - if ( $this->_showDelete ) { - $ret .= '<input type="submit" class="formbutton" name="delete" id="delete" value="' . _DELETE . '" onclick="this.form.elements.op.value=\'delete\'"> '; - } - $ret .= '<input type="button" value="' . _CANCEL . '" onClick="history.go(-1);return true;" /> <input type="reset" class="formbutton" name="reset" id="reset" value="' . _RESET . '" /> <input type="' . $this->getType() . '" class="formbutton" name="' . $this->getName() . '" id="' . $this->getName() . '" value="' . $this->getValue() . '"' . $this->getExtra() . ' />'; - return $ret; - } + /** + * @return string + */ + public function render() + { + $ret = ''; + if ($this->_showDelete) { + $ret .= '<input type="submit" class="formbutton" name="delete" id="delete" value="' . _DELETE . '" onclick="this.form.elements.op.value=\'delete\'"> '; + } + $ret .= '<input type="button" value="' . _CANCEL . '" onClick="history.go(-1);return true;" /> <input type="reset" class="formbutton" name="reset" id="reset" value="' . _RESET . '" /> <input type="' . $this->getType() . '" class="formbutton" name="' . $this->getName() . '" id="' . $this->getName() . '" value="' . $this->getValue() . '"' . $this->getExtra() . ' />'; + return $ret; + } } ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcaptcha.php 2011-10-21 20:15:00 UTC (rev 7921) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcaptcha.php 2011-10-22 14:22:35 UTC (rev 7922) @@ -11,12 +11,13 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @subpackage form + * @package class + * @subpackage xoopsform * @since 2.3.0 * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -36,24 +37,21 @@ * </code> */ -/** - * Xoops Form Captcha - * - * @author Taiwen Jiang <ph...@us...> - * @package kernel - * @subpackage form - */ class XoopsFormCaptcha extends XoopsFormElement { - var $captchaHandler; + /** + * @var XoopsCaptcha + */ + public $captchaHandler; /** * * @param string $caption Caption of the form element, default value is defined in captcha/language/ * @param string $name Name for the input box * @param boolean $skipmember Skip CAPTCHA check for members + * @param array $configs */ - function XoopsFormCaptcha($caption = '', $name = 'xoopscaptcha', $skipmember = true, $configs = array()) + public function __construct($caption = '', $name = 'xoopscaptcha', $skipmember = true, $configs = array()) { $this->captchaHandler = XoopsCaptcha::getInstance(); $configs['name'] = $name; @@ -68,19 +66,17 @@ } } - function setConfig($name, $val) + public function setConfig($name, $val) { return $this->captchaHandler->setConfig($name, $val); } - function render() + public function render() { - // if (!$this->isHidden()) { return $this->captchaHandler->render(); - // } } - function renderValidationJS() + public function renderValidationJS() { return $this->captchaHandler->renderValidationJS(); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcheckbox.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcheckbox.php 2011-10-21 20:15:00 UTC (rev 7921) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcheckbox.php 2011-10-22 14:22:35 UTC (rev 7922) @@ -1,6 +1,6 @@ <?php /** - * XOOPS form checkbox compo + * XOOPS form element of checkbox compo * * 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 @@ -11,13 +11,15 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package class + * @subpackage xoopsform * @since 2.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @author Skalpa Keo <sk...@xo...> * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); class XoopsFormCheckBox extends XoopsFormElement @@ -26,33 +28,29 @@ * Availlable options * * @var array - * @access private */ - var $_options = array(); + private $_options = array(); /** * pre-selected values in array * * @var array - * @access private */ - var $_value = array(); + protected $_value = array(); /** * HTML to seperate the elements * * @var string - * @access private */ - var $_delimeter; + private $_delimeter; /** * Column number for rendering * * @var int - * @access public */ - var $columns; + public $columns; /** * Constructor @@ -60,8 +58,9 @@ * @param string $caption * @param string $name * @param mixed $value Either one value as a string or an array of them. + * @param string $delimeter */ - function XoopsFormCheckBox($caption, $name, $value = null, $delimeter = ' ') + public function __construct($caption, $name, $value = null, $delimeter = ' ') { $this->setCaption($caption); $this->setName($name); @@ -69,51 +68,15 @@ $this->setValue($value); } $this->_delimeter = $delimeter; - $this->setFormType('checkbox'); } /** - * Get the "value" - * - * @param bool $encode To sanitizer the text? - * @return array - */ - function getValue($encode = false) - { - if (! $encode) { - return $this->_value; - } - $value = array(); - foreach($this->_value as $val) { - $value[] = $val ? htmlspecialchars($val, ENT_QUOTES) : $val; - } - return $value; - } - - /** - * Set the "value" - * - * @param array $ - */ - function setValue($value) - { - $this->_value = array(); - if (is_array($value)) { - foreach($value as $v) { - $this->_value[] = $v; - } - } else { - $this->_value[] = $value; - } - } - - /** * Add an option * * @param string $value * @param string $name */ - function addOption($value, $name = '') + public function addOption($value, $name = '') { if ($name != '') { $this->_options[$value] = $name; @@ -127,10 +90,10 @@ * * @param array $options Associative array of value->name pairs */ - function addOptionArray($options) + public function addOptionArray($options) { if (is_array($options)) { - foreach($options as $k => $v) { + foreach ($options as $k => $v) { $this->addOption($k, $v); } } @@ -139,17 +102,18 @@ /** * Get an array with all the options * - * @param int $encode To sanitizer the text? potential values: 0 - skip; 1 - only for value; 2 - for both value and name + * @param bool $encode To sanitizer the text? potential values: 0 - skip; 1 - only for value; 2 - for both value and name * @return array Associative array of value->name pairs */ - function getOptions($encode = false) + public function getOptions($encode = false) { - if (! $encode) { + if (!$encode) { return $this->_options; } $value = array(); - foreach($this->_options as $val => $name) { - $value[$encode ? htmlspecialchars($val, ENT_QUOTES) : $val] = ($encode > 1) ? htmlspecialchars($name, ENT_QUOTES) : $name; + foreach ($this->_options as $val => $name) { + $value[$encode ? htmlspecialchars($val, ENT_QUOTES) : $val] = ($encode > 1) + ? htmlspecialchars($name, ENT_QUOTES) : $name; } return $value; } @@ -160,7 +124,7 @@ * @param bool $encode To sanitizer the text? * @return string The delimiter */ - function getDelimeter($encode = false) + public function getDelimeter($encode = false) { return $encode ? htmlspecialchars(str_replace(' ', ' ', $this->_delimeter)) : $this->_delimeter; } @@ -170,29 +134,29 @@ * * @return string */ - function render() + public function render() { $ele_name = $this->getName(); - $ele_title = $this->getTitle(); + $ele_title = $this->getTitle(); $ele_id = $ele_name; $ele_value = $this->getValue(); $ele_options = $this->getOptions(); $ele_extra = $this->getExtra(); $ele_delimeter = empty($this->columns) ? $this->getDelimeter() : ''; - if (count($ele_options) > 1 && substr($ele_name, - 2, 2) != '[]') { + if (count($ele_options) > 1 && substr($ele_name, -2, 2) != '[]') { $ele_name = $ele_name . '[]'; $this->setName($ele_name); } $ret = ''; - if (! empty($this->columns)) { + if (!empty($this->columns)) { $ret .= '<table><tr>'; } $i = 0; $id_ele = 0; - foreach($ele_options as $value => $name) { - $id_ele ++; - if (! empty($this->columns)) { + foreach ($ele_options as $value => $name) { + $id_ele++; + if (!empty($this->columns)) { if ($i % $this->columns == 0) { $ret .= '<tr>'; } @@ -203,15 +167,15 @@ if (count($ele_value) > 0 && in_array($value, $ele_value)) { $ret .= ' checked="checked"'; } - $ret .= $ele_extra . ' />'."<label name='xolb_{$ele_name}' for='{$ele_id}{$id_ele}'>" . $name . "</label>" . $ele_delimeter ; - if (! empty($this->columns)) { + $ret .= $ele_extra . ' />' . "<label name='xolb_{$ele_name}' for='{$ele_id}{$id_ele}'>" . $name . "</label>" . $ele_delimeter; + if (!empty($this->columns)) { $ret .= '</td>'; - if (++ $i % $this->columns == 0) { + if (++$i % $this->columns == 0) { $ret .= '</tr>'; } } } - if (! empty($this->columns)) { + if (!empty($this->columns)) { if ($span = $i % $this->columns) { $ret .= '<td colspan="' . ($this->columns - $span) . '"></td></tr>'; } @@ -224,11 +188,13 @@ * Render custom javascript validation code * * @seealso XoopsForm::renderValidationJS + * + * @return string */ - function renderValidationJS() + public function renderValidationJS() { // render custom validation code if any - if (! empty($this->customValidationCode)) { + if (!empty($this->customValidationCode)) { return implode(NWLINE, $this->customValidationCode); // generate validation code if required } elseif ($this->isRequired()) { 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 2011-10-21 20:15:00 UTC (rev 7921) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcolorpicker.php 2011-10-22 14:22:35 UTC (rev 7922) @@ -1,9 +1,9 @@ <?php /** - * XoopsFormColorPicker component class file - * + * XOOPS form element of colorpicker + * * 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 + * 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. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -11,44 +11,32 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @subpackage form + * @package class + * @subpackage xoopsform * @since 2.0.0 * @author Zoullou <web...@zo...> + * @author John Neill <cat...@xo...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); -/** - * Color Selection Field - * - * @author Zoullou <web...@zo...> - * @author John Neill <cat...@xo...> - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @version $Id$ - * @package Kernel - * @access public - */ class XoopsFormColorPicker extends XoopsFormText { /** - * XoopsFormColorPicker::XoopsFormColorPicker() - * * @param mixed $caption * @param mixed $name * @param string $value */ - function XoopsFormColorPicker($caption, $name, $value = '#FFFFFF') + public function XoopsFormColorPicker($caption, $name, $value = '#FFFFFF') { - $this->XoopsFormText($caption, $name, 9, 7, $value); + parent::__construct($caption, $name, 9, 7, $value); } - + /** - * XoopsFormColorPicker::render() - * - * @return + * @return string */ - function render() + public function render() { if (isset($GLOBALS['xoTheme'])) { $GLOBALS['xoTheme']->addScript('include/color-picker.js'); @@ -56,20 +44,20 @@ echo '<script type="text/javascript" src="' . XOOPS_URL . '/include/color-picker.js"></script>'; } $this->setExtra(' style="background-color:' . $this->getValue() . ';"'); - return parent::render() . "<input type='reset' value=' ... ' onclick=\"return TCP.popup('" . XOOPS_URL . "/include/',document.getElementById('" . $this->getName() . "'));\">" ; + return parent::render() . "<input type='reset' value=' ... ' onclick=\"return TCP.popup('" . XOOPS_URL . "/include/',document.getElementById('" . $this->getName() . "'));\">" ; } - + /** * Returns custom validation Javascript * * @return string Element validation Javascript */ - function renderValidationJS() + public function renderValidationJS() { $eltname = $this->getName(); $eltcaption = $this->getCaption(); $eltmsg = empty($eltcaption) ? sprintf(_FORM_ENTER, $eltname) : sprintf(_FORM_ENTER, $eltcaption); - + return "if ( !(new RegExp(\"^#[0-9a-fA-F]{6}\",\"i\").test(myform.{$eltname}.value)) ) { window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }"; } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdatetime.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdatetime.php 2011-10-21 20:15:00 UTC (rev 7921) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdatetime.php 2011-10-22 14:22:35 UTC (rev 7922) @@ -9,44 +9,36 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @subpackage form + * @package class + * @subpackage xoopsform * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); -/** - * Date and time selection field - * - * @author Kazumi Ono <on...@xo...> - * @package kernel - * @subpackage form - * @access public - */ + class XoopsFormDateTime extends XoopsFormElementTray { /** - * XoopsFormDateTime::XoopsFormDateTime() - * * @param mixed $caption * @param mixed $name * @param integer $size * @param integer $value * @param mixed $showtime */ - function XoopsFormDateTime($caption, $name, $size = 15, $value = 0, $showtime = true) + public function __construct($caption, $name, $size = 15, $value = 0, $showtime = true) { - $this->XoopsFormElementTray($caption, ' '); + parent::__construct($caption, ' '); $value = intval($value); $value = ($value > 0) ? $value : time(); $datetime = getDate($value); $this->addElement(new XoopsFormTextDateSelect('', $name . '[date]', $size, $value, $showtime)); $timearray = array(); - for ($i = 0; $i < 24; $i ++) { + for ($i = 0; $i < 24; $i++) { for ($j = 0; $j < 60; $j = $j + 10) { $key = ($i * 3600) + ($j * 60); $timearray[$key] = ($j != 0) ? $i . ':' . $j : $i . ':0' . $j; 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 2011-10-21 20:15:00 UTC (rev 7921) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdhtmltextarea.php 2011-10-22 14:22:35 UTC (rev 7922) @@ -1,6 +1,6 @@ <?php /** - * Formatted textarea form + * XOOPS form element of dhtmltextarea * * 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 @@ -11,17 +11,17 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @subpackage form + * @package class + * @subpackage xoopsform * @since 2.0.0 * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ * @author Taiwen Jiang <ph...@us...> * @author Vinod <sma...@gm...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); - /** * A textarea with xoopsish formatting and smilie buttons * @@ -34,35 +34,56 @@ * <p>If an extended HTML editor is set, the renderer will be replaced by the specified editor, usually a visual or WYSIWYG editor.</p> * * <ul>Developer and user guide: - * <li><ul>For run-time settings per call - * <li>To use an editor pre-configured by {@link XoopsEditor}, e.g. 'fckeditor': <code>$options['editor'] = 'fckeditor';</code></li> - * <li>To use a custom editor, e.g. 'MyEditor' class located in "/modules/myeditor/myeditor.php": <code>$options['editor'] = array('MyEditor', XOOPS_ROOT_PATH . "/modules/myeditor/myeditor.php");</code></li> - * </ul></li> - * <li><ul>For pre-configured settings, which will force to use a editor if no specific editor is set for call - * <li><ul>Set up custom configs: in XOOPS_VAR_PATH . '/configs/xoopsconfig.php' set a editor as default, e.g. - * <li>a pre-configured editor 'fckeditor': <code>return array('editor' => 'fckeditor');</code></li> - * <li>a custom editor 'MyEditor' class located in "/modules/myeditor/myeditor.php": <code>return array('editor' => array('MyEditor', XOOPS_ROOT_PATH . "/modules/myeditor/myeditor.php");</code></li> - * </ul></li> - * <li>To disable the default editor, in XOOPS_VAR_PATH . '/configs/xoopsconfig.php': <code>return array();</code></li> - * <li>To disable the default editor for a specific call: <code>$options['editor'] = 'dhtmltextarea';</code></li> - * </ul></li> + * <li> + * <ul>For run-time settings per call + * <li>To use an editor pre-configured by {@link XoopsEditor}, e.g. 'fckeditor': <code>$options['editor'] = 'fckeditor';</code></li> + * <li>To use a custom editor, e.g. 'MyEditor' class located in "/modules/myeditor/myeditor.php": <code>$options['editor'] = array('MyEditor', XOOPS_ROOT_PATH . "/modules/myeditor/myeditor.php");</code></li> + * </ul> + * </li> + * <li> + * <ul>For pre-configured settings, which will force to use a editor if no specific editor is set for call + * <li> + * <ul>Set up custom configs: in XOOPS_VAR_PATH . '/configs/xoopsconfig.php' set a editor as default, e.g. + * <li>a pre-configured editor 'fckeditor': <code>return array('editor' => 'fckeditor');</code></li> + * <li>a custom editor 'MyEditor' class located in "/modules/myeditor/myeditor.php": <code>return array('editor' => array('MyEditor', XOOPS_ROOT_PATH . "/modules/myeditor/myeditor.php");</code></li> + * </ul> + * </li> + * <li>To disable the default editor, in XOOPS_VAR_PATH . '/configs/xoopsconfig.php': <code>return array();</code></li> + * <li>To disable the default editor for a specific call: <code>$options['editor'] = 'dhtmltextarea';</code></li> + * </ul> + * </li> * </ul> */ - var $htmlEditor = array(); + public $htmlEditor = array(); /** * Hidden text * * @var string - * @access private */ - var $_hiddenText; + private $_hiddenText; - var $skipPreview = false; - var $doHtml = false; - var $js = ''; + /** + * @var bool + */ + public $skipPreview = false; /** + * @var bool + */ + public $doHtml = false; + + /** + * @var string + */ + public $js = ''; + + /** + * @var array + */ + public $configs = array(); + + /** * Constructor * * @param string $caption Caption @@ -73,32 +94,33 @@ * @param string $hiddentext Identifier for hidden Text * @param array $options Extra options */ - function XoopsFormDhtmlTextArea($caption, $name, $value = "", $rows = 5, $cols = 50, $hiddentext = "xoopsHiddenText", $options = array()) + public function __construct($caption, $name, $value = "", $rows = 5, $cols = 50, $hiddentext = "xoopsHiddenText", $options = + array()) { - global $xoopsConfig; static $inLoop = 0; - $inLoop ++; + $inLoop++; // Second loop, invalid, return directly if ($inLoop > 2) { return; } // Else, initialize - $this->XoopsFormTextArea($caption, $name, $value, $rows, $cols); + parent::__construct($caption, $name, $value, $rows, $cols); $this->_hiddenText = $hiddentext; if ($inLoop > 1) { return; } if (!isset($options['editor'])) { - if (isset($xoopsConfig['editor'])) - $options['editor'] = $xoopsConfig['editor']; + if (isset($GLOBALS['SxoopsConfig']['editor'])) { + $options['editor'] = $GLOBALS['SxoopsConfig']['editor']; + } } - if (! empty($this->htmlEditor) || ! empty($options['editor'])) { + if (!empty($this->htmlEditor) || !empty($options['editor'])) { $options['name'] = $this->getName(); $options['value'] = $this->getValue(); - if (! empty($options['editor'])) { + if (!empty($options['editor'])) { $this->htmlEditor = is_array($options['editor']) ? $options['editor'] : array($options['editor']); } @@ -128,10 +150,10 @@ * * @return string HTML */ - function render() + public function render() { if ($this->htmlEditor && is_object($this->htmlEditor)) { - if (! isset($this->htmlEditor->isEnabled) || $this->htmlEditor->isEnabled) { + if (!isset($this->htmlEditor->isEnabled) || $this->htmlEditor->isEnabled) { return $this->htmlEditor->render(); } } @@ -147,21 +169,23 @@ $ret .= "<input type='button' onclick=\"XoopsCheckLength('" . $this->getName() . "', '" . @$this->configs['maxlength'] . "', '" . _XOOPS_FORM_ALT_LENGTH . "', '" . _XOOPS_FORM_ALT_LENGTH_MAX . "');\" value=' ? ' title='" . _XOOPS_FORM_ALT_CHECKLENGTH . "' />"; $ret .= "<br />\n"; // the textarea box - $ret .= "<textarea id='" . $this->getName() . "' name='" . $this->getName() . "' title='". $this->getTitle() . "' onselect=\"xoopsSavePosition('" . $this->getName() . "');\" onclick=\"xoopsSavePosition('" . $this->getName() . "');\" onkeyup=\"xoopsSavePosition('" . $this->getName() . "');\" cols='" . $this->getCols() . "' rows='" . $this->getRows() . "'" . $this->getExtra() . ">" . $this->getValue() . "</textarea><br />\n"; + $ret .= "<textarea id='" . $this->getName() . "' name='" . $this->getName() . "' title='" . $this->getTitle() . "' onselect=\"xoopsSavePosition('" . $this->getName() . "');\" onclick=\"xoopsSavePosition('" . $this->getName() . "');\" onkeyup=\"xoopsSavePosition('" . $this->getName() . "');\" cols='" . $this->getCols() . "' rows='" . $this->getRows() . "'" . $this->getExtra() . ">" . $this->getValue() . "</textarea><br />\n"; if (empty($this->skipPreview)) { if (empty($GLOBALS['xoTheme'])) { $this->js .= implode("", file(XOOPS_ROOT_PATH . "/class/textsanitizer/image/image.js")); } else { - $GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', array('type' => 'text/javascript')); + $GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', + array('type' => 'text/javascript')); } - $button = // "<br />" . -"<input " . " id='" . $this->getName() . "_preview_button'" . " type='button' " . " value='" . _PREVIEW . "' " . " onclick=\"form_instantPreview('" . XOOPS_URL . "', '" . $this->getName() . "','" . XOOPS_URL . "/images', " . intval($this->doHtml) . ", '" . $GLOBALS['xoopsSecurity']->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>"; + $button = "<input id='" . $this->getName() . "_preview_button' " . "type='button' " . "value='" . _PREVIEW . "' " . "onclick=\"form_instantPreview('" . XOOPS_URL . "', '" . $this->getName() . "','" . XOOPS_URL . "/images', " . intval($this->doHtml) . ", '" . $GLOBALS['xoopsSecurity']->createToken() . "')\"" . " />"; + $ret .= "<br />" . "<div id='" . $this->getName() . "_hidden' style='display: block;'> " . "<fieldset>"... [truncated message content] |
From: <tr...@us...> - 2011-10-22 22:52:27
|
Revision: 7925 http://xoops.svn.sourceforge.net/xoops/?rev=7925&view=rev Author: trabis Date: 2011-10-22 22:52:19 +0000 (Sat, 22 Oct 2011) Log Message: ----------- more updating Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/mail/xoopsmultimailer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoops_link.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/censor.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/textsanitizer/textfilter/textfilter.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.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/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.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/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/modules/system/admin/modulesadmin/modulesadmin.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -41,6 +41,7 @@ */ static function getAuthConnection($uname) { + $xoops = Xoops::getInstance(); static $auth_instance; if (!isset($auth_instance)) { /* @var $config_handler XoopsConfigHandler */ @@ -56,7 +57,7 @@ $xoops_auth_method = 'xoops'; } - $ret = include_once $GLOBALS['xoops']->path('class/auth/auth_' . $xoops_auth_method . '.php'); + $ret = include_once $xoops->path('class/auth/auth_' . $xoops_auth_method . '.php'); if ($ret == false) { return false; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -119,6 +119,8 @@ */ public function isActive() { + $xoops = Xoops::getInstance(); + if (isset($this->active)) { return $this->active; } @@ -126,7 +128,7 @@ $this->active = false; return $this->active; } - if (!empty($this->config['skipmember']) && is_object($GLOBALS['xoopsUser'])) { + if (!empty($this->config['skipmember']) && $xoops->isUser()) { $this->active = false; return $this->active; } @@ -214,6 +216,7 @@ */ public function verify($skipMember = null, $name = null) { + $xoops = Xoops::getInstance(); $sessionName = empty($name) ? $this->name : $name; $skipMember = ($skipMember === null) ? $_SESSION["{$sessionName}_skipmember"] : $skipMember; $maxAttempts = $_SESSION["{$sessionName}_maxattempts"]; @@ -224,7 +227,7 @@ $is_valid = true; // Skip CAPTCHA for member if set } else { - if (is_object($GLOBALS['xoopsUser']) && !empty($skipMember)) { + if ($xoops->isUser() && !empty($skipMember)) { $is_valid = true; // Kill too many attempts } else { 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-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/mail/xoopsmultimailer.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -40,17 +40,15 @@ * 'from' address * * @var string - * @access private */ - private $From = ''; + public $From = ''; /** * 'from' name * * @var string - * @access private */ - private $FromName = ''; + public $FromName = ''; // can be 'smtp', 'sendmail', or 'mail' /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoops_link.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoops_link.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoops_link.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -50,6 +50,7 @@ function smarty_function_xoops_link($params, &$smarty) { + $xoops = Xoops::getInstance(); $urlstr = ''; if (isset($params['urlvars'])) { $szvars = explode('&', $params['urlvars']); @@ -78,10 +79,9 @@ // Get default module/page from current ones if necessary $module = ''; - $page = ''; if (!isset($params['module'])) { - if (isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule'])) { - $module = $GLOBALS['xoopsModule']->getVar('dirname'); + if ($xoops->isModule()) { + $module = $xoops->module->getVar('dirname'); } } else { $module = $params['module']; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/censor.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/censor.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/censor.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -37,6 +37,8 @@ public function load(MyTextSanitizer &$ts, $text) { static $censorConf; + $xoops = Xoops::getInstance(); + if (!isset($censorConf)) { /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); @@ -54,7 +56,7 @@ return $text; } - if (empty($censorConf['censor_admin']) && $GLOBALS['xoopsUserIsAdmin']) { + if (empty($censorConf['censor_admin']) && $xoops->userIsAdmin) { return $text; } 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 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/image.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -32,6 +32,7 @@ { static $jsLoaded; + $xoops = Xoops::getInstance(); $config = $this->loadConfig(dirname(__FILE__)); $ts->patterns[] = "/\[img align=(['\"]?)(left|center|right)\\1 width=(['\"]?)([0-9]*)\\3]([^\"\(\)\?\&'<>]*)\[\/img\]/sU"; $ts->patterns[] = "/\[img align=(['\"]?)(left|center|right)\\1]([^\"\(\)\?\&'<>]*)\[\/img\]/sU"; @@ -51,10 +52,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($GLOBALS['xoTheme'])) { + if (!empty($config['resize']) && empty($config['clickable']) && !empty($config['max_width']) && !empty($xoops->theme)) { if (!$jsLoaded) { $jsLoaded = true; - $GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', array( + $xoops->theme->addScript('/class/textsanitizer/image/image.js', array( 'type' => 'text/javascript' )); } @@ -66,10 +67,10 @@ ? " onload=\"javascript:imageResize(this, " . $config['max_width'] . ")\"" : "") . "/>"; } else { - if (!empty($config['clickable']) && !empty($config['max_width']) && !empty($GLOBALS['xoTheme'])) { + if (!empty($config['clickable']) && !empty($config['max_width']) && !empty($xoops->theme)) { if (!$jsLoaded) { $jsLoaded = true; - $GLOBALS['xoTheme']->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/textsanitizer/textfilter/textfilter.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/textfilter/textfilter.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/textfilter/textfilter.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -30,7 +30,8 @@ */ public function load(MyTextSanitizer &$ts, $text, $force = false) { - if (empty($force) && $GLOBALS['xoopsUserIsAdmin']) { + $xoops = Xoops::getInstance(); + if (empty($force) && $xoops->userIsAdmin) { return $text; } // Built-in fitlers for XSS scripts Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -80,6 +80,7 @@ */ static function validate() { + $xoops = Xoops::getInstance(); $args = func_get_args(); $args_num = func_num_args(); @@ -117,7 +118,6 @@ xoops_loadLanguage('user'); - $xoopsUser_isAdmin = is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->isAdmin(); $stop = ''; // Invalid email address if (!checkEmail($email)) { @@ -127,7 +127,7 @@ $stop .= _US_EMAILNOSPACES . '<br />'; } // Check forbidden email address if current operator is not an administrator - if (!$xoopsUser_isAdmin) { + if (!$xoops->userIsAdmin) { foreach ($GLOBALS['xoopsConfigUser']['bad_emails'] as $be) { if (!empty($be) && preg_match('/' . $be . '/i', $email)) { $stop .= _US_INVALIDMAIL . '<br />'; @@ -155,7 +155,7 @@ $stop .= _US_INVALIDNICKNAME . '<br />'; } // Check uname settings if current operator is not an administrator - if (!$xoopsUser_isAdmin) { + if (!$xoops->userIsAdmin) { if (strlen($uname) > $GLOBALS['xoopsConfigUser']['maxuname']) { $stop .= sprintf(_US_NICKNAMETOOLONG, $GLOBALS['xoopsConfigUser']['maxuname']) . '<br />'; } 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 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcolorpicker.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -38,8 +38,9 @@ */ public function render() { - if (isset($GLOBALS['xoTheme'])) { - $GLOBALS['xoTheme']->addScript('include/color-picker.js'); + $xoops = Xoops::getInstance(); + if (isset($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 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdhtmltextarea.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -94,8 +94,7 @@ * @param string $hiddentext Identifier for hidden Text * @param array $options Extra options */ - public function __construct($caption, $name, $value = "", $rows = 5, $cols = 50, $hiddentext = "xoopsHiddenText", $options = - array()) + public function __construct($caption, $name, $value = "", $rows = 5, $cols = 50, $hiddentext = "xoopsHiddenText", $options = array()) { static $inLoop = 0; @@ -104,6 +103,7 @@ if ($inLoop > 2) { return; } + // Else, initialize parent::__construct($caption, $name, $value, $rows, $cols); $this->_hiddenText = $hiddentext; @@ -111,9 +111,11 @@ if ($inLoop > 1) { return; } + + $xoops = Xoops::getInstance(); if (!isset($options['editor'])) { - if (isset($GLOBALS['SxoopsConfig']['editor'])) { - $options['editor'] = $GLOBALS['SxoopsConfig']['editor']; + if (isset($xoops->config['editor'])) { + $options['editor'] = $xoops->config['editor']; } } @@ -159,6 +161,8 @@ } static $js_loaded; + $xoops = Xoops::getInstance(); + xoops_loadLanguage('formdhtmltextarea'); $ret = ""; // actions @@ -172,13 +176,13 @@ $ret .= "<textarea id='" . $this->getName() . "' name='" . $this->getName() . "' title='" . $this->getTitle() . "' onselect=\"xoopsSavePosition('" . $this->getName() . "');\" onclick=\"xoopsSavePosition('" . $this->getName() . "');\" onkeyup=\"xoopsSavePosition('" . $this->getName() . "');\" cols='" . $this->getCols() . "' rows='" . $this->getRows() . "'" . $this->getExtra() . ">" . $this->getValue() . "</textarea><br />\n"; if (empty($this->skipPreview)) { - if (empty($GLOBALS['xoTheme'])) { + if (empty($xoops->theme)) { $this->js .= implode("", file(XOOPS_ROOT_PATH . "/class/textsanitizer/image/image.js")); } else { - $GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', + $xoops->theme->addScript('/class/textsanitizer/image/image.js', array('type' => 'text/javascript')); } - $button = "<input id='" . $this->getName() . "_preview_button' " . "type='button' " . "value='" . _PREVIEW . "' " . "onclick=\"form_instantPreview('" . XOOPS_URL . "', '" . $this->getName() . "','" . XOOPS_URL . "/images', " . intval($this->doHtml) . ", '" . $GLOBALS['xoopsSecurity']->createToken() . "')\"" . " />"; + $button = "<input id='" . $this->getName() . "_preview_button' " . "type='button' " . "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 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhiddentoken.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -33,7 +33,8 @@ */ public function __construct($name = 'XOOPS_TOKEN', $timeout = 0) { - parent::__construct($name . '_REQUEST', $GLOBALS['xoopsSecurity']->createToken($timeout, $name)); + $xoops = Xoops::getInstance(); + parent::__construct($name . '_REQUEST', $xoops->security->createToken($timeout, $name)); } } 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 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectuser.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -95,7 +95,7 @@ return true; } </script>"; - $token = $GLOBALS['xoopsSecurity']->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/xoopsload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -308,14 +308,15 @@ */ static function loadConfig($data = null) { + $xoops = Xoops::getInstance(); $configs = array(); if (is_array($data)) { $configs = $data; } else { if (!empty($data)) { $dirname = $data; - } elseif (is_object($GLOBALS['xoopsModule'])) { - $dirname = $GLOBALS['xoopsModule']->getVar('dirname', 'n'); + } elseif ($xoops->isModule()) { + $dirname = $xoops->module->getVar('dirname', 'n'); } else { return false; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -213,8 +213,9 @@ */ public function setTemplateDir($value = null) { - if ($value === null && is_object($GLOBALS['xoopsModule'])) { - $value = $GLOBALS['xoopsModule']->getVar('dirname', 'n'); + $xoops = Xoops::getInstance(); + if ($value === null && $xoops->isModule()) { + $value = $xoops->module->getVar('dirname', 'n'); } else { $value = str_replace(DIRECTORY_SEPARATOR, "/", $value); } @@ -440,12 +441,13 @@ */ private function sendPM($uid, $subject, $body) { + $xoops = Xoops::getInstance(); $pm_handler = xoops_gethandler('privmessage'); $pm = $pm_handler->create(); $pm->setVar("subject", $subject); // RMV-NOTIFY $pm->setVar('from_userid', !empty($this->fromUser) ? $this->fromUser->getVar('uid') - : (empty($GLOBALS['xoopsUser']) ? 1 : $GLOBALS['xoopsUser']->getVar('uid'))); + : (!$xoops->isUser() ? 1 : $xoops->user->getVar('uid'))); $pm->setVar("msg_text", $body); $pm->setVar("to_userid", $uid); if (!$pm_handler->insert($pm)) { 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-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -173,7 +173,7 @@ foreach (array( 'GLOBALS', '_SESSION', 'HTTP_SESSION_VARS', '_GET', 'HTTP_GET_VARS', '_POST', 'HTTP_POST_VARS', '_COOKIE', 'HTTP_COOKIE_VARS', '_REQUEST', '_SERVER', 'HTTP_SERVER_VARS', '_ENV', 'HTTP_ENV_VARS', '_FILES', - 'HTTP_POST_FILES', 'xoopsDB', 'xoopsUser', 'xoopsUserId', 'xoopsUserGroups', 'xoopsUserIsAdmin', + 'HTTP_POST_FILES', 'xoops', 'xoopsDB', 'xoopsUser', 'xoopsUserId', 'xoopsUserGroups', 'xoopsUserIsAdmin', 'xoopsConfig', 'xoopsOption', 'xoopsModule', 'xoopsModuleConfig', 'xoopsRequestUri' ) as $bad_global) { if (isset($_REQUEST[$bad_global])) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -105,7 +105,7 @@ * Requires XoopsLogger, XOOPS_DB_PROXY; */ $xoops->db = XoopsDatabaseFactory::getDatabaseConnection(); -$xoopsDb = $xoops->db; +$xoopsDB = $xoops->db; /** * Get xoops configs 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-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -327,13 +327,14 @@ */ public function getOptions() { + $xoops = Xoops::getInstance(); if (!$this->isCustom()) { $edit_func = (string)$this->getVar('edit_func'); if (!$edit_func) { return false; } if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'))) { - if (file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/blocks.php')) { + if (file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/language/' . $xoops->config['language'] . '/blocks.php')) { include_once $file; } else { if (file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/language/english/blocks.php')) { @@ -370,7 +371,7 @@ */ public function buildBlock() { - global $xoopsConfig, $xoopsOption, $xoTheme; + $xoops = Xoops::getInstance(); $block = array(); if (!$this->isCustom()) { // get block display function @@ -378,7 +379,7 @@ if (!$show_func) { return false; } - if (!file_exists($func_file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file')))) { + if (!file_exists($func_file = $xoops->path('modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file')))) { return false; } // must get lang files b4 including the file @@ -413,6 +414,7 @@ */ public function getForm($mode = 'edit') { + $xoops = Xoops::getInstance(); xoops_loadLanguage('blocks', 'system'); if ($this->isNew()) { $title = _AM_SYSTEM_BLOCKS_ADDBLOCK; @@ -503,7 +505,7 @@ if ($this->getVar('template') != '') { /* @var $tplfile_handler XoopsTplfileHandler */ $tplfile_handler = xoops_gethandler('tplfile'); - $btemplate = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $this->getVar('bid')); + $btemplate = $tplfile_handler->find($xoops->config['template_set'], 'block', $this->getVar('bid')); if (count($btemplate) > 0) { $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate[0]->getVar('tpl_id') . '">' . _AM_SYSTEM_BLOCKS_EDITTPL . '</a>')); } else { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/config.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -18,9 +18,6 @@ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once $GLOBALS['xoops']->path('kernel/configoption.php'); -require_once $GLOBALS['xoops']->path('kernel/configitem.php'); - /** * XOOPS configuration handling class. * This class acts as an interface for handling general configurations of XOOPS @@ -65,8 +62,8 @@ */ public function __construct($db) { - $this->_cHandler = new XoopsConfigItemHandler($db); - $this->_oHandler = new XoopsConfigOptionHandler($db); + $this->_cHandler = xoops_getHandler('configitem'); + $this->_oHandler = xoops_getHandler('configoption'); } /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -221,15 +221,15 @@ */ public function loadInfo($dirname, $verbose = true) { + $xoops = xoops::getInstance(); $dirname = basename($dirname); - global $xoopsConfig; - if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/language/' . $xoopsConfig['language'] . '/modinfo.php'))) { + if (file_exists($file = $xoops->path('modules/' . $dirname . '/language/' . $xoops->config['language'] . '/modinfo.php'))) { include_once $file; - } else if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/language/english/modinfo.php'))) { + } else if (file_exists($file = $xoops->path('modules/' . $dirname . '/language/english/modinfo.php'))) { include_once $file; } - if (!file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/xoops_version.php'))) { + if (!file_exists($file = $xoops->path('modules/' . $dirname . '/xoops_version.php'))) { if (false != $verbose) { echo "Module File for $dirname Not Found!"; } @@ -252,6 +252,7 @@ */ public function search($term = '', $andor = 'AND', $limit = 0, $offset = 0, $userid = 0) { + $xoops = xoops::getInstance(); if ($this->getVar('hassearch') != 1) { return false; } @@ -259,7 +260,7 @@ if ($this->getVar('hassearch') != 1 || ! isset($search['file']) || ! isset($search['func']) || $search['func'] == '' || $search['file'] == '') { return false; } - if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/' . $search['file']))) { + if (file_exists($file = $xoops->path('modules/' . $this->getVar('dirname') . '/' . $search['file']))) { include_once $file; } else { return false; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -21,8 +21,9 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); // RMV-NOTIFY -include_once $GLOBALS['xoops']->path('include/notification_constants.php'); -include_once $GLOBALS['xoops']->path('include/notification_functions.php'); +$xoops = xoops::getInstance(); +include_once $xoops->path('include/notification_constants.php'); +include_once $xoops->path('include/notification_functions.php'); /** * A Notification @@ -141,6 +142,8 @@ **/ public function notifyUser($template_dir, $template, $subject, $tags) { + $xoops = xoops::getInstance(); + /** * @var $member_handler XoopsMemberHandler * @var $config_handler XoopsConfigHandler @@ -155,7 +158,7 @@ $method = $user->getVar('notify_method'); $xoopsMailer = xoops_getMailer(); - include_once $GLOBALS['xoops']->path('include/notification_constants.php'); + include_once $xoops->path('include/notification_constants.php'); switch ($method) { case XOOPS_NOTIFICATION_METHOD_PM: $xoopsMailer->usePM(); @@ -189,7 +192,7 @@ // If send-once-then-delete, delete notification // If send-once-then-wait, disable notification - include_once $GLOBALS['xoops']->path('include/notification_constants.php'); + include_once $xoops->path('include/notification_constants.php'); $notification_handler = xoops_gethandler('notification'); if ($this->getVar('not_mode') == XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE) { @@ -488,14 +491,14 @@ */ public function triggerEvent($category, $item_id, $event, $extra_tags = array(), $user_list = array(), $module_id = null, $omit_user_id = null) { + $xoops = xoops::getInstance(); /** * @var $config_handler XoopsConfigHandler */ if (!isset($module_id)) { - global $xoopsModule; - $module = $xoopsModule; - $module_id = !empty($xoopsModule) ? $xoopsModule->getVar('mid') : 0; + $module = $xoops->module; + $module_id = $xoops->isModule() ? $xoops->module->getVar('mid') : 0; } else { $module_handler = xoops_gethandler('module'); $module = $module_handler->get($module_id); @@ -514,9 +517,8 @@ } if (!isset($omit_user_id)) { - global $xoopsUser; - if (!empty($xoopsUser)) { - $omit_user_id = $xoopsUser->getVar('uid'); + if (!$xoops->isUser()) { + $omit_user_id = $xoops->user->getVar('uid'); } else { $omit_user_id = 0; } @@ -549,7 +551,7 @@ $tags = array(); if (!empty($not_config)) { if (!empty($not_config['tags_file'])) { - $tags_file = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname') . '/' . $not_config['tags_file']); + $tags_file = $xoops->path('modules/' . $module->getVar('dirname') . '/' . $not_config['tags_file']); if (file_exists($tags_file)) { include_once $tags_file; if (!empty($not_config['tags_func'])) { @@ -562,7 +564,7 @@ } // RMV-NEW if (!empty($not_config['lookup_file'])) { - $lookup_file = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname') . '/' . $not_config['lookup_file']); + $lookup_file = $xoops->path('modules/' . $module->getVar('dirname') . '/' . $not_config['lookup_file']); if (file_exists($lookup_file)) { include_once $lookup_file; if (!empty($not_config['lookup_func'])) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/user.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -121,6 +121,7 @@ */ public function getUnameFromId($userid, $usereal = 0) { + $xoops = xoops::getInstance(); $userid = intval($userid); $usereal = intval($usereal); if ($userid > 0) { @@ -141,7 +142,7 @@ } } } - return $GLOBALS['xoopsConfig']['anonymous']; + return $xoops->config['anonymous']; } /** @@ -208,8 +209,9 @@ */ public function isAdmin($module_id = null) { + $xoops = xoops::getInstance(); if (is_null($module_id)) { - $module_id = isset($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('mid', 'n') : 1; + $module_id = $xoops->isModule() ? $xoops->module->getVar('mid', 'n') : 1; } elseif (intval($module_id) < 1) { $module_id = 0; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-22 21:59:11 UTC (rev 7924) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-22 22:52:19 UTC (rev 7925) @@ -38,7 +38,7 @@ function xoops_module_install($dirname) { - global $xoopsUser, $xoopsConfig; + global $xoopsUser, $xoopsConfig, $xoopsDB; $dirname = trim($dirname); $db = $GLOBALS["xoopsDB"]; $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish'); @@ -354,6 +354,8 @@ $groups = array(XOOPS_GROUP_ADMIN); } // retrieve all block ids for this module + /* @var $block_handler XoopsBlockHandler */ + $block_handler = xoops_getHandler('block'); $blocks = $block_handler->getByModule($newmid, false); $msgs[] = _AM_SYSTEM_MODULES_GROUP_SETTINGS_ADD; $gperm_handler = xoops_gethandler('groupperm'); @@ -475,7 +477,7 @@ { global $xoopsConfig; $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish'); - $db = Database::getInstance(); + $db = XoopsDatabaseFactory::getDatabaseConnection(); $module_handler = xoops_gethandler('module'); $module = $module_handler->getByDirname($dirname); include_once XOOPS_ROOT_PATH . '/class/template.php'; @@ -536,6 +538,8 @@ unset($templates); // delete blocks and block tempalte files + /* @var $block_handler XoopsBlockHandler */ + $block_handler = xoops_getHandler('block'); $block_arr = $block_handler->getByModule($module->getVar('mid')); if (is_array($block_arr)) { $bcount = count($block_arr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-24 23:45:43
|
Revision: 7956 http://xoops.svn.sourceforge.net/xoops/?rev=7956&view=rev Author: trabis Date: 2011-10-24 23:45:36 +0000 (Mon, 24 Oct 2011) Log Message: ----------- More refactoring.. Modified Paths: -------------- 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/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/imagemanager.php XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.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 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-24 22:28:21 UTC (rev 7955) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2011-10-24 23:45:36 UTC (rev 7956) @@ -53,16 +53,17 @@ $tpl->assign('image_height', $height); if (file_exists($fileinc = $xoops->path('modules/news/class/class.newsstory.php'))) { include $fileinc; - $sarray =NewsStory::getAllPublished(10, 0, true); + $sarray = NewsStory::getAllPublished(10, 0, true); } if (!empty($sarray) && is_array($sarray)) { foreach ($sarray as $story) { $tpl->append('items', array( - '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') , - 'description' => XoopsLocal::convert_encoding(htmlspecialchars($story->hometext(), ENT_QUOTES)))); + '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'), + '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-24 22:28:21 UTC (rev 7955) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/banners.php 2011-10-24 23:45:36 UTC (rev 7956) @@ -11,6 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package core * @since 2.0.0 * @author Kazumi Ono <web...@my...> * @author Taiwen Jiang <ph...@us...> @@ -23,79 +24,83 @@ xoops_loadLanguage('banners'); -/********************************************/ -/* Function to let your client login to see */ -/* the stats */ -/********************************************/ + +/** + * Function to let your client login to see the stats + * + * @return void + */ function clientlogin() { $xoops = Xoops::getInstance(); - include $xoops->path('header.php'); + $xoops->header(); $xoops->theme->addStylesheet(null, null, ' #login_window { - max-width: 480px; - margin: 1em auto; - background-color: #f8f8f8; - color: inherit; - border: 1px solid #000; + max-width: 480px; + margin: 1em auto; + background-color: #f8f8f8; + color: inherit; + border: 1px solid #000; } - #login_window h2 { - margin: .5em; - padding: 130px 0 0; - background: url( images/password.png) no-repeat center top; - text-align: center; + + #login_window h2 { + margin: .5em; + padding: 130px 0 0; + background: url(images/password.png) no-repeat center top; + text-align: center; } - .login_form .credentials { - margin: .5em 1em; - padding: 1em; - background-color: #ccc; - color: inherit; + .login_form.credentials { + margin: .5em 1em; + padding: 1em; + background-color: #ccc; + color: inherit; } - .login_form .credentials label { - display: inline-block; - width: 33%; - margin: 1px; + .login_form.credentials label { + display: inline-block; + width: 33 %; + margin: 1px; } - .login_form .credentials input { - width: 50%; - margin: 1px; - padding: 1px; - border: 1px solid #000; + .login_form . credentials input { + width:50%; + margin: 1px; + padding: 1px; + border: 1px solid #000; } - .login_form .credentials input:focus { - border: 1px solid #2266cc; + .login_form.credentials input:focus { + border: 1px solid #2266cc; } - .login_form .actions { - padding: 1.5em .5em .5em; - text-align: center; + .login_form.actions { + padding: 1.5em .5em .5em; + text-align: center; } .login_info { - margin: .5em 1em; - text-align: center; + margin: .5em 1em; + text-align: center; } .content_title { - font-size: 1.2em; + font-size: 1.2em; } '); echo "<div id='login_window'> <h2 class='content_title'>" . _BANNERS_LOGIN_TITLE . "</h2> - <form method='post' action='banners.php' class='login_form'> + <form method='post' action='banners . php' class='login_form'> <div class='credentials'> - <label for='login_form-login'>" . _BANNERS_LOGIN_LOGIN . "</label> - <input type='text' name='login' id='login_form-login' value='' /><br /> - <label for='login_form-password'>" . _BANNERS_LOGIN_PASS . "</label> - <input type='password' name='pass' id='login_form-password' value='' /><br /> + <label for='login_form - login'>" . _BANNERS_LOGIN_LOGIN . "</label> + <input type='text' name='login' id='login_form - login' value='' /><br /> + <label for='login_form - password'>" . _BANNERS_LOGIN_PASS . "</label> + <input type='password' name='pass' id='login_form - password' value='' /><br /> </div> <div class='actions'><input type='hidden' name='op' value='Ok' /><button type='submit'>" . _BANNERS_LOGIN_OK . "</button></div> <div class='login_info'>" . _BANNERS_LOGIN_INFO . "</div>" . $xoops->security->getTokenHTML("BANNER_LOGIN") . " </form></div>"; - include $xoops->path('footer.php'); + $xoops->footer(); } -/*********************************************/ -/* Function to display the banners stats for */ -/* each client */ -/*********************************************/ +/** + * Function to display the banners stats for each client + * + * @return void + */ function bannerstats() { $xoops = Xoops::getInstance(); @@ -106,12 +111,10 @@ $result = $xoops->db->query(sprintf("SELECT cid, name, passwd FROM %s WHERE login=%s", $xoops->db->prefix("bannerclient"), $xoops->db->quoteString($_SESSION['banner_login']))); list ($cid, $name, $passwd) = $xoops->db->fetchRow($result); if ($_SESSION['banner_pass'] == $passwd) { - include $xoops->path('header.php'); - $xoops->theme->addStylesheet(null, null, ' + $xoops->header(); + $xoops->theme->addStylesheet(null, null,' #bannerstats {} - #bannerstats td { - text-align: center; - } + #bannerstats td {text-align: center;} '); echo "<div id='bannerstats'> @@ -149,7 +152,7 @@ <td>{$left}</td> <td>{$clicks}</td> <td>{$percent}%</td> - <td><a href='banners.php?op=EmailStats&cid={$cid}&bid={$bid}' title='" . _BANNERS_STATS . "'>" . _BANNERS_STATS . "</a></td></tr></tbody>"; + <td><a href='banners . php ? op = EmailStats & amp;cid ={$cid}&bid ={$bid}' title='" . _BANNERS_STATS . "'>" . _BANNERS_STATS . "</a></td></tr></tbody>"; $i++; } echo "</table> @@ -163,10 +166,11 @@ echo "<br />"; } if (!empty($htmlbanner) && !empty($htmlcode)) { + $myts = MyTextSanitizer::getInstance(); echo $myts->displayTarea($htmlcode); } else { if (strtolower(substr($imageurl, strrpos($imageurl, "."))) == ".swf") { - echo "<object type='application/x-shockwave-flash' width='468' height='60' data='{$imageurl}'>"; + echo "<object type='application / x - shockwave - flash' width='468' height='60' data='{$imageurl}'>"; echo "<param name='movie' value='{$imageurl}' />"; echo "<param name='quality' value='high' />"; echo "</object>"; @@ -174,11 +178,11 @@ echo "<img src='{$imageurl}' alt='' />"; } } - echo "<br /><strong>" . _BANNERS_ID . $bid . "</strong><br />" . sprintf(_BANNERS_SEND_STATS, 'banners.php?op=EmailStats&cid=' . $cid . '&bid=' . $bid) . "<br />"; + echo "<br /><strong>" . _BANNERS_ID . $bid . "</strong><br />" . sprintf(_BANNERS_SEND_STATS, 'banners.php?op=EmailStats&cid = ' . $cid . '&bid=' . $bid) . "<br />"; if (!$htmlbanner) { $clickurl = htmlspecialchars($clickurl, ENT_QUOTES); echo sprintf(_BANNERS_POINTS, $clickurl) . "<br /> - <form action='banners.php' method='post'>" . _BANNERS_URL . " + <form action='banners . php' method='post'>" . _BANNERS_URL . " <input type='text' name='url' size='50' maxlength='200' value='{$clickurl}' /> <input type='hidden' name='bid' value='{$bid}' /> <input type='hidden' name='cid' value='{$cid}' /> @@ -219,17 +223,20 @@ } echo "</table></div>"; } - include $xoops->path('footer.php'); + $xoops->footer(); } else { redirect_header("banners.php", 2); exit(); } } -/*********************************************/ -/* Function to let the client E-mail his */ -/* banner Stats */ -/*********************************************/ +/** + * Function to let the client E-mail his banner Stats + * + * @param int $cid + * @param int $bid + * @return void + */ function EmailStats($cid, $bid) { $xoops = Xoops::getInstance(); @@ -278,10 +285,14 @@ exit(); } -/*********************************************/ -/* Function to let the client to change the */ -/* url for his banner */ -/*********************************************/ +/** + * Function to let the client to change the url for his banner + * + * @param int $cid + * @param int $bid + * @param string $url + * @return void + */ function change_banner_url_by_client($cid, $bid, $url) { $xoops = Xoops::getInstance(); @@ -304,6 +315,10 @@ exit(); } +/** + * @param int $bid + * @return void + */ function clickbanner($bid) { $xoops = Xoops::getInstance(); @@ -329,8 +344,10 @@ $op = ''; if (!empty($_POST['op'])) { $op = $_POST['op']; -} else if (!empty($_GET['op'])) { - $op = $_GET['op']; +} else { + if (!empty($_GET['op'])) { + $op = $_GET['op']; + } } $myts = MyTextSanitizer::getInstance(); @@ -356,7 +373,7 @@ break; case _BANNERS_CHANGE: if (!$xoops->security->check(true, false, "BANNER_EDIT")) { - redirect_header("banners.php", 3, implode('<br />', $xoops->security->getErrors())); + redirect_header("banners.php", 3, implode(' <br />', $xoops->security->getErrors())); exit(); } $bid = $cid = 0; 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-24 22:28:21 UTC (rev 7955) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-24 23:45:36 UTC (rev 7956) @@ -270,10 +270,15 @@ /** * @param string $tpl_file - * @return void + * @return bool */ public function header($tpl_file = '') { + static $included = false; + if ($included) { + return false; + } + $included = true; $this->tpl_file = $tpl_file; $this->preload->triggerEvent('core.header.start'); @@ -340,13 +345,18 @@ $this->logger->startTime('Module display'); $this->preload->triggerEvent('core.header.end'); + return true; } /** - * @return void + * @return bool */ public function footer() { + static $included = false; + if ($included) { + return false; + } $this->preload->triggerEvent('core.footer.start'); $this->logger->stopTime('Module display'); @@ -373,6 +383,7 @@ $xoops->logger->stopTime(); $xoops->preload->triggerEvent('core.footer.end'); + 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-24 22:28:21 UTC (rev 7955) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php 2011-10-24 23:45:36 UTC (rev 7956) @@ -11,7 +11,7 @@ * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel + * @package core * @since 2.0.0 * @version $Id$ */ @@ -19,8 +19,8 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoopsPreload = XoopsPreload::getInstance(); -$xoopsPreload->triggerEvent('core.edituser.start'); +$xoops->preload = XoopsPreload::getInstance(); +$xoops->preload->triggerEvent('core.edituser.start'); xoops_loadLanguage('user'); @@ -83,7 +83,7 @@ } } if (count($errors) > 0) { - include $xoops->path('header.php'); + $xoops->header(); echo '<div>'; foreach ($errors as $er) { echo '<span class="red bold">' . $er . '</span><br />'; @@ -127,9 +127,9 @@ setcookie($xoops->config['usercookie']); } if (! $member_handler->insertUser($edituser)) { - include $xoops->path('header.php'); + $xoops->header(); echo $edituser->getHtmlErrors(); - include $xoops->path('footer.php'); + $xoops->footer(); } else { redirect_header('userinfo.php?uid=' . $uid, 1, _US_PROFUPDATED); } @@ -138,7 +138,7 @@ } if ($op == 'editprofile') { - include_once $xoops->path('header.php'); + $xoops->header(); include_once $xoops->path('include/comment_constants.php'); echo '<a href="userinfo.php?uid=' . $xoops->user->getVar('uid') . '" title="">' . _US_PROFILE . '</a> <span class="bold">»»</span> ' . _US_EDITPROFILE . '<br /><br />'; $form = new XoopsThemeForm(_US_EDITPROFILE, 'userinfo', 'edituser.php', 'post', true); @@ -187,7 +187,7 @@ XOOPS_COMMENT_NEW1ST => _NEWESTFIRST)); // RMV-NOTIFY // TODO: add this to admin user-edit functions... - include_once $xoops->path('language/' . $xoops->config['language'] . '/notification.php'); + 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( @@ -231,17 +231,17 @@ $form->addElement($mailok_radio); $form->addElement($uid_hidden); $form->addElement($op_hidden); - $form->addElement($token_hidden); + //$form->addElement($token_hidden); $form->addElement($submit_button); if ($xoopsConfigUser['allow_chgmail'] == 1) { $form->setRequired($email_text); } $form->display(); - include $xoops->path('footer.php'); + $xoops->footer(); } if ($op == 'avatarform') { - include $xoops->path('header.php'); + $xoops->header(); echo '<a href="userinfo.php?uid=' . $xoops->user->getVar('uid') . '">' . _US_PROFILE . '</a> <span class="bold">»»</span> ' . _US_UPLOADMYAVATAR . '<br /><br />'; $oldavatar = $xoops->user->getVar('user_avatar'); if (!empty($oldavatar) && $oldavatar != 'blank.gif') { @@ -276,7 +276,7 @@ $form2->addElement(new XoopsFormHidden('op', 'avatarchoose')); $form2->addElement(new XoopsFormButton('', 'submit2', _SUBMIT, 'submit')); $form2->display(); - include $xoops->path('footer.php'); + $xoops->footer(); } if ($op == 'avatarupload') { @@ -370,9 +370,9 @@ $xoops->user->setVar('user_avatar', $user_avatar); $member_handler = xoops_gethandler('member'); if (!$member_handler->insertUser($xoops->user)) { - include $xoops->path('header.php'); + $xoops->header(); echo $xoops->user->getHtmlErrors(); - include $xoops->path('footer.php'); + $xoops->footer(); exit(); } if ($oldavatar && preg_match("/^cavt/", strtolower(substr($oldavatar,8)))) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/imagemanager.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/imagemanager.php 2011-10-24 22:28:21 UTC (rev 7955) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/imagemanager.php 2011-10-24 23:45:36 UTC (rev 7956) @@ -192,7 +192,7 @@ $error = true; } else { $imgcatperm_handler = xoops_gethandler('groupperm'); - if (is_object($xoopsUser)) { + if ($xoops->isUser()) { if (!$imgcatperm_handler->checkRight('imgcat_write', $imgcat_id, $xoops->user->getGroups())) { $error = true; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.php 2011-10-24 22:28:21 UTC (rev 7955) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.php 2011-10-24 23:45:36 UTC (rev 7956) @@ -64,9 +64,9 @@ // Next step: add the new password to the database $sql = sprintf("UPDATE %s SET pass = '%s' WHERE uid = %u", $xoops->db->prefix("users"), md5($newpass), $getuser[0]->getVar('uid')); if (!$xoops->db->queryF($sql)) { - include $xoops->path('header.php'); + $xoops->header(); echo _US_MAILPWDNG; - include $xoops->path('footer.php'); + $xoops->footer(); exit(); } redirect_header("user.php", 3, sprintf(_US_PWDMAILED, $getuser[0]->getVar("uname")), false); @@ -85,14 +85,14 @@ $xoopsMailer->setFromEmail($xoops->config['adminmail']); $xoopsMailer->setFromName($xoops->config['sitename']); $xoopsMailer->setSubject(sprintf(_US_NEWPWDREQ, $xoops->config['sitename'])); - include $xoops->path('header.php'); + $xoops->header(); if (!$xoopsMailer->send()) { echo $xoopsMailer->getErrors(); } echo "<h4>"; printf(_US_CONFMAIL, $getuser[0]->getVar("uname")); echo "</h4>"; - include $xoops->path('footer.php'); + $xoops->footer(); } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php 2011-10-24 22:28:21 UTC (rev 7955) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php 2011-10-24 23:45:36 UTC (rev 7956) @@ -138,8 +138,7 @@ 'event_title' => $event_info['title'], 'user_id' => $n->getVar('not_uid') ); } - $xoops->option['template_main'] = 'system_notification_list.html'; - include $xoops->path('header.php'); + $xoops->header('system_notification_list.html'); $xoops->tpl->assign('modules', $modules); $user_info = array('uid' => $xoops->user->getVar('uid')); $xoops->tpl->assign('user', $user_info); @@ -155,7 +154,7 @@ $xoops->tpl->assign('lang_itemname', _NOT_ITEMNAME); $xoops->tpl->assign('lang_activenotifications', _NOT_ACTIVENOTIFICATIONS); $xoops->tpl->assign('notification_token', $xoops->security->createToken()); - include $xoops->path('footer.php'); + $xoops->footer(); // TODO: another display mode... instead of one notification per line, // show one line per item_id, with checkboxes for the available options... @@ -174,13 +173,13 @@ if (empty($_POST['del_not'])) { redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE); } - include $xoops->path('header.php'); + $xoops->header(); $hidden_vars = array( 'uid' => $uid, 'delete_ok' => 1, 'del_not' => $_POST['del_not'] ); echo '<h4>' . _NOT_DELETINGNOTIFICATIONS . '</h4>'; xoops_confirm($hidden_vars, xoops_getenv('PHP_SELF'), _NOT_RUSUREDEL); - include $xoops->path('footer.php'); + $xoops->footer(); // FIXME: There is a problem here... in xoops_confirm it treats arrays as // optional radio arguments on the confirmation page... change this or // write new function... Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/pda.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/pda.php 2011-10-24 22:28:21 UTC (rev 7955) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/pda.php 2011-10-24 23:45:36 UTC (rev 7956) @@ -17,25 +17,26 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; +$xoops = Xoops::getInstance(); header("Content-Type: text/html"); -echo "<html><head><title>" . htmlspecialchars($xoopsConfig['sitename']) . "</title> +echo "<html><head><title>" . htmlspecialchars($xoops->config['sitename']) . "</title> <meta name='HandheldFriendly' content='True' /> <meta name='PalmComputingPlatform' content='True' /> </head> <body>"; -$sql = "SELECT storyid, title FROM " . $xoopsDB->prefix("stories") . " WHERE published>0 AND published<" . time() . " ORDER BY published DESC"; -$result = $xoopsDB->query($sql, 10, 0); +$sql = "SELECT storyid, title FROM " . $xoops->db->prefix("stories") . " WHERE published>0 AND published<" . time() . " ORDER BY published DESC"; +$result = $xoops->db->query($sql, 10, 0); //TODO Remove this hardcoded string if (!$result) { echo "An error occured"; } else { - echo "<img src='images/logo.gif' alt='" . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) . "' border='0' /><br />"; - echo "<h2>" . htmlspecialchars($xoopsConfig['slogan']) . "</h2>"; + echo "<img src='images/logo.gif' alt='" . htmlspecialchars($xoops->config['sitename'], ENT_QUOTES) . "' border='0' /><br />"; + echo "<h2>" . htmlspecialchars($xoops->config['slogan']) . "</h2>"; echo "<div>"; - while (list ($storyid, $title) = $xoopsDB->fetchRow($result)) { - echo "<a href='" . XOOPS_URL . "/modules/news/print.php?storyid=$storyid'>" . htmlspecialchars($title) . "</a><br />"; + while (list ($storyid, $title) = $xoops->db->fetchRow($result)) { + echo "<a href='" . XOOPS_URL . "/modules/news/print.php?storyid={$storyid}'>" . htmlspecialchars($title) . "</a><br />"; } echo "</div>"; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/pmlite.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/pmlite.php 2011-10-24 22:28:21 UTC (rev 7955) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/pmlite.php 2011-10-24 23:45:36 UTC (rev 7956) @@ -17,14 +17,15 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; -$xoopsPreload = XoopsPreload::getInstance(); -$xoopsPreload->triggerEvent('core.pmlite.start'); +$xoops = Xoops::getInstance(); +$xoops->preload = XoopsPreload::getInstance(); +$xoops->preload->triggerEvent('core.pmlite.start'); xoops_loadLanguage('pmsg'); //------------------------------ mamba -$icon=''; +$icon = ''; $icons_radio = new XoopsFormRadio(_MESSAGEICON, 'icon', $icon); $subject_icons = XoopsLists::getSubjectsList(); //------------------------------- mamba @@ -38,44 +39,48 @@ $jump = "pmlite.php?refresh=" . time() . ""; if ($send == 1) { $jump .= "&send=" . $send . ""; - } else if ($send2 == 1) { - $jump .= "&send2=" . $send2 . "&to_userid=" . $to_userid . ""; - } else if ($reply == 1) { - $jump .= "&reply=" . $reply . "&msg_id=" . $msg_id . ""; } else { + if ($send2 == 1) { + $jump .= "&send2=" . $send2 . "&to_userid=" . $to_userid . ""; + } else { + if ($reply == 1) { + $jump .= "&reply=" . $reply . "&msg_id=" . $msg_id . ""; + } else { + } + } } echo "<html><head><meta http-equiv='Refresh' content='0; url=" . $jump . "' /></head><body></body></html>"; exit(); } xoops_header(); -if (is_object($xoopsUser)) { +if ($xoops->isUser()) { $myts = MyTextSanitizer::getInstance(); if (isset($_POST['op']) && $_POST['op'] == "submit") { - if (!$GLOBALS['xoopsSecurity']->check()) { + if (!$xoops->security->check()) { $security_error = true; } - $res = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("users") . " WHERE uid=" . intval($_POST['to_userid']) . ""); - list ($count) = $xoopsDB->fetchRow($res); + $res = $xoops->db->query("SELECT COUNT(*) FROM " . $xoops->db->prefix("users") . " WHERE uid=" . intval($_POST['to_userid']) . ""); + list ($count) = $xoops->db->fetchRow($res); if ($count != 1) { echo "<br /><br /><div><h4>" . _PM_USERNOEXIST . "<br />"; echo _PM_PLZTRYAGAIN . "</h4><br />"; if (isset($security_error) && $security_error == true) { - echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()); + echo implode('<br />', $xoops->security->getErrors()); } echo "[ <a href='javascript:history.go(-1)' title=''>" . _PM_GOBACK . "</a> ]</div>"; } else { $pm_handler = xoops_gethandler('privmessage'); $pm = $pm_handler->create(); -//------------------ mamba -if (isset($_POST['icon'])) { - $pm->setVar("msg_image", $_POST['icon']); + //------------------ mamba + if (isset($_POST['icon'])) { + $pm->setVar("msg_image", $_POST['icon']); } -//----------------- mamba + //----------------- mamba $pm->setVar("subject", $_POST['subject']); $pm->setVar("msg_text", $_POST['message']); $pm->setVar("to_userid", $_POST['to_userid']); - $pm->setVar("from_userid", $xoopsUser->getVar("uid")); + $pm->setVar("from_userid", $xoops->user->getVar("uid")); if (!$pm_handler->insert($pm)) { echo $pm->getHtmlErrors(); echo "<br /><a href='javascript:history.go(-1)' title=''>" . _PM_GOBACK . "</a>"; @@ -83,82 +88,87 @@ echo "<br /><br /><div style='text-align:center;'><h4>" . _PM_MESSAGEPOSTED . "</h4><br /><a href=\"javascript:window.opener.location='" . XOOPS_URL . "/viewpmsg.php';window.close();\" title=\"\">" . _PM_CLICKHERE . "</a><br /><br /><a href=\"javascript:window.close();\" title=\"\">" . _PM_ORCLOSEWINDOW . "</a></div>"; } } - } else if ($reply == 1 || $send == 1 || $send2 == 1) { - if ($reply == 1) { - $pm_handler = xoops_gethandler('privmessage'); - $pm = $pm_handler->get($msg_id); - if ($pm->getVar("to_userid") == $xoopsUser->getVar('uid')) { - $pm_uname = XoopsUser::getUnameFromId($pm->getVar("from_userid")); - $message = "[quote]\n"; - $message .= sprintf(_PM_USERWROTE, $pm_uname); - $message .= "\n" . $pm->getVar("msg_text", "E") . "\n[/quote]"; + } else { + if ($reply == 1 || $send == 1 || $send2 == 1) { + if ($reply == 1) { + $pm_handler = xoops_gethandler('privmessage'); + $pm = $pm_handler->get($msg_id); + if ($pm->getVar("to_userid") == $xoops->user->getVar('uid')) { + $pm_uname = XoopsUser::getUnameFromId($pm->getVar("from_userid")); + $message = "[quote]\n"; + $message .= sprintf(_PM_USERWROTE, $pm_uname); + $message .= "\n" . $pm->getVar("msg_text", "E") . "\n[/quote]"; + } else { + $reply = $send2 = 0; + } + } + echo "<form action='pmlite.php' method='post' name='coolsus'>\n"; + echo "<table style=' text-align:left;' class='outer'><tr><td class='head txtright' style='width:25%'>" . _PM_TO . "</td>"; + if ($reply == 1) { + echo "<td class='even'><input type='hidden' name='to_userid' value='" . $pm->getVar("from_userid") . "' />" . $pm_uname . "</td>"; } else { - unset($pm); - $reply = $send2 = 0; + if ($send2 == 1) { + $to_username = XoopsUser::getUnameFromId($to_userid); + echo "<td class='even'><input type='hidden' name='to_userid' value='" . $to_userid . "' />" . $to_username . "</td>"; + } else { + $user_sel = new XoopsFormSelectUser("", "to_userid"); + echo "<td class='even'>" . $user_sel->render(); + echo "</td>"; + } } - } - echo "<form action='pmlite.php' method='post' name='coolsus'>\n"; - echo "<table style=' text-align:left;' class='outer'><tr><td class='head txtright' style='width:25%'>" . _PM_TO . "</td>"; - if ($reply == 1) { - echo "<td class='even'><input type='hidden' name='to_userid' value='" . $pm->getVar("from_userid") . "' />" . $pm_uname . "</td>"; - } else if ($send2 == 1) { - $to_username = XoopsUser::getUnameFromId($to_userid); - echo "<td class='even'><input type='hidden' name='to_userid' value='" . $to_userid . "' />" . $to_username . "</td>"; - } else { - $user_sel = new XoopsFormSelectUser("", "to_userid"); - echo "<td class='even'>" . $user_sel->render(); - echo "</td>"; - } - echo "</tr>"; - echo "<tr><td class='head txtright' style='width:25%;'>" . _PM_SUBJECTC . "</td>"; - if ($reply == 1) { - $subject = $pm->getVar('subject', 'E'); - //TODO Fix harcoded string - if (!preg_match("/^" . _RE . "/i", $subject)) { - $subject = _RE . ' ' . $subject; + + echo "</tr>"; + echo "<tr><td class='head txtright' style='width:25%;'>" . _PM_SUBJECTC . "</td>"; + if ($reply == 1) { + $subject = $pm->getVar('subject', 'E'); + //TODO Fix harcoded string + if (!preg_match("/^" . _RE . "/i", $subject)) { + $subject = _RE . ' ' . $subject; + } + echo "<td class='even'><input type='text' name='subject' value='" . $subject . "' size='30' maxlength='100' /></td>"; + } else { + echo "<td class='even'><input type='text' name='subject' size='30' maxlength='100' /></td>"; } - echo "<td class='even'><input type='text' name='subject' value='" . $subject . "' size='30' maxlength='100' /></td>"; - } else { - echo "<td class='even'><input type='text' name='subject' size='30' maxlength='100' /></td>"; - } - echo "</tr>"; + echo "</tr>"; + unset($pm); -//----------------------------- mamba - echo "<tr>"; - echo "<td class='head txtright' style='width:25%;'>" . _MESSAGEICON. "</td>"; - foreach ($subject_icons as $iconfile) { - $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />'); - } - echo "<td class='even'>" . $icons_radio->render(); - echo "</td>"; - echo "</tr>"; -//------------------------------- mamba + //----------------------------- mamba + echo "<tr>"; + echo "<td class='head txtright' style='width:25%;'>" . _MESSAGEICON . "</td>"; + foreach ($subject_icons as $iconfile) { + $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />'); + } + echo "<td class='even'>" . $icons_radio->render(); + echo "</td>"; + echo "</tr>"; + //------------------------------- mamba - echo "<tr style='vertical-align:top;'><td style='width:25%;' class='head txtright'>" . _PM_MESSAGEC . "</td>"; - echo "<td class='even'>"; - $content = isset($GLOBALS[$textarea_id]) ? $GLOBALS[$textarea_id] : ''; - $text_editor = new XoopsFormDhtmlTextArea('', 'message', $content, 8, 37, 'xoopsHiddenText'); - $text_editor->htmlEditor = null; - //$text_editor->smilies = false; - echo $text_editor->render(); - $myts = MyTextSanitizer::getInstance(); - $smiles = $myts->getSmileys(FALSE); - $count = count($smiles); - for($i = 0; $i < $count; $i ++) { - echo "<img src='" . XOOPS_UPLOAD_URL . "/" . htmlspecialchars($smiles[$i]['smile_url'], ENT_QUOTES) . "' border='0' alt='' onclick='xoopsCodeSmilie(\"{$message}\", \" " . $smiles[$i]['code'] . " \");' onmouseover='style.cursor=\"hand\"' />"; - } - echo " [<a href='#moresmiley' onmouseover='style.cursor=\"hand\"' alt='' onclick='openWithSelfMain(\"" . XOOPS_URL . "/misc.php?action=showpopups&type=smilies&target={$message}\",\"smilies\",300,475);'>" . _MORE . "</a>]"; + echo "<tr style='vertical-align:top;'><td style='width:25%;' class='head txtright'>" . _PM_MESSAGEC . "</td>"; + echo "<td class='even'>"; + $content = isset($GLOBALS[$textarea_id]) ? $GLOBALS[$textarea_id] : ''; + $text_editor = new XoopsFormDhtmlTextArea('', 'message', $content, 8, 37, 'xoopsHiddenText'); + $text_editor->htmlEditor = null; + //$text_editor->smilies = false; + echo $text_editor->render(); + $myts = MyTextSanitizer::getInstance(); + $smiles = $myts->getSmileys(FALSE); + $count = count($smiles); + for ($i = 0; $i < $count; $i++) { + echo "<img src='" . XOOPS_UPLOAD_URL . "/" . htmlspecialchars($smiles[$i]['smile_url'], ENT_QUOTES) . "' border='0' alt='' onclick='xoopsCodeSmilie(\"{$message}\", \" " . $smiles[$i]['code'] . " \");' onmouseover='style.cursor=\"hand\"' />"; + } + echo " [<a href='#moresmiley' onmouseover='style.cursor=\"hand\"' alt='' onclick='openWithSelfMain(\"" . XOOPS_URL . "/misc.php?action=showpopups&type=smilies&target={$message}\",\"smilies\",300,475);'>" . _MORE . "</a>]"; - echo "</td>"; - echo "</tr>"; - echo "<tr><td class='head'> </td><td class='even'> - <input type='hidden' name='op' value='submit' />" . $GLOBALS['xoopsSecurity']->getTokenHTML() . " + echo "</td>"; + echo "</tr>"; + echo "<tr><td class='head'> </td><td class='even'> + <input type='hidden' name='op' value='submit' />" . $xoops->security->getTokenHTML() . " <input type='submit' class='formButton' name='submit' value='" . _PM_SUBMIT . "' /> <input type='reset' class='formButton' value='" . _PM_CLEAR . "' /> <input type='button' class='formButton' name='cancel' value='" . _PM_CANCELSEND . "' onclick='javascript:window.close();' /> </td></tr></table>\n"; - echo "</form>\n"; + echo "</form>\n"; + } } } else { echo _PM_SORRY . "<br /><br /><a href='" . XOOPS_URL . "/register.php' title=''>" . _PM_REGISTERNOW . "</a>."; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php 2011-10-24 22:28:21 UTC (rev 7955) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php 2011-10-24 23:45:36 UTC (rev 7956) @@ -17,28 +17,30 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; -$xoopsPreload = XoopsPreload::getInstance(); -$xoopsPreload->triggerEvent('core.readpmsg.start'); +$xoops = Xoops::getInstance(); +$xoops->preload = XoopsPreload::getInstance(); +$xoops->preload->triggerEvent('core.readpmsg.start'); xoops_loadLanguage('pmsg'); -if (!is_object($xoopsUser)) { +if (!$xoops->isUser()) { redirect_header("user.php", 0); exit(); } else { + /* @var $pm_handler XoopsPrivmessageHandler */ $pm_handler = xoops_gethandler('privmessage'); if (!empty($_POST['delete'])) { - if (!$GLOBALS['xoopsSecurity']->check()) { - echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()); + if (!$xoops->security->check()) { + echo implode('<br />', $xoops->security->getErrors()); exit(); } else if (empty($_REQUEST['ok'])) { - include $GLOBALS['xoops']->path('header.php'); + $xoops->header(); xoops_confirm(array('ok' => 1, 'delete' => 1, 'msg_id'=> intval($_POST['msg_id'])), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE); - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); exit(); } $pm = $pm_handler->get(intval($_POST['msg_id'])); - if (!is_object($pm) || $pm->getVar('to_userid') != $xoopsUser->getVar('uid') || !$pm_handler->delete($pm)) { + if (!is_object($pm) || $pm->getVar('to_userid') != $xoops->user->getVar('uid') || !$pm_handler->delete($pm)) { exit(); } else { redirect_header("viewpmsg.php", 1, _PM_DELETED); @@ -47,13 +49,13 @@ } $start = !empty($_GET['start']) ? intval($_GET['start']) : 0; $total_messages = !empty($_GET['total_messages']) ? intval($_GET['total_messages']) : 0; - include $GLOBALS['xoops']->path('header.php'); - $criteria = new Criteria('to_userid', $xoopsUser->getVar('uid')); + $xoops->header(); + $criteria = new Criteria('to_userid', $xoops->user->getVar('uid')); $criteria->setLimit(1); $criteria->setStart($start); $criteria->setSort('msg_time'); $pm_arr = $pm_handler->getObjects($criteria); - echo "<div><h4>" . _PM_PRIVATEMESSAGE . "</h4></div><br /><a href='userinfo.php?uid=" . $xoopsUser->getVar("uid") . "' title=''>" . _PM_PROFILE . "</a> <span class='bold'>»»</span> <a href='viewpmsg.php' title=''>" . _PM_INBOX . "</a> <span class='bold'>»»</span> \n"; + echo "<div><h4>" . _PM_PRIVATEMESSAGE . "</h4></div><br /><a href='userinfo.php?uid=" . $xoops->user->getVar("uid") . "' title=''>" . _PM_PROFILE . "</a> <span class='bold'>»»</span> <a href='viewpmsg.php' title=''>" . _PM_INBOX . "</a> <span class='bold'>»»</span> \n"; if (empty($pm_arr)) { echo '<br /><br />' . _PM_YOUDONTHAVE; } else { @@ -78,7 +80,7 @@ echo "<span class='red bold'>" . _PM_ONLINE . "</span><br /><br />\n"; } } else { - echo $xoopsConfig['anonymous']; // we need to do this for deleted users + echo $xoops->config['anonymous']; // we need to do this for deleted users } //------------- mamba $iconName=$pm_arr[0]->getVar("msg_image", "E"); @@ -97,7 +99,7 @@ echo "<a href='#' onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?reply=1&msg_id=" . $pm_arr[0]->getVar("msg_id") . "\",\"pmlite\",565,500);'><img src='" . XOOPS_URL . "/images/icons/reply.gif' alt='" . _PM_REPLY . "' /></a>\n"; } echo "<input type='hidden' name='delete' value='1' />"; - echo $GLOBALS['xoopsSecurity']->getTokenHTML(); + echo $xoops->security->getTokenHTML(); echo "<input type='hidden' name='msg_id' value='" . $pm_arr[0]->getVar("msg_id") . "' />"; echo "<a href='#" . $pm_arr[0]->getVar("msg_id") . "' onclick='javascript:document.delete" . $pm_arr[0]->getVar("msg_id") . ".submit();'><img src='" . XOOPS_URL . "/images/icons/delete.gif' alt='" . _PM_DELETE . "' /></a>"; echo "</td></tr><tr><td class='txtright' colspan='2'>"; @@ -115,6 +117,6 @@ } echo "</td></tr></table></form>\n"; } - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); } ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2011-10-24 22:28:21 UTC (rev 7955) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2011-10-24 23:45:36 UTC (rev 7956) @@ -24,13 +24,15 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; -$xoopsPreload = XoopsPreload::getInstance(); -$xoopsPreload->triggerEvent('core.register.start'); +$xoops = Xoops::getInstance(); +$xoops->preload = XoopsPreload::getInstance(); +$xoops->preload->triggerEvent('core.register.start'); xoops_loadLanguage('user'); $myts = MyTextSanitizer::getInstance(); +/* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER); @@ -45,18 +47,18 @@ $url = isset($_POST['url']) ? trim($myts->stripSlashesGPC($_POST['url'])) : ''; $pass = isset($_POST['pass']) ? $myts->stripSlashesGPC($_POST['pass']) : ''; $vpass = isset($_POST['vpass']) ? $myts->stripSlashesGPC($_POST['vpass']) : ''; -$timezone_offset = isset($_POST['timezone_offset']) ? (float) $_POST['timezone_offset'] : $xoopsConfig['default_TZ']; +$timezone_offset = isset($_POST['timezone_offset']) ? (float)$_POST['timezone_offset'] : $xoops->config['default_TZ']; $user_viewemail = (isset($_POST['user_viewemail']) && intval($_POST['user_viewemail'])) ? 1 : 0; $user_mailok = (isset($_POST['user_mailok']) && intval($_POST['user_mailok'])) ? 1 : 0; $agree_disc = (isset($_POST['agree_disc']) && intval($_POST['agree_disc'])) ? 1 : 0; switch ($op) { case 'newuser': - $xoopsOption['xoops_pagetitle'] = _US_USERREG; - include $GLOBALS['xoops']->path('header.php'); + $xoops->header(); + $xoops->tpl->assign('xoops_pagetitle', _US_USERREG); $stop = ''; - if (!$GLOBALS['xoopsSecurity']->check()) { - $stop .= implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()) . "<br />"; + if (!$xoops->security->check()) { + $stop .= implode('<br />', $xoops->security->getErrors()) . "<br />"; } if ($xoopsConfigUser['reg_dispdsclmr'] != 0 && $xoopsConfigUser['reg_disclaimer'] != '') { if (empty($agree_disc)) { @@ -79,33 +81,32 @@ echo "<input type='hidden' name='uname' value='" . $myts->htmlSpecialChars($uname) . "' /> <input type='hidden' name='email' value='" . $myts->htmlSpecialChars($email) . "' /> <input type='hidden' name='user_viewemail' value='" . $user_viewemail . "' /> - <input type='hidden' name='timezone_offset' value='" . (float) $timezone_offset . "' /> + <input type='hidden' name='timezone_offset' value='" . (float)$timezone_offset . "' /> <input type='hidden' name='url' value='" . $myts->htmlSpecialChars($url) . "' /> <input type='hidden' name='pass' value='" . $myts->htmlSpecialChars($pass) . "' /> <input type='hidden' name='vpass' value='" . $myts->htmlSpecialChars($vpass) . "' /> <input type='hidden' name='user_mailok' value='" . $user_mailok . "' /> - <br /><br /><input type='hidden' name='op' value='finish' />" - . $GLOBALS['xoopsSecurity']->getTokenHTML() - . "<input type='submit' value='" . _US_FINISH . "' /></form>"; + <br /><br /><input type='hidden' name='op' value='finish' />" . $GLOBALS['xoopsSecurity']->getTokenHTML() . "<input type='submit' value='" . _US_FINISH . "' /></form>"; } else { echo "<span class='red'>$stop</span>"; - include $GLOBALS['xoops']->path('include/registerform.php'); + include $xoops->path('include/registerform.php'); $reg_form->display(); } - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); break; case 'finish': - include $GLOBALS['xoops']->path('header.php'); + $xoops->header(); $stop = XoopsUserUtility::validate($uname, $email, $pass, $vpass); - if (!$GLOBALS['xoopsSecurity']->check()) { - $stop .= implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()) . "<br />"; + if (!$xoops->security->check()) { + $stop .= implode('<br />', $xoops->security->getErrors()) . "<br />"; } $xoopsCaptcha = XoopsCaptcha::getInstance(); if (!$xoopsCaptcha->verify()) { $stop .= $xoopsCaptcha->getMessage() . "<br />"; } if (empty($stop)) { + /* @var $member_handler XoopsMemberHandler */ $member_handler = xoops_gethandler('member'); $newuser = $member_handler->createUser(); $newuser->setVar('user_viewemail', $user_viewemail, true); @@ -120,9 +121,9 @@ $newuser->setVar('pass', md5($pass), true); $newuser->setVar('timezone_offset', $timezone_offset, true); $newuser->setVar('user_regdate', time(), true); - $newuser->setVar('uorder', $GLOBALS['xoopsConfig']['com_order'], true); - $newuser->setVar('umode', $GLOBALS['xoopsConfig']['com_mode'], true); - $newuser->setVar('theme', $GLOBALS['xoopsConfig']['theme_set'], true); + $newuser->setVar('uorder', $xoops->config['com_order'], true); + $newuser->setVar('umode', $xoops->config['com_mode'], true); + $newuser->setVar('theme', $xoops->config['theme_set'], true); $newuser->setVar('user_mailok', $user_mailok, true); if ($xoopsConfigUser['activation_type'] == 1) { $newuser->setVar('level', 1, true); @@ -131,13 +132,13 @@ } if (!$member_handler->insertUser($newuser)) { echo _US_REGISTERNG; - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); exit(); } $newid = $newuser->getVar('uid'); if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newid)) { echo _US_REGISTERNG; - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); exit(); } if ($xoopsConfigUser['activation_type'] == 1) { @@ -150,14 +151,14 @@ $xoopsMailer = xoops_getMailer(); $xoopsMailer->useMail(); $xoopsMailer->setTemplate('register.tpl'); - $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']); - $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); + $xoopsMailer->assign('SITENAME', $xoops->config['sitename']); + $xoopsMailer->assign('ADMINMAIL', $xoops->config['adminmail']); $xoopsMailer->assign('SITEURL', XOOPS_URL . "/"); $xoopsMailer->setToUsers(new XoopsUser($newid)); - $xoopsMailer->setFromEmail($xoopsConfig['adminmail']); - $xoopsMailer->setFromName($xoopsConfig['sitename']); + $xoopsMailer->setFromEmail($xoops->config['adminmail']); + $xoopsMailer->setFromName($xoops->config['sitename']); $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname)); - if (! $xoopsMailer->send()) { + if (!$xoopsMailer->send()) { echo _US_YOURREGMAILNG; } else { echo _US_YOURREGISTERED; @@ -170,15 +171,15 @@ $xoopsMailer->assign('USERNAME', $uname); $xoopsMailer->assign('USEREMAIL', $email); $xoopsMailer->assign('USERACTLINK', XOOPS_URL . '/register.php?op=actv&id=' . $newid . '&actkey=' . $actkey); - $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']); - $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); + $xoopsMailer->assign('SITENAME', $xoops->config['sitename']); + $xoopsMailer->assign('ADMINMAIL', $xoops->config['adminmail']); $xoopsMailer->assign('SITEURL', XOOPS_URL . "/"); $member_handler = xoops_gethandler('member'); $xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['activation_group'])); - $xoopsMailer->setFromEmail($xoopsConfig['adminmail']); - $xoopsMailer->setFromName($xoopsConfig['sitename']); + $xoopsMailer->setFromEmail($xoops->config['adminmail']); + $xoopsMailer->setFromName($xoops->config['sitename']); $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname)); - if (! $xoopsMailer->send()) { + if (!$xoopsMailer->send()) { echo _US_YOURREGMAILNG; } else { echo _US_YOURREGISTERED2; @@ -198,10 +199,10 @@ } } else { echo "<span class='red bold'>{$stop}</span>"; - include $GLOBALS['xoops']->path('include/registerform.php'); + include $xoops->path('include/registerform.php'); $reg_form->display(); } - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); break; case 'actv': @@ -231,20 +232,20 @@ $xoopsMailer = xoops_getMailer(); $xoopsMailer->useMail(); $xoopsMailer->setTemplate('activated.tpl'); - $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']); - $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); + $xoopsMailer->assign('SITENAME', $xoops->config['sitename']); + $xoopsMailer->assign('ADMINMAIL', $xoops->config['adminmail']); $xoopsMailer->assign('SITEURL', XOOPS_URL . "/"); $xoopsMailer->setToUsers($thisuser); - $xoopsMailer->setFromEmail($xoopsConfig['adminmail']); - $xoopsMailer->setFromName($xoopsConfig['sitename']); - $xoopsMailer->setSubject(sprintf(_US_YOURACCOUNT, $xoopsConfig['sitename'])); - include $GLOBALS['xoops']->path('header.php'); + $xoopsMailer->setFromEmail($xoops->config['adminmail']); + $xoopsMailer->setFromName($xoops->config['sitename']); + $xoopsMailer->setSubject(sprintf(_US_YOURACCOUNT, $xoops->config['sitename'])); + $xoops->header(); if (!$xoopsMailer->send()) { printf(_US_ACTVMAILNG, $thisuser->getVar('uname')); } else { printf(_US_ACTVMAILOK, $thisuser->getVar('uname')); } - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); } else { redirect_header('user.php', 5, _US_ACTLOGIN, false); } @@ -257,13 +258,13 @@ case 'register': default: - $xoopsOption['xoops_pagetitle'] = _US_USERREG; - include $GLOBALS['xoops']->path('header.php'); - $xoTheme->addMeta('meta', 'keywords', _US_USERREG . ", " . _US_NICKNAME); // FIXME! - $xoTheme->addMeta('meta', 'description', strip_tags($xoopsConfigUser['reg_disclaimer'])); - include $GLOBALS['xoops']->path('include/registerform.php'); + $xoops->header(); + $xoops->tpl->assign('xoops_pagetitle', _US_USERREG); + $xoops->theme->addMeta('meta', 'keywords', _US_USERREG . ", " . _US_NICKNAME); // FIXME! + $xoops->theme->addMeta('meta', 'description', strip_tags($xoopsConfigUser['reg_disclaimer'])); + include $xoops->path('include/registerform.php'); $reg_form->display(); - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); break; } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-25 20:28:18
|
Revision: 7961 http://xoops.svn.sourceforge.net/xoops/?rev=7961&view=rev Author: trabis Date: 2011-10-25 20:28:11 +0000 (Tue, 25 Oct 2011) Log Message: ----------- More refactoring. removing xmlrpc.php (this file is related with news module) Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.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 Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/xmlrpc.php 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-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -383,7 +383,7 @@ $xoops->logger->stopTime(); $xoops->preload->triggerEvent('core.footer.end'); - return true; + exit(); } /** 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-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -425,6 +425,7 @@ $op = 'save'; } else { // Search modules + /* @var $blocklinkmodule_handler SystemBlocklinkmoduleHandler */ $blocklinkmodule_handler = xoops_getModuleHandler('blocklinkmodule', 'system'); $criteria = new CriteriaCompo(new Criteria('block_id', $this->getVar('bid'))); $blocklinkmodule = $blocklinkmodule_handler->getObjects($criteria); @@ -731,14 +732,12 @@ } /** - * XoopsBlock::getAllBlocks() - * * @param string $rettype - * @param mixed $side - * @param mixed $visible + * @param null $side + * @param null $visible * @param string $orderby - * @param integer $isactive - * @return + * @param int $isactive + * @return array */ public function getAllBlocks($rettype = "object", $side = null, $visible = null, $orderby = "side,weight,bid", $isactive = 1) { @@ -791,11 +790,9 @@ } /** - * XoopsBlock::getByModule() - * - * @param mixed $moduleid - * @param mixed $asobject - * @return + * @param int $moduleid + * @param bool $asobject + * @return array */ public function getByModule($moduleid, $asobject = true) { @@ -827,7 +824,7 @@ * @param mixed $visible * @param string $orderby * @param integer $isactive - * @return + * @return array */ public function getAllByGroupModule($groupid, $module_id = 0, $toponlyblock = false, $visible = null, $orderby = 'b.weight, m.block_id', $isactive = 1) { @@ -894,7 +891,7 @@ * @param mixed $visible * @param string $orderby * @param integer $isactive - * @return + * @return array */ public function getNonGroupedBlocks($module_id = 0, $toponlyblock = false, $visible = null, $orderby = 'b.weight, m.block_id', $isactive = 1) { @@ -952,10 +949,10 @@ /** * XoopsBlock::countSimilarBlocks() * - * @param mixed $moduleId - * @param mixed $funcNum + * @param int $moduleId + * @param string $funcNum * @param mixed $showFunc - * @return + * @return int */ public function countSimilarBlocks($moduleId, $funcNum, $showFunc = null) { @@ -1017,7 +1014,10 @@ /************ system ***************/ - + /** + * @param int $groupid + * @return array + */ function getBlockByPerm($groupid) { $ret = array(); @@ -1040,6 +1040,7 @@ } return $blockids; } + return $ret; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -404,6 +404,7 @@ */ public function getByDirName($dirname) { + /* @var $modhandler XoopsModuleHandler */ $modhandler = xoops_gethandler('module'); $inst = $modhandler->getByDirname($dirname); return $inst; @@ -497,6 +498,7 @@ } else { return false; } + /* @var $module XoopsModule */ $_cachedModule_dirname[$dirname] = $module; $_cachedModule_mid[$module->getVar('mid')] = $module; return $module; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -280,7 +280,7 @@ * @param int $item_id * @param string $event * @param int $user_id - * @return array|bool + * @return XoopsNotification|bool */ public function getNotification($module_id, $category, $item_id, $event, $user_id) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -1,17 +1,15 @@ <?php -/* - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ - /** * XOOPS Register * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * * See the enclosed file license.txt for licensing information. * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html * Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -1,17 +1,14 @@ <?php -/* - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ - /** * XOOPS global search * + * 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. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * * See the enclosed file license.txt for licensing information. * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html * @@ -24,10 +21,14 @@ * @version $Id$ * @todo Modularize; Both search algorithms and interface will be redesigned */ + include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; xoops_loadLanguage('search'); +$xoops = Xoops::getInstance(); + +/* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); $xoopsConfigSearch = $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH); @@ -38,36 +39,48 @@ $action = "search"; if (!empty($_GET['action'])) { $action = trim(strip_tags($_GET['action'])); -} else if (!empty($_POST['action'])) { - $action = trim(strip_tags($_POST['action'])); +} else { + if (!empty($_POST['action'])) { + $action = trim(strip_tags($_POST['action'])); + } } $query = ""; if (!empty($_GET['query'])) { $query = trim(strip_tags($_GET['query'])); -} else if (!empty($_POST['query'])) { - $query = trim(strip_tags($_POST['query'])); +} else { + if (!empty($_POST['query'])) { + $query = trim(strip_tags($_POST['query'])); + } } $andor = "AND"; if (!empty($_GET['andor'])) { $andor = trim(strip_tags($_GET['andor'])); -} else if (!empty($_POST['andor'])) { - $andor = trim(strip_tags($_POST['andor'])); +} else { + if (!empty($_POST['andor'])) { + $andor = trim(strip_tags($_POST['andor'])); + } } $mid = $uid = $start = 0; if (!empty($_GET['mid'])) { $mid = intval($_GET['mid']); -} else if (!empty($_POST['mid'])) { - $mid = intval($_POST['mid']); +} else { + if (!empty($_POST['mid'])) { + $mid = intval($_POST['mid']); + } } if (!empty($_GET['uid'])) { $uid = intval($_GET['uid']); -} else if (!empty($_POST['uid'])) { - $uid = intval($_POST['uid']); +} else { + if (!empty($_POST['uid'])) { + $uid = intval($_POST['uid']); + } } if (!empty($_GET['start'])) { $start = intval($_GET['start']); -} else if (!empty($_POST['start'])) { - $start = intval($_POST['start']); +} else { + if (!empty($_POST['start'])) { + $start = intval($_POST['start']); + } } $queries = array(); @@ -77,26 +90,31 @@ redirect_header("search.php", 1, _SR_PLZENTER); exit(); } -} else if ($action == "showall") { - if ($query == "" || empty($mid)) { - redirect_header("search.php", 1, _SR_PLZENTER); - exit(); +} else { + if ($action == "showall") { + if ($query == "" || empty($mid)) { + redirect_header("search.php", 1, _SR_PLZENTER); + exit(); + } + } else { + if ($action == "showallbyuser") { + if (empty($mid) || empty($uid)) { + redirect_header("search.php", 1, _SR_PLZENTER); + exit(); + } + } } -} else if ($action == "showallbyuser") { - if (empty($mid) || empty($uid)) { - redirect_header("search.php", 1, _SR_PLZENTER); - exit(); - } } -$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; +$groups = $xoops->isUser() ? $xoops->user->getGroups() : XOOPS_GROUP_ANONYMOUS; +/* @var $gperm_handler XoopsGrouppermHandler */ $gperm_handler = xoops_gethandler('groupperm'); $available_modules = $gperm_handler->getItemIds('module_read', $groups); if ($action == 'search') { - include $GLOBALS['xoops']->path('header.php'); - include $GLOBALS['xoops']->path('include/searchform.php'); + $xoops->header(); + include $xoops->path('include/searchform.php'); $search_form->display(); - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); exit(); } if ($andor != "OR" && $andor != "exact" && $andor != "AND") { @@ -118,13 +136,11 @@ } if (count($queries) == 0) { redirect_header('search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); - exit(); } } else { $query = trim($query); if (strlen($query) < $xoopsConfigSearch['keyword_min']) { redirect_header('search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); - exit(); } $queries = array($myts->addSlashes($query)); } @@ -137,12 +153,11 @@ $criteria->add(new Criteria('mid', "(" . implode(',', $available_modules) . ")", 'IN')); $modules = $module_handler->getObjects($criteria, true); $mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array(); - if (empty($mids) || ! is_array($mids)) { + if (empty($mids) || !is_array($mids)) { unset($mids); $mids = array_keys($modules); } - $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS . ': ' . implode(' ', $queries); - include $GLOBALS['xoops']->path('header.php'); + $xoops->header(_SR_SEARCHRESULTS . ': ' . implode(' ', $queries)); $nomatch = true; echo "<h3>" . _SR_SEARCHRESULTS . "</h3>\n"; echo _SR_KEYWORDS . ':'; @@ -164,13 +179,14 @@ foreach ($mids as $mid) { $mid = intval($mid); if (in_array($mid, $available_modules)) { + /* @var $module XoopsModule */ $module = $modules[$mid]; $results = $module->search($queries, $andor, 5, 0); $count = count($results); if (is_array($results) && $count > 0) { $nomatch = false; echo "<h4>" . $module->getVar('name') . "</h4>"; - for($i = 0; $i < $count; $i++) { + for ($i = 0; $i < $count; $i++) { if (isset($results[$i]['image']) && $results[$i]['image'] != "") { echo "<img src='modules/" . $module->getVar('dirname') . "/" . $results[$i]['image'] . "' alt='" . $module->getVar('name') . "' /> "; } else { @@ -186,7 +202,8 @@ $uname = XoopsUser::getUnameFromId($results[$i]['uid']); echo " <a href='" . XOOPS_URL . "/userinfo.php?uid=" . $results[$i]['uid'] . "' title=''>" . $uname . "</a>\n"; } - echo !empty($results[$i]['time']) ? " (" . formatTimestamp(intval($results[$i]['time'])) . ")" : ""; + echo !empty($results[$i]['time']) ? " (" . formatTimestamp(intval($results[$i]['time'])) . ")" + : ""; echo "</span><br />\n"; } if ($count >= 5) { @@ -202,13 +219,13 @@ if ($nomatch) { echo "<p>" . _SR_NOMATCH . "</p>"; } - include $GLOBALS['xoops']->path('include/searchform.php'); + include $xoops->path('include/searchform.php'); $search_form->display(); break; case "showall": case 'showallbyuser': - include $GLOBALS['xoops']->path('header.php'); + $xoops->header(); $module_handler = xoops_gethandler('module'); $module = $module_handler->get($mid); $results = $module->search($queries, $andor, 20, $start, $uid); @@ -234,7 +251,7 @@ } printf(_SR_SHOWING, $start + 1, $start + $count); echo "<h5>" . $module->getVar('name') . "</h5>"; - for ($i = 0; $i < $count; $i ++) { + for ($i = 0; $i < $count; $i++) { if (isset($results[$i]['image']) && $results[$i]['image'] != '') { echo "<img src='modules/" . $module->getVar('dirname', "n") . "/" . $results[$i]['image'] . "' alt='" . $module->getVar('name') . "' /> "; } else { @@ -275,9 +292,9 @@ } else { echo '<p>' . _SR_NOMATCH . '</p>'; } - include $GLOBALS['xoops']->path('include/searchform.php'); + include $xoops->path('include/searchform.php'); $search_form->display(); break; } -include $GLOBALS['xoops']->path('footer.php'); +$xoops->footer(); ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/user.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/user.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/user.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -1,17 +1,14 @@ <?php -/* - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ - /** * XOOPS User * + * 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. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * * See the enclosed file license.txt for licensing information. * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html * @@ -22,10 +19,13 @@ * @author Kazumi Ono <web...@my...> * @version $Id$ */ + include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; -$xoopsPreload = XoopsPreload::getInstance(); -$xoopsPreload->triggerEvent('core.user.start'); +$xoops = Xoops::getInstance(); +$xoops->preload = XoopsPreload::getInstance(); +$xoops->preload->triggerEvent('core.user.start'); + xoops_loadLanguage('user'); $op = 'main'; @@ -36,34 +36,32 @@ } if ($op == 'login') { - include_once $GLOBALS['xoops']->path('include/checklogin.php'); + include_once $xoops->path('include/checklogin.php'); exit(); } if ($op == 'main') { - if (!$xoopsUser) { - $xoopsOption['template_main'] = 'system_userform.html'; - include $GLOBALS['xoops']->path('header.php'); - $xoopsTpl->assign('xoops_pagetitle', _LOGIN); - $xoTheme->addMeta('meta', 'keywords', _USERNAME . ", " . _US_PASSWORD . ", " . _US_LOSTPASSWORD); - $xoTheme->addMeta('meta', 'description', _US_LOSTPASSWORD . " " . _US_NOPROBLEM); - $xoopsTpl->assign('lang_login', _LOGIN); - $xoopsTpl->assign('lang_username', _USERNAME); + if (!$xoops->isUser()) { + $xoops->header('system_userform.html'); + $xoops->tpl->assign('xoops_pagetitle', _LOGIN); + $xoops->theme->addMeta('meta', 'keywords', _USERNAME . ", " . _US_PASSWORD . ", " . _US_LOSTPASSWORD); + $xoops->theme->addMeta('meta', 'description', _US_LOSTPASSWORD . " " . _US_NOPROBLEM); + $xoops->tpl->assign('lang_login', _LOGIN); + $xoops->tpl->assign('lang_username', _USERNAME); if (isset($_GET['xoops_redirect'])) { - $xoopsTpl->assign('redirect_page', htmlspecialchars(trim($_GET['xoops_redirect']), ENT_QUOTES)); + $xoops->tpl->assign('redirect_page', htmlspecialchars(trim($_GET['xoops_redirect']), ENT_QUOTES)); } - if ($xoopsConfig['usercookie']) { - $xoopsTpl->assign('lang_rememberme', _US_REMEMBERME); + if ($xoops->config['usercookie']) { + $xoops->tpl->assign('lang_rememberme', _US_REMEMBERME); } - $xoopsTpl->assign('lang_password', _PASSWORD); - $xoopsTpl->assign('lang_notregister', _US_NOTREGISTERED); - $xoopsTpl->assign('lang_lostpassword', _US_LOSTPASSWORD); - $xoopsTpl->assign('lang_noproblem', _US_NOPROBLEM); - $xoopsTpl->assign('lang_youremail', _US_YOUREMAIL); - $xoopsTpl->assign('lang_sendpassword', _US_SENDPASSWORD); - $xoopsTpl->assign('mailpasswd_token', $GLOBALS['xoopsSecurity']->createToken()); - include $GLOBALS['xoops']->path('footer.php'); - exit(); + $xoops->tpl->assign('lang_password', _PASSWORD); + $xoops->tpl->assign('lang_notregister', _US_NOTREGISTERED); + $xoops->tpl->assign('lang_lostpassword', _US_LOSTPASSWORD); + $xoops->tpl->assign('lang_noproblem', _US_NOPROBLEM); + $xoops->tpl->assign('lang_youremail', _US_YOUREMAIL); + $xoops->tpl->assign('lang_sendpassword', _US_SENDPASSWORD); + $xoops->tpl->assign('mailpasswd_token', $xoops->security->createToken()); + $xoops->footer(); } if (!empty($_GET['xoops_redirect'])) { $redirect = trim($_GET['xoops_redirect']); @@ -74,12 +72,12 @@ $isExternal = true; } } - if (! $isExternal) { + if (!$isExternal) { header('Location: ' . $redirect); exit(); } } - header('Location: ' . XOOPS_URL . '/userinfo.php?uid=' . $xoopsUser->getVar('uid')); + header('Location: ' . XOOPS_URL . '/userinfo.php?uid=' . $xoops->user->getVar('uid')); exit(); } @@ -88,43 +86,40 @@ $_SESSION = array(); // Regenerate a new session id and destroy old session session_regenerate_id(true); - setcookie($xoopsConfig['usercookie'], 0, - 1, '/', XOOPS_COOKIE_DOMAIN, 0); - setcookie($xoopsConfig['usercookie'], 0, - 1, '/'); + setcookie($xoops->config['usercookie'], 0, -1, '/', XOOPS_COOKIE_DOMAIN, 0); + setcookie($xoops->config['usercookie'], 0, -1, '/'); // clear entry from online users table - if (is_object($xoopsUser)) { + if ($xoops->isUser()) { + /* @var $online_handler XoopsOnlineHandler */ $online_handler = xoops_gethandler('online'); - $online_handler->destroy($xoopsUser->getVar('uid')); + $online_handler->destroy($xoops->user->getVar('uid')); } $message = _US_LOGGEDOUT . '<br />' . _US_THANKYOUFORVISIT; redirect_header('index.php', 1, $message); - exit(); } if ($op == 'delete') { + /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER); - if (!$xoopsUser || $xoopsConfigUser['self_delete'] != 1) { + if (!$xoops->isUser() || $xoopsConfigUser['self_delete'] != 1) { redirect_header('index.php', 5, _US_NOPERMISS); - exit(); } else { - $groups = $xoopsUser->getGroups(); + $groups = $xoops->user->getGroups(); if (in_array(XOOPS_GROUP_ADMIN, $groups)) { // users in the webmasters group may not be deleted redirect_header('user.php', 5, _US_ADMINNO); - exit(); } $ok = !isset($_POST['ok']) ? 0 : intval($_POST['ok']); if ($ok != 1) { - include $GLOBALS['xoops']->path('header.php'); - xoops_confirm( - array('op' => 'delete', 'ok' => 1), - 'user.php', - _US_SURETODEL . '<br/>' . _US_REMOVEINFO); - include $GLOBALS['xoops']->path('footer.php'); + $xoops->header(); + xoops_confirm(array('op' => 'delete', 'ok' => 1), 'user.php', _US_SURETODEL . '<br/>' . _US_REMOVEINFO); + $xoops->footer(); } else { - $del_uid = $xoopsUser->getVar("uid"); + $del_uid = $xoops->user->getVar("uid"); + /* @var $member_handler XoopsMemberHandler */ $member_handler = xoops_gethandler('member'); - if (false != $member_handler->deleteUser($xoopsUser)) { + if (false != $member_handler->deleteUser($xoops->user)) { $online_handler = xoops_gethandler('online'); $online_handler->destroy($del_uid); xoops_notification_deletebyuser($del_uid); @@ -132,7 +127,6 @@ } redirect_header('index.php', 5, _US_NOPERMISS); } - exit(); } } ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -1,17 +1,14 @@ <?php -/* - 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. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ - /** * XOOPS User * + * 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. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * * See the enclosed file license.txt for licensing information. * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html * @@ -22,6 +19,7 @@ * @author Kazumi Ono <web...@my...> * @version $Id$ */ + include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoopsPreload = XoopsPreload::getInstance(); $xoopsPreload->triggerEvent('core.userinfo.start'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -17,44 +17,48 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; -$xoopsPreload = XoopsPreload::getInstance(); -$xoopsPreload->triggerEvent('core.viewpmsg.start'); +$xoops = Xoops::getInstance(); +$xoops->preload = XoopsPreload::getInstance(); +$xoops->preload->triggerEvent('core.viewpmsg.start'); + xoops_loadLanguage('pmsg'); -if (!is_object($xoopsUser)) { +if (!$xoops->isUser()) { $errormessage = _PM_SORRY . "<br />" . _PM_PLZREG . ""; redirect_header("user.php", 2, $errormessage); } else { $pm_handler = xoops_gethandler('privmessage'); if (isset($_POST['delete_messages']) && isset($_POST['msg_id'])) { - if (!$GLOBALS['xoopsSecurity']->check()) { - echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()); + if (!$xoops->security->check()) { + echo implode('<br />', $xoops->security->getErrors()); exit(); - } else if (empty($_REQUEST['ok'])) { - include $GLOBALS['xoops']->path('header.php'); - xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'msg_id'=> serialize(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE); - include $GLOBALS['xoops']->path('footer.php'); - exit(); + } else { + if (empty($_REQUEST['ok'])) { + $xoops->header(); + xoops_confirm(array( + 'ok' => 1, 'delete_messages' => 1, 'msg_id' => serialize(array_map("intval", $_POST['msg_id'])) + ), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE); + $xoops->footer(); + } } $_POST['msg_id'] = unserialize($_REQUEST['msg_id']); $size = count($_POST['msg_id']); $msg = $_POST['msg_id']; - for($i = 0; $i < $size; $i++) { + for ($i = 0; $i < $size; $i++) { $pm = $pm_handler->get(intval($msg[$i])); - if ($pm->getVar('to_userid') == $xoopsUser->getVar('uid')) { + if ($pm->getVar('to_userid') == $xoops->user->getVar('uid')) { $pm_handler->delete($pm); } unset($pm); } redirect_header("viewpmsg.php", 1, _PM_DELETED); - exit(); } - include $GLOBALS['xoops']->path('header.php'); - $criteria = new Criteria('to_userid', $xoopsUser->getVar('uid')); + $xoops->header(); + $criteria = new Criteria('to_userid', $xoops->user->getVar('uid')); $criteria->setOrder('DESC'); $pm_arr = $pm_handler->getObjects($criteria); - echo "<h4 class='txtcenter'>" . _PM_PRIVATEMESSAGE . "</h4><br /><a href='userinfo.php?uid=" . $xoopsUser->getVar("uid") . "'>" . _PM_PROFILE . "</a> <span style='font-weight:bold;'>»»</span> " . _PM_INBOX . "<br /><br />"; + echo "<h4 class='txtcenter'>" . _PM_PRIVATEMESSAGE . "</h4><br /><a href='userinfo.php?uid=" . $xoops->user->getVar("uid") . "'>" . _PM_PROFILE . "</a> <span style='font-weight:bold;'>»»</span> " . _PM_INBOX . "<br /><br />"; echo "<form name='prvmsg' method='post' action='viewpmsg.php'>"; echo "<table cellspacing='1' cellpadding='4' class='outer width100 bnone'>\n"; echo "<tr align='center' valign='middle'><th><input name='allbox' id='allbox' onclick='xoopsCheckAll(\"prvmsg\", \"allbox\");' type='checkbox' value='Check All' /></th><th><img class'bnone' src='images/download.gif' alt=''/></th><th> </th><th>" . _PM_FROM . "</th><th>" . _PM_SUBJECT . "</th><th class='txtcenter'>" . _PM_DATE . "</th></tr>\n"; @@ -65,7 +69,7 @@ } else { $display = 1; } - for($i = 0; $i < $total_messages; $i++) { + for ($i = 0; $i < $total_messages; $i++) { $class = ($i % 2 == 0) ? 'even' : 'odd'; echo "<tr class='$class txtleft'><td class='aligntop width2 txtcenter'><input type='checkbox' id='msg_id[]' name='msg_id[]' value='" . $pm_arr[$i]->getVar("msg_id") . "' /></td>\n"; if ($pm_arr[$i]->getVar('read_msg') == 1) { @@ -73,30 +77,29 @@ } else { echo "<td class='aligntop width5 txtcenter'><img src='images/email_notread.png' alt='" . _PM_NOTREAD . "' title='" . _PM_NOTREAD . "' /></td>\n"; } - $iconName=$pm_arr[$i]->getVar("msg_image", "E"); + $iconName = $pm_arr[$i]->getVar("msg_image", "E"); if ($iconName != '') { - echo "<td class='aligntop width5 txtcenter'><img src='images/subject/" . $iconName . "' alt='' /></td>\n"; + echo "<td class='aligntop width5 txtcenter'><img src='images/subject/" . $iconName . "' alt='' /></td>\n"; + } else { + echo "<td class='aligntop width5 txtcenter'></td>\n"; } - else { - echo "<td class='aligntop width5 txtcenter'></td>\n"; - } $postername = XoopsUser::getUnameFromId($pm_arr[$i]->getVar("from_userid")); echo "<td class='alignmiddle width10'>"; // no need to show deleted users if ($postername) { echo "<a href='userinfo.php?uid=" . $pm_arr[$i]->getVar("from_userid") . "' title=''>" . $postername . "</a>"; } else { - echo $xoopsConfig['anonymous']; + echo $xoops->config['anonymous']; } echo "</td>\n"; echo "<td class='alignmiddle'><a href='readpmsg.php?start=" . ($total_messages - $i - 1), "&total_messages=$total_messages'>" . $pm_arr[$i]->getVar("subject") . "</a></td>"; echo "<td class='alignmiddle txtcenter width20'>" . formatTimestamp($pm_arr[$i]->getVar("msg_time")) . "</td></tr>"; } if ($display == 1) { - echo "<tr class='foot txtleft'><td colspan='6' align='left'><input type='button' class='formButton' onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send=1\",\"pmlite\",565,500);' value='" . _PM_SEND . "' /> <input type='submit' class='formButton' name='delete_messages' value='" . _PM_DELETE . "' />" . $GLOBALS['xoopsSecurity']->getTokenHTML() . "</td></tr></table></form>"; + echo "<tr class='foot txtleft'><td colspan='6' align='left'><input type='button' class='formButton' onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send=1\",\"pmlite\",565,500);' value='" . _PM_SEND . "' /> <input type='submit' class='formButton' name='delete_messages' value='" . _PM_DELETE . "' />" . $xoops->security->getTokenHTML() . "</td></tr></table></form>"; } else { echo "<tr class='bg2 txtleft'><td class='txtleft' colspan='6'><input type='button' class='formButton' onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send=1\",\"pmlite\",565,500);' value='" . _PM_SEND . "' /></td></tr></table></form>"; } - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); } ?> \ No newline at end of file Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/xmlrpc.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xmlrpc.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xmlrpc.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -1,65 +0,0 @@ -<?php -/** - * XOOPS XMLRPC - * - * 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. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package core - * @since 2.0.0 - * @version $Id$ - */ - -define('XOOPS_XMLRPC', 1); - -include dirname(__FILE__). DIRECTORY_SEPARATOR . 'mainfile.php'; - -error_reporting(0); - -$GLOBALS['xoopsLogger']->activate(false); - -$response = new XoopsXmlRpcResponse(); -$parser = new XoopsXmlRpcParser(rawurlencode($GLOBALS['HTTP_RAW_POST_DATA'])); -if (!$parser->parse()) { - $response->add(new XoopsXmlRpcFault(102)); -} else { - $module_handler = xoops_gethandler('module'); - $module = $module_handler->getByDirname('news'); - if (!is_object($module)) { - $response->add(new XoopsXmlRpcFault(110)); - } else { - $methods = explode('.', $parser->getMethodName()); - switch ($methods[0]) { - case 'blogger': - break; - case 'metaWeblog': - $rpc_api = new MetaWeblogApi($parser->getParam(), $response, $module); - break; - case 'mt': - $rpc_api = new MovableTypeApi($parser->getParam(), $response, $module); - break; - case 'xoops': - default: - $rpc_api = new XoopsApi($parser->getParam(), $response, $module); - break; - } - $method = $methods[1]; - if (!method_exists($rpc_api, $method)) { - $response->add(new XoopsXmlRpcFault(107)); - } else { - $rpc_api->$method(); - } - } -} -$payload = $response->render(); -header('Server: XOOPS XML-RPC Server'); -header('Content-type: text/xml'); -header('Content-Length: ' . strlen($payload)); -echo $payload; -?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-25 20:39:03
|
Revision: 7962 http://xoops.svn.sourceforge.net/xoops/?rev=7962&view=rev Author: trabis Date: 2011-10-25 20:38:56 +0000 (Tue, 25 Oct 2011) Log Message: ----------- More refactoring ... Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.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/user.php XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php 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-25 20:28:11 UTC (rev 7961) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php 2011-10-25 20:38:56 UTC (rev 7962) @@ -19,7 +19,6 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->preload = XoopsPreload::getInstance(); $xoops->preload->triggerEvent('core.edituser.start'); xoops_loadLanguage('user'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/index.php 2011-10-25 20:28:11 UTC (rev 7961) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/index.php 2011-10-25 20:38:56 UTC (rev 7962) @@ -22,7 +22,6 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->preload = XoopsPreload::getInstance(); $xoops->preload->triggerEvent('core.index.start'); //check if start page is defined Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.php 2011-10-25 20:28:11 UTC (rev 7961) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.php 2011-10-25 20:38:56 UTC (rev 7962) @@ -18,8 +18,6 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); - -$xoops->preload = XoopsPreload::getInstance(); $xoops->preload->triggerEvent('core.lostpass.start'); xoops_loadLanguage('user'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/pmlite.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/pmlite.php 2011-10-25 20:28:11 UTC (rev 7961) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/pmlite.php 2011-10-25 20:38:56 UTC (rev 7962) @@ -18,7 +18,6 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->preload = XoopsPreload::getInstance(); $xoops->preload->triggerEvent('core.pmlite.start'); xoops_loadLanguage('pmsg'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php 2011-10-25 20:28:11 UTC (rev 7961) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php 2011-10-25 20:38:56 UTC (rev 7962) @@ -18,7 +18,6 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->preload = XoopsPreload::getInstance(); $xoops->preload->triggerEvent('core.readpmsg.start'); xoops_loadLanguage('pmsg'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2011-10-25 20:28:11 UTC (rev 7961) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2011-10-25 20:38:56 UTC (rev 7962) @@ -23,7 +23,6 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->preload = XoopsPreload::getInstance(); $xoops->preload->triggerEvent('core.register.start'); xoops_loadLanguage('user'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/user.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/user.php 2011-10-25 20:28:11 UTC (rev 7961) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/user.php 2011-10-25 20:38:56 UTC (rev 7962) @@ -23,7 +23,6 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->preload = XoopsPreload::getInstance(); $xoops->preload->triggerEvent('core.user.start'); xoops_loadLanguage('user'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-25 20:28:11 UTC (rev 7961) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-25 20:38:56 UTC (rev 7962) @@ -21,50 +21,50 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; -$xoopsPreload = XoopsPreload::getInstance(); -$xoopsPreload->triggerEvent('core.userinfo.start'); +$xoops = Xoops::getInstance(); +$xoops->preload->triggerEvent('core.userinfo.start'); + xoops_loadLanguage('user'); -include_once $GLOBALS['xoops']->path('modules/system/constants.php'); +include_once $xoops->path('modules/system/constants.php'); $uid = intval($_GET['uid']); if ($uid <= 0) { redirect_header('index.php', 3, _US_SELECTNG); exit(); } - +/* @var $gperm_handler XoopsGrouppermHandler */ $gperm_handler = xoops_gethandler('groupperm'); -$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; +$groups = $xoops->isUser() ? $xoops->user->getGroups() : XOOPS_GROUP_ANONYMOUS; $isAdmin = $gperm_handler->checkRight('system_admin', XOOPS_SYSTEM_USER, $groups); -if (is_object($xoopsUser)) { - if ($uid == $xoopsUser->getVar('uid')) { +if ($xoops->isUser()) { + if ($uid == $xoops->user->getVar('uid')) { + /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER); - $xoopsOption['template_main'] = 'system_userinfo.html'; - include $GLOBALS['xoops']->path('header.php'); - $xoopsTpl->assign('user_ownpage', true); - $xoopsTpl->assign('lang_editprofile', _US_EDITPROFILE); - $xoopsTpl->assign('lang_avatar', _US_AVATAR); - $xoopsTpl->assign('lang_inbox', _US_INBOX); - $xoopsTpl->assign('lang_logout', _US_LOGOUT); + $xoops->header('system_userinfo.html'); + $xoops->tpl->assign('user_ownpage', true); + $xoops->tpl->assign('lang_editprofile', _US_EDITPROFILE); + $xoops->tpl->assign('lang_avatar', _US_AVATAR); + $xoops->tpl->assign('lang_inbox', _US_INBOX); + $xoops->tpl->assign('lang_logout', _US_LOGOUT); if ($xoopsConfigUser['self_delete'] == 1) { - $xoopsTpl->assign('user_candelete', true); - $xoopsTpl->assign('lang_deleteaccount', _US_DELACCOUNT); + $xoops->tpl->assign('user_candelete', true); + $xoops->tpl->assign('lang_deleteaccount', _US_DELACCOUNT); } else { - $xoopsTpl->assign('user_candelete', false); + $xoops->tpl->assign('user_candelete', false); } - $thisUser = $xoopsUser; + $thisUser = $xoops->user; } else { + /* @var $member_handler XoopsMemberHAndler */ $member_handler = xoops_gethandler('member'); $thisUser = $member_handler->getUser($uid); - if (! is_object($thisUser) || ! $thisUser->isActive()) { + if (!is_object($thisUser) || !$thisUser->isActive()) { redirect_header("index.php", 3, _US_SELECTNG); - exit(); } - $xoopsOption['template_main'] = 'system_userinfo.html'; - include $GLOBALS['xoops']->path('header.php'); - $xoopsTpl->assign('user_ownpage', false); + $xoops->header('system_userinfo.html'); + $xoops->tpl->assign('user_ownpage', false); } } else { $member_handler = xoops_gethandler('member'); @@ -73,92 +73,92 @@ redirect_header("index.php", 3, _US_SELECTNG); exit(); } - $xoopsOption['template_main'] = 'system_userinfo.html'; - include $GLOBALS['xoops']->path('header.php'); - $xoopsTpl->assign('user_ownpage', false); + $xoops->header('system_userinfo.html'); + $xoops->tpl->assign('user_ownpage', false); } $myts = MyTextSanitizer::getInstance(); -if (is_object($xoopsUser) && $isAdmin) { - $xoopsTpl->assign('lang_editprofile', _US_EDITPROFILE); - $xoopsTpl->assign('lang_deleteaccount', _US_DELACCOUNT); - $xoopsTpl->assign('user_uid', $thisUser->getVar('uid')); +if ($xoops->isUser() && $isAdmin) { + $xoops->tpl->assign('lang_editprofile', _US_EDITPROFILE); + $xoops->tpl->assign('lang_deleteaccount', _US_DELACCOUNT); + $xoops->tpl->assign('user_uid', $thisUser->getVar('uid')); } -$xoopsOption['xoops_pagetitle'] = sprintf(_US_ALLABOUT, $thisUser->getVar('uname')); -$xoopsTpl->assign('lang_allaboutuser', sprintf(_US_ALLABOUT, $thisUser->getVar('uname'))); -$xoopsTpl->assign('lang_avatar', _US_AVATAR); +$xoops->tpl->assign('xoops_pagetitle', sprintf(_US_ALLABOUT, $thisUser->getVar('uname'))); +$xoops->tpl->assign('lang_allaboutuser', sprintf(_US_ALLABOUT, $thisUser->getVar('uname'))); +$xoops->tpl->assign('lang_avatar', _US_AVATAR); + $avatar = ""; if ($thisUser->getVar('user_avatar') && "blank.gif" != $thisUser->getVar('user_avatar')) { $avatar = XOOPS_UPLOAD_URL . "/" . $thisUser->getVar('user_avatar'); } -$xoopsTpl->assign('user_avatarurl', $avatar); -$xoopsTpl->assign('lang_realname', _US_REALNAME); -$xoopsTpl->assign('user_realname', $thisUser->getVar('name')); -$xoopsTpl->assign('lang_website', _US_WEBSITE); +$xoops->tpl->assign('user_avatarurl', $avatar); +$xoops->tpl->assign('lang_realname', _US_REALNAME); +$xoops->tpl->assign('user_realname', $thisUser->getVar('name')); +$xoops->tpl->assign('lang_website', _US_WEBSITE); if ($thisUser->getVar('url', 'E') == '') { - $xoopsTpl->assign('user_websiteurl', ''); + $xoops->tpl->assign('user_websiteurl', ''); } else { - $xoopsTpl->assign('user_websiteurl', '<a href="' . $thisUser->getVar('url', 'E') . '" rel="external">' . $thisUser->getVar('url') . '</a>'); + $xoops->tpl->assign('user_websiteurl', '<a href="' . $thisUser->getVar('url', 'E') . '" rel="external">' . $thisUser->getVar('url') . '</a>'); } -$xoopsTpl->assign('lang_email', _US_EMAIL); -$xoopsTpl->assign('lang_privmsg', _US_PM); -$xoopsTpl->assign('lang_icq', _US_ICQ); -$xoopsTpl->assign('user_icq', $thisUser->getVar('user_icq')); -$xoopsTpl->assign('lang_aim', _US_AIM); -$xoopsTpl->assign('user_aim', $thisUser->getVar('user_aim')); -$xoopsTpl->assign('lang_yim', _US_YIM); -$xoopsTpl->assign('user_yim', $thisUser->getVar('user_yim')); -$xoopsTpl->assign('lang_msnm', _US_MSNM); -$xoopsTpl->assign('user_msnm', $thisUser->getVar('user_msnm')); -$xoopsTpl->assign('lang_location', _US_LOCATION); -$xoopsTpl->assign('user_location', $thisUser->getVar('user_from')); -$xoopsTpl->assign('lang_occupation', _US_OCCUPATION); -$xoopsTpl->assign('user_occupation', $thisUser->getVar('user_occ')); -$xoopsTpl->assign('lang_interest', _US_INTEREST); -$xoopsTpl->assign('user_interest', $thisUser->getVar('user_intrest')); -$xoopsTpl->assign('lang_extrainfo', _US_EXTRAINFO); +$xoops->tpl->assign('lang_email', _US_EMAIL); +$xoops->tpl->assign('lang_privmsg', _US_PM); +$xoops->tpl->assign('lang_icq', _US_ICQ); +$xoops->tpl->assign('user_icq', $thisUser->getVar('user_icq')); +$xoops->tpl->assign('lang_aim', _US_AIM); +$xoops->tpl->assign('user_aim', $thisUser->getVar('user_aim')); +$xoops->tpl->assign('lang_yim', _US_YIM); +$xoops->tpl->assign('user_yim', $thisUser->getVar('user_yim')); +$xoops->tpl->assign('lang_msnm', _US_MSNM); +$xoops->tpl->assign('user_msnm', $thisUser->getVar('user_msnm')); +$xoops->tpl->assign('lang_location', _US_LOCATION); +$xoops->tpl->assign('user_location', $thisUser->getVar('user_from')); +$xoops->tpl->assign('lang_occupation', _US_OCCUPATION); +$xoops->tpl->assign('user_occupation', $thisUser->getVar('user_occ')); +$xoops->tpl->assign('lang_interest', _US_INTEREST); +$xoops->tpl->assign('user_interest', $thisUser->getVar('user_intrest')); +$xoops->tpl->assign('lang_extrainfo', _US_EXTRAINFO); $var = $thisUser->getVar('bio', 'N'); -$xoopsTpl->assign('user_extrainfo', $myts->displayTarea($var, 0, 1, 1)); -$xoopsTpl->assign('lang_statistics', _US_STATISTICS); -$xoopsTpl->assign('lang_membersince', _US_MEMBERSINCE); +$xoops->tpl->assign('user_extrainfo', $myts->displayTarea($var, 0, 1, 1)); +$xoops->tpl->assign('lang_statistics', _US_STATISTICS); +$xoops->tpl->assign('lang_membersince', _US_MEMBERSINCE); $var = $thisUser->getVar('user_regdate'); -$xoopsTpl->assign('user_joindate', formatTimestamp($var, 's')); -$xoopsTpl->assign('lang_rank', _US_RANK); -$xoopsTpl->assign('lang_posts', _US_POSTS); -$xoopsTpl->assign('lang_basicInfo', _US_BASICINFO); -$xoopsTpl->assign('lang_more', _US_MOREABOUT); -$xoopsTpl->assign('lang_myinfo', _US_MYINFO); -$xoopsTpl->assign('user_posts', $thisUser->getVar('posts')); -$xoopsTpl->assign('lang_lastlogin', _US_LASTLOGIN); -$xoopsTpl->assign('lang_notregistered', _US_NOTREGISTERED); -$xoopsTpl->assign('lang_signature', _US_SIGNATURE); +$xoops->tpl->assign('user_joindate', formatTimestamp($var, 's')); +$xoops->tpl->assign('lang_rank', _US_RANK); +$xoops->tpl->assign('lang_posts', _US_POSTS); +$xoops->tpl->assign('lang_basicInfo', _US_BASICINFO); +$xoops->tpl->assign('lang_more', _US_MOREABOUT); +$xoops->tpl->assign('lang_myinfo', _US_MYINFO); +$xoops->tpl->assign('user_posts', $thisUser->getVar('posts')); +$xoops->tpl->assign('lang_lastlogin', _US_LASTLOGIN); +$xoops->tpl->assign('lang_notregistered', _US_NOTREGISTERED); +$xoops->tpl->assign('lang_signature', _US_SIGNATURE); $var = $thisUser->getVar('user_sig', 'N'); -$xoopsTpl->assign('user_signature', $myts->displayTarea($var, 0, 1, 1)); +$xoops->tpl->assign('user_signature', $myts->displayTarea($var, 0, 1, 1)); if ($thisUser->getVar('user_viewemail') == 1) { - $xoopsTpl->assign('user_email', $thisUser->getVar('email', 'E')); + $xoops->tpl->assign('user_email', $thisUser->getVar('email', 'E')); } else { - if (is_object($xoopsUser)) { + if ($xoops->isUser()) { // All admins will be allowed to see emails, even those that are not allowed to edit users (I think it's ok like this) - if ($xoopsUserIsAdmin || ($xoopsUser->getVar("uid") == $thisUser->getVar("uid"))) { - $xoopsTpl->assign('user_email', $thisUser->getVar('email', 'E')); + if ($xoops->userIsAdmin || ($xoops->user->getVar("uid") == $thisUser->getVar("uid"))) { + $xoops->tpl->assign('user_email', $thisUser->getVar('email', 'E')); } else { - $xoopsTpl->assign('user_email', ' '); + $xoops->tpl->assign('user_email', ' '); } } } -if (is_object($xoopsUser)) { - $xoopsTpl->assign('user_pmlink', "<a href=\"javascript:openWithSelfMain('" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $thisUser->getVar('uid') . "', 'pmlite', 450, 380);\"><img src=\"" . XOOPS_URL . "/images/icons/pm.gif\" alt=\"" . sprintf(_SENDPMTO, $thisUser->getVar('uname')) . "\" /></a>"); +if ($xoops->isUser()) { + $xoops->tpl->assign('user_pmlink', "<a href=\"javascript:openWithSelfMain('" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $thisUser->getVar('uid') . "', 'pmlite', 450, 380);\"><img src=\"" . XOOPS_URL . "/images/icons/pm.gif\" alt=\"" . sprintf(_SENDPMTO, $thisUser->getVar('uname')) . "\" /></a>"); } else { - $xoopsTpl->assign('user_pmlink', ''); + $xoops->tpl->assign('user_pmlink', ''); } $userrank = $thisUser->rank(); if (isset($userrank['image']) && $userrank['image']) { - $xoopsTpl->assign('user_rankimage', '<img src="' . XOOPS_UPLOAD_URL . '/' . $userrank['image'] . '" alt="" />'); + $xoops->tpl->assign('user_rankimage', '<img src="' . XOOPS_UPLOAD_URL . '/' . $userrank['image'] . '" alt="" />'); } -$xoopsTpl->assign('user_ranktitle', $userrank['title']); +$xoops->tpl->assign('user_ranktitle', $userrank['title']); $date = $thisUser->getVar("last_login"); -if (! empty($date)) { - $xoopsTpl->assign('user_lastlogin', formatTimestamp($date, "m")); +if (!empty($date)) { + $xoops->tpl->assign('user_lastlogin', formatTimestamp($date, "m")); } $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); @@ -166,18 +166,19 @@ $mids = array_keys($module_handler->getList($criteria)); foreach ($mids as $mid) { if ($gperm_handler->checkRight('module_read', $mid, $groups)) { + /* @var $module XoopsModule */ $module = $module_handler->get($mid); $results = $module->search('', '', 5, 0, $thisUser->getVar('uid')); $count = count($results); if (is_array($results) && $count > 0) { - for($i = 0; $i < $count; $i++) { + for ($i = 0; $i < $count; $i++) { if (isset($results[$i]['image']) && $results[$i]['image'] != '') { $results[$i]['image'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; } else { $results[$i]['image'] = 'images/icons/posticon2.gif'; } - if (! preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { + if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { $results[$i]['link'] = "modules/" . $module->getVar('dirname') . "/" . $results[$i]['link']; } @@ -189,14 +190,12 @@ } else { $showall_link = ''; } - $xoopsTpl->append('modules', array( - 'name' => $module->getVar('name') , - 'results' => $results , - 'showall_link' => $showall_link)); + $xoops->tpl->append('modules', array( + 'name' => $module->getVar('name'), 'results' => $results, 'showall_link' => $showall_link + )); } unset($module); } } -include $GLOBALS['xoops']->path('footer.php'); - +$xoops->footer(); ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php 2011-10-25 20:28:11 UTC (rev 7961) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php 2011-10-25 20:38:56 UTC (rev 7962) @@ -19,7 +19,6 @@ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoops = Xoops::getInstance(); -$xoops->preload = XoopsPreload::getInstance(); $xoops->preload->triggerEvent('core.viewpmsg.start'); xoops_loadLanguage('pmsg'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-25 21:56:29
|
Revision: 7963 http://xoops.svn.sourceforge.net/xoops/?rev=7963&view=rev Author: trabis Date: 2011-10-25 21:56:21 +0000 (Tue, 25 Oct 2011) Log Message: ----------- updating system gui Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoInboxCount.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/rss/xmlrss2parser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/xmltaghandler.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.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/gui.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoInboxCount.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoInboxCount.php 2011-10-25 20:38:56 UTC (rev 7962) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/smarty/xoops_plugins/function.xoInboxCount.php 2011-10-25 21:56:21 UTC (rev 7963) @@ -2,28 +2,27 @@ function smarty_function_xoInboxCount($params, &$smarty) { - global $xoopsUser; + $xoops = Xoops::getInstance(); - if (!isset($xoopsUser) || !is_object($xoopsUser)) { + if (!$xoops->isUser()) { return; } $time = time(); if (isset($_SESSION['xoops_inbox_count']) && @$_SESSION['xoops_inbox_count_expire'] > $time) { $count = intval($_SESSION['xoops_inbox_count']); } else { - $pm_handler =& xoops_gethandler('privmessage'); + $pm_handler = xoops_gethandler('privmessage'); - $xoopsPreload =& XoopsPreload::getInstance(); - $xoopsPreload->triggerEvent('core.class.smarty.xoops_plugins.xoinboxcount', array($pm_handler)); + $xoops->preload->triggerEvent('core.class.smarty.xoops_plugins.xoinboxcount', array($pm_handler)); $criteria = new CriteriaCompo(new Criteria('read_msg', 0)); - $criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid'))); + $criteria->add(new Criteria('to_userid', $xoops->user->getVar('uid'))); $count = intval($pm_handler->getCount($criteria)); $_SESSION['xoops_inbox_count'] = $count; $_SESSION['xoops_inbox_count_expire'] = $time + 60; } - if (!@empty( $params['assign'])) { - $smarty->assign( $params['assign'], $count ); + if (!@empty($params['assign'])) { + $smarty->assign($params['assign'], $count); } else { echo $count; } 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 2011-10-25 20:38:56 UTC (rev 7962) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php 2011-10-25 21:56:21 UTC (rev 7963) @@ -83,7 +83,6 @@ */ public function retrieveBlocks() { - $xoopsPreload = XoopsPreload::getInstance(); $xoops = Xoops::getinstance(); if ($xoops->isModule()) { @@ -118,7 +117,7 @@ /* @var $block_handler XoopsBlockHandler */ $block_handler = xoops_getHandler('block'); $block_arr = $block_handler->getAllByGroupModule($groups, $mid, $isStart, XOOPS_BLOCK_VISIBLE); - $xoopsPreload->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')]; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/rss/xmlrss2parser.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/rss/xmlrss2parser.php 2011-10-25 20:38:56 UTC (rev 7962) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/rss/xmlrss2parser.php 2011-10-25 21:56:21 UTC (rev 7963) @@ -186,7 +186,7 @@ } } -class RssChannelHandler implements XmlTagHandler +class RssChannelHandler extends XmlTagHandler { /** * @return string @@ -223,7 +223,7 @@ } } -class RssTitleHandler implements XmlTagHandler +class RssTitleHandler extends XmlTagHandler { /** * @return string @@ -274,7 +274,7 @@ } } -class RssLinkHandler implements XmlTagHandler +class RssLinkHandler extends XmlTagHandler { /** * @return string @@ -325,7 +325,7 @@ } } -class RssDescriptionHandler implements XmlTagHandler +class RssDescriptionHandler extends XmlTagHandler { /** * @return string @@ -376,7 +376,7 @@ } } -class RssGeneratorHandler implements XmlTagHandler +class RssGeneratorHandler extends XmlTagHandler { /** @@ -422,7 +422,7 @@ } -class RssCopyrightHandler implements XmlTagHandler +class RssCopyrightHandler extends XmlTagHandler { /** * @return string @@ -467,7 +467,7 @@ } -class RssNameHandler implements XmlTagHandler +class RssNameHandler extends XmlTagHandler { /** * @return string @@ -512,7 +512,7 @@ } -class RssManagingEditorHandler implements XmlTagHandler +class RssManagingEditorHandler extends XmlTagHandler { /** @@ -558,7 +558,7 @@ } -class RssLanguageHandler implements XmlTagHandler +class RssLanguageHandler extends XmlTagHandler { /** @@ -604,7 +604,7 @@ } -class RssWebMasterHandler implements XmlTagHandler +class RssWebMasterHandler extends XmlTagHandler { /** * @return string @@ -649,7 +649,7 @@ } -class RssDocsHandler implements XmlTagHandler +class RssDocsHandler extends XmlTagHandler { /** * @return string @@ -694,7 +694,7 @@ } -class RssTtlHandler implements XmlTagHandler +class RssTtlHandler extends XmlTagHandler { /** * @return string @@ -739,7 +739,7 @@ } -class RssTextInputHandler implements XmlTagHandler +class RssTextInputHandler extends XmlTagHandler { /** * @return string @@ -779,7 +779,7 @@ } -class RssLastBuildDateHandler implements XmlTagHandler +class RssLastBuildDateHandler extends XmlTagHandler { /** * @return string @@ -824,7 +824,7 @@ } -class RssImageHandler implements XmlTagHandler +class RssImageHandler extends XmlTagHandler { /** * @return string @@ -862,7 +862,7 @@ } -class RssUrlHandler implements XmlTagHandler +class RssUrlHandler extends XmlTagHandler { /** * @return string @@ -903,7 +903,7 @@ } -class RssWidthHandler implements XmlTagHandler +class RssWidthHandler extends XmlTagHandler { /** * @return string @@ -944,7 +944,7 @@ } -class RssHeightHandler implements XmlTagHandler +class RssHeightHandler extends XmlTagHandler { /** * @return string @@ -985,7 +985,7 @@ } -class RssItemHandler implements XmlTagHandler +class RssItemHandler extends XmlTagHandler { /** * @return string @@ -1026,7 +1026,7 @@ } -class RssCategoryHandler implements XmlTagHandler +class RssCategoryHandler extends XmlTagHandler { /** * @return string @@ -1073,7 +1073,7 @@ } -class RssCommentsHandler implements XmlTagHandler +class RssCommentsHandler extends XmlTagHandler { /** * @return string @@ -1114,7 +1114,7 @@ } -class RssPubDateHandler implements XmlTagHandler +class RssPubDateHandler extends XmlTagHandler { /** * @return string @@ -1162,7 +1162,7 @@ } -class RssGuidHandler implements XmlTagHandler +class RssGuidHandler extends XmlTagHandler { /** * @return string @@ -1203,7 +1203,7 @@ } -class RssAuthorHandler implements XmlTagHandler +class RssAuthorHandler extends XmlTagHandler { /** * @return string @@ -1244,7 +1244,7 @@ } -class RssSourceHandler implements XmlTagHandler +class RssSourceHandler extends XmlTagHandler { /** * @return string Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/xmltaghandler.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/xmltaghandler.php 2011-10-25 20:38:56 UTC (rev 7962) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/xmltaghandler.php 2011-10-25 21:56:21 UTC (rev 7963) @@ -10,13 +10,13 @@ @author Ken Egervari, Remi Michalski<br> *******************************************************************************/ -interface XmlTagHandler +class XmlTagHandler { /** * @abstract * @return void */ - function getName(); + function getName() {} /** * @abstract @@ -24,14 +24,14 @@ * @param array $attributes * @return void */ - function handleBeginElement(SaxParser &$parser, &$attributes); + function handleBeginElement(&$parser, &$attributes) {} /** * @abstract * @param SaxParser $parser * @return void */ - function handleEndElement(SaxParser &$parser); + function handleEndElement(&$parser) {} /** * @abstract @@ -39,7 +39,7 @@ * @param $data * @return void */ - function handleCharacterData(SaxParser &$parser, &$data); + function handleCharacterData(&$parser, &$data) {} } ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2011-10-25 20:38:56 UTC (rev 7962) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2011-10-25 21:56:21 UTC (rev 7963) @@ -155,49 +155,49 @@ static function loadCoreConfig() { return array( - 'bloggerapi' => XOOPS_ROOT_PATH . '/xml/rpc/bloggerapi.php', + 'bloggerapi' => XOOPS_ROOT_PATH . '/class/xml/rpc/bloggerapi.php', 'criteria' => XOOPS_ROOT_PATH . '/class/criteria.php', 'criteriacompo' => XOOPS_ROOT_PATH . '/class/criteria.php', 'criteriaelement' => XOOPS_ROOT_PATH . '/class/criteria.php', 'formdhtmltextarea' => XOOPS_ROOT_PATH . '/class/xoopseditor/dhtmltextarea/dhtmltextarea.php', 'formtextarea' => XOOPS_ROOT_PATH . '/class/xoopseditor/textarea/textarea.php', - 'metaweblogapi' => XOOPS_ROOT_PATH . '/xml/rpc/metaweblogapi.php', - 'movabletypeapi' => XOOPS_ROOT_PATH . '/xml/rpc/movabletypeapi.php', + 'metaweblogapi' => XOOPS_ROOT_PATH . '/class/xml/rpc/metaweblogapi.php', + 'movabletypeapi' => XOOPS_ROOT_PATH . '/class/xml/rpc/movabletypeapi.php', 'mytextsanitizer' => XOOPS_ROOT_PATH . '/class/module.textsanitizer.php', 'mytextsanitizerextension' => XOOPS_ROOT_PATH . '/class/module.textsanitizer.php', 'phpmailer' => XOOPS_ROOT_PATH . '/class/mail/phpmailer/class.phpmailer.php', - 'rssauthorhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsscategoryhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsscommentshandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsscopyrighthandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rssdescriptionhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rssdocshandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rssgeneratorhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rssguidhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rssheighthandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rssimagehandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rssitemhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsslanguagehandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsslastbuilddatehandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsslinkhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rssmanagingeditorhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rssnamehandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsspubdatehandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsssourcehandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsstextinputhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsstitlehandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rssttlhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rssurlhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsswebmasterhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', - 'rsswidthhandler' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', + 'rssauthorhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsscategoryhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsscommentshandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsscopyrighthandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rssdescriptionhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rssdocshandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rssgeneratorhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rssguidhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rssheighthandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rssimagehandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rssitemhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsslanguagehandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsslastbuilddatehandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsslinkhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rssmanagingeditorhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rssnamehandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsspubdatehandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsssourcehandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsstextinputhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsstitlehandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rssttlhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rssurlhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsswebmasterhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', + 'rsswidthhandler' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', 'saxparser' => XOOPS_ROOT_PATH . '/class/xml/saxparser.php', 'smarty' => XOOPS_ROOT_PATH . '/class/smarty/Smarty.class.php', 'snoopy' => XOOPS_ROOT_PATH . '/class/snoopy.php', 'sqlutility' => XOOPS_ROOT_PATH . '/class/database/sqlutility.php', 'tar' => XOOPS_ROOT_PATH . '/class/class.tar.php', - 'xmltaghandler' => XOOPS_ROOT_PATH . '/xml/xmltaghandler.php', + 'xmltaghandler' => XOOPS_ROOT_PATH . '/class/xml/xmltaghandler.php', 'xoops' => XOOPS_ROOT_PATH . '/class/xoops.php', - 'xoopsapi' => XOOPS_ROOT_PATH . '/xml/rpc/xoopsapi.php', + 'xoopsapi' => XOOPS_ROOT_PATH . '/class/xml/rpc/xoopsapi.php', 'xoopsauth' => XOOPS_ROOT_PATH . '/class/auth/auth.php', 'xoopsauthfactory' => XOOPS_ROOT_PATH . '/class/auth/authfactory.php', 'xoopsauthldap' => XOOPS_ROOT_PATH . '/class/auth/auth_ldap.php', @@ -273,22 +273,22 @@ 'xoopsthemeform' => XOOPS_ROOT_PATH . '/class/xoopsform/themeform.php', 'xoopsuserutility' => XOOPS_ROOT_PATH . '/class/userutility.php', 'xoopsutility' => XOOPS_ROOT_PATH . '/class/utility/xoopsutility.php', - 'xoopsxmlrpcapi' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpcapi.php', - 'xoopsxmlrpcarray' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpcbase64'=> XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpcboolean' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpcdatetime' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpcdocument' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpcdouble' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpcfault' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpcint' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpcparser' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpcparser.php', - 'xoopsxmlrpcrequest' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpcresponse' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpcstring' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpcstruct' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrpctag' => XOOPS_ROOT_PATH . 'class/xml/rpc/xmlrpctag.php', - 'xoopsxmlrss2parser' => XOOPS_ROOT_PATH . 'class/xml/rss/xmlrss2parser.php', + 'xoopsxmlrpcapi' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpcapi.php', + 'xoopsxmlrpcarray' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpcbase64'=> XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpcboolean' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpcdatetime' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpcdocument' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpcdouble' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpcfault' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpcint' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpcparser' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpcparser.php', + 'xoopsxmlrpcrequest' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpcresponse' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpcstring' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpcstruct' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrpctag' => XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpctag.php', + 'xoopsxmlrss2parser' => XOOPS_ROOT_PATH . '/class/xml/rss/xmlrss2parser.php', 'xoopszipdownloader' => XOOPS_ROOT_PATH . '/class/zipdownloader.php', 'xos_opal_adminthemefactory' => XOOPS_ROOT_PATH . '/class/theme.php', 'xos_logos_pagebuilder' => XOOPS_ROOT_PATH . '/class/theme_blocks.php', 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-25 20:38:56 UTC (rev 7962) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-25 21:56:21 UTC (rev 7963) @@ -539,9 +539,7 @@ function redirect_header($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false) { $xoops = Xoops::getInstance(); - $xoopsLogger = XoopsLogger::getInstance(); - $xoopsPreload = XoopsPreload::getInstance(); - $xoopsPreload->triggerEvent('core.include.functions.redirectheader', + $xoops->preload->triggerEvent('core.include.functions.redirectheader', array($url, $time, $message, $addredirect, $allowExternalLink)); if (preg_match("/[\\0-\\31]|about:|script:/i", $url)) { @@ -565,24 +563,22 @@ $xoopsThemeFactory = new xos_opal_ThemeFactory(); $xoopsThemeFactory->allowedThemes = $xoops->config['theme_set_allowed']; $xoopsThemeFactory->defaultTheme = $theme; - $xoTheme = $xoopsThemeFactory->createInstance(array("plugins" => array(), "renderBanner" => false)); - $xoopsTpl = $xoTheme->template; - $xoopsTpl->assign(array( + $xoops->theme = $xoopsThemeFactory->createInstance(array("plugins" => array(), "renderBanner" => false)); + $xoops->tpl = $xoops->theme->template; + $xoops->tpl->assign(array( 'xoops_theme' => $theme, 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $theme . '/', 'xoops_themecss' => xoops_getcss($theme), 'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($xoops->config['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($xoops->config['slogan'], ENT_QUOTES), - 'xoops_dirname' => isset($xoops->module) && is_object($xoops->module) ? $xoops->module->getVar('dirname') - : 'system', - 'xoops_pagetitle' => isset($xoops->module) && is_object($xoops->module) ? $xoops->module->getVar('name') - : htmlspecialchars($xoops->config['slogan'], ENT_QUOTES) + 'xoops_dirname' => $xoops->isModule() ? $xoops->module->getVar('dirname') : 'system', + 'xoops_pagetitle' => $xoops->isModule() ? $xoops->module->getVar('name') : htmlspecialchars($xoops->config['slogan'], ENT_QUOTES) )); if ($xoops->config['debug_mode'] == 2 && $xoops->userIsAdmin) { - $xoopsTpl->assign('time', 300); - $xoopsTpl->assign('xoops_logdump', $xoopsLogger->dump()); + $xoops->tpl->assign('time', 300); + $xoops->tpl->assign('xoops_logdump', $xoops->logger->dump()); } else { - $xoopsTpl->assign('time', intval($time)); + $xoops->tpl->assign('time', intval($time)); } if (!empty($_SERVER['REQUEST_URI']) && $addredirect && strstr($url, 'user.php')) { if (!strstr($url, '?')) { @@ -600,12 +596,11 @@ } } $url = preg_replace("/&/i", '&', htmlspecialchars($url, ENT_QUOTES)); - $xoopsTpl->assign('url', $url); + $xoops->tpl->assign('url', $url); $message = trim($message) != '' ? $message : _TAKINGBACK; - $xoopsTpl->assign('message', $message); - $xoopsTpl->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD, $url)); - - $xoopsTpl->display('db:system_redirect.html'); + $xoops->tpl->assign('message', $message); + $xoops->tpl->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD, $url)); + $xoops->tpl->display('db:system_redirect.html'); exit(); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-25 20:38:56 UTC (rev 7962) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-25 21:56:21 UTC (rev 7963) @@ -33,7 +33,7 @@ /** * - * @var string + * @var array */ public $adminmenu; /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2011-10-25 20:38:56 UTC (rev 7962) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2011-10-25 21:56:21 UTC (rev 7963) @@ -150,23 +150,23 @@ function b_system_user_show() { - global $xoopsUser; - if (!is_object($xoopsUser)) { + $xoops = Xoops::getInstance(); + + if (!$xoops->isUser()) { return false; } $block = array(); $block['lang_youraccount'] = _MB_SYSTEM_VACNT; $block['lang_editaccount'] = _MB_SYSTEM_EACNT; $block['lang_notifications'] = _MB_SYSTEM_NOTIF; - $block['uid'] = $xoopsUser->getVar('uid'); + $block['uid'] = $xoops->user->getVar('uid'); $block['lang_logout'] = _MB_SYSTEM_LOUT; $criteria = new CriteriaCompo(new Criteria('read_msg', 0)); - $criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid'))); + $criteria->add(new Criteria('to_userid', $xoops->user->getVar('uid'))); $pm_handler = xoops_gethandler('privmessage'); - $xoopsPreload = XoopsPreload::getInstance(); - $xoopsPreload->triggerEvent('system.blocks.system_blocks.usershow', array(&$pm_handler)); + $xoops->preload->triggerEvent('system.blocks.system_blocks.usershow', array(&$pm_handler)); $block['new_messages'] = $pm_handler->getCount($criteria); $block['lang_inbox'] = _MB_SYSTEM_INBOX; Modified: 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/gui.php 2011-10-25 20:38:56 UTC (rev 7962) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/gui.php 2011-10-25 21:56:21 UTC (rev 7963) @@ -39,19 +39,31 @@ */ var $xoTheme; + /** + * @param string $tpl_file + * @return bool + */ + function header($tpl_file = '') + { + static $included = false; + if ($included) { + return false; + } + $included = true; - function header() - { - global $xoops, $xoopsConfig, $xoopsModule, $xoopsUser, $xoopsOption, $xoTheme, $xoopsTpl; + $xoops = Xoops::getInstance(); + if (empty($tpl_file)) { + $tpl_file = $xoops->option['template_main']; + } + $xoops->tpl_file = $tpl_file; ob_start(); xoops_loadLanguage('admin', 'system'); xoops_loadLanguage('cpanel', 'system'); xoops_loadLanguage('modinfo', 'system'); - $xoopsLogger = XoopsLogger::getInstance(); - $xoopsLogger->stopTime('Module init'); - $xoopsLogger->startTime('XOOPS output init'); + $xoops->logger->stopTime('Module init'); + $xoops->logger->startTime('XOOPS output init'); if (!headers_sent()) { header('Content-Type:text/html; charset=' . _CHARSET); @@ -62,79 +74,89 @@ header("Pragma: no-cache"); } - if (@$xoopsOption['template_main']) { - if (false === strpos($xoopsOption['template_main'], ':')) { - $xoopsOption['template_main'] = 'db:' . $xoopsOption['template_main']; + if ($xoops->tpl_file) { + if (false === strpos($xoops->tpl_file, ':')) { + $xoops->tpl_file = 'db:' . $xoops->tpl_file; } } + // for legacy support when template is sset after header. + $xoops->option['template_main'] = $xoops->tpl_file; + $adminThemeFactory = new xos_opal_AdminThemeFactory(); - $this->xoTheme = $adminThemeFactory->createInstance(array( + $xoops->theme = $adminThemeFactory->createInstance(array( 'folderName' => $this->foldername, 'themesPath' => 'modules/system/themes', - 'contentTemplate' => @$xoopsOption['template_main'])); + 'contentTemplate' => $xoops->tpl_file)); - $this->xoTheme->loadLocalization('admin'); - $this->template = $this->xoTheme->template; + $xoops->theme->loadLocalization('admin'); + $xoops->tpl = $xoops->theme->template; - $GLOBALS['xoTheme'] = $this->xoTheme; - $GLOBALS['adminTpl'] = $this->xoTheme->template; + //for legacy + $this->xoTheme = $xoops->theme; + $this->template = $xoops->tpl; - $xoopsLogger->stopTime('XOOPS output init'); - $xoopsLogger->startTime('Module display'); - $xoopsPreload = XoopsPreload::getInstance(); - $xoopsPreload->triggerEvent('system.class.gui.header'); + $xoops->logger->stopTime('XOOPS output init'); + $xoops->logger->startTime('Module display'); - if ( isset($xoopsModule) && $xoopsModule->getVar('dirname') == 'system' ) { - $xoopsModule->loadAdminMenu(); + $xoops->preload->triggerEvent('system.class.gui.header'); - foreach (array_keys($xoopsModule->adminmenu) as $item) { - $sys_menu[$item]['link'] = XOOPS_URL . '/modules/'.$xoopsModule->getVar('dirname').'/' . $xoopsModule->adminmenu[$item]['link']; - $GLOBALS['xoopsTpl']->append_by_ref('sys_menu', $sys_menu ); + if ($xoops->isModule() && $xoops->module->getVar('dirname') == 'system' ) { + $xoops->module->loadAdminMenu(); + + foreach (array_keys($xoops->module->adminmenu) as $item) { + $sys_menu[$item]['link'] = XOOPS_URL . '/modules/'.$xoops->module->getVar('dirname').'/' . $xoops->module->adminmenu[$item]['link']; + $xoops->tpl->append_by_ref('sys_menu', $sys_menu); unset($sys_menu); } } // Module adminmenu - if (isset($xoopsModule) && $xoopsModule->getVar('dirname') != 'system') { + if ($xoops->isModule() && $xoops->module->getVar('dirname') != 'system') { - if ($xoopsModule->getInfo('system_menu')) { - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . '/modules/system/css/menu.css'); + if ($xoops->module->getInfo('system_menu')) { + $xoops->theme->addStylesheet(XOOPS_URL . '/modules/system/css/menu.css'); - $xoopsModule->loadAdminMenu(); + $xoops->module->loadAdminMenu(); // Get menu tab handler $menu_handler = xoops_getmodulehandler('menu', 'system'); // Define top navigation - $menu_handler->addMenuTop(XOOPS_URL . "/modules/system/admin.php?fct=preferences&op=showmod&mod=" . $xoopsModule->getVar('mid', 'e'), _AM_SYSTEM_PREF); - $menu_handler->addMenuTop(XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar('dirname', 'e'), _AM_SYSTEM_UPDATE); - $menu_handler->addMenuTop(XOOPS_URL . "/modules/system/admin.php?fct=blocksadmin&op=list&filter=1&selgen=" . $xoopsModule->getVar('mid', 'e') . "&selmod=-2&selgrp=-1&selvis=-1", _AM_SYSTEM_BLOCKS); - $menu_handler->addMenuTop(XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname', 'e') . "/", _AM_SYSTEM_GOTOMODULE); + $menu_handler->addMenuTop(XOOPS_URL . "/modules/system/admin.php?fct=preferences&op=showmod&mod=" . $xoops->module->getVar('mid', 'e'), _AM_SYSTEM_PREF); + $menu_handler->addMenuTop(XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoops->module->getVar('dirname', 'e'), _AM_SYSTEM_UPDATE); + $menu_handler->addMenuTop(XOOPS_URL . "/modules/system/admin.php?fct=blocksadmin&op=list&filter=1&selgen=" . $xoops->module->getVar('mid', 'e') . "&selmod=-2&selgrp=-1&selvis=-1", _AM_SYSTEM_BLOCKS); + $menu_handler->addMenuTop(XOOPS_URL . "/modules/" . $xoops->module->getVar('dirname', 'e') . "/", _AM_SYSTEM_GOTOMODULE); // Define main tab navigation $i=0; $current = $i; - foreach ($xoopsModule->adminmenu as $menu) { + foreach ($xoops->module->adminmenu as $menu) { if ( stripos( $_SERVER['REQUEST_URI'], $menu['link'] ) !== false ) $current = $i; $menu_handler->addMenuTabs( $menu['link'], $menu['title']); $i++; } - if ($xoopsModule->getInfo('help')) { - if ( stripos( $_SERVER['REQUEST_URI'], 'admin/' . $xoopsModule->getInfo('help') ) !== false ) $current = $i; - $menu_handler->addMenuTabs( '../system/help.php?mid=' . $xoopsModule->getVar('mid', 's') . '&' . $xoopsModule->getInfo('help'), _AM_SYSTEM_HELP); + if ($xoops->module->getInfo('help')) { + if ( stripos( $_SERVER['REQUEST_URI'], 'admin/' . $xoops->module->getInfo('help') ) !== false ) $current = $i; + $menu_handler->addMenuTabs( '../system/help.php?mid=' . $xoops->module->getVar('mid', 's') . '&' . $xoops->module->getInfo('help'), _AM_SYSTEM_HELP); } // Display navigation tabs - $GLOBALS['xoopsTpl']->assign('xo_system_menu', $menu_handler->render($current, false)); + $xoops->tpl->assign('xo_system_menu', $menu_handler->render($current, false)); } } + return true; } + /** + * @return bool + */ function footer() { - global $xoopsConfig, $xoopsOption, $xoopsTpl, $xoTheme; + static $included = false; + if ($included) { + return false; + } + $xoops = Xoops::getInstance(); + $xoops->logger->stopTime('Module display'); - $xoopsLogger = XoopsLogger::getInstance(); - $xoopsLogger->stopTime('Module display'); - if (!headers_sent()) { header('Content-Type:text/html; charset='._CHARSET); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); @@ -142,21 +164,19 @@ header('Pragma: no-cache'); } - //@internal: using global $xoTheme dereferences the variable in old versions, this does not - if (!isset($xoTheme)) $xoTheme = $GLOBALS['xoTheme']; - - if (isset($xoopsOption['template_main']) && $xoopsOption['template_main'] != $xoTheme->contentTemplate) { - trigger_error("xoopsOption[template_main] should be defined before call xoops_cp_header function", E_USER_WARNING); - if (false === strpos($xoopsOption['template_main'], ':')) { - $xoTheme->contentTemplate = 'db:' . $xoopsOption['template_main']; + if (isset($xoops->option['template_main']) && $xoops->option['template_main'] != $xoops->theme->contentTemplate) { + trigger_error("xoopsOption[template_main] should be defined before including header.php", E_USER_WARNING); + if (false === strpos($xoops->tpl_file, ':')) { + $xoops->theme->contentTemplate = 'db:' . $xoops->tpl_file; } else { - $xoTheme->contentTemplate = $xoopsOption['template_main']; + $xoops->theme->contentTemplate = $xoops->tpl_file; } } - $xoTheme->render(); - $xoopsLogger->stopTime(); + $xoops->theme->render(); + $xoops->logger->stopTime(); ob_end_flush(); + return true; } static function validate() {} Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php 2011-10-25 20:38:56 UTC (rev 7962) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php 2011-10-25 21:56:21 UTC (rev 7963) @@ -44,10 +44,10 @@ function header() { parent::header(); + $xoops = Xoops::getInstance(); + $tpl = $xoops->tpl; + $xoTheme = $xoops->theme; - global $xoopsConfig, $xoopsUser, $xoopsModule, $xoTheme, $xoopsTpl; - $tpl = $this->template; - $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js'); $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/styleswitch.js'); $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/formenu.js'); @@ -55,10 +55,13 @@ $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/tooltip.js'); $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/tabs.jquery.tools.min.js'); - $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/dark.css', array('title' => 'dark', 'media' => 'screen')); - $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/silver.css', array('title' => 'silver', 'media' => 'screen')); - $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/orange.css', array('title' => 'orange', 'media' => 'screen')); - $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/style.css' ); + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/dark.css', + array('title' => 'dark', 'media' => 'screen')); + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/silver.css', + array('title' => 'silver', 'media' => 'screen')); + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/orange.css', + array('title' => 'orange', 'media' => 'screen')); + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/style.css'); $tpl->assign('lang_cp', _CPHOME); //start system overview @@ -67,20 +70,20 @@ $tpl->assign('lang_mysql_version', mysql_get_server_info()); $tpl->assign('lang_server_api', PHP_SAPI); $tpl->assign('lang_os_name', PHP_OS); - $tpl->assign('safe_mode', ini_get( 'safe_mode' ) ? 'On' : 'Off'); - $tpl->assign('register_globals', ini_get( 'register_globals' ) ? 'On' : 'Off'); - $tpl->assign('magic_quotes_gpc', ini_get( 'magic_quotes_gpc' ) ? 'On' : 'Off'); - $tpl->assign('allow_url_fopen', ini_get( 'allow_url_fopen' ) ? 'On' : 'Off'); - $tpl->assign('fsockopen', function_exists( 'fsockopen' ) ? 'On' : 'Off'); - $tpl->assign('allow_call_time_pass_reference', ini_get( 'allow_call_time_pass_reference' ) ? 'On' : 'Off'); - $tpl->assign('post_max_size', ini_get( 'post_max_size' )); - $tpl->assign('max_input_time', ini_get( 'max_input_time' )); - $tpl->assign('output_buffering', ini_get( 'output_buffering' )); - $tpl->assign('max_execution_time', ini_get( 'max_execution_time' )); - $tpl->assign('memory_limit', ini_get( 'memory_limit' )); - $tpl->assign('file_uploads', ini_get( 'file_uploads' ) ? 'On' : 'Off'); - $tpl->assign('upload_max_filesize', ini_get( 'upload_max_filesize' )); - $tpl->assign('xoops_sitename', $xoopsConfig['sitename']); + $tpl->assign('safe_mode', ini_get('safe_mode') ? 'On' : 'Off'); + $tpl->assign('register_globals', ini_get('register_globals') ? 'On' : 'Off'); + $tpl->assign('magic_quotes_gpc', ini_get('magic_quotes_gpc') ? 'On' : 'Off'); + $tpl->assign('allow_url_fopen', ini_get('allow_url_fopen') ? 'On' : 'Off'); + $tpl->assign('fsockopen', function_exists('fsockopen') ? 'On' : 'Off'); + $tpl->assign('allow_call_time_pass_reference', ini_get('allow_call_time_pass_reference') ? 'On' : 'Off'); + $tpl->assign('post_max_size', ini_get('post_max_size')); + $tpl->assign('max_input_time', ini_get('max_input_time')); + $tpl->assign('output_buffering', ini_get('output_buffering')); + $tpl->assign('max_execution_time', ini_get('max_execution_time')); + $tpl->assign('memory_limit', ini_get('memory_limit')); + $tpl->assign('file_uploads', ini_get('file_uploads') ? 'On' : 'Off'); + $tpl->assign('upload_max_filesize', ini_get('upload_max_filesize')); + $tpl->assign('xoops_sitename', $xoops->config['sitename']); // ADD MENU ***************************************** @@ -101,7 +104,7 @@ //add SYSTEM Menu items include dirname(__FILE__) . '/menu.php'; - if (empty($xoopsModule) || 'system' == $xoopsModule->getVar('dirname', 'n')) { + if (!$xoops->isModule() || 'system' == $xoops->module->getVar('dirname', 'n')) { $modpath = XOOPS_URL . '/admin.php'; $modname = _OXYGEN_SYSOPTIONS; $modid = 1; @@ -109,20 +112,25 @@ $mod_options = $adminmenu; foreach (array_keys($mod_options) as $item) { - $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . '/modules/'.$moddir.'/' . $mod_options[$item]['link'] : $mod_options[$item]['link']; - $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_ADMINTHEME_URL . '/default/' . $mod_options[$item]['icon']; + $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) + ? XOOPS_URL . '/modules/' . $moddir . '/' . $mod_options[$item]['link'] + : $mod_options[$item]['link']; + $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' + : XOOPS_ADMINTHEME_URL . '/default/' . $mod_options[$item]['icon']; unset($mod_options[$item]['icon_small']); } } else { - $moddir = $xoopsModule->getVar('dirname', 'n'); + $moddir = $xoops->module->getVar('dirname', 'n'); $modpath = XOOPS_URL . '/modules/' . $moddir; - $modname = $xoopsModule->getVar('name'); - $modid = $xoopsModule->getVar('mid'); + $modname = $xoops->module->getVar('name'); + $modid = $xoops->module->getVar('mid'); - $mod_options = $xoopsModule->getAdminMenu(); + $mod_options = $xoops->module->getAdminMenu(); foreach (array_keys($mod_options) as $item) { - $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['link'] : $mod_options[$item]['link']; - $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['icon']; + $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) + ? XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['link'] : $mod_options[$item]['link']; + $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' + : XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['icon']; } } @@ -141,91 +149,85 @@ $mods = $module_handler->getObjects($criteria); $menu = array(); + /* @var $moduleperm_handler XoopsGrouppermHandler*/ $moduleperm_handler = xoops_gethandler('groupperm'); foreach ($mods as $mod) { + /* @var $mod XoopsModule */ $rtn = array(); - $modOptions = array(); //add for sub menus - $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups()); + $modOptions = array(); //add for sub menus + $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoops->user->getGroups()); if ($sadmin) { $info = $mod->getInfo(); if (!empty($info['adminindex'])) { - $rtn['link'] = XOOPS_URL . '/modules/'. $mod->getVar('dirname', 'n') . '/' . $info['adminindex']; + $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex']; } else { $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid'); } $rtn['title'] = $mod->name(); $rtn['absolute'] = 1; - $rtn['url'] = XOOPS_URL . '/modules/'. $mod->getVar('dirname', 'n') . '/'; //add for sub menus - $modOptions = $mod->getAdminMenu(); //add for sub menus - $rtn['options'] = $modOptions; //add for sub menus + $rtn['url'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/'; //add for sub menus + $modOptions = $mod->getAdminMenu(); //add for sub menus + $rtn['options'] = $modOptions; //add for sub menus - if (isset($info['icon']) && $info['icon'] != '' ) { + if (isset($info['icon']) && $info['icon'] != '') { $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon']; } $menu[] = $rtn; } } - $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin', - 'text' => _AM_SYSTEM_MODULES, 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu)); + $tpl->append('navitems', array( + 'link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin', 'text' => _AM_SYSTEM_MODULES, + 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu + )); // add preferences menu $menu = array(); $OPT = array(); $OPT[] = array( - 'link' => 'admin.php?fct=preferences&op=show&confcat_id=1', - 'title' => _OXYGEN_GENERAL, - 'absolute' => 1, - 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=1', 'title' => _OXYGEN_GENERAL, + 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png' + ); $OPT[] = array( - 'link' => 'admin.php?fct=preferences&op=show&confcat_id=2', - 'title' => _OXYGEN_USERSETTINGS, - 'absolute' => 1, - 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=2', 'title' => _OXYGEN_USERSETTINGS, + 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png' + ); $OPT[] = array( - 'link' => 'admin.php?fct=preferences&op=show&confcat_id=3', - 'title' => _OXYGEN_METAFOOTER, - 'absolute' => 1, - 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=3', 'title' => _OXYGEN_METAFOOTER, + 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png' + ); $OPT[] = array( - 'link' => 'admin.php?fct=preferences&op=show&confcat_id=4', - 'title' => _OXYGEN_CENSOR, - 'absolute' => 1, - 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=4', 'title' => _OXYGEN_CENSOR, + 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png' + ); $OPT[] = array( - 'link' => 'admin.php?fct=preferences&op=show&confcat_id=5', - 'title' => _OXYGEN_SEARCH, - 'absolute' => 1, - 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=5', 'title' => _OXYGEN_SEARCH, + 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png' + ); $OPT[] = array( - 'link' => 'admin.php?fct=preferences&op=show&confcat_id=6', - 'title' => _OXYGEN_MAILER, - 'absolute' => 1, - 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); - $OPT[] = array( - 'link' => 'admin.php?fct=preferences&op=show&confcat_id=7', - 'title' => _OXYGEN_AUTHENTICATION, - 'absolute' => 1, - 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); - $OPT[] = array( - 'link' => 'admin.php?fct=preferences&op=showmod&mod=1', - 'title' => _OXYGEN_MODULESETTINGS, - 'absolute' => 1, - 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=6', 'title' => _OXYGEN_MAILER, + 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png' + ); + $OPT[] = array( + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=7', 'title' => _OXYGEN_AUTHENTICATION, + 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png' + ); + $OPT[] = array( + 'link' => 'admin.php?fct=preferences&op=showmod&mod=1', 'title' => _OXYGEN_MODULESETTINGS, + 'absolute' => 1, 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png' + ); $menu[] = array( - 'link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences', - 'title' => _OXYGEN_SYSOPTIONS, - 'absolute' => 1, - 'url' => XOOPS_URL . '/modules/system/', - 'options' => $OPT); + 'link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences', 'title' => _OXYGEN_SYSOPTIONS, + 'absolute' => 1, 'url' => XOOPS_URL . '/modules/system/', 'options' => $OPT + ); foreach ($mods as $mod) { $rtn = array(); - $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups()); + $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoops->user->getGroups()); if ($sadmin && ($mod->getVar('hasnotification') || is_array($mod->getInfo('config')) || is_array($mod->getInfo('comments')))) { $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid'); $rtn['title'] = $mod->name(); @@ -234,72 +236,69 @@ $menu[] = $rtn; } } - $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences', 'text' => _OXYGEN_SITEPREF, 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu)); + $tpl->append('navitems', array( + 'link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences', 'text' => _OXYGEN_SITEPREF, + 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu + )); //add OPTIONS/Links Menu Items $menu = array(); $menu[] = array( - 'link' => 'http://sourceforge.net/projects/xoops/', - 'title' => _OXYGEN_XOOPSPROJECT, - 'absolute' => 1); + 'link' => 'http://sourceforge.net/projects/xoops/', 'title' => _OXYGEN_XOOPSPROJECT, 'absolute' => 1 + ); $menu[] = array( - 'link' => 'http://xoops.org', - 'title' => _OXYGEN_WEBSITE, - 'absolute' => 1, - 'icon' => XOOPS_ADMINTHEME_URL . '/default/images/xoops.png'); + 'link' => 'http://xoops.org', 'title' => _OXYGEN_WEBSITE, 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/images/xoops.png' + ); $menu[] = array( - 'link' => 'http://www.xoops.org/modules/repository/', - 'title' => _OXYGEN_XOOPSMODULES, - 'absolute' => 1, - 'icon' => XOOPS_ADMINTHEME_URL . '/default/images/xoops.png'); + 'link' => 'http://www.xoops.org/modules/repository/', 'title' => _OXYGEN_XOOPSMODULES, 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/images/xoops.png' + ); $menu[] = array( - 'link' => 'http://www.xoops.org/modules/extgallery/', - 'title' => _OXYGEN_XOOPSTHEMES, - 'absolute' => 1, - 'icon' => XOOPS_ADMINTHEME_URL . '/default/images/tweb.png'); + 'link' => 'http://www.xoops.org/modules/extgallery/', 'title' => _OXYGEN_XOOPSTHEMES, 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/images/tweb.png' + ); - $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php','text' => _OXYGEN_INTERESTSITES, 'menu' => $menu)); + $tpl->append('navitems', + array('link' => XOOPS_URL . '/admin.php', 'text' => _OXYGEN_INTERESTSITES, 'menu' => $menu)); //add OPTIONS/links for local support - if (file_exists($file = XOOPS_ADMINTHEME_PATH . '/default/language/' . $xoopsConfig['language'] . '/localsupport.php' )) { - $links = include XOOPS_ADMINTHEME_PATH . '/default/language/' . $xoopsConfig['language'] . '/localsupport.php'; - if ( count($links) > 0 ) { - $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php','text' => _OXYGEN_LOCALSUPPORT, 'menu' => $links)); + if (file_exists($file = XOOPS_ADMINTHEME_PATH . '/default/language/' . $xoops->config['language'] . '/localsupport.php')) { + $links = include $file; + if (count($links) > 0) { + $tpl->append('navitems', + array('link' => XOOPS_URL . '/admin.php', 'text' => _OXYGEN_LOCALSUPPORT, 'menu' => $links)); } } - if (is_object($xoopsModule) || !empty($_GET['xoopsorgnews'])) { - if (is_object($xoopsModule) && file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/' . $xoopsModule->getInfo('adminmenu'))) { + if ($xoops->isModule() || !empty($_GET['xoopsorgnews'])) { + if ($xoops->isModule() && file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $xoops->module->getVar('dirname') . '/' . $xoops->module->getInfo('adminmenu'))) { include $file; } return; } - foreach ( $mods as $mod ) { - - - $sadmin = $moduleperm_handler->checkRight ( 'module_admin', $mod->getVar ( 'mid' ), $xoopsUser->getGroups () ); + foreach ($mods as $mod) { + $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoops->user->getGroups()); if ($sadmin) { - $rtn = array (); - $info = $mod->getInfo (); - if (! empty ( $info ['adminindex'] )) { - $rtn ['link'] = XOOPS_URL . '/modules/' . $mod->getVar ( 'dirname', 'n' ) . '/' . $info ['adminindex']; + $rtn = array(); + $info = $mod->getInfo(); + if (!empty ($info ['adminindex'])) { + $rtn ['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['adminindex']; } else { - $rtn ['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar ( 'mid' ); + $rtn ['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid'); } - $rtn ['title'] = $mod->getVar ('name'); + $rtn ['title'] = $mod->getVar('name'); $rtn ['description'] = $mod->getInfo('description'); $rtn ['absolute'] = 1; - if (isset ( $info ['icon_big'] )) { - $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar ( 'dirname', 'n' ) . '/' . $info ['icon_big']; - } elseif (isset ( $info ['image'] )) { - $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar ( 'dirname', 'n' ) . '/' . $info ['image']; + if (isset ($info ['icon_big'])) { + $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['icon_big']; + } elseif (isset ($info ['image'])) { + $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['image']; } - $tpl->append ( 'modules', $rtn ); + $tpl->append('modules', $rtn); } - - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-26 19:29:43
|
Revision: 7978 http://xoops.svn.sourceforge.net/xoops/?rev=7978&view=rev Author: trabis Date: 2011-10-26 19:29:35 +0000 (Wed, 26 Oct 2011) Log Message: ----------- Updating module methods Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_post.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/searchform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php XoopsCore/branches/2.6.x/2.6.0/htdocs/misc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/groupperm.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/maintenance/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/help.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/include/postcheck_functions.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -39,18 +39,17 @@ public function __construct() { - global $xoopsConfig; - + $xoops = Xoops::getInstance(); $this->left_delimiter = '<{'; $this->right_delimiter = '}>'; $this->template_dir = XOOPS_THEME_PATH; $this->cache_dir = XOOPS_VAR_PATH . '/caches/smarty_cache'; $this->compile_dir = XOOPS_VAR_PATH . '/caches/smarty_compile'; - $this->compile_check = ($xoopsConfig['theme_fromfile'] == 1); + $this->compile_check = ($xoops->config['theme_fromfile'] == 1); $this->plugins_dir = array(SMARTY_DIR . '/xoops_plugins', SMARTY_DIR . '/plugins'); - if ($xoopsConfig['debug_mode']) { + if ($xoops->config['debug_mode']) { $this->debugging_ctrl = 'URL'; - if ($xoopsConfig['debug_mode'] == 3) { + if ($xoops->config['debug_mode'] == 3) { $this->debugging = true; } } @@ -200,9 +199,7 @@ $xoopsTpl->caching = 2; for ($i = 0; $i < $count; $i++) { if ($block_arr[$i]->getVar('template') != '') { - $xoopsTpl->clear_cache( - 'db:' . $block_arr[$i]->getVar('template'), 'blk_' . $block_arr[$i]->getVar('bid') - ); + $xoopsTpl->clear_cache(XOOPS_ROOT_PATH . "/modules/" . $block_arr[$i]->getVar('dirname') . "/templates/blocks/" . $block_arr[$i]->getVar('template'), 'blk_' . $block_arr[$i]->getVar('bid')); } } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -23,7 +23,6 @@ $xoops->isModule() or die('Restricted access'); - include_once $xoops->path('include/comment_constants.php'); $op = 'delete'; @@ -42,9 +41,9 @@ if ('system' == $xoops->module->getVar('dirname')) { $comment_handler = xoops_gethandler('comment'); $comment = $comment_handler->get($com_id); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - /* @var $module XoopsModule */ - $module = $module_handler->get($comment->getVar('com_modid')); + $module = $module_handler->getById($comment->getVar('com_modid')); $comment_config = $module->getInfo('comments'); $com_modid = $module->getVar('mid'); $redirect_page = XOOPS_URL . '/modules/system/admin.php?fct=comments&com_modid=' . $com_modid . '&com_itemid'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_post.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_post.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_post.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -32,9 +32,10 @@ } $comment_handler = xoops_gethandler('comment'); $comment = $comment_handler->get($com_id); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); /* @var $module XoopsModule */ - $module = $module_handler->get($comment->getVar('com_modid')); + $module = $module_handler->getById($comment->getVar('com_modid')); $comment_config = $module->getInfo('comments'); $com_modid = $module->getVar('mid'); $redirect_page = XOOPS_URL . '/modules/system/admin.php?fct=comments&com_modid=' . $com_modid . '&com_itemid'; @@ -129,7 +130,7 @@ $noname = isset($noname) ? intval($noname) : 0; $com_text = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['com_text'])); if ($xoops->module->getVar('dirname') != 'system') { - include_once $xoops->path('header.php'); + $xoops->header(); if (!empty($captcha_message)) { xoops_error($captcha_message); } @@ -138,7 +139,7 @@ <tr><td><br />' . $p_comment . '<br /></td></tr> </table>'; include_once $xoops->path('include/comment_form.php'); - include_once $xoops->path('footer.php'); + $xoops->footer(); } else { xoops_cp_header(); echo '<table cellpadding="4" cellspacing="1" width="98%" class="outer"> @@ -297,9 +298,9 @@ $com_rootid = $newcid; if (!$comment_handler->updateByField($comment, 'com_rootid', $com_rootid)) { $comment_handler->delete($comment); - include $xoops->path('header.php'); + $xoops->header(); xoops_error($comment->getHtmlErrors()); - include $xoops->path('footer.php'); + $xoops->footer(); } } // call custom approve function if any @@ -376,10 +377,11 @@ // module). $comment_tags = array(); if ('system' == $xoops->module->getVar('dirname')) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $not_module = $module_handler->get($not_modid); + $not_module = $module_handler->getById($not_modid); } else { - $not_module = $xoopsModule; + $not_module = $xoops->module; } if (!isset($comment_url)) { $com_config = $not_module->getInfo('comments'); @@ -411,9 +413,9 @@ } } else { if (!isset($purge_comment_post_results)) { - include_once $xoops->path('header.php'); + $xoops->header(); xoops_error($comment->getHtmlErrors()); - include_once $xoops->path('footer'); + $xoops->footer(); } else { $comment_post_results = $comment->getErrors(); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -173,8 +173,9 @@ */ function xoops_setActiveModules() { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules_obj = $module_handler->getObjects(new Criteria('isactive', 1)); + $modules_obj = $module_handler->getObjectsArray(new Criteria('isactive', 1)); $modules_active = array(); foreach (array_keys($modules_obj) as $key) { $modules_active[] = $modules_obj[$key]->getVar('dirname'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/notification_functions.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -39,8 +39,9 @@ if (!isset($module_id)) { return false; } + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($module_id); + $module = $module_handler->getById($module_id); if (!empty($module) && $module->getVar('hasnotification') == 1) { /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); @@ -78,8 +79,9 @@ if (!isset($module_id)) { $module = $xoops->module; } else { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($module_id); + $module = $module_handler->getById($module_id); } $not_config = $module->getInfo('notification'); if (empty($category_name)) { @@ -146,8 +148,9 @@ $module_id = !$xoops->isModule() ? $xoops->module->getVar('mid') : 0; $module = $xoops->module; } else { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($module_id); + $module = $module_handler->getById($module_id); } $not_config = $module->getInfo('notification'); /* @var $config_handler XoopsConfigHandler */ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/searchform.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/searchform.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/searchform.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -40,8 +40,9 @@ if (!empty($available_modules)) { $criteria->add(new Criteria('mid', '(' . implode(',', $available_modules) . ')', 'IN')); } + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $mods_checkbox->addOptionArray($module_handler->getList($criteria)); + $mods_checkbox->addOptionArray($module_handler->getNameList($criteria)); } else { foreach ($modules as $mid => $module) { $module_array[$mid] = $module->getVar('name'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/createconfigform.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -126,10 +126,11 @@ case 'startpage': $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); + /* @var $module_handler XoopsModuleHandler */ $module_handler =& xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); - $moduleslist =& $module_handler->getList($criteria, true); + $moduleslist =& $module_handler->getNameList($criteria, true); $moduleslist['--'] = _MD_AM_NONE; $ele->addOptionArray($moduleslist); break; @@ -152,8 +153,9 @@ break; case 'module_cache': + /* @var $module_handler XoopsModuleHandler */ $module_handler =& xoops_gethandler('module'); - $modules =& $module_handler->getObjects(new Criteria('hasmain', 1), true); + $modules =& $module_handler->getObjectsArray(new Criteria('hasmain', 1), true); $currrent_val = $config[$i]->getConfValueForOutput(); $cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK); if (count($modules) > 0) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -72,8 +72,9 @@ } // Get installed modules + /* @var $module_handler XoopsModuleHandler */ $module_handler =& xoops_gethandler('module'); - $installed_mods =& $module_handler->getObjects(); + $installed_mods =& $module_handler->getObjectsArray(); $listed_mods = array(); foreach ($installed_mods as $module) { $listed_mods[] = $module->getVar('dirname'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -471,10 +471,11 @@ $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_BLOCKS_VISIBLE, 'visible', $this->getVar('visible'))); // Visible In $mod_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_VISIBLEIN, 'modules', $modules, 5, true); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); - $module_list = $module_handler->getList($criteria); + $module_list = $module_handler->getNameList($criteria); $module_list[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE; $module_list[0] = _AM_SYSTEM_BLOCKS_ALLPAGES; ksort($module_list); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -453,9 +453,9 @@ * Load a module from the database * * @param int $id ID of the module - * @return XoopsModule|false on fail + * @return XoopsModule|bool on fail */ - function get($id = null, $fields = null) + function getById($id = null) { static $_cachedModule_dirname; static $_cachedModule_mid; @@ -492,7 +492,7 @@ } else { $myts = MyTextSanitizer::getInstance(); $criteria = new Criteria('dirname', $myts->addSlashes($dirname)); - $modules = $this->getObjects($criteria); + $modules = $this->getObjectsArray($criteria); if (count($modules) == 1 && is_object($modules[0])) { $module = $modules[0]; } else { @@ -508,17 +508,18 @@ /** * Write a module to the database * - * @param XoopsModule &$module reference to a {@link XoopsModule} + * @param XoopsModule $module reference to a {@link XoopsModule} + * * @return bool */ - public function insert(XoopsObject $object, $force = true) + public function insertModule(XoopsModule &$module) { - if (!parent::insert($object)) { + if (!parent::insert($module)) { return false; } - $dirname = $object->getvar('dirname'); - $mid = $object->getvar('mid'); + $dirname = $module->getvar('dirname'); + $mid = $module->getvar('mid'); if (!empty($this->_cachedModule_dirname[$dirname])) { unset($this->_cachedModule_dirname[$dirname]); @@ -535,20 +536,20 @@ * @param XoopsModule &$module * @return bool */ - public function delete(XoopsObject $object, $force = false) + public function deleteModule(XoopsModule &$module) { - if (!parent::delete($object)) { + if (!parent::delete($module)) { return false; } // delete admin permissions assigned for this module - $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'module_admin' AND gperm_itemid = %u", $this->db->prefix('group_permission'), $object->getVar('mid')); + $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'module_admin' AND gperm_itemid = %u", $this->db->prefix('group_permission'), $module->getVar('mid')); $this->db->query($sql); // delete read permissions assigned for this module - $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'module_read' AND gperm_itemid = %u", $this->db->prefix('group_permission'), $object->getVar('mid')); + $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'module_read' AND gperm_itemid = %u", $this->db->prefix('group_permission'), $module->getVar('mid')); $this->db->query($sql); - $sql = sprintf("SELECT block_id FROM %s WHERE module_id = %u", $this->db->prefix('block_module_link'), $object->getVar('mid')); + $sql = sprintf("SELECT block_id FROM %s WHERE module_id = %u", $this->db->prefix('block_module_link'), $module->getVar('mid')); if ($result = $this->db->query($sql)) { $block_id_arr = array(); while ($myrow = $this->db->fetchArray($result)) { @@ -558,28 +559,28 @@ // loop through block_id_arr if (isset($block_id_arr)) { foreach ($block_id_arr as $i) { - $sql = sprintf("SELECT block_id FROM %s WHERE module_id != %u AND block_id = %u", $this->db->prefix('block_module_link'), $object->getVar('mid'), $i); + $sql = sprintf("SELECT block_id FROM %s WHERE module_id != %u AND block_id = %u", $this->db->prefix('block_module_link'), $module->getVar('mid'), $i); if ($result2 = $this->db->query($sql)) { if (0 < $this->db->getRowsNum($result2)) { // this block has other entries, so delete the entry for this module - $sql = sprintf("DELETE FROM %s WHERE (module_id = %u) AND (block_id = %u)", $this->db->prefix('block_module_link'), $object->getVar('mid'), $i); + $sql = sprintf("DELETE FROM %s WHERE (module_id = %u) AND (block_id = %u)", $this->db->prefix('block_module_link'), $module->getVar('mid'), $i); $this->db->query($sql); } else { // this block doesnt have other entries, so disable the block and let it show on top page only. otherwise, this block will not display anymore on block admin page! $sql = sprintf("UPDATE %s SET visible = 0 WHERE bid = %u", $this->db->prefix('newblocks'), $i); $this->db->query($sql); - $sql = sprintf("UPDATE %s SET module_id = -1 WHERE module_id = %u", $this->db->prefix('block_module_link'), $object->getVar('mid')); + $sql = sprintf("UPDATE %s SET module_id = -1 WHERE module_id = %u", $this->db->prefix('block_module_link'), $module->getVar('mid')); $this->db->query($sql); } } } } - if (!empty($this->_cachedModule_dirname[$object->getVar('dirname')])) { - unset($this->_cachedModule_dirname[$object->getVar('dirname')]); + if (!empty($this->_cachedModule_dirname[$module->getVar('dirname')])) { + unset($this->_cachedModule_dirname[$module->getVar('dirname')]); } - if (!empty($this->_cachedModule_mid[$object->getVar('mid')])) { - unset($this->_cachedModule_mid[$object->getVar('mid')]); + if (!empty($this->_cachedModule_mid[$module->getVar('mid')])) { + unset($this->_cachedModule_mid[$module->getVar('mid')]); } return true; } @@ -591,7 +592,7 @@ * @param boolean $id_as_key Use the ID as key into the array * @return array */ - public function getObjects(CriteriaElement $criteria = null, $id_as_key = false, $as_object = true) + public function getObjectsArray(CriteriaElement $criteria = null, $id_as_key = false) { $ret = array(); $limit = $start = 0; @@ -627,11 +628,10 @@ * if false, array keys will be module id * @return array */ - function getList(CriteriaElement $criteria = null, $dirname_as_key = false) + function getNameList(CriteriaElement $criteria = null, $dirname_as_key = false) { $ret = array(); - //TODO we could use getAll to save memory(trabis) - $modules = $this->getObjects($criteria, true); + $modules = $this->getObjectsArray($criteria, true); foreach (array_keys($modules) as $i) { if (!$dirname_as_key) { $ret[$i] = $modules[$i]->getVar('name'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/object.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -612,8 +612,9 @@ $class = get_class($this); if (!$modules_active = XoopsCache::read('system_modules_active')) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules_obj = $module_handler->getObjects(new Criteria('isactive', 1)); + $modules_obj = $module_handler->getObjectsArray(new Criteria('isactive', 1)); $modules_active = array(); foreach (array_keys($modules_obj) as $key) { $modules_active[] = $modules_obj[$key]->getVar('dirname'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/misc.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/misc.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/misc.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -181,8 +181,9 @@ $criteria->setStart($start); $onlines = $online_handler->getAll($criteria, null, false, false); $count = count($onlines); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules = $module_handler->getList(new Criteria('isactive', 1)); + $modules = $module_handler->getNameList(new Criteria('isactive', 1)); for ($i = 0; $i < $count; $i++) { if ($onlines[$i]['online_uid'] == 0) { $onlineUsers[$i]['user'] = ''; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/field.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -28,9 +28,9 @@ default: case "list": $fields = $profilefield_handler->getObjects(null, true, false); - + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules = $module_handler->getObjects(null, true); + $modules = $module_handler->getObjectsArray(null, true); $cat_handler = xoops_getmodulehandler('category'); $criteria = new CriteriaCompo(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -176,10 +176,11 @@ // Dynamic user profiles end if ($GLOBALS['xoopsModuleConfig']['profile_search']) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); $criteria->add(new Criteria('isactive', 1) ); - $modules = $module_handler->getObjects($criteria, true); + $modules = $module_handler->getObjectsArray($criteria, true); $mids = array_keys($modules); $myts = MyTextSanitizer::getInstance(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -80,13 +80,14 @@ $xoBreadCrumb->render(); // Initialize module handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $modules = $module_handler->getObjects(null, true); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); // Modules for blocks to be visible in - $display_list = $module_handler->getList($criteria); + $display_list = $module_handler->getNameList($criteria); unset($criteria); // Initialize blocks handler $block_handler = xoops_getHandler('block'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -78,8 +78,9 @@ if ($com_id > 0) { $comment = $comment_handler->get($com_id); if (is_object($comment)) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($comment->getVar('com_modid')); + $module = $module_handler->getById($comment->getVar('com_modid')); $comment_config = $module->getInfo('comments'); header('Location: '.XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$comment_config['pageName'].'?'.$comment_config['itemName'].'='.$comment->getVar('com_itemid').'&com_id='.$comment->getVar('com_id').'&com_rootid='.$comment->getVar('com_rootid').'&com_mode=thread&'.str_replace('&', '&', $comment->getVar('com_exparams')).'#comment'.$comment->getVar('com_id')); exit(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/groupperm.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/groupperm.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/groupperm.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -9,8 +9,9 @@ redirect_header(XOOPS_URL.'/index.php', 1, _NOPERM); exit(); } +/* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); -$module = $module_handler->get($modid); +$module = $module_handler->getById($modid); if (!is_object($module) || !$module->getVar('isactive')) { redirect_header(XOOPS_URL.'/admin.php', 1, _MODULENOEXIST); exit(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/maintenance/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/maintenance/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/maintenance/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -83,10 +83,11 @@ $dump_tray->addElement(new xoopsFormLabel(' '._AM_SYSTEM_MAINTENANCE_DUMP_OR.' ')); $ele = new XoopsFormSelect(' ', 'dump_modules', '', 7, true); - $module_handler = xoops_gethandler('module'); + /* @var $module_handler XoopsModuleHandler */ + $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); - $moduleslist = $module_handler->getList($criteria, true); + $moduleslist = $module_handler->getNameList($criteria, true); $ele->addOptionArray($moduleslist); $dump_tray->addElement($ele); $form_dump->addElement($dump_tray); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -72,11 +72,12 @@ $xoBreadCrumb->addTips( _AM_SYSTEM_MODULES_TIPS ); $xoBreadCrumb->render(); // Get Module Handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(); $criteria->setOrder('weight'); // Get all installed modules - $installed_mods = $module_handler->getObjects( $criteria ); + $installed_mods = $module_handler->getObjectsArray( $criteria ); $listed_mods = array(); $i = 0; $install_mods = array(); @@ -140,9 +141,10 @@ $xoBreadCrumb->addTips( _AM_SYSTEM_MODULES_TIPS ); $xoBreadCrumb->render(); // Get Module Handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); // Get all installed modules - $installed_mods = $module_handler->getObjects(); + $installed_mods = $module_handler->getObjectsArray(); foreach ( $installed_mods as $module ) { $install_mods[] = $module->getInfo('dirname'); } @@ -180,16 +182,17 @@ case 'order': // Get Module Handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); if ( isset($_POST['mod']) ) { $i=1; foreach ($_POST['mod'] as $order) { if( $order > 0 ) { - $module = $module_handler->get($order); + $module = $module_handler->getById($order); //Change order only for visible modules if ($module->getVar('weight') != 0) { $module->setVar('weight', $i); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $error=true; } $i++; @@ -245,15 +248,16 @@ case 'display': // Get module handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $block_handler = xoops_getHandler('block'); $module_id = system_CleanVars ( $_POST, 'mid', 0, 'int' ); if ( $module_id > 0 ) { - $module = $module_handler->get( $module_id ); + $module = $module_handler->getById( $module_id ); $old = $module->getVar('isactive'); // Set value $module->setVar('isactive', !$old ); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $error=true; } $blocks = $block_handler->getByModule($module_id); @@ -269,14 +273,15 @@ case 'display_in_menu': // Get module handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $module_id = system_CleanVars ( $_POST, 'mid', 0, 'int' ); if ( $module_id > 0 ) { - $module = $module_handler->get($module_id); + $module = $module_handler->getById($module_id); $old = $module->getVar('weight'); // Set value $module->setVar('weight', !$old ); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $error=true; } } @@ -491,7 +496,7 @@ $xoBreadCrumb->addLink( _AM_SYSTEM_MODULES_UPDATE ); $xoBreadCrumb->addHelp( system_adminVersion('modulesadmin', 'help') . '#update' ); $xoBreadCrumb->render(); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { echo '<p>Could not update '.$module->getVar('name').'</p>'; echo "<br /><div class='center'><a href='admin.php?fct=modulesadmin'>" . _AM_SYSTEM_MODULES_BTOMADMIN . "</a></div>"; } else { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -42,8 +42,10 @@ $dirname = trim($dirname); $db = $GLOBALS["xoopsDB"]; $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish'); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); if ($module_handler->getCount(new Criteria('dirname', $dirname)) == 0) { + /* @var $module XoopsModule */ $module = $module_handler->create(); $module->loadInfoAsVar($dirname); $module->setVar('weight', 1); @@ -140,7 +142,7 @@ } // if no error, save the module info and blocks info associated with it if ($error == false) { - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $errs[] = "<p>" . sprintf(_AM_SYSTEM_MODULES_INSERT_DATA_FAILD, "<strong>" . $module->getVar('name') . "</strong>"); foreach ($created_tables as $ct) { $db->query("DROP TABLE " . $db->prefix($ct)); @@ -478,6 +480,7 @@ global $xoopsConfig; $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish'); $db = XoopsDatabaseFactory::getDatabaseConnection(); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $module = $module_handler->getByDirname($dirname); include_once XOOPS_ROOT_PATH . '/class/template.php'; @@ -517,7 +520,7 @@ } } - if (false === $module_handler->delete($module)) { + if (false === $module_handler->deleteModule($module)) { $msgs[] = ' <span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_DELETE_ERROR, $module->getVar('name')) . '</span>'; } else { @@ -654,10 +657,11 @@ function xoops_module_activate( $mid ) { // Get module handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); /* @var $block_handler XoopsBlockHandler */ $block_handler = xoops_getHandler('block'); - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); include_once XOOPS_ROOT_PATH . '/class/template.php'; xoops_template_clear_module_cache($module->getVar('mid')); // Display header @@ -665,7 +669,7 @@ $msgs = $msgs + xoops_module_log_header( $module, _AM_SYSTEM_MODULES_ACTIVATE ); // Change value $module->setVar('isactive', 1); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $msgs[] = '<p>' . sprintf( _AM_SYSTEM_MODULES_FAILACT, '<strong>' . $module->getVar('name', 's') . '</strong>') . ' ' . _AM_SYSTEM_MODULES_ERRORSC . '<br />' . $module->getHtmlErrors() . '</p>'; } else { $blocks = $block_handler->getByModule($module->getVar('mid')); @@ -686,8 +690,9 @@ { global $xoopsConfig; // Get module handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); include_once XOOPS_ROOT_PATH . '/class/template.php'; xoops_template_clear_module_cache($mid); // Display header @@ -700,7 +705,7 @@ } elseif ($module->getVar('dirname') == $xoopsConfig['startpage']) { $msgs[] = '<p>' . sprintf(_AM_SYSTEM_MODULES_FAILDEACT, '<strong>' . $module->getVar('name') . '</strong>') . ' ' . _AM_SYSTEM_MODULES_ERRORSC . '<br /> - ' . _AM_SYSTEM_MODULES_STRTNO . '</p>'; } else { - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $msgs[] = '<p>' . sprintf(_AM_SYSTEM_MODULES_FAILDEACT, '<strong>' . $module->getVar('name') . '</strong>') . ' ' . _AM_SYSTEM_MODULES_ERRORSC . '<br />' . $module->getHtmlErrors() . '</p>'; } else { $blocks = $block_handler->getByModule($module->getVar('mid')); @@ -719,11 +724,12 @@ function xoops_module_change($mid, $name) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); $module->setVar('name', $name); $myts = MyTextSanitizer::getInstance(); - if (!$module_handler->insert($module)) { + if (!$module_handler->insertModule($module)) { $ret = "<p>" . sprintf(_AM_SYSTEM_MODULES_FAILORDER, "<strong>" . $myts->stripSlashesGPC($name) . "</strong>") . " " . _AM_SYSTEM_MODULES_ERRORSC . "<br />"; $ret .= $module->getHtmlErrors() . "</p>"; return $ret; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -160,10 +160,11 @@ case 'startpage': $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); - $moduleslist = $module_handler->getList($criteria, true); + $moduleslist = $module_handler->getNameList($criteria, true); $moduleslist['--'] = _MD_AM_NONE; $ele->addOptionArray($moduleslist); break; @@ -186,8 +187,9 @@ break; case 'module_cache': + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules = $module_handler->getObjects(new Criteria('hasmain', 1), true); + $modules = $module_handler->getObjectsArray(new Criteria('hasmain', 1), true); $currrent_val = $config[$i]->getConfValueForOutput(); $cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK); if (count($modules) > 0) { @@ -257,8 +259,9 @@ redirect_header('admin.php?fct=preferences', 1); } $form = new XoopsThemeForm(_MD_AM_MODCONFIG, 'pref_form', 'admin.php?fct=preferences', 'post', true); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($mod); + $module = $module_handler->getById($mod); xoops_loadLanguage('modinfo', $module->getVar('dirname')); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/main.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/tplsets/main.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -77,9 +77,10 @@ $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_TEMPLATES_FORCE_GENERATED, 'force_generated', 0, _YES, _NO), true); $modules = new XoopsFormSelect(_AM_SYSTEM_TEMPLATES_SELECT_MODULES, 'select_modules'); - $module_handler = xoops_gethandler('module'); + /* @var $module_handler XoopsModuleHandler */ + $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('isactive', 1)); - $moduleslist = $module_handler->getList($criteria, true); + $moduleslist = $module_handler->getNameList($criteria, true); $modules->addOption(0, _AM_SYSTEM_TEMPLATES_ALL_MODULES); $modules->addOptionArray($moduleslist); $form->addElement($modules, true); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -108,11 +108,12 @@ $block = array(); $block['lang_home'] = _MB_SYSTEM_HOME; $block['lang_close'] = _CLOSE; + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); $criteria->add(new Criteria('weight', 0, '>')); - $modules = $module_handler->getObjects($criteria, true); + $modules = $module_handler->getObjectsArray($criteria, true); $moduleperm_handler = xoops_gethandler('groupperm'); $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; $read_allowed = $moduleperm_handler->getItemIds('module_read', $groups); @@ -396,8 +397,9 @@ $comments = $comment_handler->getObjects($criteria, true); $member_handler = xoops_gethandler('member'); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $modules = $module_handler->getObjects(new Criteria('hascomments', 1), true); + $modules = $module_handler->getObjectsArray(new Criteria('hascomments', 1), true); $comment_config = array(); foreach (array_keys($comments) as $i) { $mid = $comments[$i]->getVar('com_modid'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -102,11 +102,12 @@ $a_mod_checkbox = new XoopsFormCheckBox( '', "admin_mids[]", $a_mod_value); $a_mod_checkbox->columns = 5; + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hasadmin', 1)); $criteria->add(new Criteria('isactive', 1)); $criteria->add(new Criteria('dirname', 'system', '<>')); - $a_mod_checkbox->addOptionArray($module_handler->getList($criteria)); + $a_mod_checkbox->addOptionArray($module_handler->getNameList($criteria)); $admin_mids->addElement($a_mod_checkbox); $read_mids = new XoopsFormElementTray( _AM_SYSTEM_GROUPS_ACCESSRIGHTS, '' ); @@ -121,14 +122,14 @@ $r_mod_checkbox->columns = 5; $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); $criteria->add(new Criteria('isactive', 1)); - $r_mod_checkbox->addOptionArray($module_handler->getList($criteria)); + $r_mod_checkbox->addOptionArray($module_handler->getNameList($criteria)); $read_mids->addElement($r_mod_checkbox); $criteria = new CriteriaCompo(new Criteria('isactive', 1)); $criteria->setSort("mid"); $criteria->setOrder("ASC"); - $module_list = $module_handler->getList($criteria); + $module_list = $module_handler->getNameList($criteria); $module_list[0] = _AM_SYSTEM_GROUPS_CUSTOMBLOCK; $block_handler = xoops_getHandler("block"); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/help.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/help.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/help.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -31,8 +31,9 @@ $xoBreadCrumb->addLink( _AM_SYSTEM_HELP, 'help.php' ); if ( $mid > 0 ) { + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); $xoBreadCrumb->addLink( $module->getVar('name'), 'help.php?mid=' . $module->getVar('mid', 's') ); $xoBreadCrumb->addLink( system_adminVersion( $page, 'name' ) ); @@ -97,11 +98,12 @@ } else { $xoBreadCrumb->render(); // Get Module Handler + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(); $criteria->setOrder('weight'); // Get all installed modules - $installed_mods = $module_handler->getObjects( $criteria ); + $installed_mods = $module_handler->getObjectsArray( $criteria ); $listed_mods = array(); $i = 0; $j = 0; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/themes/default/default.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -41,9 +41,9 @@ } - function header() + function header($tpl_file = '') { - parent::header(); + parent::header($tpl_file); $xoops = Xoops::getInstance(); $tpl = $xoops->tpl; $xoTheme = $xoops->theme; @@ -141,12 +141,13 @@ $tpl->assign('moddir', $moddir); // add MODULES Menu items + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(); $criteria->add(new Criteria('hasadmin', 1)); $criteria->add(new Criteria('isactive', 1)); $criteria->setSort('mid'); - $mods = $module_handler->getObjects($criteria); + $mods = $module_handler->getObjectsArray($criteria); $menu = array(); /* @var $moduleperm_handler XoopsGrouppermHandler*/ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/notifications.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -68,6 +68,7 @@ $notifications = $notification_handler->getObjects($criteria); // Generate the info for the template + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); include_once $xoops->path('include/notification_functions.php'); $modules = array(); @@ -82,7 +83,7 @@ $prev_category = -1; $prev_item = -1; /* @var $module XoopsModule */ - $module = $module_handler->get($modid); + $module = $module_handler->getById($modid); $modules[$modid] = array( 'id' => $modid, 'name' => $module->getVar('name'), 'categories' => array() ); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -147,11 +147,12 @@ } switch ($action) { case "results": + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); $criteria->add(new Criteria('isactive', 1)); $criteria->add(new Criteria('mid', "(" . implode(',', $available_modules) . ")", 'IN')); - $modules = $module_handler->getObjects($criteria, true); + $modules = $module_handler->getObjectsArray($criteria, true); $mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array(); if (empty($mids) || !is_array($mids)) { unset($mids); @@ -226,8 +227,9 @@ case "showall": case 'showallbyuser': $xoops->header(); + /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); $results = $module->search($queries, $andor, 20, $start, $uid); $count = count($results); if (is_array($results) && $count > 0) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -160,6 +160,7 @@ if (!empty($date)) { $xoops->tpl->assign('user_lastlogin', formatTimestamp($date, "m")); } +/* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); $criteria->add(new Criteria('isactive', 1)); @@ -167,7 +168,7 @@ foreach ($mids as $mid) { if ($gperm_handler->checkRight('module_read', $mid, $groups)) { /* @var $module XoopsModule */ - $module = $module_handler->get($mid); + $module = $module_handler->getById($mid); $results = $module->search('', '', 5, 0, $thisUser->getVar('uid')); $count = count($results); if (is_array($results) && $count > 0) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/include/postcheck_functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/include/postcheck_functions.php 2011-10-26 13:27:59 UTC (rev 7977) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/include/postcheck_functions.php 2011-10-26 19:29:35 UTC (rev 7978) @@ -7,8 +7,9 @@ // patch for 2.2.x from xoops.org (I know this is not so beautiful...) if( substr( @XOOPS_VERSION , 6 , 3 ) > 2.0 && stristr( @$_SERVER['REQUEST_URI'] , 'modules/system/admin.php?fct=preferences' ) ) { - $module_handler = xoops_gethandler( 'module' ) ; - $module = $module_handler->get( intval( @$_GET['mod'] ) ) ; + /* @var $module_handler XoopsModuleHandler */ + $module_handler = xoops_gethandler( 'module' ) ; + $module = $module_handler->getById( intval( @$_GET['mod'] ) ) ; if( is_object( $module ) ) { $module->getInfo() ; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-26 19:45:15
|
Revision: 7979 http://xoops.svn.sourceforge.net/xoops/?rev=7979&view=rev Author: trabis Date: 2011-10-26 19:45:09 +0000 (Wed, 26 Oct 2011) Log Message: ----------- Moving template functions to functions.php(where functions should be) and updating protector Database::getInstance(); Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.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/xoops_lib/modules/protector/admin/advisory.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/prefix_manager.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/modules/protector/include/postcheck_functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/notification.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/oninstall.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/onuninstall.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/onupdate.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -160,49 +160,4 @@ require_once SMARTY_CORE_DIR . 'core.rm_auto.php'; return smarty_core_rm_auto($_params, $this); } -} - -/** - * function to update compiled template file in templates_c folder - * - * @param string $tpl_id - * @param boolean $clear_old - * @return boolean - */ -function xoops_template_touch($tpl_id, $clear_old = true) -{ - $tplfile_handler = xoops_gethandler('tplfile'); - $tplfile = $tplfile_handler->get($tpl_id); - - if (is_object($tplfile)) { - $file = $tplfile->getVar('tpl_file', 'n'); - $tpl = new XoopsTpl(); - return $tpl->touch('db:' . $file); - } - return false; -} - -/** - * Clear the module cache - * - * @param int $mid Module ID - * @return void - */ -function xoops_template_clear_module_cache($mid) -{ - /* @var $block_handler XoopsBlockHandler */ - $block_handler = xoops_getHandler('block'); - $block_arr = $block_handler->getByModule($mid); - $count = count($block_arr); - if ($count > 0) { - $xoopsTpl = new XoopsTpl(); - $xoopsTpl->caching = 2; - for ($i = 0; $i < $count; $i++) { - if ($block_arr[$i]->getVar('template') != '') { - $xoopsTpl->clear_cache(XOOPS_ROOT_PATH . "/modules/" . $block_arr[$i]->getVar('dirname') . "/templates/blocks/" . $block_arr[$i]->getVar('template'), 'blk_' . $block_arr[$i]->getVar('bid')); - } - } - } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_delete.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -20,7 +20,6 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); $xoops = Xoops::getInstance(); - $xoops->isModule() or die('Restricted access'); include_once $xoops->path('include/comment_constants.php'); @@ -109,10 +108,9 @@ /* @var $comment XoopsComment */ $comment = $comment_handler->get($com_id); if (!$comment_handler->delete($comment)) { - include_once $xoops->path('header.php'); + $xoops->header(); xoops_error(_CM_COMDELETENG . ' (ID: ' . $comment->getVar('com_id') . ')'); - include_once $xoops->path('footer'); - exit(); + $xoops->footer(); } $com_itemid = $comment->getVar('com_itemid'); @@ -185,9 +183,9 @@ } } if (count($errs) > 0) { - include_once $xoops->path('header.php'); + $xoops->header(); xoops_error($errs); - include_once $xoops->path('footer.php'); + $xoops->footer(); exit(); } redirect_header($redirect_page . '=' . $com_itemid . '&com_order=' . $com_order . '&com_mode=' . $com_mode, 1, _CM_COMDELETED); @@ -254,15 +252,15 @@ $comment_config['callback']['update']($com_itemid, $comment_count); } } - include_once $xoops->path('header.php'); + $xoops->header(); xoops_result($msgs); echo '<br /><a href="' . $redirect_page . '=' . $com_itemid . '&com_order=' . $com_order . '&com_mode=' . $com_mode . '">' . _BACK . '</a>'; - include_once $xoops->path('footer.php'); + $xoops->footer(); break; case 'delete': default: - include_once $xoops->path('header.php'); + $xoops->header(); $comment_confirm = array( 'com_id' => $com_id, 'com_mode' => $com_mode, 'com_order' => $com_order, 'op' => array( _CM_DELETEONE => 'delete_one', _CM_DELETEALL => 'delete_all' @@ -272,8 +270,6 @@ $comment_confirm = $comment_confirm + $comment_confirm_extra; } xoops_confirm($comment_confirm, 'comment_delete.php', _CM_DELETESELECT); - include_once $xoops->path('footer.php'); + $xoops->footer(); break; -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -1070,4 +1070,46 @@ } return $domain; } -?> \ No newline at end of file + +/** + * function to update compiled template file in templates_c folder + * + * @param string $tpl_id + * @param boolean $clear_old + * @return boolean + */ +function xoops_template_touch($tpl_id, $clear_old = true) +{ + $tplfile_handler = xoops_gethandler('tplfile'); + $tplfile = $tplfile_handler->get($tpl_id); + + if (is_object($tplfile)) { + $file = $tplfile->getVar('tpl_file', 'n'); + $tpl = new XoopsTpl(); + return $tpl->touch('db:' . $file); + } + return false; +} + +/** + * Clear the module cache + * + * @param int $mid Module ID + * @return void + */ +function xoops_template_clear_module_cache($mid) +{ + /* @var $block_handler XoopsBlockHandler */ + $block_handler = xoops_getHandler('block'); + $block_arr = $block_handler->getByModule($mid); + $count = count($block_arr); + if ($count > 0) { + $xoopsTpl = new XoopsTpl(); + $xoopsTpl->caching = 2; + for ($i = 0; $i < $count; $i++) { + if ($block_arr[$i]->getVar('template') != '') { + $xoopsTpl->clear_cache(XOOPS_ROOT_PATH . "/modules/" . $block_arr[$i]->getVar('dirname') . "/templates/blocks/" . $block_arr[$i]->getVar('template'), 'blk_' . $block_arr[$i]->getVar('bid')); + } + } + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -184,7 +184,6 @@ $newtplid = $tplfile->getVar('tpl_id'); $msgs[] = " " . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_ADD_DATA, "<strong>" . $tpl['file'] . "</strong>") . "(ID: <strong>" . $newtplid . "</strong>)"; // generate compiled file - include_once XOOPS_ROOT_PATH . '/class/template.php'; if (!xoops_template_touch($newtplid)) { $msgs[] = ' <span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_COMPILED_FAILED, "<strong>" . $tpl['file'] . "</strong>") . "</span>"; } else { @@ -194,7 +193,6 @@ unset($tplfile, $tpldata); } } - include_once XOOPS_ROOT_PATH . '/class/template.php'; xoops_template_clear_module_cache($newmid); $blocks = $module->getInfo('blocks'); if ($blocks != false) { @@ -247,7 +245,6 @@ $newtplid = $tplfile->getVar('tpl_id'); $msgs[] = " " . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_ADD_DATA, "<strong>" . $block['template'] . "</strong>") . " (ID: <strong>" . $newtplid . "</strong>)"; // generate compiled file - include_once XOOPS_ROOT_PATH . '/class/template.php'; if (!xoops_template_touch($newtplid)) { $msgs[] = ' <span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_COMPILED_FAILED, "<strong>" . $block['template'] . "</strong>") . "</span>"; @@ -483,7 +480,6 @@ /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $module = $module_handler->getByDirname($dirname); - include_once XOOPS_ROOT_PATH . '/class/template.php'; xoops_template_clear_module_cache($module->getVar('mid')); if ($module->getVar('dirname') == 'system') { return "<p>" . sprintf(_AM_SYSTEM_MODULES_FAILUNINS, "<strong>" . $module->getVar('name') . "</strong>") . " " . _AM_SYSTEM_MODULES_ERRORSC . "<br /> - " . _AM_SYSTEM_MODULES_SYSNO . "</p>"; @@ -662,7 +658,6 @@ /* @var $block_handler XoopsBlockHandler */ $block_handler = xoops_getHandler('block'); $module = $module_handler->getById($mid); - include_once XOOPS_ROOT_PATH . '/class/template.php'; xoops_template_clear_module_cache($module->getVar('mid')); // Display header $msgs[] = '<div id="xo-module-log">'; @@ -693,7 +688,6 @@ /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); $module = $module_handler->getById($mid); - include_once XOOPS_ROOT_PATH . '/class/template.php'; xoops_template_clear_module_cache($mid); // Display header $msgs[] = '<div id="xo-module-log">'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/admin/advisory.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/admin/advisory.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/admin/advisory.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -1,6 +1,6 @@ <?php -$db = Database::getInstance() ; +$db = XoopsDatabaseFactory::getDatabaseConnection(); // beggining of Output xoops_cp_header(); @@ -90,7 +90,7 @@ // patch to databasefactory.php echo "<dl><dt>'databasefactory.php' : " ; -$db = Database::getInstance() ; +$db = XoopsDatabaseFactory::getDatabaseConnection(); if( strtolower( get_class( $db ) ) != 'protectormysqldatabase' ) { echo "<span style='color:red;font-weight:bold;'>"._AM_ADV_DBFACTORYUNPATCHED."</span></dt>\n" ; } else { Modified: 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/index.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/admin/index.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -3,7 +3,7 @@ require_once XOOPS_ROOT_PATH.'/class/pagenav.php' ; require_once dirname(dirname(__FILE__)).'/class/gtickets.php' ; $myts = MyTextSanitizer::getInstance() ; -$db = Database::getInstance() ; +$db = XoopsDatabaseFactory::getDatabaseConnection(); // GET vars $pos = empty( $_GET[ 'pos' ] ) ? 0 : intval( $_GET[ 'pos' ] ) ; @@ -14,7 +14,7 @@ // Protector object require_once dirname(dirname(__FILE__)).'/class/protector.php' ; -$db = Database::getInstance() ; +$db = XoopsDatabaseFactory::getDatabaseConnection(); $protector = Protector::getInstance( $db->conn ) ; $conf = $protector->getConf() ; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/admin/prefix_manager.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/admin/prefix_manager.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/admin/prefix_manager.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -1,7 +1,7 @@ <?php require_once dirname(dirname(__FILE__)).'/class/gtickets.php' ; -$db = Database::getInstance() ; +$db = XoopsDatabaseFactory::getDatabaseConnection(); // COPY TABLES if( ! empty( $_POST['copy'] ) && ! empty( $_POST['old_prefix'] ) ) { Modified: 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/modules/protector/admin.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/admin.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -12,7 +12,6 @@ $mytrustdirpath = dirname( __FILE__ ) ; // environment -require_once XOOPS_ROOT_PATH.'/class/template.php' ; $module_handler = xoops_gethandler( 'module' ) ; $xoopsModule = $module_handler->getByDirname( $mydirname ) ; $config_handler = xoops_gethandler( 'config' ) ; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/include/postcheck_functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/include/postcheck_functions.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/include/postcheck_functions.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -22,7 +22,7 @@ // Protector object require_once dirname(dirname(__FILE__)).'/class/protector.php' ; - $db = Database::getInstance() ; + $db = XoopsDatabaseFactory::getDatabaseConnection(); $protector = Protector::getInstance() ; $protector->setConn( $db->conn ) ; $protector->updateConfFromDb() ; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/notification.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/notification.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/notification.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -21,7 +21,7 @@ { include_once dirname(__FILE__).'/include/common_functions.php' ; - $db = Database::getInstance() ; + $db = XoopsDatabaseFactory::getDatabaseConnection(); $module_handler = xoops_gethandler( 'module' ) ; $module = $module_handler->getByDirname( $mydirname ) ; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/oninstall.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/oninstall.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/oninstall.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -28,7 +28,7 @@ if( ! is_array( $ret ) ) $ret = array() ; } - $db = Database::getInstance() ; + $db = XoopsDatabaseFactory::getDatabaseConnection(); $mid = $module->getVar('mid') ; // TABLES (loading mysql.sql) @@ -94,7 +94,6 @@ $tplid = $tplfile->getVar( 'tpl_id' ) ; $ret[] = 'Template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b> added to the database. (ID: <b>'.$tplid.'</b>)<br />'; // generate compiled file - include_once XOOPS_ROOT_PATH.'/class/template.php' ; if( ! xoops_template_touch( $tplid ) ) { $ret[] = '<span style="color:#ff0000;">ERROR: Failed compiling template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b>.</span><br />'; } else { @@ -105,7 +104,6 @@ } closedir( $handler ) ; } - include_once XOOPS_ROOT_PATH.'/class/template.php' ; xoops_template_clear_module_cache( $mid ) ; return true ; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/onuninstall.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/onuninstall.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/onuninstall.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -28,7 +28,7 @@ if( ! is_array( $ret ) ) $ret = array() ; } - $db = Database::getInstance() ; + $db = XoopsDatabaseFactory::getDatabaseConnection(); $mid = $module->getVar('mid') ; // TABLES (loading mysql.sql) Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/onupdate.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/onupdate.php 2011-10-26 19:29:35 UTC (rev 7978) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/modules/protector/onupdate.php 2011-10-26 19:45:09 UTC (rev 7979) @@ -28,7 +28,7 @@ if( ! is_array( $msgs ) ) $msgs = array() ; } - $db = Database::getInstance() ; + $db = XoopsDatabaseFactory::getDatabaseConnection(); $mid = $module->getVar('mid') ; // TABLES (write here ALTER TABLE etc. if necessary) @@ -78,7 +78,6 @@ $tplid = $tplfile->getVar( 'tpl_id' ) ; $msgs[] = 'Template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b> added to the database. (ID: <b>'.$tplid.'</b>)'; // generate compiled file - include_once XOOPS_ROOT_PATH.'/class/template.php' ; if( ! xoops_template_touch( $tplid ) ) { $msgs[] = '<span style="color:#ff0000;">ERROR: Failed compiling template <b>'.htmlspecialchars($mydirname.'_'.$file).'</b>.</span>'; } else { @@ -89,7 +88,6 @@ } closedir( $handler ) ; } - include_once XOOPS_ROOT_PATH.'/class/template.php' ; xoops_template_clear_module_cache( $mid ) ; return true ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-26 20:11:59
|
Revision: 7980 http://xoops.svn.sourceforge.net/xoops/?rev=7980&view=rev Author: trabis Date: 2011-10-26 20:11:53 +0000 (Wed, 26 Oct 2011) Log Message: ----------- changing some block and privmessage methods names Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/preloads/core.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/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/class/group.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-26 19:45:09 UTC (rev 7979) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-26 20:11:53 UTC (rev 7980) @@ -588,7 +588,7 @@ * @param bool $force * @return mixed */ - public function insert(XoopsBlock &$obj, $force = false) + public function insertBlock(XoopsBlock &$obj, $force = false) { $obj->setVar('last_modified', time()); return parent::insert($obj, $force); @@ -600,7 +600,7 @@ * @param XoopsBlock $obj * @return bool */ - public function delete(XoopsBlock &$obj) + public function deleteBlock(XoopsBlock &$obj) { if (!parent::delete($obj)) { return false; @@ -618,7 +618,7 @@ * @param bool $id_as_key should the blocks' bid be the key for the returned array? * @return array {@link XoopsBlock}s matching the conditions **/ - public function getObjects(CriteriaElement $criteria = null, $id_as_key = false) + public function getDistinctObjects(CriteriaElement $criteria = null, $id_as_key = false) { $ret = array(); $limit = $start = 0; @@ -651,7 +651,7 @@ * @param CriteriaElement|null $criteria conditions to match * @return array array of blocks matching the conditions **/ - public function getList(CriteriaElement $criteria = null) + public function getNameList(CriteriaElement $criteria = null) { $blocks = $this->getObjects($criteria, true); $ret = array(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.php 2011-10-26 19:45:09 UTC (rev 7979) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/privmessage.php 2011-10-26 20:11:53 UTC (rev 7980) @@ -153,45 +153,6 @@ } /** - * Load messages from the database - * - * @param CriteriaElement|null $criteria {@link CriteriaElement} object - * @param bool $id_as_key use ID as key into the array? - * @return array Array of {@link XoopsPrivmessage} objects - **/ - public function getObjects(CriteriaElement $criteria = null, $id_as_key = false) - { - $ret = array(); - $limit = $start = 0; - $sql = 'SELECT * FROM ' . $this->db->prefix('priv_msgs'); - if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { - $sql .= ' ' . $criteria->renderWhere(); - $sort = !in_array($criteria->getSort(), array( - 'msg_id', - 'msg_time', - 'from_userid')) ? 'msg_id' : $criteria->getSort(); - $sql .= ' ORDER BY ' . $sort . ' ' . $criteria->getOrder(); - $limit = $criteria->getLimit(); - $start = $criteria->getStart(); - } - $result = $this->db->query($sql, $limit, $start); - if (!$result) { - return $ret; - } - while ($myrow = $this->db->fetchArray($result)) { - $pm = new XoopsPrivmessage(); - $pm->assignVars($myrow); - if (!$id_as_key) { - $ret[] = $pm; - } else { - $ret[$myrow['msg_id']] = $pm; - } - unset($pm); - } - return $ret; - } - - /** * Mark a message as read * * @param XoopsPrivmessage $pm {@link XoopsPrivmessage} object Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/preloads/core.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/preloads/core.php 2011-10-26 19:45:09 UTC (rev 7979) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/preloads/core.php 2011-10-26 20:11:53 UTC (rev 7980) @@ -28,17 +28,17 @@ */ class ProtectorCorePreload extends XoopsPreloadItem { - function eventCoreIncludeCommonStart($args) + static function eventCoreIncludeCommonStart($args) { include XOOPS_TRUST_PATH . '/modules/protector/include/precheck.inc.php'; } - function eventCoreIncludeCommonEnd($args) + static function eventCoreIncludeCommonEnd($args) { include XOOPS_TRUST_PATH . '/modules/protector/include/postcheck.inc.php'; } - function eventCoreClassDatabaseDatabasefactoryConnection($args) + static function eventCoreClassDatabaseDatabasefactoryConnection($args) { if (defined('XOOPS_DB_ALTERNATIVE') && class_exists(XOOPS_DB_ALTERNATIVE)) { $args[0] = XOOPS_DB_ALTERNATIVE; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php 2011-10-26 19:45:09 UTC (rev 7979) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/blocksadmin/main.php 2011-10-26 20:11:53 UTC (rev 7980) @@ -203,6 +203,7 @@ case 'display': // Initialize blocks handler + /* @var $block_handler XoopsBlockHandler */ $block_handler = xoops_getHandler('block'); // Get variable $block_id = system_CleanVars ( $_POST, 'bid', 0, 'int' ); @@ -210,7 +211,7 @@ if ( $block_id > 0 ) { $block = $block_handler->get( $block_id ); $block->setVar('visible', $visible); - if (!$block_handler->insert( $block )) { + if (!$block_handler->insertBlock( $block )) { $error=true; } } @@ -218,6 +219,7 @@ case 'drag': // Initialize blocks handler + /* @var $block_handler XoopsBlockHandler */ $block_handler = xoops_getHandler('block'); // Get variable $block_id = system_CleanVars ( $_POST, 'bid', 0, 'int' ); @@ -225,7 +227,7 @@ if ( $block_id > 0 ) { $block = $block_handler->get( $block_id ); $block->setVar('side', $side); - if (!$block_handler->insert( $block )) { + if (!$block_handler->insertBlock( $block )) { $error=true; } } @@ -233,6 +235,7 @@ case 'order': // Initialize blocks handler + /* @var $block_handler XoopsBlockHandler */ $block_handler = xoops_getHandler('block'); if ( isset($_POST['blk'] ) ) { $i=0; @@ -240,7 +243,7 @@ if( $order > 0 ) { $block = $block_handler->get($order); $block->setVar('weight', $i); - if (!$block_handler->insert($block)) { + if (!$block_handler->insertBlock($block)) { $error=true; } $i++; @@ -323,7 +326,7 @@ $content = isset($_POST['content_block']) ? $_POST['content_block'] : ''; $block->setVar('content', $content); - if (!$newid = $block_handler->insert( $block )) { + if (!$newid = $block_handler->insertBlock( $block )) { xoops_cp_header(); xoops_error( $block->getHtmlErrors() ); xoops_cp_footer(); @@ -443,12 +446,13 @@ exit(); } // Initialize blocks handler + /* @var $block_handler XoopsBlockHandler */ $block_handler = xoops_getHandler('block'); // Get avatar id $block_id = system_CleanVars ( $_POST, 'bid', 0, 'int' ); if ( $block_id > 0 ) { $block = $block_handler->get( $block_id ); - if ($block_handler->delete($block)) { + if ($block_handler->deleteBlock($block)) { // Delete Group link $blocklinkmodule_handler = xoops_getmodulehandler('blocklinkmodule'); $blocklinkmodule = $blocklinkmodule_handler->getObjects(new CriteriaCompo(new Criteria('block_id', $block_id ))); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php 2011-10-26 19:45:09 UTC (rev 7979) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/main.php 2011-10-26 20:11:53 UTC (rev 7980) @@ -250,6 +250,7 @@ // Get module handler /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); + /* @var $block_handler XoopsBlockHandler */ $block_handler = xoops_getHandler('block'); $module_id = system_CleanVars ( $_POST, 'mid', 0, 'int' ); if ( $module_id > 0 ) { @@ -264,7 +265,7 @@ $bcount = count($blocks); for ($i = 0; $i < $bcount; $i++) { $blocks[$i]->setVar('isactive', !$old); - $block_handler->insert($blocks[$i]); + $block_handler->insertBlock($blocks[$i]); } //Set active modules in cache folder xoops_setActiveModules(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-26 19:45:09 UTC (rev 7979) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-26 20:11:53 UTC (rev 7980) @@ -544,7 +544,7 @@ $bcount = count($block_arr); $msgs[] = _AM_SYSTEM_MODULES_BLOCKS_DELETE; for ($i = 0; $i < $bcount; $i++) { - if (false === $block_handler->delete($block_arr[$i])) { + if (false === $block_handler->deleteBlock($block_arr[$i])) { $msgs[] = ' <span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_BLOCK_DELETE_ERROR, "<strong>" . $block_arr[$i]->getVar('name') . "</strong>") . sprintf(_AM_SYSTEM_MODULES_BLOCK_ID, "<strong>" . $block_arr[$i]->getVar('bid') . "</strong>") . '</span>'; } else { $msgs[] = ' ' . sprintf(_AM_SYSTEM_MODULES_BLOCK_DELETE,"<strong>" . $block_arr[$i]->getVar('name') . "</strong>") . sprintf(_AM_SYSTEM_MODULES_BLOCK_ID, "<strong>" . $block_arr[$i]->getVar('bid') . "</strong>"); @@ -671,7 +671,7 @@ $bcount = count($blocks); for ($i = 0; $i < $bcount; $i++) { $blocks[$i]->setVar('isactive', 1); - $block_handler->insert($blocks[$i]); + $block_handler->insertBlock($blocks[$i]); } $msgs[] = '<p>' . sprintf( _AM_SYSTEM_MODULES_OKACT, '<strong>' . $module->getVar('name', 's') . '</strong>') . '</p></div>'; } @@ -687,6 +687,8 @@ // Get module handler /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); + /* @var $block_handler XoopsBlockHandler */ + $block_handler = xoops_getHandler('block'); $module = $module_handler->getById($mid); xoops_template_clear_module_cache($mid); // Display header @@ -706,7 +708,7 @@ $bcount = count($blocks); for ($i = 0; $i < $bcount; $i++) { $blocks[$i]->setVar('isactive', 0); - $block_handler->insert($blocks[$i]); + $block_handler->insertBlock($blocks[$i]); } $msgs[] = '<p>' . sprintf(_AM_SYSTEM_MODULES_OKDEACT, '<strong>' . $module->getVar('name') . '</strong>') . '</p>'; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php 2011-10-26 19:45:09 UTC (rev 7979) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php 2011-10-26 20:11:53 UTC (rev 7980) @@ -32,7 +32,7 @@ class SystemGroup extends XoopsGroup { - function __constrcut() + function __construct() { parent::__construct(); } @@ -132,8 +132,9 @@ $module_list = $module_handler->getNameList($criteria); $module_list[0] = _AM_SYSTEM_GROUPS_CUSTOMBLOCK; + /* @var $block_handler XoopsBlockHandler */ $block_handler = xoops_getHandler("block"); - $blocks_obj = $block_handler->getObjects(new Criteria("mid", "('" . implode("', '", array_keys($module_list)) . "')", "IN"), true); + $blocks_obj = $block_handler->getDistinctObjects(new Criteria("mid", "('" . implode("', '", array_keys($module_list)) . "')", "IN"), true); $blocks_module = array(); foreach (array_keys($blocks_obj) as $bid) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-26 20:44:40
|
Revision: 7981 http://xoops.svn.sourceforge.net/xoops/?rev=7981&view=rev Author: trabis Date: 2011-10-26 20:44:32 +0000 (Wed, 26 Oct 2011) Log Message: ----------- removing unnecessary 'includes' Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/calendarjs.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_reply.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.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/permissions.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/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/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/comments/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/userrank/main.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/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/group.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/xoops_version.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -20,8 +20,6 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -include_once XOOPS_ROOT_PATH . '/kernel/object.php'; - /** * Factory for object handlers * Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -220,9 +220,7 @@ $this->maxHeight = intval($maxHeight); } - if (!include_once $xoops->path('language/' . $xoops->config['language'] . '/uploader.php')) { - include_once $xoops->path('language/english/uploader.php'); - } + xoops_loadLanguage('uploader'); } /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/calendarjs.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/calendarjs.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/calendarjs.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -3,7 +3,7 @@ exit(); } $xoops = Xoops::getInstance(); -include_once XOOPS_ROOT_PATH . '/language/' . $xoops->config['language'] . '/calendar.php'; +xoops_loadLanguage('calendar'); ?> <link rel="stylesheet" type="text/css" media="all" href="<?php echo XOOPS_URL;?>/include/calendar-blue.css"/> <script type="text/javascript" src="<?php echo XOOPS_URL . '/include/calendar.js';?>"></script> 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-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_edit.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -67,9 +67,9 @@ $com_rootid = $comment->getVar('com_rootid'); if ($xoops->module->getVar('dirname') != 'system') { - include $xoops->path('header.php'); + $xoops->header(); include $xoops->path('include/comment_form.php'); - include $xoops->path('footer.php'); + $xoops->footer(); } else { xoops_cp_header(); include $xoops->path('include/comment_form.php'); 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-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_new.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -30,7 +30,7 @@ $com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0; if ($com_itemid > 0) { - include_once $xoops->path('header.php'); + $xoops->header(); if (isset($com_replytitle)) { if (isset($com_replytext)) { echo '<table cellpadding="4" cellspacing="1" width="98%" class="outer"> @@ -75,7 +75,5 @@ $com_text = ''; include_once $xoops->path('include/comment_form.php'); - include_once $xoops->path('footer.php'); -} - -?> \ No newline at end of file + $xoops->footer(); +} \ No newline at end of file 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-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/comment_reply.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -67,11 +67,11 @@ $com_rootid = $comment->getVar('com_rootid'); $com_itemid = $comment->getVar('com_itemid'); -include_once $xoops->path('header.php'); +$xoops->header(); echo '<table cellpadding="4" cellspacing="1" width="98%" class="outer"> <tr><td class="head">' . $comment->getVar('com_title') . '</td></tr> <tr><td><br />' . $r_text . '<br /></td></tr> </table>'; include_once $xoops->path('include/comment_form.php'); -include_once $xoops->path('footer.php'); +$xoops->footer(); ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -279,10 +279,9 @@ unset($url_arr); if (!$xoops->module || !$xoops->module->getVar('isactive')) { - include_once $xoops->path('header.php'); + $xoops->header(); echo '<h4>' . _MODULENOEXIST . '</h4>'; - include_once $xoops->path('footer.php'); - exit(); + $xoops->footer(); } /* @var $moduleperm_handler XoopsGrouppermHandler */ $moduleperm_handler = xoops_gethandler('groupperm'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -104,8 +104,7 @@ } $start = !empty($_GET['start']) ? intval($_GET['start']) : 0; $total_messages = !empty($_GET['total_messages']) ? intval($_GET['total_messages']) : 0; -$xoopsOption['template_main'] = "pm_readpmsg.html"; -include $xoops->path('header.php'); +$xoops->header('pm_readpmsg.html'); if (!is_object($pm)) { if ($_REQUEST['op'] == "out") { @@ -174,5 +173,4 @@ $GLOBALS['xoopsTpl']->assign('next', $start + 1); $GLOBALS['xoopsTpl']->assign('total_messages', $total_messages); -include $GLOBALS['xoops']->path('footer.php'); -?> \ No newline at end of file +$xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -19,14 +19,14 @@ */ include_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'mainfile.php'; +$xoops = Xoops::getInstance(); if (!is_object($GLOBALS['xoopsUser'])) { redirect_header(XOOPS_URL, 3, _NOPERM); exit(); } $xoopsConfig['module_cache'] = 0; //disable caching since the URL will be the same, but content different from one user to another -$xoopsOption['template_main'] = "pm_viewpmsg.html"; -include $GLOBALS['xoops']->path('header.php'); +$xoops->header('pm_viewpmsg.html'); $valid_op_requests = array('out', 'save', 'in'); $_REQUEST['op'] = !empty($_REQUEST['op']) && in_array($_REQUEST['op'], $valid_op_requests) ? $_REQUEST['op'] : 'in' ; @@ -39,7 +39,7 @@ $GLOBALS['xoopsTpl']->assign('errormsg', implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())); } else if (empty($_REQUEST['ok'])) { xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'op' => $_REQUEST['op'], 'msg_id'=> serialize(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE); - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); exit(); } else { $_POST['msg_id'] = unserialize($_REQUEST['msg_id']); @@ -102,8 +102,7 @@ $GLOBALS['xoopsTpl']->assign('errormsg', implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())); } else if (empty($_REQUEST['ok'])) { xoops_confirm(array('ok' => 1, 'empty_messages' => 1, 'op' => $_REQUEST['op']), $_SERVER['REQUEST_URI'], _PM_RUSUREEMPTY); - include $GLOBALS['xoops']->path('footer.php'); - exit(); + $xoops->footer(); } else { if ($_POST['op'] == 'save') { $crit_to = new CriteriaCompo(new Criteria('to_delete', 0)); @@ -225,6 +224,5 @@ $pmform->addElement($empty_button); $pmform->addElement(new XoopsFormHidden('op', $_REQUEST['op'])); $pmform->assign($GLOBALS['xoopsTpl']); - -include $GLOBALS['xoops']->path('footer.php'); +$xoops->footer(); ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/activate.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/activate.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/activate.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -19,10 +19,11 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; +$xoops = Xoops::getInstance(); xoops_loadLanguage('admin'); -include $GLOBALS['xoops']->path('header.php'); +$xoops->header(); if (!empty($_GET['id']) && !empty($_GET['actkey'])) { $id = intval($_GET['id']); $actkey = trim($_GET['actkey']); @@ -57,7 +58,7 @@ $xoopsMailer->setFromEmail($GLOBALS['xoopsConfig']['adminmail']); $xoopsMailer->setFromName($GLOBALS['xoopsConfig']['sitename']); $xoopsMailer->setSubject(sprintf(_US_YOURACCOUNT, $GLOBALS['xoopsConfig']['sitename']) ); - include $GLOBALS['xoops']->path('header.php'); + $xoops->footer(); if (!$xoopsMailer->send()) { printf(_US_ACTVMAILNG, $thisuser->getVar('uname') ); } else { Modified: 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/permissions.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/permissions.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -63,7 +63,6 @@ $opform->display(); $module_id = $GLOBALS['xoopsModule']->getVar('mid'); -include_once $GLOBALS['xoops']->path( '/class/xoopsform/grouppermform.php' ); $form = new XoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc, 'admin/permissions.php', $anonymous); if ( $op == "access" ) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changemail.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changemail.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changemail.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -18,6 +18,7 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; +$xoops = Xoops::getInstance(); xoops_loadLanguage('user'); @@ -28,8 +29,7 @@ redirect_header(XOOPS_URL . "/modules/" . $GLOBALS['xoopsModule']->getVar('dirname', 'n') . "/", 2, _NOPERM); } -$xoopsOption['template_main'] = 'profile_email.html'; -include $GLOBALS['xoops']->path('header.php'); +$xoops->header('profile_email.html'); if (!isset($_POST['submit']) || !isset($_POST['passwd'])) { //show change password form Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changepass.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changepass.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changepass.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -19,13 +19,14 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; +$xoops = Xoops::getInstance(); xoops_loadLanguage('user'); if (!$GLOBALS['xoopsUser']) { redirect_header(XOOPS_URL, 2, _NOPERM); } -$xoopsOption['template_main'] = 'profile_changepass.html'; -include $GLOBALS['xoops']->path('header.php'); +$xoops->header('profile_changepass.html'); + if (!isset($_POST['submit'])) { //show change password form $form = new XoopsThemeForm(_PROFILE_MA_CHANGEPASSWORD, 'form', $_SERVER['REQUEST_URI'], 'post', true); Modified: 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/field.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/field.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -231,11 +231,7 @@ **/ function getOutputValue(&$user, $profile) { - if (file_exists($file = $GLOBALS['xoops']->path('modules/profile/language/' . $GLOBALS['xoopsConfig']['language'] . '/modinfo.php'))) { - include_once $file; - } else { - include_once $GLOBALS['xoops']->path('modules/profile/language/english/modinfo.php'); - } + xoops_loadLanguage('modinfo', 'profile'); $value = in_array($this->getVar('field_name'), $this->getUserVars() ) ? $user->getVar($this->getVar('field_name') ) : $profile->getVar($this->getVar('field_name')); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -19,6 +19,7 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; +$xoops = Xoops::getInstance(); xoops_loadLanguage('user'); // If not a user, redirect @@ -88,8 +89,7 @@ if ($op == 'editprofile') { - $xoopsOption['template_main'] = 'profile_editprofile.html'; - include_once $GLOBALS['xoops']->path('header.php'); + $xoops->header('profile_editprofile.html'); include_once dirname(__FILE__) . '/include/forms.php'; $form = profile_getUserForm($GLOBALS['xoopsUser']); $form->assign($GLOBALS['xoopsTpl']); @@ -101,8 +101,7 @@ } if ($op == 'avatarform') { - $xoopsOption['template_main'] = 'profile_avatar.html'; - include $GLOBALS['xoops']->path('header.php'); + $xoops->header('profile_avatar.html'); $xoBreadcrumbs[] = array('title' => _US_MYAVATAR); $oldavatar = $GLOBALS['xoopsUser']->getVar('user_avatar'); @@ -224,10 +223,9 @@ $GLOBALS['xoopsUser']->setVar('user_avatar', $user_avatar); $member_handler = xoops_gethandler('member'); if (!$member_handler->insertUser($GLOBALS['xoopsUser'])) { - include $GLOBALS['xoops']->path('header.php'); + $xoops->header(); echo $GLOBALS['xoopsUser']->getHtmlErrors(); - include $GLOBALS['xoops']->path('footer.php'); - exit(); + $xoops->footer(); } if ($oldavatar && preg_match("/^cavt/", strtolower(substr($oldavatar,8)))) { $avatars = $avt_handler->getObjects(new Criteria('avatar_file', $oldavatar)); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/footer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/footer.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/footer.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -17,10 +17,8 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ - +$xoops = Xoops::getInstance(); if (count($xoBreadcrumbs) > 1) { - $GLOBALS['xoopsTpl']->assign('xoBreadcrumbs', $xoBreadcrumbs); + $xoops->tpl->assign('xoBreadcrumbs', $xoBreadcrumbs); } - -include $GLOBALS['xoops']->path('footer.php'); -?> \ No newline at end of file +include $xoops->footer(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/index.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/index.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -19,6 +19,7 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; +$xoops = Xoops::getInstance(); xoops_loadLanguage('user'); $op = 'main'; @@ -31,8 +32,7 @@ if ($op == 'main') { if (!$GLOBALS['xoopsUser']) { - $xoopsOption['template_main'] = 'system_userform.html'; - include $GLOBALS['xoops']->path('header.php'); + $xoops->header('system_userform.html'); $GLOBALS['xoopsTpl']->assign('lang_login', _LOGIN); $GLOBALS['xoopsTpl']->assign('lang_username', _USERNAME); if (isset($_GET['xoops_redirect'])) { @@ -49,7 +49,6 @@ $GLOBALS['xoopsTpl']->assign('lang_sendpassword', _US_SENDPASSWORD); $GLOBALS['xoopsTpl']->assign('mailpasswd_token', $GLOBALS['xoopsSecurity']->createToken()); include 'footer.php'; - exit(); } if (!empty($_GET['xoops_redirect']) ) { $redirect = trim($_GET['xoops_redirect']); @@ -112,7 +111,7 @@ } $ok = !isset($_POST['ok']) ? 0 : intval($_POST['ok']); if ($ok != 1) { - include $GLOBALS['xoops']->path('header.php'); + $xoops->header(); xoops_confirm(array('op' => 'delete', 'ok' => 1), 'user.php', _US_SURETODEL . '<br/>' . _US_REMOVEINFO); include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php'; } else { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/lostpass.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/lostpass.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/lostpass.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -61,7 +61,7 @@ // Next step: add the new password to the database $sql = sprintf("UPDATE %s SET pass = '%s' WHERE uid = %u", $GLOBALS['xoopsDB']->prefix("users"), md5($newpass), $user->getVar('uid') ); if (!$GLOBALS['xoopsDB']->queryF($sql)) { - include $GLOBALS['xoops']->path('header.php'); + $xoops->header(); echo _US_MAILPWDNG; include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php'; exit(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/register.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/register.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/register.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -20,6 +20,7 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; +$xoops = Xoops::getInstance(); if ($GLOBALS['xoopsUser']) { header('location: userinfo.php?uid= ' . $GLOBALS['xoopsUser']->getVar('uid')); @@ -65,8 +66,7 @@ $steps[$key]['step_no'] = $key + 1; } -$xoopsOption['template_main'] = 'profile_register.html'; -include $GLOBALS['xoops']->path('header.php'); +$xoops->header('profile_register.html'); $GLOBALS['xoopsTpl']->assign('steps', $steps); $GLOBALS['xoopsTpl']->assign('lang_register_steps', _PROFILE_MA_REGISTER_STEPS); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/search.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/search.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/search.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -19,6 +19,7 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; +$xoops = Xoops::getInstance(); $myts = MyTextSanitizer::getInstance(); $limit_default = 20; @@ -38,8 +39,7 @@ default: case "search": $xoopsOption['cache_group'] = implode('', $groups); - $xoopsOption['template_main'] = "profile_search.html"; - include $GLOBALS['xoops']->path('header.php'); + $xoops->header('profile_search.html'); $xoBreadcrumbs[] = array('title' => _SEARCH); $sortby_arr = array(); @@ -155,8 +155,7 @@ break; case "results": - $xoopsOption['template_main'] = "profile_results.html"; - include_once $GLOBALS['xoops']->path('header.php'); + $xoops->header('profile_results.html'); $GLOBALS['xoopsTpl']->assign('page_title', _PROFILE_MA_RESULTS); $xoBreadcrumbs[] = array('link' => XOOPS_URL . "/modules/" . $GLOBALS['xoopsModule']->getVar('dirname', 'n') . '/search.php', 'title' => _SEARCH); $xoBreadcrumbs[] = array('title' => _PROFILE_MA_RESULTS); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/userinfo.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -19,6 +19,7 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; +$xoops = Xoops::getInstance(); include_once $GLOBALS['xoops']->path('modules/system/constants.php'); $uid = intval($_GET['uid']); @@ -37,8 +38,7 @@ if (is_object($GLOBALS['xoopsUser']) && $uid == $GLOBALS['xoopsUser']->getVar('uid')) { //disable cache $GLOBALS['xoopsConfig']['module_cache'][$GLOBALS['xoopsModule']->getVar('mid')] = 0; - $xoopsOption['template_main'] = 'profile_userinfo.html'; - include $GLOBALS['xoops']->path('header.php'); + $xoops->header('profile_userinfo.html'); $config_handler = xoops_gethandler('config'); $GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER); @@ -106,8 +106,7 @@ //disable cache $GLOBALS['xoopsConfig']['module_cache'][$GLOBALS['xoopsModule']->getVar('mid')] = 0; } - $xoopsOption['template_main'] = 'profile_userinfo.html'; - include $GLOBALS['xoops']->path('header.php'); + $xoops->header('profile_userinfo.html'); $GLOBALS['xoopsTpl']->assign('user_ownpage', false); } Modified: 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/avatars/main.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/avatars/main.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -171,8 +171,6 @@ } $config_handler = xoops_gethandler( 'config' ); $xoopsConfigUser = $config_handler->getConfigsByCat( XOOPS_CONF_USER ); - // Upload class - include_once $GLOBALS['xoops']->path( '/class/uploader.php' ); $uploader = new XoopsMediaUploader( XOOPS_UPLOAD_PATH . '/avatars', array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'), $xoopsConfigUser['avatar_maxsize'], $xoopsConfigUser['avatar_width'], $xoopsConfigUser['avatar_height']); // Get avatar handler Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/comments/main.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -309,7 +309,6 @@ } if ( $comments_count > $comments_limit ) { - include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; $nav = new XoopsPageNav($comments_count, $comments_limit, $comments_start, 'comments_start', 'fct=comments&comments_module='.$comments_module.'&comments_status='.$comments_status); $xoopsTpl->assign( 'nav', $nav->renderNav() ); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -94,7 +94,6 @@ $error = true; } else { $msgs[] = "<p>" . sprintf(_AM_SYSTEM_MODULES_SQL_FOUND, "<strong>{$sql_file_path}</strong>") . "<br />" . _AM_SYSTEM_MODULES_CREATE_TABLES; - include_once XOOPS_ROOT_PATH . '/class/database/sqlutility.php'; $sql_query = fread(fopen($sql_file_path, 'r'), filesize($sql_file_path)); $sql_query = trim($sql_query); SqlUtility::splitMySqlFile($pieces, $sql_query); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -323,23 +323,19 @@ break; case 'group': - include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false); break; case 'group_multi': - include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true); break; // RMV-NOTIFY: added 'user' and 'user_multi' case 'user': - include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false); break; case 'user_multi': - include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true); break; Modified: 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/smilies/main.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/smilies/main.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -152,7 +152,6 @@ $display = ($_POST["display"] == 1) ? "1" : "0"; $obj->setVar("display", $display); - include_once XOOPS_ROOT_PATH . '/class/uploader.php'; $uploader_smilies_img = new XoopsMediaUploader( XOOPS_UPLOAD_PATH . '/smilies', $mimetypes, $upload_size, null, null); if ($uploader_smilies_img->fetchMedia("smile_url")) { Modified: 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/userrank/main.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/userrank/main.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -150,7 +150,6 @@ $verif_rank_special = ($_POST["rank_special"] == 1) ? "1" : "0"; $obj->setVar("rank_special", $verif_rank_special); - include_once XOOPS_ROOT_PATH . '/class/uploader.php'; $uploader_rank_img = new XoopsMediaUploader( XOOPS_UPLOAD_PATH . '/ranks', $mimetypes, $upload_size, null, null); if ($uploader_rank_img->fetchMedia("rank_image")) { Modified: 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/main.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/users/main.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -875,7 +875,6 @@ } if ($users_count > $user_limit) { - include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; $nav = new XoopsPageNav($users_count, $user_limit, $start, 'start', 'fct=users&op=default'.$requete_pagenav); $xoopsTpl->assign( 'nav', $nav->renderNav() ); } Modified: 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/users/users.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/users/users.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -47,8 +47,8 @@ $uid = system_CleanVars($_REQUEST, 'uid', 0); //RMV-NOTIFY - include_once XOOPS_ROOT_PATH. '/language/' . $xoopsConfig['language'] . '/notification.php'; - include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; + xoops_loadLanguage('notification'); + include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; if ( $add_or_edit == true ) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -433,7 +433,7 @@ { global $xoopsConfig, $xoopsUser, $xoopsModule; include_once XOOPS_ROOT_PATH . '/include/notification_functions.php'; - include_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/notification.php'; + xoops_loadLanguage('notification'); // Notification must be enabled, and user must be logged in if (empty($xoopsUser) || !notificationEnabled('block')) { return false; // do not display block Modified: 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/avatar.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/avatar.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -17,8 +17,6 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -include_once $GLOBALS['xoops']->path( '/kernel/avatar.php' ); - /** * System Avatar * Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/group.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -21,8 +21,6 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -include_once XOOPS_ROOT_PATH . '/kernel/group.php'; - /** * System Group * Modified: 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/class/users.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/users.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -16,8 +16,6 @@ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -include_once XOOPS_ROOT_PATH . '/kernel/user.php'; - /** * System Users * Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/xoops_version.php 2011-10-26 20:11:53 UTC (rev 7980) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/xoops_version.php 2011-10-26 20:44:32 UTC (rev 7981) @@ -198,7 +198,6 @@ $modversion['config'][$i]['valuetype'] = 'int'; $modversion['config'][$i]['default'] = 1; $i++; -include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; $icons = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/modules/system/images/icons'); $modversion['config'][$i]['name'] = 'typeicons'; $modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ICONS'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-27 00:12:56
|
Revision: 7983 http://xoops.svn.sourceforge.net/xoops/?rev=7983&view=rev Author: trabis Date: 2011-10-27 00:12:48 +0000 (Thu, 27 Oct 2011) Log Message: ----------- Moving functions to xoops class and mark them as deprecated. Notice that functions are required on every page and there is no difference in having them inside the main class. Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 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-26 20:47:18 UTC (rev 7982) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-27 00:12:48 UTC (rev 7983) @@ -71,9 +71,9 @@ public $userIsAdmin = false; /** - * @var string + * @var array */ - public $option = ''; + public $option = array(); /** * @var XoopsTpl|null @@ -99,6 +99,32 @@ public $tpl_file = ''; /** + * @var array + */ + private $_kernelHandlers = array(); + + /** + * @var array + */ + private $_moduleHandlers = array(); + + /** + * @var null|array + */ + private $_activeModules = null; + + /** + * @var array + */ + private $_systemConfigs = array(); + + /** + * @var array + */ + private $_moduleConfigs = array(); + + + /** * Actual Xoops OS */ private function __construct() @@ -117,7 +143,7 @@ * @staticvar Xoops * @return Xoops */ - static function getInstance() + static public function getInstance() { static $instance; if (!isset($instance)) { @@ -212,10 +238,10 @@ * Disable gzip compression if PHP is run under CLI mode and needs refactored to work correctly */ if (empty($_SERVER['SERVER_NAME']) || substr(PHP_SAPI, 0, 3) == 'cli') { - xoops_setConfigOption('gzip_compression', 0); + $this->setConfig('gzip_compression', 0); } - if (xoops_getConfigOption('gzip_compression') == 1 && extension_loaded('zlib') && !ini_get('zlib.output_compression')) { + if ($this->getConfig('gzip_compression') == 1 && extension_loaded('zlib') && !ini_get('zlib.output_compression')) { if (@ini_get('zlib.output_compression_level') < 0) { ini_set('zlib.output_compression_level', 6); } @@ -409,6 +435,1069 @@ { return $this->userIsAdmin; } + + + /** + * @param mixed $name + * @param mixed $optional + * @return XoopsObjectHandler|XoopsPersistableObjectHandler|null + */ + public function getHandler($name, $optional = false) + { + $name = strtolower(trim($name)); + $class = ''; + if (!isset($this->_kernelHandlers[$name])) { + if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/kernel/' . $name . '.php')) { + require_once $hnd_file; + } + $class = 'Xoops' . ucfirst($name) . 'Handler'; + if (class_exists($class)) { + $this->_kernelHandlers[$name] = new $class($this->db); + } + } + if (!isset($this->_kernelHandlers[$name])) { + trigger_error('Class <strong>' . $class . '</strong> does not exist<br />Handler Name: ' . $name, $optional + ? E_USER_WARNING : E_USER_ERROR); + } + if (isset($this->_kernelHandlers[$name])) { + return $this->_kernelHandlers[$name]; + } + return false; + } + + /** + * @param string|null $name + * @param string|null $module_dir + * @param bool $optional + * @return bool + */ + public function getModuleHandler($name = null, $module_dir = null, $optional = false) + { + // if $module_dir is not specified + if (!isset($module_dir)) { + // if a module is loaded + if ($this->module instanceof XoopsModule) { + $module_dir = $this->module->getVar('dirname', 'n'); + } else { + trigger_error('No Module is loaded', E_USER_ERROR); + } + } else { + $module_dir = trim($module_dir); + } + $name = (!isset($name)) ? $module_dir : trim($name); + if (!isset($this->_moduleHandlers[$module_dir][$name])) { + if (file_exists($hnd_file = XOOPS_ROOT_PATH . "/modules/{$module_dir}/class/{$name}.php")) { + include_once $hnd_file; + } + $class = ucfirst(strtolower($module_dir)) . ucfirst($name) . 'Handler'; + if (class_exists($class)) { + $this->_moduleHandlers[$module_dir][$name] = new $class($this->db); + } + } + if (!isset($this->_moduleHandlers[$module_dir][$name])) { + trigger_error('Handler does not exist<br />Module: ' . $module_dir . '<br />Name: ' . $name, $optional + ? E_USER_WARNING : E_USER_ERROR); + } + if (isset($this->_moduleHandlers[$module_dir][$name])) { + return $this->_moduleHandlers[$module_dir][$name]; + } + return false; + } + + /** + * XOOPS class loader wrapper + * + * Temporay solution for XOOPS 2.3 + * + * @param string $name Name of class to be loaded + * @param string $type domain of the class, potential values: core - locaded in /class/; framework - located in /Frameworks/; other - module class, located in /modules/[$type]/class/ + * @return boolean + */ + public function load($name, $type = 'core') + { + if (!class_exists('XoopsLoad')) { + require_once XOOPS_ROOT_PATH . '/class/xoopsload.php'; + } + return XoopsLoad::load($name, $type); + } + + /** + * XOOPS language loader wrapper + * + * Temporay solution, not encouraged to use + * + * @param string $name Name of language file to be loaded, without extension + * @param string $domain Module dirname; global language file will be loaded if $domain is set to 'global' or not specified + * @param string $language Language to be loaded, current language content will be loaded if not specified + * @return boolean + * @todo expand domain to multiple categories, e.g. module:system, framework:filter, etc. + * + */ + public function loadLanguage($name, $domain = '', $language = null) + { + /** + * We must check later for an empty value. As xoops_getOption could be empty + */ + if (empty($name)) { + return false; + } + $language = empty($language) ? $this->config['language'] : $language; + $path = ((empty($domain) || 'global' == $domain) ? '' : "modules/{$domain}/") . 'language'; + if (!file_exists($file = $this->path("{$path}/{$language}/{$name}.php"))) { + if (!file_exists($file = $this->path("{$path}/english/{$name}.php"))) { + return false; + } + } + $ret = include_once $file; + return $ret; + } + + /** + * YOU SHOULD BE CAREFUL WITH USING THIS METHOD SINCE IT WILL BE DEPRECATED + */ + /** + * Get active modules from cache file + * + * @return array + */ + public function getActiveModules() + { + if (is_array($this->_activeModules)) { + return $this->_activeModules; + } + + if (!$this->_activeModules = XoopsCache::read('system_modules_active')) { + $this->_activeModules = $this->_setActiveModules(); + } + return $this->_activeModules; + } + + /** + * YOU SHOULD BE CAREFUL WITH USING THIS METHOD SINCE IT WILL BE DEPRECATED + */ + /** + * Write active modules to cache file + * + * @return array + */ + private function _setActiveModules() + { + /* @var $module_handler XoopsModuleHandler */ + $module_handler = xoops_gethandler('module'); + $modules_active = $module_handler->getAll(new Criteria('isactive', 1), array('dirname'), false, false); + XoopsCache::write('system_modules_active', $modules_active); + return $modules_active; + } + + /** + * Checks is module is installed and active + * + * @param $dirname + * @return bool + */ + public function isActiveModule($dirname) + { + if (isset($dirname) && in_array($dirname, $this->getActiveModules())) { + return true; + } + return false; + } + + /** + * @param bool $closehead + * @return void + */ + public function simpleHeader($closehead = true) + { + /* @var $config_handler XoopsConfigHandler */ + $config_handler = xoops_gethandler('config'); + $xoopsConfigMetaFooter = $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER); + + if (!headers_sent()) { + header('Content-Type:text/html; charset=' . _CHARSET); + header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header('Cache-Control: no-store, no-cache, max-age=1, s-maxage=1, must-revalidate, post-check=0, pre-check=0'); + header("Pragma: no-cache"); + } + + echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n"; + echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . _LANGCODE . '" lang="' . _LANGCODE . '"> + <head> + <meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" /> + <meta http-equiv="content-language" content="' . _LANGCODE . '" /> + <meta name="robots" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_robots']) . '" /> + <meta name="keywords" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_keywords']) . '" /> + <meta name="description" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_desc']) . '" /> + <meta name="rating" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_rating']) . '" /> + <meta name="author" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_author']) . '" /> + <meta name="copyright" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_copyright']) . '" /> + <meta name="generator" content="XOOPS" /> + <title>' . htmlspecialchars($this->config['sitename']) . '</title> + <script type="text/javascript" src="' . XOOPS_URL . '/include/xoops.js"></script>'; + $themecss = $this->getcss($this->config['theme_set']); + echo '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/xoops.css" />'; + $language = $this->getConfig('language'); + if (file_exists($this->path('language/' . $language . '/style.css'))) { + echo '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/language/' . $language . '/style.css" />'; + } + if ($themecss) { + echo '<link rel="stylesheet" type="text/css" media="all" href="' . $themecss . '" />'; + } + if ($closehead) { + echo '</head><body>'; + } + } + + /** + * @return void + */ + public function simpleFooter() + { + echo '</body></html>'; + ob_end_flush(); + } + + /** + * @param mixed $msg + * @param string $title + * @return void + */ + public function error($msg, $title = '') + { + echo '<div class="errorMsg">'; + if ($title != '') { + echo '<strong>' . $title . '</strong><br /><br />'; + } + if (is_object($msg)) { + $msg = (array)$msg; + } + if (is_array($msg)) { + foreach ($msg as $key => $value) { + if (is_numeric($key)) { + $key = ''; + } + $this->error($value, $key); + } + } else { + echo "<div>{$msg}</div>"; + } + echo '</div>'; + } + + /** + * @param mixed $msg + * @param string $title + * @return void + */ + public function result($msg, $title = '') + { + echo '<div class="resultMsg">'; + if ($title != '') { + echo '<strong>' . $title . '</strong><br /><br />'; + } + if (is_object($msg)) { + $msg = (array)$msg; + } + if (is_array($msg)) { + foreach ($msg as $key => $value) { + if (is_numeric($key)) { + $key = ''; + } + $this->result($value, $key); + } + } else { + echo "<div>{$msg}</div>"; + } + echo '</div>'; + } + + /** + * @param mixed $hiddens + * @param mixed $action + * @param mixed $msg + * @param string $submit + * @param bool $addtoken + * @return void + */ + public function confirm($hiddens, $action, $msg, $submit = '', $addtoken = true) + { + $submit = ($submit != '') ? trim($submit) : _SUBMIT; + echo '<div class="confirmMsg">' . $msg . '<br /> + <form method="post" action="' . $action . '">'; + foreach ($hiddens as $name => $value) { + if (is_array($value)) { + foreach ($value as $caption => $newvalue) { + echo '<input type="radio" name="' . $name . '" value="' . htmlspecialchars($newvalue) . '" /> ' . $caption; + } + echo '<br />'; + } else { + echo '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />'; + } + } + if ($addtoken != false) { + echo $this->security->getTokenHTML(); + } + echo '<input type="submit" name="confirm_submit" value="' . $submit . '" title="' . $submit . '"/> + <input type="button" name="confirm_back" value="' . _CANCEL . '" onclick="javascript:history.go(-1);" title="' . _CANCEL . '" /> + </form> + </div>'; + } + + /** + * @param mixed$time + * @param string $timeoffset + * @return int + */ + public function getUserTimestamp($time, $timeoffset = '') + { + if ($timeoffset == '') { + if ($this->isUser()) { + $timeoffset = $this->user->getVar('timezone_offset'); + } else { + $timeoffset = $this->config['default_TZ']; + } + } + $usertimestamp = intval($time) + (floatval($timeoffset) - $this->config['server_TZ']) * 3600; + return $usertimestamp; + } + + /** + * Function to display formatted times in user timezone + * + * @param int $time + * @param string $format + * @param string $timeoffset + * @return string + */ + public function formatTimestamp($time, $format = 'l', $timeoffset = '') + { + return XoopsLocal::formatTimestamp($time, $format, $timeoffset); + } + + /** + * Function to calculate server timestamp from user entered time (timestamp) + * + * @param int $timestamp + * @param null $userTZ + * @return int + */ + public function userTimeToServerTime($timestamp, $userTZ = null) + { + if (!isset($userTZ)) { + $userTZ = $this->config['default_TZ']; + } + $timestamp = $timestamp - (($userTZ - $this->config['server_TZ']) * 3600); + return $timestamp; + } + + /** + * @return string + */ + public function makePass() + { + $makepass = ''; + $syllables = array( + 'er', 'in', 'tia', 'wol', 'fe', 'pre', 'vet', 'jo', 'nes', 'al', 'len', 'son', 'cha', 'ir', 'ler', 'bo', 'ok', + 'tio', 'nar', 'sim', 'ple', 'bla', 'ten', 'toe', 'cho', 'co', 'lat', 'spe', 'ak', 'er', 'po', 'co', 'lor', + 'pen', 'cil', 'li', 'ght', 'wh', 'at', 'the', 'he', 'ck', 'is', 'mam', 'bo', 'no', 'fi', 've', 'any', 'way', + 'pol', 'iti', 'cs', 'ra', 'dio', 'sou', 'rce', 'sea', 'rch', 'pa', 'per', 'com', 'bo', 'sp', 'eak', 'st', 'fi', + 'rst', 'gr', 'oup', 'boy', 'ea', 'gle', 'tr', 'ail', 'bi', 'ble', 'brb', 'pri', 'dee', 'kay', 'en', 'be', 'se' + ); + srand((double)microtime() * 1000000); + for ($count = 1; $count <= 4; $count++) { + if (rand() % 10 == 1) { + $makepass .= sprintf('%0.0f', (rand() % 50) + 1); + } else { + $makepass .= sprintf('%s', $syllables[rand() % 62]); + } + } + return $makepass; + } + + /** + * @param string $email + * @param bool $antispam + * @return bool|mixed + */ + public function checkEmail($email, $antispam = false) + { + if (!$email || !preg_match('/^[^@]{1,64}@[^@]{1,255}$/', $email)) { + return false; + } + $email_array = explode("@", $email); + $local_array = explode(".", $email_array[0]); + for ($i = 0; $i < sizeof($local_array); $i++) { + if (!preg_match("/^(([A-Za-z0-9!#$%&'*+\/\=?^_`{|}~-][A-Za-z0-9!#$%&'*+\/\=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$/", $local_array[$i]) + ) { + return false; + } + } + if (!preg_match("/^\[?[0-9\.]+\]?$/", $email_array[1])) { + $domain_array = explode(".", $email_array[1]); + if (sizeof($domain_array) < 2) { + return false; // Not enough parts to domain + } + for ($i = 0; $i < sizeof($domain_array); $i++) { + if (!preg_match("/^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$/", $domain_array[$i])) { + return false; + } + } + } + if ($antispam) { + $email = str_replace("@", " at ", $email); + $email = str_replace(".", " dot ", $email); + } + return $email; + } + + /** + * @param string $url + * @return string + */ + public function formatURL($url) + { + $url = trim($url); + if ($url != '') { + if ((!preg_match('/^http[s]*:\/\//i', $url)) && (!preg_match('/^ftp*:\/\//i', $url)) && (!preg_match('/^ed2k*:\/\//i', $url)) + ) { + $url = 'http://' . $url; + } + } + return $url; + } + + /** + * Function to get banner html tags for use in templates + * + * @return string + */ + public function getBanner() + { + $bresult = $this->db->query('SELECT COUNT(*) FROM ' . $this->db->prefix('banner')); + list ($numrows) = $this->db->fetchRow($bresult); + if ($numrows > 1) { + $numrows = $numrows - 1; + mt_srand((double)microtime() * 1000000); + $bannum = mt_rand(0, $numrows); + } else { + $bannum = 0; + } + if ($numrows > 0) { + $bresult = $this->db->query('SELECT * FROM ' . $this->db->prefix('banner'), 1, $bannum); + list ($bid, $cid, $imptotal, $impmade, $clicks, $imageurl, $clickurl, $date, $htmlbanner, $htmlcode) = $this->db->fetchRow($bresult); + if ($this->config['my_ip'] == $this->getEnv('REMOTE_ADDR')) { + // EMPTY + } else { + $impmade = $impmade + 1; + $this->db->queryF(sprintf('UPDATE %s SET impmade = %u WHERE bid = %u', $this->db->prefix('banner'), $impmade, $bid)); + /** + * Check if this impression is the last one + */ + if ($imptotal > 0 && $impmade >= $imptotal) { + $newid = $this->db->genId($this->db->prefix('bannerfinish') . '_bid_seq'); + $sql = sprintf('INSERT INTO %s (bid, cid, impressions, clicks, datestart, dateend) VALUES (%u, %u, %u, %u, %u, %u)', $this->db->prefix('bannerfinish'), $newid, $cid, $impmade, $clicks, $date, time()); + $this->db->queryF($sql); + $this->db->queryF(sprintf('DELETE FROM %s WHERE bid = %u', $this->db->prefix('banner'), $bid)); + } + } + /** + * Print the banner + */ + if ($htmlbanner) { + $bannerobject = $htmlcode; + } else { + $bannerobject = '<div id="xo-bannerfix">'; + if (stristr($imageurl, '.swf')) { + $bannerobject = $bannerobject . '<div id ="xo-fixbanner">' . '<a href="' . XOOPS_URL . '/banners.php?op=click&bid=' . $bid . '" rel="external" title="' . $clickurl . '"></a></div>' . '<object type="application/x-shockwave-flash" width="468" height="60" data="' . $imageurl . '" style="z-index:100;">' . '<param name="movie" value="' . $imageurl . '" />' . '<param name="wmode" value="opaque" />' . '</object>'; + + } else { + $bannerobject = $bannerobject . '<a href="' . XOOPS_URL . '/banners.php?op=click&bid=' . $bid . '" rel="external" title="' . $clickurl . '"><img src="' . $imageurl . '" alt="' . $clickurl . '" /></a>'; + } + + $bannerobject = $bannerobject . '</div>'; + } + return $bannerobject; + } + return ''; + } + + /** + * Function to redirect a user to certain pages + * + * @param $url + * @param int $time + * @param string $message + * @param bool $addredirect + * @param bool $allowExternalLink + * @return void + */ + public function redirect($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false) + { + $this->preload->triggerEvent('core.include.functions.redirectheader', + array($url, $time, $message, $addredirect, $allowExternalLink)); + + if (preg_match("/[\\0-\\31]|about:|script:/i", $url)) { + if (!preg_match('/^\b(java)?script:([\s]*)history\.go\(-[0-9]*\)([\s]*[;]*[\s]*)$/si', $url)) { + $url = XOOPS_URL; + } + } + if (!$allowExternalLink && $pos = strpos($url, '://')) { + $xoopsLocation = substr(XOOPS_URL, strpos(XOOPS_URL, '://') + 3); + if (strcasecmp(substr($url, $pos + 3, strlen($xoopsLocation)), $xoopsLocation)) { + $url = XOOPS_URL; + } + } + if (defined('XOOPS_CPFUNC_LOADED')) { + $theme = 'default'; + } else { + $theme = $this->config['theme_set']; + } + + $xoopsThemeFactory = null; + $xoopsThemeFactory = new xos_opal_ThemeFactory(); + $xoopsThemeFactory->allowedThemes = $this->config['theme_set_allowed']; + $xoopsThemeFactory->defaultTheme = $theme; + $this->theme = $xoopsThemeFactory->createInstance(array("plugins" => array(), "renderBanner" => false)); + $this->tpl = $this->theme->template; + $this->tpl->assign(array( + 'xoops_theme' => $theme, 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $theme . '/', + 'xoops_themecss' => xoops_getcss($theme), + 'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES), + 'xoops_sitename' => htmlspecialchars($this->config['sitename'], ENT_QUOTES), + 'xoops_slogan' => htmlspecialchars($this->config['slogan'], ENT_QUOTES), + 'xoops_dirname' => $this->isModule() ? $this->module->getVar('dirname') : 'system', + 'xoops_pagetitle' => $this->isModule() ? $this->module->getVar('name') : htmlspecialchars($this->config['slogan'], ENT_QUOTES) + )); + if ($this->config['debug_mode'] == 2 && $this->userIsAdmin) { + $this->tpl->assign('time', 300); + $this->tpl->assign('xoops_logdump', $this->logger->dump()); + } else { + $this->tpl->assign('time', intval($time)); + } + if (!empty($_SERVER['REQUEST_URI']) && $addredirect && strstr($url, 'user.php')) { + if (!strstr($url, '?')) { + $url .= '?xoops_redirect=' . urlencode($_SERVER['REQUEST_URI']); + } else { + $url .= '&xoops_redirect=' . urlencode($_SERVER['REQUEST_URI']); + } + } + if (defined('SID') && SID && (!isset($_COOKIE[session_name()]) || ($this->config['use_mysession'] && $this->config['session_name'] != '' && !isset($_COOKIE[$this->config['session_name']]))) + ) { + if (!strstr($url, '?')) { + $url .= '?' . SID; + } else { + $url .= '&' . SID; + } + } + $url = preg_replace("/&/i", '&', htmlspecialchars($url, ENT_QUOTES)); + $this->tpl->assign('url', $url); + $message = trim($message) != '' ? $message : _TAKINGBACK; + $this->tpl->assign('message', $message); + $this->tpl->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD, $url)); + $this->tpl->display('db:system_redirect.html'); + exit(); + } + + /** + * @param $key + * @return string + */ + public function getEnv($key) + { + $ret = ''; + if (array_key_exists($key, $_SERVER) && isset($_SERVER[$key])) { + $ret = $_SERVER[$key]; + return $ret; + } + if (array_key_exists($key, $_ENV) && isset($_ENV[$key])) { + $ret = $_ENV[$key]; + return $ret; + } + return $ret; + } + + /** + * Function to get css file for a certain themeset + * + * @param string $theme + * @return string + */ + public function getCss($theme = '') + { + if ($theme == '') { + $theme = $this->config['theme_set']; + } + $uagent = xoops_getenv('HTTP_USER_AGENT'); + if (stristr($uagent, 'mac')) { + $str_css = 'styleMAC.css'; + } elseif (preg_match("/MSIE ([0-9]\.[0-9]{1,2})/i", $uagent)) { + $str_css = 'style.css'; + } else { + $str_css = 'styleNN.css'; + } + if (is_dir(XOOPS_THEME_PATH . '/' . $theme)) { + if (file_exists(XOOPS_THEME_PATH . '/' . $theme . '/' . $str_css)) { + return XOOPS_THEME_URL . '/' . $theme . '/' . $str_css; + } elseif (file_exists(XOOPS_THEME_PATH . '/' . $theme . '/style.css')) { + return XOOPS_THEME_URL . '/' . $theme . '/style.css'; + } + } + if (is_dir(XOOPS_THEME_PATH . '/' . $theme . '/css')) { + if (file_exists(XOOPS_THEME_PATH . '/' . $theme . '/css/' . $str_css)) { + return XOOPS_THEME_URL . '/' . $theme . '/css/' . $str_css; + } elseif (file_exists(XOOPS_THEME_PATH . '/' . $theme . '/css/style.css')) { + return XOOPS_THEME_URL . '/' . $theme . '/css/style.css'; + } + } + return ''; + } + + /** + * @return XoopsMailer|XoopsMailerLocal + */ + public function getMailer() + { + static $mailer; + if (is_object($mailer)) { + return $mailer; + } + + include_once XOOPS_ROOT_PATH . '/class/xoopsmailer.php'; + if (file_exists($file = XOOPS_ROOT_PATH . '/language/' . Xoops::getInstance()->config['language'] . '/xoopsmailerlocal.php')) { + include_once $file; + } else { + if (file_exists($file = XOOPS_ROOT_PATH . '/language/english/xoopsmailerlocal.php')) { + include_once $file; + } + } + unset($mailer); + if (class_exists('XoopsMailerLocal')) { + $mailer = new XoopsMailerLocal(); + } else { + $mailer = new XoopsMailer(); + } + return $mailer; + } + + /** + * @param integer $rank_id + * @param int $posts + * @return array + */ + public function getRank($rank_id = 0, $posts = 0) + { + $myts = MyTextSanitizer::getInstance(); + $rank_id = intval($rank_id); + $posts = intval($posts); + if ($rank_id != 0) { + $sql = "SELECT rank_title AS title, rank_image AS image FROM " . $this->db->prefix('ranks') . " WHERE rank_id = " . $rank_id; + } else { + $sql = "SELECT rank_title AS title, rank_image AS image FROM " . $this->db->prefix('ranks') . " WHERE rank_min <= " . $posts . " AND rank_max >= " . $posts . " AND rank_special = 0"; + } + $rank = $this->db->fetchArray($this->db->query($sql)); + $rank['title'] = $myts->htmlspecialchars($rank['title']); + $rank['id'] = $rank_id; + return $rank; + } + + /** + * Returns the portion of string specified by the start and length parameters. If $trimmarker is supplied, it is appended to the return string. This function works fine with multi-byte characters if mb_* functions exist on the server. + * + * @param string $str + * @param int $start + * @param int $length + * @param string $trimmarker + * @return string + */ + public function substr($str, $start, $length, $trimmarker = '...') + { + return XoopsLocal::substr($str, $start, $length, $trimmarker); + } + + /** + * @param string $text + * @return string + */ + public function utf8_encode(&$text) + { + return XoopsLocal::utf8_encode($text); + } + + /** + * @param string $text + * @return string + */ + function convertEncoding(&$text) + { + return XoopsLocal::utf8_encode($text); + } + + /** + * @param string $text + * @return string + */ + public function trim($text) + { + return XoopsLocal::trim($text); + } + + public function getOption($option) + { + $ret = ''; + if (isset($this->option[$option])) { + $ret = $this->option[$option]; + } + return $ret; + } + + /** + * @param string $key + * @param string $type + * @return mixed + */ + function getConfig($key, $type = 'XOOPS_CONF') + { + if (isset($this->_systemConfigs[$key])) { + return $this->_systemConfigs[$key]; + } + $this->getConfigs($type); + $this->_systemConfigs[$key] = array(); + if (!isset($this->_systemConfigs[$key])) { + $this->_systemConfigs[$key] = null; + } + return $this->_systemConfigs[$key]; + } + + function getConfigs($type = 'XOOPS_CONF') { + /* @var $config_handler XoopsConfigHandler */ + $config_handler = xoops_gethandler('config'); + $configs = $config_handler->getConfigsByCat((is_array($type)) ? $type : constant($type)); + $this->_systemConfigs = array_merge($this->_systemConfigs, $configs); + $this->config =& $this->_systemConfigs;//for compatibilty + return $this->_systemConfigs; + } + + /** + * @param $configs + * @return void + */ + function addConfigs($configs) { + $this->_systemConfigs = array_merge($this->_systemConfigs, (array) $configs); + } + + /** + * @param string $key + * @param mixed $value + * @return void + */ + public function setConfig($key, $value = null) + { + if (isset($this->_systemConfigs[$key]) && !is_null($value)) { + $this->_systemConfigs[$key] = $value; + } + } + + /** + * @param string $key + * @param string $dirname + * @return null + */ + public function getModuleConfig($key, $dirname = '') + { + $dirname = trim($dirname); + if (empty($dirname)) { + $dirname = $this->isModule() ? $this->module->getVar('dirname') : 'system'; + } + if (!isset($this->_moduleConfigs[$dirname])) { + $this->getModuleConfigs($dirname); + } + if (isset($this->_moduleConfigs[$dirname][$key])) { + return $this->_moduleConfigs[$dirname][$key]; + } + return null; + } + + /** + * @param string $dirname + * @return + */ + public function getModuleConfigs($dirname = '') + { + $dirname = trim($dirname); + if (empty($dirname)) { + $dirname = $this->isModule() ? $this->module->getVar('dirname') : 'system'; + } + if (isset($this->_moduleConfigs[$dirname])) { + return $this->_moduleConfigs[$dirname]; + } + $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'); + if (is_object($module)) { + $this->_moduleConfigs[$dirname] = $config_handler->getConfigsByCat(0, $module->getVar('mid')); + } + if ($this->isModule()) { + $this->moduleConfig =& $this->_moduleConfigs[$module->getVar('dirname')]; + } + return $this->_moduleConfigs[$dirname]; + } + + /** + * @param string $url + * @param int $debug + * @return string + * @deprecated + */ + public function getBaseDomain($url, $debug = 0) + { + $base_domain = ''; + $url = strtolower($url); + + // generic tlds (source: http://en.wikipedia.org/wiki/Generic_top-level_domain) + $G_TLD = array( + 'biz', 'com', 'edu', 'gov', 'info', 'int', 'mil', 'name', 'net', 'org', 'aero', 'asia', 'cat', 'coop', 'jobs', + 'mobi', 'museum', 'pro', 'tel', 'travel', 'arpa', 'root', 'berlin', 'bzh', 'cym', 'gal', 'geo', 'kid', 'kids', + 'lat', 'mail', 'nyc', 'post', 'sco', 'web', 'xxx', 'nato', 'example', 'invalid', 'localhost', 'test', 'bitnet', + 'csnet', 'ip', 'local', 'onion', 'uucp', 'co' + ); + + // country tlds (source: http://en.wikipedia.org/wiki/Country_code_top-level_domain) + $C_TLD = array( // active + 'ac', 'ad', 'ae', 'af', 'ag', 'ai', 'al', 'am', 'an', 'ao', 'aq', 'ar', 'as', 'at', 'au', 'aw', 'ax', 'az', + 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi', 'bj', 'bm', 'bn', 'bo', 'br', 'bs', 'bt', 'bw', 'by', 'bz', + 'ca', 'cc', 'cd', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', 'co', 'cr', 'cu', 'cv', 'cx', 'cy', 'cz', + 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'ee', 'eg', 'er', 'es', 'et', 'eu', 'fi', 'fj', 'fk', 'fm', 'fo', + 'fr', 'ga', 'gd', 'ge', 'gf', 'gg', 'gh', 'gi', 'gl', 'gm', 'gn', 'gp', 'gq', 'gr', 'gs', 'gt', 'gu', 'gw', + 'gy', 'hk', 'hm', 'hn', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'in', 'io', 'iq', 'ir', 'is', 'it', 'je', + 'jm', 'jo', 'jp', 'ke', 'kg', 'kh', 'ki', 'km', 'kn', 'kr', 'kw', 'ky', 'kz', 'la', 'lb', 'lc', 'li', 'lk', + 'lr', 'ls', 'lt', 'lu', 'lv', 'ly', 'ma', 'mc', 'md', 'mg', 'mh', 'mk', 'ml', 'mm', 'mn', 'mo', 'mp', 'mq', + 'mr', 'ms', 'mt', 'mu', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'nc', 'ne', 'nf', 'ng', 'ni', 'nl', 'no', 'np', + 'nr', 'nu', 'nz', 'om', 'pa', 'pe', 'pf', 'pg', 'ph', 'pk', 'pl', 'pn', 'pr', 'ps', 'pt', 'pw', 'py', 'qa', + 're', 'ro', 'ru', 'rw', 'sa', 'sb', 'sc', 'sd', 'se', 'sg', 'sh', 'si', 'sk', 'sl', 'sm', 'sn', 'sr', 'st', + 'sv', 'sy', 'sz', 'tc', 'td', 'tf', 'tg', 'th', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'tr', 'tt', 'tv', 'tw', + 'tz', 'ua', 'ug', 'uk', 'us', 'uy', 'uz', 'va', 'vc', 've', 'vg', 'vi', 'vn', 'vu', 'wf', 'ws', 'ye', 'yu', + 'za', 'zm', 'zw', // inactive + 'eh', 'kp', 'me', 'rs', 'um', 'bv', 'gb', 'pm', 'sj', 'so', 'yt', 'su', 'tp', 'bu', 'cs', 'dd', 'zr' + ); + + // get domain + if (!$full_domain = $this->getUrlDomain($url)) { + return $base_domain; + } + + // break up domain, reverse + $DOMAIN = explode('.', $full_domain); + if ($debug) { + print_r($DOMAIN); + } + $DOMAIN = array_reverse($DOMAIN); + if ($debug) { + print_r($DOMAIN); + } + // first check for ip address + if (count($DOMAIN) == 4 && is_numeric($DOMAIN[0]) && is_numeric($DOMAIN[3])) { + return $full_domain; + } + + // if only 2 domain parts, that must be our domain + if (count($DOMAIN) <= 2) { + return $full_domain; + } + + /* + finally, with 3+ domain parts: obviously D0 is tld now, + if D0 = ctld and D1 = gtld, we might have something like com.uk so, + if D0 = ctld && D1 = gtld && D2 != 'www', domain = D2.D1.D0 else if D0 = ctld && D1 = gtld && D2 == 'www', + domain = D1.D0 else domain = D1.D0 - these rules are simplified below. + */ + if (in_array($DOMAIN[0], $C_TLD) && in_array($DOMAIN[1], $G_TLD) && $DOMAIN[2] != 'www') { + $full_domain = $DOMAIN[2] . '.' . $DOMAIN[1] . '.' . $DOMAIN[0]; + } else { + $full_domain = $DOMAIN[1] . '.' . $DOMAIN[0]; + } + // did we succeed? + return $full_domain; + } + + /** + * Function to get the domain from a URL. + * + * @param string $url the URL to be stripped. + * @return string + * @deprecated + */ + public function getUrlDomain($url) + { + $domain = ''; + $_URL = parse_url($url); + + if (!empty($_URL) || !empty($_URL['host'])) { + $domain = $_URL['host']; + } + return $domain; + } + + /** + * function to update compiled template file in templates_c folder + * + * @param string $tpl_id + * @param boolean $clear_old + * @return boolean + */ + public function templateTouch($tpl_id, $clear_old = true) + { + $tplfile_handler = xoops_gethandler('tplfile'); + $tplfile = $tplfile_handler->get($tpl_id); + + if (is_object($tplfile)) { + $file = $tplfile->getVar('tpl_file', 'n'); + $tpl = new XoopsTpl(); + return $tpl->touch('db:' . $file); + } + return false; + } + + /** + * Clear the module cache + * + * @param int $mid Module ID + * @return void + */ + public function templateClearModuleCache($mid) + { + /* @var $block_handler XoopsBlockHandler */ + $block_handler = xoops_getHandler('block'); + $block_arr = $block_handler->getByModule($mid); + $count = count($block_arr); + if ($count > 0) { + $xoopsTpl = new XoopsTpl(); + $xoopsTpl->caching = 2; + for ($i = 0; $i < $count; $i++) { + if ($block_arr[$i]->getVar('template') != '') { + $xoopsTpl->clear_cache(XOOPS_ROOT_PATH . "/modules/" . $block_arr[$i]->getVar('dirname') . "/templates/blocks/" . $block_arr[$i]->getVar('template'), 'blk_' . $block_arr[$i]->getVar('bid')); + } + } + } + } + + /** + * Notification Helper Functions + * + * We want to be able to delete by module, by user, or by item. + * How do we specify this?? + * + * @param $module_id + * @return bool + */ + public function notificationDeleteByModule($module_id) + { + /* @var $notification_handler XoopsNotificationHandler */ + $notification_handler = xoops_gethandler('notification'); + return $notification_handler->unsubscribeByModule($module_id); + } + + /** + * @param int $user_id + * @return bool + */ + public function notificationDeleteByUser($user_id) + { + /* @var $notification_handler XoopsNotificationHandler */ + $notification_handler = xoops_gethandler('notification'); + return $notification_handler->unsubscribeByUser($user_id); + } + + /** + * @param int $module_id + * @param string $category + * @param int $item_id + * @return bool + */ + function notificationDeleteByItem($module_id, $category, $item_id) + { + /* @var $notification_handler XoopsNotificationHandler */ + $notification_handler = xoops_gethandler('notification'); + return $notification_handler->unsubscribeByItem($module_id, $category, $item_id); + } + + /** + * @param int $module_id + * @param int|null $item_id + * @return int + */ + public function commentCount($module_id, $item_id = null) + { + $comment_handler = xoops_gethandler('comment'); + $criteria = new CriteriaCompo(new Criteria('com_modid', intval($module_id))); + if (isset($item_id)) { + $criteria->add(new Criteria('com_itemid', intval($item_id))); + } + return $comment_handler->getCount($criteria); + } + + /** + * @param int $module_id + * @param int $item_id + * @return bool + */ + function commentDelete($module_id, $item_id) + { + if (intval($module_id) > 0 && intval($item_id) > 0) { + /* @var $comment_handler XoopsCommentHandler */ + $comment_handler = xoops_gethandler('comment'); + $comments = $comment_handler->getByItemId($module_id, $item_id); + if (is_array($comments)) { + $count = count($comments); + $deleted_num = array(); + for ($i = 0; $i < $count; $i++) { + if (false != $comment_handler->delete($comments[$i])) { + // store poster ID and deleted post number into array for later use + $poster_id = $comments[$i]->getVar('com_uid'); + if ($poster_id != 0) { + $deleted_num[$poster_id] = !isset($deleted_num[$poster_id]) ? 1 + : ($deleted_num[$poster_id] + 1); + } + } + } + + $member_handler = xoops_gethandler('member'); + foreach ($deleted_num as $user_id => $post_num) { + // update user posts + /* @var $member_handler XoopsMemberHandler */ + $com_poster = $member_handler->getUser($user_id); + if (is_object($com_poster)) { + $member_handler->updateUserByField($com_poster, 'posts', $com_poster->getVar('posts') - $post_num); + } + } + return true; + } + } + return false; + } + + /** + * Group Permission Helper Functions + * + * @param int $module_id + * @param string $perm_name + * @param null|int $item_id + * @return bool + */ + public function grouppermDeleteByModItem($module_id, $perm_name, $item_id = null) + { + // do not allow system permissions to be deleted + if (intval($module_id) <= 1) { + return false; + } + /* @var $gperm_handler XoopsGrouppermHandler */ + $gperm_handler = xoops_gethandler('groupperm'); + return $gperm_handler->deleteByModule($module_id, $perm_name, $item_id); + } } ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2011-10-26 20:47:18 UTC (rev 7982) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2011-10-27 00:12:48 UTC (rev 7983) @@ -67,7 +67,7 @@ */ $xoops->security = new XoopsSecurity(); $xoops->security->checkSuperglobals(); -$xoopsSecurity = $xoops->security; +$xoopsSecurity =& $xoops->security; /** * Create Instance XoopsLogger Object @@ -90,7 +90,7 @@ * Set cookie dope for multiple subdomains remove the '.'. to use top level dope for session cookie; * Requires functions */ -define('XOOPS_COOKIE_DOMAIN', ($domain = xoops_getBaseDomain(XOOPS_URL)) == 'localhost' ? '' : '.' . $domain); +define('XOOPS_COOKIE_DOMAIN', ($domain = $xoops->getBaseDomain(XOOPS_URL)) == 'localhost' ? '' : '.' . $domain); /** * Check Proxy; @@ -111,18 +111,15 @@ * Get xoops configs * Requires functions and database loaded */ -/* @var $config_handler XoopsConfigHandler */ -$config_handler = xoops_gethandler('config'); -$xoops->config =& $config_handler->getConfigsByCat(XOOPS_CONF); +$xoops->getConfigs(); $xoopsConfig =& $xoops->config; /** * Merge file and db configs. */ if (file_exists($file = $xoops->path('var/configs/xoopsconfig.php'))) { - $fileConfigs = include $file; - $xoops->config = array_merge($xoops->config, (array) $fileConfigs); - unset($fileConfigs, $file); + $xoops->addConfigs(include $file); + unset($file); } else { trigger_error('File Path Error: ' . 'var/configs/xoopsconfig.php' . ' does not exist.'); } @@ -136,10 +133,10 @@ /** * Start of Error Reportings. */ -if ($xoops->config['debug_mode'] == 1 || $xoops->config['debug_mode'] == 2) { +if ($xoops->getConfig('debug_mode') == 1 || $xoops->getConfig('debug_mode') == 2) { xoops_loadLanguage('logger'); $xoops->logger->enable(); - $xoops->logger->usePopup = ($xoops->config['debug_mode'] == 2); + $xoops->logger->usePopup = ($xoops->getConfig('debug_mode') == 2); } else { $xoops->logger->disable(); } @@ -160,24 +157,24 @@ * User Sessions */ /* @var $member_handler XoopsMemberHandler */ -$member_handler = xoops_gethandler('member'); +$member_handler = $xoops->gethandler('member'); /* @var $sess_handler XoopsSessionHandler */ -$xoops->sess_handler = xoops_gethandler('session'); +$xoops->sess_handler = $xoops->gethandler('session'); $sess_handler =& $xoops->sess_handler; -if ($xoops->config['use_ssl'] - && isset($_POST[$xoops->config['sslpost_name']]) - && $_POST[$xoops->config['sslpost_name']] != '' +if ($xoops->getConfig('use_ssl') + && isset($_POST[$xoops->getConfig('sslpost_name')]) + && $_POST[$xoops->getConfig('sslpost_name')] != '' ) { - session_id($_POST[$xoops->config['sslpost_name']]); -} else if ($xoops->config['use_mysession'] && $xoops->config['session_name'] != '' && $xoops->config['session_expire'] > 0) { - if (isset($_COOKIE[$xoops->config['session_name']])) { - session_id($_COOKIE[$xoops->config['session_name']]); + session_id($_POST[$xoops->getConfig('sslpost_name')]); +} else if ($xoops->getConfig('use_mysession') && $xoops->getConfig('session_name') != '' && $xoops->getConfig('session_expire') > 0) { + if (isset($_COOKIE[$xoops->getConfig('session_name')])) { + session_id($_COOKIE[$xoops->getConfig('session_name')]); } if (function_exists('session_cache_expire')) { - session_cache_expire($xoops->config['session_expire']); + session_cache_expire($xoops->getConfig('session_expire')); } - @ini_set('session.gc_maxlifetime', $xoops->config['session_expire'] * 60); + @ini_set('session.gc_maxlifetime', $xoops->getConfig('session_expire') * 60); } session_set_save_handler(array(&$xoops->sess_handler, 'open'), array(&$xoops->sess_handler, 'close'), @@ -190,9 +187,9 @@ /** * Remove expired session for xoopsUserId */ -if ($xoops->config['use_mysession'] - && $xoops->config['session_name'] != '' - && !isset($_COOKIE[$xoops->config['session_name']]) +if ($xoops->getConfig('use_mysession') + && $xoops->getConfig('session_name') != '' + && !isset($_COOKIE[$xoops->getConfig('session_name')]) && !empty($_SESSION['xoopsUserId']) ) { unset($_SESSION['xoopsUserId']); @@ -202,10 +199,10 @@ * Load xoopsUserId from cookie if "Remember me" is enabled. */ if (empty($_SESSION['xoopsUserId']) - && !empty($xoops->config['usercookie']) - && !empty($_COOKIE[$xoops->config['usercookie']]) + && $xoops->getConfig('usercookie') != '' + && !empty($_COOKIE[$xoops->getConfig('usercookie')]) ) { - $hash_data = @explode("-", $_COOKIE[$xoops->config['usercookie']], 2); + $hash_data = @explode("-", $_COOKIE[$xoops->getConfig('usercookie')], 2); list($_SESSION['xoopsUserId'], $hash_login) = array($hash_data[0], strval(@$hash_data[1])); unset($hash_data); } @@ -219,11 +216,11 @@ $xoops->user = ''; $_SESSION = array(); session_destroy(); - setcookie($xoops->config['usercookie'], 0, - 1, '/'); + setcookie($xoops->getConfig('usercookie'), 0, - 1, '/'); } else { if ((intval($xoops->user->getVar('last_login')) + 60 * 5) < time()) { /* @var $user_handler XoopsUserHandler */ - $user_handler = xoops_gethandler('user'); + $user_handler = $xoops->gethandler('user'); $criteria = new Criteria('uid', $_SESSION['xoopsUserId']); $user_handler->updateAll('last_login', time(), $criteria, true); unset($criteria); @@ -246,7 +243,7 @@ * Note: temporary solution only. Will be re-designed in XOOPS 3.0 */ if ($xoops->logger->isEnable()) { - $level = isset($xoops->config['debugLevel']) ? intval($xoops->config['debugLevel']) : 0; + $level = $xoops->getConfig('debugLevel') ? $xoops->getConfig('debugLevel') : 0; if (($level == 2 && empty($xoops->userIsAdmin)) || ($level == 1 && !$xoops->isUser())) { $xoops->logger->disable(); } @@ -264,7 +261,7 @@ /** * Closed Site */ -if ($xoops->config['closesite'] == 1) { +if ($xoops->getConfig('closesite') == 1) { include_once $xoops->path('include/site-closed.php'); } @@ -274,7 +271,7 @@ if (file_exists('./xoops_version.php')) { $url_arr = explode('/', strstr($_SERVER['PHP_SELF'], '/modules/')); /* @var $module_handler XoopsModuleHandler */ - $module_handler = xoops_gethandler( 'module' ); + $module_handler = $xoops->gethandler( 'module' ); $xoops->module = $module_handler->getByDirname($url_arr[2]); unset($url_arr); @@ -284,17 +281,15 @@ $xoops->footer(); } /* @var $moduleperm_handler XoopsGrouppermHandler */ - $moduleperm_handler = xoops_gethandler('groupperm'); + $moduleperm_handler = $xoops->gethandler('groupperm'); if ($xoops->isUser()) { if (!$moduleperm_handler->checkRight('module_read', $xoops->module->getVar('mid'), $xoops->user->getGroups())) { - redirect_header(XOOPS_URL, 1, _NOPERM, false); - exit(); + $xoops->redirect(XOOPS_URL, 1, _NOPERM, false); } $xoops->userIsAdmin = $xoops->user->isAdmin($xoops->module->getVar('mid')); } else { if (!$moduleperm_handler->checkRight('module_read', $xoops->module->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) { - redirect_header(XOOPS_URL . '/user.php?from=' . $xoops->module->getVar('dirname', 'n'), 1, _NOPERM); - exit(); + $xoops->redirect(XOOPS_URL . '/user.php?from=' . $xoops->module->getVar('dirname', 'n'), 1, _NOPERM); } } @@ -308,7 +303,7 @@ } if ($xoops->module->getVar('hasconfig') == 1 || $xoops->module->getVar('hascomments') == 1 || $xoops->module->getVar('hasnotification') == 1 ) { - $xoops->moduleConfig = $config_handler->getConfigsByCat(0, $xoops->module->getVar('mid')); + $xoops->getModuleConfigs(); } } else if ($xoops->isUser()) { $xoops->userIsAdmin = $xoops->user->isAdmin(1); @@ -325,9 +320,8 @@ * YOU SHOULD AVOID USING THE FOLLOWING FUNCTION, IT WILL BE REMOVED */ //Creates 'system_modules_active' cache file if it has been deleted. -xoops_getActiveModules(); +$xoops->getActiveModules(); $xoops->logger->stopTime('XOOPS Boot'); $xoops->logger->startTime('Module init'); -$xoops->preload->triggerEvent('core.include.common.end'); -?> \ No newline at end of file +$xoops->preload->triggerEvent('core.include.common.end'); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-26 20:47:18 UTC (rev 7982) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-27 00:12:48 UTC (rev 7983) @@ -25,28 +25,9 @@ */ function xoops_getHandler($name, $optional = false) { - static $handlers; - $name = strtolower(trim($name)); - $class = ''; - if (!isset($handlers[$name])) { - if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/kernel/' . $name . '.php')) { - require_once $hnd_file; - } - $class = 'Xoops' . ucfirst($name) . 'Handler'; - if (class_exists($class)) { - $db = XoopsDatabaseFactory::getDatabaseConnection(); - $handlers[$name] = new $class($db); - } - } - if (!isset($handlers[$name])) { - trigger_error('Class <strong>' . $class . '</strong> does not exist<br />Handler Name: ' . $name, $optional - ? E_USER_WARNING : E_USER_ERROR); - } - if (isset($handlers[$name])) { - return $handlers[$name]; - } - $inst = false; - return $inst; + $xoops = Xoops::getInstance(); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + return $xoops->getHandler($name, $optional); } /** @@ -58,38 +39,8 @@ function xoops_getModuleHandler($name = null, $module_dir = null, $optional = false) { $xoops = Xoops::getInstance(); - static $handlers; - // if $module_dir is not specified - if (!isset($module_dir)) { - // if a module is loaded - if ($xoops->module instanceof XoopsModule) { - $module_dir = $xoops->module->getVar('dirname', 'n'); - } else { - trigger_error('No Module is loaded', E_USER_ERROR); - } - } else { - $module_dir = trim($module_dir); - } - $name = (!isset($name)) ? $module_dir : trim($name); - if (!isset($handlers[$module_dir][$name])) { - if (file_exists($hnd_file = XOOPS_ROOT_PATH . "/modules/{$module_dir}/class/{$name}.php")) { - include_once $hnd_file; - } - $class = ucfirst(strtolower($module_dir)) . ucfirst($name) . 'Handler'; - if (class_exists($class)) { - $db = XoopsDatabaseFactory::getDatabaseConnection(); - $handlers[$module_dir][$name] = new $class($db); - } - } - if (!isset($handlers[$module_dir][$name])) { - trigger_error('Handler does not exist<br />Module: ' . $module_dir . '<br />Name: ' . $name, $optional - ? E_USER_WARNING : E_USER_ERROR); - } - if (isset($handlers[$module_dir][$name])) { - return $handlers[$module_dir][$name]; - } - $inst = false; - return $inst; + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + return $xoops->getModuleHandler($name, $module_dir, $optional); } /** @@ -103,10 +54,9 @@ */ function xoops_load($name, $type = 'core') { - if (!class_exists('XoopsLoad')) { - require_once XOOPS_ROOT_PATH . '/class/xoopsload.php'; - } - return XoopsLoad::load($name, $type); + $xoops = Xoops::getInstance(); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + return $xoops->load($name, $type); } /** @@ -124,22 +74,8 @@ function xoops_loadLanguage($name, $domain = '', $language = null) { $xoops = Xoops::getInstance(); - - /** - * We must check later for an empty value. As xoops_getOption could be empty - */ - if (empty($name)) { - return false; - } - $language = empty($language) ? $xoops->config['language'] : $language; - $path = ((empty($domain) || 'global' == $domain) ? '' : "modules/{$domain}/") . 'language'; - if (!file_exists($fileinc = $xoops->path("{$path}/{$language}/{$name}.php"))) { - if (!file_exists($fileinc = $xoops->path("{$path}/english/{$name}.php"))) { - return false; - } - } - $ret = include_once $fileinc; - return $ret; + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + return $xoops->loadLanguage($name, $domain, $language); } /** @@ -152,15 +88,9 @@ */ function xoops_getActiveModules() { - static $modules_active; - if (is_array($modules_active)) { - return $modules_active; - } - - if (!$modules_active = XoopsCache::read('system_modules_active')) { - $modules_active = xoops_setActiveModules(); - } - return $modules_active; + $xoops = Xoops::getInstance(); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + return $xoops->getActiveModules(); } /** @@ -173,16 +103,7 @@ */ function xoops_setActiveModules() { - /* @var $module_handler XoopsModuleHandler */ - $module_handler = xoops_gethandler('module'); - $modules_obj = $module_handler->getObjectsArray(new Criteria('isactive', 1)); - $modules_active = array(); - foreach (array_keys($modules_obj) as $key) { - $modules_active[] = $modules_obj[$key]->getVar('dirname'); - } - unset($modules_obj); - XoopsCache::write('system_modules_active', $modules_active); - return $modules_active; + exit('xoops_setActiveModules is deprecated'); } /** @@ -196,10 +117,9 @@ */ function xoops_isActiveModule($dirname) { - if (isset($dirname) && in_array($dirname, xoops_getActiveModules())) { - return true; - } - return false; + $xoops = Xoops::getInstance(); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + return $xoops->isActiveModule($dirname); } /** @@ -209,45 +129,8 @@ function xoops_header($closehead = true) { $xoops = Xoops::getInstance(); - - /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $xoopsConfigMetaFooter = $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER); - - if (!headers_sent()) { - header('Content-Type:text/html; charset=' . _CHARSET); - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header('Cache-Control: no-store, no-cache, max-age=1, s-maxage=1, must-revalidate, post-check=0, pre-check=0'); - header("Pragma: no-cache"); - } - - echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n"; - echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . _LANGCODE . '" lang="' . _LANGCODE . '"> - <head> - <meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" /> - <meta http-equiv="content-language" content="' . _LANGCODE . '" /> - <meta name="robots" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_robots']) . '" /> - <meta name="keywords" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_keywords']) . '" /> - <meta name="description" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_desc']) . '" /> - <meta name="rating" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_rating']) . '" /> - <meta name="author" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_author']) . '" /> - <meta name="copyright" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_copyright']) . '" /> - <meta name="generator" content="XOOPS" /> - <title>' . htmlspecialchars($xoops->config['sitename']) . '</title> - <script type="text/javascript" src="' . XOOPS_URL . '/include/xoops.js"></script>'; - $themecss = xoops_getcss($xoops->config['theme_set']); - echo '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/xoops.css" />'; - $language = xoops_getConfigOption('language'); - if (file_exists($xoops->path('language/' . $language . '/style.css'))) { - echo '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/language/' . $language . '/style.css" />'; - } - if ($themecss) { - echo '<link rel="stylesheet" type="text/css" media... [truncated message content] |
From: <tr...@us...> - 2011-10-27 00:17:07
|
Revision: 7984 http://xoops.svn.sourceforge.net/xoops/?rev=7984&view=rev Author: trabis Date: 2011-10-27 00:17:00 +0000 (Thu, 27 Oct 2011) Log Message: ----------- updating setActiveModules Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 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-27 00:12:48 UTC (rev 7983) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-27 00:17:00 UTC (rev 7984) @@ -567,7 +567,7 @@ } if (!$this->_activeModules = XoopsCache::read('system_modules_active')) { - $this->_activeModules = $this->_setActiveModules(); + $this->_activeModules = $this->setActiveModules(); } return $this->_activeModules; } @@ -580,7 +580,7 @@ * * @return array */ - private function _setActiveModules() + public function setActiveModules() { /* @var $module_handler XoopsModuleHandler */ $module_handler = xoops_gethandler('module'); 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-27 00:12:48 UTC (rev 7983) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-27 00:17:00 UTC (rev 7984) @@ -26,7 +26,7 @@ function xoops_getHandler($name, $optional = false) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getHandler($name, $optional); } @@ -39,7 +39,7 @@ function xoops_getModuleHandler($name = null, $module_dir = null, $optional = false) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getModuleHandler($name, $module_dir, $optional); } @@ -55,7 +55,7 @@ function xoops_load($name, $type = 'core') { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->load($name, $type); } @@ -74,7 +74,7 @@ function xoops_loadLanguage($name, $domain = '', $language = null) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->loadLanguage($name, $domain, $language); } @@ -89,7 +89,7 @@ function xoops_getActiveModules() { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getActiveModules(); } @@ -103,7 +103,9 @@ */ function xoops_setActiveModules() { - exit('xoops_setActiveModules is deprecated'); + $xoops = Xoops::getInstance(); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); + return $xoops->setActiveModules(); } /** @@ -118,7 +120,7 @@ function xoops_isActiveModule($dirname) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->isActiveModule($dirname); } @@ -129,7 +131,7 @@ function xoops_header($closehead = true) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->simpleHeader($closehead); } @@ -139,7 +141,7 @@ function xoops_footer() { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->simpleFooter(); } @@ -151,7 +153,7 @@ function xoops_error($msg, $title = '') { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->error($msg, $title); } @@ -163,7 +165,7 @@ function xoops_result($msg, $title = '') { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->result($msg, $title); } @@ -178,7 +180,7 @@ function xoops_confirm($hiddens, $action, $msg, $submit = '', $addtoken = true) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->error($hiddens, $action, $msg, $submit, $addtoken); } @@ -190,7 +192,7 @@ function xoops_getUserTimestamp($time, $timeoffset = '') { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getUserTimestamp($time, $timeoffset); } @@ -205,7 +207,7 @@ function formatTimestamp($time, $format = 'l', $timeoffset = '') { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->formatTimestamp($time, $format, $timeoffset); } @@ -219,7 +221,7 @@ function userTimeToServerTime($timestamp, $userTZ = null) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->userTimeToServerTime($timestamp, $userTZ); } @@ -229,7 +231,7 @@ function xoops_makepass() { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->makePass(); } @@ -241,7 +243,7 @@ function checkEmail($email, $antispam = false) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->checkEmail($email, $antispam); } @@ -252,7 +254,7 @@ function formatURL($url) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->formatURL($url); } @@ -264,7 +266,7 @@ function xoops_getbanner() { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getBanner(); } @@ -281,7 +283,7 @@ function redirect_header($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->redirect($url, $time, $message, $addredirect, $allowExternalLink); } @@ -292,7 +294,7 @@ function xoops_getenv($key) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getEnv($key); } @@ -305,7 +307,7 @@ function xoops_getcss($theme = '') { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getCss($theme); } @@ -315,7 +317,7 @@ function xoops_getMailer() { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getMailer(); } @@ -327,7 +329,7 @@ function xoops_getrank($rank_id = 0, $posts = 0) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getRank($rank_id, $posts); } @@ -343,7 +345,7 @@ function xoops_substr($str, $start, $length, $trimmarker = '...') { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->substr($str, $start, $length, $trimmarker); } @@ -354,7 +356,7 @@ function xoops_notification_deletebymodule($module_id) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->notificationDeleteByModule($module_id); } @@ -367,7 +369,7 @@ function xoops_notification_deletebyuser($user_id) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->notificationDeleteByUser($user_id); } @@ -382,7 +384,7 @@ function xoops_notification_deletebyitem($module_id, $category, $item_id) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->notificationDeleteByItem($module_id, $category, $item_id); } @@ -396,7 +398,7 @@ function xoops_comment_count($module_id, $item_id = null) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->commentCount($module_id, $item_id); } @@ -410,7 +412,7 @@ function xoops_comment_delete($module_id, $item_id) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->commentDelete($module_id, $item_id); } @@ -427,7 +429,7 @@ function xoops_groupperm_deletebymoditem($module_id, $perm_name, $item_id = null) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->grouppermDeleteByModItem($module_id, $perm_name, $item_id); } @@ -440,7 +442,7 @@ function xoops_utf8_encode(&$text) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->utf8_encode($text); } @@ -453,7 +455,7 @@ function xoops_convert_encoding(&$text) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->convertEncoding($text); } @@ -466,7 +468,7 @@ function xoops_trim($text) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->trim($text); } @@ -482,7 +484,7 @@ function xoops_getOption($option) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getOption($option); } @@ -500,7 +502,7 @@ function xoops_getConfigOption($option, $type = 'XOOPS_CONF') { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getConfig($option, $type); } /** @@ -517,7 +519,7 @@ function xoops_setConfigOption($option, $new = null) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->setConfig($option, $new); } @@ -536,7 +538,7 @@ function xoops_getModuleOption($option, $dirname = '') { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getModuleConfig($option, $dirname); } @@ -554,7 +556,7 @@ function xoops_getBaseDomain($url, $debug = 0) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getBaseDomain($url, $debug); } @@ -571,7 +573,7 @@ function xoops_getUrlDomain($url) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->getUrlDomain($url); } @@ -585,7 +587,7 @@ function xoops_template_touch($tpl_id, $clear_old = true) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); return $xoops->templateTouch($tpl_id, $clear_old); } @@ -598,6 +600,6 @@ function xoops_template_clear_module_cache($mid) { $xoops = Xoops::getInstance(); - $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace in file ' . __FILE__ . ' line ' . __LINE__); + $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); $xoops->templateClearModuleCache($mid); } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tr...@us...> - 2011-10-27 23:15:34
|
Revision: 7988 http://xoops.svn.sourceforge.net/xoops/?rev=7988&view=rev Author: trabis Date: 2011-10-27 23:15:24 +0000 (Thu, 27 Oct 2011) Log Message: ----------- Refactoring... Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.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/functions.locale.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/apc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image/scripts/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha/recaptchalib.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.tar.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.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/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/mysqldatabase.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/sqlutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/downloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/file/file.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/file/folder.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/file/xoopsfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/logger/render.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/logger/xoopslogger.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/model/stats.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/sync.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/module.textsanitizer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/pagenav.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/preload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/censor.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/config.custom.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/flash/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/flash/flash.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/iframe/iframe.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/config.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/textsanitizer/li/li.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/mms/mms.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/mp3/mp3.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/rtsp/rtsp.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/syntaxhighlight/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/syntaxhighlight/syntaxhighlight.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/textfilter/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/textfilter/textfilter.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/ul/ul.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/wiki/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/wiki/wiki.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/wmp/wmp.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/youtube/youtube.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/tree.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/utility/xoopsutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/themesetparser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/dhtmltextarea/dhtmltextarea.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/dhtmltextarea/editor_registry.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/sampleform.inc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/textarea/editor_registry.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/textarea/textarea.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/xoopseditor.inc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/xoopseditor.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/formbutton.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formbuttontray.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcheckbox.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/formcontainer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdatetime.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/formeditor.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formelement.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formelementtray.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhidden.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/formlabel.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formpassword.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formradio.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formradioyn.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formraw.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselect.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectcheckgroup.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectcountry.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselecteditor.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectgroup.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectlang.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectmatchoption.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselecttheme.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselecttimezone.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/formtext.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtextarea.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/grouppermform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/simpleform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/tableform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslocal.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/zipdownloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.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/calendarjs.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -12,124 +12,185 @@ */ if (!defined("FRAMEWORKS_ART_FUNCTIONS_CACHE")): -define("FRAMEWORKS_ART_FUNCTIONS_CACHE", true); + define("FRAMEWORKS_ART_FUNCTIONS_CACHE", true); -function mod_generateCacheId_byGroup($groups = null) -{ - global $xoopsUser; + /** + * @param null|array $groups + * @return string + */ + function mod_generateCacheId_byGroup($groups = null) + { + $xoops = Xoops::getInstance(); - if (!empty($groups) && is_array($groups)) { - } elseif (is_object( $xoopsUser )) { - $groups = $xoopsUser->getGroups(); + if (!empty($groups) && is_array($groups)) { + } elseif ($xoops->isUser()) { + $groups = $xoops->user->getGroups(); + } + if (!empty($groups) && is_array($groups)) { + sort($groups); + $contentCacheId = substr(md5(implode(",", $groups) . XOOPS_DB_PASS . XOOPS_DB_NAME), 0, strlen(XOOPS_DB_USER) * 2); + } else { + $contentCacheId = XOOPS_GROUP_ANONYMOUS; + } + + return $contentCacheId; } - if (!empty($groups) && is_array($groups)) { - sort($groups); - $contentCacheId = substr( md5(implode(",", $groups).XOOPS_DB_PASS.XOOPS_DB_NAME), 0, strlen(XOOPS_DB_USER) * 2 ); - } else { - $contentCacheId = XOOPS_GROUP_ANONYMOUS; + + /** + * @param null|array $groups + * @return string + */ + function mod_generateCacheId($groups = null) + { + return mod_generateCacheId_byGroup($groups); } - return $contentCacheId; -} + /** + * @param $data + * @param null|string $name + * @param null|string $dirname + * @param string $root_path + * @return bool + */ + function mod_createFile($data, $name = null, $dirname = null, $root_path = XOOPS_CACHE_PATH) + { + $xoops = Xoops::getInstance(); -function mod_generateCacheId($groups = null) -{ - return mod_generateCacheId_byGroup($groups); -} + $name = ($name) ? $name : strval(time()); + $dirname = ($dirname) ? $dirname : $xoops->moduleDirname; -function mod_createFile($data, $name = null, $dirname = null, $root_path = XOOPS_CACHE_PATH) -{ - global $xoopsModule; + $key = "{$dirname}_{$name}"; + return XoopsCache::write($key, $data); + } - $name = ($name) ? $name : strval(time()); - $dirname = ($dirname) ? $dirname : (is_object($xoopsModule) ? $xoopsModule->getVar("dirname", "n") : "system"); + /** + * @param $data + * @param null|string $name + * @param null|string $dirname + * @return bool + */ + function mod_createCacheFile($data, $name = null, $dirname = null) + { + return mod_createFile($data, $name, $dirname); + } - $key = "{$dirname}_{$name}"; - return XoopsCache::write($key, $data); -} + /** + * @param $data + * @param null|string $name + * @param null|string $dirname + * @param null|array $groups + * @return bool + */ + function mod_createCacheFile_byGroup($data, $name = null, $dirname = null, $groups = null) + { + $name .= mod_generateCacheId_byGroup(); + return mod_createCacheFile($data, $name, $dirname); + } -function mod_createCacheFile($data, $name = null, $dirname = null) -{ - return mod_createFile($data, $name, $dirname); -} + /** + * @param $name + * @param null|string $dirname + * @param string $root_path + * @return mixed|null + */ + function mod_loadFile($name, $dirname = null, $root_path = XOOPS_CACHE_PATH) + { + $xoops = Xoops::getInstance(); -function mod_createCacheFile_byGroup($data, $name = null, $dirname = null, $groups = null) -{ - $name .= mod_generateCacheId_byGroup(); - return mod_createCacheFile($data, $name, $dirname); -} + $data = null; -function mod_loadFile($name, $dirname = null, $root_path = XOOPS_CACHE_PATH) -{ - global $xoopsModule; + if (empty($name)) { + return $data; + } + $dirname = ($dirname) ? $dirname : $xoops->moduleDirname; - $data = null; + $key = "{$dirname}_{$name}"; + return XoopsCache::read($key); + } - if (empty($name)) return $data; - $dirname = ($dirname) ? $dirname : (is_object($xoopsModule) ? $xoopsModule->getVar("dirname", "n") : "system"); + /** + * @param $name + * @param null|string $dirname + * @return mixed|null + */ + function mod_loadCacheFile($name, $dirname = null) + { + $data = mod_loadFile($name, $dirname); + return $data; + } - $key = "{$dirname}_{$name}"; - return XoopsCache::read($key); -} + /** + * @param $name + * @param null|string $dirname + * @param null|array $groups + * @return mixed|null + */ + function mod_loadCacheFile_byGroup($name, $dirname = null, $groups = null) + { + $name .= mod_generateCacheId_byGroup(); + $data = mod_loadFile($name, $dirname); + return $data; + } -function mod_loadCacheFile($name, $dirname = null) -{ - $data = mod_loadFile($name, $dirname); - return $data; -} - -function mod_loadCacheFile_byGroup($name, $dirname = null, $groups = null) -{ - $name .= mod_generateCacheId_byGroup(); - $data = mod_loadFile($name, $dirname); - return $data; -} - -/* Shall we use the function of glob for better performance ? */ - -function mod_clearFile($name = "", $dirname = null, $root_path = XOOPS_CACHE_PATH) -{ - if (empty($dirname)) { - $pattern = ($dirname) ? "{$dirname}_{$name}.*\.php" : "[^_]+_{$name}.*\.php"; - if ($handle = opendir($root_path)) { - while (false !== ($file = readdir($handle))) { - if (is_file($root_path . '/' . $file) && preg_match("/^{$pattern}$/", $file)) { - @unlink($root_path . '/' . $file); + /* Shall we use the function of glob for better performance ? */ + /** + * @param string $name + * @param null|string $dirname + * @param string $root_path + * @return bool + */ + function mod_clearFile($name = "", $dirname = null, $root_path = XOOPS_CACHE_PATH) + { + if (empty($dirname)) { + $pattern = ($dirname) ? "{$dirname}_{$name}.*\.php" : "[^_]+_{$name}.*\.php"; + if ($handle = opendir($root_path)) { + while (false !== ($file = readdir($handle))) { + if (is_file($root_path . '/' . $file) && preg_match("/^{$pattern}$/", $file)) { + @unlink($root_path . '/' . $file); + } } + closedir($handle); } - closedir($handle); + } else { + foreach (glob($root_path . "/{$dirname}_{$name}*.php") as $file) { + @unlink($file); + } } - } else { - foreach (glob($root_path . "/{$dirname}_{$name}*.php") as $file) { - @unlink($file); - } + return true; } - return true; -} -function mod_clearCacheFile($name = "", $dirname = null) -{ - return mod_clearFile($name, $dirname); -} + /** + * @param string $name + * @param null|string $dirname + * @return bool + */ + function mod_clearCacheFile($name = "", $dirname = null) + { + return mod_clearFile($name, $dirname); + } -function mod_clearSmartyCache($pattern = "") -{ - global $xoopsModule; + /** + * @param string $pattern + * @return bool + */ + function mod_clearSmartyCache($pattern = "") + { + $xoops = Xoops::getInstance(); - if (empty($pattern)) { - $dirname = (is_object($xoopsModule) ? $xoopsModule->getVar("dirname", "n") : "system"); - $pattern = "/(^{$dirname}\^.*\.html$|blk_{$dirname}_.*[^\.]*\.html$)/"; - } - if ($handle = opendir(XOOPS_CACHE_PATH)) { - while (false !== ($file = readdir($handle))) { - if (is_file(XOOPS_CACHE_PATH . '/' . $file) && preg_match($pattern, $file)) { - @unlink(XOOPS_CACHE_PATH . '/' . $file); + if (empty($pattern)) { + $dirname = $xoops->moduleDirname; + $pattern = "/(^{$dirname}\^.*\.html$|blk_{$dirname}_.*[^\.]*\.html$)/"; + } + if ($handle = opendir(XOOPS_CACHE_PATH)) { + while (false !== ($file = readdir($handle))) { + if (is_file(XOOPS_CACHE_PATH . '/' . $file) && preg_match($pattern, $file)) { + @unlink(XOOPS_CACHE_PATH . '/' . $file); + } } + closedir($handle); } - closedir($handle); + return true; } - return true; -} endif; ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -11,104 +11,108 @@ * @subpackage art */ -if(!defined("FRAMEWORKS_ART_FUNCTIONS_CONFIG")): -define("FRAMEWORKS_ART_FUNCTIONS_CONFIG", true); +if (!defined("FRAMEWORKS_ART_FUNCTIONS_CONFIG")): + define("FRAMEWORKS_ART_FUNCTIONS_CONFIG", true); -/** - * Load configs of a module - * - * - * @param string $dirname module dirname - * @return array - */ -function mod_loadConfig($dirname = "") -{ - $xoops = Xoops::getInstance(); - if (empty($dirname) && !$xoops->isModule()) { - return null; - } - $dirname = !empty($dirname) ? $dirname : $xoops->module->getVar("dirname"); - - if ($xoops->isModule() && $xoops->module->getVar("dirname", "n") == $dirname){ - if (!empty($xoops->moduleConfig)) { - $moduleConfig = $xoops->moduleConfig; - } else { + /** + * Load configs of a module + * + * @param string $dirname module dirname + * @return array + */ + function mod_loadConfig($dirname = "") + { + $xoops = Xoops::getInstance(); + if (empty($dirname) && !$xoops->isModule()) { return null; } - } else { + $dirname = !empty($dirname) ? $dirname : $xoops->module->getVar("dirname"); - if (!$moduleConfig = XoopsCache::read("{$dirname}_config")) { - $moduleConfig = mod_fetchConfig($dirname); - XoopsCache::write("{$dirname}_config", $moduleConfig); + if ($xoops->isModule() && $xoops->module->getVar("dirname", "n") == $dirname) { + if (!empty($xoops->moduleConfig)) { + $moduleConfig = $xoops->moduleConfig; + } else { + return null; + } + } else { + + if (!$moduleConfig = XoopsCache::read("{$dirname}_config")) { + $moduleConfig = mod_fetchConfig($dirname); + XoopsCache::write("{$dirname}_config", $moduleConfig); + } } + if ($customConfig = @include XOOPS_ROOT_PATH . "/modules/{$dirname}/include/plugin.php") { + $moduleConfig = array_merge($moduleConfig, $customConfig); + } + return $moduleConfig; } - if ($customConfig = @include XOOPS_ROOT_PATH . "/modules/{$dirname}/include/plugin.php") { - $moduleConfig = array_merge($moduleConfig, $customConfig); + + /** + * @param string $dirname + * @return array + */ + function mod_loadConfg($dirname = "") + { + return mod_loadConfig($dirname); } - return $moduleConfig; -} -function mod_loadConfg($dirname = "") -{ - return mod_loadConfig($dirname); -} + /** + * Fetch configs of a module from database + * + * @param string $dirname module dirname + * @return array + */ + function mod_fetchConfig($dirname = "") + { + if (empty($dirname)) { + return null; + } -/** - * Fetch configs of a module from database - * - * - * @param string $dirname module dirname - * @return array - */ -function mod_fetchConfig($dirname = "") -{ - if (empty($dirname)) { - return null; - } + $xoops = Xoops::getInstance(); + /* @var $module_handler XoopsModuleHandler */ + $module_handler = $xoops->getHandler('module'); + if (!$module = $module_handler->getByDirname($dirname)) { + trigger_error("Module '{$dirname}' does not exist", E_USER_WARNING); + return null; + } + /* @var $config_handler XoopsConfigHandler */ + $config_handler = $xoops->getHandler('config'); + $criteria = new CriteriaCompo(new Criteria('conf_modid', $module->getVar('mid'))); + $configs = $config_handler->getConfigs($criteria); + $moduleConfig = array(); + foreach (array_keys($configs) as $i) { + $moduleConfig[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput(); + } + unset($module, $configs); - $module_handler = xoops_gethandler('module'); - if (!$module = $module_handler->getByDirname($dirname)) { - trigger_error("Module '{$dirname}' does not exist", E_USER_WARNING); - return null; + return $moduleConfig; } - $config_handler = xoops_gethandler('config'); - $criteria = new CriteriaCompo(new Criteria('conf_modid', $module->getVar('mid'))); - $configs = $config_handler->getConfigs($criteria); - foreach (array_keys($configs) as $i) { - $moduleConfig[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput(); + function mod_fetchConfg($dirname = "") + { + return mod_fetchConfig($dirname); } - unset($module, $configs); - return $moduleConfig; -} + /** + * clear config cache of a module + * + * + * @param string $dirname module dirname + * @return bool + */ + function mod_clearConfig($dirname = "") + { + if (empty($dirname)) { + return false; + } -function mod_fetchConfg($dirname = "") -{ - return mod_fetchConfig($dirname); -} -/** - * clear config cache of a module - * - * - * @param string $dirname module dirname - * @return bool - */ -function mod_clearConfig($dirname = "") -{ - if (empty($dirname)) { - return false; + return XoopsCache::delete("{$dirname}_config"); } + function mod_clearConfg($dirname = "") + { + return mod_clearConfig($dirname); + } - return XoopsCache::delete("{$dirname}_config"); -} - -function mod_clearConfg($dirname = "") -{ - return mod_clearConfig($dirname); -} - -endif; -?> \ No newline at end of file +endif; \ No newline at end of file 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 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.ini.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -63,8 +63,7 @@ if (defined($constant)) { return true; } - return include_once FRAMEWORKS_ROOT_PATH . "/{$dirname}/functions.{$group}" . (empty($group) ? "" - : ".") . "php"; + return include_once FRAMEWORKS_ROOT_PATH . "/{$dirname}/functions.{$group}" . (empty($group) ? "" : ".") . "php"; } @@ -84,13 +83,12 @@ { $xoops = Xoops::getInstance(); - $dirname = !empty($dirname) ? $dirname : $xoops->module->getVar("dirname", "n"); + $dirname = !empty($dirname) ? $dirname : $xoops->moduleDirname; $constant = strtoupper("{$dirname}_functions" . (($group) ? "_{$group}" : "") . "_loaded"); if (defined($constant)) { return true; } - $filename = XOOPS_ROOT_PATH . "/modules/{$dirname}/include/functions.{$group}" . (empty($group) ? "" - : ".") . "php"; + $filename = XOOPS_ROOT_PATH . "/modules/{$dirname}/include/functions.{$group}" . (empty($group) ? "" : ".") . "php"; return include_once $filename; } @@ -107,7 +105,7 @@ function mod_loadRenderer($class, $dirname = "") { $xoops = Xoops::getInstance(); - $dirname = !empty($dirname) ? $dirname : $xoops->module->getVar("dirname", "n"); + $dirname = !empty($dirname) ? $dirname : $xoops->moduleDirname; $renderer = ucfirst($dirname) . ucfirst($class) . "Renderer"; if (!class_exists($renderer)) { require_once XOOPS_ROOT_PATH . "/modules/{$dirname}/class/{$class}.renderer.php"; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.locale.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.locale.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.locale.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -21,7 +21,7 @@ * @subpackage art */ if (!defined("FRAMEWORKS_ART_FUNCTIONS_LOCALE")): -define("FRAMEWORKS_ART_FUNCTIONS_LOCALE", true); + define("FRAMEWORKS_ART_FUNCTIONS_LOCALE", true); endif; ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -11,9 +11,11 @@ * @subpackage art */ -if (defined('XOOPS_ART_FUNCTIONS')) return false; +if (defined('XOOPS_ART_FUNCTIONS')) { + return false; +} define('XOOPS_ART_FUNCTIONS', true); - + include_once dirname(__FILE__) . "/functions.ini.php"; load_functions("cache"); @@ -21,24 +23,28 @@ load_functions("locale"); load_functions("admin"); -if (!class_exists('ArtObject')) - include_once dirname(__FILE__) . "/object.php"; +if (!class_exists('ArtObject')) { + include_once dirname(__FILE__) . "/object.php"; +} /** * get MySQL server version - * + * * In some cases mysql_get_client_info is required instead * - * @return string + * @param null $conn + * @return string */ function mod_getMysqlVersion($conn = null) { static $mysql_version; - if (isset($mysql_version)) return $mysql_version; + if (isset($mysql_version)) { + return $mysql_version; + } if (!is_null($conn)) { - $version = mysql_get_server_info($conn); + $mysql_version = mysql_get_server_info($conn); } else { - $version = mysql_get_server_info(); + $mysql_version = mysql_get_server_info(); } return $mysql_version; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -97,7 +97,7 @@ { $xoops = Xoops::getInstance(); $ret = '<br />'; - if ($xoops->config['debug_mode'] == 1 || $xoops->config['debug_mode'] == 2) { + if ($xoops->getConfig('debug_mode') == 1 || $xoops->getConfig('debug_mode') == 2) { if (!empty($this->_errors)) { foreach ($this->_errors as $errstr) { $ret .= $errstr . '<br/>'; @@ -111,6 +111,4 @@ } return $ret; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -108,6 +108,4 @@ $userDN = $uname . '@' . $this->ldap_domain_name; return $userDN; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -17,6 +17,7 @@ * @author Pierre-Eric MENUET <pe...@fr...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -202,12 +203,11 @@ */ public function __construct(XoopsDatabase $dao = null) { + $xoops = Xoops::getInstance(); $this->_dao = $dao; - // The config handler object allows us to look at the configuration options that are stored in the database - /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $config = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH); - foreach ($config as $key => $val) { + //Configuration options that are stored in the database + $configs = $xoops->getConfigs(XOOPS_CONF_AUTH); + foreach ($configs as $key => $val) { $this->$key = $val; } } @@ -335,6 +335,4 @@ } return $xoopsUser; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -79,14 +79,13 @@ */ public function __construct(XoopsAuth &$auth_instance) { + $xoops = Xoops::getInstance(); $this->_auth_instance = $auth_instance; - /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $config = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH); - foreach ($config as $key => $val) { + $configs = $xoops->getConfigs(XOOPS_CONF_AUTH); + foreach ($configs as $key => $val) { $this->$key = $val; } - $config_gen = $config_handler->getConfigsByCat(XOOPS_CONF); + $config_gen = $xoops->getConfigs(XOOPS_CONF); $this->default_TZ = $config_gen['default_TZ']; $this->theme_set = $config_gen['theme_set']; $this->com_mode = $config_gen['com_mode']; @@ -101,8 +100,9 @@ */ public function getXoopsUser($uname) { + $xoops = Xoops::getInstance(); /* @var $member_handler XoopsMemberHandler */ - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getHandler('member'); $criteria = new Criteria('uname', $uname); $getuser = $member_handler->getUsers($criteria); if (count($getuser) == 1) { @@ -150,9 +150,10 @@ */ public function add($datas, $uname, $pwd = null) { + $xoops = Xoops::getInstance(); $ret = false; /* @var $member_handler XoopsMemberHandler */ - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getHandler('member'); // Create XOOPS Database User $newuser = $member_handler->createUser(); $newuser->setVar('uname', $uname); @@ -177,7 +178,7 @@ $newuser->unsetNew(); return $newuser; } else { - redirect_header(XOOPS_URL . '/user.php', 5, $newuser->getHtmlErrors()); + $xoops->redirect(XOOPS_URL . '/user.php', 5, $newuser->getHtmlErrors()); } return $ret; } @@ -191,11 +192,12 @@ * @param string $pwd * @return bool|XoopsUser */ - public function change(&$xoopsUser, $datas, $uname, $pwd = null) + public function change(XoopsUser &$xoopsUser, $datas, $uname, $pwd = null) { + $xoops = Xoops::getInstance(); $ret = false; /* @var $member_handler XoopsMemberHandler */ - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getHandler('member'); $xoopsUser->setVar('pass', md5(stripslashes($pwd))); $tab_mapping = explode('|', $this->ldap_field_mapping); foreach ($tab_mapping as $mapping) { @@ -207,7 +209,7 @@ if ($member_handler->insertUser($xoopsUser)) { return $xoopsUser; } else { - redirect_header(XOOPS_URL . '/user.php', 5, $xoopsUser->getHtmlErrors()); + $xoops->redirect(XOOPS_URL . '/user.php', 5, $xoopsUser->getHtmlErrors()); } return $ret; } @@ -247,6 +249,4 @@ public function resetpwd() { } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -35,7 +35,7 @@ * * @param XoopsDatabase|null $dao */ - public function __construct($dao = null) + public function __construct(XoopsDatabase $dao = null) { $this->_dao = $dao; $this->auth_method = 'xoops'; @@ -50,14 +50,13 @@ */ public function authenticate($uname, $pwd = null) { + $xoops = Xoops::getInstance(); /* @var $member_handler XoopsMemberHandler */ - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getHandler('member'); $user = $member_handler->loginUser($uname, $pwd); if ($user == false) { $this->setErrors(1, _US_INCORRECTLOGIN); } return $user; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -45,8 +45,7 @@ static $auth_instance; if (!isset($auth_instance)) { /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $authConfig = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH); + $authConfig = $xoops->getConfigs(XOOPS_CONF_AUTH); if (empty($authConfig['auth_method'])) { // If there is a config error, we use xoops $xoops_auth_method = 'xoops'; } else { @@ -82,6 +81,4 @@ } return $auth_instance; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/apc.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/apc.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/apc.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -17,6 +17,7 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -59,12 +60,12 @@ * Called automatically by the cache frontend * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array()); * - * @param array $setting array of setting for the engine + * @param array $settings array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not * @see CacheEngine::__defaults * @access public */ - function init($settings = array()) + public function init($settings = array()) { parent::init($settings); return function_exists('apc_cache_info'); @@ -79,7 +80,7 @@ * @return boolean True if the data was succesfully cached, false on failure * @access public */ - function write($key, &$value, $duration) + public function write($key, &$value, $duration) { return apc_store($key, $value, $duration); } @@ -91,7 +92,7 @@ * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it * @access public */ - function read($key) + public function read($key) { return apc_fetch($key); } @@ -103,7 +104,7 @@ * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed * @access public */ - function delete($key) + public function delete($key) { return apc_delete($key); } @@ -114,10 +115,8 @@ * @return boolean True if the cache was succesfully cleared, false otherwise * @access public */ - function clear() + public function clear() { return apc_clear_cache('user'); } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -311,6 +311,4 @@ } return true; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -179,6 +179,4 @@ } return true; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -89,7 +89,7 @@ $defaults = array('fields' => array('data', 'expires')); $this->settings = array_merge($defaults, $this->settings); $this->fields = $this->settings['fields']; - $this->model = xoops_getHandler('cachemodel'); + $this->model = Xoops::getInstance()->getHandler('cachemodel'); return true; } @@ -102,7 +102,7 @@ */ public function gc() { - return $this->model->deleteAll(new Criteria($this->fields[1], time, '<= ')); + return $this->model->deleteAll(new Criteria($this->fields[1], 'time', '<= ')); } /** @@ -165,10 +165,8 @@ * @return boolean True if the cache was succesfully cleared, false otherwise * @access public */ - function clear() + public function clear() { return $this->model->deleteAll(); } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -168,6 +168,4 @@ } } } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -183,7 +183,7 @@ * * @access public */ - function gc() + static function gc() { $_this = XoopsCache::getInstance(); $config = $_this->config(); @@ -419,9 +419,7 @@ */ public function init($settings = array()) { - $this->settings = array_merge(array( - 'duration' => 31556926, 'probability' => 100 - ), $settings); + $this->settings = array_merge(array('duration' => 31556926, 'probability' => 100), $settings); return true; } @@ -494,6 +492,4 @@ { return $this->settings; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -34,6 +34,4 @@ 'skip_characters' => array( 'o', '0', 'i', 'l', '1' ) -); // characters that should not be used - -?> \ No newline at end of file +); // characters that should not be used \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -30,6 +30,4 @@ 'name' => 'xoopscaptcha', // captcha name 'skipmember' => true, // Skip CAPTCHA check for members 'maxattempts' => 10, // Maximum attempts for each session -); - -?> \ No newline at end of file +); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -25,5 +25,4 @@ 'public_key' => 'YourPublicApiKey', 'theme' => 'white', // 'red' | 'white' | 'blackglass' | 'clean' | 'custom' 'lang' => _LANGCODE -); -?> \ No newline at end of file +); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image/scripts/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image/scripts/image.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image/scripts/image.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -79,12 +79,18 @@ */ public $oImage; + /** + * Constructor + */ public function __construct() { $this->captcha_handler = XoopsCaptcha::getInstance(); $this->config = $this->captcha_handler->loadConfig("image"); } + /** + * @return void + */ public function loadImage() { $this->generateCode(); @@ -165,13 +171,14 @@ * Create CAPTCHA iamge with GD * Originated by DuGris' SecurityImage */ - // --------------------------------------------------------------------------- // - // Class : SecurityImage 1.5 // - // Author: DuGris aka L. Jen <http://www.dugris.info> // - // Email : Du...@wa... // - // Licence: GNU // - // Project: The XOOPS Project // - // --------------------------------------------------------------------------- // + + /** + * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @author DuGris aka L. Jen <http://www.dugris.info> <Du...@wa...> + * @version $Id$ + * @return void + */ public function createImageGd() { $this->loadFont(); @@ -219,12 +226,18 @@ imagedestroy($this->oImage); } + /** + * @return void + */ public function loadFont() { $fonts = $this->getList("fonts", "ttf"); $this->font = XOOPS_ROOT_PATH . "/class/captcha/image/fonts/" . $fonts[array_rand($fonts)]; } + /** + * @return void + */ public function setImageSize() { $MaxCharWidth = 0; @@ -414,7 +427,7 @@ /**#@-*/ /** - * Create CAPTCHA image with BMP + * Create CAPTCHA image with BMP * * @param string $file * @return string @@ -434,6 +447,4 @@ } $image_handler = new XoopsCaptchaImageHandler(); -$image_handler->loadImage(); - -?> \ No newline at end of file +$image_handler->loadImage(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -19,6 +19,7 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); class XoopsCaptchaImage extends XoopsCaptchaMethod @@ -85,6 +86,4 @@ { return '<img id="' . ($this->config["name"]) . '" src="' . XOOPS_URL . '/class/captcha/image/scripts/image.php" onclick=\'this.src="' . XOOPS_URL . '/class/captcha/image/scripts/image.php?refresh="+Math.random()' . '\' style="cursor: pointer; vertical-align: middle;" alt="" />'; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha/recaptchalib.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha/recaptchalib.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha/recaptchalib.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -201,6 +201,10 @@ array('domains' => $domain, 'app' => $appname)); } +/** + * @param $val + * @return string + */ function _recaptcha_aes_pad($val) { $block_size = 16; @@ -296,6 +300,4 @@ $url = recaptcha_mailhide_url($pubkey, $privkey, $email); return htmlentities($emailparts[0]) . "<a href='" . htmlentities($url) . "' onclick=\"window.open('" . htmlentities($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities($emailparts [1]); -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -70,6 +70,4 @@ } return $is_valid; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -17,6 +17,7 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); class XoopsCaptchaText extends XoopsCaptchaMethod @@ -54,6 +55,4 @@ } return '<span style="font-style: normal; font-weight: bold; font-size: 100%; font-color: #333; border: 1px solid #333; padding: 1px 5px;">' . $expression . '</span>'; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -27,44 +27,45 @@ /** * @var bool */ - var $active; + public $active; /** * @var XoopsCaptchaMethod */ - var $handler; + public $handler; /** * @var string */ - var $path_basic; + public $path_basic; /** * @var string */ - var $path_plugin; + public $path_plugin; /** * @var string */ - var $name; + public $name; /** * @var array */ - var $config = array(); + public $config = array(); /** * @var array */ - var $message = array(); + public $message = array(); /** * construct */ public function __construct() { - xoops_loadLanguage('captcha'); + $xoops = Xoops::getInstance(); + $xoops->loadLanguage('captcha'); // Load static configurations $this->path_basic = XOOPS_ROOT_PATH . '/class/captcha'; $this->path_plugin = XOOPS_ROOT_PATH . '/Frameworks/captcha'; @@ -279,7 +280,7 @@ * @param bool $clearSession * @return bool */ - function destroyGarbage($clearSession = false) + public function destroyGarbage($clearSession = false) { $this->loadHandler(); $this->handler->destroyGarbage(); @@ -384,12 +385,12 @@ /** * @var array */ - var $config; + public $config; /** * @var string */ - var $code; + public $code; /** * XoopsCaptchaMethod::__construct() @@ -428,7 +429,7 @@ * * @return string */ - function getCode() + public function getCode() { return strval($this->code); } @@ -438,7 +439,7 @@ * * @return string */ - function render() + public function render() { return ''; } @@ -446,7 +447,7 @@ /** * @return string */ - function renderValidationJS() + public function renderValidationJS() { return ''; } @@ -475,6 +476,4 @@ return true; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.tar.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.tar.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.tar.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -653,6 +653,4 @@ } return $file; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -163,6 +163,4 @@ pack('V', strlen($data)) . // offset to start of central dir "\x00\x00"; // .zip file comment length } // end of the 'file()' method -} // end of the 'zipfile' class - -?> \ No newline at end of file +} // end of the 'zipfile' class \ No newline at end of file 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-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -27,21 +27,33 @@ */ class XoopsCommentRenderer { + /** - * *#@+ - * - * @access private + * @var XoopsTpl */ private $_tpl; + + /** + * @var array + */ private $_comments = array(); + + /** + * @var bool + */ private $_useIcons = true; + + /** + * @var bool + */ private $_doIconCheck = false; - private $_statusText; /** - * *#@- + * @var array */ + private $_statusText; + /** * Constructor * @@ -315,7 +327,7 @@ $poster['id'] = intval($poster_id); if ($poster['id'] > 0) { /* @var $memberHandler XoopsMemberHandler */ - $memberHandler = xoops_gethandler('member'); + $memberHandler = Xoops::getInstance()->getHandler('member'); $com_poster = $memberHandler->getUser($poster['id']); if (!is_object($com_poster)) { $poster['id'] = 0; @@ -336,16 +348,17 @@ { $poster['id'] = intval($poster_id); if ($poster['id'] > 0) { - /* @var $memberHandler XoopsMemberHandler */ - $memberHandler = xoops_gethandler('member'); - $com_poster = $memberHandler->getUser($poster['id']); + $xoops = Xoops::getInstance(); + /* @var $member_handler XoopsMemberHandler */ + $member_handler = $xoops->getHandler('member'); + $com_poster = $member_handler->getUser($poster['id']); if (is_object($com_poster)) { $poster['uname'] = XoopsUserUtility::getUnameFromId($poster['id'], false, true); $poster_rank = $com_poster->rank(); $poster['rank_image'] = ($poster_rank['image'] != '') ? $poster_rank['image'] : 'blank.gif'; $poster['rank_title'] = $poster_rank['title']; $poster['avatar'] = $com_poster->getVar('user_avatar'); - $poster['regdate'] = formatTimestamp($com_poster->getVar('user_regdate'), 's'); + $poster['regdate'] = $xoops->formatTimestamp($com_poster->getVar('user_regdate'), 's'); $poster['from'] = $com_poster->getVar('user_from'); $poster['postnum'] = $com_poster->getVar('posts'); $poster['status'] = $com_poster->isOnline() ? _CM_ONLINE : ''; @@ -388,6 +401,4 @@ } return '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />'; } -} - -?> \ No newline at end of file +} \ No newline at end of file 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-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -39,7 +39,6 @@ protected $order = 'ASC'; /** - * * @var string */ protected $sort = ''; @@ -59,7 +58,6 @@ protected $start = 0; /** - * * @var string */ protected $groupby = ''; @@ -90,7 +88,6 @@ } /** - * * @return string */ public function getSort() @@ -99,7 +96,6 @@ } /** - * * @param string $order */ public function setOrder($order) @@ -110,7 +106,6 @@ } /** - * * @return string */ public function getOrder() @@ -119,7 +114,6 @@ } /** - * * @param int $limit */ public function setLimit($limit = 0) @@ -128,7 +122,6 @@ } /** - * * @return int */ public function getLimit() @@ -137,7 +130,6 @@ } /** - * * @param int $start */ public function setStart($start = 0) @@ -146,7 +138,6 @@ } /** - * * @return int */ public function getStart() @@ -155,7 +146,6 @@ } /** - * * @param string $group */ public function setGroupby($group) @@ -164,16 +154,12 @@ } /** - * * @return string */ public function getGroupby() { return $this->groupby ? " GROUP BY {$this->groupby}" : ""; } - /** - * *#@- - */ } /** @@ -288,13 +274,28 @@ class Criteria extends CriteriaElement { /** - * * @var string */ protected $prefix; + + /** + * @var string + */ protected $function; + + /** + * @var string + */ protected $column; + + /** + * @var string + */ protected $operator; + + /** + * @var mixed + */ protected $value; /** @@ -390,6 +391,4 @@ $cond = $this->render(); return empty($cond) ? '' : "WHERE {$cond}"; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/database.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/c... [truncated message content] |
From: <tr...@us...> - 2011-10-28 20:46:38
|
Revision: 7989 http://xoops.svn.sourceforge.net/xoops/?rev=7989&view=rev Author: trabis Date: 2011-10-28 20:46:30 +0000 (Fri, 28 Oct 2011) Log Message: ----------- Adding get methods for kernel handlers Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.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/userutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectcheckgroup.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectgroup.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/grouppermform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.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/checklogin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -69,14 +69,12 @@ } $xoops = Xoops::getInstance(); - /* @var $module_handler XoopsModuleHandler */ - $module_handler = $xoops->getHandler('module'); + $module_handler = $xoops->getModuleHandler(); if (!$module = $module_handler->getByDirname($dirname)) { trigger_error("Module '{$dirname}' does not exist", E_USER_WARNING); return null; } - /* @var $config_handler XoopsConfigHandler */ - $config_handler = $xoops->getHandler('config'); + $config_handler = $xoops->getConfigHandler(); $criteria = new CriteriaCompo(new Criteria('conf_modid', $module->getVar('mid'))); $configs = $config_handler->getConfigs($criteria); $moduleConfig = array(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -101,8 +101,7 @@ public function getXoopsUser($uname) { $xoops = Xoops::getInstance(); - /* @var $member_handler XoopsMemberHandler */ - $member_handler = $xoops->getHandler('member'); + $member_handler = $xoops->getMemberHandler(); $criteria = new Criteria('uname', $uname); $getuser = $member_handler->getUsers($criteria); if (count($getuser) == 1) { @@ -152,8 +151,7 @@ { $xoops = Xoops::getInstance(); $ret = false; - /* @var $member_handler XoopsMemberHandler */ - $member_handler = $xoops->getHandler('member'); + $member_handler = $xoops->getMemberHandler(); // Create XOOPS Database User $newuser = $member_handler->createUser(); $newuser->setVar('uname', $uname); @@ -196,8 +194,7 @@ { $xoops = Xoops::getInstance(); $ret = false; - /* @var $member_handler XoopsMemberHandler */ - $member_handler = $xoops->getHandler('member'); + $member_handler = $xoops->getMemberHandler(); $xoopsUser->setVar('pass', md5(stripslashes($pwd))); $tab_mapping = explode('|', $this->ldap_field_mapping); foreach ($tab_mapping as $mapping) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -51,8 +51,7 @@ public function authenticate($uname, $pwd = null) { $xoops = Xoops::getInstance(); - /* @var $member_handler XoopsMemberHandler */ - $member_handler = $xoops->getHandler('member'); + $member_handler = $xoops->getMemberHandler(); $user = $member_handler->loginUser($uname, $pwd); if ($user == false) { $this->setErrors(1, _US_INCORRECTLOGIN); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -89,7 +89,7 @@ $defaults = array('fields' => array('data', 'expires')); $this->settings = array_merge($defaults, $this->settings); $this->fields = $this->settings['fields']; - $this->model = Xoops::getInstance()->getHandler('cachemodel'); + $this->model = Xoops::getInstance()->getCachemodelHandler(); return true; } 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-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -326,9 +326,7 @@ { $poster['id'] = intval($poster_id); if ($poster['id'] > 0) { - /* @var $memberHandler XoopsMemberHandler */ - $memberHandler = Xoops::getInstance()->getHandler('member'); - $com_poster = $memberHandler->getUser($poster['id']); + $com_poster = Xoops::getInstance()->getMemberHandler()->getUser($poster['id']); if (!is_object($com_poster)) { $poster['id'] = 0; } @@ -349,8 +347,7 @@ $poster['id'] = intval($poster_id); if ($poster['id'] > 0) { $xoops = Xoops::getInstance(); - /* @var $member_handler XoopsMemberHandler */ - $member_handler = $xoops->getHandler('member'); + $member_handler = $xoops->getMemberHandler(); $com_poster = $member_handler->getUser($poster['id']); if (is_object($com_poster)) { $poster['uname'] = XoopsUserUtility::getUnameFromId($poster['id'], false, true); 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 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -316,8 +316,7 @@ } // Meta tags - /* @var $config_handler XoopsConfigHandler */ - $config_handler = $xoops->getHandler('config'); + $config_handler = $xoops->getConfigHandler(); $criteria = new CriteriaCompo(new Criteria('conf_modid', 0)); $criteria->add(new Criteria('conf_catid', XOOPS_CONF_METAFOOTER)); $config = $config_handler->getConfigs($criteria, 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 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -111,8 +111,7 @@ $template = null; $template = new XoopsTpl(); } - /* @var $block_handler XoopsBlockHandler */ - $block_handler = $xoops->getHandler('block'); + $block_handler = $xoops->getBlockHandler(); $block_arr = $block_handler->getAllByGroupModule($groups, $mid, $isStart, XOOPS_BLOCK_VISIBLE); $xoops->preload->triggerEvent('core.class.theme_blocks.retrieveBlocks', array(&$this, &$template, &$block_arr)); foreach ($block_arr as $block) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -43,8 +43,7 @@ } if (!empty($user) && !is_object($user)) { - /* @var $member_handler XoopsMemberHandler */ - $member_handler = $xoops->gethandler('member'); + $member_handler = $xoops->getMemberHandler(); $user = $member_handler->getUser($user); } if (!is_object($user)) { @@ -166,8 +165,7 @@ // Check if uname/email already exists if the user is a new one $uid = is_object($user) ? $user->getVar('uid') : 0; - /* @var $user_handler XoopsUserHandler */ - $user_handler = $xoops->getHandler('user'); + $user_handler = $xoops->getUserHandler(); $myts = MyTextSanitizer::getInstance(); $criteria = new CriteriaCompo(new Criteria('uname', $myts->addSlashes($uname))); @@ -278,8 +276,8 @@ if (count($userid) > 0) { $criteria = new CriteriaCompo(new Criteria('level', 0, '>')); $criteria->add(new Criteria('uid', "('" . implode(',', array_unique($userid)) . "')", 'IN')); - /* @var $user_handler XoopsUserHandler */ - $user_handler = $xoops->getHandler('user'); + + $user_handler = $xoops->getUserHandler(); if (!$rows = $user_handler->getAll($criteria, array('uid', 'uname', 'name'), false, true)) { return $users; } @@ -315,8 +313,7 @@ $userid = intval($userid); $username = ''; if ($userid > 0) { - /* @var $member_handler XoopsMemberHandler */ - $member_handler = $xoops->gethandler('member'); + $member_handler = $xoops->getMemberhandler(); $user = $member_handler->getUser($userid); if (is_object($user)) { if ($usereal && $user->getVar('name')) { 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-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -447,7 +447,7 @@ * @param mixed $optional * @return XoopsObjectHandler|XoopsPersistableObjectHandler|null */ - public function getHandler($name, $optional = false) + public function getKernel($name, $optional = false) { $name = strtolower(trim($name)); $class = ''; @@ -471,12 +471,221 @@ } /** + * @param mixed $optional + * @return XoopsAvatarHandler + */ + public function getAvatarHandler($optional = false) + { + return $this->getKernel('avatar', $optional); + } + + /** + * @param mixed $optional + * @return XoopsBlockHandler + */ + public function getBlockHandler($optional = false) + { + return $this->getKernel('block', $optional); + } + + /** + * @param mixed $optional + * @return XoopsCachemodelHandler + */ + public function getCachemodelHandler($optional = false) + { + return $this->getKernel('cachemodel', $optional); + } + + /** + * @param mixed $optional + * @return XoopsConfigHandler + */ + public function getConfigHandler($optional = false) + { + return $this->getKernel('config', $optional); + } + + /** + * @param mixed $optional + * @return XoopsCommentHandler + */ + public function getCommentHandler($optional = false) + { + return $this->getKernel('comment', $optional); + } + + /** + * @param mixed $optional + * @return XoopsConfigitemHandler + */ + public function getConfigitemHandler($optional = false) + { + return $this->getKernel('configitem', $optional); + } + + /** + * @param mixed $optional + * @return XoopsConfigoptionHandler + */ + public function getConfigoptionHandler($optional = false) + { + return $this->getKernel('configoption', $optional); + } + + /** + * @param mixed $optional + * @return XoopsGroupHandler + */ + public function getGroupHandler($optional = false) + { + return $this->getKernel('group', $optional); + } + + /** + * @param mixed $optional + * @return XoopsGrouppermHandler + */ + public function getGrouppermHandler($optional = false) + { + return $this->getKernel('groupperm', $optional); + } + + /** + * @param mixed $optional + * @return XoopsImageHandler + */ + public function getImageHandler($optional = false) + { + return $this->getKernel('image', $optional); + } + + /** + * @param mixed $optional + * @return XoopsImagecategoryHandler + */ + public function getImagecategoryHandler($optional = false) + { + return $this->getKernel('imagecategory', $optional); + } + + /** + * @param mixed $optional + * @return XoopsImagesetHandler + */ + public function getImagesetHandler($optional = false) + { + return $this->getKernel('imageset', $optional); + } + + /** + * @param mixed $optional + * @return XoopsImagesetimgHandler + */ + public function getImagesetimgHandler($optional = false) + { + return $this->getKernel('imagesetimg', $optional); + } + + /** + * @param mixed $optional + * @return XoopsMemberHandler + */ + public function getMemberHandler($optional = false) + { + return $this->getKernel('member', $optional); + } + + /** + * @param mixed $optional + * @return XoopsConfigoptionHandler + */ + public function getMembershipHandler($optional = false) + { + return $this->getKernel('membership', $optional); + } + + /** + * @param mixed $optional + * @return XoopsModuleHandler + */ + public function getModuleHandler($optional = false) + { + return $this->getKernel('module', $optional); + } + + /** + * @param mixed $optional + * @return XoopsNotificationHandler + */ + public function getNotificationHandler($optional = false) + { + return $this->getKernel('notification', $optional); + } + + /** + * @param mixed $optional + * @return XoopsOnlineHandler + */ + public function getOnlineHandler($optional = false) + { + return $this->getKernel('online', $optional); + } + + /** + * @param mixed $optional + * @return XoopsPrivmessageHandler + */ + public function getPrivmessageHandler($optional = false) + { + return $this->getKernel('privmessage', $optional); + } + + + /** + * @param mixed $optional + * @return XoopsSessionHandler + */ + public function getSessionHandler($optional = false) + { + return $this->getKernel('session', $optional); + } + + /** + * @param mixed $optional + * @return XoopsTplfileHandler + */ + public function getTplfileHandler($optional = false) + { + return $this->getKernel('tplfile', $optional); + } + + /** + * @param mixed $optional + * @return XoopsTplsetHandler + */ + public function getTplsetHandler($optional = false) + { + return $this->getKernel('tplset', $optional); + } + + /** + * @param mixed $optional + * @return XoopsUserHandler + */ + public function getUserHandler($optional = false) + { + return $this->getKernel('user', $optional); + } + + + /** * @param string|null $name * @param string|null $module_dir * @param bool $optional * @return bool */ - public function getModuleHandler($name = null, $module_dir = null, $optional = false) + public function getHandler($name = null, $module_dir = null, $optional = false) { // if $module_dir is not specified if (!isset($module_dir)) { @@ -1071,14 +1280,7 @@ } include_once XOOPS_ROOT_PATH . '/class/xoopsmailer.php'; - if (file_exists($file = XOOPS_ROOT_PATH . '/language/' . Xoops::getInstance()->config['language'] . '/xoopsmailerlocal.php')) { - include_once $file; - } else { - if (file_exists($file = XOOPS_ROOT_PATH . '/language/english/xoopsmailerlocal.php')) { - include_once $file; - } - } - unset($mailer); + $this->loadLanguage('xoopsmailerlocal'); if (class_exists('XoopsMailerLocal')) { $mailer = new XoopsMailerLocal(); } else { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectcheckgroup.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectcheckgroup.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectcheckgroup.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -35,9 +35,7 @@ { parent::__construct($caption, $name, $value, '', true); $this->columns = 3; - /* @var XoopsMemberHandler $member_handler */ - $member_handler = Xoops::getInstance()->getHandler('member'); - $this->userGroups = $member_handler->getGroupList(); + $this->userGroups = Xoops::getInstance()->getMemberHandler()->getGroupList(); foreach ($this->userGroups as $group_id => $group_name) { $this->addOption($group_id, $group_name); } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectgroup.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectgroup.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectgroup.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -38,8 +38,7 @@ public function __construct($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false) { parent::__construct($caption, $name, $value, $size, $multiple); - /* @var $member_handler XoopsMemberHandler */ - $member_handler = Xoops::getInstance()->getHandler('member'); + $member_handler = Xoops::getInstance()->getMemberHandler(); if (!$include_anon) { $this->addOptionArray($member_handler->getGroupList(new Criteria('groupid', XOOPS_GROUP_ANONYMOUS, '!='))); } else { 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 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectuser.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -46,8 +46,7 @@ if ($include_anon) { $select_element->addOption(0, $xoops->config['anonymous']); } - /* @var $member_handler XoopsMemberHandler */ - $member_handler = $xoops->getHandler('member'); + $member_handler = $xoops->getMemberHandler(); $user_count = $member_handler->getUserCount(); $value = is_array($value) ? $value : (empty($value) ? array() : array($value)); if ($user_count > $limit && count($value) > 0) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/grouppermform.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/grouppermform.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/grouppermform.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -134,10 +134,8 @@ $this->_itemTree[$item_id]['allchild'] = array(); $this->_loadAllChildItemIds($item_id, $this->_itemTree[$item_id]['allchild']); } - /* @var $gperm_handler XoopsGrouppermHandler */ - $gperm_handler = $xoops->getHandler('groupperm'); - /* @var $member_handler XoopsMemberHandler */ - $member_handler = $xoops->getHandler('member'); + $gperm_handler = $xoops->getGrouppermHandler(); + $member_handler = $xoops->getMemberHandler(); $glist = $member_handler->getGroupList(); foreach (array_keys($glist) as $i) { if ($i == XOOPS_GROUP_ANONYMOUS && !$this->_showAnonymous) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -441,12 +441,12 @@ private function sendPM($uid, $subject, $body) { $xoops = Xoops::getInstance(); - $pm_handler = $xoops->getHandler('privmessage'); + $pm_handler = $xoops->getPrivmessageHandler(); $pm = $pm_handler->create(); $pm->setVar("subject", $subject); // RMV-NOTIFY - $pm->setVar('from_userid', !empty($this->fromUser) ? $this->fromUser->getVar('uid') - : (!$xoops->isUser() ? 1 : $xoops->user->getVar('uid'))); + $pm->setVar('from_userid', !empty($this->fromUser) ? $this->fromUser->getVar('uid') : (!$xoops->isUser() ? 1 + : $xoops->user->getVar('uid'))); $pm->setVar("msg_text", $body); $pm->setVar("to_userid", $uid); if (!$pm_handler->insert($pm)) { @@ -602,9 +602,8 @@ public function setToGroups(XoopsGroup $group) { if (!is_array($group)) { - /* @var $member_handler XoopsMemberHandler */ - $member_handler = Xoops::getInstance()->getHandler('member'); - $this->setToUsers($member_handler->getUsersByGroup($group->getVar('groupid'), true)); + $this->setToUsers(Xoops::getInstance()->getMemberHandler() + ->getUsersByGroup($group->getVar('groupid'), true)); } else { foreach ($group as $g) { 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-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -38,8 +38,7 @@ $op = $_GET['op']; } -/* @var $config_handler XoopsConfigHandler */ -$config_handler = $xoops->getHandler('config'); +$config_handler = $xoops->getConfigHandler(); $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER); $myts = MyTextSanitizer::getInstance(); if ($op == 'saveuser') { @@ -90,8 +89,7 @@ echo '</div><br />'; $op = 'editprofile'; } else { - /* @var $member_handler XoopsMemberHandler */ - $member_handler = $xoops->getHandler('member'); + $member_handler = $xoops->getMemberHandler(); $edituser = $member_handler->getUser($uid); $edituser->setVar('name', $_POST['name']); if ($xoopsConfigUser['allow_chgmail'] == 1) { @@ -258,7 +256,7 @@ $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); $form->display(); } - $avatar_handler = $xoops->getHandler('avatar'); + $avatar_handler = $xoops->getAvatarHandler(); $form2 = new XoopsThemeForm(_US_CHOOSEAVT, 'uploadavatar', 'edituser.php', 'post', true); $avatar_select = new XoopsFormSelect('', 'user_avatar', $xoops->user->getVar('user_avatar')); $avatar_list = $avatar_handler->getList('S', true); @@ -305,7 +303,7 @@ if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { $uploader->setPrefix('cavt'); if ($uploader->upload()) { - $avt_handler = $xoops->getHandler('avatar'); + $avt_handler = $xoops->getAvatarHandler(); $avatar = $avt_handler->create(); $avatar->setVar('avatar_file', 'avatars/' . $uploader->getSavedFileName()); $avatar->setVar('avatar_name', $xoops->user->getVar('uname')); @@ -351,8 +349,7 @@ exit(); } $user_avatar = ''; - /* @var $avt_handler XoopsAvatarHandler */ - $avt_handler = $xoops->getHandler('avatar'); + $avt_handler = $xoops->getAvatarHandler(); if (!empty($_POST['user_avatar'])) { $user_avatar = $myts->addSlashes(trim($_POST['user_avatar'])); $criteria_avatar = new CriteriaCompo(new Criteria('avatar_file', $user_avatar)); @@ -367,7 +364,7 @@ if (0 === strpos($user_avatarpath, realpath(XOOPS_UPLOAD_PATH)) && is_file($user_avatarpath)) { $oldavatar = $xoops->user->getVar('user_avatar'); $xoops->user->setVar('user_avatar', $user_avatar); - $member_handler = $xoops->getHandler('member'); + $member_handler = $xoops->getMemberHandler(); if (!$member_handler->insertUser($xoops->user)) { $xoops->header(); echo $xoops->user->getHtmlErrors(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/image.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/image.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -45,7 +45,7 @@ $xoops->db = XoopsDatabaseFactory::getDatabaseConnection(); // ################# Include class manager file ############## -$imagehandler = $xoops->getHandler('image'); +$imagehandler = $xoops->getImageHandler(); $criteria = new CriteriaCompo(new Criteria('i.image_display', 1)); $criteria->add(new Criteria('i.image_id', $image_id)); $image = $imagehandler->getObjects($criteria, false, true); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/imagemanager.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/imagemanager.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/imagemanager.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -42,7 +42,7 @@ $xoopsTpl->assign('sitename', htmlspecialchars($xoops->config['sitename'], ENT_QUOTES)); $target = htmlspecialchars($target, ENT_QUOTES); $xoopsTpl->assign('target', $target); - $imgcat_handler = $xoops->getHandler('imagecategory'); + $imgcat_handler = $xoops->getImagecategoryHandler(); $catlist = $imgcat_handler->getList($group, 'imgcat_read', 1); $catcount = count($catlist); $xoopsTpl->assign('lang_align', _ALIGN); @@ -67,12 +67,12 @@ } $xoopsTpl->assign('cat_options', $cat_options); if ($catshow > 0) { - $image_handler = $xoops->getHandler('image'); + $image_handler = $xoops->getImageHandler(); $criteria = new CriteriaCompo(new Criteria('imgcat_id', $catshow)); $criteria->add(new Criteria('image_display', 1)); $total = $image_handler->getCount($criteria); if ($total > 0) { - $imgcat_handler = $xoops->getHandler('imagecategory'); + $imgcat_handler = $xoops->getImagecategoryHandler(); $imgcat = $imgcat_handler->get($catshow); $xoopsTpl->assign('image_total', $total); $xoopsTpl->assign('lang_image', _IMAGE); @@ -132,15 +132,14 @@ } if ($op == 'upload') { - $imgcat_handler = $xoops->getHandler('imagecategory'); + $imgcat_handler = $xoops->getImagecategoryHandler(); $imgcat_id = intval($_GET['imgcat_id']); $imgcat = $imgcat_handler->get($imgcat_id); $error = false; if (!is_object($imgcat)) { $error = true; } else { - /* @var $imgcatperm_handler XoopsGrouppermHandler */ - $imgcatperm_handler = $xoops->getHandler('groupperm'); + $imgcatperm_handler = $xoops->getGrouppermHandler(); if ($xoops->isUser()) { if (!$imgcatperm_handler->checkRight('imgcat_write', $imgcat_id, $xoops->user->getGroups())) { $error = true; @@ -184,13 +183,13 @@ $image_nicename = isset($_POST['image_nicename']) ? $_POST['image_nicename'] : ''; $xoops_upload_file = isset($_POST['xoops_upload_file']) ? $_POST['xoops_upload_file'] : array(); $imgcat_id = isset($_POST['imgcat_id']) ? intval($_POST['imgcat_id']) : 0; - $imgcat_handler = $xoops->getHandler('imagecategory'); + $imgcat_handler = $xoops->getImagecategoryHandler(); $imgcat = $imgcat_handler->get($imgcat_id); $error = false; if (!is_object($imgcat)) { $error = true; } else { - $imgcatperm_handler = $xoops->getHandler('groupperm'); + $imgcatperm_handler = $xoops->getGrouppermHandler(); if ($xoops->isUser()) { if (!$imgcatperm_handler->checkRight('imgcat_write', $imgcat_id, $xoops->user->getGroups())) { $error = true; @@ -218,7 +217,7 @@ if (!$uploader->upload()) { $err = $uploader->getErrors(); } else { - $image_handler = xoops_gethandler('image'); + $image_handler = $xoops->getImageHandler();; $image = $image_handler->create(); $image->setVar('image_name', $uploader->getSavedFileName()); $image->setVar('image_nicename', $image_nicename); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/checklogin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/checklogin.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/checklogin.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -20,7 +20,7 @@ defined('XOOPS_ROOT_PATH') or die('Restricted access'); $xoops = Xoops::getInstance(); -xoops_loadLanguage('user'); +$xoops->loadLanguage('user'); $uname = !isset($_POST['uname']) ? '' : trim($_POST['uname']); $pass = !isset($_POST['pass']) ? '' : trim($_POST['pass']); @@ -28,11 +28,11 @@ redirect_header(XOOPS_URL . '/user.php', 1, _US_INCORRECTLOGIN); exit(); } -/* @var $member_handler XoopsMemberHandler */ -$member_handler = xoops_gethandler('member'); + +$member_handler = $xoops->getMemberHandler(); $myts = MyTextsanitizer::getInstance(); -xoops_loadLanguage('auth'); +$xoops->loadLanguage('auth'); $xoopsAuth = XoopsAuthFactory::getAuthConnection($myts->addSlashes($uname)); $user = $xoopsAuth->authenticate($myts->addSlashes($uname), $myts->addSlashes($pass)); @@ -59,8 +59,8 @@ $user->setVar('last_login', time()); if (!$member_handler->insertUser($user)) { } - // Regenrate a new session id and destroy old session - $xoops->sess_handler->regenerate_id(true); + // Regenerate a new session id and destroy old session + $xoops->getSessionHandler()->regenerate_id(true); $_SESSION = array(); $_SESSION['xoopsUserId'] = $user->getVar('uid'); $_SESSION['xoopsUserGroups'] = $user->getGroups(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -22,6 +22,7 @@ date_default_timezone_set('Europe/London'); global $xoops; +$GLOBALS['xoops'] =& $xoops; /** * YOU SHOULD NEVER USE THE FOLLOWING TO CONSTANTS, THEY WILL BE REMOVED @@ -59,7 +60,7 @@ $xoops = Xoops::getInstance(); $xoops->pathTranslation(); -$xoops->preload = XoopsPreload::getInstance(); +$xoops->preload = $xoopsPreload; $xoops->option =& $GLOBALS['xoopsOption']; /** @@ -134,7 +135,7 @@ * Start of Error Reportings. */ if ($xoops->getConfig('debug_mode') == 1 || $xoops->getConfig('debug_mode') == 2) { - xoops_loadLanguage('logger'); + $xoops->loadLanguage('logger'); $xoops->logger->enable(); $xoops->logger->usePopup = ($xoops->getConfig('debug_mode') == 2); } else { @@ -150,17 +151,14 @@ * Load Language settings and defines */ $xoops->preload->triggerEvent('core.include.common.language'); -xoops_loadLanguage('global'); -xoops_loadLanguage('errors'); +$xoops->loadLanguage('global'); +$xoops->loadLanguage('errors'); /** * User Sessions */ -/* @var $member_handler XoopsMemberHandler */ -$member_handler = $xoops->gethandler('member'); -/* @var $sess_handler XoopsSessionHandler */ -$xoops->sess_handler = $xoops->gethandler('session'); -$sess_handler =& $xoops->sess_handler; +$member_handler = $xoops->getMemberHandler(); +$sess_handler = $xoops->getSessionHandler(); if ($xoops->getConfig('use_ssl') && isset($_POST[$xoops->getConfig('sslpost_name')]) && $_POST[$xoops->getConfig('sslpost_name')] != '' ) { @@ -177,8 +175,8 @@ } } session_set_save_handler( - array(&$xoops->sess_handler, 'open'), array(&$xoops->sess_handler, 'close'), array(&$xoops->sess_handler, 'read'), - array(&$xoops->sess_handler, 'write'), array(&$xoops->sess_handler, 'destroy'), array(&$xoops->sess_handler, 'gc')); + array(&$sess_handler, 'open'), array(&$sess_handler, 'close'), array(&$sess_handler, 'read'), + array(&$sess_handler, 'write'), array(&$sess_handler, 'destroy'), array(&$sess_handler, 'gc')); session_start(); /** @@ -211,13 +209,12 @@ setcookie($xoops->getConfig('usercookie'), 0, -1, '/'); } else { if ((intval($xoops->user->getVar('last_login')) + 60 * 5) < time()) { - /* @var $user_handler XoopsUserHandler */ - $user_handler = $xoops->gethandler('user'); + $user_handler = $xoops->getUserHandler(); $criteria = new Criteria('uid', $_SESSION['xoopsUserId']); $user_handler->updateAll('last_login', time(), $criteria, true); unset($criteria); } - $xoops->sess_handler->update_cookie(); + $sess_handler->update_cookie(); if (isset($_SESSION['xoopsUserGroups'])) { $xoops->user->setGroups($_SESSION['xoopsUserGroups']); } else { @@ -263,8 +260,7 @@ $xoops->moduleDirname = 'system'; if (file_exists('./xoops_version.php')) { $url_arr = explode('/', strstr($_SERVER['PHP_SELF'], '/modules/')); - /* @var $module_handler XoopsModuleHandler */ - $module_handler = $xoops->gethandler('module'); + $module_handler = $xoops->getModulehandler(); $xoops->module = $module_handler->getByDirname($url_arr[2]); $xoops->moduleDirname = $url_arr[2]; unset($url_arr); @@ -274,8 +270,7 @@ echo '<h4>' . _MODULENOEXIST . '</h4>'; $xoops->footer(); } - /* @var $moduleperm_handler XoopsGrouppermHandler */ - $moduleperm_handler = $xoops->gethandler('groupperm'); + $moduleperm_handler = $xoops->getGrouppermHandler(); if ($xoops->isUser()) { if (!$moduleperm_handler->checkRight('module_read', $xoops->module->getVar('mid'), $xoops->user->getGroups())) { $xoops->redirect(XOOPS_URL, 1, _NOPERM, false); 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-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -27,7 +27,8 @@ { $xoops = Xoops::getInstance(); $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); - return $xoops->getHandler($name, $optional); + $method = 'get' . ucfirst(strtolower(trim($name))) . 'Handler'; + return $xoops->$method($optional); } /** @@ -40,7 +41,7 @@ { $xoops = Xoops::getInstance(); $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); - return $xoops->getModuleHandler($name, $module_dir, $optional); + return $xoops->getHandler($name, $module_dir, $optional); } /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/index.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/index.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -25,38 +25,33 @@ $xoops->preload->triggerEvent('core.index.start'); //check if start page is defined -if (isset($xoops->config['startpage']) && $xoops->config['startpage'] != "" && $xoops->config['startpage'] != "--" && xoops_isActiveModule($xoops->config['startpage'])) { +if ($xoops->getConfig('startpage') != "" && $xoops->getConfig('startpage') != "--" && $xoops->isActiveModule($xoops->getConfig('startpage'))) { // Temporary solution for start page redirection define("XOOPS_STARTPAGE_REDIRECTED", 1); - /* @var $module_handler XoopsModuleHandler */ - $module_handler = xoops_gethandler('module'); - $xoops->module = $module_handler->getByDirname($xoops->config['startpage']); + $module_handler = $xoops->getModuleHandler(); + $xoops->module = $module_handler->getByDirname($xoops->getConfig('startpage')); if (!$xoops->isModule() || !$xoops->module->getVar('isactive')) { $xoops->header(); echo "<h4>" . _MODULENOEXIST . "</h4>"; $xoops->footer(); - exit(); } - /* @var $moduleperm_handler XoopsGrouppermHandler */ - $moduleperm_handler = xoops_gethandler('groupperm'); + $moduleperm_handler = $xoops->getGrouppermHandler(); if ($xoops->isUser()) { if (!$moduleperm_handler->checkRight('module_read', $xoops->module->getVar('mid'), $xoops->user->getGroups())) { - redirect_header(XOOPS_URL, 1, _NOPERM, false); - exit(); + $xoops->redirect(XOOPS_URL, 1, _NOPERM, false); } $xoops->userIsAdmin = $xoops->user->isAdmin($xoops->module->getVar('mid')); } else { if (!$moduleperm_handler->checkRight('module_read', $xoops->module->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) { - redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM); - exit(); + $xoops->redirect(XOOPS_URL . "/user.php", 1, _NOPERM); } } if ($xoops->module->getVar('hasconfig') == 1 || $xoops->module->getVar('hascomments') == 1 || $xoops->module->getVar('hasnotification') == 1) { - $xoops->moduleConfig = $config_handler->getConfigsByCat(0, $xoops->module->getVar('mid')); + $xoops->moduleConfig = $xoops->getModuleConfigs(); } - chdir('modules/' . $xoops->config['startpage'] . '/'); - xoops_loadLanguage('main', $xoops->module->getVar('dirname', 'n')); + chdir('modules/' . $xoops->getConfig('startpage') . '/'); + $xoops->loadLanguage('main', $xoops->module->getVar('dirname', 'n')); $parsed = parse_url(XOOPS_URL); $url = isset($parsed['scheme']) ? $parsed['scheme'] . '://' : 'http://'; if (isset($parsed['host'])) { @@ -68,12 +63,11 @@ $url .= $_SERVER['HTTP_HOST']; } - $_SERVER['REQUEST_URI'] = substr(XOOPS_URL, strlen($url)) . '/modules/' . $xoops->config['startpage'] . '/index.php'; - include $xoops->path('modules/' . $xoops->config['startpage'] . '/index.php'); + $_SERVER['REQUEST_URI'] = substr(XOOPS_URL, strlen($url)) . '/modules/' . $xoops->getConfig('startpage') . '/index.php'; + include $xoops->path('modules/' . $xoops->getConfig('startpage') . '/index.php'); exit(); } else { $xoops->option['show_cblock'] = 1; $xoops->header("db:system_homepage.html"); $xoops->footer(); -} -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.php 2011-10-27 23:15:24 UTC (rev 7988) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/lostpass.php 2011-10-28 20:46:30 UTC (rev 7989) @@ -31,8 +31,7 @@ } $myts = MyTextSanitizer::getInstance(); -/* @var $member_handler XoopsMemberHandler */ -$member_handler = xoops_gethandler('member'); +$member_handler = $xoops->getMemberHandler(); $getuser = $member_handler->getUsers(new Criteria('email', $myts->addSlashes($email))); if (empty($getuser)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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] |
From: <tr...@us...> - 2011-10-29 19:46:53
|
Revision: 7996 http://xoops.svn.sourceforge.net/xoops/?rev=7996&view=rev Author: trabis Date: 2011-10-29 19:46:46 +0000 (Sat, 29 Oct 2011) Log Message: ----------- formatTimestamp belongs in XoopsLocal 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/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/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.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 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -345,7 +345,6 @@ function renderAbout($paypal = '', $logo_xoops = true) { - $xoops = Xoops::getInstance(); $path = XOOPS_URL . "/Frameworks/moduleclasses/icons/32/"; $ret = "<table>\n<tr>\n"; @@ -353,9 +352,9 @@ $date = explode('/',$this->_obj->getInfo('release_date')); $author = explode(',',$this->_obj->getInfo('author')); $nickname = explode(',',$this->_obj->getInfo('nickname')); - $release_date = $xoops->formatTimestamp(mktime(0, 0, 0, $date[1], $date[2], $date[0]), 's'); + $release_date = XoopsLocal::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">' . $xoops->formatTimestamp($this->_obj->getVar("last_update"),"m") . '</text><br /> + <label>' . _AM_MODULEADMIN_ABOUT_UPDATEDATE . '</label><text class="bold">' . XoopsLocal::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/backend.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -31,7 +31,7 @@ $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', $xoops->formatTimestamp(time(), 'rss')); + $tpl->assign('channel_lastbuild', XoopsLocal::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'); @@ -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' => $xoops->formatTimestamp($story->published(), 'rss'), + 'pubdate' => XoopsLocal::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 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/banners.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -218,8 +218,8 @@ <td>{$impressions}</td> <td>{$clicks}</td> <td>{$percent}%</td> - <td>" . $xoops->formatTimestamp($datestart) . "</td> - <td>" . $xoops->formatTimestamp($dateend) . "</td></tr></tbody>"; + <td>" . XoopsLocal::formatTimestamp($datestart) . "</td> + <td>" . XoopsLocal::formatTimestamp($dateend) . "</td></tr></tbody>"; } echo "</table></div>"; } 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 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -124,7 +124,6 @@ */ public function renderFlatView($admin_view = false) { - $xoops = Xoops::getInstance(); foreach ($this->_comments as $i => $comment) { /* @var $comment XoopsComment */ if (false != $this->_useIcons) { @@ -146,8 +145,8 @@ $this->_comments[$i] = $comment; $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'), + 'date_posted' => XoopsLocal::formatTimestamp($comment->getVar('com_created'), 'm'), + 'date_modified' => XoopsLocal::formatTimestamp($comment->getVar('com_modified'), 'm'), 'poster' => $poster )); } @@ -164,7 +163,6 @@ */ 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(); @@ -206,8 +204,8 @@ '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'), + 'date_posted' => XoopsLocal::formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), + 'date_modified' => XoopsLocal::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 )); @@ -227,7 +225,6 @@ */ 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'); @@ -238,7 +235,7 @@ ? $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, + 'date_posted' => XoopsLocal::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')) @@ -272,7 +269,6 @@ */ 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) { @@ -303,8 +299,8 @@ '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'), + 'date_posted' => XoopsLocal::formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), + 'date_modified' => XoopsLocal::formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid')), 'replies' => $replies )); } @@ -322,7 +318,6 @@ */ 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'); @@ -336,8 +331,8 @@ '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'), + 'date_posted' => XoopsLocal::formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), + 'date_modified' => XoopsLocal::formatTimestamp($thread[$key]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($thread[$key]['obj']->getVar('com_uid')) ); @@ -400,7 +395,7 @@ $poster['rank_image'] = ($poster_rank['image'] != '') ? $poster_rank['image'] : 'blank.gif'; $poster['rank_title'] = $poster_rank['title']; $poster['avatar'] = $com_poster->getVar('user_avatar'); - $poster['regdate'] = $xoops->formatTimestamp($com_poster->getVar('user_regdate'), 's'); + $poster['regdate'] = XoopsLocal::formatTimestamp($com_poster->getVar('user_regdate'), 's'); $poster['from'] = $com_poster->getVar('user_from'); $poster['postnum'] = $com_poster->getVar('posts'); $poster['status'] = $com_poster->isOnline() ? _CM_ONLINE : ''; 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 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -441,7 +441,6 @@ return $this->userIsAdmin; } - /** * @param mixed $name * @param mixed $optional @@ -975,19 +974,6 @@ } /** - * Function to display formatted times in user timezone - * - * @param int $time - * @param string $format - * @param string $timeoffset - * @return string - */ - public function formatTimestamp($time, $format = 'l', $timeoffset = '') - { - return XoopsLocal::formatTimestamp($time, $format, $timeoffset); - } - - /** * Function to calculate server timestamp from user entered time (timestamp) * * @param int $timestamp 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 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -209,7 +209,7 @@ { $xoops = Xoops::getInstance(); $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); - return $xoops->formatTimestamp($time, $format, $timeoffset); + return XoopsLocal::formatTimestamp($time, $format, $timeoffset); } /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/readpmsg.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -86,7 +86,7 @@ echo "</td><td><img src='images/subject/" .$iconName . "' alt='' /> " . _PM_SENTC . "" . $xoops->formatTimestamp($pm_arr[0]->getVar("msg_time")); } else { - echo "</td><td>" . _PM_SENTC . "" . $xoops->formatTimestamp($pm_arr[0]->getVar("msg_time")); + echo "</td><td>" . _PM_SENTC . "" . XoopsLocal::formatTimestamp($pm_arr[0]->getVar("msg_time")); } //------------- mamba Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -197,7 +197,7 @@ $uname = XoopsUser::getUnameFromId($results[$i]['uid']); echo " <a href='" . XOOPS_URL . "/userinfo.php?uid=" . $results[$i]['uid'] . "' title=''>" . $uname . "</a>\n"; } - echo !empty($results[$i]['time']) ? " (" . $xoops->formatTimestamp(intval($results[$i]['time'])) . ")" + echo !empty($results[$i]['time']) ? " (" . XoopsLocal::formatTimestamp(intval($results[$i]['time'])) . ")" : ""; echo "</span><br />\n"; } @@ -262,7 +262,7 @@ $uname = XoopsUser::getUnameFromId($results[$i]['uid']); echo " <a href='" . XOOPS_URL . "/userinfo.php?uid=" . $results[$i]['uid'] . "'>" . $uname . "</a>\n"; } - echo !empty($results[$i]['time']) ? " (" . $xoops->formatTimestamp(intval($results[$i]['time'])) . ")" : ""; + echo !empty($results[$i]['time']) ? " (" . XoopsLocal::formatTimestamp(intval($results[$i]['time'])) . ")" : ""; echo "</span><br />\n"; } echo '<table><tr>'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -118,7 +118,7 @@ $xoops->tpl->assign('lang_statistics', _US_STATISTICS); $xoops->tpl->assign('lang_membersince', _US_MEMBERSINCE); $var = $thisUser->getVar('user_regdate'); -$xoops->tpl->assign('user_joindate', $xoops->formatTimestamp($var, 's')); +$xoops->tpl->assign('user_joindate', XoopsLocal::formatTimestamp($var, 's')); $xoops->tpl->assign('lang_rank', _US_RANK); $xoops->tpl->assign('lang_posts', _US_POSTS); $xoops->tpl->assign('lang_basicInfo', _US_BASICINFO); @@ -154,7 +154,7 @@ $xoops->tpl->assign('user_ranktitle', $userrank['title']); $date = $thisUser->getVar("last_login"); if (!empty($date)) { - $xoops->tpl->assign('user_lastlogin', $xoops->formatTimestamp($date, "m")); + $xoops->tpl->assign('user_lastlogin', XoopsLocal::formatTimestamp($date, "m")); } $module_handler = $xoops->getModuleHandler(); $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); @@ -179,7 +179,7 @@ } $results[$i]['title'] = $myts->htmlspecialchars($results[$i]['title']); - $results[$i]['time'] = $results[$i]['time'] ? $xoops->formatTimestamp($results[$i]['time']) : ''; + $results[$i]['time'] = $results[$i]['time'] ? XoopsLocal::formatTimestamp($results[$i]['time']) : ''; } if ($count == 5) { $showall_link = '<a href="search.php?action=showallbyuser&mid=' . $mid . '&uid=' . $thisUser->getVar('uid') . '">' . _US_SHOWALL . '</a>'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php 2011-10-29 19:12:38 UTC (rev 7995) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php 2011-10-29 19:46:46 UTC (rev 7996) @@ -92,7 +92,7 @@ } echo "</td>\n"; echo "<td class='alignmiddle'><a href='readpmsg.php?start=" . ($total_messages - $i - 1), "&total_messages=$total_messages'>" . $pm_arr[$i]->getVar("subject") . "</a></td>"; - echo "<td class='alignmiddle txtcenter width20'>" . $xoops->formatTimestamp($pm_arr[$i]->getVar("msg_time")) . "</td></tr>"; + echo "<td class='alignmiddle txtcenter width20'>" . XoopsLocal::formatTimestamp($pm_arr[$i]->getVar("msg_time")) . "</td></tr>"; } if ($display == 1) { echo "<tr class='foot txtleft'><td colspan='6' align='left'><input type='button' class='formButton' onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send=1\",\"pmlite\",565,500);' value='" . _PM_SEND . "' /> <input type='submit' class='formButton' name='delete_messages' value='" . _PM_DELETE . "' />" . $xoops->security->getTokenHTML() . "</td></tr></table></form>"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |