• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Stylesheet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Stylesheet的典型用法代码示例。如果您正苦于以下问题:PHP Stylesheet类的具体用法?PHP Stylesheet怎么用?PHP Stylesheet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Stylesheet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: newResponse

 /**
  * Creates a new response object
  *
  * @return  scriptlet.xml.XMLScriptletResponse
  */
 protected function newResponse(Stylesheet $stylesheet)
 {
     $res = new XMLScriptletResponse();
     $res->setProcessor(new DOMXSLProcessor());
     $stylesheet->addParam('__state');
     $stylesheet->addParam('__page');
     $stylesheet->addParam('__lang');
     $stylesheet->addParam('__product');
     $stylesheet->addParam('__sess');
     $stylesheet->addParam('__query');
     $res->setStylesheet($stylesheet, XSLT_TREE);
     return $res;
 }
开发者ID:Gamepay,项目名称:xp-framework,代码行数:18,代码来源:XmlScriptletTest.class.php


示例2: list

if (strpos($ruri, '?') === false) {
    $params = '';
    $path = $ruri;
} else {
    list($path, $params) = preg_split('/\\?/', $ruri, 2);
}
$special = array('css/icinga.css', 'css/icinga.min.css', 'js/icinga.dev.js', 'js/icinga.ie8.js', 'js/icinga.min.js');
if (in_array($path, $special)) {
    include_once __DIR__ . '/EmbeddedWeb.php';
    EmbeddedWeb::start();
    switch ($path) {
        case 'css/icinga.css':
            Stylesheet::send();
            exit;
        case 'css/icinga.min.css':
            Stylesheet::send(true);
            exit;
        case 'js/icinga.dev.js':
            JavaScript::send();
            exit;
        case 'js/icinga.min.js':
            JavaScript::sendMinified();
            break;
        case 'js/icinga.ie8.js':
            JavaScript::sendForIe8();
            break;
        default:
            return false;
    }
} elseif ($path === 'svg/chart.php') {
    if (!array_key_exists('data', $_GET)) {
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:31,代码来源:webrouter.php


示例3: lang

     $result = $db->Execute($query);
     if ($result && $result->RecordCount() > 0) {
         $error .= "<li>" . lang('cssalreadyused') . "</li>";
         $validinfo = false;
     }
 }
 # now checking the content of the CSS
 if ("" == $css_text) {
     $error .= "<li>" . lang('nofieldgiven', array(lang('content'))) . "</li>";
     $validinfo = false;
 }
 #******************************************************************************
 # everythings seems to be ok, we can try to save the form
 #******************************************************************************
 if ($validinfo) {
     $newstylesheet = new Stylesheet();
     $newstylesheet->name = $css_name;
     $newstylesheet->value = $css_text;
     $types = "";
     #generate comma separated list
     foreach ($media_type as $onetype) {
         $types .= "{$onetype}, ";
     }
     if ($types != '') {
         $types = substr($types, 0, -2);
         #strip last space and comma
     } else {
         $types = '';
     }
     $newstylesheet->media_type = $types;
     Events::SendEvent('Core', 'AddStylesheetPre', array('stylesheet' => &$newstylesheet));
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:31,代码来源:addcss.php


示例4: load

 /**
  *  Minify, combine and load site stylesheet
  */
 public static function load()
 {
     $backend_site_css_path = MINIFY . DS . 'backend_site.minify.css';
     $frontend_site_css_path = MINIFY . DS . 'frontend_site.minify.css';
     // Load stylesheets
     if (count(Stylesheet::$stylesheets) > 0) {
         $backend_buffer = '';
         $backend_regenerate = false;
         $frontend_buffer = '';
         $frontend_regenerate = false;
         // Sort stylesheets by priority
         $stylesheets = Arr::subvalSort(Stylesheet::$stylesheets, 'priority');
         if (BACKEND) {
             // Build backend site stylesheets
             foreach ($stylesheets as $stylesheet) {
                 if (file_exists(ROOT . DS . $stylesheet['file']) and ($stylesheet['load'] == 'backend' or $stylesheet['load'] == 'both')) {
                     if (!file_exists($backend_site_css_path) or filemtime(ROOT . DS . $stylesheet['file']) > filemtime($backend_site_css_path)) {
                         $backend_regenerate = true;
                         break;
                     }
                 }
             }
             // Regenerate site stylesheet
             if ($backend_regenerate) {
                 foreach ($stylesheets as $stylesheet) {
                     if (file_exists(ROOT . DS . $stylesheet['file']) and ($stylesheet['load'] == 'backend' or $stylesheet['load'] == 'both')) {
                         $backend_buffer .= file_get_contents(ROOT . DS . $stylesheet['file']);
                     }
                 }
                 $backend_buffer = Stylesheet::parseVariables($backend_buffer);
                 file_put_contents($backend_site_css_path, MinifyCSS::process($backend_buffer));
                 $backend_regenerate = false;
             }
         } else {
             // Build frontend site stylesheets
             foreach ($stylesheets as $stylesheet) {
                 if (file_exists(ROOT . DS . $stylesheet['file']) and ($stylesheet['load'] == 'frontend' or $stylesheet['load'] == 'both')) {
                     if (!file_exists($frontend_site_css_path) or filemtime(ROOT . DS . $stylesheet['file']) > filemtime($frontend_site_css_path)) {
                         $frontend_regenerate = true;
                         break;
                     }
                 }
             }
             // Regenerate site stylesheet
             if ($frontend_regenerate) {
                 foreach ($stylesheets as $stylesheet) {
                     if (file_exists(ROOT . DS . $stylesheet['file']) and ($stylesheet['load'] == 'frontend' or $stylesheet['load'] == 'both')) {
                         $frontend_buffer .= file_get_contents(ROOT . DS . $stylesheet['file']);
                     }
                 }
                 $frontend_buffer = Stylesheet::parseVariables($frontend_buffer);
                 file_put_contents($frontend_site_css_path, MinifyCSS::process($frontend_buffer));
                 $frontend_regenerate = false;
             }
         }
         // Render
         if (BACKEND) {
             echo '<link rel="stylesheet" href="' . Option::get('siteurl') . '/tmp/minify/backend_site.minify.css?' . Option::get('styles_version') . '" type="text/css" />';
         } else {
             echo '<link rel="stylesheet" href="' . Option::get('siteurl') . '/tmp/minify/frontend_site.minify.css?' . Option::get('styles_version') . '" type="text/css" />' . "\n";
         }
     }
 }
开发者ID:cmroanirgo,项目名称:monstra,代码行数:66,代码来源:Stylesheet.php


示例5: readCss

 private static function readCss($pdf, $view)
 {
     $css = "";
     $files = $view->getCssFiles();
     foreach ($files as $file) {
         $css = Stylesheet::minify($file);
         $pdf->WriteHtml($css, 1);
     }
     return $css;
 }
开发者ID:hofmeister,项目名称:Pimple,代码行数:10,代码来源:Pdf.php


示例6: css

 /**
  * Outputs concatenated CSS for the specified view
  * @param string view | the view - optional
  */
 public function css()
 {
     $this->setContentType('text/css; charset=utf-8;');
     $this->setCache(Date::SPAN_MONTH);
     require_once Pimple::instance()->getBaseDir() . 'lib/Stylesheet.php';
     $cacheDir = Pimple::instance()->getSiteDir() . 'cache/css/';
     Dir::ensure($cacheDir);
     $templates = array();
     if (!Request::get('skipLayout', false)) {
         $templates[] = 'application';
     }
     $view = Request::get('view', false);
     if ($view) {
         $templates[] = $view;
     }
     $used = array();
     $isDebug = Settings::get(Settings::DEBUG, false);
     foreach ($templates as $template) {
         $cacheFile = $cacheDir . $template . '.css';
         echo "/* {$template} */\n";
         if ($isDebug) {
             $view = new View($template);
             $files = $view->getInternalCssFiles();
             echo "/*FILES:\n\t" . implode("\n\t", $files) . '*/' . chr(10);
             foreach ($files as $file) {
                 if (in_array($file, $used) || String::StartsWith($file, "http://") || String::StartsWith($file, "https://")) {
                     continue;
                 }
                 $used[] = $file;
                 echo "/*FILE:" . basename($file) . '*/' . chr(10) . Stylesheet::minify($file) . chr(10);
             }
         } else {
             Dir::ensure(dirname($cacheFile));
             if (!is_file($cacheFile)) {
                 File::truncate($cacheFile);
                 $view = new View($template);
                 $files = $view->getInternalCssFiles();
                 File::append($cacheFile, "/*FILES:\n\t" . implode("\n\t", $files) . '*/' . chr(10));
                 foreach ($files as $file) {
                     if (in_array($file, $used) || String::StartsWith($file, "http://") || String::StartsWith($file, "https://")) {
                         continue;
                     }
                     $used[] = $file;
                     File::append($cacheFile, "/*FILE:" . basename($file) . '*/' . chr(10) . Stylesheet::minify($file) . chr(10));
                 }
             }
             echo file_get_contents($cacheFile);
         }
     }
     Pimple::end();
 }
开发者ID:hofmeister,项目名称:Pimple,代码行数:55,代码来源:PimpleController.php


示例7: _process_html

 /**
  * Builds the {@link Frame_Tree}, loads any CSS and applies the styles to
  * the {@link Frame_Tree}
  */
 protected function _process_html()
 {
     $this->_tree->build_tree();
     $this->_css->load_css_file(Stylesheet::DEFAULT_STYLESHEET, Stylesheet::ORIG_UA);
     $acceptedmedia = Stylesheet::$ACCEPTED_GENERIC_MEDIA_TYPES;
     $acceptedmedia[] = $this->get_option("default_media_type");
     // <base href="" />
     $base_nodes = $this->_xml->getElementsByTagName("base");
     if ($base_nodes->length && ($href = $base_nodes->item(0)->getAttribute("href"))) {
         list($this->_protocol, $this->_base_host, $this->_base_path) = explode_url($href);
     }
     // Set the base path of the Stylesheet to that of the file being processed
     $this->_css->set_protocol($this->_protocol);
     $this->_css->set_host($this->_base_host);
     $this->_css->set_base_path($this->_base_path);
     // Get all the stylesheets so that they are processed in document order
     $xpath = new DOMXPath($this->_xml);
     $stylesheets = $xpath->query("//*[name() = 'link' or name() = 'style']");
     foreach ($stylesheets as $tag) {
         switch (strtolower($tag->nodeName)) {
             // load <link rel="STYLESHEET" ... /> tags
             case "link":
                 if (mb_strtolower(stripos($tag->getAttribute("rel"), "stylesheet") !== false) || mb_strtolower($tag->getAttribute("type")) === "text/css") {
                     //Check if the css file is for an accepted media type
                     //media not given then always valid
                     $formedialist = preg_split("/[\\s\n,]/", $tag->getAttribute("media"), -1, PREG_SPLIT_NO_EMPTY);
                     if (count($formedialist) > 0) {
                         $accept = false;
                         foreach ($formedialist as $type) {
                             if (in_array(mb_strtolower(trim($type)), $acceptedmedia)) {
                                 $accept = true;
                                 break;
                             }
                         }
                         if (!$accept) {
                             //found at least one mediatype, but none of the accepted ones
                             //Skip this css file.
                             continue;
                         }
                     }
                     $url = $tag->getAttribute("href");
                     $url = build_url($this->_protocol, $this->_base_host, $this->_base_path, $url);
                     $this->_css->load_css_file($url, Stylesheet::ORIG_AUTHOR);
                 }
                 break;
                 // load <style> tags
             // load <style> tags
             case "style":
                 // Accept all <style> tags by default (note this is contrary to W3C
                 // HTML 4.0 spec:
                 // http://www.w3.org/TR/REC-html40/present/styles.html#adef-media
                 // which states that the default media type is 'screen'
                 if ($tag->hasAttributes() && ($media = $tag->getAttribute("media")) && !in_array($media, $acceptedmedia)) {
                     continue;
                 }
                 $css = "";
                 if ($tag->hasChildNodes()) {
                     $child = $tag->firstChild;
                     while ($child) {
                         $css .= $child->nodeValue;
                         // Handle <style><!-- blah --></style>
                         $child = $child->nextSibling;
                     }
                 } else {
                     $css = $tag->nodeValue;
                 }
                 $this->_css->load_css($css);
                 break;
         }
     }
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:75,代码来源:dompdf.cls.php


示例8: main

<?php

// Add Plugin Javascript
Stylesheet::add('plugins/box/filesmanager/css/style.css', 'backend', 11);
Javascript::add('plugins/box/filesmanager/js/fileuploader.js', 'backend', 11);
Javascript::add('plugins/box/filesmanager/js/filesmanager.js', 'backend', 11);
// Add plugin navigation link
Navigation::add(__('Files', 'filesmanager'), 'content', 'filesmanager', 3);
/**
 * Filesmanager Admin Class
 */
class FilesmanagerAdmin extends Backend
{
    /**
     * Main function
     */
    public static function main()
    {
        // Array of forbidden types
        $forbidden_types = array('html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'shtml', 'jhtml', 'pl', 'py', 'cgi', 'sh', 'ksh', 'bsh', 'c', 'htaccess', 'htpasswd', 'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl', 'empty');
        // Array of image types
        $image_types = array('jpg', 'png', 'bmp', 'gif', 'tif');
        // Get Site url
        $site_url = Option::get('siteurl');
        // Init vars
        if (Request::get('path')) {
            $path = Request::get('path');
        } else {
            $path = 'uploads/';
        }
        // Add slash if not exists
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:31,代码来源:filesmanager.admin.php


示例9: main

 /**
  * Themes plugin admin
  */
 public static function main()
 {
     // Get current themes
     $current_site_theme = Option::get('theme_site_name');
     $current_admin_theme = Option::get('theme_admin_name');
     // Init vars
     $themes_site = Themes::getSiteThemes();
     $themes_admin = Themes::getAdminThemes();
     $templates = Themes::getTemplates();
     $chunks = Themes::getChunks();
     $styles = Themes::getStyles();
     $scripts = Themes::getScripts();
     $errors = array();
     $chunk_path = THEMES_SITE . DS . $current_site_theme . DS;
     $template_path = THEMES_SITE . DS . $current_site_theme . DS;
     $style_path = THEMES_SITE . DS . $current_site_theme . DS . 'css' . DS;
     $script_path = THEMES_SITE . DS . $current_site_theme . DS . 'js' . DS;
     // Save site theme
     if (Request::post('save_site_theme')) {
         if (Security::check(Request::post('csrf'))) {
             Option::update('theme_site_name', Request::post('themes'));
             // Clean Monstra TMP folder.
             Monstra::cleanTmp();
             // Increment Styles and Javascript version
             Stylesheet::stylesVersionIncrement();
             Javascript::javascriptVersionIncrement();
             Request::redirect('index.php?id=themes');
         } else {
             die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
         }
     }
     // Save site theme
     if (Request::post('save_admin_theme')) {
         if (Security::check(Request::post('csrf'))) {
             Option::update('theme_admin_name', Request::post('themes'));
             // Clean Monstra TMP folder.
             Monstra::cleanTmp();
             Request::redirect('index.php?id=themes');
         } else {
             die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
         }
     }
     // Its mean that you can add your own actions for this plugin
     Action::run('admin_themes_extra_actions');
     // Check for get actions
     // -------------------------------------
     if (Request::get('action')) {
         // Switch actions
         // -------------------------------------
         switch (Request::get('action')) {
             // Add chunk
             // -------------------------------------
             case "add_chunk":
                 if (Request::post('add_file') || Request::post('add_file_and_exit')) {
                     if (Security::check(Request::post('csrf'))) {
                         if (trim(Request::post('name')) == '') {
                             $errors['file_empty_name'] = __('Required field', 'themes');
                         }
                         if (file_exists($chunk_path . Security::safeName(Request::post('name'), null, false) . '.chunk.php')) {
                             $errors['file_exists'] = __('This chunk already exists', 'themes');
                         }
                         if (count($errors) == 0) {
                             // Save chunk
                             File::setContent($chunk_path . Security::safeName(Request::post('name'), null, false) . '.chunk.php', Request::post('content'));
                             Notification::set('success', __('Your changes to the chunk <i>:name</i> have been saved.', 'themes', array(':name' => Security::safeName(Request::post('name'), null, false))));
                             if (Request::post('add_file_and_exit')) {
                                 Request::redirect('index.php?id=themes');
                             } else {
                                 Request::redirect('index.php?id=themes&action=edit_chunk&filename=' . Security::safeName(Request::post('name'), null, false));
                             }
                         }
                     } else {
                         die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
                     }
                 }
                 // Save fields
                 if (Request::post('name')) {
                     $name = Request::post('name');
                 } else {
                     $name = '';
                 }
                 if (Request::post('content')) {
                     $content = Request::post('content');
                 } else {
                     $content = '';
                 }
                 // Display view
                 View::factory('box/themes/views/backend/add')->assign('name', $name)->assign('content', $content)->assign('errors', $errors)->assign('action', 'chunk')->display();
                 break;
                 // Add template
                 // -------------------------------------
             // Add template
             // -------------------------------------
             case "add_template":
                 if (Request::post('add_file') || Request::post('add_file_and_exit')) {
                     if (Security::check(Request::post('csrf'))) {
                         if (trim(Request::post('name')) == '') {
//.........这里部分代码省略.........
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:101,代码来源:themes.admin.php


示例10:

 *	Events plugin admin
 *
 *  Provides CRUD for events and different output possibilities for event lists
 *
 *	@package    Monstra
 *  @subpackage Plugins
 *	@author     Andreas Müller | devmount <[email protected]>
 *	@license    MIT
 *  @link       https://github.com/devmount-monstra/events
 *
 */
// Add plugin styles and scripts
Stylesheet::add('plugins/events/css/events.admin.css', 'backend', 11);
Javascript::add('plugins/events/js/events.admin.js', 'backend', 11);
// lib: Image Picker http://rvera.github.io/image-picker/
Stylesheet::add('plugins/events/lib/image-picker/image-picker.css', 'backend', 11);
Javascript::add('plugins/events/lib/image-picker/image-picker.js', 'backend', 11);
// Admin Navigation: add new item
Navigation::add(__('Events', 'events'), 'content', 'events', 10);
// Add action on admin_pre_render hook
Action::add('admin_pre_render', 'EventsAdmin::_getAjaxData');
// register repository classes
require_once 'repositories/repository.events.php';
require_once 'repositories/repository.categories.php';
require_once 'repositories/repository.locations.php';
/**
 * Events class
 *
 */
class EventsAdmin extends Backend
{
开发者ID:devmount-monstra,项目名称:events,代码行数:31,代码来源:events.admin.php


示例11: list

if (strpos($ruri, '?') === false) {
    $params = '';
    $path = $ruri;
} else {
    list($path, $params) = preg_split('/\\?/', $ruri, 2);
}
$special = array('css/icinga.css', 'css/icinga.min.css', 'js/icinga.dev.js', 'js/icinga.min.js');
if (in_array($path, $special)) {
    include_once __DIR__ . '/EmbeddedWeb.php';
    EmbeddedWeb::start();
    switch ($path) {
        case 'css/icinga.css':
            Stylesheet::send();
            exit;
        case 'css/icinga.min.css':
            Stylesheet::sendMinified();
            exit;
        case 'js/icinga.dev.js':
            JavaScript::send();
            exit;
        case 'js/icinga.min.js':
            JavaScript::sendMinified();
            break;
        default:
            return false;
    }
} elseif ($path === 'svg/chart.php') {
    if (!array_key_exists('data', $_GET)) {
        return false;
    }
    include __DIR__ . '/EmbeddedWeb.php';
开发者ID:vbereza,项目名称:icinga2-migration,代码行数:31,代码来源:webrouter.php


示例12: main

<?php

// Add Plugin Javascript
Stylesheet::add('public/assets/css/daterangepicker-bs3.css', 'backend', 11);
Javascript::add('public/assets/js/moment.min.js', 'backend', 11);
Javascript::add('public/assets/js/daterangepicker.js', 'backend', 12);
Javascript::add('plugins/box/dashboard/js/ganalytics.js', 'backend', 13);
/**
 * Dashboard admin class
 */
class DashboardAdmin extends Backend
{
    /**
     * Main Dashboard admin function
     */
    public static function main()
    {
        // set/update google analytics settings
        if (Request::post('ga_settings_update')) {
            if (Security::check(Request::post('csrf'))) {
                // client id
                $ga_client_id = trim(Request::post('ga_client_id'));
                if (!empty($ga_client_id)) {
                    $opt_client_id = Option::get('ga_client_id');
                    if (empty($opt_client_id)) {
                        Option::add('ga_client_id', $ga_client_id);
                    } else {
                        Option::update('ga_client_id', $ga_client_id);
                    }
                }
                // API key
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:31,代码来源:dashboard.admin.php


示例13:

/public/assets/css/messenger.css" type="text/css" />
        <link rel="stylesheet" href="<?php 
echo Site::url();
?>
/public/assets/css/messenger-theme-flat.css" type="text/css" />
        <?php 
Stylesheet::add('public/assets/css/bootstrap-lightbox.css', 'backend', 2);
?>
        <?php 
Stylesheet::add('public/assets/css/bootstrap-fileupload.css', 'backend', 3);
?>
        <?php 
Stylesheet::add('admin/themes/default/css/default.css', 'backend', 5);
?>
        <?php 
Stylesheet::load();
?>

        <!-- JavaScripts -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        <script src="<?php 
echo Site::url();
?>
/public/assets/js/bootstrap.min.js"></script>
        <script src="<?php 
echo Site::url();
?>
/public/assets/js/messenger.min.js"></script>
        <script src="<?php 
echo Site::url();
?>
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:31,代码来源:login.template.php


示例14: _process_html

    /**
     * Builds the {@link Frame_Tree}, loads any CSS and applies the styles to
     * the {@link Frame_Tree}
     */
    protected function _process_html()
    {
        $this->save_locale();

        $this->_tree->build_tree();

        $this->_css->load_css_file(Stylesheet::DEFAULT_STYLESHEET, Stylesheet::ORIG_UA);

        $acceptedmedia = Stylesheet::$ACCEPTED_GENERIC_MEDIA_TYPES;
        if (defined("DOMPDF_DEFAULT_MEDIA_TYPE")) {
            $acceptedmedia[] = DOMPDF_DEFAULT_MEDIA_TYPE;
        } else {
            $acceptedmedia[] = Stylesheet::$ACCEPTED_DEFAULT_MEDIA_TYPE;
        }

        // load <link rel="STYLESHEET" ... /> tags
        $links = $this->_xml->getElementsByTagName("link");
        foreach ($links as $link) {
            if (mb_strtolower($link->getAttribute("rel")) === "stylesheet" ||
                mb_strtolower($link->getAttribute("type")) === "text/css"
            ) {
                //Check if the css file is for an accepted media type
                //media not given then always valid
                $formedialist = preg_split("/[\s\n,]/", $link->getAttribute("media"), -1, PREG_SPLIT_NO_EMPTY);
                if (count($formedialist) > 0) {
                    $accept = false;
                    foreach ($formedialist as $type) {
                        if (in_array(mb_strtolower(trim($type)), $acceptedmedia)) {
                            $accept = true;
                            break;
                        }
                    }
                    if (!$accept) {
                        //found at least one mediatype, but none of the accepted ones
                        //Skip this css file.
                        continue;
                    }
                }

                $url = $link->getAttribute("href");
                $url = build_url($this->_protocol, $this->_base_host, $this->_base_path, $url);

                $this->_css->load_css_file($url, Stylesheet::ORIG_AUTHOR);
            }

        }

        // Set the base path of the Stylesheet to that of the file being processed
        $this->_css->set_protocol($this->_protocol);
        $this->_css->set_host($this->_base_host);
        $this->_css->set_base_path($this->_base_path);

        // load <style> tags
        $styles = $this->_xml->getElementsByTagName("style");
        foreach ($styles as $style) {

            // Accept all <style> tags by default (note this is contrary to W3C
            // HTML 4.0 spec:
            // http://www.w3.org/TR/REC-html40/present/styles.html#adef-media
            // which states that the default media type is 'screen'
            if ($style->hasAttributes() &&
                ($media = $style->getAttribute("media")) &&
                !in_array($media, $acceptedmedia)
            )
                continue;

            $css = "";
            if ($style->hasChildNodes()) {

                $child = $style->firstChild;
                while ($child) {
                    $css .= $child->nodeValue; // Handle <style><!-- blah --></style>
                    $child = $child->nextSibling;
                }

            } else
                $css = $style->nodeValue;

            $this->_css->load_css($css);
        }

        $this->restore_locale();
    }
开发者ID:rmuyinda,项目名称:dms-1,代码行数:87,代码来源:dompdf.cls.php


示例15: main

 /**
  * Plugins admin
  */
 public static function main()
 {
     // Get siteurl
     $site_url = Option::get('siteurl');
     // Get installed plugin from $plugins array
     $installed_plugins = Plugin::$plugins;
     // Get installed users plugins
     $_users_plugins = array();
     foreach (Plugin::$plugins as $plugin) {
         if ($plugin['privilege'] !== 'box') {
             $_users_plugins[] = $plugin['id'];
         }
     }
     // Get plugins table
     $plugins = new Table('plugins');
     // Delete plugin
     // -------------------------------------
     if (Request::get('delete_plugin')) {
         if (Security::check(Request::get('token'))) {
             // Nobody cant remove box plugins
             if ($installed_plugins[Text::lowercase(str_replace("Plugin", "", Request::get('delete_plugin')))]['privilege'] !== 'box') {
                 // Run plugin uninstaller file
                 $plugin_name = Request::get('delete_plugin');
                 if (File::exists(PLUGINS . DS . $plugin_name . DS . 'install' . DS . $plugin_name . '.uninstall.php')) {
                     include PLUGINS . DS . $plugin_name . DS . 'install' . DS . $plugin_name . '.uninstall.php';
                 }
                 // Clean Monstra TMP folder.
                 Monstra::cleanTmp();
                 // Increment Styles and Javascript version
                 Stylesheet::stylesVersionIncrement();
                 Javascript::javascriptVersionIncrement();
                 // Delete plugin form plugins table
                 $plugins->deleteWhere('[name="' . Request::get('delete_plugin') . '"]');
                 // Redirect
                 Request::redirect('index.php?id=plugins');
             }
         } else {
             die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
         }
     }
     // Install new plugin
     // -------------------------------------
     if (Request::get('install')) {
         if (Security::check(Request::get('token'))) {
             // Load plugin install xml file
             $plugin_xml = XML::loadFile(PLUGINS . DS . basename(Text::lowercase(Request::get('install')), '.manifest.xml') . DS . 'install' . DS . Request::get('install'));
             // Add plugin to plugins table
             $plugins->insert(array('name' => basename(Request::get('install'), '.manifest.xml'), 'location' => (string) $plugin_xml->plugin_location, 'status' => (string) $plugin_xml->plugin_status, 'priority' => (int) $plugin_xml->plugin_priority));
             // Clean Monstra TMP folder.
             Monstra::cleanTmp();
             Stylesheet::stylesVersionIncrement();
             Javascript::javascriptVersionIncrement();
             // Run plugin installer file
             $plugin_name = str_replace(array("Plugin", ".manifest.xml"), "", Request::get('install'));
             if (File::exists(PLUGINS . DS . basename(Text::lowercase(Request::get('install')), '.manifest.xml') . DS . 'install' . DS . $plugin_name . '.install.php')) {
                 include PLUGINS . DS . basename(Text::lowercase(Request::get('install')), '.manifest.xml') . DS . 'install' . DS . $plugin_name . '.install.php';
             }
             Request::redirect('index.php?id=plugins');
         } else {
             die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
         }
     }
     // Delete plugin from server
     // -------------------------------------
     if (Request::get('delete_plugin_from_server')) {
         if (Security::check(Request::get('token'))) {
             // Clean Monstra TMP folder.
             Monstra::cleanTmp();
             Stylesheet::stylesVersionIncrement();
             Javascript::javascriptVersionIncrement();
             Dir::delete(PLUGINS . DS . basename(Request::get('delete_plugin_from_server'), '.manifest.xml'));
             Request::redirect('index.php?id=plugins');
         } else {
             die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
         }
     }
     // Upload & extract plugin archive
     // -------------------------------------
     if (Request::post('upload_file')) {
         if (Security::check(Request::post('csrf'))) {
             if ($_FILES['file']) {
                 if (in_array(File::ext($_FILES['file']['name']), array('zip'))) {
                     $tmp_dir = ROOT . DS . 'tmp' . DS . uniqid('plugin_');
                     $error = 'Plugin was not uploaded';
                     if (Dir::create($tmp_dir)) {
                         $file_locations = Zip::factory()->extract($_FILES['file']['tmp_name'], $tmp_dir);
                         if (!empty($file_locations)) {
                             $manifest = '';
                             foreach ($file_locations as $filepath) {
                                 if (substr($filepath, -strlen('.manifest.xml')) === '.manifest.xml') {
                                     $manifest = $filepath;
                                     break;
                                 }
                             }
                             if (!empty($manifest) && basename(dirname($manifest)) === 'install') {
                                 $manifest_file = pathinfo($manifest, PATHINFO_BASENAME);
                                 $plugin_name = str_replace('.manifest.xml', '', $manifest_file);
//.........这里部分代码省略.........
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:101,代码来源:plugins.admin.php


示例16: _parse_schemes_css_code

 protected function _parse_schemes_css_code()
 {
     foreach (Plugin::instance()->widgets_manager->get_widget_types() as $widget) {
         foreach ($widget->get_scheme_controls() as $control) {
             $scheme_value = Plugin::instance()->schemes_manager->get_scheme_value($control['scheme']['type'], $control['scheme']['value']);
             if (empty($scheme_value)) {
                 continue;
             }
             if (!empty($control['scheme']['key'])) {
                 $scheme_value = $scheme_value[$control['scheme']['key']];
             }
             if (empty($scheme_value)) {
                 continue;
             }
             $element_unique_class = 'elementor-widget-' . $widget->get_name();
             $control_obj = Plugin::instance()->controls_manager->get_control($control['type']);
             if (Controls_Manager::FONT === $control_obj->get_type()) {
                 $this->add_enqueue_font($scheme_value);
             }
             foreach ($control['selectors'] as $selector => $css_property) {
                 $output_selector = str_replace('{{WRAPPER}}', '.' . $element_unique_class, $selector);
                 $output_css_property = $control_obj->get_replaced_style_values($css_property, $scheme_value);
                 $this->stylesheet->add_rules($output_selector, $output_css_property);
             }
         }
     }
 }
开发者ID:pojome,项目名称:elementor,代码行数:27,代码来源:frontend.php


示例17: __construct

 public function __construct($node, $parent)
 {
     parent::__construct($node, $parent);
     self::$possible_attributes = array_merge(parent::$possible_attributes, self::$possible_attributes);
     self::$required_attributes = array_merge(parent::$required_attributes, self::$required_attributes);
     self::$possible_children = array_merge(parent::$possible_children, self::$possible_children);
     self::$required_children = array_merge(parent::$required_children, self::$required_children);
 }
开发者ID:Abuamany,项目名称:concerto-platform,代码行数:8,代码来源:Stylesheet.php


示例18: add_control_style_rules

 private function add_control_style_rules($control, $value, $placeholders, $replacements)
 {
     if (!is_numeric($value) && !is_float($value) && empty($value)) {
         return;
     }
     if (Controls_Manager::FONT === $control['type']) {
         $this->fonts[] = $value;
     }
     $control_obj = Plugin::instance()->controls_manager->get_control($control['type']);
     foreach ($control['selectors'] as $selector => $css_property) {
         $parsed_css_property = $control_obj->get_replaced_style_values($css_property, $value);
         if (!$parsed_css_property) {
             continue;
         }
         $parsed_selector = str_replace($placeholders, $replacements, $selector);
         $device = !empty($control['responsive']) ? $control['responsive'] : Element_Base::RESPONSIVE_DESKTOP;
         $this->stylesheet_obj->add_rules($parsed_selector, $parsed_css_property, $device);
     }
 }
开发者ID:pojome,项目名称:elementor,代码行数:19,代码来源:post-css-file.php


示例19: render

 /**
  * Renders the HTML to PDF
  */
 function render()
 {
     $this->_process_html();
     $this->_css->apply_styles($this->_tree);
     $root = null;
     foreach ($this->_tree->get_frames() as $frame) {
         // Set up the root frame
         if (is_null($root)) {
             $root = Frame_Factory::decorate_root($this->_tree->get_root());
             continue;
         }
         // Create the appropriate decorators, reflowers & positioners.
         $deco = Frame_Factory::decorate_frame($frame, $this);
         $deco->set_root($root);
         // FIXME: handle generated content
         if ($frame->get_style()->display == "list-item" && in_array($frame->get_style()->list_style_type, List_Bullet_Frame_Decorator::$BULLET_TYPES)) {
             // Insert a list-bullet frame
             $node = $this->_xml->createElement("bullet");
             // arbitrary choice
             $b_f = new Frame($node);
             $style = $this->_css->create_style();
             $style->display = "-dompdf-list-bullet";
             $style->inherit($frame->get_style());
             $b_f->set_style($style);
             $deco->prepend_child(Frame_Factory::decorate_frame($b_f));
         }
     }
     $this->_pdf = Canvas_Factory::get_instance($this->_paper_size, $this->_orientation);
     $root->set_containing_block(0, 0, $this->_pdf->get_width(), $this->_pdf->get_height());
     // This is where the magic happens:
     $root->reflow();
     $renderer = new Renderer($this->_pdf);
     $renderer->render($root);
 }
开发者ID:andrewroth,项目名称:c4c_intranet,代码行数:37,代码来源:dompdf.cls.php


示例20: render


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Su_Data类代码示例发布时间:2022-05-23
下一篇:
PHP Style类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap