Commit fb599b96ffd269c06493c242400bfabbbed4f647

Authored by Tiago
1 parent 55a017ce
Exists in master

new submenu of modules

css/main.css
... ... @@ -381,12 +381,14 @@ select
381 381 position: relative;
382 382 z-index: 1000;
383 383 margin-right: 100px;
  384 +
384 385 }
385 386  
386 387 .navmenu li {
387 388 margin: 0;
388 389 padding: 0;
389 390 display: inline-block;
  391 +
390 392 }
391 393  
392 394 .navmenu ul {
... ... @@ -406,6 +408,7 @@ select
406 408 content: ".";
407 409 height: 0;
408 410 visibility: hidden;
  411 +
409 412 }
410 413  
411 414 .navmenu ul li {
... ... @@ -413,14 +416,17 @@ select
413 416 float: left; /*For IE 7 lack of compliance*/
414 417 display: block !important;
415 418 display: inline; /*For IE*/
  419 +
416 420 }
417 421  
418 422 .navmenu li:first-child a {
419 423 border-left: none;
  424 +
420 425 }
421 426  
422 427 .navmenu li:first-child a:hover {
423 428 border-left: none;
  429 +
424 430 }
425 431  
426 432 .navmenu li:last-child a {
... ... @@ -440,6 +446,7 @@ select
440 446 height: 1%; /*For IE*/
441 447 height: 32px;
442 448 line-height: 32px;
  449 +
443 450 }
444 451  
445 452 /* Root Menu Hover Persistence */
... ... @@ -462,6 +469,7 @@ select
462 469 border: 1px solid #FFF;
463 470 border-left: 1px solid #ccc;
464 471 z-index: 2;
  472 +
465 473 }
466 474  
467 475 /* 2nd Menu Hover Persistence */
... ... @@ -479,6 +487,7 @@ select
479 487 .navmenu li.iehover li.iehover li a {
480 488 background: #EEE;
481 489 color: #666;
  490 +
482 491 }
483 492  
484 493 /* 3rd Menu Hover Persistence */
... ... @@ -488,6 +497,7 @@ select
488 497 .navmenu li.iehover li.iehover li.iehover a {
489 498 background: #CCC;
490 499 color: #FFF;
  500 +
491 501 }
492 502  
493 503 /* 4th Menu */
... ... @@ -1212,3 +1222,162 @@ select
1212 1222 background-color: white;
1213 1223 z-index: 99999;
1214 1224 }
  1225 +
  1226 +/* Menu modules */
  1227 +.navmenuModule {
  1228 + margin-top: 0px;
  1229 + margin-bottom: 0px;
  1230 + padding: 0;
  1231 + list-style: none;
  1232 + height: 32px;
  1233 + font-size: 11px;
  1234 + font-weight: bold;
  1235 + font-family: Verdana, Arial, Helvetica, sans-serif;
  1236 + position: relative;
  1237 + z-index: 900;
  1238 + margin-right: 20px;
  1239 +}
  1240 +
  1241 +.navmenuModule li {
  1242 + margin: 0;
  1243 + padding: 0;
  1244 + display: inline-block;
  1245 +
  1246 +}
  1247 +
  1248 +.navmenuModule ul {
  1249 + border: 0 none;
  1250 + padding: 0;
  1251 + width: 190px;
  1252 + list-style: none;
  1253 + display: none;
  1254 + position: absolute;
  1255 + height: 32px;
  1256 +}
  1257 +
  1258 +.navmenuModule ul li {
  1259 + width: 185px;
  1260 + float: left; /*For IE 7 lack of compliance*/
  1261 + display: block !important;
  1262 + display: inline; /*For IE*/
  1263 +
  1264 +}
  1265 +
  1266 +.navmenuModule li:first-child a {
  1267 + border-left: none;
  1268 +}
  1269 +
  1270 +.navmenuModule li:first-child a:hover {
  1271 + border-left: none;
  1272 +}
  1273 +
  1274 +.navmenuModule li:last-child a {
  1275 + border-right: none;
  1276 +}
  1277 +
  1278 +.navmenuModule a {
  1279 + border-right: 1px solid #CCC;
  1280 + border-left: 1px solid #FFF;
  1281 + padding: 0 20px;
  1282 + float: none !important; /*For Opera*/
  1283 + float: left; /*For IE*/
  1284 + display: block;
  1285 + /*background: #EEE;*/
  1286 + color: #666;
  1287 + text-decoration: none;
  1288 + height: 1%; /*For IE*/
  1289 + height: 32px;
  1290 + line-height: 32px;
  1291 +}
  1292 +
  1293 +/* Root Menu Hover Persistence */
  1294 +.navmenuModule a:hover,
  1295 +.navmenuModule li:hover a,
  1296 +.navmenuModule li.iehover a {
  1297 + background: #CCC;
  1298 + border-left: 1px solid #CCC;
  1299 + color: #FFF;
  1300 + z-index: 2;
  1301 +}
  1302 +
  1303 +
  1304 +/* 2nd Menu */
  1305 +.navmenuModule li:hover li a,
  1306 +.navmenuModule li.iehover li a {
  1307 + float: none;
  1308 + background: #EEE;
  1309 + color: #666;
  1310 + border: 1px solid #FFF;
  1311 + border-left: 1px solid #ccc;
  1312 + z-index: 2;
  1313 +}
  1314 +
  1315 +/* 2nd Menu Hover Persistence */
  1316 +.navmenuModule li:hover li a:hover,
  1317 +.navmenuModule li:hover li:hover a,
  1318 +.navmenuModule li.iehover li a:hover,
  1319 +.navmenuModule li.iehover li.iehover a {
  1320 + background: #CCC;
  1321 + color: #FFF;
  1322 +}
  1323 +
  1324 +/* 3rd Menu */
  1325 +.navmenuModule li:hover li:hover li a,
  1326 +.navmenuModule li.iehover li.iehover li a {
  1327 + background: #EEE;
  1328 + color: #666;
  1329 +}
  1330 +
  1331 +/* 3rd Menu Hover Persistence */
  1332 +.navmenuModule li:hover li:hover li a:hover,
  1333 +.navmenuModule li:hover li:hover li:hover a,
  1334 +.navmenuModule li.iehover li.iehover li a:hover,
  1335 +.navmenuModule li.iehover li.iehover li.iehover a {
  1336 + background: #CCC;
  1337 + color: #FFF;
  1338 +}
  1339 +
  1340 +/* 4th Menu */
  1341 +.navmenuModule li:hover li:hover li:hover li a,
  1342 +.navmenuModule li.iehover li.iehover li.iehover li a {
  1343 + background: #EEE;
  1344 + color: #666;
  1345 +}
  1346 +
  1347 +/* 4th Menu Hover */
  1348 +.navmenuModule li:hover li:hover li:hover li a:hover,
  1349 +.navmenuModule li.iehover li.iehover li.iehover li a:hover {
  1350 + background: #CCC;
  1351 + color: #FFF;
  1352 +}
  1353 +
  1354 +.navmenuModule ul ul,
  1355 +.navmenuModule ul ul ul {
  1356 + display: none;
  1357 + position: absolute;
  1358 + top: 0;
  1359 + left: 160px;
  1360 +}
  1361 +
  1362 +/* Do Not Move - Must Come Before display:block for Gecko */
  1363 +.navmenuModule li:hover ul ul,
  1364 +.navmenuModule li:hover ul ul ul,
  1365 +.navmenuModule li.iehover ul ul,
  1366 +.navmenuModule li.iehover ul ul ul {
  1367 + display: none;
  1368 +}
  1369 +
  1370 +.navmenuModule li:hover ul,
  1371 +.navmenuModule ul li:hover ul,
  1372 +.navmenuModule ul ul li:hover ul,
  1373 +.navmenuModule li.iehover ul,
  1374 +.navmenuModule ul li.iehover ul,
  1375 +.navmenuModule ul ul li.iehover ul {
  1376 + display: block;
  1377 +}
  1378 +
  1379 +
  1380 +
  1381 +
  1382 +
  1383 +
... ...
lib/Snep/Menu.php
... ... @@ -183,8 +183,31 @@ class Snep_Menu {
183 183 */
184 184 public function renderChildren() {
185 185 $html = "";
  186 +
186 187 foreach ($this->getChildren() as $child) {
187   - $html .= $child->render();
  188 + if (substr($child->id, 0, 7) == 'default') {
  189 + $html .= $child->render();
  190 + } else {
  191 + $html['module'] = $child->renderModule();
  192 + }
  193 + }
  194 +
  195 + return $html;
  196 + }
  197 +
  198 + /**
  199 + * renderChildren - Render all the children of this menu
  200 + * @return <string> HTML rendered children
  201 + */
  202 + public function renderChildrenModule() {
  203 + $html = "";
  204 +
  205 + foreach ($this->getChildren() as $child) {
  206 + if (substr($child->id, 0, 7) == 'default') {
  207 + $teste = $child->render();
  208 + } else {
  209 + $html .= $child->renderModule();
  210 + }
188 211 }
189 212 return $html;
190 213 }
... ... @@ -224,4 +247,22 @@ class Snep_Menu {
224 247 return $html;
225 248 }
226 249  
  250 + /**
  251 + * render - Render the menu and its children
  252 + * @return <string> HTML rendered menu
  253 + */
  254 + public function renderModule() {
  255 +
  256 + $html = "<li>";
  257 + $html .= "<a href=\"{$this->getUri()}\">" . $this->getLabel() . "</a>";
  258 + if (count($this->getChildren()) > 0) {
  259 + $html .= "<ul>";
  260 + $html .= $this->renderChildrenModule();
  261 + $html .= "</ul>";
  262 + }
  263 +
  264 + $html .= "</li>";
  265 + return $html;
  266 + }
  267 +
227 268 }
... ...
modules/default/views/layouts/layout.phtml
... ... @@ -55,10 +55,18 @@ $this-&gt;headLink()-&gt;appendStylesheet($this-&gt;baseUrl() . &#39;/css/main.css&#39;);
55 55 <br>
56 56 <a id="closeLink" href="javascript:void(0);"><?php echo $this->translate("Back"); ?></a><br><br>
57 57 </div>
58   -
59 58 <ul class="navmenu">
60 59 <?php echo Snep_Menu::getMasterInstance()->renderChildren(); ?>
  60 + <li id="default_modules" onclick="modules('maisinfo');"><a href="#"><?php echo $this->translate("Modules"); ?></a>
  61 + </li>
61 62 </ul>
  63 +
  64 + <div id="maisinfo" style="display:none">
  65 + <ul class="navmenuModule">
  66 + <?php echo Snep_Menu::getMasterInstance()->renderChildrenModule(); ?>
  67 + </ul>
  68 + </div>
  69 +
62 70 </div>
63 71 <?php endif; ?>
64 72 <div id="breadcrumb" <?php
... ... @@ -107,4 +115,15 @@ $this-&gt;headLink()-&gt;appendStylesheet($this-&gt;baseUrl() . &#39;/css/main.css&#39;);
107 115 Event.observe('closeLink', 'click', function() {
108 116 test.close();
109 117 });
  118 +
  119 + var modules = function(obj) {
  120 +
  121 + var el = document.getElementById(obj);
  122 + if (el.style.display != 'none') {
  123 + el.style.display = 'none';
  124 + }
  125 + else {
  126 + el.style.display = '';
  127 + }
  128 + }
110 129 </script>
... ...