Changeset 1364

Show
Ignore:
Timestamp:
08/31/08 20:44:30 (5 years ago)
Author:
networkfusion
Message:
  • Created ability to have a themes setting file to define

commonly asked for features.

  • Created a new "Network Theme Pack" to show off the settings

file and improve the user experience.

Location:
trunk/wifidog-auth
Files:
36 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/CHANGELOG

    r1363 r1364  
    11# $Id$ 
    222008-08-31 Robin Jones 
     3        * Created ability to have a themes setting file to define commonly asked for features. 
     4        * Created a new "Network Theme Pack" to show off the settings file and improve the user experience. 
     5 
     62008-08-31 Robin Jones 
    37        * Updated some table row elements to support Odd/Even CSS. This also closes #382 
    48 
     
    711 
    8122008-08-13 Robin Jones 
    9         * Fixed dependancy change for Smarty reported by cristian@lalineapeluda.com 
     13        * Fixed dependency change for Smarty reported by cristian@lalineapeluda.com 
    1014 
    11152008-08-07 Benoit Grégoire  <bock@step.polymtl.ca> 
    12         * Updated spanish translation by jlms77@gmail.com 
     16        * Updated Spanish translation by jlms77@gmail.com 
    1317 
    14182008-07-13 Benoit Grégoire  <bock@step.polymtl.ca> 
    15         * Add new catalan translation by Christian Lorenzo cristian@lalineapeluda.com 
     19        * Add new Catalan translation by Christian Lorenzo cristian@lalineapeluda.com 
    1620        * Rebuild transaltions and initial schema. 
    1721 
  • trunk/wifidog-auth/wifidog/classes/MainUI.php

    r1319 r1364  
    543543        $db = AbstractDb :: getObject(); 
    544544        // Init values 
    545         // Asign base CSS and theme pack CSS stylesheet 
     545        // Asign base CSS and theme pack CSS stylesheet and optional config 
     546        $networkThemePack = Network :: getCurrentNetwork()->getThemePack(); 
     547        if ($networkThemePack) {         
     548                $ThemeConfig = $networkThemePack->getThemeConfigPath(); 
     549        } 
     550        // Checks to see if the theme file exists and if so, loads it.   
     551        if (!empty($ThemeConfig) && file_exists($ThemeConfig)) { 
     552                require_once ($ThemeConfig); 
     553        } 
     554        // Checks to see if the theme file exists and if so, checks whether it should load the Base theme. 
     555        if (!defined('INHERIT_BASE_CSS') || defined('INHERIT_BASE_CSS' == true)) { 
    546556        $this->appendStylesheetURL(BASE_THEME_URL . STYLESHEET_NAME); 
    547                 $this->appendStylesheetURL(BASE_THEME_URL . PRINT_STYLESHEET_NAME, 'print'); 
    548         $networkThemePack = Network :: getCurrentNetwork()->getThemePack(); 
     557        $this->appendStylesheetURL(BASE_THEME_URL . PRINT_STYLESHEET_NAME, 'print'); 
     558        } 
     559        //If there is a theme pack, load the CSS file 
    549560        if ($networkThemePack) { 
    550             $this->appendStylesheetURL($networkThemePack->getStylesheetUrl()); 
    551         } 
     561            $this->appendStylesheetURL($networkThemePack->getStylesheetUrl()); 
     562        } 
     563        // Checks to see if the theme file exists and if so, checks whether it should always show the page header. 
     564        if (defined('ALWAYS_SHOW_HEADER') && ALWAYS_SHOW_HEADER == true) { 
     565        $this->smarty->assign('alwaysShowHeader', true); 
     566        } else { 
     567                $this->smarty->assign('alwaysShowHeader', false); 
     568        } 
     569        // Checks to see if the theme file exists and if so, checks whether it should always show the page footer. 
     570        if (defined('ALWAYS_SHOW_FOOTER') && (ALWAYS_SHOW_FOOTER == true)) { 
     571                $this->smarty->assign('alwaysShowFooter', true); 
     572        } else { 
     573                $this->smarty->assign('alwaysShowFooter', false); 
     574        } 
     575        // Checks to see if the theme file exists and if so, checks where the site menu should be positioned. 
     576        if (defined('MENU_POSITION') && MENU_POSITION == "all") { 
     577        $this->smarty->assign('siteMenuPlaceAll', true); 
     578        } else { 
     579                if (defined('MENU_POSITION') && MENU_POSITION == "left") { 
     580                        $this->smarty->assign('siteMenuPlaceLeft', true); 
     581                } else { 
     582                        $this->smarty->assign('siteMenuPlaceMain', true); 
     583                        } 
     584                } 
     585 
    552586 
    553587        //Handle content (must be done before headers and anything else is handled) 
  • trunk/wifidog-auth/wifidog/classes/ThemePack.php

    r1147 r1364  
    206206    } 
    207207 
     208    /** 
     209     * Retreives the url of this theme's config file (if exists 
     210     * 
     211     * @return string URL of this theme's config 
     212     */ 
     213    public function getThemeConfigPath() { 
     214        return WIFIDOG_ABS_FILE_PATH . NETWORK_THEME_PACKS_DIR . $this->_id . '/themeconfig.php'; 
     215    } 
     216 
     217 
    208218} 
    209219 
  • trunk/wifidog-auth/wifidog/media/network_theme_packs/README.txt

    r1031 r1364  
    66|- stylesheet.css       Mandatory:  the stylesheet used by the theme, will be applied after the stylesheet in base_theme 
    77|- images/              Images used by this theme's stylesheet 
    8  
     8|- themeconfig.php      The content of this file is optional, but can define the menu position, CSS inheritence and header/footer values. 
    99Important note:  The encoding for name.txt and description.txt is assumed to be UTF-8 
  • trunk/wifidog-auth/wifidog/templates/classes/MainUI_Display.tpl

    r1323 r1364  
    6262    </head> 
    6363    <body id='page' class='{$page_name}'> 
    64         {if !empty($contentDisplayArray.page_header) || $debugRequested} 
     64    <div id="wrap"> 
     65        {if !empty($contentDisplayArray.page_header) || $debugRequested || $alwaysShowHeader} 
    6566                <div id='page_header'> 
    6667            {if $debugRequested} 
     
    7374        {/if} 
    7475        <div id="page_body"> 
     76                  {if !empty($siteMenu) && $siteMenuPlaceAll} 
     77                        <div id="site_menu"> 
     78                            {$siteMenu} 
     79                        </div> 
     80                  {/if} 
     81        <div id="content-wrap"> 
    7582        {if !empty($contentDisplayArray.left_area_top) ||  !empty($contentDisplayArray.left_area_middle) ||  !empty($contentDisplayArray.left_area_middle)} 
    7683                <div id="left_area"> 
    77                         {if !empty($contentDisplayArray.left_area_top)} 
     84                        {if !empty($contentDisplayArray.left_area_top)  || (!empty($siteMenu) && $siteMenuPlaceLeft)} 
    7885                        <div id="left_area_top"> 
    79                             {$contentDisplayArray.left_area_top} 
     86                    {if !empty($siteMenu) && $siteMenuPlaceLeft}                         
     87                    <div id="site_menu"> 
     88                            {$siteMenu} 
     89                        </div>    
     90                    {/if} 
     91                        {$contentDisplayArray.left_area_top} 
    8092                        </div> 
    8193                        {/if} 
     
    94106        {if !empty($contentDisplayArray.main_area_top) ||  !empty($contentDisplayArray.main_area_middle) ||  !empty($contentDisplayArray.main_area_middle)} 
    95107                <div id="main_area"> 
    96                         {if !empty($contentDisplayArray.main_area_top) || !empty($siteMenu)} 
     108                        {if !empty($contentDisplayArray.main_area_top) || (!empty($siteMenu) && $siteMenuPlaceMain)} 
    97109                        <div id="main_area_top"> 
     110                    {if !empty($siteMenu) && $siteMenuPlaceMain}                         
     111                    <div id="site_menu"> 
    98112                            {$siteMenu} 
     113                        </div> 
     114                        {/if} 
    99115                        {$contentDisplayArray.main_area_top} 
    100116                        </div> 
     
    132148        {/if} 
    133149        </div> 
    134     {if !empty($contentDisplayArray.page_footer)} 
     150    </div> 
     151    {if !empty($contentDisplayArray.page_footer) || $alwaysShowFooter} 
    135152        <div id='page_footer'> 
    136153                        {$contentDisplayArray.page_footer} 
     
    141158          {$currScript} 
    142159        {/foreach} 
     160    </div> 
    143161    </body> 
    144162</html>