summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cbb8b9b)
raw | patch | inline | side by side (parent: cbb8b9b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 17 Dec 2007 10:59:50 +0000 (10:59 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 17 Dec 2007 10:59:50 +0000 (10:59 +0000) |
-Prepared mail account to be edited.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8135 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8135 594d385d-05f5-0310-b6e9-bd551577e9d8
index 801e4a7be0dcebc29dde3b0b3b3243199d9b8d6c..84637992ea8c04bba4320b6b7d997477246927a8 100644 (file)
...
|->tab object for dn n
+
+Other functions implemented:
+============================
+
+CLASS tab
+ - multiple_support_available() Check if there is at least one plugin with
+ enabled multiple edit support
+ - enable_multiple_support() Enable multiple edit, for this tab.
+
+CLASS plugin
+ - enable_multiple_support() Enable multiple support for this plugin.
+ - init_multiple_support() Init summy object, to preset some values.
+ - multiple_execute() Display dummy object ui.
+ - multiple_save_object() Get posted values in multiple edit mode.
+ - multiple_check() Check values specified in dummy object.
+ - get_multi_edit_values() Get values changed from dummy object.
+ - set_multi_edit_values() Set values collected with get_multi_edit_values.
+ to all objects currently edited.
+
+
+Process:
+========
+
+multi_plug::multi_plug()
+ |->o_tab = new tab() #Initialize ui handle
+ |
+ |->handles
+ | |->handles[] = new tab() #Initialize objects we want to edit at once
+ |
+ |->o_tab->enable_multiple_support() #Enable multiple support for ui handle
+ |->detect_multiple_used_attributes() #Update ui handle with some default values
+ |->handles->attrs
+ |->ui->attrs
+ |
+ |->execute() #Display ui
+ | |->o_tab->execute()
+ |->by_object->multiple_execute()
+ |
+ |->check() #Check given values
+ |->o_tab->check()
+ |->by_object->multiple_check()
+ |
+ |->save_object() #Save posts
+ |->o_tab->save_object()
+ |->by_object->multiple_save_object()
+ |
+ |->save() #Save collected values
+ |->populate_values() #Populate values to all handles
+ |->o_tab->get_multi_edit_values() #Get values to populate
+ |->handles->set_multi_edit_values() #Set values
+ |->handles->save() #Save handles
+
+
+
+
Using this class:
=================
Simple Example:
/*! \brief Detect values that are used in all edited objects.
- * @returns array All multiple used attributes
*/
private function detect_multiple_used_attributes()
{
index 458aa41e35c6111693d44e8bd7e14953008cc570..0257297037f0d8272c7cdb346f2d2e3b3699d95d 100644 (file)
}
}
+
+ /*! \brief Enables multiple support for this plugin
+ */
+ function enable_multiple_support()
+ {
+ $this->multiple_support_active = TRUE;
+ }
+
/*! \brief Returns all values that have been modfied in multiple edit mode.
@return array Cotaining all mdofied values.
index d6ed872a5eafa3168976b0b3885d1c0602e516dc..aa70a46262944de6fd532aa4bea0eec0d1a6241b 100644 (file)
$this->multiple_support_active = TRUE;
foreach($this->by_object as $name => $obj){
if($obj->multiple_support){
- $this->by_object[$name]->multiple_support_active = TRUE;
+ $this->by_object[$name]->enable_multiple_support();
}else{
unset($this->by_object[$name]);
unset($this->by_name[$name]);
diff --git a/gosa-core/plugins/personal/environment/class_environment.inc b/gosa-core/plugins/personal/environment/class_environment.inc
index 86265ba2402232a777b98661fcf6236f2706f003..35a15daed1a303d8bdd15049d3a8445bd1657fc8 100644 (file)
}
}
}
- $this->gotoHotplugDevices = array_values($this->gotoHotplugDevices);
- $this->gotoHotplugDevices = array_values($tmp);
+ $this->gotoHotplugDevices = array_values($this->gotoHotplugDevices);
for($i = 0 ; $i < strlen($this->gotoProfileFlags) ; $i ++){
$chr = $this->gotoProfileFlags[$i];
$name = "gotoProfileFlag".$chr;
$this->$name=$chr;
}
-$this->update_kiosk_profiles();
-$this->gotoKioskProfile= preg_replace("/^.*\//i","",$this->gotoKioskProfile);
+ $this->update_kiosk_profiles();
+ $this->gotoKioskProfile= preg_replace("/^.*\//i","",$this->gotoKioskProfile);
if((!empty($this->gotoProfileServer))||($this->gotoProfileFlagC=="C")){
$this->useProfile = true;
diff --git a/gosa-core/plugins/personal/mail/class_mailAccount.inc b/gosa-core/plugins/personal/mail/class_mailAccount.inc
index 4b6a7b9ef8e130f11c42f8b1fc75eaa551c82f95..6d919d3441b915fae5b5e56479a8dc74c3c35e76 100644 (file)
var $uid = "";
var $sieve_management = NULL;
+ var $multiple_support = TRUE;
/* constructor, if 'dn' is set, the node loads the given
'dn' from LDAP */
}
/* Do we represent a valid account? */
- if (!$this->is_account && $this->parent === NULL){
- $display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\"> <b>".
- _("This account has no mail extensions.")."</b>";
+ if(!$this->multiple_support_active){
+ if (!$this->is_account && $this->parent === NULL){
+ $display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\"> <b>".
+ _("This account has no mail extensions.")."</b>";
- $display.= back_to_main();
- return ($display);
- }
+ $display.= back_to_main();
+ return ($display);
+ }
- /* Show tab dialog headers */
- if ($this->parent !== NULL){
- if ($this->is_account){
- if($this->accountDelegationsConfigured()){
- $display= $this->show_disable_header(_("Remove mail account"),
- _("This account can't be removed while there are delegations configured. Remove those delegations first."),TRUE,TRUE);
- }else{
- $display= $this->show_disable_header(_("Remove mail account"),
- _("This account has mail features enabled. You can disable them by clicking below."));
+ /* Show tab dialog headers */
+ if ($this->parent !== NULL){
+ if ($this->is_account){
+ if($this->accountDelegationsConfigured()){
+ $display= $this->show_disable_header(_("Remove mail account"),
+ _("This account can't be removed while there are delegations configured. Remove those delegations first."),TRUE,TRUE);
+ }else{
+ $display= $this->show_disable_header(_("Remove mail account"),
+ _("This account has mail features enabled. You can disable them by clicking below."));
+ }
+ } else {
+ $display= $this->show_enable_header(_("Create mail account"), _("This account has mail features disabled. You can enable them by clicking below."));
+ return ($display);
}
- } else {
- $display= $this->show_enable_header(_("Create mail account"), _("This account has mail features disabled. You can enable them by clicking below."));
- return ($display);
}
}
-
/* Forwarder subdialog */
/* Trigger forward add dialog? */
$smarty->assign("spamlevel", $spamlevel);
$smarty->assign("spambox", $this->mailboxList);
+ $smarty->assign("multiple_support",$this->multiple_support_active);
$display.= $smarty->fetch (get_template_path('generic.tpl', TRUE, dirname(__FILE__)));
return ($display);
}
}
}
}
+
+ /* Initialize plugin with given atribute arrays
+ */
+ function init_multiple_support($attrs,$all)
+ {
+ plugin::init_multiple_support($attrs,$all);
+
+
+ }
+
+ function multiple_execute()
+ {
+ return($this->execute());
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: