Beispiel #1
0
/**
 * Function icms_cp_header
 *
 * @since ImpressCMS 1.2
 * @version $Id: cp_functions.php 12115 2012-11-18 16:10:55Z fiammy $
 *
 * @author rowd (from the XOOPS Community)
 * @author nekro (aka Gustavo Pilla)<*****@*****.**>
 */
function icms_cp_header()
{
    global $icmsConfig, $icmsConfigPlugins, $icmsConfigPersona, $icmsModule, $xoopsModule, $xoopsTpl, $xoopsOption, $icmsTheme, $xoTheme, $icmsConfigMultilang, $icmsAdminTpl;
    icms::$logger->stopTime('Module init');
    icms::$logger->startTime('ImpressCMS CP Output Init');
    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, must-revalidate');
        header("Cache-Control: post-check=0, pre-check=0", false);
        header("Pragma: no-cache");
    }
    $icmsAdminTpl = new icms_view_Tpl();
    $icmsAdminTpl->assign('xoops_url', ICMS_URL);
    $icmsAdminTpl->assign('icms_sitename', $icmsConfig['sitename']);
    if (@$xoopsOption['template_main']) {
        if (false === strpos($xoopsOption['template_main'], ':')) {
            $xoopsOption['template_main'] = 'db:' . $xoopsOption['template_main'];
        }
    }
    $xoopsThemeFactory = new icms_view_theme_Factory();
    $xoopsThemeFactory->allowedThemes = $icmsConfig['theme_set_allowed'];
    // The next 2 lines are for compatibility only... to implement the admin theme ;)
    // TODO: Remove all this after a few versions!!
    if (isset($icmsConfig['theme_admin_set'])) {
        $xoopsThemeFactory->defaultTheme = $icmsConfig['theme_admin_set'];
    }
    $icmsTheme = $xoTheme =& $xoopsThemeFactory->createInstance(array('contentTemplate' => @$xoopsOption['template_main'], 'canvasTemplate' => 'theme' . (file_exists(ICMS_THEME_PATH . '/' . $icmsConfig['theme_admin_set'] . '/theme_admin.html') || file_exists(ICMS_MODULES_PATH . '/system/themes/' . $icmsConfig['theme_admin_set'] . '/theme_admin.html') ? '_admin' : '') . '.html', 'plugins' => array('icms_view_PageBuilder'), 'folderName' => $icmsConfig['theme_admin_set']));
    $icmsAdminTpl = $xoTheme->template;
    // ################# Preload Trigger startOutputInit ##############
    icms::$preload->triggerEvent('adminHeader');
    $xoTheme->addScript(ICMS_URL . '/include/xoops.js', array('type' => 'text/javascript'));
    $xoTheme->addScript('', array('type' => 'text/javascript'), 'startList = function() {
						if (document.all&&document.getElementById) {
							navRoot = document.getElementById("nav");
							for (i=0; i<navRoot.childNodes.length; i++) {
								node = navRoot.childNodes[i];
								if (node.nodeName=="LI") {
									node.onmouseover=function() {
										this.className+=" over";
									}
									node.onmouseout=function() {
										this.className=this.className.replace(" over", "");
									}
								}
							}
						}
					}
					window.onload=startList;');
    /** @todo	Remove icms.css in 2.0 */
    icms_core_Debug::setDeprecated("Elements from icms.css need to be moved to your theme", sprintf(_CORE_REMOVE_IN_VERSION, '2.0'));
    $xoTheme->addStylesheet(ICMS_URL . '/icms' . (defined('_ADM_USE_RTL') && _ADM_USE_RTL ? '_rtl' : '') . '.css', array('media' => 'screen'));
    // JQuery UI Dialog
    $xoTheme->addScript(ICMS_URL . '/libraries/jquery/jquery.js', array('type' => 'text/javascript'));
    if (!empty($_SESSION['redirect_message'])) {
        $xoTheme->addScript(ICMS_URL . '/libraries/jquery/jgrowl.js', array('type' => 'text/javascript'));
        $xoTheme->addStylesheet(ICMS_URL . '/libraries/jquery/jgrowl' . (defined('_ADM_USE_RTL') && _ADM_USE_RTL ? '_rtl' : '') . '.css', array('media' => 'screen'));
        $xoTheme->addScript('', array('type' => 'text/javascript'), '
	if (!window.console || !console.firebug) {
		var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
		window.console = {};

		for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {};
	}

	(function($) {
		$(document).ready(function() {
			$.jGrowl("' . $_SESSION['redirect_message'] . '", {  life:5000 , position: "center", speed: "slow" });
		});
	})(jQuery);
	');
        unset($_SESSION['redirect_message']);
    }
    $xoTheme->addScript(ICMS_URL . '/libraries/jquery/ui/ui.min.js', array('type' => 'text/javascript'));
    $xoTheme->addScript(ICMS_URL . '/libraries/jquery/helptip.js', array('type' => 'text/javascript'));
    $xoTheme->addStylesheet(ICMS_URL . '/libraries/jquery/ui/css/ui-smoothness/ui.css', array('media' => 'screen'));
    $xoTheme->addStylesheet(ICMS_LIBRARIES_URL . '/jquery/colorbox/colorbox.css');
    $xoTheme->addScript(ICMS_LIBRARIES_URL . '/jquery/colorbox/jquery.colorbox-min.js');
    /*	$jscript = '';
    	 if(class_exists('icms_form_elements_Dhtmltextarea')){
    		foreach ($icmsConfigPlugins['sanitizer_plugins'] as $key) {
    		if( empty( $key ) )
    		continue;
    		if(file_exists(ICMS_ROOT_PATH.'/plugins/textsanitizer/'.$key.'/'.$key.'.js')){
    		$xoTheme->addScript(ICMS_URL.'/plugins/textsanitizer/'.$key.'/'.$key.'.js', array('type' => 'text/javascript'));
    		}else{
    		$extension = include_once ICMS_ROOT_PATH.'/plugins/textsanitizer/'.$key.'/'.$key.'.php';
    		$func = 'render_'.$key;
    		if ( function_exists($func) ) {
    		@list($encode, $jscript) = $func($ele_name);
    		if (!empty($jscript)) {
    		if(!file_exists(ICMS_ROOT_PATH.'/'.$jscript)){
    		$xoTheme->addScript('', array('type' => 'text/javascript'), $jscript);
    		}else{
    		$xoTheme->addScript($jscript, array('type' => 'text/javascript'));
    		}
    		}
    		}
    		}
    		}
    		}
    		*/
    $style_info = '';
    if (!empty($icmsConfigPlugins['sanitizer_plugins'])) {
        foreach ($icmsConfigPlugins['sanitizer_plugins'] as $key) {
            if (empty($key)) {
                continue;
            }
            if (file_exists(ICMS_ROOT_PATH . '/plugins/textsanitizer/' . $key . '/' . $key . '.css')) {
                $xoTheme->addStylesheet(ICMS_URL . '/plugins/textsanitizer/' . $key . '/' . $key . '.css', array('media' => 'screen'));
            } else {
                $extension = (include_once ICMS_ROOT_PATH . '/plugins/textsanitizer/' . $key . '/' . $key . '.php');
                $func = 'style_' . $key;
                if (function_exists($func)) {
                    $style_info = $func();
                    if (!empty($style_info)) {
                        if (!file_exists(ICMS_ROOT_PATH . '/' . $style_info)) {
                            $xoTheme->addStylesheet('', array('media' => 'screen'), $style_info);
                        } else {
                            $xoTheme->addStylesheet($style_info, array('media' => 'screen'));
                        }
                    }
                }
            }
        }
    }
    /**
     * Loading admin dropdown menus
     */
    if (!file_exists(ICMS_CACHE_PATH . '/adminmenu_' . $icmsConfig['language'] . '.php')) {
        xoops_module_write_admin_menu(impresscms_get_adminmenu());
    }
    $file = file_get_contents(ICMS_CACHE_PATH . "/adminmenu_" . $icmsConfig['language'] . ".php");
    $admin_menu = eval('return ' . $file . ';');
    $moduleperm_handler = icms::handler('icms_member_groupperm');
    $module_handler = icms::handler('icms_module');
    foreach ($admin_menu as $k => $navitem) {
        //Getting array of allowed modules to use in admin home
        if ($navitem['id'] == 'modules') {
            $perm_itens = array();
            foreach ($navitem['menu'] as $item) {
                $module = $module_handler->getByDirname($item['dir']);
                $admin_perm = $moduleperm_handler->checkRight('module_admin', $module->getVar('mid'), icms::$user->getGroups());
                if ($admin_perm) {
                    if ($item['dir'] != 'system') {
                        $perm_itens[] = $item;
                    }
                }
            }
            $navitem['menu'] = $mods = $perm_itens;
        }
        //end
        if ($navitem['id'] == 'opsystem') {
            $groups = icms::$user->getGroups();
            $all_ok = false;
            if (!in_array(ICMS_GROUP_ADMIN, $groups)) {
                $sysperm_handler = icms::handler('icms_member_groupperm');
                $ok_syscats =& $sysperm_handler->getItemIds('system_admin', $groups);
            } else {
                $all_ok = true;
            }
            $perm_itens = array();
            /**
             * Allow easely change the order of system dropdown menu.
             * $adminmenuorder = 1; Alphabetically order;
             * $adminmenuorder = 0; Indice key order;
             * To change the order when using Indice key order just change the order of the array in the file modules/system/menu.php and after update the system module
             *
             * @todo: Create a preference option to set this value and improve the way to change the order.
             */
            $adminmenuorder = 1;
            $adminsubmenuorder = 1;
            $adminsubsubmenuorder = 1;
            if ($adminmenuorder == 1) {
                foreach ($navitem['menu'] as $k => $sortarray) {
                    $column[] = $sortarray['title'];
                    if (isset($sortarray['subs']) && count($sortarray['subs']) > 0 && $adminsubmenuorder) {
                        asort($navitem['menu'][$k]['subs']);
                    }
                    if (isset($sortarray['subs']) && count($sortarray['subs']) > 0) {
                        foreach ($sortarray['subs'] as $k2 => $sortarray2) {
                            if (isset($sortarray2['subs']) && count($sortarray2['subs']) > 0 && $adminsubsubmenuorder) {
                                asort($navitem['menu'][$k]['subs'][$k2]['subs']);
                                //Sorting submenus of preferences
                            }
                        }
                    }
                }
                //sort arrays after loop
                array_multisort($column, SORT_ASC, $navitem['menu']);
            }
            foreach ($navitem['menu'] as $item) {
                foreach ($item['subs'] as $key => $subitem) {
                    if ($all_ok == false && !in_array($subitem['id'], $ok_syscats)) {
                        // remove the subitem
                        unset($item['subs'][$key]);
                    }
                }
                // only add the item (first layer: groups) if it has subitems
                if (count($item['subs']) > 0) {
                    $perm_itens[] = $item;
                }
            }
            //Getting array of allowed system prefs
            $navitem['menu'] = $sysprefs = $perm_itens;
        }
        $icmsAdminTpl->append('navitems', $navitem);
    }
    if (count($sysprefs) > 0) {
        $icmsAdminTpl->assign('systemadm', 1);
    } else {
        $icmsAdminTpl->assign('systemadm', 0);
    }
    if (count($mods) > 0) {
        $icmsAdminTpl->assign('modulesadm', 1);
    } else {
        $icmsAdminTpl->assign('modulesadm', 0);
    }
    /**
     * Loading options of the current module.
     */
    if ($icmsModule) {
        if ($icmsModule->getVar('dirname') == 'system') {
            if (isset($sysprefs) && count($sysprefs) > 0) {
                // remove the grouping for the system module preferences (first layer)
                $sysprefs_tmp = array();
                foreach ($sysprefs as $pref) {
                    $sysprefs_tmp = array_merge($sysprefs_tmp, $pref['subs']);
                }
                $sysprefs = $sysprefs_tmp;
                unset($sysprefs_tmp);
                for ($i = count($sysprefs) - 1; $i >= 0; $i = $i - 1) {
                    if (isset($sysprefs[$i])) {
                        $reversed_sysprefs[] = $sysprefs[$i];
                    }
                }
                foreach ($reversed_sysprefs as $k) {
                    $icmsAdminTpl->append('mod_options', array('title' => $k['title'], 'link' => $k['link'], 'icon' => isset($k['icon']) && $k['icon'] != '' ? $k['icon'] : ''));
                }
            }
        } else {
            foreach ($mods as $mod) {
                if ($mod['dir'] == $icmsModule->getVar('dirname')) {
                    $m = $mod;
                    //Getting info of the current module
                    break;
                }
            }
            if (isset($m['subs']) && count($m['subs']) > 0) {
                for ($i = count($m['subs']) - 1; $i >= 0; $i = $i - 1) {
                    if (isset($m['subs'][$i])) {
                        $reversed_module_admin_menu[] = $m['subs'][$i];
                    }
                }
                foreach ($reversed_module_admin_menu as $k) {
                    $icmsAdminTpl->append('mod_options', array('title' => $k['title'], 'link' => $k['link'], 'icon' => isset($k['icon']) && $k['icon'] != '' ? $k['icon'] : ''));
                }
            }
        }
        $icmsAdminTpl->assign('modpath', ICMS_URL . '/modules/' . $icmsModule->getVar('dirname'));
        $icmsAdminTpl->assign('modname', $icmsModule->getVar('name'));
        $icmsAdminTpl->assign('modid', $icmsModule->getVar('mid'));
        $icmsAdminTpl->assign('moddir', $icmsModule->getVar('dirname'));
        $icmsAdminTpl->assign('lang_prefs', _PREFERENCES);
    }
    if (@is_object($xoTheme->plugins['icms_view_PageBuilder'])) {
        $aggreg =& $xoTheme->plugins['icms_view_PageBuilder'];
        $icmsAdminTpl->assign_by_ref('xoAdminBlocks', $aggreg->blocks);
        // Backward compatibility code for pre 2.0.14 themes
        $icmsAdminTpl->assign_by_ref('xoops_lblocks', $aggreg->blocks['canvas_left']);
        $icmsAdminTpl->assign_by_ref('xoops_rblocks', $aggreg->blocks['canvas_right']);
        $icmsAdminTpl->assign_by_ref('xoops_ccblocks', $aggreg->blocks['page_topcenter']);
        $icmsAdminTpl->assign_by_ref('xoops_clblocks', $aggreg->blocks['page_topleft']);
        $icmsAdminTpl->assign_by_ref('xoops_crblocks', $aggreg->blocks['page_topright']);
        $icmsAdminTpl->assign('xoops_showlblock', !empty($aggreg->blocks['canvas_left']));
        $icmsAdminTpl->assign('xoops_showrblock', !empty($aggreg->blocks['canvas_right']));
        $icmsAdminTpl->assign('xoops_showcblock', !empty($aggreg->blocks['page_topcenter']) || !empty($aggreg->blocks['page_topleft']) || !empty($aggreg->blocks['page_topright']));
        /**
         * Send to template some ml infos
         */
        $icmsAdminTpl->assign('lang_prefs', _PREFERENCES);
        $icmsAdminTpl->assign('ml_is_enabled', $icmsConfigMultilang['ml_enable']);
        $icmsAdminTpl->assign('adm_left_logo', $icmsConfigPersona['adm_left_logo']);
        $icmsAdminTpl->assign('adm_left_logo_url', $icmsConfigPersona['adm_left_logo_url']);
        $icmsAdminTpl->assign('adm_left_logo_alt', $icmsConfigPersona['adm_left_logo_alt']);
        $icmsAdminTpl->assign('adm_right_logo', $icmsConfigPersona['adm_right_logo']);
        $icmsAdminTpl->assign('adm_right_logo_url', $icmsConfigPersona['adm_right_logo_url']);
        $icmsAdminTpl->assign('adm_right_logo_alt', $icmsConfigPersona['adm_right_logo_alt']);
        $icmsAdminTpl->assign('show_impresscms_menu', $icmsConfigPersona['show_impresscms_menu']);
    }
}
Beispiel #2
0
 /**
  * Gets list of themes folder from themes directory, excluding any directories that do not have theme.html
  * @deprecated	Use icms_view_theme_Factory::getThemesList()
  * @todo	Remove in 1.4
  * @return	array
  */
 public static function getThemesList()
 {
     icms_core_Debug::setDeprecated('icms_module_Handler::getAvailable', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
     return icms_view_theme_Factory::getThemesList();
 }
Beispiel #3
0
/**
 * Function to redirect a user to certain pages
 *
 * @param string  $url  The URL to redirect to
 * @param int  $time  The time it takes to redirect to the URL
 * @param string  $message  The message to show while redirecting
 * @param bool  $addredirect  Add a link to the redirect URL?
 * @param string  $allowExternalLink  Allow external links
 */
function redirect_header($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false)
{
    global $icmsConfig, $icmsConfigPersona;
    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 = ICMS_URL;
        }
    }
    if (!$allowExternalLink && ($pos = strpos($url, '://'))) {
        $xoopsLocation = substr(ICMS_URL, strpos(ICMS_URL, '://') + 3);
        if (substr($url, $pos + 3, strlen($xoopsLocation)) != $xoopsLocation) {
            $url = ICMS_URL;
        } elseif (substr($url, $pos + 3, strlen($xoopsLocation) + 1) == $xoopsLocation . '.') {
            $url = ICMS_URL;
        }
    }
    $theme = $icmsConfig['theme_set'];
    // if the user selected a theme in the theme block, let's use this theme
    if (isset($_SESSION['xoopsUserTheme']) && in_array($_SESSION['xoopsUserTheme'], $icmsConfig['theme_set_allowed'])) {
        $theme = $_SESSION['xoopsUserTheme'];
    }
    $xoopsThemeFactory = new icms_view_theme_Factory();
    $xoopsThemeFactory->allowedThemes = $icmsConfig['theme_set_allowed'];
    $xoopsThemeFactory->defaultTheme = $theme;
    $icmsTheme = $xoTheme =& $xoopsThemeFactory->createInstance(array("plugins" => array()));
    $xoopsTpl = $icmsTpl =& $xoTheme->template;
    if ($icmsConfig['debug_mode'] == 2 && icms::$user->isAdmin()) {
        $xoopsTpl->assign('time', 300);
        $xoopsTpl->assign('xoops_logdump', icms::$logger->dump());
    } else {
        $xoopsTpl->assign('time', (int) $time);
    }
    if (!empty($_SERVER['REQUEST_URI']) && $addredirect && strstr($url, 'user.php')) {
        if (!strstr($url, '?')) {
            $url .= '?xoops_redirect=' . urlencode($_SERVER['REQUEST_URI']);
        } else {
            $url .= '&amp;xoops_redirect=' . urlencode($_SERVER['REQUEST_URI']);
        }
    }
    if (defined('SID') && SID && (!isset($_COOKIE[session_name()]) || $icmsConfig['use_mysession'] && $icmsConfig['session_name'] != '' && !isset($_COOKIE[$icmsConfig['session_name']]))) {
        if (!strstr($url, '?')) {
            $url .= '?' . SID;
        } else {
            $url .= '&amp;' . SID;
        }
    }
    $url = preg_replace("/&amp;/i", '&', htmlspecialchars($url, ENT_QUOTES));
    $xoopsTpl->assign('url', $url);
    $message = trim($message) != '' ? $message : _TAKINGBACK;
    $xoopsTpl->assign('message', $message);
    $xoopsTpl->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD, $url));
    // GIJ start
    if (!headers_sent() && $icmsConfigPersona['use_custom_redirection'] == 1) {
        $_SESSION['redirect_message'] = $message;
        header("Location: " . preg_replace("/[&]amp;/i", '&', $url));
        exit;
    } else {
        $xoopsTpl->display('db:system_redirect.html');
        if (defined('XOOPS_CPFUNC_LOADED')) {
            icms_cp_footer();
        } else {
            include ICMS_ROOT_PATH . '/footer.php';
        }
        exit;
    }
    // GIJ end
}
Beispiel #4
0
 public function &createInstance($options = array(), $initArgs = array())
 {
     $this->_deprecated = icms_core_Debug::setDeprecated('icms_view_theme_Factory', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
     return parent::createInstance($options, $initArgs);
 }
Beispiel #5
0
					}
					break;
						
				case 'yesno' :
					$ele = new icms_form_elements_Radioyn($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
					break;
						
				case 'theme' :
				case 'theme_multi' :
				case 'theme_admin' :
					$ele =($config[$i]->getVar('conf_formtype') != 'theme_multi')
						? new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput())
						: new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, TRUE);
					$dirlist =($config[$i]->getVar('conf_formtype') != 'theme_admin')
						? icms_view_theme_Factory::getThemesList()
						: icms_view_theme_Factory::getAdminThemesList();
					if (! empty($dirlist)) {
						asort($dirlist);
						$ele->addOptionArray($dirlist);
					}
					$form->addElement(new icms_form_elements_Hidden('_old_theme', $config[$i]->getConfValueForOutput()));
					break;

				case 'editor' :
				case 'editor_source' :
					$type = explode('_', $config[$i]->getVar('conf_formtype'));
					$ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
					$type = array_pop($type);
					if ($type == 'editor') $type = '';
					$dirlist = icms_plugins_EditorHandler::getListByType($type);
					if (! empty($dirlist)) {
$allowed = FALSE;
if (isset($xoopsOption['ignore_closed_site']) && $xoopsOption['ignore_closed_site']) {
    $allowed = TRUE;
} elseif (is_object(icms::$user)) {
    foreach (icms::$user->getGroups() as $group) {
        if (in_array($group, $icmsConfig['closesite_okgrp']) || ICMS_GROUP_ADMIN == $group) {
            $allowed = TRUE;
            break;
        }
    }
} elseif (!empty($_POST['xoops_login'])) {
    include_once ICMS_INCLUDE_PATH . '/checklogin.php';
    exit;
}
if (!$allowed) {
    $themeFactory = new icms_view_theme_Factory();
    $themeFactory->allowedThemes = $icmsConfig['theme_set_allowed'];
    $themeFactory->defaultTheme = $icmsConfig['theme_set'];
    $icmsTheme =& $themeFactory->createInstance(array("plugins" => array()));
    $icmsTheme->addScript('/include/xoops.js', array('type' => 'text/javascript'));
    $icmsTheme->addStylesheet(ICMS_URL . "/icms" . (defined('_ADM_USE_RTL') && _ADM_USE_RTL ? "_rtl" : "") . ".css", array("media" => "screen"));
    $icmsTpl =& $icmsTheme->template;
    $icmsTpl->assign(array('icms_theme' => $icmsConfig['theme_set'], 'icms_imageurl' => ICMS_THEME_URL . '/' . $icmsConfig['theme_set'] . '/', 'icms_themecss' => xoops_getcss($icmsConfig['theme_set']), 'icms_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES), 'icms_sitename' => htmlspecialchars($icmsConfig['sitename'], ENT_QUOTES), 'icms_slogan' => htmlspecialchars($icmsConfig['slogan'], ENT_QUOTES), 'icms_dirname' => @$icmsModule ? $icmsModule->getVar('dirname') : 'system', 'icms_banner' => $icmsConfig['banners'] ? xoops_getbanner() : '&nbsp;', 'icms_pagetitle' => isset($icmsModule) && is_object($icmsModule) ? $icmsModule->getVar('name') : htmlspecialchars($icmsConfig['slogan'], ENT_QUOTES), 'lang_login' => _LOGIN, 'lang_username' => _USERNAME, 'lang_password' => _PASSWORD, 'lang_siteclosemsg' => $icmsConfig['closesite_text']));
    foreach ($icmsConfigMetaFooter as $name => $value) {
        if (substr($name, 0, 5) == 'meta_') {
            $icmsTpl->assign("xoops_{$name}", htmlspecialchars($value, ENT_QUOTES));
        } else {
            $icmsTpl->assign("xoops_{$name}", $value);
        }
    }
    $icmsTpl->debugging = FALSE;
Beispiel #7
0
 public function &createInstance($options = array(), $initArgs = array())
 {
     $this->_deprecated = icms_core_Debug::setDeprecated('icms_view_theme_Factory', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
     return parent::createInstance($options, $initArgs);
     // THIS LINE MOVED FROM ABOVE THE PREVIOUS LINE, AND RETURN ADDED.  BY FREEFORM SOLUTIONS JUNE 3 2012, FOR BACKWARDS COMPATIBILITY WITH CODE THAT RELIES ON THE XOOPS CLASS
 }
Beispiel #8
0
 * @license		http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
 * @package		core
 * @author		Sina Asghari (aka stranger) <*****@*****.**>
 * @version		svn: $Id: header.php 22269 2011-08-19 14:57:19Z phoenyx $
 */
defined('ICMS_ROOT_PATH') or die('ImpressCMS root path not defined');
icms::$logger->stopTime('Module init');
icms::$logger->startTime('ICMS output init');
global $xoopsOption, $icmsConfig, $icmsModule;
$xoopsOption['theme_use_smarty'] = 1;
if (@$xoopsOption['template_main']) {
    if (FALSE === strpos($xoopsOption['template_main'], ':')) {
        $xoopsOption['template_main'] = 'db:' . $xoopsOption['template_main'];
    }
}
$xoopsThemeFactory = new icms_view_theme_Factory();
$xoopsThemeFactory->allowedThemes = $icmsConfig['theme_set_allowed'];
$xoopsThemeFactory->defaultTheme = $icmsConfig['theme_set'];
/**
 * @var icms_view_theme_Object
 */
$icmsTheme = $xoTheme =& $xoopsThemeFactory->createInstance(array('contentTemplate' => @$xoopsOption['template_main']));
$GLOBALS['icmsTheme'] = $icmsTheme;
$GLOBALS['xoTheme'] = $xoTheme;
$xoopsTpl = $icmsTpl =& $xoTheme->template;
$GLOBALS['xoopsTpl'] = $xoopsTpl;
$GLOBALS['icmsTpl'] = $icmsTpl;
if ($icmsConfigMetaFooter['use_google_analytics'] === TRUE && isset($icmsConfigMetaFooter['google_analytics']) && $icmsConfigMetaFooter['google_analytics'] != '') {
    /* Legacy GA urchin code */
    //$xoTheme->addScript('http://www.google-analytics.com/urchin.js',array('type' => 'text/javascript'),'_uacct = "UA-' . $icmsConfigMetaFooter['google_analytics'] . '";urchinTracker();');
    $scheme = parse_url(ICMS_URL, PHP_URL_SCHEME);
Beispiel #9
0
 /**
  * Constructor
  *
  * @param	string	$caption
  * @param	string	$name
  * @param	mixed	$value	Pre-selected value (or array of them).
  * @param	int		$size	Number or rows. "1" makes a drop-down-list
  */
 public function __construct($caption, $name, $value = null, $size = 1)
 {
     parent::__construct($caption, $name, $value, $size);
     $this->addOptionArray(icms_view_theme_Factory::getThemesList());
 }
Beispiel #10
0
     $options = $config_handler->getConfigOptions(new icms_db_criteria_Item('conf_id', $config[$i]->getVar('conf_id')));
     $opcount = count($options);
     for ($j = 0; $j < $opcount; $j++) {
         $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
         $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
         $ele->addOption($optval, $optkey);
     }
     break;
 case 'yesno':
     $ele = new icms_form_elements_Radioyn($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
     break;
 case 'theme':
 case 'theme_multi':
 case 'theme_admin':
     $ele = $config[$i]->getVar('conf_formtype') != 'theme_multi' ? new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()) : new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, TRUE);
     $dirlist = $config[$i]->getVar('conf_formtype') != 'theme_admin' ? icms_view_theme_Factory::getThemesList() : icms_view_theme_Factory::getAdminThemesList();
     if (!empty($dirlist)) {
         asort($dirlist);
         $ele->addOptionArray($dirlist);
     }
     $form->addElement(new icms_form_elements_Hidden('_old_theme', $config[$i]->getConfValueForOutput()));
     break;
 case 'editor':
 case 'editor_source':
     $type = explode('_', $config[$i]->getVar('conf_formtype'));
     $ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
     $type = array_pop($type);
     if ($type == 'editor') {
         $type = '';
     }
     $dirlist = icms_plugins_EditorHandler::getListByType($type);