From a378d19d2ac09485c537328642731c033a5fe87f Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 9 Oct 2015 11:46:45 +0000 Subject: [PATCH] Some fixes for custom app-theme css: - Make sure including css on ajax response respect app-theme - Include app-theme for home portlets --- calendar/inc/class.calendar_favorite_portlet.inc.php | 4 +++- home/inc/class.home_favorite_portlet.inc.php | 3 ++- home/inc/class.home_link_portlet.inc.php | 3 ++- phpgwapi/inc/class.egw_framework.inc.php | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/calendar/inc/class.calendar_favorite_portlet.inc.php b/calendar/inc/class.calendar_favorite_portlet.inc.php index 1962822713..5fdabfdad2 100644 --- a/calendar/inc/class.calendar_favorite_portlet.inc.php +++ b/calendar/inc/class.calendar_favorite_portlet.inc.php @@ -59,7 +59,9 @@ class calendar_favorite_portlet extends home_favorite_portlet { // Always load app's css - egw_framework::includeCSS('calendar','app'); + egw_framework::includeCSS('calendar', 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) || + egw_framework::includeCSS('calendar','app'); + if($this->favorite['state']['view'] == 'listview' || is_array($this->favorite) && !$this->favorite['state']['view']) { $ui = new calendar_uilist(); diff --git a/home/inc/class.home_favorite_portlet.inc.php b/home/inc/class.home_favorite_portlet.inc.php index 73d7d3e894..76d721e2aa 100644 --- a/home/inc/class.home_favorite_portlet.inc.php +++ b/home/inc/class.home_favorite_portlet.inc.php @@ -121,7 +121,8 @@ class home_favorite_portlet extends home_portlet // Always load app's css - egw_framework::includeCSS($this->context['appname'],'app'); + egw_framework::includeCSS($this->context['appname'], 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) || + egw_framework::includeCSS($this->context['appname'],'app'); // Always load app's javascript, so most actions have a chance of working egw_framework::validate_file('','app',$this->context['appname']); diff --git a/home/inc/class.home_link_portlet.inc.php b/home/inc/class.home_link_portlet.inc.php index 42cf9fc1c0..94491cc4c5 100644 --- a/home/inc/class.home_link_portlet.inc.php +++ b/home/inc/class.home_link_portlet.inc.php @@ -117,7 +117,8 @@ class home_link_portlet extends home_portlet { // Always load app's css - egw_framework::includeCSS($this->context['entry']['app'],'app'); + egw_framework::includeCSS($this->context['entry']['app'], 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) || + egw_framework::includeCSS($this->context['entry']['app'],'app'); try { diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index 2e9c40a5d3..a46d3d7f2c 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -2276,7 +2276,8 @@ abstract class egw_framework $app = $GLOBALS['egw_info']['flags']['currentapp']; // try to add app specific css file - self::includeCSS($app,'app'); + self::includeCSS($app, 'app-'.$GLOBALS['egw_info']['user']['preferences']['common']['theme']) || + self::includeCSS($app,'app'); // add all css files from egw_framework::includeCSS() $query = null;