diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2017-10-24 20:44:25 +0200 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2017-10-24 20:44:25 +0200 |
commit | 39055c919cb7352c3d3ea4ba5cabee55347977e2 (patch) | |
tree | 9096f3f1ec10f936faf7a3fc9119cfd116e92355 /Zotlabs | |
parent | 280baf7c828e967ed563752b899f97424f1e1da0 (diff) | |
parent | 325cbfcdb37912515cb1b30484896b049ab68f2a (diff) | |
download | volse-hubzilla-39055c919cb7352c3d3ea4ba5cabee55347977e2.tar.gz volse-hubzilla-39055c919cb7352c3d3ea4ba5cabee55347977e2.tar.bz2 volse-hubzilla-39055c919cb7352c3d3ea4ba5cabee55347977e2.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Pubsites.php | 4 | ||||
-rw-r--r-- | Zotlabs/Render/Theme.php | 44 |
2 files changed, 29 insertions, 19 deletions
diff --git a/Zotlabs/Module/Pubsites.php b/Zotlabs/Module/Pubsites.php index ef02cf099..daec5dde3 100644 --- a/Zotlabs/Module/Pubsites.php +++ b/Zotlabs/Module/Pubsites.php @@ -30,7 +30,7 @@ class Pubsites extends \Zotlabs\Web\Controller { if($ret['success']) { $j = json_decode($ret['body'],true); if($j) { - $o .= '<table class="table table-striped table-hover"><tr><td>' . t('Hub URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td><td>' . t('Stats') . '</td><td>' . t('Software') . '</td>'; + $o .= '<table class="table table-striped table-hover"><tr><td>' . t('Hub URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td><!--td>' . t('Stats') . '</td--><td>' . t('Software') . '</td>'; if($rating_enabled) $o .= '<td colspan="2">' . t('Ratings') . '</td>'; $o .= '</tr>'; @@ -55,7 +55,7 @@ class Pubsites extends \Zotlabs\Web\Controller { $location = '<br /> '; } $urltext = str_replace(array('https://'), '', $jj['url']); - $o .= '<tr><td><a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url'] . '/register' ) . '" ><i class="fa fa-link"></i> ' . $urltext . '</a>' . $location . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td><td>' . '<a target="stats" href="https://hubchart-tarine.rhcloud.com/hub.jsp?hubFqdn=' . $m['host'] . '"><i class="fa fa-area-chart"></i></a></td><td>' . ucwords($jj['project']) . (($jj['version']) ? ' ' . $jj['version'] : '') . '</td>'; + $o .= '<tr><td><a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url'] . '/register' ) . '" ><i class="fa fa-link"></i> ' . $urltext . '</a>' . $location . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td><!--td>' . '<a target="stats" href="https://hubchart-tarine.rhcloud.com/hub.jsp?hubFqdn=' . $m['host'] . '"><i class="fa fa-area-chart"></i></a></td--><td>' . ucwords($jj['project']) . (($jj['version']) ? ' ' . $jj['version'] : '') . '</td>'; if($rating_enabled) $o .= '<td><a href="ratings/' . $host . '" class="btn-btn-default"><i class="fa fa-eye"></i> ' . t('View') . '</a></td>' . $rate_links ; $o .= '</tr>'; diff --git a/Zotlabs/Render/Theme.php b/Zotlabs/Render/Theme.php index 3a0116abe..09cc7a4d4 100644 --- a/Zotlabs/Render/Theme.php +++ b/Zotlabs/Render/Theme.php @@ -2,6 +2,8 @@ namespace Zotlabs\Render; +use App; + class Theme { @@ -11,17 +13,28 @@ class Theme { static $session_theme = null; static $session_mobile_theme = null; - static $base_themes = array('redbasic'); + /** + * @brief Array with base or fallback themes. + */ + static $base_themes = array('redbasic'); + + /** + * @brief Figure out the best matching theme and return it. + * + * The theme will depend on channel settings, mobile, session, core compatibility, etc. + * + * @return array + */ static public function current(){ - self::$system_theme = ((isset(\App::$config['system']['theme'])) + self::$system_theme = ((isset(\App::$config['system']['theme'])) ? \App::$config['system']['theme'] : ''); - self::$session_theme = ((isset($_SESSION) && x($_SESSION,'theme')) + self::$session_theme = ((isset($_SESSION) && x($_SESSION, 'theme')) ? $_SESSION['theme'] : self::$system_theme); - self::$system_mobile_theme = ((isset(\App::$config['system']['mobile_theme'])) + self::$system_mobile_theme = ((isset(\App::$config['system']['mobile_theme'])) ? \App::$config['system']['mobile_theme'] : ''); - self::$session_mobile_theme = ((isset($_SESSION) && x($_SESSION,'mobile_theme')) + self::$session_mobile_theme = ((isset($_SESSION) && x($_SESSION, 'mobile_theme')) ? $_SESSION['mobile_theme'] : self::$system_mobile_theme); $page_theme = null; @@ -66,7 +79,7 @@ class Theme { $chosen_theme = $page_theme; } } - if(array_key_exists('theme_preview',$_GET)) + if(array_key_exists('theme_preview', $_GET)) $chosen_theme = $_GET['theme_preview']; // Allow theme selection of the form 'theme_name:schema_name' @@ -91,14 +104,12 @@ class Theme { } // Worst case scenario, the default base theme or themes don't exist; perhaps somebody renamed it/them. - - // Find any theme at all and use it. - - $fallback = array_merge(glob('view/theme/*/css/style.css'),glob('view/theme/*/php/style.php')); - if(count($fallback)) - return(array(str_replace('view/theme/','', substr($fallback[0],0,-14)))); + // Find any theme at all and use it. + $fallback = array_merge(glob('view/theme/*/css/style.css'), glob('view/theme/*/php/style.php')); + if(count($fallback)) + return(array(str_replace('view/theme/', '', substr($fallback[0], 0, -14)))); } @@ -107,12 +118,11 @@ class Theme { * * Provide a sane default if nothing is chosen or the specified theme does not exist. * - * @param bool $installing default false + * @param bool $installing (optional) default false, if true return the name of the first base theme * * @return string */ - - function url($installing = false) { + static public function url($installing = false) { if($installing) return self::$base_themes[0]; @@ -125,9 +135,10 @@ class Theme { $opts = ''; $opts = ((\App::$profile_uid) ? '?f=&puid=' . \App::$profile_uid : ''); - $schema_str = ((x(\App::$layout,'schema')) ? '&schema=' . App::$layout['schema'] : ''); + $schema_str = ((x(\App::$layout,'schema')) ? '&schema=' . App::$layout['schema'] : ''); if(($s) && (! $schema_str)) $schema_str = '&schema=' . $s; + $opts .= $schema_str; if(file_exists('view/theme/' . $t . '/php/style.php')) @@ -139,7 +150,6 @@ class Theme { function debug() { logger('system_theme: ' . self::$system_theme); logger('session_theme: ' . self::$session_theme); - } } |