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 pour test 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"=> array( 'desc'=>"ns name", 'type'=>'string'), "ip"=> array( 'desc'=>"ip address", 'type'=>'ip'), "enabled"=> array( 'desc'=>"enabled", 'type'=>"boolean"), ), "ns2"=>array( "ns"=> array( 'desc'=>"ns name", 'type'=>'string'), "ip"=> array( 'desc'=>"ip address", 'type'=>'ip'), "enabled"=> array( 'desc'=>"enabled", 'type'=>"boolean"), ), "ns3"=>array( "desc"=>"here another", "type"=>"integer", ), ) ); /* */ if (empty($var)) { echo "
";__("Missing var name");echo "
"; include_once("foot.php"); die(); } // 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 ""; __($strata); echo " | "; switch($strata) { case 'DEFAULT': echo ""; $variables->display_value_html($allvars, 'DEFAULT', null, $var); echo " | "; break; case 'GLOBAL': 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 " | "; break; case 'FQDN_CREATOR': 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 ""; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "";
edit_var($ttv[$var]);
}
echo " "; } } // isset echo ""._("Add").""; add_var($strata, $members_list); echo " | ";
break;
case 'FQDN':
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 ""; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "";
edit_var($ttv[$var]);
}
echo " "; } } //isset echo ""._("Add").""; add_var($strata, $panel_url); echo " | ";
break;
case 'CREATOR':
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 ""; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "";
edit_var($ttv[$var]);
}
echo " "; } } //isset echo ""._("Add").""; add_var($strata, $creators_list ); echo " | ";
break;
case 'MEMBER':
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 ""; $variables->display_valueraw_html($ttv[$var]['value'], $var);echo "";
edit_var($ttv[$var]);
}
echo " "; } } //isset echo ""._("Add").""; add_var($strata, $members_list); echo " | ";
break;
case 'DOMAIN':
//FIXME TODO
echo "Todo. | "; break; } //switch echo "