예제 #1
0
 public function editTranslations($a_get_post_values = false, $a_add = false)
 {
     $this->lng->loadLanguageModule($this->ilObjectOrgUnit->getType());
     $table = new ilObjectTranslationTableGUI($this, "editTranslations", true, "Translation");
     if ($a_get_post_values) {
         $vals = array();
         foreach ($_POST["title"] as $k => $v) {
             $vals[] = array("title" => $v, "desc" => $_POST["desc"][$k], "lang" => $_POST["lang"][$k], "default" => $_POST["default"] == $k);
         }
         $table->setData($vals);
     } else {
         $data = $this->ilObjectOrgUnit->getTranslations();
         foreach ($data["Fobject"] as $k => $v) {
             $data["Fobject"][$k]["default"] = $k == $data["default_language"];
         }
         if ($a_add) {
             $data["Fobject"][++$k]["title"] = "";
         }
         $table->setData($data["Fobject"]);
     }
     $this->tpl->setContent($table->getHTML());
 }
예제 #2
0
 /**
  * Show header title
  */
 function showHeaderTitleObject($a_get_post_values = false)
 {
     global $tpl;
     $this->setGeneralSettingsSubTabs("header_title");
     include_once "./Services/Object/classes/class.ilObjectTranslationTableGUI.php";
     $table = new ilObjectTranslationTableGUI($this, "showHeaderTitle", false);
     if ($a_get_post_values) {
         $vals = array();
         foreach ($_POST["title"] as $k => $v) {
             $vals[] = array("title" => $v, "desc" => $_POST["desc"][$k], "lang" => $_POST["lang"][$k], "default" => $_POST["default"] == $k);
         }
         $table->setData($vals);
     } else {
         $data = $this->object->getHeaderTitleTranslations();
         if (is_array($data["Fobject"])) {
             foreach ($data["Fobject"] as $k => $v) {
                 if ($k == $data["default_language"]) {
                     $data["Fobject"][$k]["default"] = true;
                 } else {
                     $data["Fobject"][$k]["default"] = false;
                 }
             }
         } else {
             $data["Fobject"] = array();
         }
         $table->setData($data["Fobject"]);
     }
     $tpl->setContent($table->getHTML());
 }
 /**
  * Edit title and translations
  */
 function editTranslationsObject($a_get_post_values = false, $a_add = false)
 {
     global $tpl;
     $this->lng->loadLanguageModule($this->object->getType());
     $this->setEditTabs("settings_trans");
     include_once "./Services/Object/classes/class.ilObjectTranslationTableGUI.php";
     $table = new ilObjectTranslationTableGUI($this, "editTranslations", true, "Translation");
     if ($a_get_post_values) {
         $vals = array();
         foreach ($_POST["title"] as $k => $v) {
             $vals[] = array("title" => $v, "desc" => $_POST["desc"][$k], "lang" => $_POST["lang"][$k], "default" => $_POST["default"] == $k);
         }
         $table->setData($vals);
     } else {
         $data = $this->object->getTranslations();
         foreach ($data["Fobject"] as $k => $v) {
             $data["Fobject"][$k]["default"] = $k == $data["default_language"];
         }
         if ($a_add) {
             $data["Fobject"][++$k]["title"] = "";
         }
         $table->setData($data["Fobject"]);
     }
     $tpl->setContent($table->getHTML());
 }