本文整理汇总了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');
}
示例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');
}
示例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');
}
示例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');
}
示例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));
}
}