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