|
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->get...
[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 XoopsObjectHan...
[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/...
[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 ...
[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-...
[truncated message content] |
|
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 ...
[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;
+ ...
[truncated message content] |
|
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...
[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->p...
[truncated message content] |
|
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...
[truncated message content] |
|
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++) {
...
[truncated message content] |
|
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('m...
[truncated message content] |
|
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.' '));
$el...
[truncated message content] |
|
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,...
[truncated message content] |
|
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 g...
[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/...
[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();
...
[truncated message content] |
|
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_METAFOOTE...
[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.
|