summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dcf2480)
raw | patch | inline | side by side (parent: dcf2480)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 28 Jun 2006 11:23:24 +0000 (11:23 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 28 Jun 2006 11:23:24 +0000 (11:23 +0000) |
Fixed saving; array() attributes produced errors on ldap->add
Fixed radio buttons, one of them must be selected
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3959 594d385d-05f5-0310-b6e9-bd551577e9d8
Fixed radio buttons, one of them must be selected
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3959 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/mimetypes/class_mimetypeGeneric.inc | patch | blob | history |
diff --git a/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/plugins/admin/mimetypes/class_mimetypeGeneric.inc
index 95ac692ab01e1e2abb215d637c9459ade0f67500..33932e2c61ecad3ab446db7f2c17dd089c85d391 100644 (file)
var $ui;
var $cn = "";
var $gotoMimeLeftClickAction = "I";
- var $gotoMimeLeftClickAction_I = false;
+ var $gotoMimeLeftClickAction_I = true;
var $gotoMimeLeftClickAction_E = false;
var $gotoMimeLeftClickAction_Q = false;
var $gotoMimeIcon = "*removed*";
+ var $use_gotoMimeIcon = NULL;
var $description = "";
var $gotoMimeFilePattern = array();
var $gotoMimeApplication = array();
/* Select options */
var $MimeGroups = array("video","audio","system");
-
+
+ /* Orig_Dn is used to verify if this object is new or only edited */
+ var $orig_dn = "";
function mimetype($config,$dn= NULL)
{
plugin::plugin ($config, $dn);
+ /* Save original dn */
+ $this->orig_dn = $dn;
+
/* get gotoMimeLeftClickActions I/E/Q */
if(isset($this->gotoMimeLeftClickAction)){
$str = $this->gotoMimeLeftClickAction;
}
}
+ /* If both radio buttons arn't set, set option I */
+ if(!$this->gotoMimeLeftClickAction_I && !$this->gotoMimeLeftClickAction_E){
+ $this->gotoMimeLeftClickAction_I = true;
+ }
+
/* Get list of array attributes */
foreach(array("gotoMimeFilePattern") as $attr){
$this->$attr = array();
foreach($this->$use_attr as $entry){
$tmp[] = $entry."|".$i ++;
}
- if($this->new && count($tmp) == 0){
- $this->$attr = "";
- }
+ $this->$attr = $tmp;
}
/* Create array entries */
$i = 0;
$use_attr = "use_".$attr;
$tmp = array();
- $this->$attr = "";
+ $this->$attr = array();
foreach($this->$use_attr as $entry){
$tmp[] = $entry;
}
$this->$attr = $tmp;
}
+ if($this->use_gotoMimeIcon != "*removed*"){
+ $this->gotoMimeIcon = $this->iconData;
+ }else{
+ $this->gotoMimeIcon = "";
+ }
+
plugin::save();
- if($this->gotoMimeIcon != "*removed"){
- $this->attrs['gotoMimeIcon'] = $this->iconData;
+ /* If this is a newly created object, skip storing those
+ attributes that contain an empty array */
+ if($this->orig_dn == "new"){
+ foreach(array("gotoMimeEmbeddedApplication","gotoMimeApplication","gotoMimeFilePattern") as $attr){
+ if(!count($this->$attr)){
+ unset($this->attrs[$attr]);
+ }
+ }
}
-
+
+
$ldap = $this->config->get_ldap_link();
$ldap-> cd ( $this->config->current['BASE']);
$ldap->cat($this->dn);
{
if (empty($filename)){
$filename= "./images/default_icon.png";
- $this->gotoMimeIcon= "*removed*";
+ $this->use_gotoMimeIcon= "*removed*";
}
if (file_exists($filename)){