From: hickert Date: Tue, 25 Sep 2007 13:30:32 +0000 (+0000) Subject: Unified dialog handling. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cf01bcc97789a128b624f4fd2754fd2a07027343;p=gosa.git Unified dialog handling. Use 'FALSE' instead of 'NULL' to indicate that this->dialog is not set, because it is initilized as 'FALSE' in plugin::plugin. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7403 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/addons/gotomasses/class_goto_task.inc b/plugins/addons/gotomasses/class_goto_task.inc index d151e84a1..4d1403e36 100644 --- a/plugins/addons/gotomasses/class_goto_task.inc +++ b/plugins/addons/gotomasses/class_goto_task.inc @@ -173,12 +173,12 @@ class goto_task extends plugin foreach($ret as $entry){ $this->Target[] = $entry['cn'][0]; } - $this->dialog = NULL; + $this->dialog = FALSE; } /* Cancel object listing */ if(isset($_POST['CloseMultiSelectWindow'])){ - $this->dialog = NULL; + $this->dialog = FALSE; } /* Display object Listing */ diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index d9e0f2d13..7a044de3d 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -33,7 +33,6 @@ class faiHook extends plugin var $cn = ""; // The class name for this object var $description = ""; // The description for this set of partitions var $is_dialog = false; // specifies which buttons will be shown to save or abort - var $dialog = NULL; // a dialog, e.g. new disk dialog var $SubObjects = array(); // All leafobjects of this object var $view_logged = FALSE; var $FAIstate = ""; @@ -267,7 +266,7 @@ class faiHook extends plugin } $this->is_dialog=false; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } } @@ -286,7 +285,7 @@ class faiHook extends plugin if(isset($_POST['CancelSubObject'])){ $this->is_dialog=false; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } /* Print dialog if $this->dialog is set */ diff --git a/plugins/admin/fai/class_faiManagement.inc b/plugins/admin/fai/class_faiManagement.inc index 0473df36a..ee8a813e5 100644 --- a/plugins/admin/fai/class_faiManagement.inc +++ b/plugins/admin/fai/class_faiManagement.inc @@ -228,7 +228,7 @@ class faiManagement extends plugin $this->dialog->set_acl_base($dn); $this->dialog->by_object[$type[1]]->remove_from_parent (); unset ($this->dialog); - $this->dialog= NULL; + $this->dialog= FALSE; $to_del = clean_up_releases($dn); save_release_changes_now(); @@ -299,7 +299,7 @@ class faiManagement extends plugin $this->dialog->set_acl_base($this->dn); $this->dialog->by_object[$type[1]]->remove_from_parent (); unset ($this->dialog); - $this->dialog= NULL; + $this->dialog= FALSE; $to_del = clean_up_releases($this->dn); save_release_changes_now(); @@ -684,7 +684,7 @@ class faiManagement extends plugin if(isset($_POST['edit_cancel'])){ unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; $this->is_dialog = false; unset($_SESSION['objectinfo']); del_lock ($this->dn); @@ -712,7 +712,7 @@ class faiManagement extends plugin if (!isset($_POST['edit_apply'])){ del_lock ($this->dn); unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; $this->is_dialog=false; unset($_SESSION['objectinfo']); } @@ -730,7 +730,7 @@ class faiManagement extends plugin * Here we need both, save and cancel */ - if(($this->dialog !== NULL) && (isset($this->dialog->config))){ + if(is_object($this->dialog)){ $display .= $this->dialog->execute(); /* Don't show buttons if tab dialog requests this */ diff --git a/plugins/admin/fai/class_faiPackage.inc b/plugins/admin/fai/class_faiPackage.inc index b2bd44049..605df4b52 100644 --- a/plugins/admin/fai/class_faiPackage.inc +++ b/plugins/admin/fai/class_faiPackage.inc @@ -33,7 +33,6 @@ class faiPackage extends plugin var $cn = ""; // The class name for this object var $description = ""; // The description for this set of partitions var $is_dialog = false; // specifies which buttons will be shown to save or abort - var $dialog = NULL; // a dialog, e.g. new disk dialog var $SubObjects = array(); // All leafobjects of this object var $FAIdebianRelease = ""; // The selected release diff --git a/plugins/admin/fai/class_faiPartitionTable.inc b/plugins/admin/fai/class_faiPartitionTable.inc index aa5c27c27..52f587e58 100644 --- a/plugins/admin/fai/class_faiPartitionTable.inc +++ b/plugins/admin/fai/class_faiPartitionTable.inc @@ -17,7 +17,6 @@ class faiPartitionTable extends plugin var $description = ""; // The description for this set of partitions var $disks = array(); // All defined Disks var $is_dialog = false; // specifies which buttons will be shown to save or abort - var $dialog = NULL; // a dialog, e.g. new disk dialog var $FAIstate = ""; var $ui; @@ -189,7 +188,7 @@ class faiPartitionTable extends plugin */ if(isset($_POST['CancelDisk'])){ unset($this->dialog); - $this->dialog = NULL; + $this->dialog = FALSE; $this->is_dialog=false; } @@ -225,12 +224,12 @@ class faiPartitionTable extends plugin $this->disks[$disk['cn']]=$disk; unset($this->dialog); - $this->dialog = NULL; + $this->dialog = FALSE; $this->is_dialog=false; ksort($this->disks); } }else{ - $this->dialog = NULL; + $this->dialog = FALSE; $this->is_dialog=false; } } diff --git a/plugins/admin/fai/class_faiProfile.inc b/plugins/admin/fai/class_faiProfile.inc index 19ae476c5..0f429041e 100644 --- a/plugins/admin/fai/class_faiProfile.inc +++ b/plugins/admin/fai/class_faiProfile.inc @@ -21,7 +21,6 @@ class faiProfile extends plugin var $cn = ""; // The class name for this object var $description = ""; // The description for this set of partitions var $is_dialog = false; // specifies which buttons will be shown to save or abort - var $dialog = NULL; // a dialog, e.g. new disk dialog var $FAIclass = ""; // Classnames used for this profile var $FAIclasses = array(); // Contains classname seperated in an array var $FAIAllclasses = array(); // Contains all possible Classnames @@ -276,7 +275,7 @@ class faiProfile extends plugin } $this->is_dialog=false; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; //ksort($this->FAIclasses); } } @@ -285,7 +284,7 @@ class faiProfile extends plugin if(isset($_POST['CancelSubObject'])){ $this->is_dialog=false; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } if(is_object($this->dialog)){ diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index 243fdef95..a595a0289 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -33,7 +33,6 @@ class faiScript extends plugin var $cn = ""; // The class name for this object var $description = ""; // The description for this set of partitions var $is_dialog = false; // specifies which buttons will be shown to save or abort - var $dialog = NULL; // a dialog, e.g. new disk dialog var $SubObjects = array(); // All leafobjects of this object var $FAIstate = ""; @@ -268,7 +267,7 @@ class faiScript extends plugin } $this->is_dialog=false; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } } @@ -301,7 +300,7 @@ class faiScript extends plugin if(isset($_POST['CancelSubObject'])){ $this->is_dialog=false; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } /* Print dialog if $this->dialog is set */ diff --git a/plugins/admin/fai/class_faiTemplate.inc b/plugins/admin/fai/class_faiTemplate.inc index 5b166123c..68c1ec045 100644 --- a/plugins/admin/fai/class_faiTemplate.inc +++ b/plugins/admin/fai/class_faiTemplate.inc @@ -33,7 +33,6 @@ class faiTemplate extends plugin var $cn = ""; // The class name for this object var $description = ""; // The description for this set of partitions var $is_dialog = false; // specifies which buttons will be shown to save or abort - var $dialog = NULL; // a dialog, e.g. new disk dialog var $SubObjects = array(); // All leafobjects of this object var $FAIstate = ""; @@ -242,7 +241,7 @@ class faiTemplate extends plugin } $this->is_dialog=false; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } } @@ -261,7 +260,7 @@ class faiTemplate extends plugin if(isset($_POST['CancelSubObject'])){ $this->is_dialog=false; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } /* Print dialog if $this->dialog is set */ diff --git a/plugins/admin/fai/class_faiVariable.inc b/plugins/admin/fai/class_faiVariable.inc index f52917cda..9dea39748 100644 --- a/plugins/admin/fai/class_faiVariable.inc +++ b/plugins/admin/fai/class_faiVariable.inc @@ -31,7 +31,6 @@ class faiVariable extends plugin var $cn = ""; // The class name for this object var $description = ""; // The description for this set of partitions var $is_dialog = false; // specifies which buttons will be shown to save or abort - var $dialog = NULL; // a dialog, e.g. new disk dialog var $SubObjects = array(); // All leafobjects of this object var $FAIstate = ""; @@ -186,7 +185,7 @@ class faiVariable extends plugin } $this->is_dialog=false; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } } @@ -205,7 +204,7 @@ class faiVariable extends plugin if(isset($_POST['CancelSubObject'])){ $this->is_dialog=false; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } /* Print dialog if $this->dialog is set */ diff --git a/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/plugins/admin/mimetypes/class_mimetypeGeneric.inc index e70c21a02..2e21c24f9 100644 --- a/plugins/admin/mimetypes/class_mimetypeGeneric.inc +++ b/plugins/admin/mimetypes/class_mimetypeGeneric.inc @@ -41,7 +41,6 @@ class mimetype extends plugin /* Mime type release mode */ var $isReleaseMimeType = false; - var $dialog = NULL; /* These vars will be copied too, if you use copy&paste mode */ var $CopyPasteVars = array("use_gotoMimeFilePattern","use_gotoMimeApplication","use_gotoMimeEmbeddedApplication","iconData", diff --git a/plugins/admin/systems/class_goSpamServer.inc b/plugins/admin/systems/class_goSpamServer.inc index 174ef5a9b..e62bb401b 100644 --- a/plugins/admin/systems/class_goSpamServer.inc +++ b/plugins/admin/systems/class_goSpamServer.inc @@ -36,7 +36,6 @@ class gospamserver extends goService{ var $saFlagsD = false; var $saFlagsP = false; - var $dialog = NULL; var $ui = NULL; var $acl = NULL; var $view_logged =FALSE; @@ -118,7 +117,7 @@ class gospamserver extends goService{ /* Cancel adding/editing specified rule */ if(isset($_POST['CancelRule'])){ - $this->dialog = NULL; + $this->dialog = FALSE; } /* Handle post to delete rules */ @@ -154,7 +153,7 @@ class gospamserver extends goService{ unset($this->Rules[$ret['orig_name']]); } $this->Rules[$ret['name']] = $ret['rule']; - $this->dialog = NULL; + $this->dialog = FALSE; } } diff --git a/plugins/admin/systems/class_goVirusServer.inc b/plugins/admin/systems/class_goVirusServer.inc index 7c7f94fb6..0d7cd7159 100644 --- a/plugins/admin/systems/class_goVirusServer.inc +++ b/plugins/admin/systems/class_goVirusServer.inc @@ -16,7 +16,6 @@ class govirusserver extends goService{ var $cn = ""; var $avStatus = ""; - var $dialog = NULL; var $ui = NULL; var $Flags = array("D","S","A","E"); diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 5b77578fe..c1b7ae244 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -34,8 +34,6 @@ class printgeneric extends plugin var $member =array(); var $strings = ""; - var $dialog =NULL; - var $netConfigDNS; var $baseSelection = false; var $macAddress = ""; @@ -428,7 +426,7 @@ class printgeneric extends plugin /* Close ppd dialog */ if(isset($_POST['ClosePPD'])){ unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } /* Save selected ppd */ @@ -443,7 +441,7 @@ class printgeneric extends plugin $this->gotoPrinterPPD = $this->dialog->save(); $this->PPDdialogToSave = $this->dialog; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } } @@ -475,7 +473,7 @@ class printgeneric extends plugin /* Abort user / group adding dialog */ if(isset($_POST['PrinterCancel'])){ unset($this->dialog); - $this->dialog= NULL; + $this->dialog= FALSE; } /* Save selected users / groups */ @@ -492,12 +490,12 @@ class printgeneric extends plugin $this->AddMember($new['type'], $mem['dn']); } unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } } /* Display dialog, if there is currently one open*/ - if($this->dialog !== NULL){ + if(is_object($this->dialog)){ $this->dialog->save_object(); $display = $this->dialog->execute(); return $display; diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc index edeecca77..f8b4433aa 100644 --- a/plugins/admin/systems/class_printerPPDDialog.inc +++ b/plugins/admin/systems/class_printerPPDDialog.inc @@ -25,7 +25,6 @@ class printerPPDDialog extends plugin /* Object Info */ var $cn = "" ; // Used to tag the ppds modified by the printer object, - var $dialog = NULL; // Contains sub dialogs function printerPPDDialog (&$config, $dn= NULL, $ppdfile=NULL ) { @@ -124,19 +123,19 @@ class printerPPDDialog extends plugin /* The selection dialog fpr PPDs is canceled */ if(isset($_POST['ClosePPDSelection'])){ unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } /* Div Selection */ if((isset($_GET['act']))&&($_GET['act']=="use")){ $this->SelectPPD(base64_decode($_GET['id'])); unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } /* if a dialog is open, print the dialog instead of this class */ - if($this->dialog!==NULL){ + if(is_object($this->dialog)){ $display = $this->dialog->execute(); return($display); } diff --git a/plugins/admin/systems/class_servDHCP.inc b/plugins/admin/systems/class_servDHCP.inc index aea61346b..eaeafbc3c 100644 --- a/plugins/admin/systems/class_servDHCP.inc +++ b/plugins/admin/systems/class_servDHCP.inc @@ -124,13 +124,13 @@ class servdhcp extends goService $this->dialog= new $section($this->current_object); $this->current_object= ""; } else { - $this->dialog= NULL; + $this->dialog= FALSE; } } /* Cancel section creation? */ if (isset($_POST['cancel_section']) || isset($_POST['cancel_dhcp'])){ - $this->dialog= NULL; + $this->dialog= FALSE; } /* Save changes */ @@ -200,7 +200,7 @@ class servdhcp extends goService $this->dhcpObjectCache[$data['dn']]= $data; } } - $this->dialog= NULL; + $this->dialog= FALSE; } } @@ -220,7 +220,7 @@ class servdhcp extends goService } else { print_red(_("You're not allowed to remove DHCP sections!")); } - $this->dialog= NULL; + $this->dialog= FALSE; } /* Look for post entries */ @@ -314,7 +314,7 @@ class servdhcp extends goService /* Show dialog */ - if($this->dialog !== NULL && !is_int($this->dialog) && is_object($this->dialog)){ + if(isset($this->dialog) && is_object($this->dialog)){ $this->dialog->save_object(); $this->dialog->parent = $this; return($this->dialog->execute()); diff --git a/plugins/admin/systems/class_servDNS.inc b/plugins/admin/systems/class_servDNS.inc index 4f5ed149b..4603a4394 100644 --- a/plugins/admin/systems/class_servDNS.inc +++ b/plugins/admin/systems/class_servDNS.inc @@ -14,7 +14,6 @@ class servdns extends goService var $RecordTypes = array(); var $Zones = array(); - var $dialog = NULL; var $orig_dn = ""; @@ -197,14 +196,14 @@ class servdns extends goService unset($this->Zones[$this->dialog->OldZoneName]); } $this->Zones[$ret['zoneName']] = $ret; - $this->dialog = NULL; + $this->dialog = FALSE; } } /* Cancel zone edit / new */ if(isset($_POST['CancelZoneChanges'])){ - $this->dialog = NULL; + $this->dialog = FALSE; } /* Add empty new zone @@ -257,7 +256,7 @@ class servdns extends goService /* Show dialog */ - if($this->dialog!== NULL){ + if(is_object($this->dialog)){ $this->dialog->save_object(); $this->dialog->parent = $this; return($this->dialog->execute()); diff --git a/plugins/admin/systems/class_servRepository.inc b/plugins/admin/systems/class_servRepository.inc index 41c84d330..c95860729 100644 --- a/plugins/admin/systems/class_servRepository.inc +++ b/plugins/admin/systems/class_servRepository.inc @@ -15,9 +15,6 @@ class servrepository extends goService /* Search filter */ var $regex = "*"; - /* Configurationdialog for repositories */ - var $dialog = NULL; - /* Repositories */ var $repositories = array(); var $FAIrepository = array(); @@ -229,17 +226,17 @@ class servrepository extends goService }else{ $this->repositories[$obj['Release']]=$obj; } - $this->dialog = NULL; + $this->dialog = FALSE; $this->is_dialog= false; } } if(isset($_POST['repository_setup_cancel'])){ - $this->dialog=NULL; + $this->dialog=FALSE; $this->is_dialog = false; } - if($this->dialog !== NULL){ + if(is_object($this->dialog)){ $this->dialog->save_object(); $this->is_dialog = true; return($this->dialog->execute()); diff --git a/plugins/admin/systems/class_serverService.inc b/plugins/admin/systems/class_serverService.inc index cb50f5d03..069c2e5d5 100644 --- a/plugins/admin/systems/class_serverService.inc +++ b/plugins/admin/systems/class_serverService.inc @@ -23,7 +23,6 @@ class ServerService extends plugin var $objectclasses = array(); var $divList = NULL; - var $dialog = NULL; // Contains dialog object if a dialog is opened var $plugins = array(); var $pluign_names = array(); @@ -159,7 +158,7 @@ class ServerService extends plugin /* Abort service add */ if(isset($_POST['CancelServiceAdd'])){ - $this->dialog = NULL; + $this->dialog = FALSE; $this->backup = NULL; $this->current = ""; } @@ -178,7 +177,7 @@ class ServerService extends plugin $this->plugins[$this->current]->$name = $value; } } - $this->dialog = NULL; + $this->dialog = FALSE; $this->backup = NULL; $this->current = ""; } @@ -199,7 +198,7 @@ class ServerService extends plugin $this->plugins[$this->current]->$name = $value; } $this->current = ""; - $this->dialog = NULL; + $this->dialog = FALSE; $this->backup = NULL; } } @@ -215,7 +214,7 @@ class ServerService extends plugin /* There is currently a subdialog open, display this dialog */ - if($this->dialog !== NULL){ + if(is_object($this->dialog)){ $this->dialog->save_object(); return($this->dialog->execute()); } diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 2d90fd0ba..24630f933 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -536,7 +536,7 @@ class environment extends plugin if(!$this->acl_is_writeable("gotoLogonScript")){ print_red(_("You are not allowed to write Logon scripts.")); unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; $this->is_dialog=false; }else{ $this->dialog->save_object(); @@ -547,7 +547,7 @@ class environment extends plugin }else{ $tmp = $this->dialog->save(); unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; $this->is_dialog=false; $this->gotoLogonScripts[$tmp['LogonName']]=$tmp; } @@ -559,7 +559,7 @@ class environment extends plugin if(isset($_POST['LogonCancel'])){ $this->is_dialog= false; unset($this->dialog); - $this->dialog= NULL; + $this->dialog= FALSE; } /* Check Edit Del New Posts for a selected LogonScript */ @@ -754,7 +754,7 @@ class environment extends plugin /* Dialog Aborted */ if(isset($_POST['HotPlugCancel'])){ unset($this->dialog); - $this->dialog= NULL; + $this->dialog= FALSE; $this->is_dialog = false; } @@ -776,7 +776,7 @@ class environment extends plugin } } unset($this->dialog); - $this->dialog= NULL; + $this->dialog= FALSE; $this->is_dialog = false; } } @@ -800,7 +800,7 @@ class environment extends plugin if(isset($_POST['PrinterCancel'])){ $this->is_dialog=false; unset($this->dialog); - $this->dialog=NULL; + $this->dialog=FALSE; } if(isset($_POST['PrinterSave'])){ @@ -849,7 +849,7 @@ class environment extends plugin $this->is_dialog=false; unset($this->dialog); - $this->dialog =NULL; + $this->dialog =FALSE; } } diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index e512206d8..e1536d2b2 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -255,13 +255,13 @@ class mailAccount extends plugin /* Cancel sieve edit */ if(isset($_POST['sieve_cancel'])){ - $this->dialog = NULL; + $this->dialog = FALSE; } /* Save sieve changes */ if(isset($_POST['sieve_finish'])){ $this->sieve_management = $this->dialog; - $this->dialog = NULL; + $this->dialog = FALSE; } if(is_object($this->dialog)){ diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc index d92c80f75..da4680a47 100644 --- a/plugins/personal/samba/class_sambaAccount.inc +++ b/plugins/personal/samba/class_sambaAccount.inc @@ -89,7 +89,6 @@ class sambaAccount extends plugin var $objectclasses= array(); var $uid= ""; - var $dialog = NULL; var $CopyPasteVars = array("kickoff_time_set","logoff_time_set","logon_time_set","mungedObject","orig_sambaDomainName"); function sambaAccount (&$config, $dn= NULL) @@ -248,7 +247,7 @@ class sambaAccount extends plugin /* Cancel dialog */ if(isset($_POST['cancel_logonHours'])){ - $this->dialog = NULL; + $this->dialog = FALSE; } /* Save selected logon hours */ @@ -257,7 +256,7 @@ class sambaAccount extends plugin if($this->acl_is_writeable("sambaLogonHours")){ $this->sambaLogonHours = $this->dialog->save(); } - $this->dialog = NULL; + $this->dialog = FALSE; } /* Display dialog */