ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
imagemanager.php File Reference

Go to the source code of this file.

Functions

 outMobImages ()
 deleteImg ()
 outMobImageParams ()
 liboptions ($arr, $prefix= '', $sel= '')

Variables

global $ilIliasIniFile
 $htdocs = $ilIliasIniFile->readVariable('server', 'absolute_path') . '/'
 $weburl = $ilIliasIniFile->readVariable('server', 'http_path') . '/'
 $installpath = $htdocs
 $iliasMobPath = 'data/' . CLIENT_ID . '/mobs/'
 $iliasAbsolutePath = $htdocs
 $iliasHttpPath = $weburl
 $tinyMCE_base_url = $weburl
 $tinyMCE_DOC_url = $installpath
if($iliasHttpPath) $tinyMCE_valid_imgs = array('gif', 'jpg', 'jpeg', 'png')
 $tinyMCE_upload_allowed = true
 $mobs = ilSoapFunctions::getMobsOfObject(session_id() . '::' . CLIENT_ID, $_GET['obj_type'] . ':html', (int)$_GET['obj_id'])
 $preview = ''
 $img = isset($_POST['imglist']) ? $_POST['imglist'] : ''
 $_root = $installpath
 $errors = array()
if(isset($_FILES['img_file']['size'])&&$_FILES['img_file']['size'] > 0) $tpl = new ilTemplate(dirname(__FILE__).'/tpl.imagemanager.html', true, true)
 $error_messages = ''

Function Documentation

deleteImg ( )

Definition at line 190 of file imagemanager.php.

{
}
liboptions (   $arr,
  $prefix = '',
  $sel = '' 
)

Definition at line 212 of file imagemanager.php.

{
$buf = '';
foreach($arr as $lib)
{
$buf .= '<option value="' . $lib['value'] . '"' . (($lib['value'] == $sel) ? ' selected' : '') . '>' . $prefix . $lib['text'] . '</option>' . "\n";
}
return $buf;
}
outMobImageParams ( )

Definition at line 194 of file imagemanager.php.

References $size, $tpl, and ilFormat\formatSize().

{
global $arr_tinyMCE_image_files;
global $tpl;
for($k = 0; $k < count($arr_tinyMCE_image_files); $k++)
{
$tpl->setCurrentBlock('imageparams');
$entry = $arr_tinyMCE_image_files[$k]['file_name'];
$size = getimagesize($arr_tinyMCE_image_files[$k]['file_dir'] . $entry);
$fsize = filesize($arr_tinyMCE_image_files[$k]['file_dir'] . $entry);
$tpl->setVariable('IMG_WIDTH', $size[0]);
$tpl->setVariable('IMG_HEIGHT', $size[1]);
$tpl->setVariable('IMG_PATH', $arr_tinyMCE_image_files[$k]['http_dir']);
$tpl->setVariable('F_SIZE', ilFormat::formatSize($fsize));
$tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

outMobImages ( )

Definition at line 131 of file imagemanager.php.

References $d, $errors, $iliasAbsolutePath, $iliasHttpPath, $iliasMobPath, $img, $mobs, $size, $tinyMCE_valid_imgs, and $tpl.

{
global $mobs;
global $iliasMobPath;
global $tpl;
global $errors;
global $img;
global $arr_tinyMCE_image_files;
$arr_tinyMCE_image_files = array();
$i = 0;
// read image directory
foreach($mobs as $mob)
{
$mobdir = $iliasAbsolutePath . $iliasMobPath . 'mm_' . $mob . '/';
$d = @dir($mobdir);
if($d)
{
while(FALSE !== ($entry = $d->read()))
{
$ext = strtolower(substr(strrchr($entry, '.'), 1));
if(is_file($mobdir . $entry) && in_array($ext, $tinyMCE_valid_imgs))
{
$arr_tinyMCE_image_files[$i]['file_name'] = $entry;
$arr_tinyMCE_image_files[$i]['file_dir'] = $mobdir;
$arr_tinyMCE_image_files[$i]['http_dir'] = $iliasHttpPath . $iliasMobPath . 'mm_' . $mob . '/';
$i++;
}
}
$d->close();
}
else
{
$errors[] = '{#ibrowser.errornodir}';
}
}
// sort the list of image filenames alphabetically.
sort($arr_tinyMCE_image_files);
for($k = 0; $k < count($arr_tinyMCE_image_files); $k++)
{
$entry = $arr_tinyMCE_image_files[$k]['file_name'];
$size = getimagesize($arr_tinyMCE_image_files[$k]['file_dir'] . $entry);
$fsize = filesize($arr_tinyMCE_image_files[$k]['file_dir'] . $entry);
$tpl->setCurrentBlock('imagefile');
$tpl->setVariable('IMAGEFILE_VALUE', $arr_tinyMCE_image_files[$k]['http_dir']);
$tpl->setVariable('IMAGEFILE_TEXT', $entry);
if($entry == $img)
{
$tpl->setVariable('IMAGEFILE_SELECTED', ' selected=\'selected\'');
}
$tpl->parseCurrentBlock();
}
}

Variable Documentation

$_root = $installpath

Definition at line 72 of file imagemanager.php.

$error_messages = ''

Definition at line 118 of file imagemanager.php.

$errors = array()

Definition at line 73 of file imagemanager.php.

$htdocs = $ilIliasIniFile->readVariable('server', 'absolute_path') . '/'

Definition at line 34 of file imagemanager.php.

$iliasAbsolutePath = $htdocs

Definition at line 41 of file imagemanager.php.

$iliasHttpPath = $weburl

Definition at line 42 of file imagemanager.php.

$iliasMobPath = 'data/' . CLIENT_ID . '/mobs/'

Definition at line 40 of file imagemanager.php.

global $ilIliasIniFile

Definition at line 32 of file imagemanager.php.

$img = isset($_POST['imglist']) ? $_POST['imglist'] : ''

Definition at line 71 of file imagemanager.php.

$installpath = $htdocs

Definition at line 36 of file imagemanager.php.

$mobs = ilSoapFunctions::getMobsOfObject(session_id() . '::' . CLIENT_ID, $_GET['obj_type'] . ':html', (int)$_GET['obj_id'])

Definition at line 67 of file imagemanager.php.

$preview = ''

Definition at line 68 of file imagemanager.php.

$tinyMCE_base_url = $weburl

Definition at line 44 of file imagemanager.php.

$tinyMCE_DOC_url = $installpath

Definition at line 45 of file imagemanager.php.

$tinyMCE_upload_allowed = true

Definition at line 64 of file imagemanager.php.

if ($iliasHttpPath) $tinyMCE_valid_imgs = array('gif', 'jpg', 'jpeg', 'png')

Definition at line 61 of file imagemanager.php.

if (isset($_FILES['img_file']['size'])&&$_FILES['img_file']['size'] > 0) $tpl = new ilTemplate(dirname(__FILE__).'/tpl.imagemanager.html', true, true)

Definition at line 90 of file imagemanager.php.

$weburl = $ilIliasIniFile->readVariable('server', 'http_path') . '/'

Definition at line 35 of file imagemanager.php.