當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilRTE::_cleanupMediaObjectUsage方法代碼示例

本文整理匯總了PHP中ilRTE::_cleanupMediaObjectUsage方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilRTE::_cleanupMediaObjectUsage方法的具體用法?PHP ilRTE::_cleanupMediaObjectUsage怎麽用?PHP ilRTE::_cleanupMediaObjectUsage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ilRTE的用法示例。


在下文中一共展示了ilRTE::_cleanupMediaObjectUsage方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: cleanupMediaobjectUsage

 /**
  * Cleans up the media objects for all text fields in a test which are using an RTE field
  *
  * @access private
  */
 function cleanupMediaobjectUsage()
 {
     include_once "./Services/RTE/classes/class.ilRTE.php";
     $completecontent = "";
     foreach ($this->getAllRTEContent() as $content) {
         $completecontent .= $content;
     }
     ilRTE::_cleanupMediaObjectUsage($completecontent, $this->getType() . ":html", $this->getId());
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:14,代碼來源:class.ilObjTest.php

示例2: savePageContentObject

 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, "");
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:29,代碼來源:class.ilContainerGUI.php

示例3: cleanupMediaObjectUsage

 /**
  * synchronises appearances of media objects in the question with media
  * object usage table
  */
 function cleanupMediaObjectUsage()
 {
     $combinedtext = $this->getRTETextWithMediaObjects();
     include_once "./Services/RTE/classes/class.ilRTE.php";
     ilRTE::_cleanupMediaObjectUsage($combinedtext, "qpl:html", $this->getId());
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:10,代碼來源:class.assQuestion.php

示例4: saveToDb

 /**
  * Saves a SurveyQuestion object to a database
  *
  * @param integer $original_id
  * @access public
  */
 function saveToDb($original_id = "")
 {
     global $ilDB;
     // cleanup RTE images which are not inserted into the question text
     include_once "./Services/RTE/classes/class.ilRTE.php";
     ilRTE::_cleanupMediaObjectUsage($this->getQuestiontext(), "spl:html", $this->getId());
     $affectedRows = 0;
     if ($this->getId() == -1) {
         // Write new dataset
         $next_id = $ilDB->nextId('svy_question');
         $affectedRows = $ilDB->insert("svy_question", array("question_id" => array("integer", $next_id), "questiontype_fi" => array("integer", $this->getQuestionTypeID()), "obj_fi" => array("integer", $this->getObjId()), "owner_fi" => array("integer", $this->getOwner()), "title" => array("text", $this->getTitle()), "label" => array("text", strlen($this->label) ? $this->label : null), "description" => array("text", $this->getDescription()), "author" => array("text", $this->getAuthor()), "questiontext" => array("clob", ilRTE::_replaceMediaObjectImageSrc($this->getQuestiontext(), 0)), "obligatory" => array("text", $this->getObligatory()), "complete" => array("text", $this->isComplete()), "created" => array("integer", time()), "original_id" => array("integer", $original_id ? $original_id : NULL), "tstamp" => array("integer", time())));
         $this->setId($next_id);
     } else {
         // update existing dataset
         $affectedRows = $ilDB->update("svy_question", array("title" => array("text", $this->getTitle()), "label" => array("text", strlen($this->label) ? $this->label : null), "description" => array("text", $this->getDescription()), "author" => array("text", $this->getAuthor()), "questiontext" => array("clob", ilRTE::_replaceMediaObjectImageSrc($this->getQuestiontext(), 0)), "obligatory" => array("text", $this->getObligatory()), "complete" => array("text", $this->isComplete()), "tstamp" => array("integer", time())), array("question_id" => array("integer", $this->getId())));
     }
     // #12420
     $set = $ilDB->query("SELECT survey_id FROM svy_svy" . " WHERE obj_fi = " . $ilDB->quote($this->getObjId(), "integer"));
     $survey_fi = $ilDB->fetchAssoc($set);
     $survey_fi = $survey_fi["survey_id"];
     // pool?
     if ($survey_fi) {
         $set = $ilDB->query("SELECT obligatory FROM svy_qst_oblig" . " WHERE survey_fi = " . $ilDB->quote($survey_fi, "integer") . " AND question_fi = " . $ilDB->quote($this->getId(), "integer"));
         $has_obligatory_states_entry = (bool) $ilDB->numRows($set);
         $is_obligatory = $ilDB->fetchAssoc($set);
         $is_obligatory = (bool) $is_obligatory["obligatory"];
         if (!$this->getObligatory()) {
             if ($has_obligatory_states_entry) {
                 $ilDB->manipulate("DELETE FROM svy_qst_oblig" . " WHERE survey_fi = " . $ilDB->quote($survey_fi, "integer") . " AND question_fi = " . $ilDB->quote($this->getId(), "integer"));
             }
         } else {
             if ($this->getObligatory()) {
                 if (!$has_obligatory_states_entry) {
                     // ilObjSurvey::setObligatoryStates()
                     $next_id = $ilDB->nextId('svy_qst_oblig');
                     $affectedRows = $ilDB->manipulateF("INSERT INTO svy_qst_oblig (question_obligatory_id, survey_fi, question_fi, " . "obligatory, tstamp) VALUES (%s, %s, %s, %s, %s)", array('integer', 'integer', 'integer', 'text', 'integer'), array($next_id, $survey_fi, $this->getId(), 1, time()));
                 } else {
                     if (!$is_obligatory) {
                         $ilDB->manipulate("UPDATE svy_qst_oblig" . " SET obligatory = " . $ilDB->quote(1, "integer") . " WHERE survey_fi = " . $ilDB->quote($survey_fi, "integer") . " AND question_fi = " . $ilDB->quote($this->getId(), "integer"));
                     }
                 }
             }
         }
     }
     return $affectedRows;
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:52,代碼來源:class.SurveyQuestion.php

示例5: saveToDb

 /**
  * Saves a SurveyQuestion object to a database
  *
  * @param integer $original_id
  * @access public
  */
 function saveToDb($original_id = "")
 {
     global $ilDB;
     // cleanup RTE images which are not inserted into the question text
     include_once "./Services/RTE/classes/class.ilRTE.php";
     ilRTE::_cleanupMediaObjectUsage($this->getQuestiontext(), "spl:html", $this->getId());
     $affectedRows = 0;
     if ($this->getId() == -1) {
         // Write new dataset
         $next_id = $ilDB->nextId('svy_question');
         $affectedRows = $ilDB->insert("svy_question", array("question_id" => array("integer", $next_id), "questiontype_fi" => array("integer", $this->getQuestionTypeID()), "obj_fi" => array("integer", $this->getObjId()), "owner_fi" => array("integer", $this->getOwner()), "title" => array("text", $this->getTitle()), "label" => array("text", strlen($this->label) ? $this->label : null), "description" => array("text", $this->getDescription()), "author" => array("text", $this->getAuthor()), "questiontext" => array("clob", ilRTE::_replaceMediaObjectImageSrc($this->getQuestiontext(), 0)), "obligatory" => array("text", $this->getObligatory()), "complete" => array("text", $this->isComplete()), "created" => array("integer", time()), "original_id" => array("integer", $original_id ? $original_id : NULL), "tstamp" => array("integer", time())));
         $this->setId($next_id);
     } else {
         // update existing dataset
         $affectedRows = $ilDB->update("svy_question", array("title" => array("text", $this->getTitle()), "label" => array("text", strlen($this->label) ? $this->label : null), "description" => array("text", $this->getDescription()), "author" => array("text", $this->getAuthor()), "questiontext" => array("clob", ilRTE::_replaceMediaObjectImageSrc($this->getQuestiontext(), 0)), "obligatory" => array("text", $this->getObligatory()), "complete" => array("text", $this->isComplete()), "tstamp" => array("integer", time())), array("question_id" => array("integer", $this->getId())));
     }
     return $affectedRows;
 }
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:24,代碼來源:class.SurveyQuestion.php


注:本文中的ilRTE::_cleanupMediaObjectUsage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。