From: <tr...@us...> - 2011-10-15 15:18:04
|
Revision: 7887 http://xoops.svn.sourceforge.net/xoops/?rev=7887&view=rev Author: trabis Date: 2011-10-15 15:17:55 +0000 (Sat, 15 Oct 2011) Log Message: ----------- finishing class folder refactoring (root) Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslocal.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/zipdownloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/imagemanager.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/commentform.inc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/findusers.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/old_functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/registerform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/searchform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/site-closed.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/xoops13_header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/locale.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/admin/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/class/message.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/pmlite.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/readpmsg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/viewpmsg.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/activate.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/permissions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/user.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/admin/visibility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changemail.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/changepass.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/category.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/class/field.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/edituser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/include/forms.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/search.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/preferences/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/admin/users/users.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/gui.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/pmlite.php Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopstree.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/backend.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -23,10 +23,9 @@ } header('Content-Type:text/xml; charset=utf-8'); -include_once $GLOBALS['xoops']->path('class/template.php'); $tpl = new XoopsTpl(); -$tpl->xoops_setCaching(2); -$tpl->xoops_setCacheTime(3600); +$tpl->caching = 2; +$tpl->cache_lifetime = 3600; if (!$tpl->is_cached('db:system_rss.html')) { $tpl->assign('channel_title', XoopsLocal::convert_encoding(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); $tpl->assign('channel_link', XOOPS_URL . '/'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -63,7 +63,7 @@ /** * Returns a singleton instance * - * @return object + * @return XoopsCache * @access public */ static function getInstance() Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -1,5 +1,6 @@ <?php // $Id$ + /** * package::i.tools * Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -142,7 +142,6 @@ */ public function renderThreadView($comment_id = 0, $admin_view = false, $show_nav = true) { - include_once $GLOBALS['xoops']->path('class/tree.php'); // construct comment tree $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid'); $tree = $xot->getTree(); @@ -234,7 +233,6 @@ */ public function renderNestView($comment_id = 0, $admin_view = false) { - include_once $GLOBALS['xoops']->path('class/tree.php'); $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid'); $tree = $xot->getTree(); if (false != $this->_useIcons) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -18,15 +18,6 @@ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -/** - * base class - */ -include_once XOOPS_ROOT_PATH . '/class/downloader.php'; -/** - * Class to handle tar files - */ -include_once XOOPS_ROOT_PATH . '/class/class.tar.php'; - class XoopsTarDownloader extends XoopsDownloader { /** @@ -35,7 +26,7 @@ * @param string $ext file extension * @param string $mimyType Mimetype */ - function __construct($ext = '.tar.gz', $mimyType = 'application/x-gzip') + public function __construct($ext = '.tar.gz', $mimyType = 'application/x-gzip') { $this->archiver = new tar(); $this->ext = trim($ext); @@ -48,7 +39,7 @@ * @param string $filepath Full path to the file * @param string $newfilename Filename (if you don't want to use the original) */ - function addFile($filepath, $newfilename = null) + public function addFile($filepath, $newfilename = null) { $this->archiver->addFile($filepath); if (isset($newfilename)) { @@ -68,7 +59,7 @@ * @param string $filepath Full path to the file * @param string $newfilename Filename (if you don't want to use the original) */ - function addBinaryFile($filepath, $newfilename = null) + public function addBinaryFile($filepath, $newfilename = null) { $this->archiver->addFile($filepath, true); if (isset($newfilename)) { @@ -89,7 +80,7 @@ * @param string $filename Name for the file in the archive * @param integer $time */ - function addFileData(&$data, $filename, $time = 0) + public function addFileData(&$data, $filename, $time = 0) { $dummyfile = XOOPS_CACHE_PATH . '/dummy_' . time() . '.html'; $fp = fopen($dummyfile, 'w'); @@ -116,7 +107,7 @@ * @param string $filename Name for the file in the archive * @param integer $time */ - function addBinaryFileData(&$data, $filename, $time = 0) + public function addBinaryFileData(&$data, $filename, $time = 0) { $dummyfile = XOOPS_CACHE_PATH . '/dummy_' . time() . '.html'; $fp = fopen($dummyfile, 'wb'); @@ -142,7 +133,7 @@ * @param string $name Filename * @param boolean $gzip Use GZ compression */ - function download($name, $gzip = true) + public function download($name, $gzip = true) { $this->_header($name . $this->ext); echo $this->archiver->toTarOutput($name . $this->ext, $gzip); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -20,11 +20,8 @@ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -/** - * Base class: Smarty template engine - */ + define('SMARTY_DIR', XOOPS_ROOT_PATH . '/class/smarty/'); -require_once SMARTY_DIR . 'Smarty.class.php'; /** * Template engine @@ -39,7 +36,7 @@ /** * @var xos_opal_Theme */ - var $currentTheme = null; + public $currentTheme = null; public function __construct() { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -396,9 +396,9 @@ /** * xos_opal_Theme::checkCache() * - * @return + * @return bool */ - function checkCache() + public function checkCache() { if ($_SERVER['REQUEST_METHOD'] != 'POST' && $this->contentCacheLifetime) { $template = $this->contentTemplate ? $this->contentTemplate : 'db:system_dummy.html'; @@ -433,8 +433,10 @@ * @param string $pageTpl The page template, if different from the theme default (unsupported, 2.3+ only) * @param string $contentTpl The content template * @param array $vars Template variables to send to the template engine + * + * @return bool */ - function render($canvasTpl = null, $pageTpl = null, $contentTpl = null, $vars = array()) + public function render($canvasTpl = null, $pageTpl = null, $contentTpl = null, $vars = array()) { if ($this->renderCount) { return false; @@ -521,8 +523,11 @@ * <li>style.css - localization stylesheet</li> * <li>script.js - localization script</li> * </ul> + * + * @param string $type + * @return bool */ - function loadLocalization($type = "main") + public function loadLocalization($type = "main") { $language = xoops_getConfigOption('language'); // Load global localization stylesheet if available @@ -545,14 +550,14 @@ * * @param string $type language type, like 'main', 'admin'; Needs to be declared in theme xo-info.php * @param string $language specific language + * + * @return bool|mixed */ - function addLanguage($type = "main", $language = null) + public function addLanguage($type = "main", $language = null) { $language = is_null($language) ? $GLOBALS["xoopsConfig"]["language"] : $language; - if (!file_exists($fileinc = $GLOBALS['xoops']->path($this->resourcePath("/language/{$language}/{$type}.php"))) - ) { - if (!file_exists($fileinc = $GLOBALS['xoops']->path($this->resourcePath("/language/english/{$type}.php"))) - ) { + if (!file_exists($fileinc = $GLOBALS['xoops']->path($this->resourcePath("/language/{$language}/{$type}.php")))) { + if (!file_exists($fileinc = $GLOBALS['xoops']->path($this->resourcePath("/language/english/{$type}.php")))) { return false; } } @@ -591,7 +596,7 @@ * @param string $content Code snippet to output within the <script> tag * @return void */ - function addScript($src = '', $attributes = array(), $content = '') + public function addScript($src = '', $attributes = array(), $content = '') { if (empty($attributes)) { $attributes = array(); @@ -618,7 +623,7 @@ * @param string $content CSS code to output between the <style> tags (in case $src is empty) * @return void */ - function addStylesheet($src = '', $attributes = array(), $content = '') + public function addStylesheet($src = '', $attributes = array(), $content = '') { if (empty($attributes)) { $attributes = array(); @@ -643,7 +648,7 @@ * @param string $href URI of the anchored document * @param array $attributes Additional attributes to add to the <link> element */ - function addLink($rel, $href = '', $attributes = array()) + public function addLink($rel, $href = '', $attributes = array()) { if (empty($attributes)) { $attributes = array(); @@ -657,19 +662,29 @@ /** * Set a meta http-equiv value + * + * @param string $name + * @param null $value + * @return bool|string */ - function addHttpMeta($name, $value = null) + public function addHttpMeta($name, $value = null) { if (isset($value)) { return $this->addMeta('http', $name, $value); } unset($this->metas['http'][$name]); + return false; } /** * Change output page meta-information + * + * @param string $type + * @param string $name + * @param string $value + * @return string */ - function addMeta($type = 'meta', $name = '', $value = '') + public function addMeta($type = 'meta', $name = '', $value = '') { if (!isset($this->metas[$type])) { $this->metas[$type] = array(); @@ -685,13 +700,13 @@ /** * xos_opal_Theme::headContent() * - * @param mixed $params - * @param mixed $content - * @param mixed $smarty - * @param mixed $repeat - * @return + * @param $params + * @param $content + * @param $smarty + * @param $repeat + * @return void */ - function headContent($params, $content, &$smarty, &$repeat) + public function headContent($params, $content, &$smarty, &$repeat) { if (!$repeat) { $this->htmlHeadStrings[] = $content; @@ -701,11 +716,11 @@ /** * xos_opal_Theme::renderMetas() * - * @param mixed $type - * @param mixed $return - * @return + * @param null $type + * @param bool|string $return + * @return bool|string */ - function renderMetas($type = null, $return = false) + public function renderMetas($type = null, $return = false) { $str = ''; if (!isset($type)) { @@ -765,7 +780,7 @@ * @param string $tagName * @return string */ - function genElementId($tagName = 'xos') + public function genElementId($tagName = 'xos') { static $cache = array(); if (!isset($cache[$tagName])) { @@ -780,7 +795,7 @@ * @param array $coll * @return string */ - function renderAttributes($coll) + public function renderAttributes($coll) { $str = ''; foreach ($coll as $name => $val) { @@ -797,7 +812,7 @@ * @param string $path * @return string */ - function resourcePath($path) + public function resourcePath($path) { if (substr($path, 0, 1) == '/') { $path = substr($path, 1); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -22,8 +22,6 @@ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -include_once $GLOBALS['xoops']->path('class/template.php'); - /** * xos_logos_PageBuilder main class * @@ -85,12 +83,11 @@ */ public function retrieveBlocks() { - global $xoopsConfig; $xoopsPreload = XoopsPreload::getInstance(); if (isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule'])) { $mid = $GLOBALS['xoopsModule']->getVar('mid'); - $isStart = (substr($_SERVER['PHP_SELF'], -9) == 'index.php' && $xoopsConfig['startpage'] == $GLOBALS['xoopsModule']->getVar('dirname') && empty($_SERVER['QUERY_STRING'])); + $isStart = (substr($_SERVER['PHP_SELF'], -9) == 'index.php' && $GLOBALS['xoopsConfig']['startpage'] == $GLOBALS['xoopsModule']->getVar('dirname') && empty($_SERVER['QUERY_STRING'])); } else { $mid = 0; $isStart = !empty($GLOBALS['xoopsOption']['show_cblock']); @@ -213,7 +210,6 @@ } } if (count($metas)) { - /* @var $cache XoopsCache */ $cache = XoopsCache::getInstance(); $cache->write($cacheid, $metas); @@ -226,7 +222,6 @@ //add block cached metas if ($this->theme && $bcachetime) { - $cache = XoopsCache::getInstance(); if ($metas = $cache->read($cacheid)) { foreach ($metas as $type => $value) { @@ -234,9 +229,7 @@ } } } - $template->setCompileId(); - return $block; } } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -75,109 +75,109 @@ * * @var bool */ - var $allowUnknownTypes = false; + public $allowUnknownTypes = false; /** * @var string */ - var $mediaName; + public $mediaName; /** * @var string */ - var $mediaType; + public $mediaType; /** * @var int */ - var $mediaSize; + public $mediaSize; /** * @var string */ - var $mediaTmpName; + public $mediaTmpName; /** * @var string */ - var $mediaError; + public $mediaError; /** * @var string */ - var $mediaRealType = ''; + public $mediaRealType = ''; /** * @var string */ - var $uploadDir = ''; + public $uploadDir = ''; /** * @var array */ - var $allowedMimeTypes = array(); + public $allowedMimeTypes = array(); /** * @var array */ - var $deniedMimeTypes = array( + public $deniedMimeTypes = array( 'application/x-httpd-php' ); /** * @var int */ - var $maxFileSize = 0; + public $maxFileSize = 0; /** * @var int */ - var $maxWidth; + public $maxWidth; /** * @var int */ - var $maxHeight; + public $maxHeight; /** * @var string */ - var $targetFileName; + public $targetFileName; /** * @var */ - var $prefix; + public $prefix; /** * @var array */ - var $errors = array(); + public $errors = array(); /** * @var string */ - var $savedDestination; + public $savedDestination; /** * @var string */ - var $savedFileName; + public $savedFileName; /** * @var array|mixed */ - var $extensionToMime = array(); + public $extensionToMime = array(); /** * @var bool */ - var $checkImageType = true; + public $checkImageType = true; /** * @var array */ - var $extensionsToBeSanitized = array( + public $extensionsToBeSanitized = array( 'php', 'phtml', 'phtm', 'php3', 'php4', 'cgi', 'pl', 'asp', 'php5' ); @@ -186,7 +186,7 @@ * * @var array */ - var $imageExtensions = array( + public $imageExtensions = array( 1 => 'gif', 2 => 'jpg', 3 => 'png', 4 => 'swf', 5 => 'psd', 6 => 'bmp', 7 => 'tif', 8 => 'tif', 9 => 'jpc', 10 => 'jp2', 11 => 'jpx', 12 => 'jb2', 13 => 'swc', 14 => 'iff', 15 => 'wbmp', 16 => 'xbm' ); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -35,14 +35,12 @@ */ static function sendWelcome($user) { - global $xoopsConfigUser, $xoopsConfig; - - if (empty($xoopsConfigUser)) { + if (empty($GLOBALS['xoopsConfigUser'])) { /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); - $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER); + $GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER); } - if (empty($xoopsConfigUser['welcome_type'])) { + if (empty($GLOBALS['xoopsConfigUser']['welcome_type'])) { return true; } @@ -57,17 +55,17 @@ xoops_loadLanguage('user'); $xoopsMailer = xoops_getMailer(); - if ($xoopsConfigUser['welcome_type'] == 1 || $xoopsConfigUser['welcome_type'] == 3) { + if ($GLOBALS['xoopsConfigUser']['welcome_type'] == 1 || $GLOBALS['xoopsConfigUser']['welcome_type'] == 3) { $xoopsMailer->useMail(); } - if ($xoopsConfigUser['welcome_type'] == 2 || $xoopsConfigUser['welcome_type'] == 3) { + if ($GLOBALS['xoopsConfigUser']['welcome_type'] == 2 || $GLOBALS['xoopsConfigUser']['welcome_type'] == 3) { $xoopsMailer->usePM(); } $xoopsMailer->setTemplate('welcome.tpl'); - $xoopsMailer->setSubject(sprintf(_US_WELCOME_SUBJECT, $xoopsConfig['sitename'])); + $xoopsMailer->setSubject(sprintf(_US_WELCOME_SUBJECT, $GLOBALS['xoopsConfig']['sitename'])); $xoopsMailer->setToUsers($user); - if ($xoopsConfigUser['reg_dispdsclmr'] && $xoopsConfigUser['reg_disclaimer']) { - $xoopsMailer->assign('TERMSOFUSE', $xoopsConfigUser['reg_disclaimer']); + if ($GLOBALS['xoopsConfigUser']['reg_dispdsclmr'] && $GLOBALS['xoopsConfigUser']['reg_disclaimer']) { + $xoopsMailer->assign('TERMSOFUSE', $GLOBALS['xoopsConfigUser']['reg_disclaimer']); } else { $xoopsMailer->assign('TERMSOFUSE', ''); } @@ -81,9 +79,6 @@ */ static function validate() { - /* @var $xoopsUser XoopsUser|null */ - global $xoopsUser; - $args = func_get_args(); $args_num = func_num_args(); @@ -117,11 +112,11 @@ /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); - $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER); + $GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER); xoops_loadLanguage('user'); - $xoopsUser_isAdmin = is_object($xoopsUser) && $xoopsUser->isAdmin(); + $xoopsUser_isAdmin = is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->isAdmin(); $stop = ''; // Invalid email address if (!checkEmail($email)) { @@ -132,7 +127,7 @@ } // Check forbidden email address if current operator is not an administrator if (!$xoopsUser_isAdmin) { - foreach ($xoopsConfigUser['bad_emails'] as $be) { + foreach ($GLOBALS['xoopsConfigUser']['bad_emails'] as $be) { if (!empty($be) && preg_match('/' . $be . '/i', $email)) { $stop .= _US_INVALIDMAIL . '<br />'; break; @@ -141,7 +136,7 @@ } $uname = xoops_trim($uname); $restriction = ''; - switch ($xoopsConfigUser['uname_test_level']) { + switch ($GLOBALS['xoopsConfigUser']['uname_test_level']) { case 0: // strict $restriction = '/[^a-zA-Z0-9\_\-]/'; @@ -160,13 +155,13 @@ } // Check uname settings if current operator is not an administrator if (!$xoopsUser_isAdmin) { - if (strlen($uname) > $xoopsConfigUser['maxuname']) { - $stop .= sprintf(_US_NICKNAMETOOLONG, $xoopsConfigUser['maxuname']) . '<br />'; + if (strlen($uname) > $GLOBALS['xoopsConfigUser']['maxuname']) { + $stop .= sprintf(_US_NICKNAMETOOLONG, $GLOBALS['xoopsConfigUser']['maxuname']) . '<br />'; } - if (strlen($uname) < $xoopsConfigUser['minuname']) { - $stop .= sprintf(_US_NICKNAMETOOSHORT, $xoopsConfigUser['minuname']) . '<br />'; + if (strlen($uname) < $GLOBALS['xoopsConfigUser']['minuname']) { + $stop .= sprintf(_US_NICKNAMETOOSHORT, $GLOBALS['xoopsConfigUser']['minuname']) . '<br />'; } - foreach ($xoopsConfigUser['bad_unames'] as $bu) { + foreach ($GLOBALS['xoopsConfigUser']['bad_unames'] as $bu) { if (!empty($bu) && preg_match('/' . $bu . '/i', $uname)) { $stop .= _US_NAMERESERVED . '<br />'; break; @@ -209,8 +204,8 @@ if ((isset($pass)) && ($pass != $vpass)) { $stop .= _US_PASSNOTSAME . '<br />'; } else { - if (($pass != '') && (strlen($pass) < $xoopsConfigUser['minpass'])) { - $stop .= sprintf(_US_PWDTOOSHORT, $xoopsConfigUser['minpass']) . '<br />'; + if (($pass != '') && (strlen($pass) < $GLOBALS['xoopsConfigUser']['minpass'])) { + $stop .= sprintf(_US_PWDTOOSHORT, $GLOBALS['xoopsConfigUser']['minpass']) . '<br />'; } } return $stop; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php 2011-10-14 21:28:33 UTC (rev 7886) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php 2011-10-15 15:17:55 UTC (rev 7887) @@ -16,381 +16,377 @@ * @version $Id$ */ - defined('XOOPS_ROOT_PATH') or die('Restricted access'); -if (!defined('XOOPS_LISTS_INCLUDED')) { - define('XOOPS_LISTS_INCLUDED', 1); - +/** + * XoopsLists + * + * @author John Neill <cat...@xo...> + * @copyright copyright (c) XOOPS.org + * @package kernel + * @subpackage form + * @access public + */ +class XoopsLists +{ /** - * XoopsLists - * - * @author John Neill <cat...@xo...> - * @copyright copyright (c) XOOPS.org - * @package kernel - * @subpackage form - * @access public + * @static + * @return array */ - class XoopsLists + static function getTimeZoneList() { - /** - * @static - * @return array - */ - static function getTimeZoneList() - { - xoops_loadLanguage('timezone'); + xoops_loadLanguage('timezone'); - $time_zone_list = array( - '-12' => _TZ_GMTM12, '-11' => _TZ_GMTM11, '-10' => _TZ_GMTM10, '-9' => _TZ_GMTM9, '-8' => _TZ_GMTM8, - '-7' => _TZ_GMTM7, '-6' => _TZ_GMTM6, '-5' => _TZ_GMTM5, '-4' => _TZ_GMTM4, '-3.5' => _TZ_GMTM35, - '-3' => _TZ_GMTM3, '-2' => _TZ_GMTM2, '-1' => _TZ_GMTM1, '0' => _TZ_GMT0, '1' => _TZ_GMTP1, - '2' => _TZ_GMTP2, '3' => _TZ_GMTP3, '3.5' => _TZ_GMTP35, '4' => _TZ_GMTP4, '4.5' => _TZ_GMTP45, - '5' => _TZ_GMTP5, '5.5' => _TZ_GMTP55, '6' => _TZ_GMTP6, '7' => _TZ_GMTP7, '8' => _TZ_GMTP8, - '9' => _TZ_GMTP9, '9.5' => _TZ_GMTP95, '10' => _TZ_GMTP10, '11' => _TZ_GMTP11, '12' => _TZ_GMTP12 - ); + $time_zone_list = array( + '-12' => _TZ_GMTM12, '-11' => _TZ_GMTM11, '-10' => _TZ_GMTM10, '-9' => _TZ_GMTM9, '-8' => _TZ_GMTM8, + '-7' => _TZ_GMTM7, '-6' => _TZ_GMTM6, '-5' => _TZ_GMTM5, '-4' => _TZ_GMTM4, '-3.5' => _TZ_GMTM35, + '-3' => _TZ_GMTM3, '-2' => _TZ_GMTM2, '-1' => _TZ_GMTM1, '0' => _TZ_GMT0, '1' => _TZ_GMTP1, + '2' => _TZ_GMTP2, '3' => _TZ_GMTP3, '3.5' => _TZ_GMTP35, '4' => _TZ_GMTP4, '4.5' => _TZ_GMTP45, + '5' => _TZ_GMTP5, '5.5' => _TZ_GMTP55, '6' => _TZ_GMTP6, '7' => _TZ_GMTP7, '8' => _TZ_GMTP8, + '9' => _TZ_GMTP9, '9.5' => _TZ_GMTP95, '10' => _TZ_GMTP10, '11' => _TZ_GMTP11, '12' => _TZ_GMTP12 + ); - return $time_zone_list; - } + return $time_zone_list; + } - /** - * gets list of themes folder from themes directory - * - * @static - * @return array - */ - static function getThemesList() - { - return XoopsLists::getDirListAsArray(XOOPS_THEME_PATH . '/'); - } + /** + * gets list of themes folder from themes directory + * + * @static + * @return array + */ + static function getThemesList() + { + return XoopsLists::getDirListAsArray(XOOPS_THEME_PATH . '/'); + } - /** - * gets a list of module folders from the modules directory - * - * @static - * @return array - */ - static function getModulesList() - { - return XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/modules/'); - } + /** + * gets a list of module folders from the modules directory + * + * @static + * @return array + */ + static function getModulesList() + { + return XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/modules/'); + } - /** - * gets list of editors folder from xoopseditor directory - * - * @static - * @return array - */ - static function getEditorList() - { - return XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/class/xoopseditor/'); - } + /** + * gets list of editors folder from xoopseditor directory + * + * @static + * @return array + */ + static function getEditorList() + { + return XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/class/xoopseditor/'); + } - /** - * gets list of name of directories inside a directory - * - * @static - * @param string $dirname - * @return array - */ - static function getDirListAsArray($dirname) - { - $ignored = array( - 'cvs', '_darcs' - ); - $list = array(); - if (substr($dirname, -1) != '/') { - $dirname .= '/'; - } - if ($handle = opendir($dirname)) { - while ($file = readdir($handle)) { - if (substr($file, 0, 1) == '.' || in_array(strtolower($file), $ignored)) { - continue; - } - if (is_dir($dirname . $file)) { - $list[$file] = $file; - } + /** + * gets list of name of directories inside a directory + * + * @static + * @param string $dirname + * @return array + */ + static function getDirListAsArray($dirname) + { + $ignored = array( + 'cvs', '_darcs' + ); + $list = array(); + if (substr($dirname, -1) != '/') { + $dirname .= '/'; + } + if ($handle = opendir($dirname)) { + while ($file = readdir($handle)) { + if (substr($file, 0, 1) == '.' || in_array(strtolower($file), $ignored)) { + continue; } - closedir($handle); - asort($list); - reset($list); + if (is_dir($dirname . $file)) { + $list[$file] = $file; + } } - return $list; + closedir($handle); + asort($list); + reset($list); } + return $list; + } - /** - * gets list of all files in a directory - * - * @static - * @param string $dirname - * @param string $prefix - * @return array - */ - static function getFileListAsArray($dirname, $prefix = '') - { - $filelist = array(); - if (substr($dirname, -1) == '/') { - $dirname = substr($dirname, 0, -1); - } - if (is_dir($dirname) && $handle = opendir($dirname)) { - while (false !== ($file = readdir($handle))) { - if (!preg_match('/^[\.]{1,2}$/', $file) && is_file($dirname . '/' . $file)) { - $file = $prefix . $file; - $filelist[$file] = $file; - } + /** + * gets list of all files in a directory + * + * @static + * @param string $dirname + * @param string $prefix + * @return array + */ + static function getFileListAsArray($dirname, $prefix = '') + { + $filelist = array(); + if (substr($dirname, -1) == '/') { + $dirname = substr($dirname, 0, -1); + } + if (is_dir($dirname) && $handle = opendir($dirname)) { + while (false !== ($file = readdir($handle))) { + if (!preg_match('/^[\.]{1,2}$/', $file) && is_file($dirname . '/' . $file)) { + $file = $prefix . $file; + $filelist[$file] = $file; } - closedir($handle); - asort($filelist); - reset($filelist); } - return $filelist; + closedir($handle); + asort($filelist); + reset($filelist); } + return $filelist; + } - /** - * gets list of image file names in a directory - * - * @static - * @param string $dirname - * @param string $prefix - * @return array - */ - static function getImgListAsArray($dirname, $prefix = '') - { - $filelist = array(); - if ($handle = opendir($dirname)) { - while (false !== ($file = readdir($handle))) { - if (preg_match('/(\.gif|\.jpg|\.png)$/i', $file)) { - $file = $prefix . $file; - $filelist[$file] = $file; - } + /** + * gets list of image file names in a directory + * + * @static + * @param string $dirname + * @param string $prefix + * @return array + */ + static function getImgListAsArray($dirname, $prefix = '') + { + $filelist = array(); + if ($handle = opendir($dirname)) { + while (false !== ($file = readdir($handle))) { + if (preg_match('/(\.gif|\.jpg|\.png)$/i', $file)) { + $file = $prefix . $file; + $filelist[$file] = $file; } - closedir($handle); - asort($filelist); - reset($filelist); } - return $filelist; + closedir($handle); + asort($filelist); + reset($filelist); } + return $filelist; + } - /** - * gets list of html file names in a certain directory - * - * @static - * @param string $dirname - * @param string $prefix - * @return array - */ - static function getHtmlListAsArray($dirname, $prefix = '') - { - $filelist = array(); - if ($handle = opendir($dirname)) { - while (false !== ($file = readdir($handle))) { - if ((preg_match('/(\.htm|\.html|\.xhtml)$/i', $file) && !is_dir($file))) { - $file = $prefix . $file; - $filelist[$file] = $prefix . $file; - } + /** + * gets list of html file names in a certain directory + * + * @static + * @param string $dirname + * @param string $prefix + * @return array + */ + static function getHtmlListAsArray($dirname, $prefix = '') + { + $filelist = array(); + if ($handle = opendir($dirname)) { + while (false !== ($file = readdir($handle))) { + if ((preg_match('/(\.htm|\.html|\.xhtml)$/i', $file) && !is_dir($file))) { + $file = $prefix . $file; + $filelist[$file] = $prefix . $file; } - closedir($handle); - asort($filelist); - reset($filelist); } - return $filelist; + closedir($handle); + asort($filelist); + reset($filelist); } + return $filelist; + } - /** - * gets list of avatar file names in a certain directory - * if directory is not specified, default directory will be searched - * - * @static - * @param string $avatar_dir - * @return array - */ - static function getAvatarsList($avatar_dir = '') - { - if ($avatar_dir != '') { - $avatars = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/' . $avatar_dir . '/', $avatar_dir . '/'); - } else { - $avatars = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/'); - } - return $avatars; + /** + * gets list of avatar file names in a certain directory + * if directory is not specified, default directory will be searched + * + * @static + * @param string $avatar_dir + * @return array + */ + static function getAvatarsList($avatar_dir = '') + { + if ($avatar_dir != '') { + $avatars = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/' . $avatar_dir . '/', $avatar_dir . '/'); + } else { + $avatars = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/'); } + return $avatars; + } - /** - * gets list of all avatar image files inside default avatars directory - * - * @static - * @return array|false - */ - static function getAllAvatarsList() - { - $avatars = array(); - $dirlist = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/images/avatar/'); - if (count($dirlist) > 0) { - foreach ($dirlist as $dir) { - $avatars[$dir] = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/' . $dir . '/', $dir . '/'); - } - } else { - return false; + /** + * gets list of all avatar image files inside default avatars directory + * + * @static + * @return array|false + */ + static function getAllAvatarsList() + { + $avatars = array(); + $dirlist = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/images/avatar/'); + if (count($dirlist) > 0) { + foreach ($dirlist as $dir) { + $avatars[$dir] = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/avatar/' . $dir . '/', $dir . '/'); } - return $avatars; + } else { + return false; } + return $avatars; + } - /** - * gets list of subject icon image file names in a certain directory - * if directory is not specified, default directory will be searched - * - * @static - * @param string $sub_dir - * @return array - */ - static function getSubjectsList($sub_dir = '') - { - if ($sub_dir != '') { - $subjects = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/subject/' . $sub_dir, $sub_dir . '/'); - } else { - $subjects = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/subject/'); - } - return $subjects; + /** + * gets list of subject icon image file names in a certain directory + * if directory is not specified, default directory will be searched + * + * @static + * @param string $sub_dir + * @return array + */ + static function getSubjectsList($sub_dir = '') + { + if ($sub_dir != '') { + $subjects = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/subject/' . $sub_dir, $sub_dir . '/'); + } else { + $subjects = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/images/subject/'); } + return $subjects; + } - /** - * gets list of language folders inside default language directory - * - * @static - * @return array - */ - public static function getLangList() - { - $lang_list = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/language/'); - return $lang_list; - } + /** + * gets list of language folders inside default language directory + * + * @static + * @return array + */ + public static function getLangList() + { + $lang_list = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/language/'); + return $lang_list; + } - /** - * XoopsLists::getCountryList() - * - * @static - * @return array - */ - static function getCountryList() - { - xoops_loadLanguage('countries'); - $country_list = array( - "" => "-", "AD" => _COUNTRY_AD, "AE" => _COUNTRY_AE, "AF" => _COUNTRY_AF, "AG" => _COUNTRY_AG, - "AI" => _COUNTRY_AI, "AL" => _COUNTRY_AL, "AM" => _COUNTRY_AM, "AN" => _COUNTRY_AN, "AO" => _COUNTRY_AO, - "AQ" => _COUNTRY_AQ, "AR" => _COUNTRY_AR, "AS" => _COUNTRY_AS, "AT" => _COUNTRY_AT, "AU" => _COUNTRY_AU, - "AW" => _COUNTRY_AW, "AX" => _COUNTRY_AX, "AZ" => _COUNTRY_AZ, "BA" => _COUNTRY_BA, "BB" => _COUNTRY_BB, - "BD" => _COUNTRY_BD, "BE" => _COUNTRY_BE, "BF" => _COUNTRY_BF, "BG" => _COUNTRY_BG, "BH" => _COUNTRY_BH, - "BI" => _COUNTRY_BI, "BJ" => _COUNTRY_BJ, "BL" => _COUNTRY_BL, "BM" => _COUNTRY_BM, "BN" => _COUNTRY_BN, - "BO" => _COUNTRY_BO, "BR" => _COUNTRY_BR, "BS" => _COUNTRY_BS, "BT" => _COUNTRY_BT, "BV" => _COUNTRY_BV, - "BW" => _COUNTRY_BW, "BY" => _COUNTRY_BY, "BZ" => _COUNTRY_BZ, "CA" => _COUNTRY_CA, "CC" => _COUNTRY_CC, - "CD" => _COUNTRY_CD, "CF" => _COUNTRY_CF, "CG" => _COUNTRY_CG, "CH" => _COUNTRY_CH, "CI" => _COUNTRY_CI, - "CK" => _COUNTRY_CK, "CL" => _COUNTRY_CL, "CM" => _COUNTRY_CM, "CN" => _COUNTRY_CN, "CO" => _COUNTRY_CO, - "CR" => _COUNTRY_CR, "CS" => _COUNTRY_CS, // Not listed in ISO 3166 - "CU" => _COUNTRY_CU, "CV" => _COUNTRY_CV, "CX" => _COUNTRY_CX, "CY" => _COUNTRY_CY, "CZ" => _COUNTRY_CZ, - "DE" => _COUNTRY_DE, "DJ" => _COUNTRY_DJ, "DK" => _COUNTRY_DK, "DM" => _COUNTRY_DM, "DO" => _COUNTRY_DO, - "DZ" => _COUNTRY_DZ, "EC" => _COUNTRY_EC, "EE" => _COUNTRY_EE, "EG" => _COUNTRY_EG, "EH" => _COUNTRY_EH, - "ER" => _COUNTRY_ER, "ES" => _COUNTRY_ES, "ET" => _COUNTRY_ET, "FI" => _COUNTRY_FI, "FJ" => _COUNTRY_FJ, - "FK" => _COUNTRY_FK, "FM" => _COUNTRY_FM, "FO" => _COUNTRY_FO, "FR" => _COUNTRY_FR, "FX" => _COUNTRY_FX, - // Not listed in ISO 3166 - "GA" => _COUNTRY_GA, "GB" => _COUNTRY_GB, "GD" => _COUNTRY_GD, "GE" => _COUNTRY_GE, "GF" => _COUNTRY_GF, - "GG" => _COUNTRY_GG, "GH" => _COUNTRY_GH, "GI" => _COUNTRY_GI, "GL" => _COUNTRY_GL, "GM" => _COUNTRY_GM, - "GN" => _COUNTRY_GN, "GP" => _COUNTRY_GP, "GQ" => _COUNTRY_GQ, "GR" => _COUNTRY_GR, "GS" => _COUNTRY_GS, - "GT" => _COUNTRY_GT, "GU" => _COUNTRY_GU, "GW" => _COUNTRY_GW, "GY" => _COUNTRY_GY, "HK" => _COUNTRY_HK, - "HM" => _COUNTRY_HM, "HN" => _COUNTRY_HN, "HR" => _COUNTRY_HR, "HT" => _COUNTRY_HT, "HU" => _COUNTRY_HU, - "ID" => _COUNTRY_ID, "IE" => _COUNTRY_IE, "IL" => _COUNTRY_IL, "IM" => _COUNTRY_IM, "IN" => _COUNTRY_IN, - "IO" => _COUNTRY_IO, "IQ" => _COUNTRY_IQ, "IR" => _COUNTRY_IR, "IS" => _COUNTRY_IS, "IT" => _COUNTRY_IT, - "JM" => _COUNTRY_JM, "JO" => _COUNTRY_JO, "JP" => _COUNTRY_JP, "KE" => _COUNTRY_KE, "KG" => _COUNTRY_KG, - "KH" => _COUNTRY_KH, "KI" => _COUNTRY_KI, "KM" => _COUNTRY_KM, "KN" => _COUNTRY_KN, "KP" => _COUNTRY_KP, - "KR" => _COUNTRY_KR, "KW" => _COUNTRY_KW, "KY" => _COUNTRY_KY, "KZ" => _COUNTRY_KZ, "LA" => _COUNTRY_LA, - "LB" => _COUNTRY_LB, "LC" => _COUNTRY_LC, "LI" => _COUNTRY_LI, "LK" => _COUNTRY_LK, "LR" => _COUNTRY_LR, - "LS" => _COUNTRY_LS, "LT" => _COUNTRY_LT, "LU" => _COUNTRY_LU, "LV" => _COUNTRY_LV, "LY" => _COUNTRY_LY, - "MA" => _COUNTRY_MA, "MC" => _COUNTRY_MC, "MD" => _COUNTRY_MD, "ME" => _COUNTRY_ME, "MF" => _COUNTRY_MF, - "MG" => _COUNTRY_MG, "MH" => _COUNTRY_MH, "MK" => _COUNTRY_MK, "ML" => _COUNTRY_ML, "MM" => _COUNTRY_MM, - "MN" => _COUNTRY_MN, "MO" => _COUNTRY_MO, "MP" => _COUNTRY_MP, "MQ" => _COUNTRY_MQ, "MR" => _COUNTRY_MR, - "MS" => _COUNTRY_MS, "MT" => _COUNTRY_MT, "MU" => _COUNTRY_MU, "MV" => _COUNTRY_MV, "MW" => _COUNTRY_MW, - "MX" => _COUNTRY_MX, "MY" => _COUNTRY_MY, "MZ" => _COUNTRY_MZ, "NA" => _COUNTRY_NA, "NC" => _COUNTRY_NC, - "NE" => _COUNTRY_NE, "NF" => _COUNTRY_NF, "NG" => _COUNTRY_NG, "NI" => _COUNTRY_NI, "NL" => _COUNTRY_NL, - "NO" => _COUNTRY_NO, "NP" => _COUNTRY_NP, "NR" => _COUNTRY_NR, "NT" => _COUNTRY_NT, - // Not listed in ISO 3166 - "NU" => _COUNTRY_NU, "NZ" => _COUNTRY_NZ, "OM" => _COUNTRY_OM, "PA" => _COUNTRY_PA, "PE" => _COUNTRY_PE, - "PF" => _COUNTRY_PF, "PG" => _COUNTRY_PG, "PH" => _COUNTRY_PH, "PK" => _COUNTRY_PK, "PL" => _COUNTRY_PL, - "PM" => _COUNTRY_PM, "PN" => _COUNTRY_PN, "PR" => _COUNTRY_PR, "PS" => _COUNTRY_PS, "PT" => _COUNTRY_PT, - "PW" => _COUNTRY_PW, "PY" => _COUNTRY_PY, "QA" => _COUNTRY_QA, "RE" => _COUNTRY_RE, "RO" => _COUNTRY_RO, - "RS" => _COUNTRY_RS, "RU" => _COUNTRY_RU, "RW" => _COUNTRY_RW, "SA" => _COUNTRY_SA, "SB" => _COUNTRY_SB, - "SC" => _COUNTRY_SC, "SD" => _COUNTRY_SD, "SE" => _COUNTRY_SE, "SG" => _COUNTRY_SG, "SH" => _COUNTRY_SH, - "SI" => _COUNTRY_SI, "SJ" => _COUNTRY_SJ, "SK" => _COUNTRY_SK, "SL" => _COUNTRY_SL, "SM" => _COUNTRY_SM, - "SN" => _COUNTRY_SN, "SO" => _COUNTRY_SO, "SR" => _COUNTRY_SR, "ST" => _COUNTRY_ST, "SU" => _COUNTRY_SU, - // Not listed in ISO 3166 - "SV" => _COUNTRY_SV, "SY" => _COUNTRY_SY, "SZ" => _COUNTRY_SZ, "TC" => _COUNTRY_TC, "TD" => _COUNTRY_TD, - "TF" => _COUNTRY_TF, "TG" => _COUNTRY_TG, "TH" => _COUNTRY_TH, "TJ" => _COUNTRY_TJ, "TK" => _COUNTRY_TK, - "TL" => _COUNTRY_TL, "TM" => _COUNTRY_TM, "TN" => _COUNTRY_TN, "TO" => _COUNTRY_TO, "TP" => _COUNTRY_TP, - // Not listed in ISO 3166 - "TR" => _COUNTRY_TR, "TT" => _COUNTRY_TT, "TV" => _COUNTRY_TV, "TW" => _COUNTRY_TW, "TZ" => _COUNTRY_TZ, - "UA" => _COUNTRY_UA, "UG" => _COUNTRY_UG, "UK" => _COUNTRY_UK, // Not listed in ISO 3166 - "UM" => _COUNTRY_UM, "US" => _COUNTRY_US, "UY" => _COUNTRY_UY, "UZ" => _COUNTRY_UZ, "VA" => _COUNTRY_VA, - "VC" => _COUNTRY_VC, "VE" => _COUNTRY_VE, "VG" => _COUNTRY_VG, "VI" => _COUNTRY_VI, "VN" => _COUNTRY_VN, - "VU" => _COUNTRY_VU, "WF" => _COUNTRY_WF, "WS" => _COUNTRY_WS, "YE" => _COUNTRY_YE, "YT" => _COUNTRY_YT, - "YU" => _COUNTRY_YU, // Not listed in ISO 3166 - "ZA" => _COUNTRY_ZA, "ZM" => _COUNTRY_ZM, "ZR" => _COUNTRY_ZR, // Not listed in ISO 3166 - "ZW" => _COUNTRY_ZW - ); - asort($country_list); - reset($country_list); - return $country_list; - } + /** + * XoopsLists::getCountryList() + * + * @static + * @return array + */ + static function getCountryList() + { + xoops_loadLanguage('countries'); + $country_list = array( + "" => "-", "AD" => _COUNTRY_AD, "AE" => _COUNTRY_AE, "AF" => _COUNTRY_AF, "AG" => _COUNTRY_AG, + "AI" => _COUNTRY_AI, "AL" => _COUNTRY_AL, "AM" => _COUNTRY_AM, "AN" => _COUNTRY_AN, "AO" => _COUNTRY_AO, + "AQ" => _COUNTRY_AQ, "AR" => _COUNTRY_AR, "AS" => _COUNTRY_AS, "AT" => _COUNTRY_AT, "AU" => _COUNTRY_AU, + "AW" => _COUNTRY_AW, "AX" => _COUNTRY_AX, "AZ" => _COUNTRY_AZ, "BA" => _COUNTRY_BA, "BB" => _COUNTRY_BB, + "BD" => _COUNTRY_BD, "BE" => _COUNTRY_BE, "BF" => _COUNTRY_BF, "BG" => _COUNTRY_BG, "BH" => _COUNTRY_BH, + "BI" => _COUNTRY_BI, "BJ" => _COUNTRY_BJ, "BL" => _COUNTRY_BL, "BM" => _COUNTRY_BM, "BN" => _COUNTRY_BN, + "BO" => _COUNTRY_BO, "BR" => _COUNTRY_BR, "BS" => _COUNTRY_BS, "BT" => _COUNTRY_BT, "BV" => _COUNTRY_BV, + "BW" => _COUNTRY_BW, "BY" => _COUNTRY_BY, "BZ" => _COUNTRY_BZ, "CA" => _COUNTRY_CA, "CC" => _COUNTRY_CC, + "CD" => _COUNTRY_CD, "CF" => _COUNTRY_CF, "CG" => _COUNTRY_CG, "CH" => _COUNTRY_CH, "CI" => _COUNTRY_CI, + "CK" => _COUNTRY_CK, "CL" => _COUNTRY_CL, "CM" => _COUNTRY_CM, "CN" => _COUNTRY_CN, "CO" => _COUNTRY_CO, + "CR" => _COUNTRY_CR, "CS" => _COUNTRY_CS, // Not listed in ISO 3166 + "CU" => _COUNTRY_CU, "CV" => _COUNTRY_CV, "CX" => _COUNTRY_CX, "CY" => _COUNTRY_CY, "CZ" => _COUNTRY_CZ, + "DE" => _COUNTRY_DE, "DJ" => _COUNTRY_DJ, "DK" => _COUNTRY_DK, "DM" => _COUNTRY_DM, "DO" => _COUNTRY_DO, + "DZ" => _COUNTRY_DZ, "EC" => _COUNTRY_EC, "EE" => _COUNTRY_EE, "EG" => _COUNTRY_EG, "EH" => _COUNTRY_EH, + "ER" => _COUNTRY_ER, "ES" => _COUNTRY_ES, "ET" => _COUNTRY_ET, "FI" => _COUNTRY_FI, "FJ" => _COUNTRY_FJ, + "FK" => _COUNTRY_FK, "FM" => _COUNTRY_FM, "FO" => _COUNTRY_FO, "FR" => _COUNTRY_FR, "FX" => _COUNTRY_FX, + // Not listed in ISO 3166 + "GA" => _COUNTRY_GA, "GB" => _COUNTRY_GB, "GD" => _COUNTRY_GD, "GE" => _COUNTRY_GE, "GF" => _COUNTRY_GF, + "GG" => _COUNTRY_GG, "GH" => _COUNTRY_GH, "GI" => _COUNTRY_GI, "GL" => _COUNTRY_GL, "GM" => _COUNTRY_GM, + "GN" => _COUNTRY_GN, "GP" => _COUNTRY_GP, "GQ" => _COUNTRY_GQ, "GR" => _COUNTRY_GR, "GS" => _COUNTRY_GS, + "GT" => _COUNTRY_GT, "GU" => _COUNTRY_GU, "GW" => _COUNTRY_GW, "GY" => _COUNTRY_GY, "HK" => _COUNTRY_HK, + "HM" => _COUNTRY_HM, "HN" => _COUNTRY_HN, "HR" => _COUNTRY_HR, "HT" => _COUNTRY_HT, "HU" => _COUNTRY_HU, + "ID" => _COUNTRY_ID, "IE" => _COUNTRY_IE, "IL" => _COUNTRY_IL, "IM" => _COUNTRY_IM, "IN" => _COUNTRY_IN, + "IO" => _COUNTRY_IO, "IQ" => _COUNTRY_IQ, "IR" => _COUNTRY_IR, "IS" => _COUNTRY_IS, "IT" => _COUNTRY_IT, + "JM" => _COUNTRY_JM, "JO" => _COUNTRY_JO, "JP" => _COUNTRY_JP, "KE" => _COUNTRY_KE, "KG" => _COUNTRY_KG, + "KH" => _COUNTRY_KH, "KI" => _COUNTRY_KI, "KM" => _COUNTRY_KM, "KN" => _COUNTRY_KN, "KP" => _COUNTRY_KP, + "KR" => _COUNTRY_KR, "KW" => _COUNTRY_KW, "KY" => _COUNTRY_KY, "KZ" => _COUNTRY_KZ, "LA" => _COUNTRY_LA, + "LB" => _COUNTRY_LB, "LC" => _COUNTRY_LC, "LI" => _COUNTRY_LI, "LK" => _COUNTRY_LK, "LR" => _COUNTRY_LR, + "LS" => _COUNTRY_LS, "LT" => _COUNTRY_LT, "LU" => _COUNTRY_LU, "LV" => _COUNTRY_LV, "LY" => _COUNTRY_LY, + "MA" => _COUNTRY_MA, "MC" => _COUNTRY_MC, "MD" => _COUNTRY_MD, "ME" => _COUNTRY_ME, "MF" => _COUNTRY_MF, + "MG" => _COUNTRY_MG, "MH" => _COUNTRY_MH, "MK" => _COUNTRY_MK, "ML" => _COUNTRY_ML, "MM" => _COUNTRY_MM, + "MN" => _COUNTRY_MN, "MO" => _COUNTRY_MO, "MP" => _COUNTRY_MP, "MQ" => _COUNTRY_MQ, "MR" => _COUNTRY_MR, + "MS" => _COUNTRY_MS, "MT" => _COUNTRY_MT, "MU" => _COUNTRY_MU, "MV" => _COUNTRY_MV, "MW" => _COUNTRY_MW, + "MX" => _COUNTRY_MX, "MY" => _COUNTRY_MY, "MZ" => _COUNTRY_MZ, "NA" => _COUNTRY_NA, "NC" => _COUNTRY_NC, + "NE" => _COUNTRY_NE, "NF" => _COUNTRY_NF, "NG" => _COUNTRY_NG, "NI" => _COUNTRY_NI, "NL" => _COUNTRY_NL, + "NO" => _COUNTRY_NO, "NP" => _COUNTRY_NP, "NR" => _COUNTRY_NR, "NT" => _COUNTRY_NT, + // Not listed in ISO 3166 + "NU" => _COUNTRY_NU, "NZ" => _COUNTRY_NZ, "OM" => _COUNTRY_OM, "PA" => _COUNTRY_PA, "PE" => _COUNTRY_PE, + "PF" => _COUNTRY_PF, "PG" => _COUNTRY_PG, "PH" => _COUNTRY_PH, "PK" => _COUNTRY_PK, "PL" => _COUNTRY_PL, + "PM" => _COUNTRY_PM, "PN" => _COUNTRY_PN, "PR" => _COUNTRY_PR, "PS" => _COUNTRY_PS, "PT" => _COUNTRY_PT, + "PW" => _COUNTRY_PW, "PY" => _COUNTRY_PY, "QA" => _COUNTRY_QA, "RE" => _COUNTRY_RE, "RO" => _COUNTRY_RO, + "RS" => _COUNTRY_RS, "RU" => _COUNTRY_RU, "RW" => _COUNTRY_RW, "SA" => _COUNTRY_SA, "SB" => _COUNTRY_SB, + "SC" => _COUNTRY_SC, "SD" => _COUNTRY_SD, "SE" => _COUNTRY_SE, "SG" => _COUNTRY_SG, "SH" => _COUNTRY_SH, + "SI" => _COUNTRY_SI, "SJ" => _COUNTRY_SJ, "SK" => _COUNTRY_SK, "SL" => _COUNTRY_SL, "SM" => _COUNTRY_SM, + "SN" => _COUNTRY_SN, "SO" => _COUNTRY_SO, "SR" => _COUNTRY_SR, "ST" => _COUNTRY_ST, "SU" => _COUNTRY_SU, + // Not listed in ISO 3166 + "SV" => _COUNTRY_SV, "SY" => _COUNTRY_SY, "SZ" => _COUNTRY_SZ, "TC" => _COUNTRY_TC, "TD" => _COUNTRY_TD, + "TF" => _COUNTRY_TF, "TG" => _COUNTRY_TG, "TH" => _COUNTRY_TH, "TJ" => _COUNTRY_TJ, "TK" => _COUNTRY_TK, + "TL" => _COUNTRY_TL, "TM" => _COUNTRY_TM, "TN" => _COUNTRY_TN, "TO" => _COUNTRY_TO, "TP" => _COUNTRY_TP, + // Not listed in ISO 3166 + "TR" => _COUNTRY_TR, "TT" => _COUNTRY_TT, "TV" => _COUNTRY_TV, "TW" => _COUNTRY_TW, "TZ" => _COUNTRY_TZ, + "UA" => _COUNTRY_UA, "UG" => _COUNTRY_UG, "UK" => _COUNTRY_UK, // Not listed in ISO 3166 + "UM" => _COUNTRY_UM, "US" => _COUNTRY_US, "UY" => _COUNTRY_UY, "UZ" => _COUNTRY_UZ, "VA" => _COUNTRY_VA, + "VC" => _COUNTRY_VC, "VE" => _COUNTRY_VE, "VG" => _COUNTRY_VG, "VI" => _COUNTRY_VI, "VN" => _COUNTRY_VN, + "VU" => _COUNTRY_VU, "WF" => _COUNTRY_WF, "WS" => _COUNTRY_WS, "YE" => _COUNTRY_YE, "YT" => _COUNTRY_YT, + "YU" => _COUNTRY_YU, // Not listed in ISO 3166 + "ZA" => _COUNTRY_ZA, "ZM" => _COUNTRY_ZM, "ZR" => _COUNTRY_ZR, // Not listed in ISO 3166 + "ZW" => _COUNTRY_ZW + ); + asort($country_list); + reset($country_list); + return $country_list; + } - /** - * XoopsLists::getHtmlList() - * - * This Function is no longer being used by the core - * - * @static - * @return array - */ - static function getHtmlList() - { - $html_list = array( - 'a' => '<a>', 'abbr' => '<abbr>', 'acronym' => '<acronym>', - 'address' => '<address>', 'b' => '<b>', 'bdo' => '<bdo>', 'big' => '<big>', - 'blockquote' => '<blockquote>', 'br' => '<br>', 'caption' => '<caption>', - 'cite' => '<cite>', 'code' => '<code>', 'col' => '<col>', - 'colgroup' => '<colgroup>', 'dd' => '<dd>', 'del' => '<del>', 'dfn' => '<dfn>', - 'div' => '<div>', 'dl' => '<dl>', 'dt' => '<dt>', 'em' => '<em>', - 'font' => '<font>', 'h1' => '<h1>', 'h2' => '<h2>', 'h3' => '<h3>', - 'h4' => '<h4>', 'h5' => '<h5>', 'h6' => '<h6>', 'hr' => '<hr>', - 'i' => '<i>', 'img' => '<img>', 'ins' => '<ins>', 'kbd' => '<kbd>', - 'li' => '<li>', 'map' => '<map>', 'object' => '<object>', 'ol' => '<ol>', - 'p' => '<p>', 'pre' => '<pre>', 's' => '<s>', 'samp' => '<samp>', - 'small' => '<small>', 'span' => '<span>', 'strike' => '<strike>', - 'strong' => '<strong>', 'sub' => '<sub>', 'sup' => '<sup>', - 'table' => '<table>', 'tbody' => '<tbody>', 'td' => '<td>', - 'tfoot' => '<tfoot>', 'th' => '<th>', 'thead' => '<thead>', 'tr' => '<tr>', - 'tt' => '<tt>', 'u' => '<u>', 'ul' => '<ul>', 'var' => '<var>' - ); - asort($html_list); - reset($html_list); - return $html_list; - } + /** + * XoopsLists::getHtmlList() + * + * This Function is no longer being used by the core + * + * @static + * @return array + */ + static function getHtmlList() + { + $html_list = array( + 'a' => '<a>', 'abbr' => '<abbr>', 'acronym' => '<acronym>', + 'address' => '<address>', 'b' => '<b>', 'bdo' => '<bdo>', 'big' => '<big>', + 'blockquote' => '<blockquote>', 'br' => '<br>', 'caption' => '<caption>', + 'cite' => '<cite>', 'code' => '<code>', 'col' => '<col>', + 'colgroup' => '<colgroup>', 'dd' => '<dd>', 'del' => '<del>', 'dfn' => '<dfn>', + 'div' => '<div>', 'dl' => '<dl>', 'dt' => '<dt>', 'em' => '<em>', + 'font' => '<font>', 'h1' => '<h1>', 'h2' => '<h2>', 'h3' => '<h3>', + 'h4' => '<h4>', 'h5' => '<h5>', 'h6' => '<h6>', 'hr' => '<hr>', + 'i' => '<i>', 'img' => '<img>', 'ins' => '<ins>', 'kbd' => '<kbd>', + 'li' => '<li>', 'map' => '<map>', 'object' => '<object>', 'ol' => '<ol>', + 'p' => '<p>', 'pre' => '<pre>', 's' => '<s>', 'samp' => '<samp>', + 'small' => '<small>', 'span' => '<span>', 'strike' => '<strike>', + 'strong' => '<strong>', 'sub' => '<sub>', 'sup' => '<sup>', + 'table' => '<table>', 'tbody' => '<tbody>', 'td' => '<td>', + 'tfoot' => '<tfoot>', 'th' => '<th>', 'thead' => '<thead>', 'tr' => '<tr>', + 'tt' => '<tt>', 'u' => '<u>', 'ul' => '<ul>', 'var' => '<var>' + ); + asort($html_list); + reset($html_list); + return $html_list; + } - /** - * XoopsLists::getUserRankList() - * - * @todo create handler for ranks - * @static - * @return array - ... [truncated message content] |