Beispiel #1
0
                    $lang_file = './js/jquery_ui/i18n/jquery.ui.datepicker-' . cot::$usr['lang'] . '.js';
                }
                Resources::$rc_link_func($lang_file, 'js', 60);
            }
        }
        if ($uidt_cfg['enable_timepicker']) {
            $timepicker_path = pathinfo($uidt_cfg['timepicker_js'], PATHINFO_DIRNAME);
            Resources::addFile($uidt_cfg['timepicker_css'], 'css', 70);
            Resources::$rc_link_func($uidt_cfg['timepicker_js'], 'js', 70);
            if ($usr['lang'] != 'en') {
                $lang_file = $timepicker_path . "/i18n/jquery-ui-timepicker-{$usr['lang']}.js";
                Resources::$rc_link_func($lang_file, 'js', 70);
            }
            if ($uidt_cfg['support_touch']) {
                Resources::$rc_link_func($timepicker_path . "/jquery-ui-sliderAccess.js", 'js', 70);
            }
        } else {
            $ui_off_code = 'var ui_time_off = true;';
        }
        if (!$uidt_cfg['enable_datepicker']) {
            $ui_off_code .= 'var ui_date_off = true;';
        }
        Resources::$rc_link_func(cot::$cfg['plugins_dir'] . "/{$plug_name}/js/{$plug_name}.js", 'js', 70);
        if ($admintools) {
            Resources::$rc_link_func(cot::$cfg['plugins_dir'] . "/{$plug_name}/js/{$plug_name}.tools.js", 'js', 70);
        }
        if ($ui_off_code) {
            Resources::embed($plug_name, $ui_off_code);
        }
    }
}
Beispiel #2
0
/**
 * A shortcut for plain output of an embedded stylesheet/javascript in the header of the page
 *
 * @global array $out Output snippets
 * @param string $code Stylesheet or javascript code
 * @param bool $prepend Prepend this file before other head outputs
 * @param string $type Resource type: 'js' or 'css'
 *
 * @deprecated Will be removed in v.1.0. Resources::embed() instead
 */
function cot_rc_embed($code, $prepend = false, $type = 'js')
{
    $order = 60;
    if ($prepend) {
        $order = 40;
    }
    Resources::embed($code, $type, $order);
}