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


PHP Style类代码示例

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


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

示例1: profileEdit

 function profileEdit()
 {
     // Authorize user
     $id = $_GET['id'];
     if ($this->_user['is_authorized']) {
         if (!($this->_user['id'] == $id)) {
             $this->set('authorized', false);
             die('You are not allowed to edit this profile!');
         } else {
             $this->set('authorized', true);
         }
     } else {
         $this->set('authorized', false);
         die('You are not allowed to edit this profile!');
     }
     // get all necessary user data
     $user = new User();
     $user->createFromID($id);
     $email = $user->getEmail();
     $language = $user->getDefaultLanguage();
     $this->set('default_language', $language);
     // notification_interval is rewritten if any POST data is present
     $notification_interval = $user->getNotificationInterval();
     $default_theme = $user->getDefaultTheme();
     //if any POST data in - update profile
     $style = new Style();
     $styles_list = $style->getAll();
     $this->set('styles', $styles_list);
     $this->set('notification_interval', $notification_interval);
     $this->set('default_theme', $default_theme);
     $this->set('profile', $user);
     $this->set('email', $email);
     $this->set('page_title', "Edit User - " . $user->username);
 }
开发者ID:TBoonX,项目名称:SlideWiki,代码行数:34,代码来源:UserController.php

示例2: style

 public function style($src, $media = null)
 {
     $asset = new Style($src, $media);
     if ($asset->isLess()) {
         $asset->setPublicRoot($this->manager->getPublicRoot());
     }
     $this->styleAssets[] = $asset;
     return $this;
 }
开发者ID:jimbojsb,项目名称:simple-asset,代码行数:9,代码来源:Collection.php

示例3: testReadXml1

 /**
  * @covers Geissler\CSL\Style\Style::readXml
  */
 public function testReadXml1()
 {
     $xml = '<style
                     xmlns="http://purl.org/net/xbiblio/csl"
                     class="note"
                     version="1.0">
                 <info>
                   <id />
                   <title />
                   <updated>2009-08-10T04:49:00+09:00</updated>
                 </info>
                 <locale lang="fr">
                 </locale>
                 <citation>
                   <layout>
                     <text value="Oops"/>
                   </layout>
                 </citation>
                 <bibliography
                     initialize-with=". ">
                   <layout>
                     <names variable="author">
                       <name />
                     </names>
                   </layout>
                 </bibliography>
               </style>';
     $this->assertInstanceOf($this->class, $this->object->readXml(new \SimpleXMLElement($xml)));
 }
开发者ID:geissler,项目名称:csl,代码行数:32,代码来源:StyleTest.php

示例4: _tag

 protected function _tag($code)
 {
     if ($this->tag === true) {
         return Style::open() . $code . Style::close();
     }
     return $code;
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:7,代码来源:SheetTrait.php

示例5: validate_style_id

 public function validate_style_id()
 {
     $errors = array();
     if (!is_integer($this->style_id) || !Style::find($this->style_id)) {
         $errors[] = "style does not exist";
     }
     return $errors;
 }
开发者ID:Rochet2,项目名称:Tsoha-Bootstrap,代码行数:8,代码来源:beer.php

示例6: __toString

 function __toString()
 {
     // Skip empty text frames
     //     if ( $this->is_text_node() &&
     //          preg_replace("/\s/", "", $this->_node->data) === "" )
     //       return "";
     $str = "<b>" . $this->_node->nodeName . ":</b><br/>";
     //$str .= spl_object_hash($this->_node) . "<br/>";
     $str .= "Id: " . $this->get_id() . "<br/>";
     $str .= "Class: " . get_class($this) . "<br/>";
     if ($this->is_text_node()) {
         $tmp = htmlspecialchars($this->_node->nodeValue);
         $str .= "<pre>'" . mb_substr($tmp, 0, 70) . (mb_strlen($tmp) > 70 ? "..." : "") . "'</pre>";
     } elseif ($css_class = $this->_node->getAttribute("class")) {
         $tmp = htmlspecialchars($css_class);
         $str .= "CSS class: '{$css_class}'<br/>";
     }
     if ($this->_parent) {
         $str .= "\nParent:" . $this->_parent->_node->nodeName . " (" . spl_object_hash($this->_parent->_node) . ") " . "<br/>";
     }
     if ($this->_prev_sibling) {
         $str .= "Prev: " . $this->_prev_sibling->_node->nodeName . " (" . spl_object_hash($this->_prev_sibling->_node) . ") " . "<br/>";
     }
     if ($this->_next_sibling) {
         $str .= "Next: " . $this->_next_sibling->_node->nodeName . " (" . spl_object_hash($this->_next_sibling->_node) . ") " . "<br/>";
     }
     $d = $this->get_decorator();
     while ($d && $d != $d->get_decorator()) {
         $str .= "Decorator: " . get_class($d) . "<br/>";
         $d = $d->get_decorator();
     }
     $str .= "Position: " . pre_r($this->_position, true);
     $str .= "\nContaining block: " . pre_r($this->_containing_block, true);
     $str .= "\nMargin width: " . pre_r($this->get_margin_width(), true);
     $str .= "\nMargin height: " . pre_r($this->get_margin_height(), true);
     $str .= "\nStyle: <pre>" . $this->_style->__toString() . "</pre>";
     if ($this->_decorator instanceof Block_Frame_Decorator) {
         $str .= "Lines:<pre>";
         foreach ($this->_decorator->get_line_boxes() as $line) {
             foreach ($line->get_frames() as $frame) {
                 if ($frame instanceof Text_Frame_Decorator) {
                     $str .= "\ntext: ";
                     $str .= "'" . htmlspecialchars($frame->get_text()) . "'";
                 } else {
                     $str .= "\nBlock: " . $frame->get_node()->nodeName . " (" . spl_object_hash($frame->get_node()) . ")";
                 }
             }
             $str .= "\ny => " . $line->y . "\n" . "w => " . $line->w . "\n" . "h => " . $line->h . "\n" . "left => " . $line->left . "\n" . "right => " . $line->right . "\n";
         }
         $str .= "</pre>";
     }
     $str .= "\n";
     if (php_sapi_name() === "cli") {
         $str = strip_tags(str_replace(array("<br/>", "<b>", "</b>"), array("\n", "", ""), $str));
     }
     return $str;
 }
开发者ID:nvdnkpr,项目名称:dompdf,代码行数:57,代码来源:frame.cls.php

示例7: createStyle

 function createStyle($deck)
 {
     $style = new Style();
     $this->css = $style->getStyle($deck->default_theme);
     $deck_name = $this->sluggify($deck->title);
     $css = ROOT . DS . 'tmp' . DS . $this->root_deck_name . DS . $deck_name . DS . 'default.css';
     if (!file_exists($css)) {
         $fp = fopen($css, "wb");
         fwrite($fp, $this->css['css']);
         fclose($fp);
     } else {
         unlink($css);
         $fp = fopen($css, "wb");
         fwrite($fp, $this->css['css']);
         fclose($fp);
     }
     $this->common_resources[] = $deck_name . DS . 'default.css';
 }
开发者ID:TBoonX,项目名称:SlideWiki,代码行数:18,代码来源:Scorm.php

示例8: run

 public function run()
 {
     $row = 0;
     if (($handle = fopen(storage_path() . "/csvs/styles.csv", "r")) !== FALSE) {
         while (($data = fgetcsv($handle)) !== FALSE) {
             $row++;
             if ($row > 1) {
                 try {
                     $style = new Style();
                     $style->style_name = $data[2];
                     // $beer->beer_id = $data[0];
                     $style->save();
                 } catch (Exception $e) {
                 }
             }
         }
         fclose($handle);
     }
 }
开发者ID:hopshoppub,项目名称:hopshop.dev,代码行数:19,代码来源:StylesTableSeeder.php

示例9: setStyle

 /**
  * Sets the style 
  * @param String $paramStyle  path of the style folder
  */
 public static function setStyle($paramStyle)
 {
     try {
         getDatabase()->query('TRUNCATE TABLE `style_data`');
         Style::install(ROOT . "/themes/" . $paramStyle . "/info.xml");
     } catch (Exception $e) {
         throw $e;
     }
     getDatabase()->update("settings", array("value" => $paramStyle), "setting = 'website_style'");
 }
开发者ID:JacoRuit,项目名称:orongocms,代码行数:14,代码来源:class_Settings.php

示例10: PrintHtmlHeader

 function PrintHtmlHeader($logout)
 {
     $style = new Style();
     echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n";
     echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >' . "\n";
     echo '  <head>' . "\n";
     echo '    <title>Shrew Gallery</title>' . "\n";
     echo '    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n";
     echo '<style type="text/css">' . "\n";
     echo $style->Generate();
     echo '</style>' . "\n";
     echo '  </head>' . "\n";
     echo '  <body>' . "\n";
     echo '  <div id="page">' . "\n";
     if ($logout) {
         echo '    <div id=logout><a href=index.php?want=logout >Déconnection</a></div>' . "\n";
     }
     echo '    <h1>Shrew gallery</h1>' . "\n";
 }
开发者ID:niavok,项目名称:shrew-gallery,代码行数:19,代码来源:display_manager.php

示例11: Check

 public static function Check()
 {
     if (empty(self::$Default)) {
         self::$Default = CFG_STYLE_DEFAULT;
     }
     // TODO: Read user style from Database and use it
     if (empty(self::$Style)) {
         self::$Style = self::$Default;
     }
 }
开发者ID:nicocode,项目名称:Board,代码行数:10,代码来源:Style.class.php

示例12: run

 public function run()
 {
     $settings = Style::getSettings();
     //Reverse the Menu, we've right float
     getMenu()->flip();
     foreach ($settings as $setting => $value) {
         if ($value != null) {
             getDisplay()->setTemplateVariable($settings, $value);
         }
     }
 }
开发者ID:JacoRuit,项目名称:orongocms,代码行数:11,代码来源:monkPHP.php

示例13: run

 public function run()
 {
     $tags = Style::model()->findStyleWeights($this->limit, $this->singer_id);
     foreach ($tags as $tag => $options) {
         //$color = '#'.dechex(rand(100, 255)).dechex(rand(0, 200)).dechex(rand(50, 100));
         $text = CHtml::encode($tag);
         //$id_hidden = CHtml::hiddenField('style_'.$options['id'], $options['id']);
         //$content = $link.$id_hidden;
         echo CHtml::tag('span', array('id' => $options['id'], 'style' => "font-size:{$options['weight']}pt; color: #2E3CA3; cursor: pointer;"), $text) . "\n";
     }
 }
开发者ID:vasia-ostapchuk,项目名称:source,代码行数:11,代码来源:StyleCloud.php

示例14: pop

 /**
  * 从堆栈中弹出一个样式
  * @param Style|null $style
  * @return Style
  * @throws \InvalidArgumentException
  */
 public function pop(Style $style = null)
 {
     if (empty($this->styles)) {
         return $this->emptyStyle;
     }
     if (null === $style) {
         return array_pop($this->styles);
     }
     /**
      * @var int   $index
      * @var Style $stackedStyle
      */
     foreach (array_reverse($this->styles, true) as $index => $stackedStyle) {
         if ($style->apply('') === $stackedStyle->apply('')) {
             $this->styles = array_slice($this->styles, 0, $index);
             return $stackedStyle;
         }
     }
     throw new \InvalidArgumentException('Incorrectly nested style tag found.');
 }
开发者ID:top-think,项目名称:framework,代码行数:26,代码来源:Stack.php

示例15: __toString

 function __toString()
 {
     // Skip empty text frames
     if ($this->_node->nodeName == "#text" && preg_replace("/\\s/", "", $this->_node->data) === "") {
         return "";
     }
     $str = "<b>" . $this->_node->nodeName . ":</b><br/>";
     $str .= (string) $this->_node . "<br/>";
     $str .= "Id: " . $this->get_id() . "<br/>";
     $str .= "Class: " . get_class($this) . "<br/>";
     if ($this->_node->nodeName == "#text") {
         $tmp = htmlspecialchars($this->_node->nodeValue);
         $str .= "<pre>'" . mb_substr($tmp, 0, 70) . (mb_strlen($tmp) > 70 ? "..." : "") . "'</pre>";
     }
     if ($this->_parent) {
         $str .= "\nParent:" . $this->_parent->_node->nodeName . " (" . (string) $this->_parent->_node . ") " . "<br/>";
     }
     if ($this->_prev_sibling) {
         $str .= "Prev: " . $this->_prev_sibling->_node->nodeName . " (" . (string) $this->_prev_sibling->_node . ") " . "<br/>";
     }
     if ($this->_next_sibling) {
         $str .= "Next: " . $this->_next_sibling->_node->nodeName . " (" . (string) $this->_next_sibling->_node . ") " . "<br/>";
     }
     $d = $this->get_decorator();
     while ($d && $d != $d->get_decorator()) {
         $str .= "Decorator: " . get_class($d) . "<br/>";
         $d = $d->get_decorator();
     }
     $str .= "Position: " . pre_r($this->_position, true);
     $str .= "\nContaining block: " . pre_r($this->_containing_block, true);
     $str .= "\nMargin width: " . pre_r($this->get_margin_width(), true);
     $str .= "\nMargin height: " . pre_r($this->get_margin_height(), true);
     $str .= "\nStyle: <pre>" . $this->_style->__toString() . "</pre>";
     if ($this->_decorator instanceof Block_Frame_Decorator) {
         $str .= "Lines:<pre>";
         foreach ($this->_decorator->get_lines() as $line) {
             foreach ($line["frames"] as $frame) {
                 if ($frame instanceof Text_Frame_Decorator) {
                     $str .= "\ntext: ";
                     $str .= htmlspecialchars($frame->get_text());
                 } else {
                     $str .= "\nBlock: " . $frame->get_node()->nodeName . " (" . (string) $frame->get_node() . ")";
                 }
             }
             $str .= "\ny => " . $line["y"] . "\n" . "w => " . $line["w"] . "\n" . "h => " . $line["h"] . "\n";
         }
         $str .= "</pre>";
     }
     $str .= "\n";
     if (php_sapi_name() == "cli") {
         $str = strip_tags(str_replace(array("<br/>", "<b>", "</b>"), array("\n", "", ""), $str));
     }
     return $str;
 }
开发者ID:artre,项目名称:study,代码行数:54,代码来源:frame.cls.php


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