コード例 #1
0
 /**
  * Get HTML for file link
  * @return	string		file link html
  */
 function getFileLinkHTML()
 {
     global $ilCtrl, $lng;
     if (!is_object($this->uploaded_file)) {
         $tpl = new ilTemplate("tpl.link_file.html", true, true, "Modules/LearningModule");
         $tpl->setCurrentBlock("form");
         $tpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this, "saveFileLink", "", true));
         $tpl->setVariable("TXT_SELECT_FILE", $lng->txt("cont_select_file"));
         $tpl->setVariable("TXT_SAVE_LINK", $lng->txt("cont_create_link"));
         $tpl->setVariable("CMD_SAVE_LINK", "saveFileLink");
         include_once "./Services/Form/classes/class.ilFileInputGUI.php";
         $fi = new ilFileInputGUI("", "link_file");
         $fi->setSize(15);
         $tpl->setVariable("INPUT", $fi->getToolbarHTML());
         $tpl->parseCurrentBlock();
         return $tpl->get();
     } else {
         $tpl = new ilTemplate("tpl.link_file.html", true, true, "Modules/LearningModule");
         $tpl->setCurrentBlock("link_js");
         //			$tpl->setVariable("LINK_FILE",
         //				$this->prepareJavascriptOutput("[iln dfile=\"".$this->uploaded_file->getId()."\"] [/iln]")
         //				);
         $tpl->setVariable("TAG_B", '[iln dfile=\\x22' . $this->uploaded_file->getId() . '\\x22]');
         $tpl->setVariable("TAG_E", "[/iln]");
         $tpl->setVariable("TXT_FILE", $this->uploaded_file->getTitle());
         //			$tpl->parseCurrentBlock();
         return $tpl->get();
     }
 }