Пример #1
0
 function savePageContentObject()
 {
     include_once "Services/XHTMLPage/classes/class.ilXHTMLPage.php";
     include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
     $xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(), "xhtml_page");
     /*include_once("./Services/Form/classes/class.ilFormPropertyGUI.php");
     		include_once("./Services/Form/classes/class.ilTextAreaInputGUI.php");
     		$ta = new ilTextAreaInputGUI();
     		$ta->setRteTagSet("extended_table_img");
     		$tags = $ta->getRteTagString();*/
     //$text = ilUtil::stripSlashes($_POST["page_content"],
     //		true,
     //		$tags);
     $text = ilUtil::stripSlashes($_POST["page_content"], true, ilObjAdvancedEditing::_getUsedHTMLTagsAsString());
     if ($xpage_id > 0) {
         $xpage = new ilXHTMLPage($xpage_id);
         $xpage->setContent($text);
         $xpage->save();
     } else {
         $xpage = new ilXHTMLPage();
         $xpage->setContent($text);
         $xpage->save();
         ilContainer::_writeContainerSetting($this->object->getId(), "xhtml_page", $xpage->getId());
     }
     include_once "Services/RTE/classes/class.ilRTE.php";
     ilRTE::_cleanupMediaObjectUsage($text, $this->object->getType() . ":html", $this->object->getId());
     ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
     $this->ctrl->redirect($this, "");
 }
Пример #2
0
 function handlerEndTag($a_xml_parser, $a_name)
 {
     switch ($a_name) {
         case "title":
             $this->group_data["title"] = trim($this->cdata);
             break;
         case "description":
             $this->group_data["description"] = trim($this->cdata);
             break;
         case 'information':
             $this->group_data['information'] = trim($this->cdata);
             break;
         case 'password':
             $this->group_data['password'] = trim($this->cdata);
             break;
         case 'maxMembers':
             $this->group_data['max_members'] = trim($this->cdata);
             break;
         case 'expiration':
             $this->group_data['expiration_end'] = trim($this->cdata);
             break;
         case 'start':
             $this->group_data['expiration_start'] = trim($this->cdata);
             break;
         case 'end':
             $this->group_data['expiration_end'] = trim($this->cdata);
             break;
         case "folder":
             $this->__popParentId();
             break;
         case "folderTitle":
             $this->folder = trim($this->cdata);
             $this->__saveFolder();
             break;
         case "group":
             // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
             $this->__save();
             break;
         case 'ContainerSetting':
             if ($this->current_container_setting) {
                 // #17357
                 if (!$this->group_obj instanceof ilObjGroup) {
                     $this->__initGroupObject();
                 }
                 ilContainer::_writeContainerSetting($this->group_obj->getId(), $this->current_container_setting, $this->cdata);
             }
             break;
     }
     $this->cdata = '';
 }
Пример #3
0
 /**
  * updates object entry in object_data
  *
  * @access	public
  */
 function updateObject()
 {
     global $ilSetting;
     if (!$this->checkPermissionBool("write")) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
     } else {
         $form = $this->initEditForm();
         if ($form->checkInput()) {
             $this->saveSortingSettings($form);
             // save custom icons
             //save custom icons
             if ($ilSetting->get("custom_icons")) {
                 if ($_POST["cont_icon_delete"]) {
                     $this->object->removeCustomIcon();
                 }
                 $this->object->saveIcons($_FILES["cont_icon"]['tmp_name']);
             }
             // hide icon/title
             ilContainer::_writeContainerSetting($this->object->getId(), "hide_header_icon_and_title", $form->getInput("hide_header_icon_and_title"));
             // BEGIN ChangeEvent: Record update
             global $ilUser;
             require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
             ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'update');
             ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
             // END ChangeEvent: Record update
             ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
             $this->ctrl->redirect($this, "edit");
         }
         // display form to correct errors
         $this->setEditTabs();
         $form->setValuesByPost();
         $this->tpl->setContent($form->getHTML());
     }
 }
Пример #4
0
 protected function updateTaxonomySettingsObject()
 {
     $taxonomies = $this->getTaxonomiesForRefId();
     if (sizeof($taxonomies)) {
         $form = $this->initTaxonomyForm($taxonomies);
         if ($form->checkInput()) {
             $sblock = $form->getInput("sblock");
             $prefix = self::CONTAINER_SETTING_TAXBLOCK;
             ilContainer::_deleteContainerSettings($this->object->getId(), $prefix . "%", true);
             if (is_array($sblock)) {
                 foreach ($sblock as $tax_id) {
                     ilContainer::_writeContainerSetting($this->object->getId(), $prefix . $tax_id, 1);
                 }
             }
             ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
         }
     }
     $this->ctrl->redirect($this, "editTaxonomySettings");
 }
Пример #5
0
 /**
  * remove small icon
  */
 function removeCustomIcon()
 {
     $cont_dir = $this->getContainerDirectory();
     $small_file_name = $cont_dir . "/icon_custom.svg";
     @unlink($small_file_name);
     ilContainer::_writeContainerSetting($this->getId(), "icon_custom", 0);
 }
 /**
  * remove tiny icon
  */
 function removeTinyIcon()
 {
     $cont_dir = $this->getContainerDirectory();
     $tiny_file_name = $cont_dir . "/icon_tiny.png";
     @unlink($tiny_file_name);
     ilContainer::_writeContainerSetting($this->getId(), "icon_tiny", 0);
 }
Пример #7
0
 /**
  * handler for end of element
  *
  * @param	resource	$a_xml_parser		xml parser
  * @param	string		$a_name				element name
  */
 function handlerEndTag($a_xml_parser, $a_name)
 {
     if ($this->in_meta_data) {
         parent::handlerEndTag($a_xml_parser, $a_name);
     }
     switch ($a_name) {
         case 'Course':
             $this->log->write('CourseXMLParser: import_id = ' . $this->course_obj->getImportId());
             $this->course_obj->MDUpdateListener('General');
             $this->course_obj->update();
             $this->adv_md_handler->save();
             break;
         case 'Settings':
             $this->in_settings = false;
             break;
         case 'Availability':
             $this->in_availability = false;
             break;
         case 'Registration':
             $this->in_registration = false;
             break;
         case 'Archive':
             $this->in_archive = false;
             break;
         case 'Start':
             if ($this->in_availability) {
                 $this->course_obj->setActivationStart(trim($this->cdata));
             }
             if ($this->in_registration) {
                 $this->course_obj->setSubscriptionStart(trim($this->cdata));
             }
             if ($this->in_archive) {
                 $this->course_obj->setArchiveStart(trim($this->cdata));
             }
             break;
         case 'End':
             if ($this->in_availability) {
                 $this->course_obj->setActivationEnd(trim($this->cdata));
             }
             if ($this->in_registration) {
                 $this->course_obj->setSubscriptionEnd(trim($this->cdata));
             }
             if ($this->in_archive) {
                 $this->course_obj->setArchiveEnd(trim($this->cdata));
             }
             break;
         case 'Syllabus':
             $this->course_obj->setSyllabus(trim($this->cdata));
             break;
         case 'ImportantInformation':
             $this->course_obj->setImportantInformation(trim($this->cdata));
             break;
         case 'Name':
             $this->course_obj->setContactName(trim($this->cdata));
             break;
         case 'Responsibility':
             $this->course_obj->setContactResponsibility(trim($this->cdata));
             break;
         case 'Phone':
             $this->course_obj->setContactPhone(trim($this->cdata));
             break;
         case 'Email':
             $this->course_obj->setContactEmail(trim($this->cdata));
             break;
         case 'Consultation':
             $this->course_obj->setContactConsultation(trim($this->cdata));
             break;
         case 'Password':
             $this->course_obj->setSubscriptionPassword(trim($this->cdata));
             break;
         case 'MetaData':
             $this->in_meta_data = false;
             parent::handlerEndTag($a_xml_parser, $a_name);
             break;
         case 'ContainerSetting':
             if ($this->current_container_setting) {
                 ilContainer::_writeContainerSetting($this->course_obj->getId(), $this->current_container_setting, $this->cdata);
             }
             break;
     }
     $this->cdata = '';
     return;
 }
 /**
  * Update settings
  */
 protected function updateToolSettings()
 {
     $form = $this->initSettingsForm();
     if ($form->checkInput()) {
         include_once './Services/Calendar/classes/class.ilCalendarSettings.php';
         if (ilCalendarSettings::_getInstance()->isEnabled()) {
             if ($this->isModeActive(self::CALENDAR_VISIBILITY)) {
                 ilContainer::_writeContainerSetting($this->getObjId(), 'show_calendar', (int) $form->getInput('calendar'));
             }
         }
         ilUtil::sendSuccess($GLOBALS['lng']->txt('settings_saved'), true);
         $GLOBALS['ilCtrl']->redirect($this);
     }
     ilUtil::sendFailure($GLOBALS['lng']->txt('err_check_input'));
     $form->setValuesByPost();
     $this->editSettings($form);
 }
 /**
  * Handler end tag
  * @param type $a_xml_parser
  * @param type $a_name 
  */
 public function handlerEndTag($a_xml_parser, $a_name)
 {
     switch ($a_name) {
         case "Category":
             $this->save();
             break;
         case 'Title':
             $this->current_translation['title'] = trim($this->cdata);
             if ($this->current_translation['default']) {
                 $this->getCategory()->setTitle(trim($this->cdata));
             }
             break;
         case 'Description':
             $this->current_translation['description'] = trim($this->cdata);
             if ($this->current_translation['default']) {
                 $this->getCategory()->setDescription(trim($this->cdata));
             }
             break;
         case 'Translation':
             // Add translation
             $this->getCategory()->addTranslation((string) $this->current_translation['title'], (string) $this->current_translation['description'], (string) $this->current_translation['lang'], (int) $this->current_translation['default']);
             break;
         case 'ContainerSetting':
             if ($this->current_container_setting) {
                 ilContainer::_writeContainerSetting($this->getCategory()->getId(), $this->current_container_setting, $this->cdata);
             }
             break;
     }
     $this->cdata = '';
 }