?>
							<th class="span-1">&#160;</th>
						<?php 
}
?>
						<th class="span-14"><?php 
echo $ccms['lang']['backup']['timestamp'];
?>
</th>
						<th>&#160;</th>
					</tr>
					<?php 
if ($handle = opendir('../../../../media/files/')) {
    $i = 0;
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != ".." && strmatch_tail($file, ".zip")) {
            // Alternate rows
            if ($i % 2 != 1) {
                echo '<tr class="altrgb">';
            } else {
                echo '<tr>';
            }
            echo "\n";
            if ($perm->is_level_okay('manageModBackup', $_SESSION['ccms_userLevel'])) {
                echo '<td><input type="checkbox" name="file[]" value="' . $file . '" id="' . $i . '"></td>';
            }
            echo "\n";
            echo '<td>' . $file . '</td>';
            echo "\n";
            echo '<td><a href="../../../../media/files/' . $file . '" title="' . $file . '"><span class="ss_sprite_16 ss_package_green">&#160;</span>' . $ccms['lang']['backup']['download'] . '</a></td>';
            echo "\n</tr>\n";
Exemple #2
0
//$ccms['page_name'] = false;
//$ccms['content'] = false;
//$ccms['template'] = null;
// This files' current version
$ccms['ccms_version'] = $v = "1.4.2";
// preparation for plugins, et.c which want to load JavaScript files through the template:
$ccms['CSS.required_files'] = array();
$ccms['CSS.inline'] = array();
$ccms['JS.required_files'] = array();
$ccms['JS.done'] = array();
// TEMPLATES ==
// Read and list the available templates
if ($handle = @opendir(BASE_PATH . '/lib/templates/')) {
    $template = array();
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != ".." && strmatch_tail($file, ".tpl.html")) {
            // Add the templates to an array for use through-out CCMS, while removing the extension .tpl.html (=9)
            $template_name = substr($file, 0, -9);
            if ($template_name != $cfg['default_template']) {
                $template[] = substr($file, 0, -9);
            }
        }
    }
    closedir($handle);
    // sort the order of the templates; also make sure that the 'default' template is placed at index [0] so that 404 pages and others pick that one.
    sort($template, SORT_LOCALE_STRING);
    if (!empty($cfg['default_template'])) {
        array_unshift($template, $cfg['default_template']);
    }
    $ccms['template_collection'] = $template;
} else {
function load_tinyMCE_js($type, $http_base, $base, $root, $element, $suffix)
{
    global $cfg;
    global $do_not_load;
    if ($do_not_load) {
        return '';
    }
    // return zip, nada, nothing
    /*
     * Make sure the tinyMCE language is set up correctly!
     *
     * If we don't do this here, then $cfg['tinymce_language'] will not exist and we will croak further down below.
     */
    SetUpLanguageAndLocale($cfg['language'], true);
    $mce_basepath = merge_path_elems($base, get_remainder_upto_slash($element) . 'tiny_mce/jscripts/tiny_mce/');
    $mce_files = array();
    /*
    To facilitate the lazyloading of tinyMCE in parts when the $suffix is set to '_dev', we do this as
    a two-stage process:
    
    the first stage if for all of 'em and loads the tinyMCE 'core' code at least, lazyloaded or flattened.
    
    When we're in '_dev' mode, the second stage is triggered by the first stage having added a lazyload
    instruction for '2nd-stage.tiny_mce_ccms.js', a fake filename, which will nevertheless trigger the Combiner
    into going here AGAIN and that time around we add the flattened set of language files and plugins.
    
    When we're NOT in '_dev' mode, the second stage won't happen, because the trigger isn't written into
    the produced JS code, so we're good to go either way!
    */
    $stage2 = strmatch_tail($element, "2nd-stage.tiny_mce_ccms.js");
    if (!$stage2) {
        // Add core
        $mce_files[] = merge_path_elems($mce_basepath, "tiny_mce" . $suffix . ".js");
    } else {
        if ($suffix != '_full') {
            /*
            _full is a prebuilt version with everything included by the ant build.
            
            In all other cases, we need to load the language files and plugins ourselves in some way.
            */
            $plugin_suffix = '_src';
            // Add core language(s)
            $languages = array($cfg['tinymce_language']);
            if ($cfg['tinymce_language'] != 'en') {
                $languages[] = 'en';
            }
            foreach ($languages as $lang) {
                $mce_files[] = merge_path_elems($mce_basepath, "langs/" . $lang . ".js");
            }
            // Add themes
            $themes = array('advanced');
            foreach ($themes as $theme) {
                $mce_files[] = merge_path_elems($mce_basepath, "themes", $theme, "editor_template" . $plugin_suffix . ".js");
                foreach ($languages as $lang) {
                    $mce_files[] = merge_path_elems($mce_basepath, "themes", $theme, "langs", $lang . ".js");
                    $mce_files[] = merge_path_elems($mce_basepath, "themes", $theme, "langs", $lang . "_dlg.js");
                }
            }
            // Add plugins
            $pluginarr = get_tinyMCE_plugin_list();
            foreach ($pluginarr as $plugin => $info) {
                if (!is_real_tinyMCE_plugin($plugin)) {
                    continue;
                }
                $mce_files[] = merge_path_elems($mce_basepath, "plugins", $plugin, "editor_plugin" . $plugin_suffix . ".js");
                foreach ($languages as $lang) {
                    $mce_files[] = merge_path_elems($mce_basepath, "plugins", $plugin, "langs", $lang . ".js");
                    $mce_files[] = merge_path_elems($mce_basepath, "plugins", $plugin, "langs", $lang . "_dlg.js");
                }
            }
        }
    }
    // now load all content:
    $my_content = '';
    foreach ($mce_files as $jsf) {
        $path = realpath($jsf);
        if (is_file($path)) {
            $c = @file_get_contents($path) . "\n";
            if ($c !== false) {
                $my_content .= <<<EOT42


/*
#------------------------------------------------------------------------------------
# processed: ({$path} :: {$jsf})
#------------------------------------------------------------------------------------
*/


EOT42;
                $my_content .= $c;
            } else {
                send_response_status_header(404);
                // Not Found
                die("\n" . get_response_code_string(404) . " - Combiner: could not load data from file: type='{$type}', element='{$element}'\n");
            }
        } else {
            $my_content .= <<<EOT42


/*
#####################################################################################
# file not found: ({$path} :: {$jsf})
#####################################################################################
*/


EOT42;
        }
    }
    if (!$stage2 && $suffix == '_dev') {
        // Add 2nd stage into the lazyload chain:
        $my_content = preg_replace('/;\\s*load\\(\\);\\s*\\}\\(\\)\\);/', ';

	// hack/tweak to make dev mode lazyloading work with the CCMS Combiner: delayload the language and plugin code as well!
	include(\'../../../../2nd-stage.tiny_mce_ccms.js\');

	load();
}());
			', $my_content);
    }
    return $my_content;
}
Exemple #4
0
/**
 * Collect the available languages (translations) and return those in an array.
 */
function GetAvailableLanguages()
{
    $sl = array();
    if ($handle = opendir(BASE_PATH . '/lib/languages')) {
        while (false !== ($file = readdir($handle))) {
            // Filter out irrelevant files && dirs
            if ($file != "." && $file != ".." && strmatch_tail($file, ".inc.php")) {
                $f = substr($file, 0, strpos($file, '.'));
                $sl[$f] = setLanguage($f);
                // making sure language support is indeed in sync in code and definition files:
                if ($sl[$f]['lang'] != $f) {
                    die("CCMS code has not been updated to support language: language code=" . $f);
                }
            }
        }
    }
    return $sl;
}