Code

add dropdown with preferred language for the mediawiki authorization
authorguiguidoc <guiguidoc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Oct 2005 14:31:41 +0000 (14:31 +0000)
committerguiguidoc <guiguidoc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Oct 2005 14:31:41 +0000 (14:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1516 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/generic/class_user.inc
plugins/personal/generic/generic.tpl

index 8749a6627732d72e5c1382e93800841d88b27d0b..2df7054191fa4e15acc383b5c3f443921f7792b4 100644 (file)
@@ -45,6 +45,7 @@ class user extends plugin
   var $dob= "0";
   var $use_dob= "0";
   var $gender= "0";
+  var $preferredLanguage= "";
 
   var $jpegPhoto= "*removed*";
   var $photoData= "";
@@ -82,7 +83,7 @@ class user extends plugin
 
   /* attribute list for save action */
   var $attributes= array("sn", "givenName", "uid", "personalTitle", "academicTitle",
-      "homePostalAddress", "homePhone", "labeledURI", "o", "ou", "dob", "gender",
+      "homePostalAddress", "homePhone", "labeledURI", "o", "ou", "dob", "gender","preferredLanguage",
       "departmentNumber", "employeeNumber", "employeeType", "l", "st",
       "roomNumber", "telephoneNumber", "mobile", "pager", "cn", "userPKCS12",
       "postalAddress", "facsimileTelephoneNumber", "userSMIMECertificate");
@@ -247,6 +248,10 @@ class user extends plugin
     $sex= array(0 => "&nbsp;", "F" => _("female"), "M" => _("male"));
     $smarty->assign("gender_list", $sex);
 
+    /* Assign prefered langage */
+    $language= array(0 => "&nbsp;", "fr_FR" => _("fr_FR"), "en_EN" => _("en_EN"), "de_DE" => _("de_DE"), "it_IT" => _("it_IT"));
+    $smarty->assign("preferredLanguage_list", $language);
+
     /* Get random number for pictures */
     srand((double)microtime()*1000000); 
     $smarty->assign("rand", rand(0, 10000));
@@ -661,6 +666,13 @@ class user extends plugin
         $this->attrs["gender"]= array();
       }
     }
+      if ($this->preferredLanguage == "0"){
+      if ($this->new) {
+        unset($this->attrs["preferredLanguage"]);
+      } else {
+        $this->attrs["preferredLanguage"]= array();
+      }
+    }
 
     /* Special handling for attribute jpegPhote needed, scale image via
        image magick to 147x200 pixels and inject resulting data. */
index d4592e39e4852d93d2c80faf092bb83bc2b04583..1614fa0cb404a75c60b4b84969928b70f5162c60 100644 (file)
       </select>
      </td>
     </tr>
+    <tr>
+     <td>
+      <label for="preferredLanguage">{t}Prefered langage{/t}</label>
+     </td>
+     <td>
+      <select size="1" id="preferredLanguage" name="preferredLanguage" {$preferredLanguageACL}>
+       {html_options options=$preferredLanguage_list selected=$preferredLanguage}
+      </select>
+     </td>
+    </tr>
     <tr>
      <td>
       <div style="height:10px;"></div>