/**
 * Return stylesheet URL
 * 
 * Parameters:
 * 
 * - name - stylesheet filename
 * - module - name of the module, if not present global data is used
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_stylesheet_url($params, &$smarty)
{
    $name = array_var($params, 'name');
    //if(empty($name)) {
    //  return new InvalidParamError('name', $name, "'name' parameter is required for 'stylesheet_url' helper", true);
    //} // if
    return get_stylesheet_url($name, array_var($params, 'module'));
}
/**
 * Add stylesheet to selected page
 * 
 * Parameters:
 * 
 * - name - name of the CSS file
 * - module - name of the module, if null global stylesheet is used
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_add_stylesheet($params, &$smarty)
{
    $name = array_var($params, 'name');
    if (empty($name)) {
        return new InvalidParamError('name', $name, "'name' parameter is required for 'add_stylesheet' helper", true);
    }
    // if
    $module = array_var($params, 'module');
    if (!isset($params['type'])) {
        $params['type'] = 'text/css';
    }
    // if
    unset($params['name']);
    if (isset($params['module'])) {
        unset($params['module']);
    }
    // if
    PageConstruction::addLink(get_stylesheet_url($name, $module), 'stylesheet', $params);
    return '';
}
Beispiel #3
0
 /**
 * Add external stylesheet file to page
 *
 * @access public
 * @param string $href
 * @param string $title
 * @param string $media
 * @return null
 */
 function add_stylesheet_to_page($href, $title = null, $media = null) {
   if (!is_valid_url($href)) {
     $href = get_stylesheet_url($href);
   }
   $page = PageDescription::instance();
   $attributes = array('type' => 'text/css');
   if ($title) $attributes['title'] = $title;
   if ($media) $attributes['media'] = $media;
   $page->addRelLink($href, 'Stylesheet', $attributes); // addRelLink
 } // add_stylesheet_to_page
ckeditor', {
                height: (h-200) + 'px',
            	allowedContent: true,
                enterMode: CKEDITOR.ENTER_DIV,
                shiftEnterMode: CKEDITOR.ENTER_BR,
                disableNativeSpellChecker: false,
                language: '<?php 
echo $loc;
?>
',
                customConfig: '',
            	contentsCss: ['<?php 
echo get_javascript_url('ckeditor/contents.css') . '?rev=' . product_version_revision();
?>
', '<?php 
echo get_stylesheet_url('og/ckeditor_override.css') . '?rev=' . product_version_revision();
?>
'],
                toolbar: [
							[	'Source','-','Font','FontSize','-','Bold','Italic','Underline','-', 'SpellChecker', 'Scayt','-',
								'Link','Unlink','-',
								'TextColor','BGColor','RemoveFormat','-',
								'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'
							]
						],
                on: {
                        instanceReady: function(ev) {
                                og.adjustCkEditorArea('<?php 
echo $genid;
?>
');
Beispiel #5
0
/**
 * Add external stylesheet file to page
 *
 * @access public
 * @param string $href
 * @param string $title
 * @param string $media
 * @return null
 */
function add_stylesheet_to_page($href, $title = null, $media = null)
{
    if (!is_valid_url($href)) {
        $href = get_stylesheet_url($href);
    }
    $page = PageDescription::instance();
    $page->addRelLink($href, 'Stylesheet', array('type' => 'text/css', 'title' => $title, 'media' => $media));
    // addRelLink
}