/** * 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'); }
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'); }
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'); }
/** * 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'); }
/** * 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)); } }