Esempio n. 1
0
 static function getTemplateFile($file)
 {
     static $cache;
     if (!$cache) {
         $cache = array();
     } elseif (isset($cache[$file])) {
         return $cache[$file];
     }
     list($theme, $media) = getActualTheme();
     $ret = RSS_THEME_DIR . "/{$theme}/{$media}/{$file}";
     /*
     
     Patch submitted by rene ( at ) evo42 * net. 
     
     		if you use an new theme and also set the THEME_OVERRIDE to 
     		this theme name you get an 'invisible error' in the getTemplateFile 
     		function (cls/rss.php) at the file_exists function...
     
     
     I haven't tested this  :)
     
     PATH_TRANSLATED is not always populated (depends of PHP/Apache/OS version)
     see remarks about this here: http://www.php.net/reserved.variables
     We must use SCRIPT_FILENAME instead, because it always exists
     */
     $theme_check = RSS_THEME_DIR . "/{$theme}/{$media}/{$file}";
     if (isset($_SERVER['SCRIPT_FILENAME']) && strpos($_SERVER['SCRIPT_FILENAME'], 'admin') !== false) {
         $theme_path = substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], 'admin'));
         $theme_check = $theme_path . $ret;
     }
     if (!file_exists(GREGARIUS_HOME . $theme_check)) {
         $ret = RSS_THEME_DIR . "/default/{$media}/{$file}";
     }
     if (!file_exists(GREGARIUS_HOME . $ret)) {
         $ret = RSS_THEME_DIR . "/default/web/{$file}";
     }
     $cache[$file] = $ret;
     return $ret;
 }
Esempio n. 2
0
function rss_scheme_stylesheets($theme = null, $media = null)
{
    if ($theme === null) {
        list($theme, $media) = getActualTheme();
    }
    $ret = getProperty(rss_theme_option_ref_obj_from_theme($theme, $media), rss_theme_config_override_option_name_mangle('rss.output.theme.scheme'));
    if ($ret === null) {
        return "";
    }
    $arr = explode(',', $ret);
    $ret = "";
    $idx = array_pop($arr);
    foreach (loadSchemeList(false, $theme, $media) as $i => $val) {
        if ($i == $idx) {
            if ($i > 0) {
                if (file_exists(GREGARIUS_HOME . RSS_THEME_DIR . "/{$theme}/{$media}/schemes/{$val}") && is_dir(GREGARIUS_HOME . RSS_THEME_DIR . "/{$theme}/{$media}/schemes/{$val}")) {
                    foreach (glob(GREGARIUS_HOME . RSS_THEME_DIR . "/{$theme}/{$media}/schemes/{$val}/*.css") as $file) {
                        $file = substr($file, strlen(GREGARIUS_HOME . RSS_THEME_DIR . "/{$theme}/{$media}/schemes/{$val}/"));
                        $file = getPath() . RSS_THEME_DIR . "/{$theme}/{$media}/schemes/{$val}/{$file}";
                        $ret .= "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"{$file}\" />\n";
                    }
                }
            }
            break;
        }
    }
    return $ret;
}
Esempio n. 3
0
_pf(' ... nav.php');
_pf('parsing remaining files...');
rss_require('extlib/rss_fetch.inc');
rss_require('extlib/rss_utils.inc');
rss_require('extlib/kses.php');
rss_require('extlib/Sajax.php');
rss_require('tags.php');
////////////////////////////////////////////////////////////////////////////////
// Localization
_pf('Loading l10n...');
require_once 'cls/l10n.php';
$GLOBALS['rssl10n'] = new RSSl10n();
$lang = $GLOBALS['rssl10n']->getLocale();
_pf('done');
// Theme  specific l10n handling
list($theme, $media) = getActualTheme();
if (file_exists(RSS_THEME_DIR . "/{$theme}/intl/{$lang}.php")) {
    rss_require(RSS_THEME_DIR . "/{$theme}/intl/{$lang}.php");
} elseif ($lang != "en" && file_exists(RSS_THEME_DIR . "/{$theme}/intl/en.php")) {
    rss_require(RSS_THEME_DIR . "/{$theme}/intl/en.php");
}
//
if (file_exists(getThemePath(GREGARIUS_HOME) . "overrides.php")) {
    rss_require(getThemePath('') . "overrides.php");
}
/*
// Load the right locale
if (defined('OVERRIDE_LOCALE')) {
    setlocale(LC_TIME,constant("OVERRIDE_LOCALE"));
}
elseif (isset($_SERVER["WINDIR"]) && defined("LOCALE_WINDOWS")) {