array ("get", "string", null), "var_id" => array ("post", "integer", null), "var_value" => array ("post", "string", null), "var_value_arr" => array ("post", "array", null), "var_name" => array ("post", "string", null), "strata" => array ("post", "string", null), "strata_id" => array ("post", "integer", null), "delete" => array ("post", "boolean", false), ); getFields($fields); variable_get("aaa_test3", array("ns1"=> array("ns"=>"ns1.%%FQDN%%", "ip"=>"%%PUBLIC_IP%%", "enabled"=>"%%ENABLED%%"), "ns2"=>array("ns"=>"fdsffsd", "ip"=>"fdsfdfds", "enabled"=>"fds"), 'ns55'=> 'arf' ), "This is a test!", array("ns1"=> array("ns"=>"ns name", "ip"=>"ip address", "enabled"=>"enabled"), "ns2"=>array("ns"=>"ns name", "ip"=>"ip address", "enabled"=>"enabled"), 'ns3'=>'toto' ) ); if (empty($var)) { echo "

";__("Missing var name");echo "

"; include_once("foot.php"); } // Which one between var_value and var_value_arr ? $var_v = null; if (!is_null($var_value)) $var_v = $var_value; if (!is_null($var_value_arr)) $var_v = $var_value_arr; if ( $var_id && $delete ) { $variables->del($var_id); } else if ( $strata && $var_name && $var_v ) { $variables->variable_update_or_create($var_name, $var_v, $strata, $strata_id); } else if ( $var_id && $var_v ) { $variables->variable_update_or_create($var_name, $var_v, null, null, $var_id); } echo "

";echo sprintf(_("Edition of var %s"), $var); echo "

"; $members = $admin->get_list(); $panel_url = $fqdn=$dom->get_panel_url_list(); $allvars = $variables->variables_list(); $members_list=array(); foreach($admin->get_list() as $mid=>$mlogin) { $members_list[$mid] = $mlogin['login']; } $creators_list=array(); foreach($admin->get_creator_list() as $mid=>$mlogin) { $creators_list[$mid] = $mlogin['login']; } echo "
"._("Description").""; echo "

".$variables->variables_list_name()[$var]."

"; echo "
"; echo "
"; function edit_var($var_arr) { global $allvars; echo "
"; echo ""; if (is_array( $allvars['DEFAULT'][null][$var_arr['name']]['type'] )) { echo ""; } else { echo ""; } echo "
"; echo ""; echo ""; echo ""; echo "
"; echo ""; } function add_var($stratatata, $stratatata_arr=null) { global $var, $allvars; echo "
"; echo ""; echo ""; if (is_array($stratatata_arr)) { echo " "; } if (is_array( $allvars['DEFAULT'][null][$var]['type'] )) { echo ""; } else { echo ""; } echo "
"; echo ""; echo ""; echo "
"; echo ""; } echo ""; foreach ( $variables->strata_order as $strata) { echo ""; echo ""; switch($strata) { case 'DEFAULT': echo ""; break; case 'GLOBAL': echo ""; break; case 'FQDN_CREATOR': echo ""; break; case 'FQDN': echo ""; break; case 'CREATOR': echo ""; break; case 'MEMBER': echo ""; break; case 'DOMAIN': //FIXME TODO echo ""; break; } //switch echo ""; } //foreach echo "
"; __($strata); echo ""; $variables->display_value_html($allvars, 'DEFAULT', null, $var); echo ""; if ( isset($allvars['GLOBAL'][null][$var]) && is_array($allvars['GLOBAL'][null][$var])){ echo ""; $variables->display_value_html($allvars, 'GLOBAL', null, $var); echo ""; edit_var($allvars['GLOBAL'][null][$var]); } else { echo ""._("Add").""; add_var($strata); } echo ""; if (isset($allvars['FQDN_CREATOR']) && is_array($allvars['FQDN_CREATOR'])) { foreach ($allvars['FQDN_CREATOR'] as $ttk => $ttv ) { if ( isset($ttv[$var]) && is_array( $ttv[$var])) { echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → "; echo ""; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; edit_var($ttv[$var]); } echo "
"; } } // isset echo ""._("Add").""; add_var($strata, $members_list); echo "
"; if ( isset($allvars['FQDN']) && is_array($allvars['FQDN'])) { foreach ($allvars['FQDN'] as $ttk => $ttv ) { if ( isset($ttv[$var]) && is_array( $ttv[$var])) { echo sprintf(_("Overwritted by %s"), $panel_url[$ttk])." → "; echo ""; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; edit_var($ttv[$var]); } echo "
"; } } //isset echo ""._("Add").""; add_var($strata, $panel_url); echo "
"; if (isset($allvars['CREATOR']) && is_array($allvars['CREATOR'])) { foreach ($allvars['CREATOR'] as $ttk => $ttv ) { if ( isset($ttv[$var]) && is_array( $ttv[$var])) { echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → "; echo ""; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; edit_var($ttv[$var]); } echo "
"; } } //isset echo ""._("Add").""; add_var($strata, $creators_list ); echo "
"; if (isset($allvars['MEMBER']) && is_array($allvars['MEMBER'])) { foreach ($allvars['MEMBER'] as $ttk => $ttv ) { if ( isset($ttv[$var]) && is_array( $ttv[$var])) { echo sprintf(_("Overwritted by %s"), $members[$ttk]['login'])." → "; echo ""; echo $variables->display_valueraw_html($ttv[$var]['value'], $var);echo ""; edit_var($ttv[$var]); } echo "
"; } } //isset echo ""._("Add").""; add_var($strata, $members_list); echo "
Todo.
"; ?>