From: <tr...@us...> - 2012-12-02 18:59:22
|
Revision: 10304 http://sourceforge.net/p/xoops/svn/10304 Author: trabis Date: 2012-12-02 18:59:19 +0000 (Sun, 02 Dec 2012) Log Message: ----------- Updating Xoops Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php 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 2012-12-02 17:49:37 UTC (rev 10303) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-12-02 18:59:19 UTC (rev 10304) @@ -216,12 +216,6 @@ 'xoopsavatarhandler' => XOOPS_ROOT_PATH . '/kernel/avatar.php', 'xoopsavataruserlink' => XOOPS_ROOT_PATH . '/kernel/avataruserlink.php', 'xoopsavataruserlinkhandler' => XOOPS_ROOT_PATH . '/kernel/avataruserlink.php', - 'xoopsbanner' => XOOPS_ROOT_PATH . '/kernel/banner.php', - 'xoopsbannerhandler' => XOOPS_ROOT_PATH . '/kernel/banner.php', - 'xoopsbannerclient' => XOOPS_ROOT_PATH . '/kernel/bannerclient.php', - 'xoopsbannerclienthandler' => XOOPS_ROOT_PATH . '/kernel/bannerclient.php', - 'xoopsbannerfinish' => XOOPS_ROOT_PATH . '/kernel/bannerfinish.php', - 'xoopsbannerfinishhandler' => XOOPS_ROOT_PATH . '/kernel/bannerfinish.php', 'xoopsblock' => XOOPS_ROOT_PATH . '/kernel/block.php', 'xoopsblockhandler' => XOOPS_ROOT_PATH . '/kernel/block.php', 'xoopsblockmodulelink' => XOOPS_ROOT_PATH . '/kernel/blockmodulelink.php', Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php 2012-12-02 17:49:37 UTC (rev 10303) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops.php 2012-12-02 18:59:19 UTC (rev 10304) @@ -109,7 +109,8 @@ 'var' => array(), 'lib' => array(), 'modules' => array(), - 'themes' => array() + 'themes' => array(), + 'media' => array() ); /** @@ -158,6 +159,7 @@ $this->paths['lib'] = array(XOOPS_PATH, XOOPS_URL . 'browse.php'); $this->paths['modules'] = array(XOOPS_ROOT_PATH . '/modules', XOOPS_URL . '/modules'); $this->paths['themes'] = array(XOOPS_ROOT_PATH . '/themes', XOOPS_URL . '/themes'); + $this->paths['media'] = array(XOOPS_ROOT_PATH . '/media', XOOPS_URL . '/media'); $this->registry = Xoops_Registry::getInstance(); } @@ -369,7 +371,7 @@ * * @return bool */ - public function header($tpl_name = '') + public function header($tpl_name = null) { if ($this->isAdminSide) { return $this->_adminHeader($tpl_name); @@ -388,11 +390,18 @@ if ($tpl_name) { $tpl_info = $this->getTplInfo($tpl_name); $this->tpl_name = $tpl_info['tpl_name']; + } else { + $tpl_name = 'module:system|system_dummy.html'; + $tpl_info = $this->getTplInfo($tpl_name); + $this->tpl_name = $tpl_info['tpl_name']; } // for legacy support when template is set after header. $this->option['template_main'] = $this->tpl_name; + // Load xlanguage api + $this->preload->triggerEvent('core.language.common'); + $xoopsThemeFactory = null; $xoopsThemeFactory = new XoopsThemeFactory(); $xoopsThemeFactory->allowedThemes = $this->getConfig('theme_set_allowed'); @@ -402,6 +411,9 @@ $this->preload->triggerEvent('core.header.addmeta'); + // common preload : xlanguage block, ... + $this->preload->triggerEvent('core.header.common'); + // Temporary solution for start page redirection if (defined("XOOPS_STARTPAGE_REDIRECTED")) { $this->theme->headContent(null, "<base href='" . XOOPS_URL . '/modules/' . $this->getConfig('startpage') . "/' />", null, null); @@ -427,7 +439,7 @@ // Tricky solution for setting cache time for homepage } else { if ($this->tpl_name == 'module:system|system_homepage.html') { - //$this->theme->contentCacheLifetime = 604800; + $this->theme->contentCacheLifetime = 604800; } } @@ -579,26 +591,6 @@ /** * @param mixed $optional * - * @return XoopsBannerHandler - */ - public function getHandlerBanner($optional = false) - { - return $this->getHandler('banner', $optional); - } - - /** - * @param mixed $optional - * - * @return XoopsBannerclientHandler - */ - public function getHandlerBannerclient($optional = false) - { - return $this->getHandler('bannerclient', $optional); - } - - /** - * @param mixed $optional - * * @return XoopsBlockHandler */ public function getHandlerBlock($optional = false) @@ -1098,7 +1090,7 @@ */ public function error($msg, $title = '') { - echo '<div class="errorMsg alert-message error">'; + echo '<div class="alert alert-error">'; if ($title != '') { echo '<strong>' . $title . '</strong><br /><br />'; } @@ -1158,25 +1150,25 @@ 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 . '">'; + $this->tpl->assign('msg', $msg); + $this->tpl->assign('action', $action); + $this->tpl->assign('submit', $submit); + $str_hiddens = ''; foreach ($hiddens as $name => $value) { if (is_array($value)) { foreach ($value as $caption => $newvalue) { - echo '<input type="radio" name="' . $name . '" value="' . htmlspecialchars($newvalue) . '" /> ' . $caption; + $str_hiddens .= '<input type="radio" name="' . $name . '" value="' . htmlspecialchars($newvalue) . '" > ' . $caption . NWLINE; } - echo '<br />'; + $str_hiddens .= '<br />' . NWLINE; } else { - echo '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />'; + $str_hiddens .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />' . NWLINE; } } if ($addtoken != false) { - echo $this->security->getTokenHTML(); + $this->tpl->assign('token', $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>'; + $this->tpl->assign('hiddens', $str_hiddens); + $this->tpl->display('module:system|system_confirm.html'); } /** @@ -1296,80 +1288,13 @@ /** * Function to get banner html tags for use in templates * - * @param int $nb_banner - * @param string $align - * @param array $client - * @param string $ids - * * @return string */ - public function getBanner($nb_banner = 1, $align = 'H', $client = array(), $ids = '') + public function getBanner() { - if ($this->isActiveModule('banners')) { - // Get banners handler - $banner_Handler = $this->getHandlerBanner(); - // Display banner - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('status', 0, '!=')); - $criteria->setSort('RAND()'); - if (!empty($client)) { - if (!in_array(0,$client)) { - $criteria->add(new Criteria('cid', '(' . implode(',', $client) . ')','IN')); - } - } - if ($ids == '') { - $criteria->setLimit($nb_banner); - $criteria->setStart(0); - } else { - $criteria->add(new Criteria('bid', '(' . $ids . ')','IN')); - } - $banner_arr = $banner_Handler->getall($criteria); - $numrows = count($banner_arr); - $bannerobject = ''; - if ($numrows > 0) { - foreach (array_keys($banner_arr) as $i) { - $imptotal = $banner_arr[$i]->getVar("imptotal"); - $impmade = $banner_arr[$i]->getVar("impmade"); - $htmlbanner = $banner_arr[$i]->getVar("htmlbanner"); - $htmlcode = $banner_arr[$i]->getVar("htmlcode"); - $imageurl = $banner_arr[$i]->getVar("imageurl"); - $bid = $banner_arr[$i]->getVar("bid"); - $clickurl = $banner_arr[$i]->getVar("clickurl"); - /** - * Print the banner - */ - if ($htmlbanner) { - $bannerobject .= $htmlcode; - } else { - if (stristr($imageurl, '.swf')) { - $bannerobject .= '<a href="' . XOOPS_URL . '/modules/banners/index.php?op=click&bid=' . $bid . '" rel="external" title="' . $clickurl . '"></a>' . '<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 .= '<a href="' . XOOPS_URL . '/modules/banners/index.php?op=click&bid=' . $bid . '" rel="external" title="' . $clickurl . '"><img src="' . $imageurl . '" alt="' . $clickurl . '" /></a>'; - } - } - if ($align == 'V') { - $bannerobject .= '<br /><br />'; - } else { - $bannerobject .= ' '; - } - if ($this->getModuleConfig('banners_myip', 'banners') == $this->getEnv('REMOTE_ADDR')) { - // EMPTY - } else { - /** - * Check if this impression is the last one - */ - $impmade = $impmade + 1; - if ($imptotal > 0 && $impmade >= $imptotal) { - $this->db->queryF(sprintf('UPDATE %s SET status = %u, dateend = %u WHERE bid = %u', $this->db->prefix('banner'), 0, time(), $bid)); - }else{ - $this->db->queryF(sprintf('UPDATE %s SET impmade = %u WHERE bid = %u', $this->db->prefix('banner'), $impmade, $bid)); - } - } - } - return $bannerobject; - } - } - return ''; + $options = ''; + $this->preload->triggerEvent('core.banner.display', array(&$options)); + return $options; } /** @@ -1582,15 +1507,16 @@ /** * @param string $key * @param string $type + * @param int $module * * @return mixed */ - public function getConfig($key, $type = 'XOOPS_CONF') + public function getConfig($key, $type = 'XOOPS_CONF', $module = 0) { if (isset($this->_systemConfigs[$key])) { return $this->_systemConfigs[$key]; } - $this->getConfigs($type); + $this->getConfigs($type, $module); if (!isset($this->_systemConfigs[$key])) { $this->_systemConfigs[$key] = ''; } @@ -1599,13 +1525,14 @@ /** * @param string $type + * @param int $module * * @return array */ - public function getConfigs($type = 'XOOPS_CONF') + public function getConfigs($type = 'XOOPS_CONF', $module = 0) { $configs = $this->getHandlerConfig() - ->getConfigsByCat((is_array($type)) ? $type : (!defined($type) ? $type : constant($type))); + ->getConfigsByCat((is_array($type)) ? $type : (!defined($type) ? $type : constant($type)), $module); $this->_systemConfigs = array_merge($this->_systemConfigs, $configs); $this->config =& $this->_systemConfigs; //for compatibilty return $this->_systemConfigs; |