本文整理汇总了PHP中CSS类的典型用法代码示例。如果您正苦于以下问题:PHP CSS类的具体用法?PHP CSS怎么用?PHP CSS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CSS类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: Execute
public function Execute(Template $template, Session $session, $request)
{
if ($session['user'] instanceof Member && $session['user']['perms'] & ADMIN) {
$css = new CSS();
if ($css->Revert(intval($request['id']))) {
header("Location: admin.php?act=css");
}
}
return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:k4bb,代码行数:10,代码来源:css.class.php
示例2: _addCSS
function _addCSS($order, $resource, $is_file, $minify)
{
$order = intval($order);
$resources = array();
if (array_key_exists($order, $this->css_resources)) {
$resources = $this->css_resources[$order];
}
$css = new CSS($resource, $is_file);
$css->setMinified($minify);
$resources[] = $css;
$this->css_resources[$order] = $resources;
}
开发者ID:ravinderphp,项目名称:landlordv2,代码行数:12,代码来源:Assets.php
示例3: parse
function parse($value)
{
if ($value == 'inherit') {
return CSS_PROPERTY_INHERIT;
}
// Remove spaces between color values in rgb() color definition; this will allow us to tread
// this declaration as a single value
$value = preg_replace("/\\s*,\\s*/", ",", $value);
// Remove spaces before and after parens in rgb color definition
$value = preg_replace("/rgb\\s*\\(\\s*(.*?)\\s*\\)/", 'rgb(\\1)', $value);
$subvalues = explode(" ", $value);
$border = CSS::getDefaultValue(CSS_BORDER);
foreach ($subvalues as $subvalue) {
$subvalue = trim(strtolower($subvalue));
switch (CSSBorder::detect_border_value_type($subvalue)) {
case BORDER_VALUE_COLOR:
$color_handler = CSS::get_handler(CSS_BORDER_COLOR);
$border_color = $color_handler->parse($subvalue);
$color_handler->setValue($border, $border_color);
break;
case BORDER_VALUE_WIDTH:
$width_handler = CSS::get_handler(CSS_BORDER_WIDTH);
$border_width = $width_handler->parse($subvalue);
$width_handler->setValue($border, $border_width);
break;
case BORDER_VALUE_STYLE:
$style_handler = CSS::get_handler(CSS_BORDER_STYLE);
$border_style = $style_handler->parse($subvalue);
$style_handler->setValue($border, $border_style);
break;
}
}
return $border;
}
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:34,代码来源:css.border.inc.php
示例4: parse_css_properties_value
function parse_css_properties_value($string, &$value)
{
$string1_regexp = CSS_STRING1_REGEXP;
$string2_regexp = CSS_STRING2_REGEXP;
$value = '';
do {
$matched = false;
list($new_value, $string) = CSS::parse_string($string);
if (!is_null($new_value)) {
$value .= $new_value;
$matched = true;
}
if (preg_match('/^(' . CSS_FUNCTION_REGEXP . CSS_IDENT_REGEXP . '\\))\\s*(.*)$/si', $string, $matches)) {
$value .= $matches[1];
$string = $matches[2];
$matched = true;
}
} while ($matched);
$value_regexp = '[^;]*?';
if (preg_match(sprintf('/^(%s)(\\s*;.*)/si', $value_regexp), $string, $matches)) {
$value .= trim($matches[1]);
$rest = $matches[2];
return $rest;
}
$value = $value . trim($string);
return '';
}
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:27,代码来源:css.parse.properties.php
示例5: _fix_tag_display
function _fix_tag_display($default_display, &$state, &$pipeline)
{
// In some cases 'display' CSS property should be ignored for element-generated boxes
// Here we will use the $default_display stored above
// Note that "display: none" should _never_ be changed
//
$handler =& CSS::get_handler(CSS_DISPLAY);
if ($handler->get($state->getState()) === "none") {
return;
}
switch ($default_display) {
case 'table-cell':
// TD will always have 'display: table-cell'
$handler->css('table-cell', $pipeline);
break;
case '-button':
// INPUT buttons will always have 'display: -button' (in latter case if display = 'block', we'll use a wrapper box)
$css_state =& $pipeline->getCurrentCSSState();
if ($handler->get($css_state->getState()) === 'block') {
$need_block_wrapper = true;
}
$handler->css('-button', $pipeline);
break;
}
}
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:25,代码来源:css.utils.inc.php
示例6: __construct
/**
* Checks environment and build defaults
*
*/
protected function __construct()
{
// Instantiate Feature Manager
FeatureManager::getInstance();
// Instantiate Context Manager
ContextManager::getInstance();
// Instantiate URLs Manager
UrlManager::getInstance();
// Instantiate Paths Manager & set Bebop root directory
PathManager::getInstance()->set('bebop', __DIR__);
// Set default Media Mvc Model modifications on the Bebop HTTP API
Media::onContext('api', function ($media) {
$media->cacheAllImageSizes();
});
// Set default views directory
View::setViewsDir(PathManager::getInstance()->get('theme', 'views'));
// Instantiate CSS Manager
CSS::getInstance();
// Instantiate JS Manager
JS::getInstance();
// Instantiate UI
UI::getInstance();
// Instantiate Api
self::Api();
// Instantiate Config
Config::getInstance();
// Shortcode support for in editor use
add_shortcode('Bebop', array($this, '__bebopShortcodes'));
}
开发者ID:ponticlaro,项目名称:bebop-core,代码行数:33,代码来源:Bebop.php
示例7: apply
function apply(&$root, &$state, &$pipeline)
{
$local_css = array();
if (isset($this->tag_filtered[strtolower($root->tagname())])) {
$local_css = $this->tag_filtered[strtolower($root->tagname())];
}
if (isset($this->tag_filtered['*'])) {
$local_css = array_merge($local_css, $this->tag_filtered['*']);
}
$applicable = array();
foreach ($local_css as $rule) {
if ($rule->match($root)) {
$applicable[] = $rule;
}
}
usort($applicable, 'cmp_rule_objs');
foreach ($applicable as $rule) {
switch ($rule->get_pseudoelement()) {
case SELECTOR_PSEUDOELEMENT_BEFORE:
$handler =& CSS::get_handler(CSS_HTML2PS_PSEUDOELEMENTS);
$handler->replace($handler->get($state->getState()) | CSS_HTML2PS_PSEUDOELEMENTS_BEFORE, $state);
break;
case SELECTOR_PSEUDOELEMENT_AFTER:
$handler =& CSS::get_handler(CSS_HTML2PS_PSEUDOELEMENTS);
$handler->replace($handler->get($state->getState()) | CSS_HTML2PS_PSEUDOELEMENTS_AFTER, $state);
break;
default:
$rule->apply($root, $state, $pipeline);
break;
}
}
}
开发者ID:isantiago,项目名称:foswiki,代码行数:32,代码来源:css.ruleset.class.php
示例8: post_process
/**
* The second last process, should only be getting everything
* syntaxically correct, rather than doing any heavy processing
*
* @author Anthony Short
* @return $css string
*/
public static function post_process()
{
if ($found = CSS::find_properties_with_value('image-replace', 'url\\([\'\\"]?([^)]+)[\'\\"]?\\)')) {
foreach ($found[4] as $key => $value) {
$path = $url = str_replace("\\", "/", unquote($value));
# If they're getting an absolute file
if ($path[0] == "/") {
$path = DOCROOT . ltrim($path, "/");
}
# Check if it exists
if (!file_exists($path)) {
FB::log("ImageReplace - Image doesn't exist " . $path);
}
# Make sure it's an image
if (!is_image($path)) {
FB::log("ImageReplace - File is not an image: {$path}");
}
// Get the size of the image file
$size = GetImageSize($path);
$width = $size[0];
$height = $size[1];
// Make sure theres a value so it doesn't break the css
if (!$width && !$height) {
$width = $height = 0;
}
// Build the selector
$properties = "\n\t\t\t\t\tbackground:url({$url}) no-repeat 0 0;\n\t\t\t\t\theight:{$height}px;\n\t\t\t\t\twidth:{$width}px;\n\t\t\t\t\tdisplay:block;\n\t\t\t\t\ttext-indent:-9999px;\n\t\t\t\t\toverflow:hidden;\n\t\t\t\t";
CSS::replace($found[2][$key], $properties);
}
# Remove any left overs
CSS::replace($found[1], '');
}
}
开发者ID:Keukendeur,项目名称:csscaffold,代码行数:40,代码来源:ImageReplace.php
示例9: BoxNoteCall
function BoxNoteCall(&$content, &$pipeline)
{
$this->GenericInlineBox();
$this->_note_content =& $content;
$this->copy_style($content);
$this->put_height_constraint(new HCConstraint(null, null, null));
/**
* Prepare ::note-call box
*/
$this->_note_call_box = InlineBox::create_from_text(CSSListStyleType::format_number(LST_DECIMAL, 99), WHITESPACE_NORMAL, $pipeline);
$this->_note_call_box->copy_style($content);
$this->_note_call_box->content[0]->copy_style($content);
$font = $this->_note_call_box->content[0]->getCSSProperty(CSS_FONT);
$font = $font->copy();
$font->size->scale(0.75);
$this->_note_call_box->content[0]->setCSSProperty(CSS_FONT, $font);
$this->_note_call_box->content[0]->setCSSProperty(CSS_VERTICAL_ALIGN, VA_SUPER);
$this->_note_call_box->content[0]->setCSSProperty(CSS_LINE_HEIGHT, CSS::getDefaultValue(CSS_LINE_HEIGHT));
/**
* Prepare ::marker box
*/
$this->_note_marker_box = InlineBox::create_from_text(CSSListStyleType::format_number(LST_DECIMAL, 99), WHITESPACE_NORMAL, $pipeline);
$this->_note_marker_box->copy_style($content);
$this->_note_marker_box->content[0]->copy_style($content);
$font = $this->_note_marker_box->content[0]->getCSSProperty(CSS_FONT);
$font = $font->copy();
$font->size->scale(0.5);
$this->_note_marker_box->content[0]->setCSSProperty(CSS_FONT, $font);
$margin = $this->_note_marker_box->content[0]->getCSSProperty(CSS_MARGIN);
$margin = $margin->copy();
$margin->right = Value::fromData(FOOTNOTE_MARKER_MARGIN, UNIT_PT);
$this->_note_marker_box->content[0]->setCSSProperty(CSS_MARGIN, $margin);
$this->_note_marker_box->content[0]->setCSSProperty(CSS_VERTICAL_ALIGN, VA_SUPER);
$this->_note_marker_box->content[0]->setCSSProperty(CSS_LINE_HEIGHT, CSS::getDefaultValue(CSS_LINE_HEIGHT));
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:35,代码来源:box.note-call.class.php
示例10: NullBox
function &create()
{
$box =& new NullBox();
$css_state = new CSSState(CSS::get());
$css_state->pushState();
$box->readCSS($css_state);
return $box;
}
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:8,代码来源:box.null.php
示例11: testCssAddIntoResult
function testCssAddIntoResult()
{
CSS::clean();
CSS::require_css_file("/" . FRAMEWORK_CORE_PATH . "tests/html/example_css/my_css_file.css");
$this->assertEqual(1, CSS::get_loaded_css(), "Il numero di css caricati non corrisponde!!");
$this->assertTrue(PageData::instance()->is_set("/page/headers/required_css_files"));
$this->assertEqual(1, count(PageData::instance()->get("/page/headers/required_css_files/css_file_list")), "Il numero di css caricati non corrisponde!!");
}
开发者ID:mbcraft,项目名称:frozen,代码行数:8,代码来源:css_test.php
示例12: parse
function parse($value)
{
if ($value == 'inherit') {
return CSS_PROPERTY_INHERIT;
}
$width_handler = CSS::get_handler(CSS_BORDER_WIDTH);
$width = $width_handler->parse_value($value);
return $width;
}
开发者ID:alachaum,项目名称:simpleinvoices,代码行数:9,代码来源:css.border.left.width.inc.php
示例13: parse
/**
* The main processing function called by Scaffold. MUST return $css!
*
* @author Anthony Short
* @return $css string
*/
public static function parse()
{
$xml = CSS::to_xml();
$css = "";
foreach ($xml->rule as $key => $value) {
$css .= self::parse_rule($value);
}
CSS::$css = CSS::convert_entities('decode', $css);
}
开发者ID:Keukendeur,项目名称:csscaffold,代码行数:15,代码来源:NestedSelectors.php
示例14: array
/**
* Optimization: this function is called very often,
* so even a slight overhead for CSS::get_handler call
* accumulates in a significiant processing delay.
*/
function &getCSSProperty($code)
{
static $cache = array();
if (!isset($cache[$code])) {
$cache[$code] =& CSS::get_handler($code);
}
$value =& $cache[$code]->get($this->_css);
return $value;
}
开发者ID:alachaum,项目名称:simpleinvoices,代码行数:14,代码来源:box.generic.php
示例15: apply
function apply(&$state)
{
$properties = $this->getPropertiesRaw();
foreach ($properties as $property) {
$key = $property->getCode();
$value = $property->getValue();
$handler =& CSS::get_handler($key);
$handler->replace($value, $state);
}
}
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:10,代码来源:css.property.collection.php
示例16: initDisplay
/**
* Initialize requires CSS and JS files.
*/
public static function initDisplay()
{
static $inited = false;
if (!$inited) {
JS::add('/js/video-js.min.js', false);
JS::startup('videojs.options.flash.swf = "/swf/video-js.swf"');
CSS::add('/css/video-js.min.css');
$inited = true;
}
}
开发者ID:kemosabhay,项目名称:Lightning,代码行数:13,代码来源:Video.php
示例17: parse
function parse($string)
{
list($value, $rest) = CSS::parse_string($string);
if (!is_null($value)) {
$item =& new ValueContentItemString();
$item->set_value(substr($value, 1, strlen($value) - 2));
return array('item' => &$item, 'rest' => $rest);
}
$null = null;
return array('item' => &$null, 'rest' => $string);
}
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:11,代码来源:value.content.item.php
示例18: index
function index()
{
$content = CSS::cache_content($_GET['f']);
header('Expires: Thu, 15 Apr 2100 20:00:00 GMT');
header('Pragma: public');
header('Cache-Control: max-age=604800');
header('Content-Type: text/css; charset:utf-8');
ob_start('ob_gzhandler');
echo $content;
ob_end_flush();
exit;
}
开发者ID:pihizi,项目名称:qf,代码行数:12,代码来源:css.php
示例19: parse_css_properties_property
function parse_css_properties_property($string, &$code)
{
$identifier_regexp = CSS::get_identifier_regexp();
if (!preg_match(sprintf('/^\\s*(%s)(.*)/s', $identifier_regexp), $string, $matches)) {
$code = null;
return '';
}
$name = strtolower(trim($matches[1]));
$rest = $matches[2];
$code = CSS::word2code($name);
return $rest;
}
开发者ID:emildev35,项目名称:processmaker,代码行数:12,代码来源:css.parse.properties.php
示例20: TableBox
function &create(&$root, &$pipeline)
{
$box =& new TableBox();
$box->readCSS($pipeline->getCurrentCSSState());
// This row should not inherit any table specific properties!
// 'overflow' for example
//
$css_state =& $pipeline->getCurrentCSSState();
$css_state->pushDefaultState();
$row =& new TableRowBox($root);
$row->readCSS($css_state);
$box->add_child($row);
$css_state->popState();
// Setup cellspacing / cellpadding values
if ($box->getCSSProperty(CSS_BORDER_COLLAPSE) == BORDER_COLLAPSE) {
$handler =& CSS::get_handler(CSS_PADDING);
$box->setCSSProperty(CSS_PADDING, $handler->default_value());
}
// Set text-align to 'left'; all browsers I've ever seen prevent inheriting of
// 'text-align' property by the tables.
// Say, in the following example the text inside the table cell will be aligned left,
// instead of inheriting 'center' value.
//
// <div style="text-align: center; background-color: green;">
// <table width="100" bgcolor="red">
// <tr><td>TEST
// </table>
// </div>
$handler =& CSS::get_handler(CSS_TEXT_ALIGN);
$handler->css('left', $pipeline);
// Parse table contents
$child = $root->first_child();
$col_index = 0;
while ($child) {
if ($child->node_type() === XML_ELEMENT_NODE) {
if ($child->tagname() === 'colgroup') {
// COLGROUP tags do not generate boxes; they contain information on the columns
//
$col_index = $box->parse_colgroup_tag($child, $col_index);
} else {
$child_box =& create_pdf_box($child, $pipeline);
$box->add_child($child_box);
}
}
$child = $child->next_sibling();
}
$box->normalize($pipeline);
$box->normalize_cwc();
$box->normalize_rhc();
$box->normalize_parent();
return $box;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:52,代码来源:box.table.php
注:本文中的CSS类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论