diff options
Diffstat (limited to 'mayor-orig/www/skin/sulix/base/html')
-rw-r--r-- | mayor-orig/www/skin/sulix/base/html/base.phtml | 332 |
1 files changed, 332 insertions, 0 deletions
diff --git a/mayor-orig/www/skin/sulix/base/html/base.phtml b/mayor-orig/www/skin/sulix/base/html/base.phtml new file mode 100644 index 00000000..5848a7b7 --- /dev/null +++ b/mayor-orig/www/skin/sulix/base/html/base.phtml @@ -0,0 +1,332 @@ +<?php +/* + Module: base + + html_base($sessionID,$page,$sub,$f,$lang,$skin,$MENU) + html_head($page,$f,$lang,$skin) + html_mayor_head($sessionID,$page,$sub,$f,$lang,$MENU,$skin = 'default') + html_mayor_foot() + //page($page,$sub,$f,$lang,$skin) --> base.php + putValidXHTML() +*/ + + +// ------------------------------------------------------------------- +// html_base() : a html oldal szerkezete +// ------------------------------------------------------------------- + +function html_base($sessionID,$policy,$page,$sub,$f,$lang,$skin,$MENU) { + + _httpheader(); + if ($MENU['set'][$policy][$page][$sub][$f]['refresh'] > 0) { + @header("Refresh:".intval($MENU['set'][$policy][$page][$sub][$f]['refresh'])); + } + + html_head($page,$sub,$f,$lang,$skin); + _debugLayer(); + html_mayor_head($sessionID,$page,$sub,$f,$lang,$MENU,$skin); + echo '<div id="mayorerror"></div>'; + echo '<div class="mayorbody" id="mayorbody">'; + page($page,$sub,$f,$lang,$skin,$policy); + echo '</div>'; + html_mayor_foot(); +} + +// ------------------------------------------------------------------- +// html_head() : html fejlec kiirasa +// ------------------------------------------------------------------- + +function html_head($page,$sub,$f,$lang,$skin) { + + global $INCLUDES, $SSSHH; + + if ($f == '') $f = $page; + ## ---------------------------------------------- + ## Note http://hixie.ch/advocacy/xhtml + ## But this is crazy! Using Doctype sniffing instead... + ## Also read: http://www.mozilla.org/docs/web-developer/faq.html + ## header('Content-type: application/xhtml+xml'); + ## ----------------------------------------------- + echo '<?xml version="1.0" encoding="utf-8"?>'."\n"; + echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n"; + echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="hu">'."\n"; + echo '<head>'."\n"; + echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'."\n"; + echo '<title>'; +// if (_SULIX_DESIGN !== true) { +// if (defined('_SITE')) echo ' - '._SITE.' - '; +// echo _MAIN_TITLE; +// echo '.'; +// echo _MAYORREV; +// } else { + echo _SITE; +// } + echo '</title>'."\n"; + includeCSS($page,$sub,$f,$skin); + includeCSS($page,$sub,$f,$skin,'handheld'); // install css for handheld devices + includeJS($page,$sub,$f,$skin); + if ($SSSHH!=null && $SSSHH!='') echo $SSSHH; + + if (is_array(@$INCLUDES['html_head']['global'])) foreach ($INCLUDES['html_head']['global'] as $key => $include) { + if (file_exists("skin/$skin/$include")) { + include("skin/$skin/$include"); + } elseif (file_exists('skin/'._DEFAULT_SKIN.'/'.$include)) { + include('skin/'._DEFAULT_SKIN.'/'.$include); + } + } + if (is_array(@$INCLUDES['html_head'][$page])) foreach ($INCLUDES['html_head'][$page] as $key => $include) { + if (file_exists("skin/$skin/$include")) { + include("skin/$skin/$include"); + } elseif (file_exists('skin/'._DEFAULT_SKIN.'/'.$include)) { + include('skin/'._DEFAULT_SKIN.'/'.$include); + } + } +// if (_SULIX_DESIGN !== true) echo '<link rel="shortcut icon" href="/skin/sulix/base/img/favicon.ico" />'."\n"; +// else + echo '<link type="image/x-ico" rel="icon" href="/sulixlearning/theme/image.php?theme=leatherbound&image=favicon&rev=171&component=theme">'; + echo "</head>\n<body>\n"; + +} +// ------------------------------------------------------------------- +// mayor_menu(): a menü kiiratása +// ------------------------------------------------------------------- + +function mayor_menu($MENU,$sessionID,$lang = _DEFAULT_LANG,$skin = _DEFAULT_SKIN) { + + global $policy, $page, $sub, $f, $LANGUAGES, $SKINSSHOW; + + echo '<ul id="nav" class="hideShowContainer">'."\n"; + + if (is_array($MENU)) { + foreach ($MENU as $aModule => $pItems) { + if ($aModule != 'modules') { + for ($i = 0; $i < count($pItems); $i++) { + if ($page == $aModule and + ((!isset($pItems[$i]['url'])) || strpos($_SERVER["REQUEST_URI"],$pItems[$i]['url']) !== false) + ) { +// if (_SULIX_DESIGN === true) + echo '<li class="active">'; +// else echo '<li class="active nav1szin">'; + } else { + echo '<li style="display: none;" class="openable">'; + } + if (isset($pItems[$i]['url']) && $pItems[$i]['url'] != '') { + if ($pItems[$i]['url'][0] == '&') $href = href("index.php?page=$aModule".$pItems[$i]['url']); + elseif (substr($pItems[$i]['url'],0,4) == 'http') $href = href($pItems[$i]['url'], array()); + elseif (isset($pItems[$i]['get']) && is_array($pItems[$i]['get'])) $href = href($pItems[$i]['url'], $pItems[$i]['get']); + else $href = href($pItems[$i]['url']); + } else { + $href = href("index.php?page=$aModule"); + } + echo '<a href="'.$href.'"'.((isset($pItems[$i]['target']))?' target="'.$pItems[$i]['target'].'" ':'').'>' + .$pItems[$i]['txt'] + .'</a>'."\n"; + // --- sub --- + + @$pageArray = $MENU['modules'][$aModule]; + + if (is_array($pageArray) && count($pageArray)>0) { + echo '<ul class="sub">'."\n"; + foreach ($pageArray as $aSub => $sItems) { + if ($aSub != 'sub') { + for ($j=0;$j<count($sItems);$j++) { + if ( + $page == $aModule and + ( + (!isset($sItems[$j]['url']) && $f == $aSub) + || (isset($sItems[$j]['url']) && strpos($_SERVER["REQUEST_URI"],$sItems[$j]['url']) !== false) + ) + ) { + echo '<li class="active">'; $activeSub = true; + } else { + echo '<li>'; $activeSub = false; + } + if (isset($sItems[$j]['url']) && $sItems[$j]['url'] != '') { + if ($sItems[$j]['url'][0] == '&') $href = href("index.php?page=$aModule&f=$aSub".$sItems[$j]['url']); + elseif (substr($sItems[$j]['url'],0,4) == 'http') $href = href($sItems[$j]['url'], array()); + elseif (isset($sItems[$j]['get']) && is_array($sItems[$j]['get'])) $href = href($sItems[$j]['url'], $sItems[$j]['get']); + else $href = href($sItems[$j]['url']); + } else { + $href = href("index.php?page=$aModule&f=$aSub",array('policy','sessionID','lang','skin')); + } + @$subArray = $MENU['modules'][$aModule]['sub'][$aSub]; + if (!is_array($subArray) || count($subArray) == 0) { + echo '<a href="'.$href.'"'.((isset($sItems[$j]['target']))?' target="'.$sItems[$j]['target'].'" ':'').'>' + .$sItems[$j]['txt'].'</a>'; + } else { // vannak al-al menúk (f - menü) + echo '<span>«</span><a href="'.$href.'"'.((isset($sItems[$j]['target']))?' target="'.$sItems[$j]['target'].'" ':'').'>' + .$sItems[$j]['txt'].'</a>'; + // -- f menü -- + echo '<ul class="fmenu">'."\n"; + + foreach ($subArray as $anF => $items) { + for ($k=0;$k<count($items);$k++) { + if ($aModule == $page and + $aSub == $sub and + $anF == $f and + (!isset($items[$k]['url']) or strpos($_SERVER["REQUEST_URI"],$items[$k]['url']) !== false) + ) { echo '<li class="active">'."\n"; } + else { echo '<li>'."\n"; } + + if (isset($items[$k]['url']) && $items[$k]['url'] != '') { + if ($items[$k]['url'][0] == '&') $href = href("index.php?page=$aModule&sub=$aSub&f=$anF".$items[$k]['url']); + elseif (substr($items[$k]['url'],0,4) == 'http') $href = href($items[$k]['url'], array()); + elseif (isset($items[$k]['get']) && is_array($items[$k]['get'])) $href = href($items[$k]['url'], $items[$k]['get']); + else $href = href($items[$k]['url']); + } else { + $href = href("index.php?page=$aModule&sub=$aSub&f=$anF"); + } + echo '<a href="'.$href.'"'.((isset($items[$k]['target']))?' target="'.$items[$k]['target'].'" ':'').'> ' + .$items[$k]['txt'].' </a>'."\n"; + + echo '</li>'."\n"; // al-al menüpont vége (f) + } // for - on items + } // foreach - on subArray + + echo '</ul>'."\n"; // fmenu + } // vannak al-al menük (f -menü) + + echo '</li>'."\n"; // almenü-pont vége (sub) + } // for - on sItems + } // ha nem sub == aSub + } // foreach pageArray + echo '</ul>'."\n"; // submenu + } // vannak almenük (sub) + echo '</li>'."\n"; // menüpont vége (page) + } // for - on pItems + } // ha aModule != 'modules' + } // foreach on MENU + } +// if (_SULIX_DESIGN !== true) echo '<li class="start onClickHideShow"> </li>'; + echo '</ul>'."\n"; + + // ------------------------ + +} + +// ------------------------------------------------------------------- +// html_mayor_head() : fejlec kiirasa (logo+menu+lastupdated) +// ------------------------------------------------------------------- + +function html_mayor_head($sessionID,$page,$sub,$f,$lang,$MENU,$skin = _DEFAULT_SKIN) { + + global $INCLUDES, $INSTALLED_MODULES, $LANGUAGES, $SKINS, $SKINSSHOW, $policy, $SCHOOL_LOGO, $SCHOOL_IDENTITY, $SCHOOL_URL, $NAV; + + _updateWindow(); + + //if (date('m')==12) $imgextra = '-santa'; else $imgextra = ''; + +// if (defined('_HOME_LOGO') && file_exists(_HOME_LOGO)) $HOME_LOGO=_HOME_LOGO; +// else + if (!file_exists($HOME_LOGO = 'skin/'.$skin.'/base/img/mayor_small_ssl'.$imgextra.'.png')) + $HOME_LOGO = 'skin/'._DEFAULT_SKIN.'/base/img/mayor_small_ssl'.$imgextra.'.png'; + +echo '<div id="head">'; +/* --- + if ($policy == 'parent') { + echo '<div id="egyeb" class="hideShowContainer"><span class="onClickHideShow">Egyéb</span>'; + echo '<div id="settings" class="openable" style="">'; + echo '<table>'; + echo '<tr>'; + echo '<td><a href="'.href('index.php?policy=public&page=session&f=logout', array('sessionID','skin','lang')).'">'._LOGOUT.'</a></td>'; + echo '</tr><tr>'; + echo '<td><a href="'.href('index.php?policy=public&page=password&f=changeMyPassword&userAccount='._USERACCOUNT.'&toPolicy=parent',array('sessionID','skin','lang')).'">'._PASSWORD.'</a></td>'; + echo '</tr>'; + echo '</table>'; + echo '</div>'; + echo '</div>'; + } +/* --- */ +echo '</div>'; + + echo "<!--// NAV1 start //-->\n"; + echo '<div id="nav1">'; + echo '<div>'; + + if (is_array($NAV[1])) foreach ($NAV[1] as $N1) { + $txt = ''; + $i = intval($N1['index']); + if (isset($N1['sub'])) { + if (!isset($N1['f'])) { + $M = $MENU['modules'][ $N1['page'] ][ $N1['sub'] ][ $i ]; + } else { + $M = $MENU['modules'][ $N1['page'] ]['sub'][ $N1['sub'] ][ $N1['f'] ][ $i ]; + } + } elseif (isset($N1['f'])) { + $M = $MENU['modules'][ $N1['page'] ][ $N1['f'] ][ $i ]; + } else { + $M = $MENU[$N1['page']][ $i ]; + } + $txt = $M['txt']; + $url = $M['url']; + $get = $M['get']; + if (isset($get)) $href = href( isset($url)?$url:'index.php?page='.$N1['page'].'&sub='.$N1['sub'].'&f='.$N1['f'], $get); + else $href = href( isset($url)?$url:'index.php?page='.$N1['page'].'&sub='.$N1['sub'].'&f='.$N1['f']); + if ($page == $N1['page'] && $sub == $N1['sub'] && (!isset($N1['f']) || $f == $N1['f'])) $class = ' class="aktiv" '; else $class = ''; + if ($txt != '') { // Hibás hivatkozás ne rontsa el a menüt! + echo '<a href="'.$href.'"'.$class.'>'; + echo $txt; + echo '</a>'; + } + } + + echo '</div>'; + echo '</div>'."\n<!--// NAV1 end //-->\n"; + + + mayor_menu($MENU,$sessionID,$lang,$skin); +// if (_SULIX_DESIGN !== true) echo '<a href="'.href('index.php').'"><img src="'.$HOME_LOGO.'" alt="MaYoR" id="logo" /></a>'; +// else + echo '<img src="'.$HOME_LOGO.'" alt="MaYoR" id="logo" />'; + + + echo "<!--// NAV2 start //-->\n"; + echo '<div id="nav2">'; + if (is_array($NAV[2])) { + echo '<ul>'; + foreach ($NAV[2] as $N2) { + $txt = ''; + $i = intval($N2['index']); + if (isset($N2['sub'])) { + if (!isset($N2['f'])) { + $M = $MENU['modules'][ $N2['page'] ][ $N2['sub'] ][ $i ]; + } else { + $M = $MENU['modules'][ $N2['page'] ]['sub'][ $N2['sub'] ][ $N2['f'] ][ $i ]; + } + } elseif (isset($N2['f'])) { + $M = $MENU['modules'][ $N2['page'] ][ $N2['f'] ][ $i ]; + } else { + $M = $MENU[$N2['page']][ $i ]; + } + $txt = $M['txt']; + $url = $M['url']; + $get = $M['get']; + if (isset($get)) $href = href( isset($url)?$url:'index.php?page='.$N2['page'].'&sub='.$N2['sub'].'&f='.$N2['f'], $get); + else $href = href( isset($url)?$url:'index.php?page='.$N2['page'].'&sub='.$N2['sub'].'&f='.$N2['f']); + + if ($page == $N2['page'] && $sub == $N2['sub'] && (!isset($N2['f']) || $f == $N2['f'])) $class = ' class="aktiv" '; else $class = ''; + if ($txt != '') { + echo '<li>'; + echo '<a href="'.$href.'"'.$class.'>'; + echo $txt; + echo '</a>'; + echo '</li>'; + } + } + echo '</ul>'; + } + echo '</div>'."\n<!--// NAV2 end //-->\n"; + +} + +// ------------------------------------------------------------------- +// html_mayor_foot() : lablec kiirasa ( ) +// ------------------------------------------------------------------- + +function html_mayor_foot() { + //echo '<div class="mayorfoot" id="mayorfoot">'._MAIN_FOOTER.'</div>'."\n\n"; + echo "</body>\n</html>"; +} + + +?> |