Beispiel #1
0
 public function eventCoreIncludeCommonLanguage()
 {
     load_mod_locale('xthemes');
     define('XTPATH', XOOPS_ROOT_PATH . '/modules/xthemes');
     define('XTURL', XOOPS_URL . '/modules/xthemes');
     require_once XTPATH . '/class/xtassembler.class.php';
     $GLOBALS['xtAssembler'] = new XtAssembler();
     $GLOBALS['xtFunctions'] = new XtFunctions();
     load_theme_locale($GLOBALS['xtAssembler']->theme()->getInfo('dir'));
 }
Beispiel #2
0
 public function eventCoreHeaderStart()
 {
     global $xoopsConfig;
     include_once XOOPS_ROOT_PATH . '/modules/xthemes/include/functions.php';
     include XOOPS_ROOT_PATH . '/modules/xthemes/class/theme.php';
     include XOOPS_ROOT_PATH . '/modules/xthemes/controller.php';
     if (FALSE == ($object = xt_is_valid($xoopsConfig['theme_set']))) {
         return;
     }
     load_theme_locale($xoopsConfig['theme_set']);
 }
Beispiel #3
0
 public function eventCoreHeaderStart()
 {
     global $xoopsConfig;
     include XOOPS_ROOT_PATH . '/modules/xthemes/include/functions.php';
     include XOOPS_ROOT_PATH . '/modules/xthemes/class/theme.php';
     include XOOPS_ROOT_PATH . '/modules/xthemes/controller.php';
     if (FALSE == ($object = xt_is_valid($xoopsConfig['theme_set']))) {
         return;
     }
     load_theme_locale($xoopsConfig['theme_set']);
     if ($object->get_info("jquery")) {
         RMTemplate::get()->add_jquery();
     }
 }
Beispiel #4
0
<?php

// $Id$
// --------------------------------------------------------------
// Designia v1.0
// Theme for Common Utilities 2
// Author: Eduardo Cortés <*****@*****.**>
// Email: i.bitcero@gmail.com
// License: GPL 2.0
// --------------------------------------------------------------
load_theme_locale('designia', '', true);
global $xoopsUser, $xoopsSecurity;
define('DESIGNIA_PATH', RMCPATH . '/themes/designia');
define('DESIGNIA_URL', RMCURL . '/themes/designia');
include_once DESIGNIA_PATH . '/class/designiafunctions.class.php';
// Cookies
RMTemplate::get()->add_local_script('jquery.ck.js', 'rmcommon', 'include');
// Get current module menu
DesigniaFunctions::currentModuleMenu();
// System module menu
if ($xoopsModule->dirname() != 'system') {
    $system_menu = DesigniaFunctions::moduleMenu('system');
}
// Common Utilities module menu
if ($xoopsModule->dirname() != 'rmcommon') {
    $rmcommon_menu = DesigniaFunctions::moduleMenu('rmcommon');
}
// Other Menus
$other_menu = RMEvents::get()->run_event('designia.other.menu');
// Left Widgets
$left_widgets = array();
Beispiel #5
0
<?php

/*
Theme name: Two Point Six
Theme URI: http://www.redmexico.com.mx
Version: 1.0
Author: bitcero
Author URI: http://www.bitcero.info
*/
load_theme_locale('twop6', '', true);
global $xoopsUser, $xoopsSecurity;
define('TWOP6_PATH', RMCPATH . '/themes/twop6');
define('TWOP6_URL', RMCURL . '/themes/twop6');
include_once TWOP6_PATH . '/class/twop6functions.class.php';
$xoFunc = new Twop6Functions();
// Get current module menu
if ($xoopsModule->dirname() != 'rmcommon' && $xoopsModule->dirname() != 'system') {
    $xoFunc->currentModuleMenu();
}
// Common Utilities module menu
$rmcommon_menu = $xoFunc->moduleMenu('rmcommon');
// System module menu
$system_menu = $xoFunc->moduleMenu('system');
// Other Menus
$other_menu = RMEvents::get()->run_event('twop6.other.menu');
// Left Widgets
$left_widgets = array();
$left_widgets = RMEvents::get()->run_event('rmcommon.load.left.widgets', $left_widgets);
// Right widgets
$right_widgets = array();
$right_widgets = RMEvents::get()->run_event('rmcommon.load.right.widgets', $right_widgets);
Beispiel #6
0
<?php

/*
Theme name: Helium Theme
Theme URI: http://www.redmexico.com.mx
Version: 1.0
Author: Eduardo Cortés
Author URI: http://www.eduardocortes.mx
*/
load_theme_locale('helium', '', true);
global $xoopsUser, $xoopsSecurity, $cuIcons, $cuServices;
define('HELIUM_PATH', RMCPATH . '/themes/helium');
define('HELIUM_URL', RMCURL . '/themes/helium');
include_once HELIUM_PATH . '/class/HeliumHelper.class.php';
$xoFunc = new HeliumHelper();
// Common Utilities module menu
$mod = RMModules::load_module('rmcommon');
$rmcommon_menu = array('name' => $mod->getVar('name'), 'directory' => $mod->getVar('dirname'), 'menu' => $xoFunc->moduleMenu('rmcommon'), 'native' => $mod->getInfo('rmnative'), 'rewrite' => $mod->getInfo('rewrite'));
// System module menu
$mod = RMModules::load_module('system');
$system_menu = array('name' => $mod->getVar('name'), 'directory' => $mod->getVar('dirname'), 'menu' => $xoFunc->moduleMenu('system'), 'native' => $mod->getInfo('rmnative'), 'rewrite' => $mod->getInfo('rewrite'));
// Current Module Menu
$currentModule = array('name' => $xoopsModule->getVar('name'), 'directory' => $xoopsModule->getVar('dirname'), 'menu' => $xoFunc->moduleMenu($xoopsModule->getVar('dirname')), 'native' => $xoopsModule->getInfo('rmnative'), 'rewrite' => $xoopsModule->getInfo('rewrite'));
$currentModule = (object) $currentModule;
/**
 * Load modules and their menus
 */
$modulesList = \XoopsLists::getModulesList();
$activeModules = array();
foreach ($modulesList as $item) {
    if ($item == 'rmcommon' || $item == 'system' || $item == $xoopsModule->getVar('dirname')) {
 /**
  * Init data for theme rendering
  */
 public function init()
 {
     global $xoopsTpl, $xoopsConfig, $rmc_config, $xoTheme;
     // xThemes settings (?)
     $this->xsettings = RMSettings::module_settings('xthemes');
     $xoopsTpl->assign('isHome', defined('XTHEMES_IS_HOME'));
     if (!$this->isSupported()) {
         return;
     }
     if ($this->current->getInfo('dir') != $xoopsConfig['theme_set']) {
         // If user has selected another theme, realod all theme data
         $dir = XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'];
         if (!is_file($dir . '/assemble/' . $xoopsConfig['theme_set'] . '.theme.php')) {
             $this->current = new StandardTheme();
             $this->current->set_dir($xoopsConfig['theme_set']);
             return;
         }
         require_once $dir . '/assemble/' . $xoopsConfig['theme_set'] . '.theme.php';
         $class = ucfirst($xoopsConfig['theme_set']);
         $this->current = new $class();
         /**
          * The theme support native menus?
          */
         $this->root_menus = $this->current->haveMenus();
         /**
          * Load theme configuration
          */
         $this->current->setSettings($this->load_settings());
         /*
          * @todo Agregar código para carga de métodos del tema
          */
         $this->loadMenus();
         // Register pluguins
         if (method_exists($this->current, 'register')) {
             $plugins = $this->theme()->register();
             $dir = str_replace(XOOPS_URL, XOOPS_ROOT_PATH, $this->theme()->url() . '/assemble/plugins');
             foreach ($plugins as $plug) {
                 if (!file_exists($dir . '/' . $plug['file'])) {
                     continue;
                 }
                 include_once $dir . '/' . $plug['file'];
                 $this->registered[$plug['var']] = new $plug['name']();
             }
         }
     }
     $xoopsTpl->assign('theme', $this->theme());
     $xoopsTpl->assign('xtConfig', $this->theme()->settings());
     $xoopsTpl->assign('xt_language', $rmc_config['lang']);
     $xoopsTpl->assign('isHome', defined('XTHEMES_IS_HOME'));
     $this->colors = new XtColor();
     $xoopsTpl->assign('xtColor', $this->colors);
     // Assign plugins
     foreach ($this->registered as $id => $o) {
         $xoopsTpl->assign($id, $o);
     }
     // Register smarty plugins
     $dir = str_replace(XOOPS_URL, XOOPS_ROOT_PATH, $this->theme()->url());
     $xoopsTpl->plugins_dir[] = XOOPS_ROOT_PATH . '/modules/xthemes/smarty';
     $xoopsTpl->plugins_dir[] = $dir . '/assemble/smarty';
     load_theme_locale($this->theme()->getInfo('dir'));
     $this->current->init();
 }
Beispiel #8
0
<?php

// $Id: themes.php 159 2012-12-06 23:51:54Z i.bitcero $
// --------------------------------------------------------------
// xThemes for XOOPS
// Module for manage themes by Red Mexico
// Author: Eduardo Cortés <*****@*****.**>
// License: GPL v2
// --------------------------------------------------------------
define('RMCLOCATION', 'themes');
require '../../include/cp_header.php';
load_theme_locale($xoopsConfig['theme_set']);
$tpl = RMTemplate::get();
$xtf = new XTFunctions();
function xt_show_themes()
{
    global $tpl, $xtf, $xoopsSecurity, $xtAssembler, $xtFunctions;
    $current = $xtAssembler->theme();
    // Read all available themes
    $dh = opendir(XOOPS_THEME_PATH);
    $i = 0;
    while (false !== ($dir = readdir($dh))) {
        if ($dir == '.' || $dir == '..' || is_file(XOOPS_THEME_PATH . '/' . $dir)) {
            continue;
        }
        if (!is_file(XOOPS_THEME_PATH . '/' . $dir . '/theme.html')) {
            continue;
        }
        // Supported themes
        $theme_path = XOOPS_THEME_PATH . '/' . $dir;
        if (is_file($theme_path . '/assemble/' . strtolower($dir) . '.theme.php')) {
Beispiel #9
0
 /**
  * Genera el bloque a partir de su función
  */
 function buildBlock()
 {
     global $xoopsConfig, $xoopsOption;
     $block = array();
     // M for module block, S for system block C for Custom
     if ($this->getVar("type") != "custom") {
         // get block display function
         $show_func = $this->getVar('show_func');
         if (!$show_func) {
             return false;
         }
         // Bloque de Módulo
         // Comprobamos si se trata de un bloque de plugin de sistema
         if ($this->getVar('element_type') == 'plugin') {
             $file = XOOPS_ROOT_PATH . '/modules/' . $this->getVar('element') . '/plugins/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('file');
             load_plugin_locale($this->getVar('dirname'), '', $this->getVar('element'));
         } elseif ($this->getVar('element_type') == 'theme') {
             $file = XOOPS_ROOT_PATH . '/themes/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('file');
             load_theme_locale($this->getVar('dirname'), '', $this->getVar('element'));
         } else {
             $file = XOOPS_ROOT_PATH . "/modules/" . $this->getVar('dirname') . "/blocks/" . $this->getVar('file');
             if (file_exists(XOOPS_ROOT_PATH . "/modules/" . $this->getVar('dirname') . "/language/" . $xoopsConfig['language'] . "/blocks.php")) {
                 include_once XOOPS_ROOT_PATH . "/modules/" . $this->getVar('dirname') . "/language/" . $xoopsConfig['language'] . "/blocks.php";
             } elseif (file_exists(XOOPS_ROOT_PATH . "/modules/" . $this->getVar('dirname') . "/language/english/blocks.php")) {
                 include_once XOOPS_ROOT_PATH . "/modules/" . $this->getVar('dirname') . "/language/english/blocks.php";
             } else {
                 load_mod_locale($this->getVar('dirname'));
             }
         }
         include_once $file;
         $options = $this->getVar("options");
         $option = is_array($options) ? $options : explode('|', $options);
         if (function_exists($show_func)) {
             $block = $show_func($option);
             if (!$block) {
                 return false;
             }
         }
     } else {
         // Bloque Personalizado. Solo devolvemos el contenido
         $block['content'] = $this->getContent("S", $this->getVar("content_type"));
         if (empty($block['content'])) {
             return false;
         }
     }
     return $block;
 }