~ubuntu-branches/ubuntu/vivid/gosa/vivid

« back to all changes in this revision

Viewing changes to goto/admin/mimetypes/tabs_mimetypes.inc

Tags: 2.7.1-1
* New upstream release
* Updated packaging to not include smarty (Closes: #620489)
* Fixed case of POSIX (Closes: #620486)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
class mimetabs extends tabs
 
4
{
 
5
  var $parent   = FALSE;
 
6
  var $FAIstate = "";  
 
7
 
 
8
  function mimetabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE)
 
9
  {
 
10
    tabs::tabs($config, $data, $dn,$category,$hide_refs , $hide_acls);
 
11
 
 
12
    /* Add references/acls/snapshots */
 
13
    $this->addSpecialTabs();
 
14
  }
 
15
 
 
16
  function set_FAIstate($state)
 
17
  {
 
18
    $this->FAIstate = $state;
 
19
    foreach($this->by_name as $name => $desc){
 
20
      $this->by_object[$name]->FAIstate = $state;
 
21
    }
 
22
  }
 
23
 
 
24
  function save($ignore_account= FALSE)
 
25
  {
 
26
    $baseobject= $this->by_object['mimetype'];
 
27
    $cn      = preg_replace('/,/', '\,', $baseobject->cn);
 
28
    $cn      = preg_replace('/"/', '\"', $cn);
 
29
 
 
30
    /* Check for new 'dn', in order to propagate the
 
31
       'dn' to all plugins */
 
32
 
 
33
    if($this->parent->IsReleaseManagementActivated()){
 
34
      $new_dn= "cn=".$cn.",".$this->parent->mime_release;
 
35
    }else{
 
36
      $new_dn= "cn=".$cn.",".get_ou("mimetype", "mimetypeRDN").$baseobject->base;
 
37
    }
 
38
 
 
39
    $new_dn =  @LDAP::convert($new_dn);
 
40
 
 
41
    /* Move group? */
 
42
    if ($this->dn != $new_dn){
 
43
 
 
44
      /* Write entry on new 'dn' */
 
45
      if ($this->dn != "new"){
 
46
        $baseobject->move($this->dn, $new_dn);
 
47
        $this->by_object['mimetype']= $baseobject;
 
48
      }
 
49
 
 
50
      /* Happen to use the new one */
 
51
      $this->dn= $new_dn;
 
52
    }
 
53
 
 
54
    tabs::save();
 
55
  }
 
56
 
 
57
}
 
58
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 
59
?>