summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 334ab62)
raw | patch | inline | side by side (parent: 334ab62)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 12 Dec 2007 09:08:55 +0000 (09:08 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 12 Dec 2007 09:08:55 +0000 (09:08 +0000) |
-Preset attributes which are used in all objects
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8090 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8090 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_multi_plug.inc | patch | blob | history | |
include/class_plugin.inc | patch | blob | history | |
include/class_tabs.inc | patch | blob | history |
index 0012b2710187343c5b123fd6e1009771c6590c41..e9851afc1a8bd00044e9bcea7befd841efff5f62 100644 (file)
$this->a_handles[] = $obj;
}
}
+
+ /* Detect attributes used by all plugins and set
+ * those values as default in edit handle
+ */
+ $this->detect_multiple_used_attributes();
+ }
+
+
+ /*! \brief Detect values that are used in all edited objects.
+ * @returns array All multiple used attributes
+ */
+ private function detect_multiple_used_attributes()
+ {
+ $attrs = array();
+ restore_error_handler();
+ $first = $this->o_tab->current;
+ foreach($this->a_handles as $handle){
+ if(count($attrs) == 0){
+ $attrs = $handle->by_object[$first]->attrs;
+ }else{
+
+ foreach($attrs as $key => $attr){
+ if(!isset($handle->by_object[$first]->attrs[$key]) || !($attr === $handle->by_object[$first]->attrs[$key])){
+ unset($attrs[$key]);
+ }
+ }
+ }
+ }
+ foreach($this->o_tab->by_object as $name => $obj){
+ $this->o_tab->by_object[$name]->init_multiple_support($attrs);
+ }
}
+
/*! \brief Returns the edit ui for multiple edit.
@return string HTML User interface for given tab object.
*/
index 7b7910445863afe5bc85de3bb60d07c1fea0355a..5a209ab39642c4b9565b795d76291913be349837 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
}
-
-
- function set_multi_edit_value()
- {
-
- }
-
-
/*! \brief Prepares the plugin to be used for multiple edit
+ * Update plugin attributes with given array of attribtues.
+ * @param array Array with attributes that must be updated.
*/
- function init_multiple_support()
+ function init_multiple_support($attrs)
{
+ $ldap= $this->config->get_ldap_link();
+ $this->attrs= $attrs;
+
+ /* Copy needed attributes */
+ foreach ($this->attributes as $val){
+ $found= array_key_ics($val, $this->attrs);
+ if ($found != ""){
+ $this->$val= $this->attrs["$found"][0];
+ }
+ }
}
diff --git a/include/class_tabs.inc b/include/class_tabs.inc
index b6060399a900df6941ec959b1088591ac4f9494a..d6ed872a5eafa3168976b0b3885d1c0602e516dc 100644 (file)
--- a/include/class_tabs.inc
+++ b/include/class_tabs.inc
foreach($this->by_object as $name => $obj){
if($obj->multiple_support){
$this->by_object[$name]->multiple_support_active = TRUE;
- $this->by_object[$name]->init_multiple_support();
}else{
unset($this->by_object[$name]);
unset($this->by_name[$name]);