theme name cleanup - rename default to loozah, provide sane fallbacks and change system primary theme.
Provide indication on contact edit page of last update success/failure - can be extended later to show actual timestamp of last successful update.
This commit is contained in:
parent
8e988341d0
commit
147d7f3bbf
23 changed files with 107 additions and 26 deletions
32
boot.php
32
boot.php
|
@ -2,7 +2,7 @@
|
|||
|
||||
set_time_limit(0);
|
||||
|
||||
define ( 'BUILD_ID', 1035 );
|
||||
define ( 'BUILD_ID', 1036 );
|
||||
define ( 'FRIENDIKA_VERSION', '2.10.0905' );
|
||||
define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
|
||||
|
||||
|
@ -2275,3 +2275,33 @@ function proc_run($cmd){
|
|||
proc_close(proc_open($cmdline." &",array(),$foo));
|
||||
}}
|
||||
|
||||
/*
|
||||
* Return full URL to theme which is currently in effect.
|
||||
* Provide a sane default if nothing is chosen or the specified theme does not exist.
|
||||
*/
|
||||
|
||||
if(! function_exists('current_theme_url')) {
|
||||
function current_theme_url() {
|
||||
|
||||
$app_base_themes = array('duepuntozero', 'loozah');
|
||||
|
||||
$a = get_app();
|
||||
|
||||
$system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : '');
|
||||
$theme_name = ((x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme);
|
||||
|
||||
if($theme_name && file_exists('view/theme/' . $theme_name . '/style.css'))
|
||||
return($a->get_baseurl() . '/view/theme/' . $theme_name . '/style.css');
|
||||
|
||||
foreach($app_base_themes as $t) {
|
||||
if(file_exists('view/theme/' . $t . '/style.css'))
|
||||
return($a->get_baseurl() . '/view/theme/' . $t . '/style.css');
|
||||
}
|
||||
|
||||
$fallback = glob('view/theme/*/style.css');
|
||||
if(count($fallback))
|
||||
return($a->get_baseurl() . $fallback[0]);
|
||||
|
||||
|
||||
}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue