MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
theme.class
Ir para a documentação deste ficheiro.
1<?php
58class Theme extends MTheme
59{
60 public function __construct()
61 {
62 parent::__construct('sjoomla');
63 }
64
65 public function Init()
66 {
67 $ui = $this->manager->GetUI();
68 $logo = '
69 <table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody>
70 <tr>
71 <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>
72 </td>
73 </tr>
74 </table>
75 ';
76
77 $top = new MDiv('', $logo, 'logo');
78 $top->width = "100%";
79
80 $this->SetElement('top', $top, 'm-container-top');
81 // navigation
82 $this->SetElement('navigation', new MNavigationBar(), 'm-container-topmenu');
83 }
84
85 public function Generate()
86 {
87 $method = "Generate" . $this->layout;
88 return $this->$method();
89 }
90
91 public function GenerateDefault()
92 {
93 $html = '<div id="divSaguMessages" style="display: none;">';
94 $html .= ' <div id="divSaguMessagesContent"></div>';
95 $html .= '</div>';
96 $html .= '<script language="javascript">
97 function hideLoadingDiv()
98 {
99 var bg = document.getElementById(\'m-loading-message-bg\');
100 var fg = document.getElementById(\'m-loading-message\');
101
102 if ( bg != null )
103 {
104 bg.style.display = \'none\';
105 }
106
107 if ( fg != null )
108 {
109 fg.style.display = \'none\';
110 }
111 }
112 </script>
113 <div id="m-loading-message-bg" onclick="javascript:hideLoadingDiv()"></div>
114 <div id="m-loading-message" onclick="javascript:hideLoadingDiv()">
115 <div id="m-loading-message-image">
116 <div id="m-loading-message-text">' . _M('Carregando', 'sagu2') . '...</div>
117 </div>
118 </div>';
119
120 $this->SetElementId('toolbar', 'm-toolbar');
121 $html .= $this->GenerateElement('toolbar');
122
123 $html .= '<div id="extContent" style="overflow-y: auto;">';
124 $html .= $this->GenerateElement('content');
125 $html .= '</div>';
126
127 $html .= '<div id="extBottom" style="visibility: visible; position: fixed; bottom:0; width: 100%">';
128 $html .= $this->GenerateElement('bottom');
129 $html .= '</div>';
130
131 $html .= '
132<script type="text/javascript">
133function adjustContentHeight()
134{
135var height = document.documentElement.clientHeight
136
137var elems = new Array("m-container-top", "div-dhtml-menu2", "m-container-module2", "m-toolbar", "m-container-bottom");
138
139for ( var i=0; i<elems.length; i++ )
140{
141 var e = document.getElementById(elems[i]);
142 if ( e != null )
143 {
144 height -= e.offsetHeight;
145 }
146}
147height -= 30; // ajuste - margem de segurança
148
149document.getElementById("extContent").style.height = height + "px";
150}
151document.getElementsByTagName("body")[0].setAttribute("onresize", "adjustContentHeight()");
152adjustContentHeight();
153
154// FIXME: nao funciona setar a largura da toolbar pelos metodos do miolo
155var toolbar = document.getElementById("m_toolBar");
156if ( toolbar != null )
157{
158toolbar.style.width = "100%";
159}
160</script>
161';
162
163 return $this->painter->div(new Div('m-container', $html));
164 }
165
166 public function GenerateLookup()
167 {
168 $html = $this->GenerateElement('content');
169 $div = new Div('', $html, 'm-container');
170 $div->AddStyle('width', '100%');
171 return $this->painter->GenerateToString($div);
172 }
173
174 public function GenerateHtmlArea()
175 {
176 // content
177 $this->SetElementId('content', 'm-htmlarea');
178 $html .= $this->GenerateElement('content');
179 return $this->painter->div(new Div('m-container', $html));
180 }
181
182 public function GeneratePopup()
183 {
184 $html = $this->GenerateElement('content');
185 $div = new Div('', $html, 'm-container');
186 $div->AddStyle('width', '100%');
187 return $this->painter->GenerateToString($div);
188 }
189
190 public function GeneratePrint()
191 {
192 $this->GenerateDefault();
193 }
194}
195?>
Definição mtheme.class:3
$layout
Definição mtheme.class:5
Definição theme.class:61
__construct()
Definição theme.class:60
GenerateDefault()
Definição theme.class:91
Generate()
Definição theme.class:85
GenerateLookup()
Definição theme.class:166
GenerateHtmlArea()
Definição theme.class:174
GeneratePrint()
Definição theme.class:190
Init()
Definição theme.class:65
GeneratePopup()
Definição theme.class:182