/**
  * @param $message
  */
 protected function sendFailure($message)
 {
     $keep = $this->ctrl->isAsynch() ? false : true;
     $this->form->setValuesByPost();
     if ($this->ctrl->isAsynch()) {
         echo $this->tpl->getMessageHTML($message, 'failure') . $this->form->getHTML();
         exit;
     } else {
         ilUtil::sendFailure($message, $keep);
         $this->tpl->setContent($this->form->getHTML());
     }
 }
Exemplo n.º 2
0
 /**
  * Get HTML
  *
  * @param
  * @return
  */
 function getHTML()
 {
     global $lng, $ilCtrl;
     $lng->loadLanguageModule("tagging");
     $tpl = new ilTemplate("tpl.edit_tags.html", true, true, "Services/Tagging");
     $tpl->setVariable("TXT_TAGS", $lng->txt("tagging_tags"));
     switch ($_GET["mess"] != "" ? $_GET["mess"] : $this->mess) {
         case "mod":
             $mtype = "success";
             $mtxt = $lng->txt("msg_obj_modified");
             break;
     }
     if ($mtxt != "") {
         $tpl->setVariable("MESS", $tpl->getMessageHTML($mtxt, $mtype));
     } else {
         $tpl->setVariable("MESS", "");
     }
     $img = ilUtil::img(ilObject::_getIcon($this->obj_id, "tiny"));
     $tpl->setVariable("TXT_OBJ_TITLE", $img . " " . ilObject::_lookupTitle($this->obj_id));
     $tags = ilTagging::getTagsForUserAndObject($this->obj_id, $this->obj_type, $this->sub_obj_id, $this->sub_obj_type, $this->getUserId());
     $tpl->setVariable("VAL_TAGS", ilUtil::prepareFormOutput(implode($tags, " ")));
     $tpl->setVariable("TXT_SAVE", $lng->txt("save"));
     $tpl->setVariable("CMD_SAVE", "saveJS");
     $os = "ilTagging.cmdAjaxForm(event, '" . $ilCtrl->getFormActionByClass("iltagginggui", "", "", true) . "');";
     $tpl->setVariable("ON_SUBMIT", $os);
     echo $tpl->get();
     exit;
 }
Exemplo n.º 3
0
 /**
  * Get HTML
  *
  * @param
  * @return
  */
 function getHTML()
 {
     global $lng, $ilCtrl;
     $lng->loadLanguageModule("tagging");
     $tpl = new ilTemplate("tpl.edit_tags.html", true, true, "Services/Tagging");
     $tpl->setVariable("TXT_TAGS", $lng->txt("tagging_tags"));
     switch ($_GET["mess"] != "" ? $_GET["mess"] : $this->mess) {
         case "mod":
             $mtype = "success";
             $mtxt = $lng->txt("msg_obj_modified");
             break;
     }
     if ($mtxt != "") {
         $tpl->setVariable("MESS", $tpl->getMessageHTML($mtxt, $mtype));
     } else {
         $tpl->setVariable("MESS", "");
     }
     $img = ilUtil::img(ilObject::_getIcon($this->obj_id, "tiny"));
     $tpl->setVariable("TXT_OBJ_TITLE", $img . " " . ilObject::_lookupTitle($this->obj_id));
     $tags = ilTagging::getTagsForUserAndObject($this->obj_id, $this->obj_type, $this->sub_obj_id, $this->sub_obj_type, $this->getUserId());
     $tpl->setVariable("VAL_TAGS", ilUtil::prepareFormOutput(implode($tags, " ")));
     $tpl->setVariable("TXT_SAVE", $lng->txt("save"));
     $tpl->setVariable("CMD_SAVE", "saveJS");
     $os = "ilTagging.cmdAjaxForm(event, '" . $ilCtrl->getFormActionByClass("iltagginggui", "", "", true) . "');";
     $tpl->setVariable("ON_SUBMIT", $os);
     $tags_set = new ilSetting("tags");
     if ($tags_set->get("enable_all_users")) {
         $tpl->setVariable("TAGS_TITLE", $lng->txt("tagging_my_tags"));
         $all_obj_tags = ilTagging::_getListTagsForObjects(array($this->obj_id));
         $all_obj_tags = $all_obj_tags[$this->obj_id];
         if (is_array($all_obj_tags) && sizeof($all_obj_tags) != sizeof($tags)) {
             $tpl->setVariable("TITLE_OTHER", $lng->txt("tagging_other_users"));
             $tpl->setCurrentBlock("tag_other_bl");
             foreach ($all_obj_tags as $tag => $is_owner) {
                 if (!$is_owner) {
                     $tpl->setVariable("OTHER_TAG", $tag);
                     $tpl->parseCurrentBlock();
                 }
             }
         }
     }
     echo $tpl->get();
     exit;
 }