コード例 #1
0
 /**
  * update object data
  *
  * @access	public
  * @return	boolean
  */
 function update()
 {
     global $ilDB;
     $this->updateMetaData();
     parent::update();
     $ilDB->manipulate("UPDATE file_based_lm SET " . " is_online = " . $ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text") . ", startfile = " . $ilDB->quote($this->getStartFile(), "text") . " " . ", show_lic = " . $ilDB->quote($this->getShowLicense(), "integer") . " " . ", show_bib = " . $ilDB->quote($this->getShowBibliographicalData(), "integer") . " " . " WHERE id = " . $ilDB->quote($this->getId(), "integer"));
     return true;
 }
コード例 #2
0
 /**
  * @param ilObjiLincCourse $a_new_object 
  */
 protected function afterSave(ilObject $a_new_object)
 {
     // save ilinc_id in ILIAS and save data
     $a_new_object->storeiLincId($this->iLincAddCourseResponse->getFirstID());
     $a_new_object->saveActivationStatus(ilUtil::tf2yn((bool) $this->form_gui->getInput('activated')));
     $a_new_object->saveAKClassValues($this->form_gui->getInput('akclassvalue1'), $this->form_gui->getInput('akclassvalue2'));
     // ...finally assign icrsadmin role to creator of icrs object
     $success = $a_new_object->addMember($this->ilias->account, $a_new_object->getDefaultAdminRole(), true);
     if (!$success) {
         ilUtil::sendFailure($a_new_object->getErrorMsg(), true);
         $this->ctrl->returnToParent($this);
     }
     //		$icrsObj->setRegistrationFlag($_POST["enable_registration"]); //0=no registration, 1=registration enabled 2=passwordregistration
     //		$icrsObj->setPassword($_POST["password"]);
     //		$icrsObj->setExpirationDateTime($_POST["expirationdate"]." ".$_POST["expirationtime"].":00");
     $this->ilias->account->addDesktopItem($a_new_object->getRefId(), 'icrs');
     // always send a message
     ilUtil::sendInfo($this->lng->txt('icrs_added'), true);
     $this->redirectToRefId((int) $_GET['ref_id']);
 }
コード例 #3
0
    /**
     * update object data
     *
     * @access	public
     * @return	boolean
     */
    function update()
    {
        global $ilDB;
        $this->updateMetaData();
        parent::update();
        $statement = $ilDB->manipulateF('
			UPDATE sahs_lm  
			SET c_online = %s, 
				api_adapter = %s, 
				api_func_prefix = %s,
				auto_review = %s,
				default_lesson_mode = %s,
				c_type = %s,
				stylesheet = %s, 
				editable = %s, 
				max_attempt = %s, 
				module_version = %s, 
				credit = %s, 
				glossary = %s, 
				question_tries = %s,
				unlimited_session = %s,
				no_menu = %s,
				hide_navig = %s,
				sequencing = %s,
				interactions = %s,
				objectives = %s,
				comments = %s,
				time_from_lms = %s,
				debug = %s,
				localization = %s,
				seq_exp_mode = %s,
				debugpw = %s,
				open_mode = %s,
				width = %s,
				height = %s,
				auto_continue = %s,
				auto_last_visited = %s,
				check_values = %s,
				offline_mode = %s,
				auto_suspend = %s
			WHERE id = %s', array('text', 'text', 'text', 'text', 'text', 'text', 'integer', 'integer', 'integer', 'integer', 'text', 'integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'text', 'integer', 'integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer'), array(ilUtil::tf2yn($this->getOnline()), $this->getAPIAdapterName(), $this->getAPIFunctionsPrefix(), $this->getAutoReviewChar(), $this->getDefaultLessonMode(), $this->getSubType(), $this->getStyleSheetId(), $this->getEditable(), $this->getMaxAttempt(), $this->getModuleVersion(), $this->getCreditMode(), $this->getAssignedGlossary(), $this->getTries(), ilUtil::tf2yn($this->getSession()), ilUtil::tf2yn($this->getNoMenu()), ilUtil::tf2yn($this->getHideNavig()), ilUtil::tf2yn($this->getSequencing()), ilUtil::tf2yn($this->getInteractions()), ilUtil::tf2yn($this->getObjectives()), ilUtil::tf2yn($this->getComments()), ilUtil::tf2yn($this->getTime_from_lms()), ilUtil::tf2yn($this->getDebug()), $this->getLocalization(), $this->getSequencingExpertMode(), $this->getDebugPw(), $this->getOpenMode(), $this->getWidth(), $this->getHeight(), ilUtil::tf2yn($this->getAutoContinue()), ilUtil::tf2yn($this->getAuto_last_visited()), ilUtil::tf2yn($this->getCheck_values()), ilUtil::tf2yn($this->getOfflineMode()), ilUtil::tf2yn($this->getAutoSuspend()), $this->getId()));
        return true;
    }
コード例 #4
0
 /**
  * export properties of content object
  *
  */
 function exportXMLProperties($a_xml_writer, &$expLog)
 {
     $attrs = array();
     $a_xml_writer->xmlStartTag("Properties", $attrs);
     // Layout
     $attrs = array("Name" => "Layout", "Value" => $this->getLayout());
     $a_xml_writer->xmlElement("Property", $attrs);
     // Page Header
     $attrs = array("Name" => "PageHeader", "Value" => $this->getPageHeader());
     $a_xml_writer->xmlElement("Property", $attrs);
     // TOC Mode
     $attrs = array("Name" => "TOCMode", "Value" => $this->getTOCMode());
     $a_xml_writer->xmlElement("Property", $attrs);
     // LM Menu Activation
     $attrs = array("Name" => "ActiveLMMenu", "Value" => ilUtil::tf2yn($this->isActiveLMMenu()));
     $a_xml_writer->xmlElement("Property", $attrs);
     // Numbering Activation
     $attrs = array("Name" => "ActiveNumbering", "Value" => ilUtil::tf2yn($this->isActiveNumbering()));
     $a_xml_writer->xmlElement("Property", $attrs);
     // Table of contents button activation
     $attrs = array("Name" => "ActiveTOC", "Value" => ilUtil::tf2yn($this->isActiveTOC()));
     $a_xml_writer->xmlElement("Property", $attrs);
     // Print view button activation
     $attrs = array("Name" => "ActivePrintView", "Value" => ilUtil::tf2yn($this->isActivePrintView()));
     $a_xml_writer->xmlElement("Property", $attrs);
     // Note that download button is not saved, because
     // download files do not exist after import
     // Clean frames
     $attrs = array("Name" => "CleanFrames", "Value" => ilUtil::tf2yn($this->cleanFrames()));
     $a_xml_writer->xmlElement("Property", $attrs);
     // Public notes activation
     $attrs = array("Name" => "PublicNotes", "Value" => ilUtil::tf2yn($this->publicNotes()));
     $a_xml_writer->xmlElement("Property", $attrs);
     // History comments for authors activation
     $attrs = array("Name" => "HistoryUserComments", "Value" => ilUtil::tf2yn($this->isActiveHistoryUserComments()));
     $a_xml_writer->xmlElement("Property", $attrs);
     // Rating
     $attrs = array("Name" => "Rating", "Value" => ilUtil::tf2yn($this->hasRating()));
     $a_xml_writer->xmlElement("Property", $attrs);
     // Header Page
     if ($this->getHeaderPage() > 0) {
         $attrs = array("Name" => "HeaderPage", "Value" => "il_" . IL_INST_ID . "_pg_" . $this->getHeaderPage());
         $a_xml_writer->xmlElement("Property", $attrs);
     }
     // Footer Page
     if ($this->getFooterPage() > 0) {
         $attrs = array("Name" => "FooterPage", "Value" => "il_" . IL_INST_ID . "_pg_" . $this->getFooterPage());
         $a_xml_writer->xmlElement("Property", $attrs);
     }
     $a_xml_writer->xmlEndTag("Properties");
 }
コード例 #5
0
 /**
  * save permissions
  * 
  * @access	public
  */
 function permSaveObject($a_show_admin_permissions = false)
 {
     global $rbacsystem, $rbacadmin, $rbacreview, $objDefinition, $tree;
     // for role administration check write of global role folder
     /*
     if ($this->rolf_ref_id == ROLE_FOLDER_ID)
     {
     	$access = $rbacsystem->checkAccess('write',$this->rolf_ref_id);
     }
     else	// for local roles check 'edit permission' of parent object of the local role folder
     {
     	$access = $rbacsystem->checkAccess('edit_permission',$tree->getParentId($this->rolf_ref_id));
     }
     */
     $access = $this->checkAccess('visible,write', 'edit_permission');
     if (!$access) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"), $this->ilias->error_obj->MESSAGE);
     }
     // rbac log
     include_once "Services/AccessControl/classes/class.ilRbacLog.php";
     $rbac_log_active = ilRbacLog::isActive();
     if ($rbac_log_active) {
         $rbac_log_old = ilRbacLog::gatherTemplate($this->rolf_ref_id, $this->object->getId());
     }
     // delete all template entries of enabled types
     if ($this->rolf_ref_id == ROLE_FOLDER_ID) {
         if ($a_show_admin_permissions) {
             $subs = $objDefinition->getSubObjectsRecursively('adm', true, true);
         } else {
             $subs = $objDefinition->getSubObjectsRecursively('root', true, false);
         }
     } else {
         $subs = $objDefinition->getSubObjectsRecursively($this->getParentType(), true, false);
     }
     foreach ($subs as $subtype => $def) {
         // Delete per object type
         $rbacadmin->deleteRolePermission($this->object->getId(), $this->rolf_ref_id, $subtype);
     }
     if (empty($_POST["template_perm"])) {
         $_POST["template_perm"] = array();
     }
     foreach ($_POST["template_perm"] as $key => $ops_array) {
         // sets new template permissions
         $rbacadmin->setRolePermission($this->object->getId(), $key, $ops_array, $this->rolf_ref_id);
     }
     if ($rbac_log_active) {
         $rbac_log_new = ilRbacLog::gatherTemplate($this->rolf_ref_id, $this->object->getId());
         $rbac_log_diff = ilRbacLog::diffTemplate($rbac_log_old, $rbac_log_new);
         ilRbacLog::add(ilRbacLog::EDIT_TEMPLATE, $this->obj_ref_id, $rbac_log_diff);
     }
     // update object data entry (to update last modification date)
     $this->object->update();
     // set protected flag
     if ($this->rolf_ref_id == ROLE_FOLDER_ID or $rbacreview->isAssignable($this->object->getId(), $this->rolf_ref_id)) {
         $rbacadmin->setProtected($this->rolf_ref_id, $this->object->getId(), ilUtil::tf2yn($_POST['protected']));
     }
     if ($a_show_admin_permissions) {
         $_POST['recursive'] = true;
     }
     // Redirect if Change existing objects is not chosen
     if (!$_POST['recursive'] and !is_array($_POST['recursive_list'])) {
         ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
         if ($a_show_admin_permissions) {
             $this->ctrl->redirect($this, 'adminPerm');
         } else {
             $this->ctrl->redirect($this, 'perm');
         }
     }
     // New implementation
     if ($this->isChangeExistingObjectsConfirmationRequired() and !$a_show_admin_permissions) {
         $this->showChangeExistingObjectsConfirmation();
         return true;
     }
     $start = $this->rolf_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID : $tree->getParentId($this->rolf_ref_id);
     if ($a_show_admin_permissions) {
         $start = $tree->getParentId($this->rolf_ref_id);
     }
     if ($_POST['protected']) {
         $this->object->changeExistingObjects($start, ilObjRole::MODE_PROTECTED_KEEP_LOCAL_POLICIES, array('all'), array());
     } else {
         $this->object->changeExistingObjects($start, ilObjRole::MODE_UNPROTECTED_KEEP_LOCAL_POLICIES, array('all'), array());
     }
     ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
     if ($a_show_admin_permissions) {
         $this->ctrl->redirect($this, 'adminPerm');
     } else {
         $this->ctrl->redirect($this, 'perm');
     }
     return true;
 }
コード例 #6
0
 /**
  * update role template object
  *
  * @access	public
  */
 function updateObject()
 {
     global $rbacsystem, $rbacadmin, $rbacreview;
     // check write access
     if (!$rbacsystem->checkAccess("write", $this->rolf_ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_modify_rolt"), $this->ilias->error_obj->WARNING);
     }
     if (substr($this->object->getTitle(), 0, 3) != "il_") {
         // check required fields
         if (empty($_POST["Fobject"]["title"])) {
             $this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"), $this->ilias->error_obj->MESSAGE);
         }
         // check if role title has il_ prefix
         if (substr($_POST["Fobject"]["title"], 0, 3) == "il_") {
             $this->ilias->raiseError($this->lng->txt("msg_role_reserved_prefix"), $this->ilias->error_obj->MESSAGE);
         }
         // update
         $this->object->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
     }
     $this->object->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
     $rbacadmin->setProtected($this->rolf_ref_id, $this->object->getId(), ilUtil::tf2yn($_POST["Fobject"]["protect_permissions"]));
     $this->object->update();
     ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
     $this->ctrl->returnToParent($this);
 }
コード例 #7
0
 /**
  * Update object
  */
 function update()
 {
     global $ilDB;
     $this->updateMetaData();
     $ilDB->manipulate("UPDATE glossary SET " . " is_online = " . $ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text") . "," . " virtual = " . $ilDB->quote($this->getVirtualMode(), "text") . "," . " public_xml_file = " . $ilDB->quote($this->getPublicExportFile("xml"), "text") . "," . " public_html_file = " . $ilDB->quote($this->getPublicExportFile("html"), "text") . "," . " glo_menu_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveGlossaryMenu()), "text") . "," . " downloads_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveDownloads()), "text") . ", " . " pres_mode = " . $ilDB->quote($this->getPresentationMode(), "text") . ", " . " show_tax = " . $ilDB->quote((int) $this->getShowTaxonomy(), "integer") . ", " . " snippet_length = " . $ilDB->quote((int) $this->getSnippetLength(), "integer") . " " . " WHERE id = " . $ilDB->quote($this->getId(), "integer"));
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     ilObjStyleSheet::writeStyleUsage($this->getId(), $this->getStyleSheetId());
     parent::update();
 }