當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Theme::file方法代碼示例

本文整理匯總了PHP中Theme::file方法的典型用法代碼示例。如果您正苦於以下問題:PHP Theme::file方法的具體用法?PHP Theme::file怎麽用?PHP Theme::file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Theme的用法示例。


在下文中一共展示了Theme::file方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: _showLogo

 function _showLogo($action)
 {
     $action->elementStart('address', 'vcard');
     $action->elementStart('a', array('class' => 'url home bookmark', 'href' => common_local_url('public')));
     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:himmelex,項目名稱:NTW,代碼行數:11,代碼來源:MobileProfilePlugin.php

示例3: _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

示例4: 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

示例5: 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


注:本文中的Theme::file方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。