24 chdir(
'../../../../../');
26 require_once
'Services/Init/classes/class.ilInitialisation.php';
54 if(strpos(
$iliasHttpPath,
'https://') ===
false && $https->isDetected())
66 include_once
'webservice/soap/include/inc.soap_functions.php';
76 if(isset($_FILES[
'img_file'][
'size']) && $_FILES[
'img_file'][
'size'] > 0)
78 include_once
'webservice/soap/include/inc.soap_functions.php';
79 $safefilename = preg_replace(
'/[^a-zA-z0-9_\.]/',
'', $_FILES[
'img_file'][
'name']);
84 $media_object->_saveUsage($media_object->getId(),
$_GET[
'obj_type'] .
':html', (int)
$_GET[
'obj_id']);
87 $mobs[$media_object->getId()] = $media_object->getId();
90 $tpl =
new ilTemplate(dirname(__FILE__).
'/tpl.imagemanager.html',
true,
true);
94 && (
$_POST[
'lib_action']==
'delete') && !empty(
$img))
101 $tpl->touchBlock(
"delete_allowed");
105 $tpl->setVariable(
'OBJ_ID', (
int)
$_GET[
'obj_id']);
106 $tpl->setVariable(
'OBJ_TYPE', $_GET[
'obj_type']);
107 $tpl->setVariable(
'VALUE_UPDATE', (
int)$_GET[
'update']);
109 if($_GET[
'update'] == 1)
111 $tpl->setVariable(
'INSERT_COMMAND',
'{#update}');
115 $tpl->setVariable(
'INSERT_COMMAND',
'{#insert}');
141 global $arr_tinyMCE_image_files;
143 $arr_tinyMCE_image_files = array();
147 foreach($mobs as $mob)
149 $mobdir = $iliasAbsolutePath . $iliasMobPath .
'mm_' . $mob .
'/';
153 while(FALSE !== ($entry =
$d->read()))
155 $ext = strtolower(substr(strrchr($entry,
'.'), 1));
156 if(is_file($mobdir . $entry) && in_array($ext, $tinyMCE_valid_imgs))
158 $arr_tinyMCE_image_files[$i][
'file_name'] = $entry;
159 $arr_tinyMCE_image_files[$i][
'file_dir'] = $mobdir;
160 $arr_tinyMCE_image_files[$i][
'http_dir'] = $iliasHttpPath . $iliasMobPath .
'mm_' . $mob .
'/';
168 $errors[] =
'{#ibrowser.errornodir}';
172 sort($arr_tinyMCE_image_files);
174 for($k = 0; $k < count($arr_tinyMCE_image_files); $k++)
176 $entry = $arr_tinyMCE_image_files[$k][
'file_name'];
177 $size = getimagesize($arr_tinyMCE_image_files[$k][
'file_dir'] . $entry);
178 $fsize = filesize($arr_tinyMCE_image_files[$k][
'file_dir'] . $entry);
179 $tpl->setCurrentBlock(
'imagefile');
180 $tpl->setVariable(
'IMAGEFILE_VALUE', $arr_tinyMCE_image_files[$k][
'http_dir']);
181 $tpl->setVariable(
'IMAGEFILE_TEXT', $entry);
184 $tpl->setVariable(
'IMAGEFILE_SELECTED',
' selected=\'selected\'');
186 $tpl->parseCurrentBlock();
196 global $arr_tinyMCE_image_files;
198 for($k = 0; $k < count($arr_tinyMCE_image_files); $k++)
200 $tpl->setCurrentBlock(
'imageparams');
201 $entry = $arr_tinyMCE_image_files[$k][
'file_name'];
202 $size = getimagesize($arr_tinyMCE_image_files[$k][
'file_dir'] . $entry);
203 $fsize = filesize($arr_tinyMCE_image_files[$k][
'file_dir'] . $entry);
204 $tpl->setVariable(
'IMG_WIDTH',
$size[0]);
205 $tpl->setVariable(
'IMG_HEIGHT',
$size[1]);
206 $tpl->setVariable(
'IMG_PATH', $arr_tinyMCE_image_files[$k][
'http_dir']);
208 $tpl->parseCurrentBlock();
215 foreach($arr as $lib)
217 $buf .=
'<option value="' . $lib[
'value'] .
'"' . (($lib[
'value'] == $sel) ?
' selected' :
'') .
'>' . $prefix . $lib[
'text'] .
'</option>' .
"\n";