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


PHP Theme::path方法代码示例

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


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

示例1: handle

 /**
  * Class handler.
  *
  * @param array $args query arguments
  *
  * @return boolean false if user doesn't exist
  */
 function handle($args)
 {
     parent::handle($args);
     $type = $this->trimmed('type');
     $short_name = '';
     if ($type == 'people') {
         $type = 'peoplesearch';
         // TRANS: ShortName in the OpenSearch interface when trying to find users.
         $short_name = _('People Search');
     } else {
         $type = 'noticesearch';
         // TRANS: ShortName in the OpenSearch interface when trying to find notices.
         $short_name = _('Notice Search');
     }
     header('Content-Type: application/opensearchdescription+xml');
     $this->startXML();
     $this->elementStart('OpenSearchDescription', array('xmlns' => 'http://a9.com/-/spec/opensearch/1.1/'));
     $short_name = common_config('site', 'name') . ' ' . $short_name;
     $this->element('ShortName', null, $short_name);
     $this->element('Contact', null, common_config('site', 'email'));
     $this->element('Url', array('type' => 'text/html', 'method' => 'get', 'template' => str_replace('---', '{searchTerms}', common_local_url($type, array('q' => '---')))));
     $this->element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico'));
     $this->element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), Theme::path('logo.png'));
     $this->element('AdultContent', null, 'false');
     $this->element('Language', null, common_language());
     $this->element('OutputEncoding', null, 'UTF-8');
     $this->element('InputEncoding', null, 'UTF-8');
     $this->elementEnd('OpenSearchDescription');
     $this->endXML();
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:37,代码来源:opensearch.php

示例2: handle

 protected function handle()
 {
     parent::handle();
     switch ($this->format) {
         case 'xml':
             $this->initDocument('xml');
             $this->elementStart('config');
             // XXX: check that all sections and settings are legal XML elements
             foreach ($this->keys as $section => $settings) {
                 $this->elementStart($section);
                 foreach ($settings as $setting) {
                     $value = $this->setting($section, $setting);
                     if (is_array($value)) {
                         $value = implode(',', $value);
                     } else {
                         if ($value === false || $value == '0') {
                             $value = 'false';
                         } else {
                             if ($value === true || $value == '1') {
                                 $value = 'true';
                             }
                         }
                     }
                     // return theme logo if there's no site specific one
                     if (empty($value)) {
                         if ($section == 'site' && $setting == 'logo') {
                             $value = Theme::path('logo.png');
                         }
                     }
                     $this->element($setting, null, $value);
                 }
                 $this->elementEnd($section);
             }
             $this->elementEnd('config');
             $this->endDocument('xml');
             break;
         case 'json':
             $result = array();
             foreach ($this->keys as $section => $settings) {
                 $result[$section] = array();
                 foreach ($settings as $setting) {
                     $result[$section][$setting] = $this->setting($section, $setting);
                 }
             }
             $this->initDocument('json');
             $this->showJsonObjects($result);
             $this->endDocument('json');
             break;
         default:
             // TRANS: Client error displayed when coming across a non-supported API method.
             $this->clientError(_('API method not found.'), 404);
     }
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:53,代码来源:apignusocialconfig.php

示例3: showTimeline

 /**
  * Show the timeline of notices
  *
  * @return void
  */
 function showTimeline()
 {
     $sitename = common_config('site', 'name');
     $sitelogo = common_config('site', 'logo') ? common_config('site', 'logo') : Theme::path('logo.png');
     // TRANS: Title for timeline with lastest notices with a given tag.
     // TRANS: %s is the tag.
     $title = sprintf(_("Notices tagged with %s"), $this->tag);
     $subtitle = sprintf(_('Updates tagged with %1$s on %2$s!'), $this->tag, $sitename);
     $taguribase = TagURI::base();
     $id = "tag:{$taguribase}:TagTimeline:" . $this->tag;
     $link = common_local_url('tag', array('tag' => $this->tag));
     $self = $this->getSelfUri();
     switch ($this->format) {
         case 'xml':
             $this->showXmlTimeline($this->notices);
             break;
         case 'rss':
             $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $sitelogo, $self);
             break;
         case 'atom':
             header('Content-Type: application/atom+xml; charset=utf-8');
             $atom = new AtomNoticeFeed($this->auth_user);
             $atom->setId($id);
             $atom->setTitle($title);
             $atom->setSubtitle($subtitle);
             $atom->setLogo($sitelogo);
             $atom->setUpdated('now');
             $atom->addLink($link);
             $atom->setSelfLink($self);
             $atom->addEntryFromNotices($this->notices);
             $this->raw($atom->getString());
             break;
         case 'json':
             $this->showJsonTimeline($this->notices);
             break;
         case 'as':
             header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
             $doc = new ActivityStreamJSONDocument($this->auth_user);
             $doc->setTitle($title);
             $doc->addLink($link, 'alternate', 'text/html');
             $doc->addItemsFromNotices($this->notices);
             $this->raw($doc->asString());
             break;
         default:
             // TRANS: Client error displayed when coming across a non-supported API method.
             $this->clientError(_('API method not found.'), $code = 404);
             break;
     }
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:54,代码来源:apitimelinetag.php

示例4: Header

 function Header()
 {
     $this->Image(Theme::path('logo.png'), 10, 8, 33);
     // Arial bold 15
     $this->SetFont('Arial', 'B', 15);
     // Movernos a la derecha
     $this->Cell(80);
     // Título
     $this->Cell(0, 0, 'Apuntes ' . $this->modo, 0, 1, 'R');
     $this->Ln(10);
     $this->SetFont('Arial', 'I', 12);
     $this->SetTextColor(199, 199, 199);
     $this->MultiCell(0, 6, 'Este documento es únicamente una recopilación de ideas. En ningún caso sustituye al material proporcionado por el profesor.', 0);
     $this->Ln(5);
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:15,代码来源:GenerarPDF.php

示例5: _showLogo

 function _showLogo($action)
 {
     $action->elementStart('address', 'vcard');
     if (common_config('singleuser', 'enabled')) {
         $user = User::singleUser();
         $url = common_local_url('showstream', array('nickname' => $user->nickname));
     } else {
         $url = common_local_url('public');
     }
     $action->elementStart('a', array('class' => 'url home bookmark', 'href' => $url));
     if (common_config('site', 'mobilelogo') || file_exists(Theme::file('logo.png')) || file_exists(Theme::file('mobilelogo.png'))) {
         $action->element('img', array('class' => 'photo', 'src' => common_config('site', 'mobilelogo') ? common_config('site', 'mobilelogo') : (file_exists(Theme::file('mobilelogo.png')) ? Theme::path('mobilelogo.png') : Theme::path('logo.png')), 'alt' => common_config('site', 'name')));
     }
     $action->element('span', array('class' => 'fn org'), common_config('site', 'name'));
     $action->elementEnd('a');
     $action->elementEnd('address');
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:17,代码来源:MobileProfilePlugin.php

示例6: cssLink

 /**
  * output a css link
  *
  * @param string $src     relative path within the theme directory, or an absolute path
  * @param string $theme        'theme' that contains the stylesheet
  * @param string media         'media' attribute of the tag
  *
  * @return void
  */
 function cssLink($src, $theme = null, $media = null)
 {
     if (Event::handle('StartCssLinkElement', array($this, &$src, &$theme, &$media))) {
         $url = parse_url($src);
         if (empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment'])) {
             if (file_exists(Theme::file($src, $theme))) {
                 $src = Theme::path($src, $theme);
             } else {
                 $src = common_path($src, GNUsocial::isHTTPS());
             }
             $src .= '?version=' . GNUSOCIAL_VERSION;
         }
         $this->element('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => $src, 'media' => $media));
         Event::handle('EndCssLinkElement', array($this, $src, $theme, $media));
     }
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:25,代码来源:htmloutputter.php

示例7: showNotice

 function showNotice($notice)
 {
     $profile = $notice->getProfile();
     if (empty($profile)) {
         common_log(LOG_WARNING, sprintf("Notice %d has no profile", $notice->id));
         return;
     }
     $this->out->elementStart('li', 'hentry notice');
     $this->out->elementStart('div', 'entry-title');
     $avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
     $this->out->elementStart('span', 'vcard author');
     $this->out->elementStart('a', array('title' => $profile->fullname ? $profile->fullname : $profile->nickname, 'href' => $profile->profileurl, 'class' => 'url'));
     $this->out->element('img', array('src' => $avatar ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_MINI_SIZE), 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar photo', 'alt' => $profile->fullname ? $profile->fullname : $profile->nickname));
     $this->out->text(' ');
     $this->out->element('span', 'fn nickname', $profile->nickname);
     $this->out->elementEnd('a');
     $this->out->elementEnd('span');
     $this->out->elementStart('p', 'entry-content');
     $this->out->raw($notice->rendered);
     $notice_link_cfg = common_config('site', 'notice_link');
     if ('direct' === $notice_link_cfg) {
         $this->out->text(' (');
         $this->out->element('a', array('href' => $notice->uri), 'see');
         $this->out->text(')');
     } elseif ('attachment' === $notice_link_cfg) {
         if ($count = $notice->hasAttachments()) {
             // link to attachment(s) pages
             if (1 === $count) {
                 $f2p = File_to_post::staticGet('post_id', $notice->id);
                 $href = common_local_url('attachment', array('attachment' => $f2p->file_id));
                 $att_class = 'attachment';
             } else {
                 $href = common_local_url('attachments', array('notice' => $notice->id));
                 $att_class = 'attachments';
             }
             $clip = Theme::path('images/icons/clip.png', 'base');
             $this->out->elementStart('a', array('class' => $att_class, 'style' => "font-style: italic;", 'href' => $href, 'title' => "# of attachments: {$count}"));
             $this->out->raw(" ({$count}&nbsp");
             $this->out->element('img', array('style' => 'display: inline', 'align' => 'top', 'width' => 20, 'height' => 20, 'src' => $clip, 'alt' => 'alt'));
             $this->out->text(')');
             $this->out->elementEnd('a');
         } else {
             $this->out->text(' (');
             $this->out->element('a', array('href' => $notice->uri), 'see');
             $this->out->text(')');
         }
     }
     $this->out->elementEnd('p');
     if (!empty($notice->value)) {
         $this->out->elementStart('p');
         $this->out->text($notice->value);
         $this->out->elementEnd('p');
     }
     $this->out->elementEnd('div');
     $this->out->elementEnd('li');
 }
开发者ID:himmelex,项目名称:NTW,代码行数:56,代码来源:noticesection.php

示例8: showContent

 function showContent()
 {
     $this->raw('<p style="margin: 20px 80px">');
     // @fixme this would be better using standard CSS class, but the present theme's a bit scary.
     $this->element('img', array('src' => Theme::path('images/icons/icon_processing.gif', 'base'), 'style' => 'display: inline'));
     // TRANS: OpenID plugin message used while requesting authorization user's OpenID login provider.
     $this->text(_m('Requesting authorization from your login provider...'));
     $this->raw('</p>');
     $this->raw('<p style="margin-top: 60px; font-style: italic">');
     // TRANS: OpenID plugin message. User instruction while requesting authorization user's OpenID login provider.
     $this->text(_m('If you are not redirected to your login provider in a few seconds, try pushing the button below.'));
     $this->raw('</p>');
     $this->raw($this->form_html);
 }
开发者ID:Br3nda,项目名称:statusnet-debian,代码行数:14,代码来源:openid.php

示例9: showLogo

 /**
  * Show configured logo.
  *
  * @return nothing
  */
 function showLogo()
 {
     $this->elementStart('address', array('id' => 'site_contact', 'class' => 'vcard grid_8'));
     $url = common_local_url('public');
     $this->elementStart('a', array('class' => 'url home bookmark', 'href' => $url));
     $this->element('img', array('class' => 'logo photo', 'src' => common_config('site', 'logo') ? common_config('site', 'logo') : Theme::path('logo.png'), 'alt' => common_config('site', 'name')));
     $this->text(' ');
     //$this->element ( 'span', array ('class' => 'fn org' ), common_config ( 'site', 'name' ) );
     $this->elementEnd('a');
     $this->elementEnd('address');
 }
开发者ID:himmelex,项目名称:NTW,代码行数:16,代码来源:action.php

示例10: showLogo

 /**
  * Show configured logo.
  *
  * @return nothing
  */
 function showLogo()
 {
     $this->elementStart('address', array('id' => 'site_contact', 'class' => 'vcard'));
     if (Event::handle('StartAddressData', array($this))) {
         if (common_config('singleuser', 'enabled')) {
             $url = common_local_url('showstream', array('nickname' => common_config('singleuser', 'nickname')));
         } else {
             $url = common_local_url('public');
         }
         $this->elementStart('a', array('class' => 'url home bookmark', 'href' => $url));
         if (common_config('site', 'logo') || file_exists(Theme::file('logo.png'))) {
             $this->element('img', array('class' => 'logo photo', 'src' => common_config('site', 'logo') ? common_config('site', 'logo') : Theme::path('logo.png'), 'alt' => common_config('site', 'name')));
         }
         $this->text(' ');
         $this->element('span', array('class' => 'fn org'), common_config('site', 'name'));
         $this->elementEnd('a');
         Event::handle('EndAddressData', array($this));
     }
     $this->elementEnd('address');
 }
开发者ID:Br3nda,项目名称:StatusNet,代码行数:25,代码来源:action.php

示例11: showTimeline

 /**
  * Show the timeline of notices
  *
  * @return void
  */
 function showTimeline()
 {
     $nonapi_action = substr($this->action, strlen('apitimeline'));
     // Just so we don't need to set this explicitly
     $sitelogo = common_config('site', 'logo') ? common_config('site', 'logo') : Theme::path('logo.png');
     $title = $this->title();
     $taguribase = TagURI::base();
     $id = "tag:{$taguribase}:" . ucfirst($nonapi_action) . 'Timeline';
     // Public or Networkpublic probably
     $link = common_local_url($nonapi_action);
     $self = $this->getSelfUri();
     // TRANS: Subtitle for site timeline. %s is the GNU social sitename.
     $subtitle = sprintf(_("%s updates from everyone!"), common_config('site', 'name'));
     switch ($this->format) {
         case 'xml':
             $this->showXmlTimeline($this->notices);
             break;
         case 'rss':
             $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $sitelogo, $self);
             break;
         case 'atom':
             header('Content-Type: application/atom+xml; charset=utf-8');
             $atom = new AtomNoticeFeed($this->auth_user);
             $atom->setId($id);
             $atom->setTitle($title);
             $atom->setSubtitle($subtitle);
             $atom->setLogo($sitelogo);
             $atom->setUpdated('now');
             $atom->addLink(common_local_url($nonapi_action));
             $atom->setSelfLink($self);
             $atom->addEntryFromNotices($this->notices);
             $this->raw($atom->getString());
             break;
         case 'json':
             $this->showJsonTimeline($this->notices);
             break;
         case 'as':
             header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
             $doc = new ActivityStreamJSONDocument($this->auth_user);
             $doc->setTitle($title);
             $doc->addLink($link, 'alternate', 'text/html');
             $doc->addItemsFromNotices($this->notices);
             $this->raw($doc->asString());
             break;
         default:
             // TRANS: Client error displayed when coming across a non-supported API method.
             $this->clientError(_('API method not found.'), $code = 404);
             break;
     }
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:55,代码来源:apitimelinepublic.php

示例12: public_path

|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
/*
|--------------------------------------------------------------------------
| Load theme view path to namespace
|--------------------------------------------------------------------------
|
| Here you can add view's name space to currently used theme.
|
*/
View::addNamespace('Admin', public_path() . '/' . Theme::path(Config::get('lavalite.admin.theme')));
View::addNamespace('Public', public_path() . '/' . Theme::path(Config::get('lavalite.public.theme')));
require app_path() . '/filters.php';
开发者ID:nunodotferreira,项目名称:cms-1,代码行数:31,代码来源:global.php

示例13: showTimeline

 /**
  * Show the timeline of notices
  *
  * @return void
  */
 function showTimeline()
 {
     $sitename = common_config('site', 'name');
     $sitelogo = common_config('site', 'logo') ? common_config('site', 'logo') : Theme::path('logo.png');
     $title = sprintf(_("Notices tagged with %s"), $this->tag);
     $subtitle = sprintf(_('Updates tagged with %1$s on %2$s!'), $this->tag, $sitename);
     $taguribase = TagURI::base();
     $id = "tag:{$taguribase}:TagTimeline:" . $tag;
     $link = common_local_url('tag', array('tag' => $this->tag));
     $self = $this->getSelfUri();
     common_debug("self link is: {$self}");
     switch ($this->format) {
         case 'xml':
             $this->showXmlTimeline($this->notices);
             break;
         case 'rss':
             $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $sitelogo, $self);
             break;
         case 'atom':
             header('Content-Type: application/atom+xml; charset=utf-8');
             $atom = new AtomNoticeFeed($this->auth_user);
             $atom->setId($id);
             $atom->setTitle($title);
             $atom->setSubtitle($subtitle);
             $atom->setLogo($logo);
             $atom->setUpdated('now');
             $atom->addLink($link);
             $atom->setSelfLink($self);
             $atom->addEntryFromNotices($this->notices);
             $this->raw($atom->getString());
             break;
         case 'json':
             $this->showJsonTimeline($this->notices);
             break;
         default:
             $this->clientError(_('API method not found.'), $code = 404);
             break;
     }
 }
开发者ID:Br3nda,项目名称:StatusNet,代码行数:44,代码来源:apitimelinetag.php

示例14: showLogo

 /**
  * Show configured logo.
  *
  * @return nothing
  */
 function showLogo()
 {
     $this->elementStart('address', array('id' => 'site_contact', 'class' => 'vcard'));
     if (Event::handle('StartAddressData', array($this))) {
         if (common_config('singleuser', 'enabled')) {
             $user = User::singleUser();
             $url = common_local_url('showstream', array('nickname' => $user->nickname));
         } else {
             $url = common_local_url('public');
         }
         $this->elementStart('a', array('class' => 'url home bookmark', 'href' => $url));
         if (StatusNet::isHTTPS()) {
             $logoUrl = common_config('site', 'ssllogo');
             if (empty($logoUrl)) {
                 // if logo is an uploaded file, try to fall back to HTTPS file URL
                 $httpUrl = common_config('site', 'logo');
                 if (!empty($httpUrl)) {
                     $f = File::staticGet('url', $httpUrl);
                     if (!empty($f) && !empty($f->filename)) {
                         // this will handle the HTTPS case
                         $logoUrl = File::url($f->filename);
                     }
                 }
             }
         } else {
             $logoUrl = common_config('site', 'logo');
         }
         if (empty($logoUrl) && file_exists(Theme::file('logo.png'))) {
             // This should handle the HTTPS case internally
             $logoUrl = Theme::path('logo.png');
         }
         if (!empty($logoUrl)) {
             $this->element('img', array('class' => 'logo photo', 'src' => $logoUrl, 'alt' => common_config('site', 'name')));
         }
         $this->text(' ');
         $this->element('span', array('class' => 'fn org'), common_config('site', 'name'));
         $this->elementEnd('a');
         Event::handle('EndAddressData', array($this));
     }
     $this->elementEnd('address');
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:46,代码来源:action.php

示例15: showTimeline

 /**
  * Show the timeline of notices
  *
  * @return void
  */
 function showTimeline()
 {
     $sitename = common_config('site', 'name');
     $sitelogo = common_config('site', 'logo') ? common_config('site', 'logo') : Theme::path('logo.png');
     $title = sprintf(_("%s public timeline"), $sitename);
     $taguribase = TagURI::base();
     $id = "tag:{$taguribase}:PublicTimeline";
     $link = common_local_url('public');
     $self = $this->getSelfUri();
     $subtitle = sprintf(_("%s updates from everyone!"), $sitename);
     switch ($this->format) {
         case 'xml':
             $this->showXmlTimeline($this->notices);
             break;
         case 'rss':
             $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $sitelogo, $self);
             break;
         case 'atom':
             header('Content-Type: application/atom+xml; charset=utf-8');
             $atom = new AtomNoticeFeed($this->auth_user);
             $atom->setId($id);
             $atom->setTitle($title);
             $atom->setSubtitle($subtitle);
             $atom->setLogo($sitelogo);
             $atom->setUpdated('now');
             $atom->addLink(common_local_url('public'));
             $atom->setSelfLink($self);
             $atom->addEntryFromNotices($this->notices);
             $this->raw($atom->getString());
             break;
         case 'json':
             $this->showJsonTimeline($this->notices);
             break;
         default:
             $this->clientError(_('API method not found.'), $code = 404);
             break;
     }
 }
开发者ID:Br3nda,项目名称:StatusNet,代码行数:43,代码来源:apitimelinepublic.php


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