/**
  * Get multi lang header
  *
  * @param
  * @return
  */
 static function getMultiLangHeader($a_lm_id, $a_gui_class)
 {
     global $lng, $ilCtrl;
     // multi language
     include_once "./Services/COPage/classes/class.ilPageMultiLang.php";
     $ml = new ilPageMultiLang("lm", $a_lm_id);
     if ($ml->getActivated()) {
         $lng->loadLanguageModule("meta");
         // info
         include_once "./Services/COPage/classes/class.ilPageMultiLangGUI.php";
         $ml_gui = new ilPageMultiLangGUI("lm", $a_lm_id);
         include_once "./Services/COPage/classes/class.ilPageMultiLangGUI.php";
         $ml_head = $ml_gui->getMultiLangInfo($_GET["transl"]);
         // language switch
         include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
         $list = new ilAdvancedSelectionListGUI();
         $list->setListTitle($lng->txt("actions"));
         $list->setId("copage_act");
         $entries = false;
         if (!in_array($_GET["transl"], array("", "-"))) {
             $l = $ml->getMasterLanguage();
             $list->addItem($lng->txt("cont_edit_language_version") . ": " . $lng->txt("meta_l_" . $l), "", $ilCtrl->getLinkTarget($a_gui_class, "editMasterLanguage"));
             $entries = true;
         }
         foreach ($ml->getLanguages() as $al) {
             if ($_GET["transl"] != $al) {
                 $ilCtrl->setParameter($a_gui_class, "totransl", $al);
                 $list->addItem($lng->txt("cont_edit_language_version") . ": " . $lng->txt("meta_l_" . $al), "", $ilCtrl->getLinkTarget($a_gui_class, "switchToLanguage"));
                 $ilCtrl->setParameter($a_gui_class, "totransl", $_GET["totransl"]);
             }
             $entries = true;
         }
         if ($entries) {
             $ml_head = '<div class="ilFloatLeft">' . $ml_head . '</div><div style="margin: 5px 0;" class="small ilRight">' . $list->getHTML() . "</div>";
         }
     }
     return $ml_head;
 }
示例#2
0
 /**
  * Add multi-language actions to menu
  *
  * @param
  * @return
  */
 function addMultiLangActionsAndInfo($a_list, $a_tpl)
 {
     global $lng, $ilCtrl;
     $any_items = false;
     $cfg = $this->getPageConfig();
     // general multi lang support and single page mode?
     if ($cfg->getMultiLangSupport()) {
         //include_once("./Services/COPage/classes/class.ilPageMultiLang.php");
         //$ml = new ilPageMultiLang($this->getPageObject()->getParentType(),
         //	$this->getPageObject()->getParentId());
         include_once "./Services/Object/classes/class.ilObjectTranslation.php";
         $ot = ilObjectTranslation::getInstance($this->getPageObject()->getParentId());
         if (!$ot->getContentActivated()) {
             /*				if ($cfg->getSinglePageMode())
             				{
             					$a_list->addItem($lng->txt("cont_activate_multi_lang"), "",
             						$ilCtrl->getLinkTargetByClass("ilpagemultilanggui", "activateMultilinguality"));
             	
             					$any_items = true;
             				}*/
         } else {
             $lng->loadLanguageModule("meta");
             //echo $this->getPageObject()->getLanguage();
             if ($this->getPageObject()->getLanguage() != "-") {
                 $l = $ot->getMasterLanguage();
                 $a_list->addItem($lng->txt("cont_edit_language_version") . ": " . $lng->txt("meta_l_" . $l), "", $ilCtrl->getLinkTarget($this, "editMasterLanguage"));
             }
             foreach ($ot->getLanguages() as $al => $lang) {
                 if ($this->getPageObject()->getLanguage() != $al && $al != $ot->getMasterLanguage()) {
                     $ilCtrl->setParameter($this, "totransl", $al);
                     $a_list->addItem($lng->txt("cont_edit_language_version") . ": " . $lng->txt("meta_l_" . $al), "", $ilCtrl->getLinkTarget($this, "switchToLanguage"));
                     $ilCtrl->setParameter($this, "totransl", $_GET["totransl"]);
                 }
             }
             /*				if ($cfg->getSinglePageMode())
             				{
             					$a_list->addItem($lng->txt("cont_manage_multilang"), "",
             						$ilCtrl->getLinkTargetByClass("ilpagemultilanggui", "settings"));
             				}*/
             include_once "./Services/COPage/classes/class.ilPageMultiLangGUI.php";
             $ml_gui = new ilPageMultiLangGUI($this->getPageObject()->getParentType(), $this->getPageObject()->getParentId());
             $a_tpl->setVariable("MULTI_LANG_INFO", $ml_gui->getMultiLangInfo($this->getPageObject()->getLanguage()));
             $any_items = true;
         }
     }
     return $any_items;
 }