Exemple #1
0
session_start();
if (!isset($_SESSION['connected'])) {
    header('Location: auth.php');
}
//we extract the get parameters
extract($_GET);
//import of the differents files
include '../libs/php/globalInfos.php';
$gb = new globalInfos();
$gb->requireModel($table);
//the model for the current page
$myTools = new myTools();
include '../libs/php/inclusion_' . $table . '.php';
//file that instanciate the differents models
$globalInfosClass = new globalInfos();
$gb->setGlobalXmlConfig(simplexml_load_file("../config/global_config.xml"));
//this variable contains the title for the form ( edit or add )
$titre = $mode == "edit" ? $gb->getGlobalInfoForNodeAndTable("global_edit_title_label", $table) : $gb->getGlobalInfoForNodeAndTable("global_add_title_label", $table);
//if we are in edit mode , we init the model with the saved values
if ($mode == "edit") {
    $oneElement->initFromDatas(array($datasManager->getPrimaryKey() => $id));
} else {
    $id = 'aucun';
    /*if(isset($_SESSION['hierarchy']["filter"]) && count($_SESSION['hierarchy']["filter"])>0)
    	{
    		$initDatas=array();
    		foreach($_SESSION['hierarchy']["filter"] as $filter=>$value)
    		{
    			$initDatas[$filter]=$value;
    		}
    		$oneElement->initWithDatas($initDatas);
Exemple #2
0
foreach ($datas->aMenu as $menu) {
    $pages[] = (string) $menu['tableName'];
}
//we create a page variable that will contains the name of the current page
$page;
if (isset($_GET['page'])) {
    if (in_array($_GET['page'], $pages)) {
        $page = $_GET['page'];
    } else {
        $page = $pages[0];
    }
} else {
    $page = $pages[0];
}
$globalInfosClass = new globalInfos();
$globalInfosClass->setGlobalXmlConfig(simplexml_load_file("config/global_config.xml"));
?>
<!-- container of the header -->
<div class="navbar navbar-inverse navbar-fixed-top" id="headerDiv">
      <div class="navbar-inner">
        <div class="container">
          
          <div class="nav-collapse collapse">
            <ul class="nav" id="menuDiv">
              <?php 
foreach ($datas->aMenu as $menu) {
    if (strlen((string) $menu['displayName']) > 0) {
        ?>
 <li <?php 
        if ($page == $menu['tableName']) {
            echo "class='active'";