/usr/local/miolo2/classes/ui/themes/miolo2/theme.class

Go to the documentation of this file.
00001 <?php
00002     class Theme extends MTheme
00003     {
00004         function __construct()
00005         {
00006             parent::__construct('miolo2');
00007         }
00008 
00009         function Init()
00010         {
00011             $ui = $this->manager->getUI();
00012             $logo = $ui->getImageTheme($this->id, 'banner_miolo.png');
00013             $img = new MImageButton('', 'Home', $this->manager->getConf('home.url'), $logo);
00014             $img->image->addAttribute('width', '750px');            
00015             $img->image->addAttribute('height', '60px');
00016 
00017             $top = array
00018                 (
00019                 new Div('', $img, 'logo'),
00020                 );
00021 
00022             $this->setElement('top', $top, 'm-container-top');
00023             $this->setElement('navigation', new MNavigationBar(), 'm-container-topmenu');
00024         }
00025 
00026         function generate()
00027         {
00028             $method = "Generate" . $this->layout;
00029             return $this->$method();
00030         }
00031 
00032         function generateDefault()
00033         {
00034             // bottom
00035             $this->setElement('bottom', new MStatusBar(), 'm-container-bottom');
00036             
00037             // menus        
00038             if ( $this->manager->getConf('options.mainmenu') == 2 )
00039             {
00040                 $idModule = 'm-container-module';
00041                 $idMenu = 'm-container-dhtmlmenu';
00042             }
00043             else if ( $this->manager->GetConf('options.mainmenu') == 3 )
00044             {
00045                 $idModule = 'm-container-module2';
00046                 $needTable = true;
00047             }
00048             else
00049             {
00050                 $idMenu = 'm-container-menu';
00051             }
00052 
00053             // module
00054             $this->SetElementId('module', $idModule);
00055 
00056             $this->SetElementId('menus', $idMenu);
00057 
00058             // content
00059             $idContent = ( ($this->manager->GetConf('options.mainmenu') == 2) || ($this->manager->GetConf('options.mainmenu') == 3) )
00060                        ? 'm-container-content-full' : 'm-container-content';
00061             $this->SetElementId('content', $idContent);
00062 
00063             $html = $this->GenerateElement('top');
00064 
00065             $html .= '<div id="m-loading-message-bg"></div><div id="m-loading-message"><div id="m-loading-message-image"><div id="m-loading-message-text">' . _M('Loading') . '...</div></div></div>';
00066 
00067             if ($this->HasMenuOptions())
00068             {
00069                 $html .= ($needTable == true) ? '<div><table id="m-container-dhtmlmenu2" collspacing=0 cellpadding=0 cellspacing=1 border=0><tr>' : '';
00070                 $html .= $this->GenerateElement('menus');
00071                 $html .= ($needTable == true) ? '</tr></table></div>' : '';
00072             }
00073 
00074                 $html .= $this->GenerateElement('module');
00075 
00076             if ($this->GetElement('navigation')->HasOptions())
00077             {
00078                 $html .= $this->GenerateElement('navigation');
00079             }
00080 
00081             $html .= $this->GenerateElement('content');
00082             $html .= $this->GenerateElement('bottom');
00083             return $this->painter->div(new Div('m-container', $html));
00084         }
00085 
00086         function GenerateLookup()
00087         {
00088             $html = $this->GenerateElement('content');
00089             $div = new MDiv('', $html, 'm-container');
00090             $div->AddStyle('width', '100%');
00091             return $this->painter->GenerateToString($div);
00092         }
00093 
00094         function GenerateHtmlArea()
00095         {
00096             // module
00097             $this->SetElementId('module', 'm-container-module');
00098             // content
00099             $this->SetElementId('content', 'm-htmlarea');
00100             // bottom
00101             $this->SetElement('bottom', new StatusBar(), 'm-container-bottom');
00102 
00103             $html = $this->GenerateElement('top');
00104 
00105             if ($this->GetElement('module') != NULL)
00106             {
00107                 $html .= $this->GenerateElement('module');
00108             }
00109 
00110             if ($this->GetElement('navigation')->HasOptions())
00111             {
00112                 $html .= $this->GenerateElement('navigation');
00113             }
00114 
00115             $html .= $this->GenerateElement('content');
00116             $html .= $this->GenerateElement('bottom');
00117             return $this->painter->div(new Div('m-container', $html));
00118         }
00119 
00120         function GeneratePopup()
00121         {
00122             $html = $this->GenerateElement('content');
00123             $div = new MDiv('', $html, 'm-container');
00124             $div->AddStyle('width', '100%');
00125             return $this->painter->GenerateToString($div);
00126         }
00127 
00128         function GeneratePrint()
00129         {
00130             $this->GenerateDefault();
00131         }
00132     }
00133 ?>
CopyLeft (L) 2001-2006 - [MIOLO Development Team] SOLIS - Cooperativa de Soluções Livres - Lajeado/RS - Brasil