/** * Fill template row * @param <type> $a_set */ public function fillRow($a_set) { $this->tpl->setVariable('TIME', $a_set['time']); $this->tpl->setVariable('DURATION', $a_set['duration']); $this->tpl->setVariable('REC', ilViteroUtils::recurrenceToString($a_set['rec'])); if ($this->isAdminTable()) { include_once './Services/Tree/classes/class.ilPathGUI.php'; $path = new ilPathGUI(); $path->setUseImages(false); $path->enableTextOnly(false); $this->tpl->setVariable('OBJ_PATH', $path->getPath(ROOT_FOLDER_ID, end(ilObject::_getAllReferences($a_set['group'])))); } if ($a_set['rec']) { $this->tpl->setVariable('ENDS', $a_set['ends']); } else { $this->tpl->setVariable('ENDS', ''); } if (!$this->isEditable()) { return true; } include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; $list = new ilAdvancedSelectionListGUI(); $list->setId('booka_' . $a_set['start']->get(IL_CAL_UNIX) . '_' . $a_set['id']); $list->setListTitle($this->lng->txt('actions')); // no recurrence if ($a_set['rec'] == 0) { $GLOBALS['ilCtrl']->setParameter($this->getParentObject(), 'bookid', $a_set['id']); $list->addItem(ilViteroPlugin::getInstance()->txt('edit_booking'), '', $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(), 'editBooking')); // delete appointment $list->addItem(ilViteroPlugin::getInstance()->txt('delete_appointment'), '', $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(), 'confirmDeleteAppointment')); } // A recurrence if ($a_set['rec'] > 0) { // Delete single appointment $GLOBALS['ilCtrl']->setParameter($this->getParentObject(), 'atime', $a_set['start']->get(IL_CAL_UNIX)); $GLOBALS['ilCtrl']->setParameter($this->getParentObject(), 'bookid', $a_set['id']); $list->addItem(ilViteroPlugin::getInstance()->txt('edit_bookings'), '', $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(), 'editBooking')); // not supported /* $list->addItem( ilViteroPlugin::getInstance()->txt('delete_appointment'), '', $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(),'confirmDeleteAppointmentInSeries') ); */ // Delete appointment series $list->addItem(ilViteroPlugin::getInstance()->txt('delete_reccurrence'), '', $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(), 'confirmDeleteBooking')); } $this->tpl->setVariable('ACTION_PART', $list->getHTML()); }
/** * Fill a single data row. */ protected function fillRow($a_set) { $this->tpl->setVariable('TYPE_IMG', ilObject::_getIcon('', 'tiny', $a_set['type'])); $this->tpl->setVariable('IMG_ALT', $this->lng->txt('obj_' . $a_set['type'])); $this->tpl->setVariable("VAL_POSTNAME", "items"); $this->tpl->setVariable("VAL_ID", $a_set['ref_id']); if (in_array($a_set['ref_id'], $this->getMaterialItems())) { $this->tpl->setVariable("VAL_CHECKED", "checked"); } $this->tpl->setVariable("COLL_TITLE", $a_set['title']); if (strlen($a_set['description'])) { $this->tpl->setVariable("COLL_DESC", $a_set['description']); } $this->tpl->setVariable("ASSIGNED_IMG_OK", in_array($a_set['ref_id'], $this->getMaterialItems()) ? ilUtil::getImagePath('icon_ok.svg') : ilUtil::getImagePath('icon_not_ok.svg')); $this->tpl->setVariable("ASSIGNED_STATUS", $this->lng->txt('event_material_assigned')); include_once './Services/Tree/classes/class.ilPathGUI.php'; $path = new ilPathGUI(); $path->enableDisplayCut(true); $path->enableTextOnly(false); $this->tpl->setVariable("PATH", $this->lng->txt('path')); $this->tpl->setVariable("COLL_PATH", $path->getPath($this->getContainerRefId(), $a_set['ref_id'])); }
/** * Init settings form */ protected function initFormCSettings() { include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php'; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt('settings')); // individual course allocation $check = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_enable'), 'enabled'); $check->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled()); $form->addItem($check); // add default container $imp = new ilCustomInputGUI($this->lng->txt('ecs_cmap_def_cat'), 'default_cat'); $imp->setRequired(true); $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS'); $tpl->setVariable('SIZE', 5); $tpl->setVariable('MAXLENGTH', 11); $tpl->setVariable('POST_VAR', 'default_cat'); $default = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getDefaultCourseCategory(); $tpl->setVariable('PROPERTY_VALUE', $default); if ($default) { include_once './Services/Tree/classes/class.ilPathGUI.php'; $path = new ilPathGUI(); $path->enableTextOnly(false); $path->enableHideLeaf(false); $tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default)); } $imp->setHtml($tpl->get()); $imp->setInfo($this->lng->txt('ecs_cmap_def_cat_info')); $form->addItem($imp); // all in one category $allinone = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_all_in_one'), 'allinone'); $allinone->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAllInOneCategoryEnabled()); $allinone->setInfo($this->lng->txt('ecs_cmap_all_in_one_info')); $allinone_cat = new ilCustomInputGUI($this->lng->txt('ecs_cmap_all_in_one_cat'), 'allinone_cat'); $allinone_cat->setRequired(true); $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS'); $tpl->setVariable('SIZE', 5); $tpl->setVariable('MAXLENGTH', 11); $tpl->setVariable('POST_VAR', 'allinone_cat'); $cat = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getAllInOneCategory(); $tpl->setVariable('PROPERTY_VALUE', $cat); if ($cat) { include_once './Services/Tree/classes/class.ilPathGUI.php'; $path = new ilPathGUI(); $path->enableTextOnly(false); $path->enableHideLeaf(false); $tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default)); } $allinone_cat->setHtml($tpl->get()); $allinone->addSubItem($allinone_cat); $form->addItem($allinone); // multiple attributes $multiple = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_multiple_atts'), 'multiple'); $multiple->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAttributeMappingEnabled()); // attribute selection include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php'; include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php'; $attributes = new ilSelectInputGUI($this->lng->txt('ecs_cmap_attributes'), 'atts'); $attributes->setMulti(true); $attributes->setValue(ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid())->getAttributeValues()); $attributes->setRequired(true); $attributes->setOptions(ilECSMappingUtils::getCourseMappingFieldSelectOptions()); $multiple->addSubItem($attributes); $form->addItem($multiple); // role mapping $rm = new ilFormSectionHeaderGUI(); $rm->setTitle($this->lng->txt('ecs_role_mappings')); $form->addItem($rm); $mapping_defs = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getRoleMappings(); include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php'; foreach (ilECSMappingUtils::getRoleMappingInfo() as $name => $info) { $role_map = new ilTextInputGUI($this->lng->txt($info['lang']), $name); $role_map->setValue($mapping_defs[$name]); $role_map->setSize(32); $role_map->setMaxLength(64); $role_map->setRequired($info['required']); $form->addItem($role_map); } $form->addCommandButton('cUpdateSettings', $this->lng->txt('save')); $form->addCommandButton('cSettings', $this->lng->txt('cancel')); return $form; }
/** * parse * * @access public * @return */ public function parse() { global $ilUser, $tree; include_once './Services/Calendar/classes/class.ilCalendarCategories.php'; $cats = ilCalendarCategories::_getInstance($ilUser->getId()); $cats->initialize(ilCalendarCategories::MODE_MANAGE); $tmp_title_counter = array(); $categories = array(); foreach ($cats->getCategoriesInfo() as $category) { $tmp_arr['obj_id'] = $category['obj_id']; $tmp_arr['id'] = $category['cat_id']; $tmp_arr['title'] = $category['title']; $tmp_arr['type'] = $category['type']; // Append object type to make type sortable $tmp_arr['type_sortable'] = ilCalendarCategory::lookupCategorySortIndex($category['type']); if ($category['type'] == ilCalendarCategory::TYPE_OBJ) { $tmp_arr['type_sortable'] .= '_' . ilObject::_lookupType($category['obj_id']); } $tmp_arr['color'] = $category['color']; $tmp_arr['editable'] = $category['editable']; $tmp_arr['accepted'] = $category['accepted']; $tmp_arr['remote'] = $category['remote']; $categories[] = $tmp_arr; // count title for appending the parent container if there is more than one entry. $tmp_title_counter[$category['type'] . '_' . $category['title']]++; } $path_categories = array(); foreach ($categories as $cat) { if ($cat['type'] == ilCalendarCategory::TYPE_OBJ) { if ($tmp_title_counter[$cat['type'] . '_' . $cat['title']] > 1) { foreach (ilObject::_getAllReferences($cat['obj_id']) as $ref_id) { include_once './Services/Tree/classes/class.ilPathGUI.php'; $path = new ilPathGUI(); $path->setUseImages(false); $path->enableTextOnly(false); $cat['path'] = $path->getPath(ROOT_FOLDER_ID, $ref_id); break; } } } $path_categories[] = $cat; } $this->setData($path_categories); }
/** * Append path * @return */ protected function appendPath($a_ref_id) { include_once './Services/Tree/classes/class.ilPathGUI.php'; $path_gui = new ilPathGUI(); $path_gui->enableTextOnly(false); $path_gui->setUseImages(false); $tpl = new ilTemplate('tpl.lucene_path.html', true, true, 'Services/Search'); $tpl->setVariable('PATH_ITEM', $path_gui->getPath(ROOT_FOLDER_ID, $a_ref_id)); return $tpl->get(); }
/** * insert path */ function insertPath() { global $tree, $lng; if ($this->getPathStatus() != false) { include_once 'Services/Tree/classes/class.ilPathGUI.php'; $path_gui = new ilPathGUI(); $path_gui->enableTextOnly(!$this->path_linked); $path_gui->setUseImages(false); $start_node = $this->path_start_node ? $this->path_start_node : ROOT_FOLDER_ID; $this->tpl->setCurrentBlock("path_item"); $this->tpl->setVariable('PATH_ITEM', $path_gui->getPath($start_node, $this->ref_id)); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("path"); $this->tpl->setVariable("TXT_LOCATION", $lng->txt("locator")); $this->tpl->parseCurrentBlock(); return true; } }