diff options
Diffstat (limited to 'mayor-orig/www/skin/teszt/base/html')
-rw-r--r-- | mayor-orig/www/skin/teszt/base/html/base.phtml | 407 |
1 files changed, 407 insertions, 0 deletions
diff --git a/mayor-orig/www/skin/teszt/base/html/base.phtml b/mayor-orig/www/skin/teszt/base/html/base.phtml new file mode 100644 index 00000000..77e12bc7 --- /dev/null +++ b/mayor-orig/www/skin/teszt/base/html/base.phtml @@ -0,0 +1,407 @@ +<?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() +*/ + + require('skin/blue/base/color_schemes.php'); + if (!defined('__COLOR_SCHEME') || !is_array($_COLOR_SCHEMES[__COLOR_SCHEME])) + $_COLORS = $_COLOR_SCHEMES['blue']; + else + $_COLORS = $_COLOR_SCHEMES[__COLOR_SCHEME]; + + +// ------------------------------------------------------------------- +// 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>'; + $_defaultPageLayout = ($_SESSION['pageLayout']==0) ? 'leftpad' : 'toppad'; + echo '<div class="mayorbody '.$_defaultPageLayout.'" 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, $SSSBB; + + 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'); + ## ----------------------------------------------- + + // debug üzenetek layer-ének lezárása +// if (defined('__START_DEBUG') && __START_DEBUG === true) echo "</div>\n<!--// debug end //-->"; + + 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 (defined('_SITE')) echo ' - '._SITE.' - '; + echo _MAIN_TITLE; + echo '.'; + echo _MAYORREV; + 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 (is_string($SSSHH) && $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); + } + } + echo '<link rel="shortcut icon" href="/skin/blue/base/img/favicon.ico" />'."\n"; + echo "</head>\n<body>\n"; + if (is_string($SSSBB) && $SSSBB!='') echo $SSSBB; + +} + +// ------------------------------------------------------------------- +// mayor_menu(): a menü kiiratása +// ------------------------------------------------------------------- + +function mayor_menu($MENU,$sessionID,$lang = _DEFAULT_LANG,$skin = _DEFAULT_SKIN) { + + global $policy, $page, $sub, $f, $LANGUAGES, $SKINSSHOW, $_COLORS; + + echo '<ul id="nav" class="hideShowContainer">'."\n"; + if (is_array($MENU)) { + $active_page=false; + foreach ($MENU as $aModule => $pItems) { + if ($aModule != 'modules') { + for ($i = 0; $i < count($pItems); $i++) { + if ($page == $aModule and + ( $active_page===false && ( $_SERVER["REQUEST_URI"]=='/' || (!isset($pItems[$i]['url'])) || strpos($_SERVER["REQUEST_URI"],$pItems[$i]['url']) !== false || strpos($pItems[$i]['url'],"page=$page") !== false) ) + ) { + echo '<li class="active">'; + $active_page=true; + } 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 + } + echo '<li class="start onClickHideShow"> </li>'; + echo '</ul>'."\n"; + + $loginout_img = _svgLoginout(array('print'=>false, 'color' => $_COLORS['login'])); + $down_svg = _svgDown(array('print'=>false, 'color' => $_COLORS['login'])); + // ------------------------ + + echo '<ul id="poz">'; + echo '<li>'; + if (!defined('_SCHOOL_NAME')) define('_SCHOOL_NAME',_SITE/*.' - '._MAIN_TITLE.'.'._MAYORREV*/); + echo '<span class="school">'._SCHOOL_NAME.'</span>'; + + if ($policy == 'public') { + echo '<div class="nev hideShowContainer">'.$down_svg.'<span class="onClickHideShow" style="padding-left:14px;" > '._LOGIN.'</span>'; + echo '<a id="logout" title="'._LOGIN.'" href="'.href('index.php?page=auth&f=login&toPolicy=private',array('skin','lang','sessionID')).'">'; + echo $loginout_img; + echo '</a>'; + echo '<div id="settings" class="openable" style="display: none">'; + echo '<table>'; + echo '<tr>'; + echo '<td><a href="'.href('index.php?page=auth&f=login&toPolicy=parent').'">'.str_replace(' ',' ',_PARENT_LOGIN).'</a></td>'; + echo '<td><a href="'.href('index.php?page=auth&f=login&toPolicy=private').'">'._LOGIN.'</a></td>'; + echo '</tr>'; + echo '</table>'; + formBegin(); + formEnd(); + echo '</div>'; + echo '</div>'; + } else { + echo '<div class="nev hideShowContainer">'.$down_svg.'<span class="onClickHideShow" style="padding-left:14px;" > '._USERCN.'</span>'; + echo '<a id="logout" title="'._LOGOUT.'" href="'.href('index.php?page=session&f=logout&policy=public',array('skin','lang','sessionID')).'">'; + echo $loginout_img; + echo '</a>'; + echo '<div id="settings" class="openable" style="display: none">'; + echo '<div>'; + echo '<p class="name">'._USERCN.'</p>'; + echo '<p class="account">'._USERACCOUNT.'</p>'; + echo '</div>'; + echo '<table>'; + echo '<tr>'; + echo '<td><a href="'.href('index.php?page=password&f=changeMyPassword&userAccount='._USERACCOUNT.'&policy=public',array('skin','lang','sessionID')).'">'._PASSWORD.'</a></td>'; + echo '<td><a href="'.href('index.php?page=session&f=logout&policy=public',array('skin','lang','sessionID')).'">'._LOGOUT.'</a></td>'; + echo '</tr>'; + echo '</table>'; + formBegin(); + /* Némi javascipt támogatás a session kezelésre ebben a formban */ + $sessionMaxIdleTime=$sessionAlertTime=0; + if ((_SESSIONID!='' && _POLICY!='public') && defined('_SESSION_MAX_IDLE_TIME') && _SESSION_MAX_IDLE_TIME>0) { + $sessionMaxIdleTime=((_SESSION_MAX_IDLE_TIME*1000*60*60)+1000); + if (defined('_SESSION_ALERT_TIME')) $sessionAlertTime = ((_SESSION_MAX_IDLE_TIME*1000*60*60)-(_SESSION_ALERT_TIME*1000*60)); + } + echo '<input type="text" id="SESSION_MAX_IDLE_TIME" value="'.$sessionMaxIdleTime.'" />'; + echo '<input type="text" id="SESSION_ALERT_TIME" value="'.$sessionAlertTime.'" />'; + /* --- */ + formEnd(); + echo '</div>'; + echo '</div>'; + } // policy != punlic +//var_dump(substr($_SERVER["REQUEST_URI"],0,strpos($_SERVER["REQUEST_URI"],'sessionID='))); + + echo '</li>'; + echo '</ul>'; + + +} + +// ------------------------------------------------------------------- +// 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(); + _keyHelp(); + + echo '<div id="mayorhead">'; + + //if (date('m')==12) $imgextra = '-santa'; else $imgextra = ''; + if (defined('_HOME_LOGO') && file_exists(_HOME_LOGO)) $HOME_LOGO=_HOME_LOGO; + elseif (!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'; + + if (defined('_HOME_LOGO_BADGE') && file_exists(_HOME_LOGO_BADGE)) $HOME_LOGO_BADGE=_HOME_LOGO_BADGE; +// elseif (!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"></div><!-- we are holding some place here -->'; + + echo "<!--// NAV1 start //-->\n"; + echo '<div id="nav1">'; + echo '<div class="hideShowContainer">'; + + $db = 0; $max = __MAX_MENU; // Az egy sorba megjeleníthető menüpontok maximális száma + 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 ($db<$max) { + if ($page == $N1['page'] && $sub == $N1['sub'] && (!isset($N1['f']) || $f == $N1['f'])) $class = ' class="aktiv" '; else $class = ''; + } else { + if ($page == $N1['page'] && $sub == $N1['sub'] && (!isset($N1['f']) || $f == $N1['f'])) $class = ' class="openable aktiv" '; else $class = ' class="openable" '; + $style = ' style="display: none;" '; + } + + if ($txt != '') { // Hibás hivatkozás ne rontsa el a menüt! + if ($db == $max) echo '<span class="onClickHideShow openable">∇</span><span class="onClickHideShow openable" style="display: none;">Δ</span><br />'; + echo '<a href="'.$href.'"'.$class.$style.'>'; + echo $txt; + echo '</a>'; + $db++; + } + + + } + echo '</div>'; + echo '</div>'."\n<!--// NAV1 end //-->\n"; + + mayor_menu($MENU,$sessionID,$lang,$skin); + + echo '<div class="mayorLogo">'; + echo '<a href="'.href('index.php').'">'; + echo '<img src="'.$HOME_LOGO.'" alt="MaYoR" id="logo" />'; + if ($HOME_LOGO_BADGE!='') echo '<img src="'.$HOME_LOGO_BADGE.'" alt="" id="logobadge" />'; + echo '</a>'; + echo '</div>'; + + + echo "<!--// NAV2 start //-->\n"; + $_defaultPageLayout = ($_SESSION['pageLayout']==0) ? 'vertical' : 'horizontal'; + echo '<div id="nav2" class="'.$_defaultPageLayout.'">'; +// echo '<span id="hideNav2:tavtarto" class="onClickHide">X</span>'; + 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"; + + echo '</div>'."\n"; + +} + + +// ------------------------------------------------------------------- +// html_mayor_foot() : lablec kiirasa ( ) +// ------------------------------------------------------------------- + +function html_mayor_foot() { + $_defaultPageLayout = ($_SESSION['pageLayout']==0) ? 'leftpad' : 'toppad'; + echo '<div class="mayorfoot '.$_defaultPageLayout.'" id="mayorfoot">'._MAIN_FOOTER.'</div>'."\n\n"; + echo "</body>\n</html>"; +} + + +?> |