MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
theme.class
Ir para a documentação deste ficheiro.
1<?php
60 class Theme extends MTheme
61 {
62 public function __construct()
63 {
64 parent::__construct('sblue');
65 }
66
67 public function Init()
68 {
69 $ui = $this->manager->GetUI();
70 $logo = '
71 <table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody>
72 <tr>
73 <td bgcolor="#ffffff" background="' . $ui->GetImageTheme($this->id, 'banner_sagu2_inicio.png') . '" width="100%"><center><a href="index.php?module=sagu2&action=main"><img alt="Sagu 2" src="'.$ui->GetImageTheme($this->id, 'banner_sagu2_principal.png') . '" border="0"></a></center>
74 </td>
75 </tr>
76 </table>
77 ';
78
79 $top = new MDiv('', $logo, 'logo');
80 $top->width="100%";
81
82 $this->SetElement('top', $top, 'm-container-top');
83 // navigation
84 $this->SetElement('navigation', new MNavigationBar(), 'm-container-topmenu');
85 }
86
87 public function Generate()
88 {
89 $method = "Generate" . $this->layout;
90 return $this->$method();
91 }
92
93 public function GenerateDefault()
94 {
95 // bottom
96 $statusBar = new MStatusBar();
97 $statusBar->cols[3] = _M('Versão @1', 'sagu2', SAGU_VERSION);
98 $statusBar->cols[4] = array(
99 new MLabel(_M('Desenvolvido por', 'sagu2') . ':'),
100 new MOpenWindow('lnkSagu', _M('Equipe SOLIS', 'sagu2'), 'http://www.solis.coop.br')
101 );
102 $this->SetElement('bottom', $statusBar, 'm-container-bottom');
103
104 // menus
105 if ( $this->manager->GetConf('options.mainmenu') == 2 )
106 {
107 $idModule = 'm-container-module';
108 $idMenu = 'm-container-dhtmlmenu';
109 }
110 else if ( $this->manager->GetConf('options.mainmenu') == 3 )
111 {
112 $idModule = 'm-container-module2';
113 $needTable = true;
114 }
115 else
116 {
117 $idMenu = 'm-container-menu';
118 }
119
120 // module
121 $this->SetElementId('module', $idModule);
122
123 $this->SetElementId('menus', $idMenu);
124
125 // content
126 $idContent = ( ($this->manager->GetConf('options.mainmenu') == 2) || ($this->manager->GetConf('options.mainmenu') == 3) )
127 ? 'm-container-content-full' : 'm-container-content';
128 $this->SetElementId('content', $idContent);
129
130 $html = '<div id="divSaguMessages" style="display: none;">';
131 $html .= ' <div id="divSaguMessagesContent"></div>';
132 $html .= '</div>';
133
134 $html .= '<script language="javascript">
135 function hideLoadingDiv()
136 {
137 var bg = document.getElementById(\'m-loading-message-bg\');
138 var fg = document.getElementById(\'m-loading-message\');
139
140 if ( bg != null )
141 {
142 bg.style.display = \'none\';
143 }
144
145 if ( fg != null )
146 {
147 fg.style.display = \'none\';
148 }
149 }
150 </script>
151 <div id="m-loading-message-bg" onclick="javascript:hideLoadingDiv()"></div>
152 <div id="m-loading-message" onclick="javascript:hideLoadingDiv()">
153 <div id="m-loading-message-image">
154 <div id="m-loading-message-text">' . _M('Carregando', 'sagu2') . '...</div>
155 </div>
156 </div>';
157
158 $top = 120;
159 $html .= '<div id="extTop" style="position:fixed; width:100%; top:0; left:0; background-color:#F2F3FF; z-index:10; margin:0; padding:0;">';
160 $html .= $this->GenerateElement('top');
161
162 if ($this->HasMenuOptions())
163 {
164 $html .= ($needTable == true) ? '<div id="div-dhtml-menu2"><table id="m-container-dhtmlmenu2" collspacing=0 cellpadding=0 cellspacing=1 border=0><tr>' : '';
165 $html .= $this->GenerateElement('menus');
166 $html .= ($needTable == true) ? '</tr></table></div>' : '';
167 }
168
169 $html .= $this->GenerateElement('module');
170
171 if ($this->GetElement('navigation')->HasOptions())
172 {
173 $html .= $this->GenerateElement('navigation');
174 }
175
176 $this->SetElementId('toolbar', 'm-toolbar');
177 $html .= $tb = $this->GenerateElement('toolbar');
178 if ( !trim(strip_tags($tb)) )
179 {
180 $top -= 30;
181 }
182 $html .= '</div>';
183
184 $html .= '<div id="extContent" style="position:absolute; top: ' . $top . 'px; width:100%;">';
185 $html .= $this->GenerateElement('content');
186 $html .= '</div>';
187
188 $html .= '<div id="extBottom" style="visibility: visible; position: fixed; bottom:0; width: 100%">';
189 $html .= $this->GenerateElement('bottom');
190 $html .= '</div>';
191
192 return $this->painter->div(new Div('m-container', $html));
193 }
194
195 public function GenerateLookup()
196 {
197 $html = $this->GenerateElement('content');
198 $div = new Div('', $html, 'm-container');
199 $div->AddStyle('width', '100%');
200 return $this->painter->GenerateToString($div);
201 }
202
203 public function GenerateHtmlArea()
204 {
205 // module
206 $this->SetElementId('module', 'm-container-module');
207 // content
208 $this->SetElementId('content', 'm-htmlarea');
209 // bottom
210 $this->SetElement('bottom', new StatusBar(), 'm-container-bottom');
211
212 $html = $this->GenerateElement('top');
213
214 if ($this->GetElement('module') != NULL)
215 {
216 $html .= $this->GenerateElement('module');
217 }
218
219 if ($this->GetElement('navigation')->HasOptions())
220 {
221 $html .= $this->GenerateElement('navigation');
222 }
223
224 $html .= $this->GenerateElement('content');
225 $html .= $this->GenerateElement('bottom');
226 return $this->painter->div(new Div('m-container', $html));
227 }
228
229 public function GeneratePopup()
230 {
231 $html = $this->GenerateElement('content');
232 $div = new Div('', $html, 'm-container');
233 $div->AddStyle('width', '100%');
234 return $this->painter->GenerateToString($div);
235 }
236
237 public function GeneratePrint()
238 {
239 $this->GenerateDefault();
240 }
241 }
242?>
Definição mtheme.class:3
$layout
Definição mtheme.class:5
Definição theme.class:61
__construct()
Definição theme.class:62
GenerateDefault()
Definição theme.class:93
Generate()
Definição theme.class:87
GenerateLookup()
Definição theme.class:195
GenerateHtmlArea()
Definição theme.class:203
GeneratePrint()
Definição theme.class:237
Init()
Definição theme.class:67
GeneratePopup()
Definição theme.class:229