phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgwapi/templates/verdilak head.inc.php head.tpl


From: Dave Hall
Subject: [Phpgroupware-cvs] phpgwapi/templates/verdilak head.inc.php head.tpl
Date: Tue, 19 Sep 2006 13:23:45 +0000

CVSROOT:        /cvsroot/phpgwapi
Module name:    phpgwapi
Changes by:     Dave Hall <skwashd>     06/09/19 13:23:45

Modified files:
        templates/verdilak: head.inc.php head.tpl 

Log message:
        fix css handling to match idots

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/templates/verdilak/head.inc.php?cvsroot=phpgwapi&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/templates/verdilak/head.tpl?cvsroot=phpgwapi&r1=1.13&r2=1.14

Patches:
Index: head.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/templates/verdilak/head.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- head.inc.php        5 Sep 2006 17:47:45 -0000       1.21
+++ head.inc.php        19 Sep 2006 13:23:45 -0000      1.22
@@ -5,38 +5,67 @@
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package phpgwapi
        * @subpackage gui
-       * @version $Id: head.inc.php,v 1.21 2006/09/05 17:47:45 sigurdne Exp $
+       * @version $Id: head.inc.php,v 1.22 2006/09/19 13:23:45 skwashd Exp $
        */
 
-       // css file handling
-       $css_file = PHPGW_SERVER_ROOT . 
'/phpgwapi/templates/verdilak/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css';
-       if (file_exists($css_file))
+       if ( !isset($GLOBALS['phpgw_info']['server']['site_title']) )
        {
-               $css_ref = $GLOBALS['phpgw_info']['server']['webserver_url'] . 
'/phpgwapi/templates/verdilak/css/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'].'.css';
+               $GLOBALS['phpgw_info']['server']['site_title'] = lang('please 
set a site name in admin &gt; siteconfig');
+       }
+       
+       $GLOBALS['phpgw']->template->set_root(PHPGW_TEMPLATE_DIR);
+       $GLOBALS['phpgw']->template->set_unknowns('remove');
+       $GLOBALS['phpgw']->template->set_file('head', 'head.tpl');
+       $GLOBALS['phpgw']->template->set_block('head', 'theme_stylesheet', 
'theme_stylesheets');
+
+       $app = $GLOBALS['phpgw_info']['flags']['currentapp'];
+       if ( ! (isset($GLOBALS['phpgw_info']['flags']['noframework']) && 
$GLOBALS['phpgw_info']['flags']['noframework']) )
+       {
+               $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/verdilak/css/base.css";
+               if(file_exists(PHPGW_SERVER_ROOT . 
'/phpgwapi/templates/verdilak/css/' . 
$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '.css'))
+               {
+                       $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/verdilak/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css";
        }
        else
        {
-               $css_ref = $GLOBALS['phpgw_info']['server']['webserver_url'] . 
'/phpgwapi/templates/verdilak/css/styles.css';
+                       $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/verdilak/css/styles.css";
+                       
$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = 'verdilak';
        }
 
+               if(file_exists(PHPGW_SERVER_ROOT . 
"/{$app}/templates/base/css/base.css"))
+               {
+                       $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/{$app}/templates/base/css/base.css";
+               }
+       
+               if(file_exists(PHPGW_SERVER_ROOT . 
"/{$app}/templates/verdilak/css/base.css"))
+               {
+                       $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/{$app}/templates/verdilak/css/base.css";
+               }
+       
+               if(file_exists(PHPGW_SERVER_ROOT . 
"/{$app}/templates/verdilak/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css"))
+               {
+                       $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/{$app}/templates/verdilak/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css";
+               }
+       
+               foreach ( $theme_styles as $style )
+               {
+                       $GLOBALS['phpgw']->template->set_var('theme_style', 
$style);
+                       $GLOBALS['phpgw']->template->parse('theme_stylesheets', 
'theme_stylesheet', true);
+               }
 
-       $app = $GLOBALS['phpgw_info']['flags']['currentapp'];
        $app = $app ? ' ['.(isset($GLOBALS['phpgw_info']['apps'][$app]) ? 
$GLOBALS['phpgw_info']['apps'][$app]['title'] : lang($app)).']':'';
 
-       $tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
-       $tpl->set_unknowns('remove');
-       $tpl->set_file(array('head' => 'head.tpl'));
-       $var = Array (
+               $GLOBALS['phpgw']->template->set_var(array
+               (
                'css'                   => $GLOBALS['phpgw']->common->get_css(),
+                       'javascript'    => 
$GLOBALS['phpgw']->common->get_javascript(),
                'img_icon'      => PHPGW_IMAGES_DIR . '/favicon.ico',
                'img_shortcut'  => PHPGW_IMAGES_DIR . '/favicon.ico',
-               'java_script'   => $GLOBALS['phpgw']->common->get_java_script(),
-               'str_base_url'  => $GLOBALS['phpgw']->link('/'),
-               'theme_css'     => $css_ref,
-               'website_title' => 
(isset($GLOBALS['phpgw_info']['server']['site_title'])?$GLOBALS['phpgw_info']['server']['site_title']
 . $app:''),
-               'win_on_events' => $GLOBALS['phpgw']->common->get_on_events()
-       );
-       $tpl->set_var($var);
-       $tpl->pfp('out','head');
-       unset($tpl);
+                       'str_base_url'  => $GLOBALS['phpgw']->link('/', 
array(), true),         
+                       'website_title' => 
$GLOBALS['phpgw_info']['server']['site_title'] . $app,
+                       'win_on_events' => 
$GLOBALS['phpgw']->common->get_on_events(),
+               ));
+       }
+       $GLOBALS['phpgw']->template->pfp('out','head');
 ?>
+

Index: head.tpl
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/templates/verdilak/head.tpl,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- head.tpl    16 Aug 2006 19:20:41 -0000      1.13
+++ head.tpl    19 Sep 2006 13:23:45 -0000      1.14
@@ -1,23 +1,25 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+       "http://www.w3.org/TR/html4/strict.dtd";>
 <!-- BEGIN head -->
 <html>
        <head>
-               <meta http-equiv="Content-Type" content="text/html; 
charset=utf-8" />
-               <meta name="AUTHOR" content="phpGroupWare 
http://www.phpgroupware.org"; />
-               <meta NAME="description" CONTENT="phpGroupWare" />
-               <meta NAME="keywords" CONTENT="phpGroupWare" />
-               <meta name="robots" content="none" />
-               <link rel="icon" href="{img_icon}" type="image/x-ico" />
-               <link rel="shortcut icon" href="{img_shortcut}" />
-               <link href="{theme_css}" type="text/css" rel="StyleSheet" />
+               <meta http-equiv="Content-Type" content="text/html; 
charset=utf-8">
+               <meta name="AUTHOR" content="phpGroupWare 
http://www.phpgroupware.org";>
+               <meta NAME="description" CONTENT="phpGroupWare">
+               <meta NAME="keywords" CONTENT="phpGroupWare">
+               <meta name="robots" content="none">
+               <link rel="icon" href="{img_icon}" type="image/x-ico">
+               <link rel="shortcut icon" href="{img_shortcut}">
+               <!-- BEGIN theme_stylesheet -->
+               <link href="{theme_style}" type="text/css" rel="StyleSheet">
+               <!-- END theme_stylesheet -->
+               {javascript}
                <script type="text/javascript">
                        <!--
                        var strBaseURL = '{str_base_url}';
                        {win_on_events}
                        -->
                </script>
-               {java_script}
                <title>{website_title}</title>
        </head>
        <body>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]