當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。