Esempio n. 1
0
        return $maxtime;
    }
}
global $ckeditor_timestamp;
if (!$ckeditor_timestamp) {
    $ckeditor_timestamp = ckeditor_max_timestamp($cfg['plugins_dir'] . '/ckeditor/lib');
}
// Main CKEditor file
cot_rc_link_footer($cfg['plugins_dir'] . '/ckeditor/lib/ckeditor.js?' . $ckeditor_timestamp);
// Load preset and connector
if ($usr['id'] > 0) {
    $preset_name = 'group_' . $usr['maingrp'];
    if (!file_exists($cfg['plugins_dir'] . "/ckeditor/presets/ckeditor.{$preset_name}.set.js")) {
        $preset_name = 'default';
    }
} else {
    $preset_name = file_exists($cfg['plugins_dir'] . "/ckeditor/presets/ckeditor.group_1.set.js") ? 'group_1' : 'default';
}
cot_rc_link_footer($cfg['plugins_dir'] . "/ckeditor/presets/ckeditor.{$preset_name}.set.js?" . $ckeditor_timestamp);
if ($ckeditor_css_to_load && is_array($ckeditor_css_to_load)) {
    foreach ($ckeditor_css_to_load as $key => $css_file) {
        if (!file_exists($css_file)) {
            unset($ckeditor_css_to_load[$key]);
        }
    }
    if (sizeof($ckeditor_css_to_load)) {
        $ckeditor_css_connector = "CKEDITOR.config.contentsCss = ['" . implode("','", $ckeditor_css_to_load) . "'];";
    }
}
cot_rc_embed_footer("CKEDITOR.timestamp = {$ckeditor_timestamp}; " . $ckeditor_css_connector);
Esempio n. 2
0
    // BBcode or HTML preset
    $mkup_set = $sys['parser'] == 'bbcode' ? 'bbcode' : 'html';
    // Load resources
    $mkup_skin_path = $cfg['plugins_dir'] . '/markitup/skins/' . $cfg['plugin']['markitup']['skin'] . '/style.css';
    $mkup_skin = cot_rc('code_rc_css_file', array('url' => $mkup_skin_path));
    $mkup_style_path = $cfg['plugins_dir'] . '/markitup/style.css';
    $mkup_style = cot_rc('code_rc_css_file', array('url' => $mkup_style_path));
    cot_rc_link_footer($smile_lang);
    cot_rc_link_footer('images/smilies/set.js');
    cot_rc_link_footer($cfg['plugins_dir'] . '/markitup/js/jquery.markitup.min.js');
    cot_rc_link_footer($mkup_lang);
    cot_rc_link_footer($cfg['plugins_dir'] . "/markitup/js/{$mkup_set}.set.js");
    if ($cfg['plugin']['markitup']['chili']) {
        cot_rc_link_footer($cfg['plugins_dir'] . '/markitup/js/chili.js');
    }
    // User-specific setup
    $autorefresh = $cfg['plugin']['markitup']['autorefresh'] ? 'true' : 'false';
    cot_rc_embed_footer('$(document).ready(function() {
		if (document.createStyleSheet) { document.createStyleSheet("' . $mkup_skin_path . '"); } else { $("head").append(\'' . $mkup_skin . '\'); }
		if (document.createStyleSheet) { document.createStyleSheet("' . $mkup_style_path . '"); } else { $("head").append(\'' . $mkup_style . '\'); }
		mySettings.previewAutorefresh = ' . $autorefresh . ';
		mySettings.previewParserPath = "index.php?r=markitup&x=" + $("input[name=\'x\'][type=\'hidden\']").eq(0).val();
		mediSettings.previewAutorefresh = ' . $autorefresh . ';
		mediSettings.previewParserPath = mySettings.previewParserPath;
		miniSettings.previewAutorefresh = ' . $autorefresh . ';
		miniSettings.previewParserPath = mySettings.previewParserPath;
		$("textarea.editor").markItUp(mySettings);
		$("textarea.medieditor").markItUp(mediSettings);
		$("textarea.minieditor").markItUp(miniSettings);
	});');
}
        return $maxtime;
    }
}
global $ckeditor_timestamp;
if (!$ckeditor_timestamp) {
    $ckeditor_timestamp = ckeditor_max_timestamp($cfg['plugins_dir'] . '/ckeditor/lib');
}
// Main CKEditor file
cot_rc_link_footer($cfg['plugins_dir'] . '/ckeditor_plus/lib/ckeditor.js?' . $ckeditor_timestamp);
// Load preset and connector
if ($usr['id'] > 0) {
    $preset_name = 'group_' . $usr['maingrp'];
    if (!file_exists($cfg['plugins_dir'] . "/ckeditor_plus/presets/ckeditor.{$preset_name}.set.js")) {
        $preset_name = 'default';
    }
} else {
    $preset_name = file_exists($cfg['plugins_dir'] . "/ckeditor_plus/presets/ckeditor.group_1.set.js") ? 'group_1' : 'default';
}
cot_rc_link_footer($cfg['plugins_dir'] . "/ckeditor_plus/presets/ckeditor.{$preset_name}.set.js?" . $ckeditor_timestamp);
if ($ckeditor_css_to_load && is_array($ckeditor_css_to_load)) {
    foreach ($ckeditor_css_to_load as $key => $css_file) {
        if (!file_exists($css_file)) {
            unset($ckeditor_css_to_load[$key]);
        }
    }
    if (sizeof($ckeditor_css_to_load)) {
        $ckeditor_css_connector = "CKEDITOR.config.contentsCss = ['" . implode("','", $ckeditor_css_to_load) . "'];";
    }
}
cot_rc_embed_footer("CKEDITOR.config.allowedContent = true;CKEDITOR.timestamp = {$ckeditor_timestamp};" . $ckeditor_css_connector);