Esempio n. 1
0
 public function generateDBUpdateForInstallation()
 {
     $tpl = new ilTemplate(dirname(__FILE__) . '/templates/dbupdate.txt', true, true);
     $ar = $this->getAr();
     $tpl->setVariable('TABLE_NAME', $ar->getConnectorContainerName());
     $tpl->setVariable('TABLE_NAME2', $ar->getConnectorContainerName());
     $tpl->setVariable('TABLE_NAME3', $ar->getConnectorContainerName());
     $tpl->setVariable('STEP', $this->getStep());
     $tpl->setVariable('PRIMARY', $this->getAr()->getArFieldList()->getPrimaryFieldName());
     foreach ($this->getAr()->getArFieldList()->getFields() as $field) {
         $tpl->touchBlock('field');
         $tpl->setVariable('FIELD_NAME', $field->getName());
         foreach ($field->getAttributesForConnector() as $name => $value) {
             $tpl->setCurrentBlock('attribute');
             $tpl->setVariable('NAME', arFieldList::mapKey($name));
             $tpl->setVariable('VALUE', $value);
             $tpl->parseCurrentBlock();
         }
     }
     if ($this->getAr()->getArFieldList()->getPrimaryField()->getFieldType() == arField::FIELD_TYPE_INTEGER) {
         $tpl->setCurrentBlock('attribute');
         $tpl->setVariable('TABLE_NAME4', $ar->getConnectorContainerName());
         $tpl->parseCurrentBlock();
     }
     header('Content-type: application/x-httpd-php');
     header("Content-Disposition: attachment; filename=\"dbupdate.php\"");
     echo $tpl->get();
     exit;
 }
 public function insertIconsAndCheckboxes()
 {
     global $lng, $ilias;
     // FSX removed $this->getCheckboxStatus() in if-Statement: 0014726
     if (!$ilias->getSetting('custom_icons')) {
         parent::insertIconsAndCheckboxes();
         return;
     }
     $icons_cache = ilObjOrgUnit::getIconsCache();
     if (isset($icons_cache[$this->obj_id])) {
         $icon_file = $icons_cache[$this->obj_id];
         // icon link
         if (!$this->default_command or !$this->getCommandsStatus() and !$this->restrict_to_goto) {
         } else {
             $this->tpl->setCurrentBlock("icon_link_s");
             if ($this->default_command["frame"] != "") {
                 $this->tpl->setVariable("ICON_TAR", "target='" . $this->default_command["frame"] . "'");
             }
             $this->tpl->setVariable("ICON_HREF", $this->default_command["link"]);
             $this->tpl->parseCurrentBlock();
             $this->tpl->touchBlock("icon_link_e");
         }
         $this->enableIcon(false);
         if ($this->getContainerObject()->isActiveAdministrationPanel() && !$_SESSION['clipboard']) {
             $this->tpl->touchBlock("i_1");
             // indent main div  }
             $this->tpl->touchBlock("d_2");
             // indent main div  } #0014913
         } else {
             $this->tpl->touchBlock("d_1");
         }
         parent::insertIconsAndCheckboxes();
         $this->tpl->setCurrentBlock("icon");
         $this->tpl->setVariable("ALT_ICON", $lng->txt("icon") . " " . $lng->txt("obj_" . $this->getIconImageType()));
         $this->tpl->setVariable("SRC_ICON", $icon_file);
         $this->tpl->parseCurrentBlock();
         $this->enableIcon(true);
     } else {
         parent::insertIconsAndCheckboxes();
     }
 }
Esempio n. 3
0
 /**
  * Get icon html
  *
  * @param string $a_type icons type ICON_RSS | ICON_ICAL
  * @param string $a_href href
  * @return string icon html
  */
 static function get($a_type, $a_href = "")
 {
     $tpl = new ilTemplate("tpl.rss_icon.html", true, true, "Services/News");
     if ($a_href != "") {
         $tpl->setCurrentBlock("a_start");
         $tpl->setVariable("HREF", $a_href);
         $tpl->parseCurrentBlock();
         $tpl->touchBlock("a_end");
     }
     $text = "";
     switch ($a_type) {
         case self::ICON_RSS:
             $text = "RSS";
             break;
         case self::ICON_RSS_AUDIO:
             $text = "RSS Audio";
             break;
         case self::ICON_RSS_VIDEO:
             $text = "RSS Video";
             break;
         case self::ICON_ICAL:
             $text = "iCal";
             break;
         case self::ICON_ITUNES:
             $text = "iTunes";
             break;
         case self::ICON_ITUNES_AUDIO:
             $text = "iTunes Audio";
             break;
         case self::ICON_ITUNES_VIDEO:
             $text = "iTunes Video";
             break;
     }
     $tpl->setVariable("TEXT", $text);
     return $tpl->get();
 }
 /**
  * Returns the user and pass data for a test results output
  *
  * @param integer $active_id The active ID of the user
  * @return string HTML code of the user data for the test results
  * @access public
  */
 function getResultsHeadUserAndPass($active_id, $pass)
 {
     $template = new ilTemplate("tpl.il_as_tst_results_head_user_pass.html", TRUE, TRUE, "Modules/Test");
     include_once './Services/User/classes/class.ilObjUser.php';
     $user_id = $this->object->_getUserIdFromActiveId($active_id);
     if (strlen(ilObjUser::_lookupLogin($user_id)) > 0) {
         $user = new ilObjUser($user_id);
     } else {
         $user = new ilObjUser();
         $user->setLastname($this->lng->txt("deleted_user"));
     }
     $title_matric = "";
     if (strlen($user->getMatriculation()) && $this->object->getAnonymity() == FALSE) {
         $template->setCurrentBlock("user_matric");
         $template->setVariable("TXT_USR_MATRIC", $this->lng->txt("matriculation"));
         $template->parseCurrentBlock();
         $template->setCurrentBlock("user_matric_value");
         $template->setVariable("VALUE_USR_MATRIC", $user->getMatriculation());
         $template->parseCurrentBlock();
         $template->touchBlock("user_matric_separator");
         $title_matric = " - " . $this->lng->txt("matriculation") . ": " . $user->getMatriculation();
     }
     $invited_user = array_pop($this->object->getInvitedUsers($user_id));
     if (strlen($invited_user["clientip"])) {
         $template->setCurrentBlock("user_clientip");
         $template->setVariable("TXT_CLIENT_IP", $this->lng->txt("client_ip"));
         $template->parseCurrentBlock();
         $template->setCurrentBlock("user_clientip_value");
         $template->setVariable("VALUE_CLIENT_IP", $invited_user["clientip"]);
         $template->parseCurrentBlock();
         $template->touchBlock("user_clientip_separator");
         $title_client = " - " . $this->lng->txt("clientip") . ": " . $invited_user["clientip"];
     }
     $template->setVariable("TXT_USR_NAME", $this->lng->txt("name"));
     $uname = $this->object->userLookupFullName($user_id, FALSE);
     $template->setVariable("VALUE_USR_NAME", $uname);
     $template->setVariable("TXT_PASS", $this->lng->txt("scored_pass"));
     $template->setVariable("VALUE_PASS", $pass);
     return $template->get();
 }
Esempio n. 5
0
 /**
  * Get HTML
  *
  * @param
  * @return
  */
 function getHTML()
 {
     global $ilCtrl;
     $tpl = new ilTemplate("tpl.grouped_list.html", true, true, "Services/UIComponent/GroupedList");
     $tt_calls = "";
     foreach ($this->items as $i) {
         switch ($i["type"]) {
             case "sep":
                 $tpl->touchBlock("sep");
                 $tpl->touchBlock("item");
                 break;
             case "next_col":
                 $tpl->touchBlock("next_col");
                 $tpl->touchBlock("item");
                 break;
             case "group_head":
                 $tpl->setCurrentBlock("group_head");
                 if ($i["add_class"] != "") {
                     $tpl->setVariable("ADD_CLASS", $i["add_class"]);
                 }
                 $tpl->setVariable("GROUP_HEAD", $i["content"]);
                 $tpl->parseCurrentBlock();
                 $tpl->touchBlock("item");
                 break;
             case "entry":
                 if ($i["href"] != "") {
                     $tpl->setCurrentBlock("linked_entry");
                     if ($i["add_class"] != "") {
                         $tpl->setVariable("ADD_CLASS", $i["add_class"]);
                     }
                     $tpl->setVariable("HREF", $i["href"]);
                     $tpl->setVariable("TXT_ENTRY", $i["content"]);
                     if ($i["target"] != "") {
                         $tpl->setVariable("TARGET", 'target="' . $i["target"] . '"');
                     } else {
                         $tpl->setVariable("TARGET", 'target="_top"');
                     }
                     if ($i["onclick"] != "") {
                         $tpl->setVariable("ONCLICK", 'onclick="' . $i["onclick"] . '"');
                     }
                     if ($i["id"] != "") {
                         $tpl->setVariable("ID", 'id="' . $i["id"] . '"');
                     }
                     $tpl->parseCurrentBlock();
                     $tpl->touchBlock("item");
                     if ($i["ttip"] != "" && $i["id"] != "") {
                         include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php";
                         if ($ilCtrl->isAsynch()) {
                             $tt_calls .= " " . ilTooltipGUI::getTooltip($i["id"], $i["ttip"], "", $i["tt_my"], $i["tt_at"], $i["tt_use_htmlspecialchars"]);
                         } else {
                             ilTooltipGUI::addTooltip($i["id"], $i["ttip"], "", $i["tt_my"], $i["tt_at"], $i["tt_use_htmlspecialchars"]);
                         }
                     }
                 } else {
                     $tpl->setCurrentBlock("unlinked_entry");
                     if ($i["add_class"] != "") {
                         $tpl->setVariable("ADD_CLASS2", $i["add_class"]);
                     }
                     $tpl->setVariable("TXT_ENTRY2", $i["content"]);
                     $tpl->parseCurrentBlock();
                 }
                 break;
         }
     }
     if ($this->multi_column) {
         $tpl->touchBlock("multi_start");
         $tpl->touchBlock("multi_end");
     }
     if ($tt_calls != "") {
         $tpl->setCurrentBlock("script");
         $tpl->setVariable("TT_CALLS", $tt_calls);
         $tpl->parseCurrentBlock();
     }
     if ($this->getAsDropDown()) {
         if ($this->dd_pullright) {
             $tpl->setVariable("LIST_CLASS", "dropdown-menu pull-right");
         } else {
             $tpl->setVariable("LIST_CLASS", "dropdown-menu");
         }
         $tpl->setVariable("LIST_ROLE", "menu");
     } else {
         $tpl->setVariable("LIST_CLASS", "");
         $tpl->setVariable("LIST_ROLE", "");
     }
     return $tpl->get();
 }
 /**
  * Get locator HTML
  */
 function getHTML()
 {
     global $lng, $ilSetting;
     if ($this->getTextOnly()) {
         $loc_tpl = new ilTemplate("tpl.locator_text_only.html", true, true, "Services/Locator");
     } else {
         $loc_tpl = new ilTemplate("tpl.locator.html", true, true, "Services/Locator");
     }
     $items = $this->getItems();
     $first = true;
     if (is_array($items)) {
         foreach ($items as $item) {
             if (!$first) {
                 $loc_tpl->touchBlock("locator_separator_prefix");
             }
             if ($item["ref_id"] > 0) {
                 $obj_id = ilObject::_lookupObjId($item["ref_id"]);
                 $type = ilObject::_lookupType($obj_id);
                 if (!$this->getTextOnly()) {
                     $icon_path = ilObject::_getIcon($obj_id, "tiny", $type, $this->getOffline());
                 }
                 $loc_tpl->setCurrentBlock("locator_img");
                 $loc_tpl->setVariable("IMG_SRC", $icon_path);
                 $loc_tpl->setVariable("IMG_ALT", $lng->txt("obj_" . $type));
                 $loc_tpl->parseCurrentBlock();
             }
             $loc_tpl->setCurrentBlock("locator_item");
             if ($item["link"] != "") {
                 $loc_tpl->setVariable("LINK_ITEM", $item["link"]);
                 if ($item["frame"] != "") {
                     $loc_tpl->setVariable("LINK_TARGET", ' target="' . $item["frame"] . '" ');
                 }
                 $loc_tpl->setVariable("ITEM", $item["title"]);
             } else {
                 $loc_tpl->setVariable("PREFIX", $item["title"]);
             }
             $loc_tpl->parseCurrentBlock();
             $first = false;
         }
     } else {
         $loc_tpl->setVariable("NOITEM", " ");
         $loc_tpl->touchBlock("locator");
     }
     $loc_tpl->setVariable("TXT_BREADCRUMBS", $lng->txt("breadcrumb_navigation"));
     return trim($loc_tpl->get());
 }
 /**
  * Get the bb menu incl. script
  */
 function getBBMenu($a_ta_name = "par_content")
 {
     global $lng, $ilCtrl;
     include_once "./Services/COPage/classes/class.ilPageEditorSettings.php";
     $btpl = new ilTemplate("tpl.bb_menu.html", true, true, "Services/COPage");
     // not nice, should be set by context per method
     //if ($this->pg_obj->getParentType() == "gdf" ||
     //	$this->pg_obj->getParentType() == "lm" ||
     //	$this->pg_obj->getParentType() == "dbk")
     if ($this->getPageConfig()->getEnableInternalLinks()) {
         $btpl->setCurrentBlock("bb_ilink_button");
         $btpl->setVariable("BB_LINK_ILINK", $this->ctrl->getLinkTargetByClass("ilInternalLinkGUI", "showLinkHelp"));
         $btpl->parseCurrentBlock();
         // add int link parts
         include_once "./Services/Link/classes/class.ilInternalLinkGUI.php";
         $btpl->setCurrentBlock("int_link_prep");
         $btpl->setVariable("INT_LINK_PREP", ilInternalLinkGUI::getInitHTML($ilCtrl->getLinkTargetByClass(array("ilpageeditorgui", "ilinternallinkgui"), "", false, true, false), true));
         $btpl->parseCurrentBlock();
     }
     if ($this->getPageConfig()->getEnableKeywords()) {
         $btpl->touchBlock("bb_kw_button");
         $btpl->setVariable("TXT_KW", $this->lng->txt("cont_text_keyword"));
     }
     if ($this->pg_obj->getParentType() == "wpg") {
         $btpl->setCurrentBlock("bb_wikilink_button2");
         $btpl->setVariable("TXT_WIKI_BUTTON2", $lng->txt("obj_wiki"));
         $btpl->setVariable("WIKI_BUTTON2_URL", $ilCtrl->getLinkTargetByClass("ilwikipagegui", ""));
         $btpl->parseCurrentBlock();
         $btpl->setCurrentBlock("bb_wikilink_button");
         $btpl->setVariable("TXT_WLN2", $lng->txt("wiki_wiki_page"));
         $btpl->parseCurrentBlock();
     }
     $mathJaxSetting = new ilSetting("MathJax");
     $style = $this->getStyle();
     //echo URL_TO_LATEX;
     foreach (self::$common_bb_buttons as $c => $st) {
         if (ilPageEditorSettings::lookupSettingByParentType($this->pg_obj->getParentType(), "active_" . $c, true)) {
             if ($c != "tex" || $mathJaxSetting->get("enable") || defined("URL_TO_LATEX")) {
                 $btpl->touchBlock("bb_" . $c . "_button");
                 $btpl->setVariable("TXT_" . strtoupper($c), $this->lng->txt("cont_text_" . $c));
             }
         }
     }
     if ($this->getPageConfig()->getEnableAnchors()) {
         $btpl->touchBlock("bb_anc_button");
         $btpl->setVariable("TXT_ANC", $lng->txt("cont_anchor") . ":");
     }
     // footnote
     //		$btpl->setVariable("TXT_FN", $this->lng->txt("cont_text_fn"));
     //		$btpl->setVariable("TXT_CODE", $this->lng->txt("cont_text_code"));
     $btpl->setVariable("TXT_ILN", $this->lng->txt("cont_text_iln"));
     //		$btpl->setVariable("TXT_XLN", $this->lng->txt("cont_text_xln"));
     //		$btpl->setVariable("TXT_TEX", $this->lng->txt("cont_text_tex"));
     $btpl->setVariable("TXT_BB_TIP", $this->lng->txt("cont_bb_tip"));
     $btpl->setVariable("TXT_WLN", $lng->txt("wiki_wiki_page"));
     $btpl->setVariable("PAR_TA_NAME", $a_ta_name);
     return $btpl->get();
 }
 /**
  * render attendance list
  *
  * @return string
  */
 public function getHTML()
 {
     $tpl = new ilTemplate('tpl.attendance_list_print.html', true, true, 'Services/Membership');
     // title
     $time = ilFormat::formatUnixTime(time(), true);
     $tpl->setVariable('TXT_TITLE', $this->title);
     if ($this->description) {
         $tpl->setVariable('TXT_DESCRIPTION', $this->description . " (" . $time . ")");
     } else {
         $tpl->setVariable('TXT_DESCRIPTION', $time);
     }
     // header
     $tpl->setCurrentBlock('head_item');
     foreach ($this->presets as $id => $item) {
         if ($item[1]) {
             $tpl->setVariable('TXT_HEAD', $item[0]);
             $tpl->parseCurrentBlock();
         }
     }
     if ($this->blank_columns) {
         foreach ($this->blank_columns as $blank) {
             $tpl->setVariable('TXT_HEAD', $blank);
             $tpl->parseCurrentBlock();
         }
     }
     // handle members
     $member_ids = array();
     if ($this->show_admins) {
         $member_ids = array_merge((array) $member_ids, $this->participants->getAdmins());
     }
     if ($this->show_tutors) {
         $member_ids = array_merge((array) $member_ids, $this->participants->getTutors());
     }
     if ($this->show_members) {
         $member_ids = array_merge((array) $member_ids, $this->participants->getMembers());
     }
     $member_ids = ilUtil::_sortIds((array) $member_ids, 'usr_data', 'lastname', 'usr_id');
     // rows
     foreach ($member_ids as $user_id) {
         if ($this->callback) {
             $user_data = call_user_func_array($this->callback, array($user_id));
             $tpl->setCurrentBlock("row_preset");
             foreach ($this->presets as $id => $item) {
                 if ($item[1]) {
                     switch ($id) {
                         case "name":
                             if (!$user_data[$id]) {
                                 $name = ilObjUser::_lookupName($user_id);
                                 $value = $name["lastname"] . ", " . $name["firstname"];
                                 break;
                             }
                         case "email":
                             if (!$user_data[$id]) {
                                 $value = ilObjUser::_lookupEmail($user_id);
                                 break;
                             }
                         case "login":
                             if (!$user_data[$id]) {
                                 $value = ilObjUser::_lookupLogin($user_id);
                                 break;
                             }
                         default:
                             $value = (string) $user_data[$id];
                             break;
                     }
                     $tpl->setVariable("TXT_PRESET", $value);
                     $tpl->parseCurrentBlock();
                 }
             }
         }
         if ($this->blank_columns) {
             for ($loop = 0; $loop < sizeof($this->blank_columns); $loop++) {
                 $tpl->touchBlock('row_blank');
             }
         }
         $tpl->touchBlock("member_row");
     }
     return $tpl->get();
 }
Esempio n. 9
0
 static function addYesNoDialog($dialogname, $headertext, $message, $yesaction, $noaction, $defaultyes, $icon = "help")
 {
     global $tpl, $lng;
     self::initSimpleDialog();
     $template = new ilTemplate("tpl.yes_no_dialog.js", TRUE, TRUE, "Services/YUI");
     $template->setVariable("DIALOGNAME", $dialogname);
     $template->setVariable("YES_ACTION", $yesaction);
     $template->setVariable("NO_ACTION", $noaction);
     $template->setVariable("DIALOG_HEADER", $headertext);
     $template->setVariable("DIALOG_MESSAGE", $message);
     $template->setVariable("TEXT_YES", $lng->txt("yes"));
     $template->setVariable("TEXT_NO", $lng->txt("no"));
     switch ($icon) {
         case "warn":
             $template->setVariable("ICON", "YAHOO.widget.SimpleDialog.ICON_WARN");
             break;
         case "tip":
             $template->setVariable("ICON", "YAHOO.widget.SimpleDialog.ICON_TIP");
             break;
         case "info":
             $template->setVariable("ICON", "YAHOO.widget.SimpleDialog.ICON_INFO");
             break;
         case "block":
             $template->setVariable("ICON", "YAHOO.widget.SimpleDialog.ICON_BLOCK");
             break;
         case "alarm":
             $template->setVariable("ICON", "YAHOO.widget.SimpleDialog.ICON_ALARM");
             break;
         case "help":
         default:
             $template->setVariable("ICON", "YAHOO.widget.SimpleDialog.ICON_HELP");
             break;
     }
     if ($defaultyes) {
         $template->touchBlock("isDefaultYes");
     } else {
         $template->touchBlock("isDefaultNo");
     }
     $tpl->setCurrentBlock("HeadContent");
     $tpl->setVariable("CONTENT_BLOCK", $template->get());
     $tpl->parseCurrentBlock();
 }
Esempio n. 10
0
 /**
  * Get Tiny Menu
  */
 static function getTinyMenu($a_par_type, $a_int_links = false, $a_wiki_links = false, $a_keywords = false, $a_style_id = 0, $a_paragraph_styles = true, $a_save_return = true, $a_anchors = false, $a_save_new = true)
 {
     global $lng, $ilCtrl;
     $mathJaxSetting = new ilSetting("MathJax");
     include_once "./Services/COPage/classes/class.ilPageEditorSettings.php";
     include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php";
     $btpl = new ilTemplate("tpl.tiny_menu.html", true, true, "Services/COPage");
     // debug ghost element
     if (DEVMODE == 1) {
         $btpl->touchBlock("debug_ghost");
     }
     // bullet list
     $btpl->touchBlock("blist_button");
     ilTooltipGUI::addTooltip("il_edm_blist", $lng->txt("cont_blist"), "iltinymenu_bd");
     // numbered list
     $btpl->touchBlock("nlist_button");
     ilTooltipGUI::addTooltip("il_edm_nlist", $lng->txt("cont_nlist"), "iltinymenu_bd");
     // list indent
     $btpl->touchBlock("list_indent");
     ilTooltipGUI::addTooltip("ilIndentBut", $lng->txt("cont_list_indent"), "iltinymenu_bd");
     // list outdent
     $btpl->touchBlock("list_outdent");
     ilTooltipGUI::addTooltip("ilOutdentBut", $lng->txt("cont_list_outdent"), "iltinymenu_bd");
     if ($a_int_links) {
         $btpl->touchBlock("bb_ilink_button");
         ilTooltipGUI::addTooltip("iosEditInternalLinkTrigger", $lng->txt("cont_link_to_internal"), "iltinymenu_bd");
     }
     ilTooltipGUI::addTooltip("il_edm_xlink", $lng->txt("cont_link_to_external"), "iltinymenu_bd");
     // remove format
     $btpl->touchBlock("rformat_button");
     ilTooltipGUI::addTooltip("il_edm_rformat", $lng->txt("cont_remove_format"), "iltinymenu_bd");
     if ($a_paragraph_styles) {
         // new paragraph
         $btpl->setCurrentBlock("new_par");
         $btpl->setVariable("IMG_NEWPAR", "+");
         $btpl->parseCurrentBlock();
         ilTooltipGUI::addTooltip("il_edm_newpar", $lng->txt("cont_insert_new_paragraph"), "iltinymenu_bd");
         $btpl->setCurrentBlock("par_edit");
         $btpl->setVariable("TXT_PAR_FORMAT", $lng->txt("cont_par_format"));
         include_once "./Services/COPage/classes/class.ilPCParagraphGUI.php";
         $btpl->setVariable("STYLE_SELECTOR", ilPCParagraphGUI::getStyleSelector($a_selected, ilPCParagraphGUI::_getCharacteristics($a_style_id), true));
         ilTooltipGUI::addTooltip("ilAdvSelListAnchorText_style_selection", $lng->txt("cont_paragraph_styles"), "iltinymenu_bd");
         $btpl->parseCurrentBlock();
     }
     if ($a_keywords) {
         $btpl->setCurrentBlock("bb_kw_button");
         $btpl->setVariable("CC_KW", "kw");
         $btpl->parseCurrentBlock();
         ilTooltipGUI::addTooltip("il_edm_kw", $lng->txt("cont_text_keyword"), "iltinymenu_bd");
     }
     if ($a_wiki_links) {
         $btpl->setCurrentBlock("bb_wikilink_button2");
         $btpl->setVariable("TXT_WIKI_BUTTON2", $lng->txt("obj_wiki"));
         $btpl->setVariable("WIKI_BUTTON2_URL", $ilCtrl->getLinkTargetByClass("ilwikipagegui", ""));
         $btpl->parseCurrentBlock();
         $btpl->setCurrentBlock("bb_wikilink_button");
         $btpl->setVariable("TXT_WLN2", $lng->txt("obj_wiki"));
         $btpl->parseCurrentBlock();
         ilTooltipGUI::addTooltip("il_edm_wlink", $lng->txt("cont_link_to_wiki"), "iltinymenu_bd");
     }
     $aset = new ilSetting("adve");
     include_once "./Services/COPage/classes/class.ilPageContentGUI.php";
     foreach (ilPageContentGUI::_getCommonBBButtons() as $c => $st) {
         // these are handled via drop down now...
         if (in_array($c, array("com", "quot", "acc", "code"))) {
             continue;
         }
         if (ilPageEditorSettings::lookupSettingByParentType($a_par_type, "active_" . $c, true)) {
             $cc_code = $c;
             if ($aset->get("use_physical")) {
                 $cc_code = str_replace(array("str", "emp", "imp"), array("B", "I", "U"), $cc_code);
             }
             if ($c != "tex" || $mathJaxSetting->get("enable") || defined("URL_TO_LATEX")) {
                 $btpl->setCurrentBlock("bb_" . $c . "_button");
                 $btpl->setVariable("CC_" . strtoupper($c), $cc_code);
                 $btpl->parseCurrentBlock();
                 ilTooltipGUI::addTooltip("il_edm_cc_" . $c, $lng->txt("cont_cc_" . $c), "iltinymenu_bd");
                 //					$btpl->setVariable("TXT_".strtoupper($c), $this->lng->txt("cont_text_".$c));
             }
         }
     }
     if ($mathJaxSetting->get("enable") || defined("URL_TO_LATEX")) {
         ilTooltipGUI::addTooltip("il_edm_tex", $lng->txt("cont_tex"), "iltinymenu_bd");
     }
     ilTooltipGUI::addTooltip("il_edm_fn", $lng->txt("cont_fn"), "iltinymenu_bd");
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $sdd = new ilAdvancedSelectionListGUI();
     $sdd->setPullRight(false);
     $sdd->setListTitle($lng->txt("save") . "...");
     if ($a_save_return) {
         $btpl->setCurrentBlock("save_return");
         $btpl->setVariable("TXT_SAVE_RETURN", $lng->txt("save_return"));
         $btpl->parseCurrentBlock();
         $sdd->addItem($lng->txt("save_return"), "", "#", "", "", "", "", "", "ilCOPage.cmdSaveReturn(false); return false;");
     }
     if ($a_save_new) {
         $btpl->setCurrentBlock("save_new");
         $btpl->setVariable("TXT_SAVE_NEW", $lng->txt("save_new"));
         $btpl->parseCurrentBlock();
         $sdd->addItem($lng->txt("save_new"), "", "#", "", "", "", "", "", "ilCOPage.cmdSaveReturn(true); return false;");
     }
     $sdd->addItem($lng->txt("save"), "", "#", "", "", "", "", "", "ilCOPage.cmdSave(null); return false;");
     $sdd->addItem($lng->txt("cancel"), "", "#", "", "", "", "", "", "ilCOPage.cmdCancel(); return false;");
     if ($a_anchors) {
         $btpl->setCurrentBlock("bb_anc_button");
         $btpl->setVariable("CC_ANC", "anc");
         $btpl->parseCurrentBlock();
         ilTooltipGUI::addTooltip("il_edm_anc", $lng->txt("cont_anchor"), "iltinymenu_bd");
     }
     $btpl->setVariable("SAVE_DROPDOWN", $sdd->getHTML());
     /*		// footnote
     		$btpl->setVariable("TXT_ILN", $this->lng->txt("cont_text_iln"));
     		$btpl->setVariable("TXT_BB_TIP", $this->lng->txt("cont_bb_tip"));
     		$btpl->setVariable("TXT_WLN", $lng->txt("wiki_wiki_page"));
     */
     //		$btpl->setVariable("PAR_TA_NAME", $a_ta_name);
     $btpl->setVariable("TXT_SAVE", $lng->txt("save"));
     $btpl->setVariable("TXT_CANCEL", $lng->txt("cancel"));
     $btpl->setVariable("TXT_CHAR_FORMAT", $lng->txt("cont_char_format"));
     $btpl->setVariable("TXT_LISTS", $lng->txt("cont_lists"));
     $btpl->setVariable("TXT_LINKS", $lng->txt("cont_links"));
     $btpl->setVariable("TXT_MORE_FUNCTIONS", $lng->txt("cont_more_functions"));
     $btpl->setVariable("TXT_SAVING", $lng->txt("cont_saving"));
     include_once "./Services/COPage/classes/class.ilPCParagraphGUI.php";
     $btpl->setVariable("CHAR_STYLE_SELECTOR", ilPCParagraphGUI::getCharStyleSelector($a_par_type));
     ilTooltipGUI::addTooltip("ilAdvSelListAnchorElement_char_style_selection", $lng->txt("cont_more_character_styles"), "iltinymenu_bd");
     return $btpl->get();
 }
Esempio n. 11
0
 /**
  * add ILIAS footer
  */
 function addILIASFooter()
 {
     global $ilAuth;
     if (!$this->getAddFooter()) {
         return;
     }
     global $ilias, $ilClientIniFile, $ilCtrl, $ilDB, $ilSetting, $lng;
     $ftpl = new ilTemplate("tpl.footer.html", true, true, "Services/UICore");
     $ftpl->setVariable("ILIAS_VERSION", $ilias->getSetting("ilias_version"));
     $link_items = array();
     // imprint
     include_once "Services/Imprint/classes/class.ilImprint.php";
     if ($_REQUEST["baseClass"] != "ilImprintGUI" && ilImprint::isActive()) {
         include_once "Services/Link/classes/class.ilLink.php";
         $link_items[ilLink::_getStaticLink(0, "impr")] = array($lng->txt("imprint"), true);
     }
     $link_items["mailto:" . ilUtil::prepareFormOutput($ilSetting->get("feedback_recipient"))] = array($lng->txt("contact_sysadmin"), false);
     if (DEVMODE && version_compare(PHP_VERSION, '5', '>=')) {
         $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=xhtml")] = array("Validate", true);
         $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=accessibility")] = array("Accessibility", true);
     }
     // output translation link (extended language maintenance)
     if ($ilSetting->get("lang_ext_maintenance") == "1") {
         include_once "Services/Language/classes/class.ilObjLanguageAccess.php";
         if (ilObjLanguageAccess::_checkTranslate() and !ilObjLanguageAccess::_isPageTranslation()) {
             ilObjLanguageAccess::_saveUsages();
             $link_items[ilObjLanguageAccess::_getTranslationLink()] = array($lng->txt('translation'), true);
         }
     }
     $cnt = 0;
     foreach ($link_items as $url => $caption) {
         $cnt++;
         if ($caption[1]) {
             $ftpl->touchBlock("blank");
         }
         if ($cnt < sizeof($link_items)) {
             $ftpl->touchBlock("item_separator");
         }
         $ftpl->setCurrentBlock("items");
         $ftpl->setVariable("URL_ITEM", $url);
         $ftpl->setVariable("TXT_ITEM", $caption[0]);
         $ftpl->parseCurrentBlock();
     }
     if (DEVMODE) {
         // execution time
         $t1 = explode(" ", $GLOBALS['ilGlobalStartTime']);
         $t2 = explode(" ", microtime());
         $diff = $t2[0] - $t1[0] + $t2[1] - $t1[1];
         $mem_usage = array();
         if (function_exists("memory_get_usage")) {
             $mem_usage[] = "Memory Usage: " . memory_get_usage() . " Bytes";
         }
         if (function_exists("xdebug_peak_memory_usage")) {
             $mem_usage[] = "XDebug Peak Memory Usage: " . xdebug_peak_memory_usage() . " Bytes";
         }
         $mem_usage[] = round($diff, 4) . " Seconds";
         if (sizeof($mem_usage)) {
             $ftpl->setVariable("MEMORY_USAGE", "<br>" . implode(" | ", $mem_usage));
         }
         if (is_object($ilAuth) && isset($_SESSION[$ilAuth->_sessionName]) && isset($_SESSION[$ilAuth->_sessionName]["timestamp"])) {
             $ftpl->setVariable("SESS_INFO", "<br />maxlifetime: " . ini_get("session.gc_maxlifetime") . " (" . ini_get("session.gc_maxlifetime") / 60 . "), id: " . session_id() . "<br />" . "timestamp: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["timestamp"]) . ", idle: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["idle"]) . "<br />expire: " . ($exp = $ilClientIniFile->readVariable("session", "expire")) . " (" . $exp / 60 . "), session ends at: " . date("Y-m-d H:i:s", $_SESSION[$ilAuth->_sessionName]["idle"] + $exp));
         }
         if (!empty($_GET["do_dev_validate"]) && $ftpl->blockExists("xhtml_validation")) {
             require_once "Services/XHTMLValidator/classes/class.ilValidatorAdapter.php";
             $template2 = clone $this;
             //echo "-".ilValidatorAdapter::validate($template2->get(), $_GET["do_dev_validate"])."-";
             $ftpl->setCurrentBlock("xhtml_validation");
             $ftpl->setVariable("VALIDATION", ilValidatorAdapter::validate($template2->get("DEFAULT", false, false, false, true), $_GET["do_dev_validate"]));
             $ftpl->parseCurrentBlock();
         }
         // controller history
         if (is_object($ilCtrl) && $ftpl->blockExists("c_entry") && $ftpl->blockExists("call_history")) {
             $hist = $ilCtrl->getCallHistory();
             foreach ($hist as $entry) {
                 $ftpl->setCurrentBlock("c_entry");
                 $ftpl->setVariable("C_ENTRY", $entry["class"]);
                 if (is_object($ilDB)) {
                     $file = $ilCtrl->lookupClassPath($entry["class"]);
                     $add = $entry["mode"] . " - " . $entry["cmd"];
                     if ($file != "") {
                         $add .= " - " . $file;
                     }
                     $ftpl->setVariable("C_FILE", $add);
                 }
                 $ftpl->parseCurrentBlock();
             }
             $ftpl->setCurrentBlock("call_history");
             $ftpl->parseCurrentBlock();
             // debug hack
             $debug = $ilCtrl->getDebug();
             foreach ($debug as $d) {
                 $ftpl->setCurrentBlock("c_entry");
                 $ftpl->setVariable("C_ENTRY", $d);
                 $ftpl->parseCurrentBlock();
             }
             $ftpl->setCurrentBlock("call_history");
             $ftpl->parseCurrentBlock();
         }
         // included files
         if (is_object($ilCtrl) && $ftpl->blockExists("i_entry") && $ftpl->blockExists("included_files")) {
             $fs = get_included_files();
             $ifiles = array();
             $total = 0;
             foreach ($fs as $f) {
                 $ifiles[] = array("file" => $f, "size" => filesize($f));
                 $total += filesize($f);
             }
             $ifiles = ilUtil::sortArray($ifiles, "size", "desc", true);
             foreach ($ifiles as $f) {
                 $ftpl->setCurrentBlock("i_entry");
                 $ftpl->setVariable("I_ENTRY", $f["file"] . " (" . $f["size"] . " Bytes, " . round(100 / $total * $f["size"], 2) . "%)");
                 $ftpl->parseCurrentBlock();
             }
             $ftpl->setCurrentBlock("i_entry");
             $ftpl->setVariable("I_ENTRY", "Total (" . $total . " Bytes, 100%)");
             $ftpl->parseCurrentBlock();
             $ftpl->setCurrentBlock("included_files");
             $ftpl->parseCurrentBlock();
         }
     }
     // BEGIN Usability: Non-Delos Skins can display the elapsed time in the footer
     // The corresponding $ilBench->start invocation is in inc.header.php
     global $ilBench;
     $ilBench->stop("Core", "ElapsedTimeUntilFooter");
     $ftpl->setVariable("ELAPSED_TIME", ", " . number_format($ilBench->getMeasuredTime("Core", "ElapsedTimeUntilFooter"), 1) . ' seconds');
     // END Usability: Non-Delos Skins can display the elapsed time in the footer
     $this->setVariable("FOOTER", $ftpl->get());
 }
 function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $user_post_solution = FALSE)
 {
     if ($this->object->getOutputType() == OUTPUT_JAVASCRIPT) {
         return $this->getTestOutputJS($active_id, $pass, $is_postponed, $user_post_solution);
     }
     // generate the question output
     include_once "./Services/UICore/classes/class.ilTemplate.php";
     $template = new ilTemplate("tpl.il_as_qpl_matching_output.html", TRUE, TRUE, "Modules/TestQuestionPool");
     if ($active_id) {
         $solutions = NULL;
         include_once "./Modules/Test/classes/class.ilObjTest.php";
         if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) {
             if (is_null($pass)) {
                 $pass = ilObjTest::_getPass($active_id);
             }
         }
         if (is_array($user_post_solution)) {
             $solutions = array();
             foreach ($user_post_solution['matching'][$this->object->getId()] as $definition => $term) {
                 array_push($solutions, array("value1" => $term, "value2" => $definition));
             }
         } else {
             $solutions =& $this->object->getSolutionValues($active_id, $pass);
         }
     }
     // shuffle output
     $terms = $this->object->getTerms();
     $definitions = $this->object->getDefinitions();
     switch ($this->object->getShuffle()) {
         case 1:
             $terms = $this->object->pcArrayShuffle($terms);
             if (count($solutions)) {
                 $definitions = $this->sortDefinitionsBySolution($solutions);
             } else {
                 $definitions = $this->object->pcArrayShuffle($definitions);
             }
             break;
         case 2:
             $terms = $this->object->pcArrayShuffle($terms);
             break;
         case 3:
             if (count($solutions)) {
                 $definitions = $this->sortDefinitionsBySolution($solutions);
             } else {
                 $definitions = $this->object->pcArrayShuffle($definitions);
             }
             break;
     }
     $maxcount = max(count($terms), count($definitions));
     for ($i = 0; $i < count($definitions); $i++) {
         $definition = $definitions[$i];
         if (is_object($definition)) {
             if (strlen($definition->picture)) {
                 $template->setCurrentBlock('definition_image');
                 $template->setVariable('ANSWER_IMAGE_URL', $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $definition->picture);
                 $template->setVariable('ANSWER_IMAGE_ALT', strlen($definition->text) ? ilUtil::prepareFormOutput($definition->text) : ilUtil::prepareFormOutput($definition->picture));
                 $template->setVariable('ANSWER_IMAGE_TITLE', strlen($definition->text) ? ilUtil::prepareFormOutput($definition->text) : ilUtil::prepareFormOutput($definition->picture));
                 $template->setVariable('URL_PREVIEW', $this->object->getImagePathWeb() . $definition->picture);
                 $template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
                 $template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.png'));
                 $template->setVariable("TEXT_DEFINITION", strlen($definition->text) ? $this->lng->txt('definition') . ' ' . ($i + 1) . ': ' . ilUtil::prepareFormOutput($definition->text) : $this->lng->txt('definition') . ' ' . ($i + 1));
                 $template->parseCurrentBlock();
             } else {
                 $template->setCurrentBlock('definition_text');
                 $template->setVariable("DEFINITION", $this->object->prepareTextareaOutput($definition->text, true));
                 $template->parseCurrentBlock();
             }
         }
         $template->setCurrentBlock('option');
         $template->setVariable("VALUE_OPTION", 0);
         $template->setVariable("TEXT_OPTION", ilUtil::prepareFormOutput($this->lng->txt('please_select')));
         $template->parseCurrentBlock();
         $j = 1;
         foreach ($terms as $term) {
             $template->setCurrentBlock('option');
             $template->setVariable("VALUE_OPTION", $term->identifier);
             $template->setVariable("TEXT_OPTION", strlen($term->text) ? $this->lng->txt('term') . ' ' . $j . ': ' . ilUtil::prepareFormOutput($term->text) : $this->lng->txt('term') . ' ' . $j);
             foreach ($solutions as $solution) {
                 if ($solution["value1"] == $term->identifier && $solution["value2"] == $definition->identifier) {
                     $template->setVariable("SELECTED_OPTION", " selected=\"selected\"");
                 }
             }
             $template->parseCurrentBlock();
             $j++;
         }
         $template->setCurrentBlock('row');
         $template->setVariable("TEXT_MATCHES", $this->lng->txt("matches"));
         if ($this->object->getEstimatedElementHeight() > 0) {
             $template->setVariable("ELEMENT_HEIGHT", " style=\"height: " . $this->object->getEstimatedElementHeight() . "px;\"");
         }
         $template->setVariable("QUESTION_ID", $this->object->getId());
         $template->setVariable("DEFINITION_ID", $definition->identifier);
         $template->parseCurrentBlock();
     }
     $i = 0;
     foreach ($terms as $term) {
         if (strlen($term->picture)) {
             $template->setCurrentBlock('term_image');
             $template->setVariable('ANSWER_IMAGE_URL', $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $term->picture);
             $template->setVariable('ANSWER_IMAGE_ALT', strlen($term->text) ? ilUtil::prepareFormOutput($term->text) : ilUtil::prepareFormOutput($term->picture));
             $template->setVariable('ANSWER_IMAGE_TITLE', strlen($term->text) ? ilUtil::prepareFormOutput($term->text) : ilUtil::prepareFormOutput($term->picture));
             $template->setVariable('URL_PREVIEW', $this->object->getImagePathWeb() . $term->picture);
             $template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
             $template->setVariable("TEXT_TERM", strlen($term->text) ? $this->lng->txt('term') . ' ' . ($i + 1) . ': ' . ilUtil::prepareFormOutput($term->text) : $this->lng->txt('term') . ' ' . ($i + 1));
             $template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.png'));
             $template->parseCurrentBlock();
         } else {
             $template->setCurrentBlock('term_text');
             $template->setVariable("TERM", $this->object->prepareTextareaOutput($term->text, true));
             $template->parseCurrentBlock();
         }
         $template->touchBlock('terms');
         $i++;
     }
     $questiontext = $this->object->getQuestion();
     $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
     $template->setVariable("TEXT_TERMS", ilUtil::prepareFormOutput($this->lng->txt('available_terms')));
     $template->setVariable('TEXT_SELECTION', ilUtil::prepareFormOutput($this->lng->txt('selection')));
     $questiontext = $this->object->getQuestion();
     $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
     $questionoutput = $template->get();
     $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
     return $pageoutput;
 }
 /**
  * Fill data section
  */
 function fillDataSection()
 {
     global $ilCtrl, $lng, $ilAccess;
     $tpl = new ilTemplate("tpl.wiki_side_block_content.html", true, true, "Modules/Wiki");
     $wp = $this->getPageObject();
     // start page
     $actions[] = array("txt" => $lng->txt("wiki_start_page"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "gotoStartPage"));
     // all pages
     $actions[] = array("txt" => $lng->txt("wiki_all_pages"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "allPages"));
     // new pages
     $actions[] = array("txt" => $lng->txt("wiki_new_pages"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "newPages"));
     // popular pages
     $actions[] = array("txt" => $lng->txt("wiki_popular_pages"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "popularPages"));
     // orphaned pages
     $actions[] = array("txt" => $lng->txt("wiki_orphaned_pages"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "orphanedPages"));
     // recent changes
     $actions[] = array("txt" => $lng->txt("wiki_recent_changes"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "recentChanges"));
     foreach ($actions as $a) {
         $tpl->setCurrentBlock("action");
         $tpl->setVariable("HREF", $a["href"]);
         $tpl->setVariable("TXT", $a["txt"]);
         $tpl->parseCurrentBlock();
         $tpl->touchBlock("item");
     }
     $this->setDataSection($tpl->get());
 }
 /**
  *   export bibinfo for download or copy/paste
  *
  *   @param
  *   @access public
  *   @return
  */
 function exportbibinfo()
 {
     global $ilDB;
     $objRow["obj_id"] = ilObject::_lookupObjId($_GET["ref_id"]);
     $objRow["title"] = ilObject::_lookupTitle($objRow["obj_id"]);
     $filename = preg_replace('/[^a-z0-9_]/i', '_', $objRow["title"]);
     $C = $this->lm_gui->showAbstract(array(1));
     if ($_GET["print"] == 1) {
         $printTpl = new ilTemplate("tpl.print.html", true, true, "Modules/LearningModule");
         $printTpl->touchBlock("printreq");
         $css1 = ilObjStyleSheet::getContentStylePath($this->lm->getStyleSheetId());
         $css2 = ilUtil::getStyleSheetLocation();
         $printTpl->setVariable("LOCATION_CONTENT_STYLESHEET", $css1);
         $printTpl->setVariable("LOCATION_STYLESHEET", $css2);
         // syntax style
         $printTpl->setCurrentBlock("SyntaxStyle");
         $printTpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
         $printTpl->parseCurrentBlock();
         $printTpl->setVariable("CONTENT", $C);
         echo $printTpl->get();
         exit;
     } else {
         ilUtil::deliverData($C, $filename . ".html");
         exit;
     }
 }
 /**
  * Fill data section
  */
 function fillDataSection()
 {
     global $ilCtrl, $lng, $ilAccess;
     $tpl = new ilTemplate("tpl.wiki_side_block_content.html", true, true, "Modules/Wiki");
     $wp = $this->getPageObject();
     // info
     $actions[] = array("txt" => $lng->txt("info_short"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "infoScreen"));
     // recent changes
     $actions[] = array("txt" => $lng->txt("wiki_recent_changes"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "recentChanges"));
     foreach ($actions as $a) {
         $tpl->setCurrentBlock("action");
         $tpl->setVariable("HREF", $a["href"]);
         $tpl->setVariable("TXT", $a["txt"]);
         $tpl->parseCurrentBlock();
         $tpl->touchBlock("item");
     }
     $actions = array();
     // all pages
     $actions[] = array("txt" => $lng->txt("wiki_all_pages"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "allPages"));
     // new pages
     $actions[] = array("txt" => $lng->txt("wiki_new_pages"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "newPages"));
     // popular pages
     $actions[] = array("txt" => $lng->txt("wiki_popular_pages"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "popularPages"));
     // orphaned pages
     $actions[] = array("txt" => $lng->txt("wiki_orphaned_pages"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "orphanedPages"));
     // page lists
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $list = new ilAdvancedSelectionListGUI();
     $list->setListTitle($lng->txt("wiki_page_lists"));
     $list->setStyle(ilAdvancedSelectionListGUI::STYLE_LINK);
     $list->setId("wiki_pglists");
     foreach ($actions as $a) {
         $list->addItem($a["txt"], "", $a["href"]);
     }
     $tpl->setCurrentBlock("plain");
     $tpl->setVariable("PLAIN", $list->getHTML());
     $tpl->parseCurrentBlock();
     $tpl->touchBlock("item");
     // page actions
     $list = new ilAdvancedSelectionListGUI();
     $list->setStyle(ilAdvancedSelectionListGUI::STYLE_LINK);
     $list->setListTitle($lng->txt("wiki_page_actions"));
     $list->setId("wiki_pgactions");
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         // rating
         if (ilObjWiki::_lookupRating($this->getPageObject()->getWikiId())) {
             if (!$this->getPageObject()->getRating()) {
                 $list->addItem($lng->txt("wiki_activate_page_rating"), "", $ilCtrl->getLinkTargetByClass("ilwikipagegui", "activateWikiPageRating"));
             } else {
                 $list->addItem($lng->txt("wiki_deactivate_page_rating"), "", $ilCtrl->getLinkTargetByClass("ilwikipagegui", "deactivateWikiPageRating"));
             }
         }
         // unhide advmd?
         include_once "./Modules/Wiki/classes/class.ilWikiAdvMetaDataBlockGUI.php";
         if (ilWikiAdvMetaDataBlockGUI::isActive($this->getPageObject()->getWikiId()) && ilWikiPage::lookupAdvancedMetadataHidden($this->getPageObject()->getId())) {
             $list->addItem($lng->txt("wiki_unhide_meta_adv_records"), "", $ilCtrl->getLinkTargetByClass("ilwikipagegui", "unhideAdvancedMetaData"));
         }
     }
     if ($ilAccess->checkAccess("edit_content", "", $_GET["ref_id"]) && !$this->getPageObject()->getBlocked() || $ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         // rename
         $list->addItem($lng->txt("wiki_rename_page"), "", $ilCtrl->getLinkTargetByClass("ilwikipagegui", "renameWikiPage"));
     }
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         // block/unblock
         if ($this->getPageObject()->getBlocked()) {
             $list->addItem($lng->txt("wiki_unblock_page"), "", $ilCtrl->getLinkTargetByClass("ilwikipagegui", "unblockWikiPage"));
         } else {
             $list->addItem($lng->txt("wiki_block_page"), "", $ilCtrl->getLinkTargetByClass("ilwikipagegui", "blockWikiPage"));
         }
         // delete page
         $st_page = ilObjWiki::_lookupStartPage($this->getPageObject()->getParentId());
         if ($st_page != $this->getPageObject()->getTitle()) {
             $list->addItem($lng->txt("wiki_delete_page"), "", $ilCtrl->getLinkTargetByClass("ilwikipagegui", "deleteWikiPageConfirmationScreen"));
         }
         include_once "Modules/Wiki/classes/class.ilWikiPageTemplate.php";
         $wpt = new ilWikiPageTemplate($this->getPageObject()->getParentId());
         if (!$wpt->isPageTemplate($this->getPageObject()->getId())) {
             $list->addItem($lng->txt("wiki_add_template"), "", $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", "addPageTemplateFromPageAction"));
         } else {
             $list->addItem($lng->txt("wiki_remove_template_status"), "", $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", "removePageTemplateFromPageAction"));
         }
     }
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) || $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $tpl->setCurrentBlock("plain");
         $tpl->setVariable("PLAIN", $list->getHTML());
         $tpl->parseCurrentBlock();
         $tpl->touchBlock("item");
     }
     // permissions
     //		if ($ilAccess->checkAccess('edit_permission', "", $_GET["ref_id"]))
     //		{
     //			$actions[] = array(
     //				"txt" => $lng->txt("perm_settings"),
     //				"href" => $ilCtrl->getLinkTargetByClass(array("ilobjwikigui", "ilpermissiongui"), "perm")
     //				);
     //		}
     $actions = array();
     // settings
     if ($ilAccess->checkAccess('write', "", $_GET["ref_id"])) {
         //			$actions[] = array(
         //				"txt" => $lng->txt("settings"),
         //				"href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "editSettings")
         //				);
         $actions[] = array("txt" => $lng->txt("wiki_contributors"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "listContributors"));
     }
     // manage
     if ($ilAccess->checkAccess('write', "", $_GET["ref_id"])) {
         $actions[] = array("txt" => $lng->txt("settings"), "href" => $ilCtrl->getLinkTargetByClass("ilobjwikigui", "editSettings"));
     } else {
         if ($ilAccess->checkAccess('statistics_read', "", $_GET["ref_id"])) {
             $actions[] = array("txt" => $lng->txt("statistics"), "href" => $ilCtrl->getLinkTargetByClass(array("ilobjwikigui", "ilwikistatgui"), "initial"));
         }
     }
     foreach ($actions as $a) {
         $tpl->setCurrentBlock("action");
         $tpl->setVariable("HREF", $a["href"]);
         $tpl->setVariable("TXT", $a["txt"]);
         $tpl->parseCurrentBlock();
         $tpl->touchBlock("item");
     }
     $this->setDataSection($tpl->get());
 }
Esempio n. 16
0
 /**
  * @param $show_pass_details
  * @param $show_answers
  * @param $show_reached_points
  * @param $show_user_results
  *
  * @return ilTemplate
  */
 public function createUserResults($show_pass_details, $show_answers, $show_reached_points, $show_user_results)
 {
     global $ilTabs, $ilDB;
     $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'participants'));
     if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
         require_once 'Services/Link/classes/class.ilLink.php';
         $courseLink = ilLink::_getLink($this->getObjectiveOrientedContainer()->getRefId());
         $ilTabs->setBack2Target($this->lng->txt('back_to_objective_container'), $courseLink);
     }
     $template = new ilTemplate("tpl.il_as_tst_participants_result_output.html", TRUE, TRUE, "Modules/Test");
     require_once 'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
     $toolbar = new ilTestResultsToolbarGUI($this->ctrl, $this->tpl, $this->lng);
     $this->ctrl->setParameter($this, 'pdf', '1');
     $toolbar->setPdfExportLinkTarget($this->ctrl->getLinkTarget($this, $this->ctrl->getCmd()));
     $this->ctrl->setParameter($this, 'pdf', '');
     if ($show_answers) {
         if (isset($_GET['show_best_solutions'])) {
             $_SESSION['tst_results_show_best_solutions'] = true;
         } elseif (isset($_GET['hide_best_solutions'])) {
             $_SESSION['tst_results_show_best_solutions'] = false;
         } elseif (!isset($_SESSION['tst_results_show_best_solutions'])) {
             $_SESSION['tst_results_show_best_solutions'] = false;
         }
         if ($_SESSION['tst_results_show_best_solutions']) {
             $this->ctrl->setParameter($this, 'hide_best_solutions', '1');
             $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'showUserAnswers'));
             $this->ctrl->setParameter($this, 'hide_best_solutions', '');
         } else {
             $this->ctrl->setParameter($this, 'show_best_solutions', '1');
             $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this, 'showUserAnswers'));
             $this->ctrl->setParameterByClass('', 'show_best_solutions', '');
         }
     }
     require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
     $participantData = new ilTestParticipantData($ilDB, $this->lng);
     if ($this->object->getFixedParticipants()) {
         $participantData->setUserIds($show_user_results);
     } else {
         $participantData->setActiveIds($show_user_results);
     }
     $participantData->load($this->object->getTestId());
     $toolbar->setParticipantSelectorOptions($participantData->getOptionArray($show_user_results));
     $toolbar->build();
     $template->setVariable('RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
     include_once "./Modules/Test/classes/class.ilTestServiceGUI.php";
     $serviceGUI = new ilTestServiceGUI($this->object);
     $serviceGUI->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
     $serviceGUI->setParticipantData($participantData);
     $count = 0;
     foreach ($show_user_results as $key => $active_id) {
         $count++;
         $results = "";
         if ($this->object->getFixedParticipants()) {
             $active_id = $this->object->getActiveIdOfUser($active_id);
         }
         if ($active_id > 0) {
             $results = $serviceGUI->getResultsOfUserOutput($this->testSessionFactory->getSession($active_id), $active_id, $this->object->_getResultPass($active_id), $this, $show_pass_details, $show_answers, FALSE, $show_reached_points);
         }
         if ($count < count($show_user_results)) {
             $template->touchBlock("break");
         }
         $template->setCurrentBlock("user_result");
         $template->setVariable("USER_RESULT", $results);
         $template->parseCurrentBlock();
     }
     if ($this->isPdfDeliveryRequest()) {
         require_once 'class.ilTestPDFGenerator.php';
         ilTestPDFGenerator::generatePDF($template->get(), ilTestPDFGenerator::PDF_OUTPUT_DOWNLOAD, $this->object->getTitle());
     } else {
         return $template;
     }
 }
Esempio n. 17
0
            // Append file to array of existings mobs of this context (obj_type and obj_id)
            $mobs[$media_object->getId()] = $media_object->getId();
            $uploadedFile = $media_object->getId();
            $_GET['update'] = 1;
        }
    }
}
$tpl = new ilTemplate(dirname(__FILE__) . "/tpl.img_upload.html", true, true);
$tpl->setVariable("OBJ_ID", (int) $_GET["obj_id"]);
$tpl->setVariable("OBJ_TYPE", $_GET["obj_type"]);
$tpl->setVariable("VALUE_UPDATE", (int) $_GET["update"]);
$tpl->setVariable("ILIAS_INST_PATH", $iliasHttpPath);
$tpl->setVariable("TXT_MAX_SIZE", ilUtil::getFileSizeInfo());
$tpl->setVariable("TXT_ALLOWED_FILE_EXTENSIONS", $lng->txt("file_allowed_suffixes") . " " . implode(', ', array_map(create_function('$value', 'return ".".$value;'), $tinyMCE_valid_imgs)));
if ($ilUser->getLanguage() == 'de') {
    $tpl->touchBlock('validation_engine_lang_de');
} else {
    $tpl->touchBlock('validation_engine_lang_default');
}
if ($_GET["update"] == 1) {
    $tpl->setVariable("IMG_FROM_URL_TAB_DESC", "{#ilimgupload.edit_image}");
    $tpl->setVariable("IMG_FROM_URL_DESC", "{#ilimgupload.edit_image_desc}");
    $tpl->setVariable("INSERT_COMMAND", "{#ilimgupload.insert}");
} else {
    $tpl->setVariable("IMG_FROM_URL_TAB_DESC", "{#ilimgupload.upload_image_from_url}");
    $tpl->setVariable("IMG_FROM_URL_DESC", "{#ilimgupload.upload_image_from_url_desc}");
    $tpl->setVariable("INSERT_COMMAND", "{#ilimgupload.insert}");
}
$mob_details = array();
foreach ($mobs as $mob) {
    $mobdir = $iliasAbsolutePath . $iliasMobPath . 'mm_' . $mob . '/';
 public function render($a_mode = "")
 {
     $tpl = new ilTemplate("tpl.prop_mail_quick_filter_input.html", true, true, "Services/Mail");
     if (strlen($this->getValue())) {
         $tpl->setCurrentBlock("prop_text_propval");
         $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
         $tpl->parseCurrentBlock();
     }
     if (strlen($this->getInlineStyle())) {
         $tpl->setCurrentBlock("stylecss");
         $tpl->setVariable("CSS_STYLE", ilUtil::prepareFormOutput($this->getInlineStyle()));
         $tpl->parseCurrentBlock();
     }
     if (strlen($this->getCssClass())) {
         $tpl->setCurrentBlock("classcss");
         $tpl->setVariable('CLASS_CSS', ilUtil::prepareFormOutput($this->getCssClass()));
         $tpl->parseCurrentBlock();
     }
     if ($this->getSubmitFormOnEnter()) {
         $tpl->touchBlock("submit_form_on_enter");
     }
     switch ($this->getInputType()) {
         case 'password':
             $tpl->setVariable('PROP_INPUT_TYPE', 'password');
             break;
         case 'hidden':
             $tpl->setVariable('PROP_INPUT_TYPE', 'hidden');
             break;
         case 'text':
         default:
             $tpl->setVariable('PROP_INPUT_TYPE', 'text');
     }
     $tpl->setVariable("ID", $this->getFieldId());
     $tpl->setVariable("SIZE", $this->getSize());
     if ($this->getMaxLength() != null) {
         $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
     }
     if (strlen($this->getSuffix())) {
         $tpl->setVariable("INPUT_SUFFIX", $this->getSuffix());
     }
     $postvar = $this->getPostVar();
     if ($this->getMulti() && substr($postvar, -2) != "[]") {
         $postvar .= "[]";
     }
     if ($this->getDisabled()) {
         if ($this->getMulti()) {
             $value = $this->getMultiValues();
             $hidden = "";
             if (is_array($value)) {
                 foreach ($value as $item) {
                     $hidden .= $this->getHiddenTag($postvar, $item);
                 }
             }
         } else {
             $hidden = $this->getHiddenTag($postvar, $this->getValue());
         }
         if ($hidden) {
             $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
             $tpl->setVariable("HIDDEN_INPUT", $hidden);
         }
     } else {
         $tpl->setVariable("POST_VAR", $postvar);
     }
     // use autocomplete feature?
     if ($this->getDataSource()) {
         include_once "Services/jQuery/classes/class.iljQueryUtil.php";
         iljQueryUtil::initjQuery();
         iljQueryUtil::initjQueryUI();
         if ($this->getMulti()) {
             $tpl->setCurrentBlock("ac_multi");
             $tpl->setVariable('MURL_AUTOCOMPLETE', $this->getDataSource());
             $tpl->setVariable('ID_AUTOCOMPLETE', $this->getFieldId());
             $tpl->parseCurrentBlock();
             // set to fields that start with autocomplete selector
             $sel_auto = '[id^="' . $this->getFieldId() . '"]';
         } else {
             // use id for autocomplete selector
             $sel_auto = "#" . $this->getFieldId();
         }
         $tpl->setCurrentBlock("prop_text_autocomplete");
         $tpl->setVariable('SEL_AUTOCOMPLETE', $sel_auto);
         $tpl->setVariable('URL_AUTOCOMPLETE', $this->getDataSource());
         $tpl->parseCurrentBlock();
     }
     if ($a_mode == "toolbar") {
         // block-inline hack, see: http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/
         // -moz-inline-stack for FF2
         // zoom 1; *display:inline for IE6 & 7
         $tpl->setVariable("STYLE_PAR", 'display: -moz-inline-stack; display:inline-block; zoom: 1; *display:inline;');
     } else {
         $tpl->setVariable("STYLE_PAR", '');
     }
     // multi icons
     if ($this->getMulti() && !$a_mode && !$this->getDisabled()) {
         $tpl->setVariable("MULTI_ICONS", $this->getMultiIconsHTML($this->multi_sortable));
     }
     if (is_array($this->sub_items) && $this->sub_items) {
         /**
          * @var $lng ilLanguage
          */
         global $lng;
         $tpl->setVariable("FIELD_ID", $this->getFieldId());
         $tpl->setVariable("TXT_PLACEHOLDER", $lng->txt('mail_filter_field_placeholder'));
         $tpl->setVariable("TXT_FILTER_MESSAGES_BY", $lng->txt('mail_filter_txt'));
         $subitem_html = '';
         foreach ($this->sub_items as $item) {
             $subitem_html .= $item->render('toolbar');
         }
         $tpl->setVariable('FIELD_SUBITEMS', $subitem_html);
     }
     return $tpl->get();
 }
Esempio n. 19
0
 /**
  * get html
  */
 function getHTML()
 {
     global $lng, $ilSetting, $tree, $ilAccess, $ilCtrl, $ilUser;
     $tpl = new ilTemplate("tpl.infoscreen.html", true, true, "Services/InfoScreen");
     // other class handles form action (@todo: this is not implemented/tested)
     if ($this->form_action == "") {
         $this->setFormAction($ilCtrl->getFormAction($this));
     }
     require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     iljQueryUtil::initjQuery();
     if ($this->hidden) {
         $tpl->touchBlock("hidden_js");
         if ($this->show_hidden_toggle) {
             $this->addButton($lng->txt("show_hidden_sections"), "JavaScript:toggleSections(this, '" . $lng->txt("show_hidden_sections") . "', '" . $lng->txt("hide_visible_sections") . "');");
         }
     }
     // DEPRECATED - use ilToolbarGUI
     // add top buttons
     if (count($this->top_buttons) > 0) {
         $tpl->addBlockfile("TOP_BUTTONS", "top_buttons", "tpl.buttons.html");
         foreach ($this->top_buttons as $button) {
             // view button
             $tpl->setCurrentBlock("btn_cell");
             $tpl->setVariable("BTN_LINK", $button["link"]);
             $tpl->setVariable("BTN_TARGET", $button["target"]);
             $tpl->setVariable("BTN_TXT", $button["title"]);
             if ($button["primary"]) {
                 $tpl->setVariable("BTN_CLASS", " btn-primary");
             }
             $tpl->parseCurrentBlock();
         }
     }
     // add top formbuttons
     if (count($this->top_formbuttons) > 0 && strlen($this->form_action) > 0) {
         $tpl->addBlockfile("TOP_FORMBUTTONS", "top_submitbuttons", "tpl.submitbuttons.html", "Services/InfoScreen");
         foreach ($this->top_formbuttons as $button) {
             // view button
             $tpl->setCurrentBlock("btn_submit_cell");
             $tpl->setVariable("BTN_COMMAND", $button["command"]);
             $tpl->setVariable("BTN_NAME", $button["title"]);
             $tpl->parseCurrentBlock();
         }
     }
     // add form action
     if (strlen($this->form_action) > 0) {
         if ($this->open_form_tag) {
             $tpl->setCurrentBlock("formtop");
             $tpl->setVariable("FORMACTION", $this->form_action);
             $tpl->parseCurrentBlock();
         }
         if ($this->close_form_tag) {
             $tpl->touchBlock("formbottom");
         }
     }
     if (count($this->hiddenelements)) {
         foreach ($this->hiddenelements as $hidden) {
             $tpl->setCurrentBlock("hidden_element");
             $tpl->setVariable("HIDDEN_NAME", $hidden["name"]);
             $tpl->setVariable("HIDDEN_VALUE", $hidden["value"]);
             $tpl->parseCurrentBlock();
         }
     }
     // learning progress
     if ($this->learning_progress_enabled and $html = $this->showLearningProgress($tpl)) {
         $tpl->setCurrentBlock("learning_progress");
         $tpl->setVariable("LP_TABLE", $html);
         $tpl->parseCurrentBlock();
     }
     // notes section
     if ($this->private_notes_enabled && !$ilSetting->get('disable_notes')) {
         $html = $this->showNotesSection();
         $tpl->setCurrentBlock("notes");
         $tpl->setVariable("NOTES", $html);
         $tpl->parseCurrentBlock();
     }
     // tagging
     if (is_object($this->gui_object->object)) {
         $tags_set = new ilSetting("tags");
         if ($tags_set->get("enable") && $ilUser->getId() != ANONYMOUS_USER_ID) {
             $this->addTagging();
         }
     }
     if (is_object($this->gui_object->object)) {
         $this->addObjectSections();
     }
     // render all sections
     for ($i = 1; $i <= $this->sec_nr; $i++) {
         if (is_array($this->section[$i]["properties"])) {
             // section properties
             foreach ($this->section[$i]["properties"] as $property) {
                 if ($property["name"] != "") {
                     if ($property["link"] == "") {
                         $tpl->setCurrentBlock("pv");
                         $tpl->setVariable("TXT_PROPERTY_VALUE", $property["value"]);
                         $tpl->parseCurrentBlock();
                     } else {
                         $tpl->setCurrentBlock("lpv");
                         $tpl->setVariable("TXT_PROPERTY_LVALUE", $property["value"]);
                         $tpl->setVariable("LINK_PROPERTY_VALUE", $property["link"]);
                         $tpl->parseCurrentBlock();
                     }
                     $tpl->setCurrentBlock("property_row");
                     $tpl->setVariable("TXT_PROPERTY", $property["name"]);
                     $tpl->parseCurrentBlock();
                 } else {
                     $tpl->setCurrentBlock("property_full_row");
                     $tpl->setVariable("TXT_PROPERTY_FULL_VALUE", $property["value"]);
                     $tpl->parseCurrentBlock();
                 }
             }
             // section header
             if ($this->section[$i]["hidden"]) {
                 $tpl->setVariable("SECTION_HIDDEN", " style=\"display:none;\"");
                 $tpl->setVariable("SECTION_ID", "hidable_" . $i);
             } else {
                 $tpl->setVariable("SECTION_ID", $i);
             }
             $tpl->setVariable("TCLASS", $this->getTableClass());
             $tpl->setVariable("TXT_SECTION", $this->section[$i]["title"]);
             $tpl->touchBlock("row");
         }
     }
     return $tpl->get();
 }
 /**
  * Render item
  */
 public function render($a_mode = "")
 {
     $tpl = new ilTemplate("tpl.prop_textinput.html", true, true, "Services/Form");
     if (strlen($this->getValue())) {
         $tpl->setCurrentBlock("prop_text_propval");
         $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
         $tpl->parseCurrentBlock();
     }
     if (strlen($this->getInlineStyle())) {
         $tpl->setCurrentBlock("stylecss");
         $tpl->setVariable("CSS_STYLE", ilUtil::prepareFormOutput($this->getInlineStyle()));
         $tpl->parseCurrentBlock();
     }
     if (strlen($this->getCssClass())) {
         $tpl->setCurrentBlock("classcss");
         $tpl->setVariable('CLASS_CSS', ilUtil::prepareFormOutput($this->getCssClass()));
         $tpl->parseCurrentBlock();
     }
     if ($this->getSubmitFormOnEnter()) {
         $tpl->touchBlock("submit_form_on_enter");
     }
     switch ($this->getInputType()) {
         case 'password':
             $tpl->setVariable('PROP_INPUT_TYPE', 'password');
             break;
         case 'hidden':
             $tpl->setVariable('PROP_INPUT_TYPE', 'hidden');
             break;
         case 'text':
         default:
             $tpl->setVariable('PROP_INPUT_TYPE', 'text');
     }
     $tpl->setVariable("ID", $this->getFieldId());
     $tpl->setVariable("SIZE", $this->getSize());
     if ($this->getMaxLength() != null) {
         $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
     }
     if (strlen($this->getSuffix())) {
         $tpl->setVariable("INPUT_SUFFIX", $this->getSuffix());
     }
     $postvar = $this->getPostVar();
     if ($this->getMulti() && substr($postvar, -2) != "[]") {
         $postvar .= "[]";
     }
     if ($this->getDisabled()) {
         if ($this->getMulti()) {
             $value = $this->getMultiValues();
             $hidden = "";
             if (is_array($value)) {
                 foreach ($value as $item) {
                     $hidden .= $this->getHiddenTag($postvar, $item);
                 }
             }
         } else {
             $hidden = $this->getHiddenTag($postvar, $this->getValue());
         }
         if ($hidden) {
             $tpl->setVariable("DISABLED", " disabled=\"disabled\"");
             $tpl->setVariable("HIDDEN_INPUT", $hidden);
         }
     } else {
         $tpl->setVariable("POST_VAR", $postvar);
     }
     // use autocomplete feature?
     if ($this->getDataSource()) {
         include_once "Services/jQuery/classes/class.iljQueryUtil.php";
         iljQueryUtil::initjQuery();
         iljQueryUtil::initjQueryUI();
         if ($this->getMulti()) {
             $tpl->setCurrentBlock("ac_multi");
             $tpl->setVariable('MURL_AUTOCOMPLETE', $this->getDataSource());
             $tpl->setVariable('ID_AUTOCOMPLETE', $this->getFieldId());
             $tpl->parseCurrentBlock();
             // set to fields that start with autocomplete selector
             $sel_auto = '[id^="' . $this->getFieldId() . '"]';
         } else {
             // use id for autocomplete selector
             $sel_auto = "#" . $this->getFieldId();
         }
         if (!$this->ajax_datasource_delimiter) {
             $tpl->setCurrentBlock("autocomplete_bl");
             $tpl->setVariable('SEL_AUTOCOMPLETE', $sel_auto);
             $tpl->setVariable('URL_AUTOCOMPLETE', $this->getDataSource());
             $tpl->parseCurrentBlock();
         } else {
             $tpl->setCurrentBlock("autocomplete_bl");
             $tpl->setVariable('AUTOCOMPLETE_DELIMITER', $this->ajax_datasource_delimiter);
             $tpl->setVariable('SEL_AUTOCOMPLETE_DELIMITER', $sel_auto);
             $tpl->setVariable('URL_AUTOCOMPLETE_DELIMITER', $this->getDataSource());
             $tpl->parseCurrentBlock();
         }
     }
     if ($a_mode == "toolbar") {
         // block-inline hack, see: http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/
         // -moz-inline-stack for FF2
         // zoom 1; *display:inline for IE6 & 7
         $tpl->setVariable("STYLE_PAR", 'display: -moz-inline-stack; display:inline-block; zoom: 1; *display:inline;');
     } else {
         $tpl->setVariable("STYLE_PAR", '');
     }
     if ($this->isHtmlAutoCompleteDisabled()) {
         $tpl->setVariable("AUTOCOMPLETE", "autocomplete=\"off\"");
     }
     // multi icons
     if ($this->getMulti() && !$a_mode && !$this->getDisabled()) {
         $tpl->setVariable("MULTI_ICONS", $this->getMultiIconsHTML());
     }
     return $tpl->get();
 }
Esempio n. 21
0
    $safefilename = preg_replace('/[^a-zA-z0-9_\\.]/', '', $_FILES['img_file']['name']);
    $media_object = ilSoapFunctions::saveTempFileAsMediaObject(session_id() . '::' . CLIENT_ID, $safefilename, $_FILES['img_file']['tmp_name']);
    if (file_exists($iliasAbsolutePath . $iliasMobPath . 'mm_' . $media_object->getId() . '/' . $media_object->getTitle())) {
        // only save usage if the file was uploaded
        $media_object->_saveUsage($media_object->getId(), $_GET['obj_type'] . ':html', (int) $_GET['obj_id']);
    }
    $preview = $iliasHttpPath . $iliasMobPath . 'mm_' . $media_object->getId() . '/' . $media_object->getTitle();
    $mobs[$media_object->getId()] = $media_object->getId();
}
$tpl = new ilTemplate(dirname(__FILE__) . '/tpl.imagemanager.html', true, true);
// delete image
if ($tinyMCE_img_delete_allowed && isset($_POST['lib_action']) && $_POST['lib_action'] == 'delete' && !empty($img)) {
    deleteImg();
}
if ($tinyMCE_img_delete_allowed) {
    $tpl->touchBlock("delete_allowed");
}
outMobImages();
outMobImageParams();
$tpl->setVariable('OBJ_ID', (int) $_GET['obj_id']);
$tpl->setVariable('OBJ_TYPE', $_GET['obj_type']);
$tpl->setVariable('VALUE_UPDATE', (int) $_GET['update']);
$tpl->setVariable('ILIAS_INST_PATH', $iliasHttpPath);
if ($_GET['update'] == 1) {
    $tpl->setVariable('INSERT_COMMAND', '{#update}');
} else {
    $tpl->setVariable('INSERT_COMMAND', '{#insert}');
}
$tpl->setVariable('URL_PREVIEW', $preview);
$error_messages = '';
if (!empty($errors)) {
 /**
  * Render rating details
  * 
  * @param string $a_js_id
  * @param bool $a_may_rate
  * @param array $a_categories 
  * @return string
  */
 protected function renderDetails($a_js_id, $a_may_rate, array $a_categories = null)
 {
     global $lng, $ilCtrl;
     $ttpl = new ilTemplate("tpl.rating_details.html", true, true, "Services/Rating");
     $rate_text = $this->getYourRatingText() != "" ? $this->getYourRatingText() : $lng->txt("rating_your_rating");
     // no categories: 1 simple rating (link)
     if (!$a_categories) {
         if ($a_may_rate) {
             $rating = ilRating::getRatingForUserAndObject($this->obj_id, $this->obj_type, $this->sub_obj_id, $this->sub_obj_type, $this->getUserId(), 0);
             // user rating links
             for ($i = 1; $i <= 5; $i++) {
                 $ttpl->setCurrentBlock("rating_link_simple");
                 $ilCtrl->setParameter($this, "rating", $i);
                 $ttpl->setVariable("HREF_RATING", $ilCtrl->getLinkTarget($this, "saveRating"));
                 if ($rating >= $i) {
                     $ttpl->setVariable("SRC_ICON", ilUtil::getImagePath("icon_rate_on.png"));
                 } else {
                     $ttpl->setVariable("SRC_ICON", ilUtil::getImagePath("icon_rate_off.png"));
                 }
                 $ttpl->setVariable("ALT_ICON", "(" . $i . "/5)");
                 $ttpl->parseCurrentBlock();
             }
             // user rating text
             $ttpl->setCurrentBlock("user_rating_simple");
             $ttpl->setVariable("TXT_RATING_SIMPLE", $rate_text);
             $ttpl->parseCurrentBlock();
         }
     } else {
         foreach ($a_categories as $category) {
             $user_rating = round(ilRating::getRatingForUserAndObject($this->obj_id, $this->obj_type, $this->sub_obj_id, $this->sub_obj_type, $this->getUserId(), $category["id"]));
             $overall_rating = ilRating::getOverallRatingForObject($this->obj_id, $this->obj_type, $this->sub_obj_id, $this->sub_obj_type, $category["id"]);
             for ($i = 1; $i <= 5; $i++) {
                 if ($a_may_rate && $i == $user_rating) {
                     $ttpl->setCurrentBlock("rating_mark");
                     $ttpl->setVariable("SRC_MARK", ilUtil::getImagePath("icon_rate_marker.png"));
                     $ttpl->parseCurrentBlock();
                 }
                 $ttpl->setCurrentBlock("user_rating_icon");
                 if ($overall_rating["avg"] >= $i) {
                     $ttpl->setVariable("SRC_ICON", ilUtil::getImagePath("icon_rate_on.png"));
                 } else {
                     if ($overall_rating["avg"] + 1 <= $i) {
                         $ttpl->setVariable("SRC_ICON", ilUtil::getImagePath("icon_rate_off.png"));
                     } else {
                         $nr = round(($overall_rating["avg"] + 1 - $i) * 10);
                         $ttpl->setVariable("SRC_ICON", ilUtil::getImagePath("icon_rate_{$nr}.png"));
                     }
                 }
                 $ttpl->setVariable("ALT_ICON", "(" . $i . "/5)");
                 if ($a_may_rate) {
                     $ttpl->setVariable("HREF_RATING", "il.Rating.setValue(" . $category["id"] . "," . $i . ", '" . $a_js_id . "')");
                     $ttpl->setVariable("CATEGORY_ID", $category["id"]);
                     $ttpl->setVariable("ICON_VALUE", $i);
                     $ttpl->setVariable("JS_ID", $a_js_id);
                     $ttpl->setVariable("ICON_MOUSEACTION", " onmouseover=\"il.Rating.toggleIcon(this," . $i . ")\"" . " onmouseout=\"il.Rating.toggleIcon(this," . $i . ",1)\"");
                 }
                 $ttpl->parseCurrentBlock();
             }
             if ($a_may_rate) {
                 $ttpl->setCurrentBlock("user_rating_category_column");
                 $ttpl->setVariable("JS_ID", $a_js_id);
                 $ttpl->setVariable("CATEGORY_ID", $category["id"]);
                 $ttpl->setVariable("CATEGORY_VALUE", $user_rating);
                 $ttpl->parseCurrentBlock();
             }
             // category title
             $ttpl->setCurrentBlock("user_rating_category");
             $ttpl->setVariable("TXT_RATING_CATEGORY", $category["title"]);
             $ttpl->parseCurrentBlock();
         }
         if ($overall_rating["cnt"]) {
             $ttpl->setCurrentBlock("votes_number_bl");
             $ttpl->setVariable("NUMBER_VOTES", sprintf($lng->txt("rating_number_votes"), $overall_rating["cnt"]));
             $ttpl->parseCurrentBlock();
         }
         if ($a_may_rate) {
             $ttpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this, "saveRating"));
             $ttpl->setVariable("TXT_SUBMIT", $lng->txt("rating_overlay_submit"));
             $ttpl->setVariable("CMD_SUBMIT", "saveRating");
             $ttpl->touchBlock("user_rating_categories_form_out");
             // overall / user title
             $ttpl->setCurrentBlock("user_rating_categories");
             $ttpl->setVariable("TXT_RATING_OVERALL", $lng->txt("rating_overlay_title_overall"));
             $ttpl->parseCurrentBlock();
         }
     }
     return $ttpl->get();
 }
 /**
  * Get toolbar html
  */
 function getHTML()
 {
     global $lng;
     $tpl = new ilTemplate("tpl.toolbar.html", true, true, "Services/UIComponent/Toolbar");
     if (count($this->items) > 0) {
         foreach ($this->items as $item) {
             switch ($item["type"]) {
                 case "button":
                     $tpl->setCurrentBlock("button");
                     $tpl->setVariable("BTN_TXT", $item["txt"]);
                     $tpl->setVariable("BTN_LINK", $item["cmd"]);
                     if ($item["target"] != "") {
                         $tpl->setVariable("BTN_TARGET", 'target="' . $item["target"] . '"');
                     }
                     if ($item["id"] != "") {
                         $tpl->setVariable("BID", 'id="' . $item["id"] . '"');
                     }
                     if ($item["acc_key"] != "") {
                         include_once "./Services/Accessibility/classes/class.ilAccessKeyGUI.php";
                         $tpl->setVariable("BTN_ACC_KEY", ilAccessKeyGUI::getAttribute($item["acc_key"]));
                     }
                     if ($item['add_attrs']) {
                         $tpl->setVariable('BTN_ADD_ARG', $item['add_attrs']);
                     }
                     $tpl->parseCurrentBlock();
                     $tpl->touchBlock("item");
                     break;
                 case "fbutton":
                     $tpl->setCurrentBlock("form_button");
                     $tpl->setVariable("SUB_TXT", $item["txt"]);
                     $tpl->setVariable("SUB_CMD", $item["cmd"]);
                     $tpl->parseCurrentBlock();
                     $tpl->touchBlock("item");
                     break;
                 case "input":
                     if ($item["label"]) {
                         $tpl->setCurrentBlock("input_label");
                         $tpl->setVariable("TXT_INPUT", $item["input"]->getTitle());
                         $tpl->parseCurrentBlock();
                     }
                     $tpl->setCurrentBlock("input");
                     $tpl->setVariable("INPUT_HTML", $item["input"]->getToolbarHTML());
                     $tpl->parseCurrentBlock();
                     $tpl->touchBlock("item");
                     break;
                 case "separator":
                     $tpl->touchBlock("separator");
                     $tpl->touchBlock("item");
                     break;
                 case "text":
                     $tpl->setCurrentBlock("text");
                     $tpl->setVariable("VAL_TEXT", $item["text"]);
                     $tpl->touchBlock("item");
                     break;
                 case "spacer":
                     $tpl->touchBlock("spacer");
                     if (!$item["width"]) {
                         $item["width"] = 2;
                     }
                     $tpl->setVariable("SPACER_WIDTH", $item["width"]);
                     $tpl->touchBlock("item");
                     break;
                 case "link":
                     if ($item["disabled"] == false) {
                         $tpl->setCurrentBlock("link");
                         $tpl->setVariable("LINK_TXT", $item["txt"]);
                         $tpl->setVariable("LINK_URL", $item["cmd"]);
                         $tpl->parseCurrentBlock();
                         $tpl->touchBlock("item");
                         break;
                     } else {
                         $tpl->setCurrentBlock("link_disabled");
                         $tpl->setVariable("LINK_DISABLED_TXT", $item["txt"]);
                         //$tpl->setVariable("LINK_URL", $item["cmd"]);
                         $tpl->parseCurrentBlock();
                         $tpl->touchBlock("item");
                         break;
                     }
             }
         }
         $tpl->setVariable("TXT_FUNCTIONS", $lng->txt("functions"));
         if ($this->lead_img["img"] != "") {
             $tpl->setCurrentBlock("lead_image");
             $tpl->setVariable("IMG_SRC", $this->lead_img["img"]);
             $tpl->setVariable("IMG_ALT", $this->lead_img["alt"]);
             $tpl->parseCurrentBlock();
         }
         // form?
         if ($this->getFormAction() != "") {
             if ($this->getOpenFormTag()) {
                 $tpl->setCurrentBlock("form_open");
                 $tpl->setVariable("FORMACTION", $this->getFormAction());
                 if ($this->multipart) {
                     $tpl->setVariable("ENC_TYPE", 'enctype="multipart/form-data"');
                 }
                 if ($this->form_target != "") {
                     $tpl->setVariable("TARGET", ' target="' . $this->form_target . '" ');
                 }
                 if ($this->form_name != "") {
                     $tpl->setVariable("FORMNAME", 'name="' . $this->getFormName() . '"');
                 }
                 $tpl->parseCurrentBlock();
             }
             if ($this->getCloseFormTag()) {
                 $tpl->touchBlock("form_close");
             }
         }
         // id
         if ($this->getId() != "") {
             $tpl->setVariable("ID", ' id="' . $this->getId() . '" ');
         }
         // hidden style
         if ($this->getHidden()) {
             $tpl->setVariable("STYLE", ' style="display:none;" ');
         }
         return $tpl->get();
     }
     return "";
 }
 /**
  * @param ilCloudFileNode $node
  * @param ilObjCloudGUI   $gui_class
  * @param bool            $delete_files
  * @param bool            $delete_folder
  * @param bool            $download
  *
  * @return string
  */
 public function getItemHtml(ilCloudFileNode $node, ilObjCloudGUI $gui_class, $delete_files = false, $delete_folder = false, $download = false)
 {
     global $ilCtrl;
     $item = new ilTemplate("tpl.container_list_item.html", true, true, "Services/Container/");
     $action_list_gui = ilCloudConnector::getActionListGUIClass($this->getService());
     $item->setVariable("COMMAND_SELECTION_LIST", $action_list_gui->getSelectionListItemsHTML($delete_files, $delete_folder, $node));
     $item->setVariable("DIV_CLASS", "ilContainerListItemOuter");
     $item->touchBlock("d_1");
     include_once './Services/Calendar/classes/class.ilDate.php';
     $modified = ilDatePresentation::formatDate(new ilDateTime($node->getModified(), IL_CAL_UNIX));
     if ($node->getIconPath() != "") {
         $item->setVariable("SRC_ICON", $node->getIconPath());
     }
     // Folder with content
     if ($node->getIsDir()) {
         if ($node->getIconPath() == "") {
             //				$item->setVariable("SRC_ICON", "./Modules/Cloud/templates/images/icon_folder_b.png");
             $item->setVariable("SRC_ICON", ilUtil::getImagePath('icon_fold.svg'));
         }
         $item->setVariable("TXT_DESC", '&nbsp;');
         $item->setVariable("TXT_TITLE_LINKED", basename($node->getPath()));
         $item->setVariable("HREF_TITLE_LINKED", $this->getLinkToFolder($node));
     } else {
         if ($node->getIconPath() == "") {
             //				$item->setVariable("SRC_ICON", "./Modules/Cloud/templates/images/icon_file_b.png");
             $item->setVariable("SRC_ICON", ilUtil::getImagePath('icon_file.svg'));
         }
         $item->setVariable("TXT_DESC", pathinfo($node->getPath(), PATHINFO_EXTENSION) . "&nbsp;&nbsp;&nbsp;" . $node->getSize() . "&nbsp;&nbsp;&nbsp;" . $modified);
         if ($download) {
             $item->setVariable("TXT_TITLE_LINKED", basename($node->getPath()));
             $item->setVariable("HREF_TITLE_LINKED", $ilCtrl->getLinkTarget($gui_class, "getFile") . "&id=" . $node->getId());
         } else {
             $item->setVariable("TXT_TITLE", basename($node->getPath()));
         }
     }
     $this->setItemVariablePlugin($item, $node);
     return $item->get();
 }
 /**
  * Render item row
  * 
  * @param ilTemplate $a_tpl
  * @param string $a_html
  * @param int $a_ref_id
  */
 protected function addStandardRow(ilTemplate $a_tpl, $a_html, $a_ref_id = 0)
 {
     // :TODO: obsolete?
     $this->cur_row_type = $this->cur_row_type == "row_type_1" ? "row_type_2" : "row_type_1";
     if ($a_ref_id > 0) {
         $a_tpl->setCurrentBlock($this->cur_row_type);
         $a_tpl->setVariable("ROW_ID", 'id="item_row_' . $a_ref_id . '"');
         $a_tpl->parseCurrentBlock();
     } else {
         $a_tpl->touchBlock($this->cur_row_type);
     }
     $a_tpl->setCurrentBlock("container_standard_row");
     $a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
     $a_tpl->parseCurrentBlock();
     $a_tpl->touchBlock("container_row");
 }
 /**
 * Creates the question output form for the learner
 *
 * @access public
 */
 function getWorkingForm($working_data = "", $question_title = 1, $show_questiontext = 1, $error_message = "", $survey_id = null)
 {
     $template = new ilTemplate("tpl.il_svy_out_mc.html", TRUE, TRUE, "Modules/SurveyQuestionPool");
     $template->setCurrentBlock("material");
     $template->setVariable("TEXT_MATERIAL", $this->getMaterialOutput());
     $template->parseCurrentBlock();
     switch ($this->object->getOrientation()) {
         case 0:
             // vertical orientation
             for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
                 $cat = $this->object->categories->getCategory($i);
                 if ($cat->other) {
                     $template->setCurrentBlock("other_row");
                     if (strlen($cat->title)) {
                         $template->setVariable("OTHER_LABEL", $cat->title);
                     }
                     $template->setVariable("VALUE_MC", $cat->scale ? $cat->scale - 1 : $i);
                     $template->setVariable("QUESTION_ID", $this->object->getId());
                     if (is_array($working_data)) {
                         foreach ($working_data as $value) {
                             if (strlen($value["value"])) {
                                 if ($value["value"] == $cat->scale - 1) {
                                     $template->setVariable("OTHER_VALUE", ' value="' . ilUtil::prepareFormOutput($value['textanswer']) . '"');
                                     if (!$value['uncheck']) {
                                         $template->setVariable("CHECKED_MC", " checked=\"checked\"");
                                     }
                                 }
                             }
                         }
                     }
                     $template->parseCurrentBlock();
                 } else {
                     $template->setCurrentBlock("mc_row");
                     if ($cat->neutral) {
                         $template->setVariable('ROWCLASS', ' class="neutral"');
                     }
                     $template->setVariable("TEXT_MC", ilUtil::prepareFormOutput($cat->title));
                     $template->setVariable("VALUE_MC", $cat->scale ? $cat->scale - 1 : $i);
                     $template->setVariable("QUESTION_ID", $this->object->getId());
                     if (is_array($working_data)) {
                         foreach ($working_data as $value) {
                             if (strlen($value["value"])) {
                                 if ($value["value"] == $cat->scale - 1) {
                                     if (!$value['uncheck']) {
                                         $template->setVariable("CHECKED_MC", " checked=\"checked\"");
                                     }
                                 }
                             }
                         }
                     }
                     $template->parseCurrentBlock();
                 }
                 $template->touchBlock('outer_row');
             }
             break;
         case 1:
             // horizontal orientation
             // #9363: split categories in answer and answer+text
             // as we have 2 table rows we have to keep them in sync
             $ordered_ids = array(0 => array(), 1 => array());
             for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
                 $cat = $this->object->categories->getCategory($i);
                 if ($cat->other) {
                     $ordered_ids[1][] = $cat;
                 } else {
                     $ordered_ids[0][] = $cat;
                 }
             }
             $ordered_ids = array_merge($ordered_ids[0], $ordered_ids[1]);
             foreach ($ordered_ids as $i => $cat) {
                 // checkbox
                 $template->setCurrentBlock("checkbox_col");
                 if ($cat->neutral) {
                     $template->setVariable('COLCLASS', ' neutral');
                 }
                 $template->setVariable("VALUE_MC", $cat->scale ? $cat->scale - 1 : $i);
                 $template->setVariable("QUESTION_ID", $this->object->getId());
                 if (is_array($working_data)) {
                     foreach ($working_data as $value) {
                         if (strlen($value["value"])) {
                             if ($value["value"] == $cat->scale - 1) {
                                 if (!$value['uncheck']) {
                                     $template->setVariable("CHECKED_MC", " checked=\"checked\"");
                                 }
                             }
                         }
                     }
                 }
                 $template->parseCurrentBlock();
                 // answer & input
                 if ($cat->other) {
                     $template->setCurrentBlock("text_other_col");
                     $template->setVariable("VALUE_MC", $cat->scale ? $cat->scale - 1 : $i);
                     $template->setVariable("QUESTION_ID", $this->object->getId());
                     if (strlen($cat->title)) {
                         $template->setVariable("OTHER_LABEL", $cat->title);
                     }
                     if (is_array($working_data)) {
                         foreach ($working_data as $value) {
                             if (strlen($value["value"])) {
                                 if ($value["value"] == $cat->scale - 1) {
                                     $template->setVariable("OTHER_VALUE", ' value="' . ilUtil::prepareFormOutput($value['textanswer']) . '"');
                                 }
                             }
                         }
                     }
                     $template->parseCurrentBlock();
                 } else {
                     $template->setCurrentBlock("text_col");
                     if ($cat->neutral) {
                         $template->setVariable('COLCLASS', ' neutral');
                     }
                     $template->setVariable("VALUE_MC", $cat->scale ? $cat->scale - 1 : $i);
                     $template->setVariable("TEXT_MC", ilUtil::prepareFormOutput($cat->title));
                     $template->setVariable("QUESTION_ID", $this->object->getId());
                     $template->parseCurrentBlock();
                 }
                 // $template->touchBlock('text_outer_col');
             }
             break;
     }
     $template->setCurrentBlock("question_data");
     if ($this->object->use_min_answers) {
         $template->setCurrentBlock('min_max_msg');
         if ($this->object->nr_min_answers > 0 && $this->object->nr_max_answers > 0) {
             if ($this->object->nr_min_answers == $this->object->nr_max_answers) {
                 $template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_min_max_exact_answers'), $this->object->nr_min_answers));
             } else {
                 $template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_min_max_nr_answers'), $this->object->nr_min_answers, $this->object->nr_max_answers));
             }
         } else {
             if ($this->object->nr_min_answers > 0) {
                 $template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_min_nr_answers'), $this->object->nr_min_answers));
             } else {
                 if ($this->object->nr_max_answers > 0) {
                     $template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_max_nr_answers'), $this->object->nr_max_answers));
                 }
             }
         }
         $template->parseCurrentBlock();
     }
     if (strcmp($error_message, "") != 0) {
         $template->setVariable("ERROR_MESSAGE", "<p class=\"warning\">{$error_message}</p>");
     }
     if ($show_questiontext) {
         $this->outQuestionText($template);
     }
     if ($question_title) {
         $template->setVariable("QUESTION_TITLE", $this->object->getTitle());
     }
     $template->parseCurrentBlock();
     return $template->get();
 }
 /**
  * Get User List HTML (to be displayed besides the map)
  */
 function getUserListHtml()
 {
     $list_tpl = new ilTemplate("tpl.openlayers_map_user_list.html", true, true, "Services/Maps");
     $cnt = 0;
     foreach ($this->user_marker as $user_id) {
         if (ilObject::_exists($user_id)) {
             $user = new ilObjUser($user_id);
             $this->css_row = $this->css_row != "tblrow1_mo" ? "tblrow1_mo" : "tblrow2_mo";
             if ($user->getLatitude() != 0 && $user->getLongitude() != 0 && $user->getPref("public_location") == "y") {
                 $list_tpl->setCurrentBlock("item");
                 $list_tpl->setVariable("MARKER_CNT", $cnt);
                 $list_tpl->setVariable("MAP_ID", $this->getMapId());
                 $cnt++;
             } else {
                 $list_tpl->setCurrentBlock("item_no_link");
             }
             $list_tpl->setVariable("CSS_ROW", $this->css_row);
             $list_tpl->setVariable("TXT_USER", $user->getLogin());
             $list_tpl->setVariable("IMG_USER", $user->getPersonalPicturePath("xxsmall"));
             $list_tpl->parseCurrentBlock();
             $list_tpl->touchBlock("row");
         }
     }
     return $list_tpl->get();
 }
Esempio n. 28
0
 /**
  * Render
  * 
  * @return string
  */
 public function render()
 {
     $tpl = new ilTemplate("tpl.il_progress.html", true, true, "Services/UIComponent/ProgressBar");
     $tpl->setVariable("MIN", $this->min);
     $tpl->setVariable("MAX", $this->max);
     $tpl->setVariable("CURRENT_INT", round($this->current));
     $tpl->setVariable("CURRENT", round($this->current));
     $tpl->setVariable("CAPTION", $this->caption);
     $map = array(self::TYPE_INFO => "info", self::TYPE_SUCCESS => "success", self::TYPE_WARNING => "warning", self::TYPE_DANGER => "danger");
     $css = array("progress-bar-" . $map[$this->type]);
     if ($this->striped) {
         $css[] = "progress-bar-striped";
     }
     if ($this->animated) {
         $css[] = "active";
     }
     $tpl->setVariable("CSS", implode(" ", $css));
     if (!$this->show_caption) {
         $tpl->touchBlock("hide_caption_in_bl");
         $tpl->touchBlock("hide_caption_out_bl");
     }
     return $tpl->get();
 }
 /**
  * 
  * @param
  * @return
  */
 protected function appendCalendarSelection()
 {
     global $ilUser;
     $this->lng->loadLanguageModule('pd');
     $tpl = new ilTemplate('tpl.calendar_selection.html', true, true, 'Services/Calendar');
     include_once './Services/Calendar/classes/class.ilCalendarUserSettings.php';
     switch (ilCalendarUserSettings::_getInstance()->getCalendarSelectionType()) {
         case ilCalendarUserSettings::CAL_SELECTION_MEMBERSHIP:
             $tpl->setVariable('HTEXT', $this->lng->txt('pd_my_memberships'));
             $tpl->touchBlock('head_item');
             $tpl->touchBlock('head_delim');
             $tpl->touchBlock('head_item');
             $this->ctrl->setParameter($this, 'calendar_mode', ilCalendarUserSettings::CAL_SELECTION_ITEMS);
             $this->ctrl->setParameter($this, 'seed', $this->seed->get(IL_CAL_DATE));
             $tpl->setVariable('HHREF', $this->ctrl->getLinkTarget($this, 'switchCalendarMode'));
             $tpl->setVariable('HLINK', $this->lng->txt('pd_my_offers'));
             $tpl->touchBlock('head_item');
             break;
         case ilCalendarUserSettings::CAL_SELECTION_ITEMS:
             $this->ctrl->setParameter($this, 'calendar_mode', ilCalendarUserSettings::CAL_SELECTION_MEMBERSHIP);
             $this->ctrl->setParameter($this, 'seed', $this->seed->get(IL_CAL_DATE));
             $tpl->setVariable('HHREF', $this->ctrl->getLinkTarget($this, 'switchCalendarMode'));
             $tpl->setVariable('HLINK', $this->lng->txt('pd_my_memberships'));
             $tpl->touchBlock('head_item');
             $tpl->touchBlock('head_delim');
             $tpl->touchBlock('head_item');
             $tpl->setVariable('HTEXT', $this->lng->txt('pd_my_offers'));
             $tpl->touchBlock('head_item');
             break;
     }
     return $tpl->get();
 }
Esempio n. 30
0
 /**
  * Get HTML.
  */
 function getHTML()
 {
     $tpl = new ilTemplate("tpl.form.html", true, true, "Services/Form");
     // this line also sets multipart, so it must be before the multipart check
     $content = $this->getContent();
     if ($this->getOpenTag()) {
         $opentpl = new ilTemplate('tpl.form_open.html', true, true, "Services/Form");
         if ($this->getTarget() != "") {
             $opentpl->setCurrentBlock("form_target");
             $opentpl->setVariable("FORM_TARGET", $this->getTarget());
             $opentpl->parseCurrentBlock();
         }
         if ($this->getName() != "") {
             $opentpl->setCurrentBlock("form_name");
             $opentpl->setVariable("FORM_NAME", $this->getName());
             $opentpl->parseCurrentBlock();
         }
         if ($this->getMultipart()) {
             $opentpl->touchBlock("multipart");
             /*if (function_exists("apc_fetch"))
             				//
             				// Progress bar would need additional browser window (popup)
             				// to not be stopped, when form is submitted  (we can't work
             				// with an iframe or httprequest solution here)
             				//
             				{
             					$tpl->touchBlock("onsubmit");
             					
             					//onsubmit="postForm('{ON_ACT}','form_{F_ID}',1); return false;"
             					$tpl->setCurrentBlock("onsubmit");
             					$tpl->setVariable("ON_ACT", $this->getFormAction());
             					$tpl->setVariable("F_ID", $this->getId());
             					$tpl->setVariable("F_ID", $this->getId());
             					$tpl->parseCurrentBlock();
             	
             					$tpl->setCurrentBlock("hidden_progress");
             					$tpl->setVariable("APC_PROGRESS_ID", uniqid());
             					$tpl->setVariable("APC_FORM_ID", $this->getId());
             					$tpl->parseCurrentBlock();
             				}*/
         }
         $opentpl->setVariable("FORM_ACTION", $this->getFormAction());
         if ($this->getId() != "") {
             $opentpl->setVariable("FORM_ID", $this->getId());
         }
         $opentpl->parseCurrentBlock();
         $tpl->setVariable('FORM_OPEN_TAG', $opentpl->get());
     }
     $tpl->setVariable("FORM_CONTENT", $content);
     if (!$this->getKeepOpen()) {
         $tpl->setVariable("FORM_CLOSE_TAG", "</form>");
     }
     return $tpl->get();
 }