本文整理汇总了PHP中Style类的典型用法代码示例。如果您正苦于以下问题:PHP Style类的具体用法?PHP Style怎么用?PHP Style使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Style类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: run
public function run()
{
//Filter::initialization();
//error_log(print_r(Yii::app()->basePath,true));
$data = array();
$event = Events::$even;
if (Filter::getSortByDate()) {
usort($event, "Events::sortByDate");
} elseif (Filter::getSortByPopularity()) {
usort($event, "Events::sortByPopularity");
}
//error_log(print_r($this->controller->getViewFile('poster'),true));
$data['ajaxContent'] = $this->controller->renderPartial('poster', array('parameters' => $event), true);
$data['main_menu'] = $this->controller->renderPartial('main_menu', array(), true);
$location = new Location();
$style = new Style();
$data['country'] = $location->selectContry();
if (!Filter::getCountryId()) {
Filter::setCountryId(current(array_keys($data['country'])));
}
$data['city'] = $location->selectCity(Filter::getCountryId());
if (!Filter::getCityId()) {
Filter::setCityId(0);
}
//Filter::setCityId(current(array_keys($data['city'])));
$data['style'] = $style->selectStyle();
if (!Filter::getStyleId()) {
Filter::setStyleId(current(array_keys($data['style'])));
}
/*Filter::getStyleId()*/
$data['genre'] = $style->selectGenre(Filter::getStyleId());
if (!Filter::getGenreId()) {
Filter::setGenreId(current(array_keys($data['genre'])));
}
$data['model'] = new FilterForm();
$this->controller->render('index', $data);
//$this->controller->render('translationUser', array('row'=>0));
}
开发者ID:vasia-ostapchuk,项目名称:source,代码行数:38,代码来源:IndexAction.php
示例17: __construct
function __construct()
{
$this->CI =& get_instance();
$this->style = Style::getInstance();
$this->CI->config->load('style');
if ($this->CI->config->item('default_style') == NULL || $this->CI->config->item('default_style') == "") {
$this->style = NULL;
} else {
if (!is_dir(VIEWPATH . $this->CI->config->item('theme_dir') . '/' . $this->CI->config->item('default_style'))) {
show_error("Default Theme directory not found");
}
}
$this->defaultThemeDirectory = $this->CI->config->item('theme_dir') . '/' . $this->CI->config->item('default_style');
}
开发者ID:altunbas-huseyin,项目名称:Codeigniter-Theme,代码行数:14,代码来源:View.php
示例18: searchElement
public function searchElement($element_name, $text = null)
{
$html = "";
$elements = [];
$db_elements = DB::table($element_name)->where('name', 'like', "%" . $text . "%")->get();
foreach ($db_elements as $db_element) {
switch ($element_name) {
case "beer":
$elements[] = Beer::find($db_element->id);
break;
case "brewer":
$elements[] = Brewer::find($db_element->id);
break;
case "locality":
$elements[] = Locality::find($db_element->id);
break;
case "style":
$elements[] = Style::find($db_element->id);
break;
}
}
foreach ($elements as $element) {
$html .= '<li class="list-group-item clearfix">';
if ($element_name == "locality" && $element->flag()) {
$html .= '<img src="' . $element->flag()->path . '" style="height:15px"> ';
} elseif ($element_name == "brewer" && $element->logo()) {
$html .= '<img src="' . $element->logo()->path . '" style="height:15px"> ';
}
$html .= '<span>' . $element->name . '</span>' . '<div class="btn-group pull-right">';
if ($element_name == "brewer" || $element_name == "beer") {
$html .= '<a href="' . URL::to('/dashboard/' . $element_name . 's/edit/' . $element->id) . '">';
}
$html .= '<button type="button" class="btn btn-info" ';
if ($element_name != "brewer" && $element_name == "beer") {
$html .= 'onclick="editElement(' . $element->id . ')"';
}
$html .= '>Edit</button>';
if ($element_name == "brewer" || $element_name == "beer") {
$html .= '</a>';
}
$html .= '<a href="' . URL::to('/dashboard/' . $element_name . 's/delete/' . $element->id) . '"><button type="button" class="btn btn-danger">Delete</button></a>';
$html .= '</div></li>';
}
return Response::json(['html' => $html]);
}
开发者ID:andreuramos,项目名称:beers,代码行数:45,代码来源:AjaxController.php
示例19: selectBySingerId
public function selectBySingerId($singer_id)
{
$criteria = new CDbCriteria();
$criteria->select = '*';
$criteria->condition = 'id=:singer_id';
$criteria->params = array(':singer_id' => $singer_id);
$result = Singer::model()->find($criteria);
$image = Image::model()->selectByRow('singer', $singer_id);
$style = Style::model()->selectBySingerId($singer_id);
$result = $result['attributes'];
if ($image) {
$result['path'] = $image->path;
}
if ($style) {
$result['style'] = $style;
}
return $result;
}
开发者ID:vasia-ostapchuk,项目名称:source,代码行数:18,代码来源:singer.php
示例20: __construct
/**
* Style Object
* @param String $paramPrefix Prefix for the folder, sub-folders use this
* @param String $paramStyleFolder Folder where info.xml and template files are located
* @author Jaco Ruit
*/
public function __construct($paramStyleFolder)
{
self::$constructed = true;
$this->styleFolder = $paramStyleFolder;
$filePath = ROOT . '/themes/' . $this->styleFolder . '/info.xml';
if (file_exists($filePath) == false) {
throw new Exception("Unable to load the style. <br /> The info.xml file of the style doesn't exist!");
}
$xml = @simplexml_load_file($filePath);
$this->stylePath = ROOT . '/themes/' . $this->styleFolder . "/";
$json = @json_encode($xml);
$info = @json_decode($json, true);
$this->styleName = $info['style']['name'];
$this->styleCopyright = $info['style']['copyright'];
$this->authorName = $info['style']['author']['name'];
$this->authorWebsite = $info['style']['author']['website'];
$this->usePHP = $info['style']['use_php'] == 'true' ? true : false;
$this->phpFile = $this->usePHP ? $info['style']['php_file'] : null;
if ($this->usePHP) {
try {
$pathString = ROOT . '/themes/' . $this->getStyleFolder() . '/' . $this->getPHPFile();
if (!file_exists($pathString)) {
throw new ClassLoadException();
}
require ROOT . '/themes/' . $this->getStyleFolder() . '/' . $this->getPHPFile();
if (!class_exists($info['style']['main_class'])) {
throw new ClassLoadException($info['style']['main_class'] . " class doesn't exist!");
}
$this->mainClass = new $info['style']['main_class']();
if ($this->mainClass instanceof IOrongoStyle == false) {
throw new Exception();
}
} catch (Exception $e) {
throw new ClassLoadException("Unable to load the style. <br /> Please check the info.xml of the activated style for errors.");
}
} else {
$this->mainClass = null;
}
$this->doHTMLArticle = $info['style']['own_article_html'] == "true" ? true : false;
$this->doHTMLComment = $info['style']['own_comment_html'] == "true" ? true : false;
}
开发者ID:JacoRuit,项目名称:orongocms,代码行数:47,代码来源:class_Style.php
注:本文中的Style类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论