Public Member Functions | Data Fields

ilMediaItem Class Reference

Public Member Functions

 ilMediaItem ($a_id=0)
 setId ($a_id)
 set media item id
 getId ()
 get media item id
 setMobId ($a_mob_id)
 set id of parent media object
 getMobId ()
 get id of parent media object
 setNr ($a_nr)
 set number of media item within media object
 getNr ()
 create ()
 create persistent media item
 read ()
 read media item data (item id or (mob_id and nr) must be set)
 _getMediaItemsOfMOb (&$a_mob)
 read media items into media objects (static)
 deleteAllItemsOfMob ($a_mob_id)
 static
 setPurpose ($a_purpose)
 getPurpose ()
 setLocation ($a_location)
 getLocation ()
 setLocationType ($a_type)
 getLocationType ()
 setFormat ($a_format)
 getFormat ()
 addMapArea (&$a_map_area)
 deleteMapArea ($nr)
 delete map area
getMapArea ($nr)
 get map area
 getWidth ()
 get width
 setWidth ($a_width)
 set width
 getHeight ()
 get height
 setHeight ($a_height)
 set height
 setCaption ($a_caption)
 set caption
 getCaption ()
 get caption
 setHAlign ($a_halign)
 set horizontal align
 getHAlign ()
 get horizontal align
 setParameter ($a_name, $a_value)
 set parameter
 resetParameters ()
 reset parameters
 setParameters ($a_par)
 set alle parameters via parameter string (format: par1="value1", par2="value2", ...)
 getParameters ()
 get all parameters (in array)
 getParameterString ()
 get all parameters (as string)
 getParameter ($a_name)
 get a single parameter
 getWorkDirectory ()
 get work directory for image map editing
 createWorkDirectory ()
 create work directory for image map editing
 getSuffix ()
 get location suffix
 getMapWorkCopyType ()
 get image type of image map work copy
 getMapWorkCopyName ()
 getDirectory ()
 get media file directory
 makeMapWorkCopy ($a_area_nr=0, $a_exclude=false)
 make map work copy of image
 addAreaToMapWorkCopy ($a_shape, $a_coords)
 draw a new area in work image
 outputMapWorkCopy ()
 output raw map work copy file
 buildMapWorkImage ()
 build image map work image
 saveMapWorkImage ()
 save image map work image
getMapWorkImage ()
 get image map work image
 getMapAreasXML ($a_insert_inst=false, $a_inst=0)
 get xml code of media items' areas
 _resolveMapAreaLinks ($a_mob_id)
 resolve internal links of all media items of a media object
 _getMapAreasIntLinks ($a_mob_id)
 get all internal links of map areas of a mob

Data Fields

 $ilias
 $id
 $purpose
 $location
 $location_type
 $format
 $width
 $height
 $caption
 $halign
 $parameters
 $mob_id
 $nr
 $mapareas
 $map_cnt
 $map_image
 $color1
 $color2

Detailed Description

Definition at line 36 of file class.ilMediaItem.php.


Member Function Documentation

ilMediaItem::_getMapAreasIntLinks ( a_mob_id  ) 

get all internal links of map areas of a mob

Parameters:
int $a_mob_id media object id

Definition at line 766 of file class.ilMediaItem.php.

References $query, and ilMapArea::_getIntLinks().

Referenced by ilPageObject::getInternalLinks(), ilLMPresentationGUI::ilMedia(), and ilObjMediaPoolGUI::showMedia().

        {
                // read media_items records
                $query = "SELECT * FROM media_item WHERE mob_id = '".$a_mob_id."' ".
                        "ORDER BY nr";
                $item_set = $this->ilias->db->query($query);
                $links = array();
                while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        $map_links = ilMapArea::_getIntLinks($item_rec["id"]);
                        foreach($map_links as $key => $map_link)
                        {
                                $links[$key] = $map_link;
                        }
                }
                return $links;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::_getMediaItemsOfMOb ( &$  a_mob  ) 

read media items into media objects (static)

Parameters:
object $a_mob media object

Definition at line 231 of file class.ilMediaItem.php.

References $query, ilMapArea::_getMaxNr(), and ilMediaItem().

Referenced by ilObjMediaObject::read().

        {
                // read media_object record
                $query = "SELECT * FROM media_item WHERE mob_id = '".$a_mob->getId()."' ".
                        "ORDER BY nr";
                $item_set = $this->ilias->db->query($query);
                while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        $media_item =& new ilMediaItem();
                        $media_item->setNr($item_rec["nr"]);
                        $media_item->setId($item_rec["id"]);
                        $media_item->setLocation($item_rec["location"]);
                        $media_item->setLocationType($item_rec["location_type"]);
                        $media_item->setFormat($item_rec["format"]);
                        $media_item->setWidth($item_rec["width"]);
                        $media_item->setHeight($item_rec["height"]);
                        $media_item->setHAlign($item_rec["halign"]);
                        $media_item->setCaption($item_rec["caption"]);
                        $media_item->setPurpose($item_rec["purpose"]);
                        $media_item->setMobId($item_rec["mob_id"]);

                        // get item parameter
                        $query = "SELECT * FROM mob_parameter WHERE med_item_id = '".
                                $item_rec["id"]."'";
                        $par_set = $this->ilias->db->query($query);
                        while ($par_rec = $par_set->fetchRow(DB_FETCHMODE_ASSOC))
                        {
                                $media_item->setParameter($par_rec["name"], $par_rec["value"]);
                        }

                        // get item map areas
                        $max = ilMapArea::_getMaxNr($media_item->getId());
                        for ($i = 1; $i <= $max; $i++)
                        {
                                $area =& new ilMapArea($media_item->getId(), $i);
                                $media_item->addMapArea($area);
                        }

                        // add media item to media object
                        $a_mob->addMediaItem($media_item);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::_resolveMapAreaLinks ( a_mob_id  ) 

resolve internal links of all media items of a media object

Parameters:
int $a_mob_id media object id

Definition at line 748 of file class.ilMediaItem.php.

References $query, and ilMapArea::_resolveIntLinks().

Referenced by ilContObjParser::processPagesToParse(), and ilPageObject::resolveIntLinks().

        {
//echo "mediaItems::resolve<br>";
                // read media_object record
                $query = "SELECT * FROM media_item WHERE mob_id = '".$a_mob_id."' ".
                        "ORDER BY nr";
                $item_set = $this->ilias->db->query($query);
                while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        ilMapArea::_resolveIntLinks($item_rec["id"]);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::addAreaToMapWorkCopy ( a_shape,
a_coords 
)

draw a new area in work image

Parameters:
string $a_shape shape
string $a_coords coordinates string

Definition at line 604 of file class.ilMediaItem.php.

References buildMapWorkImage(), getMapWorkImage(), and saveMapWorkImage().

        {
                $this->buildMapWorkImage();

                // add new area to work image
                $area = new ilMapArea();
                $area->setShape($a_shape);
//echo "addAreaToMap:".$a_shape.":<br>";
                $area->setCoords($a_coords);
                $area->draw($this->getMapWorkImage(), $this->color1, $this->color2, false);

                $this->saveMapWorkImage();
        }

Here is the call graph for this function:

ilMediaItem::addMapArea ( &$  a_map_area  ) 

Definition at line 338 of file class.ilMediaItem.php.

Referenced by read().

        {
                $this->mapareas[$this->map_cnt] =& $a_map_area;
                $this->map_cnt++;
        }

Here is the caller graph for this function:

ilMediaItem::buildMapWorkImage (  ) 

build image map work image

Definition at line 636 of file class.ilMediaItem.php.

References getMapWorkCopyName(), and getMapWorkCopyType().

Referenced by addAreaToMapWorkCopy(), and makeMapWorkCopy().

        {
                $im_type = strtolower($this->getMapWorkCopyType());

                switch ($im_type)
                {
                        case "gif":
                                $this->map_image = ImageCreateFromGIF($this->getMapWorkCopyName());
                                break;

                        case "jpg":
                                $this->map_image = ImageCreateFromJPEG($this->getMapWorkCopyName());
                                break;

                        case "png":
                                $this->map_image = ImageCreateFromPNG($this->getMapWorkCopyName());
                                break;
                }

                // try to allocate black and white as color. if this is not possible, get the closest colors
                if (imagecolorstotal($this->map_image) > 250)
                {
                        $this->color1 = imagecolorclosest($this->map_image, 0, 0, 0);
                        $this->color2 = imagecolorclosest($this->map_image, 255, 255, 255);
                }
                else
                {
                        $this->color1 = imagecolorallocate($this->map_image, 0, 0, 0);
                        $this->color2 = imagecolorallocate($this->map_image, 255, 255, 255);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::create (  ) 

create persistent media item

Definition at line 129 of file class.ilMediaItem.php.

References $ilDB, $params, $query, getCaption(), getFormat(), getHAlign(), getHeight(), getId(), getLocation(), getLocationType(), getMobId(), getNr(), getParameters(), getPurpose(), getWidth(), and setId().

        {
                global $ilDB;

                $query = "INSERT INTO media_item (mob_id, purpose, location, ".
                        "location_type, format, width, ".
                        "height, halign, caption, nr) VALUES ".
                        "(".$ilDB->quote($this->getMobId()).",".
                        $ilDB->quote($this->getPurpose()).",".
                        $ilDB->quote($this->getLocation()).",".
                        $ilDB->quote($this->getLocationType()).",".
                        $ilDB->quote($this->getFormat()).",".
                        $ilDB->quote($this->getWidth()).",".
                        $ilDB->quote($this->getHeight()).",".
                        $ilDB->quote($this->getHAlign()).",".
                        $ilDB->quote($this->getCaption()).",".
                        $ilDB->quote($this->getNr()).")";
                $this->ilias->db->query($query);
//echo "create_mob:$query:<br>";
                $item_id = $this->ilias->db->getLastInsertId();
                $this->setId($item_id);

                // create mob parameters
                $params = $this->getParameters();
                foreach($params as $name => $value)
                {
                        $query = "INSERT INTO mob_parameter (med_item_id, name, value) VALUES ".
                                "(".$ilDB->quote($item_id).",".
                                $ilDB->quote($name).",".
                                $ilDB->quote($value).")";
                        $this->ilias->db->query($query);
                }

                // create map areas
                for ($i=0; $i < count($this->mapareas); $i++)
                {
                        $this->mapareas[$i]->setItemId($this->getId());
                        $this->mapareas[$i]->setNr($i + 1);
                        $this->mapareas[$i]->create();
                }
        }

Here is the call graph for this function:

ilMediaItem::createWorkDirectory (  ) 

create work directory for image map editing

Definition at line 512 of file class.ilMediaItem.php.

References ilUtil::createDirectory(), ilUtil::getDataDir(), and getWorkDirectory().

Referenced by makeMapWorkCopy().

        {
                if(!@is_dir(ilUtil::getDataDir()."/map_workfiles"))
                {
                        ilUtil::createDirectory(ilUtil::getDataDir()."/map_workfiles");
                }
                $work_dir = $this->getWorkDirectory();
                if(!@is_dir($work_dir))
                {
                        ilUtil::createDirectory($work_dir);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::deleteAllItemsOfMob ( a_mob_id  ) 

static

Definition at line 277 of file class.ilMediaItem.php.

References $query.

Referenced by ilObjMediaObject::delete(), and ilObjMediaObject::update().

        {
                // iterate all media items ob mob
                $query = "SELECT * FROM media_item WHERE mob_id = '".$a_mob_id."'";
                $item_set = $this->ilias->db->query($query);
                while ($item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        // delete all parameters of media item
                        $query = "DELETE FROM mob_parameter WHERE med_item_id = '".$item_rec["id"]."'";
                        $this->ilias->db->query($query);

                        // delete all map areas of media item
                        $query = "DELETE FROM map_area WHERE item_id = '".$item_rec["id"]."'";
                        $this->ilias->db->query($query);
                }

                // delete media items
                $query = "DELETE FROM media_item WHERE mob_id = '".$a_mob_id."'";
                $this->ilias->db->query($query);
        }

Here is the caller graph for this function:

ilMediaItem::deleteMapArea ( nr  ) 

delete map area

Definition at line 347 of file class.ilMediaItem.php.

References $nr.

        {
                for ($i=1; $i<=$this->map_cnt; $i++)
                {
                        if($i > $nr)
                        {
                                $this->mapareas[$i-2] =& $this->mapareas[$i-1];
                                $this->mapareas[$i-2]->setNr($i-1);
                        }
                }
                if($nr <= $this->map_cnt)
                {
                        unset($this->mapareas[$this->map_cnt - 1]);
                        $this->map_cnt--;
                }
        }

ilMediaItem::getCaption (  ) 

get caption

Definition at line 415 of file class.ilMediaItem.php.

Referenced by create().

        {
                return $this->caption;
        }

Here is the caller graph for this function:

ilMediaItem::getDirectory (  ) 

get media file directory

Definition at line 560 of file class.ilMediaItem.php.

References ilObjMediaObject::_getDirectory(), and getMobId().

Referenced by makeMapWorkCopy().

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::getFormat (  ) 

Definition at line 333 of file class.ilMediaItem.php.

Referenced by create().

        {
                return $this->format;
        }

Here is the caller graph for this function:

ilMediaItem::getHAlign (  ) 

get horizontal align

Definition at line 431 of file class.ilMediaItem.php.

Referenced by create().

        {
                return $this->halign;
        }

Here is the caller graph for this function:

ilMediaItem::getHeight (  ) 

get height

Definition at line 391 of file class.ilMediaItem.php.

Referenced by create().

        {
                return $this->height;
        }

Here is the caller graph for this function:

ilMediaItem::getId (  ) 

get media item id

Returns:
int media item id

Definition at line 88 of file class.ilMediaItem.php.

Referenced by create(), getWorkDirectory(), and read().

        {
                return $this->id;
        }

Here is the caller graph for this function:

ilMediaItem::getLocation (  ) 

Definition at line 313 of file class.ilMediaItem.php.

Referenced by create(), getMapWorkCopyName(), getSuffix(), and makeMapWorkCopy().

        {
                return $this->location;
        }

Here is the caller graph for this function:

ilMediaItem::getLocationType (  ) 

Definition at line 323 of file class.ilMediaItem.php.

Referenced by create().

        {
                return $this->location_type;
        }

Here is the caller graph for this function:

& ilMediaItem::getMapArea ( nr  ) 

get map area

Definition at line 367 of file class.ilMediaItem.php.

References $nr.

        {
                return $this->mapareas[$nr-1];
        }

ilMediaItem::getMapAreasXML ( a_insert_inst = false,
a_inst = 0 
)

get xml code of media items' areas

Definition at line 706 of file class.ilMediaItem.php.

References $xml.

        {
                $xml = "";

                // build xml of map areas
                for ($i=0; $i < count($this->mapareas); $i++)
                {
                        $area =& $this->mapareas[$i];
                        $xml .= "<MapArea Shape=\"".$area->getShape()."\" Coords=\"".$area->getCoords()."\">";
                        if ($area->getLinkType() == IL_INT_LINK)
                        {
                                $target_frame = $area->getTargetFrame();

                                if ($area->getType() == "GlossaryItem" && $target_frame == "")
                                {
                                        $target_frame = "Glossary";
                                }

                                $xml .= "<IntLink Target=\"".$area->getTarget($a_insert_inst, $a_inst)."\" Type=\"".
                                        $area->getType()."\" TargetFrame=\"".$target_frame."\">";
                                $xml .= $area->getTitle();
                                $xml .="</IntLink>";
                        }
                        else
                        {
                                $xml .= "<ExtLink Href=\"".str_replace("&", "&amp;",$area->getHref())."\" Title=\"".
                                        $area->getExtTitle()."\">";
                                $xml .= $area->getTitle();
                                $xml .="</ExtLink>";
                        }
                        $xml .= "</MapArea>";
                }

                return $xml;
        }

ilMediaItem::getMapWorkCopyName (  ) 

Definition at line 546 of file class.ilMediaItem.php.

References $file, getLocation(), getMapWorkCopyType(), and getWorkDirectory().

Referenced by buildMapWorkImage(), makeMapWorkCopy(), outputMapWorkCopy(), and saveMapWorkImage().

        {
                $file_arr = explode("/", $this->getLocation());
                $file = $file_arr[count($file_arr) - 1];
                $file_arr = explode(".", $file);
                unset($file_arr[count($file_arr) - 1]);
                $file = implode($file_arr, ".");

                return $this->getWorkDirectory()."/".$file.".".$this->getMapWorkCopyType();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::getMapWorkCopyType (  ) 

get image type of image map work copy

Definition at line 538 of file class.ilMediaItem.php.

References ilUtil::getGDSupportedImageType(), and getSuffix().

Referenced by buildMapWorkImage(), getMapWorkCopyName(), makeMapWorkCopy(), outputMapWorkCopy(), and saveMapWorkImage().

Here is the call graph for this function:

Here is the caller graph for this function:

& ilMediaItem::getMapWorkImage (  ) 

get image map work image

Definition at line 697 of file class.ilMediaItem.php.

Referenced by addAreaToMapWorkCopy(), and makeMapWorkCopy().

        {
                return $this->map_image;
        }

Here is the caller graph for this function:

ilMediaItem::getMobId (  ) 

get id of parent media object

Returns:
int media object id

Definition at line 108 of file class.ilMediaItem.php.

Referenced by create(), getDirectory(), and read().

        {
                return $this->mob_id;
        }

Here is the caller graph for this function:

ilMediaItem::getNr (  ) 

Definition at line 121 of file class.ilMediaItem.php.

Referenced by create(), and read().

        {
                return $this->nr;
        }

Here is the caller graph for this function:

ilMediaItem::getParameter ( a_name  ) 

get a single parameter

Definition at line 496 of file class.ilMediaItem.php.

        {
                return $this->parameters[$a_name];
        }

ilMediaItem::getParameters (  ) 

get all parameters (in array)

Definition at line 478 of file class.ilMediaItem.php.

Referenced by create().

        {
                return $this->parameters;
        }

Here is the caller graph for this function:

ilMediaItem::getParameterString (  ) 

get all parameters (as string)

Definition at line 487 of file class.ilMediaItem.php.

References ilUtil::assembleParameterString().

        {
                return ilUtil::assembleParameterString($this->parameters);
        }

Here is the call graph for this function:

ilMediaItem::getPurpose (  ) 

Definition at line 303 of file class.ilMediaItem.php.

Referenced by create().

        {
                return $this->purpose;
        }

Here is the caller graph for this function:

ilMediaItem::getSuffix (  ) 

get location suffix

Definition at line 528 of file class.ilMediaItem.php.

References getLocation().

Referenced by getMapWorkCopyType().

        {
                $loc_arr = explode(".", $this->getLocation());

                return $loc_arr[count($loc_arr) - 1];
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::getWidth (  ) 

get width

Definition at line 375 of file class.ilMediaItem.php.

Referenced by create().

        {
                return $this->width;
        }

Here is the caller graph for this function:

ilMediaItem::getWorkDirectory (  ) 

get work directory for image map editing

Definition at line 504 of file class.ilMediaItem.php.

References ilUtil::getDataDir(), and getId().

Referenced by createWorkDirectory(), and getMapWorkCopyName().

        {
                return ilUtil::getDataDir()."/map_workfiles/item_".$this->getId();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::ilMediaItem ( a_id = 0  ) 

Definition at line 57 of file class.ilMediaItem.php.

References $ilias, read(), and setId().

Referenced by _getMediaItemsOfMOb().

        {
                global $ilias;

                $this->ilias =& $ilias;
                $this->parameters = array();
                $this->mapareas = array();
                $this->map_cnt = 0;

                if ($a_id != 0)
                {
                        $this->setId($a_id);
                        $this->read();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::makeMapWorkCopy ( a_area_nr = 0,
a_exclude = false 
)

make map work copy of image

Parameters:
int $a_area_nr draw area $a_area_nr only
boolean $a_exclude true: draw all areas but area $a_area_nr

Definition at line 572 of file class.ilMediaItem.php.

References buildMapWorkImage(), ilUtil::convertImage(), createWorkDirectory(), getDirectory(), getLocation(), getMapWorkCopyName(), getMapWorkCopyType(), getMapWorkImage(), and saveMapWorkImage().

        {
                $this->createWorkDirectory();
                ilUtil::convertImage($this->getDirectory()."/".$this->getLocation(),
                        $this->getMapWorkCopyName(),
                        $this->getMapWorkCopyType());

                $this->buildMapWorkImage();

                // draw map areas
                for ($i=0; $i < count($this->mapareas); $i++)
                {
                        if (    ((($i+1) == $a_area_nr) && !$a_exclude) ||
                                        ((($i+1) != $a_area_nr) && $a_exclude) ||
                                        ($a_area_nr == 0)
                                )
                        {
                                $area =& $this->mapareas[$i];
                                $area->draw($this->getMapWorkImage(), $this->color1, $this->color2);
                        }
                }

                $this->saveMapWorkImage();
        }

Here is the call graph for this function:

ilMediaItem::outputMapWorkCopy (  ) 

output raw map work copy file

Definition at line 621 of file class.ilMediaItem.php.

References exit, getMapWorkCopyName(), and getMapWorkCopyType().

        {
                if ($this->getMapWorkCopyType() != "")
                {
                        header("Pragma: no-cache");
                        header("Expires: 0");
                        header("Content-type: image/".strtolower($this->getMapWorkCopyType()));
                        readfile($this->getMapWorkCopyName());
                }
                exit;
        }

Here is the call graph for this function:

ilMediaItem::read (  ) 

read media item data (item id or (mob_id and nr) must be set)

Definition at line 174 of file class.ilMediaItem.php.

References $mob_id, $nr, $query, ilMapArea::_getMaxNr(), addMapArea(), getId(), getMobId(), getNr(), setCaption(), setFormat(), setHAlign(), setHeight(), setId(), setLocation(), setLocationType(), setMobId(), setNr(), setParameter(), setPurpose(), and setWidth().

Referenced by ilMediaItem().

        {
                $item_id = $this->getId();
                $mob_id = $this->getMobId();
                $nr = $this->getNr();
                $query = "";
                if($item_id > 0)
                {
                        $query = "SELECT * FROM media_item WHERE id = '".$this->getId()."'";
                }
                else if ($mob_id > 0 && $nr > 0)
                {
                        $query = "SELECT * FROM media_item WHERE mob_id = '".$this->getMobId()."' ".
                                "AND nr='".$this->getNr()."'";
                }
                if ($query != "")
                {
                        $item_set = $this->ilias->db->query($query);
                        $item_rec = $item_set->fetchRow(DB_FETCHMODE_ASSOC);

                        $this->setLocation($item_rec["location"]);
                        $this->setLocationType($item_rec["location_type"]);
                        $this->setFormat($item_rec["format"]);
                        $this->setWidth($item_rec["width"]);
                        $this->setHeight($item_rec["height"]);
                        $this->setHAlign($item_rec["halign"]);
                        $this->setCaption($item_rec["caption"]);
                        $this->setPurpose($item_rec["purpose"]);
                        $this->setNr($item_rec["nr"]);
                        $this->setMobId($item_rec["mob_id"]);
                        $this->setId($item_rec["id"]);

                        // get item parameter
                        $query = "SELECT * FROM mob_parameter WHERE med_item_id = '".
                                $this->getId()."'";
                        $par_set = $this->ilias->db->query($query);
                        while ($par_rec = $par_set->fetchRow(DB_FETCHMODE_ASSOC))
                        {
                                $this->setParameter($par_rec["name"], $par_rec["value"]);
                        }

                        // get item map areas
                        $max = ilMapArea::_getMaxNr($this->getId());
                        for ($i = 1; $i <= $max; $i++)
                        {
                                $area =& new ilMapArea($this->getId(), $i);
                                $this->addMapArea($area);
                        }
                }

        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::resetParameters (  ) 

reset parameters

Definition at line 451 of file class.ilMediaItem.php.

Referenced by setParameters().

        {
                $this->parameters = array();
        }

Here is the caller graph for this function:

ilMediaItem::saveMapWorkImage (  ) 

save image map work image

Definition at line 671 of file class.ilMediaItem.php.

References getMapWorkCopyName(), and getMapWorkCopyType().

Referenced by addAreaToMapWorkCopy(), and makeMapWorkCopy().

        {
                $im_type = strtolower($this->getMapWorkCopyType());

                // save image work-copy and free memory
                switch ($im_type)
                {
                        case "gif":
                                ImageGIF($this->map_image, $this->getMapWorkCopyName());
                                break;

                        case "jpg":
                                ImageJPEG($this->map_image, $this->getMapWorkCopyName());
                                break;

                        case "png":
                                ImagePNG($this->map_image, $this->getMapWorkCopyName());
                                break;
                }

                ImageDestroy($this->map_image);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMediaItem::setCaption ( a_caption  ) 

set caption

Definition at line 407 of file class.ilMediaItem.php.

Referenced by read().

        {
                $this->caption = $a_caption;
        }

Here is the caller graph for this function:

ilMediaItem::setFormat ( a_format  ) 

Definition at line 328 of file class.ilMediaItem.php.

Referenced by read().

        {
                $this->format = $a_format;
        }

Here is the caller graph for this function:

ilMediaItem::setHAlign ( a_halign  ) 

set horizontal align

Definition at line 423 of file class.ilMediaItem.php.

Referenced by read().

        {
                $this->halign = $a_halign;
        }

Here is the caller graph for this function:

ilMediaItem::setHeight ( a_height  ) 

set height

Definition at line 399 of file class.ilMediaItem.php.

Referenced by read().

        {
                $this->height = $a_height;
        }

Here is the caller graph for this function:

ilMediaItem::setId ( a_id  ) 

set media item id

Parameters:
int $a_id media item id

Definition at line 78 of file class.ilMediaItem.php.

Referenced by create(), ilMediaItem(), and read().

        {
                $this->id = $a_id;
        }

Here is the caller graph for this function:

ilMediaItem::setLocation ( a_location  ) 

Definition at line 308 of file class.ilMediaItem.php.

Referenced by read().

        {
                $this->location = $a_location;
        }

Here is the caller graph for this function:

ilMediaItem::setLocationType ( a_type  ) 

Definition at line 318 of file class.ilMediaItem.php.

Referenced by read().

        {
                $this->location_type = $a_type;
        }

Here is the caller graph for this function:

ilMediaItem::setMobId ( a_mob_id  ) 

set id of parent media object

Parameters:
int $a_mob_id media object id

Definition at line 98 of file class.ilMediaItem.php.

Referenced by read().

        {
                $this->mob_id = $a_mob_id;
        }

Here is the caller graph for this function:

ilMediaItem::setNr ( a_nr  ) 

set number of media item within media object

Definition at line 116 of file class.ilMediaItem.php.

Referenced by read().

        {
                $this->nr = $a_nr;
        }

Here is the caller graph for this function:

ilMediaItem::setParameter ( a_name,
a_value 
)

set parameter

Parameters:
string $a_name parameter name
string $a_value parameter value

Definition at line 443 of file class.ilMediaItem.php.

Referenced by read(), and setParameters().

        {
                $this->parameters[$a_name] = $a_value;
        }

Here is the caller graph for this function:

ilMediaItem::setParameters ( a_par  ) 

set alle parameters via parameter string (format: par1="value1", par2="value2", ...)

Parameters:
string $a_par parameter string

Definition at line 461 of file class.ilMediaItem.php.

References ilUtil::extractParameterString(), resetParameters(), and setParameter().

        {
                $this->resetParameters();
                $par_arr = ilUtil::extractParameterString($a_par);
                if(is_array($par_arr))
                {
                        foreach($par_arr as $par => $val)
                        {
                                $this->setParameter($par, $val);
                        }
                }
        }

Here is the call graph for this function:

ilMediaItem::setPurpose ( a_purpose  ) 

Definition at line 298 of file class.ilMediaItem.php.

Referenced by read().

        {
                $this->purpose = $a_purpose;
        }

Here is the caller graph for this function:

ilMediaItem::setWidth ( a_width  ) 

set width

Definition at line 383 of file class.ilMediaItem.php.

Referenced by read().

        {
                $this->width = $a_width;
        }

Here is the caller graph for this function:


Field Documentation

ilMediaItem::$caption

Definition at line 46 of file class.ilMediaItem.php.

ilMediaItem::$color1

Definition at line 54 of file class.ilMediaItem.php.

ilMediaItem::$color2

Definition at line 55 of file class.ilMediaItem.php.

ilMediaItem::$format

Definition at line 43 of file class.ilMediaItem.php.

ilMediaItem::$halign

Definition at line 47 of file class.ilMediaItem.php.

ilMediaItem::$height

Definition at line 45 of file class.ilMediaItem.php.

ilMediaItem::$id

Definition at line 39 of file class.ilMediaItem.php.

ilMediaItem::$ilias

Definition at line 38 of file class.ilMediaItem.php.

Referenced by ilMediaItem().

ilMediaItem::$location

Definition at line 41 of file class.ilMediaItem.php.

ilMediaItem::$location_type

Definition at line 42 of file class.ilMediaItem.php.

ilMediaItem::$map_cnt

Definition at line 52 of file class.ilMediaItem.php.

ilMediaItem::$map_image

Definition at line 53 of file class.ilMediaItem.php.

ilMediaItem::$mapareas

Definition at line 51 of file class.ilMediaItem.php.

ilMediaItem::$mob_id

Definition at line 49 of file class.ilMediaItem.php.

Referenced by read().

ilMediaItem::$nr

Definition at line 50 of file class.ilMediaItem.php.

Referenced by deleteMapArea(), getMapArea(), and read().

ilMediaItem::$parameters

Definition at line 48 of file class.ilMediaItem.php.

ilMediaItem::$purpose

Definition at line 40 of file class.ilMediaItem.php.

ilMediaItem::$width

Definition at line 44 of file class.ilMediaItem.php.


The documentation for this class was generated from the following file: