82 $this->tpl = $DIC[
'tpl'];
83 $this->ctrl = $DIC[
'ilCtrl'];
84 $this->lng = $DIC[
'lng'];
85 $this->browser = $DIC[
'ilBrowser'];
86 $this->client_init = $DIC[
'ilClientIniFile'];
87 $this->
user = $DIC[
'ilUser'];
96 array_push($this->plugins, $a_plugin_name);
105 array_push($this->buttons, $a_button_name);
114 $key = array_search($a_plugin_name, $this->plugins);
117 unset($this->plugins[$key]);
126 foreach($this->plugins as $plugin)
138 $key = array_search($a_button_name, $this->buttons);
141 unset($this->buttons[$key]);
154 public function addRTESupport($obj_id, $obj_type, $a_module =
"", $allowFormElements = FALSE, $cfg_template = null, $hide_switch =
false)
181 require_once
'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
202 require_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
205 while(preg_match(
"/data\/" . CLIENT_ID .
"\/mobs\/mm_([0-9]+)/i", $a_text, $found))
207 $a_text = str_replace($found[0],
"", $a_text);
208 if(!in_array($found[1],
$mobs))
216 unset(
$mobs[$found[1]]);
223 foreach(
$mobs as $mob)
239 if(!strlen($a_text))
return '';
244 $a_text = preg_replace(
'/src="([^"]*?\/mobs\/mm_([0-9]+)\/.*?)\"/',
'src="il_' . IL_INST_ID .
'_mob_\\2"', $a_text);
248 require_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
249 $resulttext = $a_text;
250 if(preg_match_all(
'/src="il_([0-9]+)_mob_([0-9]+)"/', $a_text, $matches))
252 foreach($matches[2] as $idx => $mob)
257 $replace =
"il_" . $matches[1][$idx] .
"_mob_" . $mob;
258 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
259 $path_to_file =
ilWACSignedPath::signFile(ILIAS_HTTP_PATH .
"/data/" . CLIENT_ID .
"/mobs/mm_" . $mob .
"/" . $mob_obj->getTitle());
260 $resulttext = str_replace(
"src=\"$replace\"",
"src=\"" . $path_to_file .
"\"", $resulttext);
264 $a_text = $resulttext;
279 if(!strlen($a_text))
return array();
281 require_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
283 $mediaObjects =
array();
287 if(preg_match_all(
'/src="([^"]*?\/mobs\/mm_([0-9]+)\/.*?)\"/', $a_text, $matches))
289 foreach($matches[2] as $idx => $mob)
293 $mediaObjects[] = $mob;
300 if(preg_match_all(
'/src="il_([0-9]+)_mob_([0-9]+)"/', $a_text, $matches))
302 foreach($matches[2] as $idx => $mob)
306 $mediaObjects[] = $mob;
313 return $mediaObjects;
323 $this->root_block_element = $a_root_block_element;
343 if(is_array($a_button))
345 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons, $a_button));
349 $this->disabled_buttons = array_unique(array_merge($this->disabled_buttons,
array($a_button)));
364 return implode(
',', $this->disabled_buttons);
static _getMediaObjects($a_text, $a_direction=0)
Returns all media objects found in the passed string.
static _getRTEClassname()
addButton($a_button_name)
Adds a button to the button list.
static _getRichTextEditor()
Returns the identifier for the Rich Text Editor.
disableButtons($a_button)
Sets buttons which should be disabled in the RTE.
removeAllPlugins()
Removes all plugins from instance.
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
setInitialWidth($initialWidth)
removeButton($a_button_name)
Removes a button from the button list.
addRTESupport($obj_id, $obj_type, $a_module="", $allowFormElements=FALSE, $cfg_template=null, $hide_switch=false)
Adds support for an RTE in an ILIAS form.
addUserTextEditor($editor_selector)
Adds support for an user text editor.
Rich Text Editor base class This class provides access methods to a Rich Text Editor (RTE) integrated...
const ILIAS_IMG_MANAGER_PLUGIN
__construct($a_version='')
ilRTE constructor.
static signFile($path_to_file)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
addPlugin($a_plugin_name)
Adds a plugin to the plugin list.
removePlugin($a_plugin_name)
Removes a plugin from the plugin list.
getRTERootBlockElement()
Getter for the RTE root block element.
static _cleanupMediaObjectUsage($a_text, $a_usage_type, $a_usage_id)
Synchronises appearances of media objects in $a_text with media object usage table.
getDisabledButtons($as_array=true)
Returns the disabled RTE buttons.
setRTERootBlockElement($a_root_block_element)
Setter for the RTE root block element.
addCustomRTESupport($obj_id, $obj_type, array $tags)
Adds custom support for an RTE in an ILIAS form.