Changeset 374 for minimanager/header.php


Ignore:
Timestamp:
Sep 11, 2008, 9:10:27 AM (16 years ago)
Author:
george
Message:
  • Aktualizováno: Minimanager 0.12 rev. 99. Opraveno zobrazování honoru, přidána captcha p?i registraci nového účtu a mini fórum.
  • Přidáno: Český překlad pro Minimanager 0.12.
  • Smazáno: Staré fotky fyzického serveru přesunuty do fotogalerie.
  • Přidáno: Nějaké návody na eventy od bbtrashe.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/header.php

    r142 r374  
    2929require_once("lang/$lang.php");
    3030require_once("scripts/global_lib.php");
     31require_once("scripts/id_tab.php");
    3132
    3233//application/xhtml+xml
    3334$output .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
    34 <html>
     35<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">
    3536<head>
    3637 <title>$title</title>
    37  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=$site_encoding\" />
    38  <link rel=\"stylesheet\" type=\"text/css\" href=\"templates/".$css_template."/".$css_template."_1024.css\" title=\"default\" />
     38 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
     39 <meta http-equiv=\"Content-Type\" content=\"text/javascript; charset=utf-8\" />
    3940 <link rel=\"stylesheet\" type=\"text/css\" href=\"templates/".$css_template."/".$css_template."_1024.css\" title=\"1024\" />
    4041 <link rel=\"stylesheet\" type=\"text/css\" href=\"templates/".$css_template."/".$css_template."_1280.css\" title=\"1280\" />
     42 <link rel=\"SHORTCUT ICON\" href=\"img/favicon.ico\" />
     43 <script type=\"text/javascript\" charset=\"utf-8\"></script>
     44 <script src=\"js/general.js\"></script>
     45 <script src=\"js/layout.js\"></script>
     46 <script src=\"$tt_scrip\"></script>
    4147
    42  <link rel=\"SHORTCUT ICON\" href=\"img/favicon.ico\" />
    43  <script type=\"text/javascript\" src=\"js/general.js\"></script>
    44  <script type=\"text/javascript\" src=\"js/layout.js\"></script>
    4548<!--[if lte IE 7]>
    4649 <style>
     
    7780        $realm_id = (isset($_GET['r_id'])) ? addslashes($_GET['r_id']) : $_SESSION['realm_id'];
    7881       
     82        $user_lvl_name = get_gm_level($user_lvl);
     83       
    7984        //override PHP error reporting
    8085        if ($debug) error_reporting (E_ALL);
     
    9095    if(!isset($menu_array[$user_lvl])) error("Wrong menu_array configuration.<br />Level $user_lvl menu missing...");
    9196
    92         foreach ($menu_array[$user_lvl][1] as $trunk){
    93                 $output .= "<li><a href=\"{$trunk[0]}\">{$lang_header[$trunk[1]]}</a>";
    94                 if(isset($trunk[2][0])) $output .= "<ul>";
    95                 foreach ($trunk[2] as $branch){
    96                         $output .= "<li><a href=\"{$branch[0]}\">{$lang_header[$branch[1]]}</a></li>";
    97                 }
    98                 if(isset($trunk[2][0])) $output .= "</ul>";
    99                 $output .= "</li>";
    100         }
     97  // get file we are executing
     98  $array = explode ( '/', $_SERVER['PHP_SELF']);
     99        $lookup_file = $array[sizeof($array)-1];
     100       
     101  foreach ($menu_array as $trunk){
     102    if ($trunk[1] != "invisible") // ignore "invisible array" this is for setting security read/write values for not accessible elements not in the navbar!
     103    {
     104      $output .= "<li><a href=\"{$trunk[0]}\">{$lang_header[$trunk[1]]}</a>";
     105      if(isset($trunk[2][0])) $output .= "<ul>";
     106      foreach ($trunk[2] as $branch){
     107       
     108        if($branch[0] == $lookup_file)
     109        {
     110          $action_permission['read']   = $branch[2];
     111          $action_permission['update'] = $branch[3];
     112          $action_permission['insert'] = $branch[4];
     113          $action_permission['delete'] = $branch[5];
     114        }
     115       
     116        if ( $user_lvl >= $branch[2] )
     117          $output .= "<li><a href=\"{$branch[0]}\">{$lang_header[$branch[1]]}</a></li>";
     118      }
     119      if(isset($trunk[2][0])) $output .= "</ul>";
     120      $output .= "</li>";
     121    }
     122    else
     123    {
     124      foreach ($trunk[2] as $branch){
     125       
     126        if($branch[0] == $lookup_file)
     127          $action_permission['read']=$branch[2];
     128      }
     129    }
     130   
     131  }
     132 
     133  // secure non secure settings
     134  // some pages don't have security yet, because they dont use header.php... like pomm.php and login.php
     135  if(!isset($action_permission['read']))                                                                   $action_permission['read']   = 3;
     136  if(!isset($action_permission['update']) || $action_permission['update'] < $action_permission['read']   ) $action_permission['update'] = $action_permission['read'];
     137  if(!isset($action_permission['insert']) || $action_permission['insert'] < $action_permission['update'] ) $action_permission['insert'] = $action_permission['update'];
     138  if(!isset($action_permission['delete']) || $action_permission['delete'] < $action_permission['insert'] ) $action_permission['delete'] = $action_permission['insert'];
    101139
    102140        $output .= "<li><a class=\"trigger\" href=\"edit.php\">{$lang_header['my_acc']}</a>
     
    117155                </div></td>
    118156                        <td class=\"table_top_middle\">
    119                         <div id=\"username\">$user_name .:{$menu_array[$user_lvl][0]}'s {$lang_header['menu']}:.</div></td>
     157                        <div id=\"username\">$user_name .:{$user_lvl_name}'s {$lang_header['menu']}:.</div></td>
    120158                        <td class=\"table_top_right\"></td>
    121159                        </tr>
Note: See TracChangeset for help on using the changeset viewer.