ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjMediaPoolSubItemListGUI Class Reference

Show media pool items. More...

+ Inheritance diagram for ilObjMediaPoolSubItemListGUI:
+ Collaboration diagram for ilObjMediaPoolSubItemListGUI:

Public Member Functions

 getHTML ()
 get html
- Public Member Functions inherited from ilSubItemListGUI
 __construct ($a_cmd_class)
 Constructor.
 getCmdClass ()
 get cmd class
 setHighlighter ($a_highlighter)
 set highlighter
 getHighlighter ()
 get highlighter
 getRefId ()
 get ref id
 getObjId ()
 get obj id
 getType ()
 get type
 getSubItemIds ($a_limited=false)
 get sub item ids
 getItemListGUI ()
 get item list gui
 init ($item_list_gui, $a_ref_id, $a_subitem_ids)
 init

Protected Member Functions

 parseImage ($a_sub_id)
- Protected Member Functions inherited from ilSubItemListGUI
 showDetailsLink ()
 show details link
 parseRelevance ($sub_item)

Additional Inherited Members

- Static Public Member Functions inherited from ilSubItemListGUI
static setShowDetails ($a_obj_id)
 set show details.
static resetDetails ()
 reset details As long as static::resetDetails is not possible this method is final
static enabledDetails ($a_obj_id)
 enabled show details As long as static::enableDetails is not possible this method is final
- Protected Attributes inherited from ilSubItemListGUI
 $cmdClass = null
 $tpl
- Static Protected Attributes inherited from ilSubItemListGUI
static $MAX_SUBITEMS = 5

Detailed Description

Show media pool items.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Member Function Documentation

ilObjMediaPoolSubItemListGUI::getHTML ( )

get html

Returns

Reimplemented from ilSubItemListGUI.

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

References $lng, ilLink\_getLink(), ilSubItemListGUI\getHighlighter(), ilSubItemListGUI\getItemListGUI(), ilSubItemListGUI\getObjId(), ilSubItemListGUI\getRefId(), ilSubItemListGUI\getSubItemIds(), ilMediaPoolItem\lookupTitle(), ilMediaPoolItem\lookupType(), parseImage(), ilSubItemListGUI\parseRelevance(), and ilSubItemListGUI\showDetailsLink().

{
global $lng;
$lng->loadLanguageModule('content');
foreach($this->getSubItemIds(true) as $sub_item)
{
if(is_object($this->getHighlighter()) and strlen($this->getHighlighter()->getContent($this->getObjId(),$sub_item)))
{
$this->tpl->setCurrentBlock('sea_fragment');
$this->tpl->setVariable('TXT_FRAGMENT',$this->getHighlighter()->getContent($this->getObjId(),$sub_item));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('subitem');
$this->tpl->setVariable('SEPERATOR',':');
include_once './Modules/MediaPool/classes/class.ilMediaPoolItem.php';
switch(ilMediaPoolItem::lookupType($sub_item))
{
case 'fold':
$this->tpl->setVariable('LINK',ilLink::_getLink($this->getRefId(),'mep',array(),'_'.$sub_item));
$this->tpl->setVariable('TARGET',$this->getItemListGUI()->getCommandFrame(''));
break;
case 'mob':
$this->tpl->setVariable('LINK',
$this->getItemListGUI()->getCommandLink('allMedia').
'&force_filter='.$sub_item
);
$this->tpl->setVariable('TARGET',$this->getItemListGUI()->getCommandFrame(''));
break;
default:
}
$this->tpl->setVariable('SUBITEM_TYPE',$lng->txt('obj_'.ilMediaPoolItem::lookupType($sub_item)));
$this->tpl->setVariable('TITLE',ilMediaPoolItem::lookupTitle($sub_item));
#$this->getItemListGUI()->setChildId($sub_item);
// begin-patch mime_filter
if(!$this->parseImage($sub_item))
{
include_once './Modules/MediaPool/classes/class.ilMediaPoolItem.php';
$this->tpl->setVariable('SUBITEM_TYPE',$lng->txt('obj_'.ilMediaPoolItem::lookupType($sub_item)));
$this->tpl->setVariable('SEPERATOR',':');
}
if(count($this->getSubItemIds(true)) > 1)
{
$this->parseRelevance($sub_item);
}
$this->tpl->parseCurrentBlock();
}
$this->showDetailsLink();
return $this->tpl->get();
}

+ Here is the call graph for this function:

ilObjMediaPoolSubItemListGUI::parseImage (   $a_sub_id)
protected

Definition at line 106 of file class.ilObjMediaPoolSubItemListGUI.php.

References $size, ilLink\_getLink(), ilObject\_lookupType(), ilUtil\deducibleSize(), ilUtil\getImagePath(), ilSubItemListGUI\getRefId(), ilUtil\img(), and ilMediaPoolItem\lookupForeignId().

Referenced by getHTML().

{
include_once './Modules/MediaPool/classes/class.ilMediaPoolItem.php';
$sub_id = ilMediaPoolItem::lookupForeignId($a_sub_id);
// output thumbnail (or mob icon)
if (ilObject::_lookupType($sub_id) == "mob")
{
include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$mob = new ilObjMediaObject($sub_id);
$med = $mob->getMediaItem("Standard");
$target = $med->getThumbnailTarget();
if ($target != "")
{
// begin-patch mime_filter
$this->tpl->setVariable('LINKED_LINK',
$this->getRefId(),
'mep',
array('action' => 'showMedia', 'mob_id' => $sub_id,'mepitem_id' => $a_sub_id)));
$this->tpl->setVariable('LINKED_TARGET','_blank');
$this->tpl->setVariable("LINKED_IMAGE", ilUtil::img($target));
// end-patch mime_filter
}
else
{
$this->tpl->setVariable("SUB_ITEM_IMAGE",ilUtil::img(ilUtil::getImagePath("icon_".$a_set["type"].".gif")));
}
if (ilUtil::deducibleSize($med->getFormat()) && $med->getLocationType() == "Reference")
{
$size = @getimagesize($med->getLocation());
if ($size[0] > 0 && $size[1] > 0)
{
$wr = $size[0] / 80;
$hr = $size[1] / 80;
$r = max($wr, hr);
$w = (int) ($size[0]/$r);
$h = (int) ($size[1]/$r);
$this->tpl->setVariable("SUB_ITEM_IMAGE",ilUtil::img($med->getLocation(), "", $w, $h));
return true;
}
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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