コード例 #1
0
ファイル: Styles.php プロジェクト: forthrobot/inuvik
 public static function defaults(ShoppStyles $styles)
 {
     $script = basename(__FILE__);
     $schema = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off' ? 'https://' : 'http://';
     if (defined('SHOPP_PLUGINURI')) {
         $url = SHOPP_PLUGINURI . '/core';
     } else {
         $url = preg_replace("|{$script}.*|i", '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
     }
     $styles->base_url = $url;
     // Short checksum for cache control that changes with Shopp versions while masking it somewhat
     $styles->default_version = hash('crc32b', ABSPATH . ShoppVersion::release());
     $styles->default_dirs = array('/ui/styles/');
     $styles->add('admin', '/ui/styles/admin.css');
     $styles->add('admin-rtl', '/ui/styles/rtl.css');
     $styles->add('catalog', '/ui/styles/catalog.css');
     $styles->add('colorbox', '/ui/styles/colorbox.css');
     $styles->add('dashboard', '/ui/styles/dashboard.css');
     $styles->add('icons', '/ui/styles/icons.css');
     $styles->add('menus', '/ui/styles/menu.css');
     $styles->add('welcome', '/ui/styles/welcome.css');
     // Fix icons
     $styles->add('selectize', '/ui/styles/selectize.css');
 }
コード例 #2
0
ファイル: style.php プロジェクト: forthrobot/inuvik
/**
 * Adds a stylesheet to the queue to be included
 *
 *
 * @since 1.4
 *
 * @param string $handle Reference name for the stylesheet
 * @param string $src (optional) Path to the stylesheet
 * @param array $deps (optional) List of registered stylesheet handles that this stylesheet depends on
 * @param string $ver The version number of the stylesheet for proper cache handling
 * @param string $media (optional) The media type for the stylesheet
 * @return void
 **/
function shopp_enqueue_style($handle, $src = false, $deps = array(), $ver = false, $media = 'all')
{
    global $ShoppStyles;
    if (!is_a($ShoppStyles, 'ShoppStyles')) {
        $ShoppStyles = new ShoppStyles();
    }
    if ($src) {
        list($name, ) = explode('?', $handle);
        $ShoppStyles->add($name, $src, $deps, $ver);
    }
    $ShoppStyles->enqueue($handle);
}