当前位置: 首页>>代码示例>>PHP>>正文


PHP css::getCSSValues方法代码示例

本文整理汇总了PHP中css::getCSSValues方法的典型用法代码示例。如果您正苦于以下问题:PHP css::getCSSValues方法的具体用法?PHP css::getCSSValues怎么用?PHP css::getCSSValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在css的用法示例。


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

示例1: ucfirst

                $categBlock = $blockInfos['block_category'];
            } else {
                $categBlock = $module;
            }
            if (!isset($blocksCat[$categBlock])) {
                $blocksCat[$categBlock] = '';
            }
            if (isset($blockInfos['description'])) {
                $description = ucfirst(s($blockInfos['description']));
            }
            $blocksCat[$categBlock] .= '<div class="admin_core_block tooltip" data-title="' . trim(ucfirst(s($blockInfos['title']))) . '" data-tooltip="' . $description . '" draggable="true" id="' . str_replace('\\', '', $blockClassName) . '" data-block="' . $blockClassName . '" style="background:url(' . BASE_PATH . $module . '/blocks/' . $blockName . '/icon.png) center center no-repeat;"></div>';
        }
        /* List default stylables selecteurs */
        if (is_file('modules/' . $module . '/blocks/' . $blockName . '/default.css')) {
            $css = new css('modules/' . $module . '/blocks/' . $blockName . '/default.css');
            $CSSValues = $css->getCSSValues();
            if (!isset($stylableElements[$module . '_' . $blockName])) {
                $stylableElements[$module . '_' . $blockName] = array();
            }
            foreach ($CSSValues as $selecteur => $components) {
                preg_match('@\\{(.*)\\}@', $components['b'], $res);
                if (!empty($res)) {
                    $stylableElements[$module . '_' . $blockName][$res[1]] = $selecteur;
                }
            }
        }
    }
}
foreach ($blocksCat as $title => $blocks) {
    echo '<div class="titleTab ellipsis">' . t(ucfirst($title), FALSE) . '</div>';
    echo '<div id="blocks_' . $title . '">' . $blocks . '</div>';
开发者ID:saitinet,项目名称:parsimony,代码行数:31,代码来源:view.php

示例2: setContent

 /**
  * Send content to client
  * @param mixed $body optional
  */
 public function setContent($body = '', $status = FALSE)
 {
     if ($status !== FALSE) {
         $this->setStatus($status);
     }
     if ($body instanceof page) {
         /* If it's a page object */
         $this->page = $body;
         /* Save page object */
         /* Init defaults JS and CSS for CMS pages */
         $this->addJSFile('core/js/parsimony.js');
         $this->addCSSFile('core/css/parsimony.css');
         \app::dispatchEvent('beforePageLoad');
         $theme = $this->page->getTheme();
         if ($theme instanceof theme) {
             define('THEMEMODULE', $theme->getModule());
             define('THEME', $theme->getName());
             $this->addCSSFile(THEMEMODULE . '/themes/' . THEME . '/style.css');
             $body = $theme->display();
             /* Display with theme */
         } else {
             define('THEMEMODULE', '');
             define('THEME', '');
             $body = $body->display();
             /* Display without theme */
         }
         /* Set page infos to admin */
         if (!defined('PARSI_ADMIN') && $_SESSION['permissions'] > 0 && \app::$request->getParam('popup') !== '') {
             $timer = isset($_SERVER['REQUEST_TIME_FLOAT']) ? round(microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], 4) : '~ ' . floor(microtime(true) - $_SERVER['REQUEST_TIME']);
             /* Be sure that editiniline can be used in edit mode */
             \app::$response->addJSFile('core/js/editinline.js');
             \app::$response->addCSSFile('core/css/editinline.css');
             /* correct resMax with preview screen */
             \app::$response->head .= '<script>document.cookie = "DW=" + (top.ParsimonyAdmin.getCookie("screenX") || screen.width) + ";path=/";document.cookie = "DH=" + (top.ParsimonyAdmin.getCookie("screenY") || screen.height)  + ";path=/";</script>';
             $body .= '<script>top.document.getElementById("infodev_timer").textContent="' . $timer . ' s";top.document.getElementById("infodev_module").textContent="' . MODULE . '";top.document.getElementById("infodev_theme").textContent="' . THEME . '";top.setActiveTheme("' . THEME . '");top.document.getElementById("infodev_page").textContent="' . $this->page->getId() . '";';
             $pathTheme = THEMEMODULE . '/themes/' . THEME . '/style.css';
             if ($_SESSION['permissions'] & 16) {
                 /* Store on client side all CSS selectors from theme style */
                 $css = new css(stream_resolve_include_path($pathTheme));
                 $CSSValues = $css->getCSSValues();
                 $body .= 'top.Parsimony.blocks["admin_css"].CSSValues["' . $pathTheme . '"] = ' . json_encode($CSSValues) . ';';
             }
             $body .= 'top.history.replaceState({url:document.location.pathname}, document.title, document.location.pathname.replace("?preview=ok","").replace("preview=ok",""));top.$_GET=' . json_encode($_GET) . ';top.$_POST=' . json_encode($_POST) . ';top.CSSTHEMEPATH = "' . $pathTheme . '";top.CSSPAGEPATH = "' . MODULE . '/css/' . DEVICE . '.css";document.addEventListener("DOMContentLoaded", function() {top.ParsimonyAdmin.initPreview();});  </script>';
         }
         \app::dispatchEvent('afterPageLoad');
         /* Wrap body with HTML structure */
         ob_start();
         include 'core/views/index.php';
         $body = ob_get_clean();
         \app::dispatchEvent('beforePageDisplay', array(&$body));
         /* allow to process files before they are sent to the client */
     }
     /* Set headers */
     header($_SERVER['SERVER_PROTOCOL'] . ' ' . $this->status . ' ' . self::$HTTPstatus[$this->status], true, $this->status);
     header('Content-type: ' . \app::$config['ext'][$this->format] . '; charset=' . $this->charset);
     header('Vary: User-Agent');
     /* Dynamically serving different HTML on the same URL */
     foreach ($this->headers as $label => $header) {
         header($label . ': ' . $header);
     }
     /* Set body to client */
     $this->body = $body;
 }
开发者ID:saitinet,项目名称:parsimony,代码行数:67,代码来源:response.php


注:本文中的css::getCSSValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。