ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjMediaCastGUI Class Reference

Class ilObjMediaCastGUI. More...

+ Inheritance diagram for ilObjMediaCastGUI:
+ Collaboration diagram for ilObjMediaCastGUI:

Public Member Functions

 ilObjMediaCastGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor public.
 executeCommand ()
 execute command
 afterSave ($newObj)
 save object public
 listItemsObject ($a_presentation_mode=false)
 List items of media cast.
 getFeedIconsHTML ()
 Get feed icons HTML.
 addCastItemObject ()
 Add media cast item.
 editCastItemObject ()
 Edit media cast item.
 initAddCastItemForm ($a_mode="create")
 Init add cast item form.
 getCastItemValues ()
 Get cast item values into form.
 saveCastItemObject ()
 Save new cast item.
 updateCastItemObject ()
 Update cast item.
 confirmDeletionItemsObject ()
 Confirmation Screen.
 deleteItemsObject ()
 Delete news items.
 downloadItemObject ()
 Delete news items.
 determinePlaytimeObject ()
 Delete news items.
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed
 infoScreen ()
 show information screen
 setTabs ()
 get tabs public
 addContentSubTabs ($a_active="content")
 Add content subtabs.
 editSettingsObject ()
 Edit settings.
 initSettingsForm ()
 Init Settings Form.
 saveSettingsObject ()
 Save Settings.
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 _goto ($a_target)
 saveOrderObject ()
 showContentObject ()
 Show content.
 showGallery ()
 convertFileObject ()
 Convert file object.
 extractPreviewImageObject ()
 Extract preview image.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

Protected Member Functions

 initCreationForms ($a_new_type)
 Init creation froms.
 getMediaItem ($id)
 get MediaItem for id and updates local variable mcst_item
 getMediaItems ($id)
 get MediaItems for id and updates local variable mcst_item
 editOrderObject ()
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission.

Static Protected Member Functions

static isAudio ($extension)
 detect audio mimetype

Private Member Functions

 getDuration ($file)
 get duration from form or from file analyzer
 createMediaItemForPurpose ($mob, $purpose)
 handle media item for given purpose
 updateMediaItem ($mob, &$mediaItem)
 update media item from form
 populateFormFromPost ()

Private Attributes

 $additionalPurposes = array ("VideoPortable", "AudioPortable")
 $purposeSuffixes = array ()
 $mimeTypes = array()

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false
const CFORM_NEW = 1
const CFORM_IMPORT = 2
const CFORM_CLONE = 3

Detailed Description

Member Function Documentation

ilObjMediaCastGUI::_goto (   $a_target)

Definition at line 1310 of file class.ilObjMediaCastGUI.php.

References $_GET, $ilErr, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

{
global $ilAccess, $ilErr, $lng;
if ($ilAccess->checkAccess("read", "", $a_target))
{
$_GET["cmd"] = "listItems";
$_GET["ref_id"] = $a_target;
$_GET["baseClass"] = "ilmediacasthandlergui";
$_GET["cmdClass"] = "ilobjmediacastgui";
include("ilias.php");
}
else if ($ilAccess->checkAccess("visible", "", $a_target))
{
ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
}
else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
}
$ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::addCastItemObject ( )

Add media cast item.

Definition at line 264 of file class.ilObjMediaCastGUI.php.

References ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), and initAddCastItemForm().

{
global $tpl;
$this->checkPermission("write");
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::addContentSubTabs (   $a_active = "content")

Add content subtabs.

Parameters
@return

Definition at line 1098 of file class.ilObjMediaCastGUI.php.

References $_GET, ilObjectGUI\$lng, and ilObjMediaCast\ORDER_MANUAL.

Referenced by editOrderObject(), listItemsObject(), and showGallery().

{
global $ilTabs, $ilAccess, $lng;
$ilTabs->addSubTab("content",
$lng->txt("view"),
$this->ctrl->getLinkTarget($this, "showContent"));
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
{
$ilTabs->addSubTab("manage",
$lng->txt("mcst_manage"),
$this->ctrl->getLinkTarget($this, "listItems"));
if ($this->object->getOrder() == ilObjMediaCast::ORDER_MANUAL)
{
$ilTabs->addSubTab("sorting",
$lng->txt("mcst_ordering"),
$this->ctrl->getLinkTarget($this, "editOrder"));
}
}
$ilTabs->activateSubTab($a_active);
$ilTabs->activateTab("content");
}

+ Here is the caller graph for this function:

ilObjMediaCastGUI::addLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

Definition at line 1300 of file class.ilObjMediaCastGUI.php.

References $_GET.

{
global $ilLocator;
if (is_object($this->object))
{
$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "listItems"), "", $_GET["ref_id"]);
}
}
ilObjMediaCastGUI::afterSave (   $newObj)

save object public

Definition at line 131 of file class.ilObjMediaCastGUI.php.

References ilUtil\redirect(), and ilUtil\sendSuccess().

{
// always send a message
ilUtil::sendSuccess($this->lng->txt("object_added"),true);
ilUtil::redirect("ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=".$newObj->getRefId()."&cmd=editSettings");
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::confirmDeletionItemsObject ( )

Confirmation Screen.

Definition at line 861 of file class.ilObjMediaCastGUI.php.

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), ilUtil\getImagePath(), and listItemsObject().

{
global $ilCtrl, $lng, $tpl, $ilTabs;
$this->checkPermission("write");
$ilTabs->activateTab("edit_content");
if (!is_array($_POST["item_id"]))
{
$this->listItemsObject();
return;
}
include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
$c_gui = new ilConfirmationGUI();
// set confirm/cancel commands
$c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteItems"));
$c_gui->setHeaderText($lng->txt("info_delete_sure"));
$c_gui->setCancel($lng->txt("cancel"), "listItems");
$c_gui->setConfirm($lng->txt("confirm"), "deleteItems");
// add items to delete
include_once("./Services/News/classes/class.ilNewsItem.php");
foreach($_POST["item_id"] as $item_id)
{
$item = new ilNewsItem($item_id);
$c_gui->addItem("item_id[]", $item_id, $item->getTitle(),
ilUtil::getImagePath("icon_mcst.png"));
}
$tpl->setContent($c_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::convertFileObject ( )

Convert file object.

Parameters
@return

Definition at line 1556 of file class.ilObjMediaCastGUI.php.

References $_GET, $_POST, $ilCtrl, $ret, ilObjMediaObject\_getDirectory(), ilObjectGUI\checkPermission(), convert(), ilFFmpeg\getLastReturnValues(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\stripSlashes().

{
global $ilCtrl;
$this->checkPermission("write");
$this->mcst_item = new ilNewsItem($_GET["item_id"]);
include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$mob = new ilObjMediaObject($this->mcst_item->getMobId());
$target_purpose = ilUtil::stripSlashes($_POST["target_purpose"]);
$target_format = ilUtil::stripSlashes($_POST["target_format"]);
try
{
include_once("./Services/MediaObjects/classes/class.ilFFmpeg.php");
$med = $mob->getMediaItem("Standard");
$mob_file = ilObjMediaObject::_getDirectory($mob->getId())."/".$med->getLocation();
$new_file = ilFFmpeg::convert($mob_file, $target_format);
$pi = pathinfo($new_file);
$med = $mob->getMediaItem($target_purpose);
if (!is_object($med))
{
$med = new ilMediaItem();
$med->setMobId($mob->getId());
$mob->addMediaItem($med);
$mob->update();
$med->setPurpose($target_purpose);
}
$med->setFormat($target_format);
$med->setLocation($pi["basename"]);
$med->setLocationType("LocalFile");
$med->update();
$add = (is_array($ret) && count($ret) > 0)
? "<br />".implode($ret, "<br />")
: "";
ilUtil::sendInfo($this->lng->txt("mcst_converted_file").$add, true);
}
catch (ilException $e)
{
$add = (is_array($ret) && count($ret) > 0)
? "<br />".implode($ret, "<br />")
: "";
ilUtil::sendFailure($e->getMessage().$add, true);
}
$ilCtrl->redirect($this, "editCastItem");
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::createMediaItemForPurpose (   $mob,
  $purpose 
)
private

handle media item for given purpose

Parameters
ilMediaObject$mob
stringfile

Definition at line 669 of file class.ilObjMediaCastGUI.php.

References updateMediaItem().

Referenced by saveCastItemObject(), and updateCastItemObject().

{
$mediaItem = new ilMediaItem();
$mob->addMediaItem($mediaItem);
$mediaItem->setPurpose($purpose);
return $this->updateMediaItem($mob, $mediaItem);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaCastGUI::deleteItemsObject ( )

Delete news items.

Definition at line 898 of file class.ilObjMediaCastGUI.php.

References $_POST, $ilCtrl, and ilObjectGUI\checkPermission().

{
global $ilCtrl;
$this->checkPermission("write");
// delete all selected news items
foreach($_POST["item_id"] as $item_id)
{
$mc_item = new ilNewsItem($item_id);
$mc_item->delete();
}
$ilCtrl->redirect($this, "listItems");
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::determinePlaytimeObject ( )

Delete news items.

Definition at line 951 of file class.ilObjMediaCastGUI.php.

References $_GET, $file, $ilCtrl, ilObjectGUI\$lng, ilObjMediaObject\_getDirectory(), getDuration(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilCtrl, $lng;
$mc_item = new ilNewsItem($_GET["item_id"]);
$mob = $mc_item->getMobId();
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
$mob = new ilObjMediaObject($mob);
$mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
$m_item = $mob->getMediaItem("Standard");
$file = $mob_dir."/".$m_item->getLocation();
$duration = $this->getDuration($file);
if ($duration != "00:00:00")
{
$mc_item->setPlaytime($duration);
$mc_item->update();
ilUtil::sendSuccess($lng->txt("mcst_set_playtime"), true);
}
else
{
ilUtil::sendFailure($lng->txt("mcst_unable_to_determin_playtime"), true);
}
$ilCtrl->redirect($this, "listItems");
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::downloadItemObject ( )

Delete news items.

Definition at line 917 of file class.ilObjMediaCastGUI.php.

References $_GET, $file, $ilCtrl, ilObjMediaObject\_getDirectory(), ilObjectGUI\checkPermission(), ilUtil\deliverFile(), exit, ilUtil\redirect(), and ilUtil\sendFailure().

{
global $ilCtrl;
$this->checkPermission("read");
$mc_item = new ilNewsItem($_GET["item_id"]);
$mob = $mc_item->getMobId();
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
$mob = new ilObjMediaObject($mob);
$mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
$purpose = $_GET["purpose"];
$m_item = $mob->getMediaItem($purpose);
if ($m_item->getLocationType() != "Reference")
{
$file = $mob_dir."/".$m_item->getLocation();
if (file_exists($file) && is_file($file))
{
ilUtil::deliverFile($file, $m_item->getLocation());
}
else {
ilUtil::sendFailure("File not found!",true);
$ilCtrl->redirect($this, "listItems");
}
}
else
{
ilUtil::redirect($m_item->getLocation());
}
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::editCastItemObject ( )

Edit media cast item.

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

References $_GET, $ilCtrl, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), ilFFmpeg\enabled(), getCastItemValues(), ilObjMediaObject\getMediaItem(), initAddCastItemForm(), ilTextInputGUI\setMaxLength(), and ilFFmpeg\supportsImageExtraction().

{
global $tpl, $ilToolbar, $ilCtrl;
$this->checkPermission("write");
// conversion toolbar
include_once("./Services/MediaObjects/classes/class.ilFFmpeg.php");
{
$this->mcst_item = new ilNewsItem($_GET["item_id"]);
include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$mob = new ilObjMediaObject($this->mcst_item->getMobId());
$conv_cnt = 0;
// we had other purposes as source as well, but
// currently only "Standard" is implemented in the convertFile method
foreach (array("Standard") as $p)
{
/*
$med = $mob->getMediaItem($p);
if (is_object($med))
{
$options = ilFFmpeg::getPossibleTargetMimeTypes($med->getFormat());
if (count($options) > 0)
{
if ($conv_cnt > 0)
{
$ilToolbar->addSeparator();
}
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$si = new ilSelectInputGUI($this->lng->txt("mcst_conv_".
strtolower($p)."_to"), "target_format");
$si->setOptions($options);
$ilToolbar->addInputItem($si, true);
$si = new ilSelectInputGUI(", ".$this->lng->txt("mcst_target").": ",
"target_purpose");
$si->setOptions(array("Standard" => $this->lng->txt("mcst_purpose_standard"),
"VideoAlternative" => $this->lng->txt("mcst_purpose_videoalternative")
));
$si->setValue($p);
$ilToolbar->addInputItem($si, true);
$ilToolbar->addFormButton($this->lng->txt("mcst_convert"), "convertFile");
$conv_cnt++;
}
}
*/
$med = $mob->getMediaItem($p);
if (is_object($med))
{
if (ilFFmpeg::supportsImageExtraction($med->getFormat()))
{
// second
include_once("./Services/Form/classes/class.ilTextInputGUI.php");
$ni = new ilTextInputGUI($this->lng->txt("mcst_second"), "sec");
$ni->setMaxLength(4);
$ni->setSize(4);
$ni->setValue(1);
$ilToolbar->addInputItem($ni, true);
$ilToolbar->addFormButton($this->lng->txt("mcst_extract_preview_image"), "extractPreviewImage");
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
}
}
/*if ($conv_cnt > 0)
{
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
}*/
}
}
$this->initAddCastItemForm("edit");
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::editOrderObject ( )
protected

Definition at line 1397 of file class.ilObjMediaCastGUI.php.

References ilObjectGUI\$lng, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), listItemsObject(), ilObjMediaCast\ORDER_CREATION_DATE_ASC, ilObjMediaCast\ORDER_CREATION_DATE_DESC, ilObjMediaCast\ORDER_MANUAL, and ilObjMediaCast\ORDER_TITLE.

{
global $ilTabs, $lng, $tpl;
$this->checkPermission("write");
$ilTabs->activateTab("edit_content");
$this->addContentSubTabs("sorting");
// sort by order setting
switch($this->object->getOrder())
{
return $this->listItemsObject();
// sub-tabs
break;
}
include_once("./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
$table_gui = new ilMediaCastTableGUI($this, "editOrder", true);
$table_gui->setTitle($lng->txt("mcst_media_cast"));
$table_gui->setData($this->object->getSortedItemsArray());
$table_gui->addCommandButton("saveOrder", $lng->txt("mcst_save_order"));
$tpl->setContent($table_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::editSettingsObject ( )

Edit settings.

Definition at line 1128 of file class.ilObjMediaCastGUI.php.

References ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), and initSettingsForm().

{
global $tpl, $ilTabs;
$this->checkPermission("write");
$ilTabs->activateTab("id_settings");
$this->initSettingsForm();
$tpl->setContent($this->form_gui->getHtml());
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

References $cmd, $ilUser, $ret, ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreen(), and ilObjectGUI\prepareOutput().

{
global $ilUser, $ilTabs;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
switch($next_class)
{
case "ilinfoscreengui":
$this->checkPermission("visible");
$this->infoScreen(); // forwards command
break;
case "ilexportgui":
// $this->prepareOutput();
$ilTabs->activateTab("export");
include_once("./Services/Export/classes/class.ilExportGUI.php");
$exp_gui = new ilExportGUI($this);
$exp_gui->addFormat("xml");
$ret = $this->ctrl->forwardCommand($exp_gui);
// $this->tpl->show();
break;
case 'ilpermissiongui':
$ilTabs->activateTab("id_permissions");
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
case "ilcommonactiondispatchergui":
include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
$this->ctrl->forwardCommand($gui);
break;
default:
if(!$cmd)
{
$cmd = "infoScreen";
}
$cmd .= "Object";
if ($cmd != "infoScreenObject")
{
$this->checkPermission("read");
}
else
{
$this->checkPermission("visible");
}
$this->$cmd();
break;
}
$this->addHeaderAction();
return true;
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::extractPreviewImageObject ( )

Extract preview image.

Parameters
@return

Definition at line 1616 of file class.ilObjMediaCastGUI.php.

References $_GET, $_POST, $ilCtrl, $ret, ilObjMediaObject\_getDirectory(), ilObjectGUI\checkPermission(), ilFFmpeg\extractImage(), ilFFmpeg\getLastReturnValues(), ilUtil\sendFailure(), and ilUtil\sendInfo().

{
global $ilCtrl;
$this->checkPermission("write");
$this->mcst_item = new ilNewsItem($_GET["item_id"]);
include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$mob = new ilObjMediaObject($this->mcst_item->getMobId());
try
{
$sec = (int) $_POST["sec"];
if ($sec < 0)
{
$sec = 0;
}
if ($mob->getVideoPreviewPic() != "")
{
$mob->removeAdditionalFile($mob->getVideoPreviewPic(true));
}
include_once("./Services/MediaObjects/classes/class.ilFFmpeg.php");
$med = $mob->getMediaItem("Standard");
$mob_file = ilObjMediaObject::_getDirectory($mob->getId())."/".$med->getLocation();
$new_file = ilFFmpeg::extractImage($mob_file, "mob_vpreview.png",
ilObjMediaObject::_getDirectory($mob->getId()), $sec);
if ($new_file != "")
{
ilUtil::sendInfo($this->lng->txt("mcst_image_extracted"), true);
}
else
{
ilUtil::sendFailure($this->lng->txt("mcst_no_extraction_possible"), true);
}
}
catch (ilException $e)
{
if (DEVMODE == 1)
{
$add = (is_array($ret) && count($ret) > 0)
? "<br />".implode($ret, "<br />")
: "";
}
ilUtil::sendFailure($e->getMessage().$add, true);
}
$ilCtrl->redirect($this, "editCastItem");
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::getCastItemValues ( )

Get cast item values into form.

Definition at line 485 of file class.ilObjMediaCastGUI.php.

References $_GET, ilObjectGUI\$lng, ilObjMediaCast\$purposes, getMediaItems(), and ilObjMediaObject\getVideoPreviewPic().

Referenced by editCastItemObject().

{
global $lng;
// get mob
$this->mcst_item = new ilNewsItem($_GET["item_id"]);
include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$mob = new ilObjMediaObject($this->mcst_item->getMobId());
// preview
$ppic = $mob->getVideoPreviewPic();
if ($ppic != "")
{
$i = $this->form_gui->getItemByPostVar("preview_pic");
$i->setImage($ppic);
}
$values = array();
$mediaItems = $this->getMediaItems($_GET["item_id"]);
if (count ($mediaItems) > 0)
{
foreach ($mediaItems as $med)
{
if (!isset ($values["title"]))
{
// first item, so set title, description, ...
$values["title"] = $this->mcst_item->getTitle();
$values["description"] = $this->mcst_item->getContent();
$values["visibility"] = $this->mcst_item->getVisibility();
$length = explode(":", $this->mcst_item->getPlaytime());
$values["duration"] = array("hh" => $length[0], "mm" => $length[1], "ss" => $length[2]);
}
$values["value_".$med->getPurpose()] = (strlen($med->getLocation())> 100) ? "...".substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
$values["label_value_".$med->getPurpose()] = (strlen($med->getLocation())> 100) ? "...".substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
$values["mimetype_".$med->getPurpose()] = $med->getFormat();
}
}
foreach (ilObjMediaCast::$purposes as $purpose) {
if (!isset ($values["value_".$purpose]))
{
$values["label_value_".$purpose] = $lng->txt("none");
$values["value_".$purpose] = $lng->txt("none");
}
}
$this->form_gui->setValuesByArray($values);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaCastGUI::getDuration (   $file)
private

get duration from form or from file analyzer

Parameters
unknown_type$file
Returns
unknown

Definition at line 641 of file class.ilObjMediaCastGUI.php.

References $file.

Referenced by determinePlaytimeObject(), saveCastItemObject(), and updateCastItemObject().

{
$duration = isset($this->form_gui)
? $this->form_gui->getInput("duration")
: array("hh"=>0, "mm"=>0, "ss"=>0);
if ($duration["hh"] == 0 && $duration["mm"] == 0 && $duration["ss"] == 0 && is_file($file))
{
include_once("./Services/MediaObjects/classes/class.ilMediaAnalyzer.php");
$ana = new ilMediaAnalyzer();
$ana->setFile($file);
$ana->analyzeFile();
$dur = $ana->getPlaytimeString();
$dur = explode(":", $dur);
$duration["mm"] = $dur[0];
$duration["ss"] = $dur[1];
}
$duration = str_pad($duration["hh"], 2 , "0", STR_PAD_LEFT).":".
str_pad($duration["mm"], 2 , "0", STR_PAD_LEFT).":".
str_pad($duration["ss"], 2 , "0", STR_PAD_LEFT);
return $duration;
}

+ Here is the caller graph for this function:

ilObjMediaCastGUI::getFeedIconsHTML ( )

Get feed icons HTML.

Parameters
@return

Definition at line 195 of file class.ilObjMediaCastGUI.php.

References ilObjectGUI\$lng, ilObjMediaCast\$purposes, $title, ilBlockSetting\_lookup(), and ilUtil\getImagePath().

Referenced by listItemsObject(), and showGallery().

{
global $lng;
$html = "";
include_once("./Services/Block/classes/class.ilBlockSetting.php");
$public_feed = ilBlockSetting::_lookup("news", "public_feed",
0, $this->object->getId());
// rss icon/link
if ($public_feed)
{
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
if ($enable_internal_rss)
{
// create dummy object in db (we need an id)
$items = $this->object->getItemsArray();
include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$html = "";
foreach (ilObjMediaCast::$purposes as $purpose)
{
foreach ($items as $id => $item)
{
$mob = new ilObjMediaObject($item["mob_id"]);
$mob->read();
if ($mob->hasPurposeItem($purpose))
{
if ($html == "")
{
$html = " ";
}
$url = ILIAS_HTTP_PATH."/feed.php?client_id=".rawurlencode(CLIENT_ID)."&"."ref_id=".$_GET["ref_id"]."&purpose=$purpose";
$title = $lng->txt("news_feed_url");
$icon = ilUtil::getImagePath("rss_icon_".strtolower($purpose).".png");
$target = "_blank";
$row1 .= "<A href='$url' target='$target'><img src='$icon' alt='$title'/></A>";
if ($this->object->getPublicFiles())
{
$url = preg_replace("/https?/i","itpc",$url);
$title = $lng->txt("news_feed_url");
$icon = ilUtil::getImagePath("itunes_icon.png");
$row2 .= "<A href='$url' target='$target'><img src='$icon' alt='$title'/></A>";
}
break;
}
}
}
if ($html != "")
{
$html .= $row1;
if ($row2 != "")
{
$html .= "&nbsp;&nbsp;".$row2;
}
}
}
}
return $html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaCastGUI::getMediaItem (   $id)
protected

get MediaItem for id and updates local variable mcst_item

Returns
ilMediaItem

Definition at line 1354 of file class.ilObjMediaCastGUI.php.

References ilObjMediaObject\getMediaItem().

{
include_once("./Services/News/classes/class.ilNewsItem.php");
$this->mcst_item = new ilNewsItem($id);
// create dummy object in db (we need an id)
include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$mob = new ilObjMediaObject($this->mcst_item->getMobId());
return $mob->getMediaItem("Standard");
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::getMediaItems (   $id)
protected

get MediaItems for id and updates local variable mcst_item

Returns
array of ilMediaItem

Definition at line 1369 of file class.ilObjMediaCastGUI.php.

References ilObjMediaObject\getMediaItems().

Referenced by getCastItemValues().

{
include_once("./Services/News/classes/class.ilNewsItem.php");
$this->mcst_item = new ilNewsItem($id);
// create dummy object in db (we need an id)
include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$mob = new ilObjMediaObject($this->mcst_item->getMobId());
return $mob->getMediaItems();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaCastGUI::ilObjMediaCastGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor public.

Definition at line 28 of file class.ilObjMediaCastGUI.php.

References $ilCtrl, ilObjectGUI\$lng, ilMediaCastSettings\_getInstance(), ilMimeTypeUtil\getExt2MimeMap(), and ilObjectGUI\ilObjectGUI().

{
global $ilCtrl, $lng;
$this->type = "mcst";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
$lng->loadLanguageModule("mcst");
$lng->loadLanguageModule("news");
$ilCtrl->saveParameter($this, "item_id");
include_once ("./Modules/MediaCast/classes/class.ilMediaCastSettings.php");
$this->purposeSuffixes = $settings->getPurposeSuffixes();
$this->mimeTypes = array();
$mime_types = $settings->getMimeTypes();
foreach ($mime_types as $mt)
{
$this->mimeTypes[$mt] = $mt;
}
include_once("./Services/Utilities/classes/class.ilMimeTypeUtil.php");
foreach (ilMimeTypeUtil::getExt2MimeMap() as $mt)
{
$this->mimeTypes[$mt] = $mt;
}
asort($this->mimeTypes);
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::infoScreen ( )

show information screen

Definition at line 993 of file class.ilObjMediaCastGUI.php.

References $ilUser, ilDatePresentation\formatDate(), and IL_CAL_DATETIME.

Referenced by executeCommand(), and infoScreenObject().

{
global $ilAccess, $ilUser, $ilTabs;
$ilTabs->activateTab("id_info");
if (!$ilAccess->checkAccess("visible", "", $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
}
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
/*
$info->enableNews();
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
{
//$info->enableNewsEditing();
$info->setBlockProperty("news", "settings", true);
}*/
// general information
$this->lng->loadLanguageModule("meta");
$this->lng->loadLanguageModule("mcst");
$med_items = $this->object->getItemsArray();
$info->addSection($this->lng->txt("meta_general"));
$info->addProperty($this->lng->txt("mcst_nr_items"),
(int) count($med_items));
if (count($med_items) > 0)
{
$cur = current($med_items);
$last = ilDatePresentation::formatDate(new ilDateTime($cur["creation_date"], IL_CAL_DATETIME));
}
else
{
$last = "-";
}
$info->addProperty($this->lng->txt("mcst_last_submission"), $last);
// forward the command
$this->ctrl->forwardCommand($info);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaCastGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 982 of file class.ilObjMediaCastGUI.php.

References ilObjectGUI\checkPermission(), and infoScreen().

{
$this->checkPermission("visible");
$this->ctrl->setCmd("showSummary");
$this->ctrl->setCmdClass("ilinfoscreengui");
$this->infoScreen();
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::initAddCastItemForm (   $a_mode = "create")

Init add cast item form.

Definition at line 362 of file class.ilObjMediaCastGUI.php.

References $file, $ilCtrl, ilObjectGUI\$lng, ilObjMediaCast\$purposes, $section, ilObjectGUI\checkPermission(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilTextInputGUI\setMaxLength(), ilRegExpInputGUI\setPattern(), ilFormPropertyGUI\setPostVar(), ilFormPropertyGUI\setRequired(), and ilFileInputGUI\setSuffixes().

Referenced by addCastItemObject(), editCastItemObject(), saveCastItemObject(), and updateCastItemObject().

{
global $lng, $ilCtrl, $ilTabs;
$this->checkPermission("write");
$ilTabs->activateTab("edit_content");
$lng->loadLanguageModule("mcst");
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setMultipart(true);
// Property Title
$text_input = new ilTextInputGUI($lng->txt("title"), "title");
$text_input->setMaxLength(200);
$this->form_gui->addItem($text_input);
// Property Content
$text_area = new ilTextAreaInputGUI($lng->txt("description"), "description");
$text_area->setRequired(false);
$this->form_gui->addItem($text_area);
// Property Visibility
if ($enable_internal_rss)
{
$radio_group = new ilRadioGroupInputGUI($lng->txt("access_scope"), "visibility");
$radio_option = new ilRadioOption($lng->txt("access_users"), "users");
$radio_group->addOption($radio_option);
$radio_option = new ilRadioOption($lng->txt("access_public"), "public");
$radio_group->addOption($radio_option);
$radio_group->setInfo($lng->txt("mcst_visibility_info"));
$radio_group->setRequired(true);
$radio_group->setValue($this->object->getDefaultAccess() == 0 ? "users" : "public");
$this->form_gui->addItem($radio_group);
}
// Duration
$dur = new ilDurationInputGUI($lng->txt("mcst_duration"), "duration");
$dur->setInfo($lng->txt("mcst_duration_info"));
$dur->setShowDays(false);
$dur->setShowHours(true);
$dur->setShowSeconds(true);
$this->form_gui->addItem($dur);
foreach (ilObjMediaCast::$purposes as $purpose)
{
if ($purpose == "VideoAlternative" &&
$a_mode == "create")
{
continue;
}
$section->setTitle($lng->txt("mcst_".strtolower($purpose)."_title"));
$this->form_gui->addItem($section);
if ($a_mode != "create")
{
$value = new ilHiddenInputGUI("value_".$purpose);
$label = new ilNonEditableValueGUI($lng->txt("value"));
$label->setPostVar("label_value_".$purpose);
$label->setInfo($lng->txt("mcst_current_value_info"));
$this->form_gui->addItem($label);
$this->form_gui->addItem($value);
}
$file = new ilFileInputGUI($lng->txt("file"), "file_".$purpose);
$file->setSuffixes($this->purposeSuffixes[$purpose]);
$this->form_gui->addItem($file);
$text_input = new ilRegExpInputGUI($lng->txt("url"), "url_".$purpose);
$text_input->setPattern("/https?\:\/\/.+/i");
$text_input->setInfo($lng->txt("mcst_reference_info"));
$this->form_gui->addItem($text_input);
if ($purpose != "Standard")
{
$clearCheckBox = new ilCheckboxInputGUI();
$clearCheckBox->setPostVar("delete_".$purpose);
$clearCheckBox->setTitle($lng->txt("mcst_clear_purpose_title"));
$this->form_gui->addItem($clearCheckBox);
} else {
// mime type selection
$mimeTypeSelection = new ilSelectInputGUI();
$mimeTypeSelection->setPostVar("mimetype_".$purpose);
$mimeTypeSelection->setTitle($lng->txt("mcst_mimetype"));
$mimeTypeSelection->setInfo($lng->txt("mcst_mimetype_info"));
$options = array("" => $lng->txt("mcst_automatic_detection"));
$options = array_merge($options, $this->mimeTypes);
$mimeTypeSelection->setOptions($options);
$this->form_gui->addItem($mimeTypeSelection);
// preview picure
$pp = new ilImageFileInputGUI($lng->txt("mcst_preview_picture"), "preview_pic");
$pp->setSuffixes(array("png", "jpeg", "jpg"));
$pp->setInfo($lng->txt("mcst_preview_picture_info")." mp4, mp3, png, jp(e)g, gif");
$this->form_gui->addItem($pp);
}
}
// save/cancel button
if ($a_mode == "create")
{
$this->form_gui->setTitle($lng->txt("mcst_add_new_item"));
$this->form_gui->addCommandButton("saveCastItem", $lng->txt("save"));
}
else
{
$this->form_gui->setTitle($lng->txt("mcst_edit_item"));
$this->form_gui->addCommandButton("updateCastItem", $lng->txt("save"));
}
$this->form_gui->addCommandButton("listItems", $lng->txt("cancel"));
$this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveCastItem"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaCastGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObjectGUI.

Definition at line 119 of file class.ilObjMediaCastGUI.php.

References ilObjectGUI\initCreateForm(), and ilObjectGUI\initImportForm().

{
$forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
self::CFORM_IMPORT => $this->initImportForm($a_new_type));
return $forms;
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::initSettingsForm ( )

Init Settings Form.

Definition at line 1142 of file class.ilObjMediaCastGUI.php.

References $ilCtrl, ilObjectGUI\$lng, $si, ilObjectGUI\$tpl, ilBlockSetting\_lookup(), ilNewsItem\_lookupRSSPeriod(), ilRadioGroupInputGUI\addOption(), ilObjMediaCast\ORDER_CREATION_DATE_ASC, ilObjMediaCast\ORDER_CREATION_DATE_DESC, ilObjMediaCast\ORDER_MANUAL, ilObjMediaCast\ORDER_TITLE, ilCheckboxInputGUI\setChecked(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilNumberInputGUI\setMaxValue(), ilSelectInputGUI\setOptions(), ilTextInputGUI\setValue(), ilTextAreaInputGUI\setValue(), ilObjMediaCast\VIEW_GALLERY, and ilObjMediaCast\VIEW_LIST.

Referenced by editSettingsObject(), and saveSettingsObject().

{
global $tpl, $lng, $ilCtrl;
$lng->loadLanguageModule("mcst");
include("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setTitle($lng->txt("mcst_settings"));
// Title
$tit = new ilTextInputGUI($lng->txt("title"), "title");
$tit->setValue($this->object->getTitle());
$tit->setRequired(true);
$this->form_gui->addItem($tit);
// description
$des = new ilTextAreaInputGUI($lng->txt("description"), "description");
$des->setValue($this->object->getLongDescription());
$this->form_gui->addItem($des);
// Online
$online = new ilCheckboxInputGUI($lng->txt("online"), "online");
$online->setChecked($this->object->getOnline());
$this->form_gui->addItem($online);
// Sorting
$sort = new ilRadioGroupInputGUI($lng->txt("mcst_ordering"), "order");
$sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_title"),
$sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_creation_date_asc"),
$sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_creation_date_desc"),
$sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_manual"),
$sort->setValue($this->object->getOrder());
$this->form_gui->addItem($sort);
// view mode
$options = array(
ilObjMediaCast::VIEW_LIST => $lng->txt("mcst_list"),
ilObjMediaCast::VIEW_GALLERY => $lng->txt("mcst_gallery")
);
$si = new ilSelectInputGUI($this->lng->txt("mcst_viewmode"), "viewmode");
$si->setOptions($options);
$si->setValue($this->object->getViewMode());
$this->form_gui->addItem($si);
// Downloadable
$downloadable = new ilCheckboxInputGUI($lng->txt("mcst_downloadable"), "downloadable");
$downloadable->setChecked($this->object->getDownloadable());
$downloadable->setInfo($lng->txt("mcst_downloadable_info"));
$this->form_gui->addItem($downloadable);
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
//Default Visibility
if ($enable_internal_rss)
{
$radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "defaultaccess");
$radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "0");
$radio_group->addOption($radio_option);
$radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "1");
$radio_group->addOption($radio_option);
$radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
$radio_group->setRequired(false);
$radio_group->setValue($this->object->getDefaultAccess());
#$ch->addSubItem($radio_group);
$this->form_gui->addItem($radio_group);
//Extra Feed
include_once("./Services/Block/classes/class.ilBlockSetting.php");
$public_feed = ilBlockSetting::_lookup("news", "public_feed", 0, $this->object->getId());
$ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"), "extra_feed");
$ch->setInfo($lng->txt("news_public_feed_info"));
$ch->setChecked($public_feed);
$this->form_gui->addItem($ch);
// keep minimal x number of items
$ni = new ilNumberInputGUI($this->lng->txt("news_keep_minimal_x_items"), "keep_rss_min");
$ni->setMaxValue(100);
$ni->setMinValue(0);
$ni->setMaxLength(3);
$ni->setSize(3);
$ni->setInfo($this->lng->txt("news_keep_minimal_x_items_info")." (".
ilNewsItem::_lookupRSSPeriod()." ".(ilNewsItem::_lookupRSSPeriod() == 1 ? $lng->txt("day") : $lng->txt("days")).")");
$ni->setValue((int) ilBlockSetting::_lookup("news", "keep_rss_min", 0, $this->object->getId()));
$ch->addSubItem($ni);
// Include Files in Pubic Items
$incl_files = new ilCheckboxInputGUI($lng->txt("mcst_incl_files_in_rss"), "public_files");
$incl_files->setChecked($this->object->getPublicFiles());
$incl_files->setInfo($lng->txt("mcst_incl_files_in_rss_info"));
#$ch->addSubItem($incl_files);
$this->form_gui->addItem($incl_files);
}
// Form action and save button
$this->form_gui->addCommandButton("saveSettings", $lng->txt("save"));
$this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilObjMediaCastGUI::isAudio (   $extension)
staticprotected

detect audio mimetype

Parameters
string$extension
Returns
true, if extension contains string "audio"

Definition at line 1344 of file class.ilObjMediaCastGUI.php.

{
return strpos($extension,"audio") !== false;
}
ilObjMediaCastGUI::listItemsObject (   $a_presentation_mode = false)

List items of media cast.

Definition at line 141 of file class.ilObjMediaCastGUI.php.

References $_GET, ilObjectGUI\$lng, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), and getFeedIconsHTML().

Referenced by confirmDeletionItemsObject(), editOrderObject(), and showContentObject().

{
global $tpl, $lng, $ilAccess, $ilTabs, $ilToolbar;
$this->checkPermission("read");
if ($a_presentation_mode)
{
$this->addContentSubTabs("content");
}
else
{
$this->addContentSubTabs("manage");
}
$med_items = $this->object->getSortedItemsArray();
include_once("./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
if ($a_presentation_mode)
{
$table_gui = new ilMediaCastTableGUI($this, "showContent", false, true);
}
else
{
$table_gui = new ilMediaCastTableGUI($this, "listItems");
}
$table_gui->setData($med_items);
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && !$a_presentation_mode)
{
$ilToolbar->addButton($lng->txt("add"), $this->ctrl->getLinkTarget($this, "addCastItem"));
$table_gui->addMultiCommand("confirmDeletionItems", $lng->txt("delete"));
$table_gui->setSelectAllCheckbox("item_id");
}
$feed_icon_html = $this->getFeedIconsHTML();
if ($feed_icon_html != "")
{
$table_gui->setHeaderHTML($feed_icon_html);
}
$tpl->setContent($table_gui->getHTML());
$tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaCastGUI::populateFormFromPost ( )
private

Definition at line 1378 of file class.ilObjMediaCastGUI.php.

References $_POST, ilObjMediaCast\$purposes, and ilObjectGUI\$tpl.

Referenced by saveCastItemObject(), and updateCastItemObject().

{
global $tpl;
//issue: we have to display the current settings
// problem: POST does not contain values of disabled textfields
// solution: use hidden field and label to display-> here we need to synchronize the labels
// with the values from the hidden fields.
foreach (ilObjMediaCast::$purposes as $purpose)
{
if ($_POST["value_".$purpose])
{
$_POST["label_value_".$purpose] = $_POST["value_".$purpose];
}
}
$this->form_gui->setValuesByPost();
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the caller graph for this function:

ilObjMediaCastGUI::saveCastItemObject ( )

Save new cast item.

Definition at line 537 of file class.ilObjMediaCastGUI.php.

References $_POST, $file, $ilCtrl, $ilUser, ilObjectGUI\$lng, $title, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), createMediaItemForPurpose(), ilObjMediaObject\generatePreviewPic(), getDuration(), initAddCastItemForm(), NEWS_AUDIO, populateFormFromPost(), and ilUtil\sendFailure().

{
global $tpl, $ilCtrl, $ilUser, $lng, $ilTabs;
$this->checkPermission("write");
$ilTabs->activateTab("edit_content");
if ($_POST["url_Standard"] == "" && !$_FILES['file_Standard']['tmp_name']) {
ilUtil::sendFailure($lng->txt("msg_input_either_file_or_url"));
}
else if ($this->form_gui->checkInput())
{
// create dummy object in db (we need an id)
include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$mob = new ilObjMediaObject();
$mob->create();
//handle standard purpose
$file = $this->createMediaItemForPurpose($mob, "Standard");
// set title and description
// set title to basename of file if left empty
$title = $this->form_gui->getInput("title") != "" ? $this->form_gui->getInput("title") : basename($file);
$description = $this->form_gui->getInput("description");
$mob->setTitle($title);
$mob->setDescription($description);
// save preview pic
$prevpic = $this->form_gui->getInput("preview_pic");
if ($prevpic["size"] > 0)
{
$mob->uploadVideoPreviewPic($prevpic);
}
// determine duration for standard purpose
$duration = $this->getDuration($file);
// handle other purposes
foreach ($this->additionalPurposes as $purpose)
{
// check if some purpose has been uploaded
$file_gui = $this->form_gui->getInput("file_".$purpose);
$url_gui = $this->form_gui->getInput("url_".$purpose);
if ($url_gui || $file_gui["size"] > 0)
{
$this->createMediaItemForPurpose ($mob, $purpose);
}
}
$mob->update();
if ($prevpic["size"] == 0)
{
// re-read media object
$mob = new ilObjMediaObject($mob->getId());
$mob->generatePreviewPic(320, 240);
}
//
// @todo: save usage
//
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
// create new media cast item
include_once("./Services/News/classes/class.ilNewsItem.php");
$mc_item = new ilNewsItem();
$mc_item->setMobId($mob->getId());
$mc_item->setContentType(NEWS_AUDIO);
$mc_item->setContextObjId($this->object->getId());
$mc_item->setContextObjType($this->object->getType());
$mc_item->setUserId($ilUser->getId());
$mc_item->setPlaytime($duration);
$mc_item->setTitle($title);
$mc_item->setContent($description);
$mc_item->setLimitation(false);
if ($enable_internal_rss)
{
$mc_item->setVisibility($this->form_gui->getInput("visibility"));
}
else
{
$mc_item->setVisibility("users");
}
$mc_item->create();
$ilCtrl->redirect($this, "listItems");
}
else
{
}
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::saveOrderObject ( )

Definition at line 1430 of file class.ilObjMediaCastGUI.php.

References $_POST, ilObjectGUI\$lng, and ilUtil\sendSuccess().

{
global $lng;
asort($_POST["item_id"]);
$items = array();
foreach(array_keys($_POST["item_id"]) as $id)
{
$items[] = $id;
}
$this->object->saveOrder($items);
ilUtil::sendSuccess($lng->txt("settings_saved"), true);
$this->ctrl->redirect($this, "editOrder");
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::saveSettingsObject ( )

Save Settings.

Definition at line 1250 of file class.ilObjMediaCastGUI.php.

References $ilCtrl, ilBlockSetting\_write(), ilObjectGUI\checkPermission(), initSettingsForm(), and ilUtil\sendSuccess().

{
global $ilCtrl, $ilTabs;
$this->checkPermission("write");
$ilTabs->activateTab("id_settings");
$this->initSettingsForm();
if ($this->form_gui->checkInput())
{
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
$this->object->setTitle($this->form_gui->getInput("title"));
$this->object->setDescription($this->form_gui->getInput("description"));
$this->object->setOnline($this->form_gui->getInput("online"));
$this->object->setDownloadable($this->form_gui->getInput("downloadable"));
$this->object->setOrder($this->form_gui->getInput("order"));
$this->object->setViewMode($this->form_gui->getInput("viewmode"));
if ($enable_internal_rss)
{
$this->object->setPublicFiles($this->form_gui->getInput("public_files"));
$this->object->setDefaultAccess($this->form_gui->getInput("defaultaccess"));
}
$this->object->update();
if ($enable_internal_rss)
{
include_once("./Services/Block/classes/class.ilBlockSetting.php");
ilBlockSetting::_write("news", "public_feed",
$this->form_gui->getInput("extra_feed"),
0, $this->object->getId());
ilBlockSetting::_write("news", "keep_rss_min",
$this->form_gui->getInput("keep_rss_min"),
0, $this->object->getId());
}
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
$ilCtrl->redirect($this, "editSettings");
}
else
{
$this->form_gui->setValuesByPost();
$this->tpl->setContent($this->form_gui->getHTML());
}
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::setTabs ( )

get tabs public

Reimplemented from ilObjectGUI.

Definition at line 1045 of file class.ilObjMediaCastGUI.php.

References ilObjectGUI\$lng.

{
global $ilAccess, $ilTabs, $lng, $ilHelp;
$ilHelp->setScreenIdComponent("mcst");
// list items
if ($ilAccess->checkAccess('read', "", $this->object->getRefId()))
{
$ilTabs->addTab("content",
$lng->txt("content"),
$this->ctrl->getLinkTarget($this, "showContent"));
}
// info screen
if ($ilAccess->checkAccess('visible', "", $this->object->getRefId()))
{
$ilTabs->addTab("id_info",
$lng->txt("info_short"),
$this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
}
// settings
if ($ilAccess->checkAccess('write', "", $this->object->getRefId()))
{
$ilTabs->addTab("id_settings",
$lng->txt("settings"),
$this->ctrl->getLinkTarget($this, "editSettings"));
}
// export
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$ilTabs->addTab("export",
$lng->txt("export"),
$this->ctrl->getLinkTargetByClass("ilexportgui", ""));
}
// edit permissions
if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId()))
{
$ilTabs->addTab("id_permissions",
$lng->txt("perm_settings"),
$this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"));
}
}
ilObjMediaCastGUI::showContentObject ( )

Show content.

Parameters
@return

Definition at line 1457 of file class.ilObjMediaCastGUI.php.

References listItemsObject(), showGallery(), and ilObjMediaCast\VIEW_GALLERY.

{
if ($this->object->getViewMode() == ilObjMediaCast::VIEW_GALLERY)
{
$this->showGallery();
}
else
{
$this->listItemsObject(true);
}
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::showGallery ( )

Definition at line 1469 of file class.ilObjMediaCastGUI.php.

References ilObjectGUI\$tpl, ilObjMediaObject\_getURL(), addContentSubTabs(), getFeedIconsHTML(), ilUtil\getImagePath(), and ilUtil\img().

Referenced by showContentObject().

{
global $tpl, $ilTabs;
$tpl->addJavascript("./Modules/MediaCast/js/MediaCast.js");
$ilTabs->activateTab("content");
$this->addContentSubTabs("content");
$ctpl = new ilTemplate("tpl.mcst_content.html", true, true, "Modules/MediaCast");
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
foreach ($this->object->getSortedItemsArray() as $item)
{
$mob = new ilObjMediaObject($item["mob_id"]);
$med = $mob->getMediaItem("Standard");
$ctpl->setCurrentBlock("item");
$ctpl->setVariable("TITLE", $item["title"]);
$ctpl->setVariable("TIME", $item["playtime"]);
$ctpl->setVariable("ID", $item["id"]);
if ($mob->getVideoPreviewPic() != "")
{
$ctpl->setVariable("PREVIEW_PIC",
ilUtil::img($mob->getVideoPreviewPic(), $item["title"], 320, 240));
}
else
{
$ctpl->setVariable("PREVIEW_PIC",
ilUtil::img(ilUtil::getImagePath("mcst_preview.png"), $item["title"], 320, 240));
}
// player
if (is_object($med))
{
include_once("./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
$mpl = new ilMediaPlayerGUI();
if (strcasecmp("Reference", $med->getLocationType()) == 0)
{
$mpl->setFile($med->getLocation());
}
else
{
$mpl->setFile(ilObjMediaObject::_getURL($mob->getId())."/".$med->getLocation());
}
$mpl->setMimeType ($med->getFormat());
//$mpl->setDisplayHeight($med->getHeight());
$mpl->setDisplayHeight("480");
$mpl->setDisplayWidth("640");
$mpl->setVideoPreviewPic($mob->getVideoPreviewPic());
$mpl->setTitle($item["title"]);
$mpl->setDescription($item["content"]);
$mpl->setForceAudioPreview(true);
$med_alt = $mob->getMediaItem("VideoAlternative");
if (is_object($med_alt))
{
$mpl->setAlternativeVideoFile(ilObjMediaObject::_getURL($mob->getId())."/".
$med_alt->getLocation());
$mpl->setAlternativeVideoMimeType($med_alt->getFormat());
}
$ctpl->setVariable("PLAYER", $mpl->getPreviewHtml());
}
$ctpl->parseCurrentBlock();
}
$feed_icon_html = $this->getFeedIconsHTML();
if ($feed_icon_html != "")
{
$feed_icon_html = '<p>'.$feed_icon_html.'</p>';
}
$tpl->setContent($feed_icon_html.$ctpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaCastGUI::updateCastItemObject ( )

Update cast item.

Definition at line 756 of file class.ilObjMediaCastGUI.php.

References $_GET, $file, $ilCtrl, $ilUser, ilObjectGUI\$lng, $log, ilObjMediaCast\$purposes, $title, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), createMediaItemForPurpose(), getDuration(), initAddCastItemForm(), populateFormFromPost(), and updateMediaItem().

{
$this->checkPermission("write");
$this->initAddCastItemForm("edit");
if ($this->form_gui->checkInput())
{
// create new media cast item
include_once("./Services/News/classes/class.ilNewsItem.php");
$mc_item = new ilNewsItem($_GET["item_id"]);
$mob_id = $mc_item->getMobId();
// create dummy object in db (we need an id)
include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$mob = new ilObjMediaObject($mob_id);
foreach (ilObjMediaCast::$purposes as $purpose)
{
if ($this->form_gui->getInput("delete_".$purpose))
{
$mob->removeMediaItem($purpose);
$log->write ("Mcst: deleting purpose $purpose");
continue;
}
$media_item = $mob->getMediaItem($purpose);
$url_gui = $this->form_gui->getInput("url_".$purpose);
$file_gui = $this->form_gui->getInput("file_".$purpose);
if ($media_item == null)
{
if ($purpose != "Standard" &&
($url_gui || $file_gui["size"]>0))
{
// check if we added an additional purpose when updating
// either by url or by file
$file = $this->createMediaItemForPurpose($mob, $purpose);
}
} else
{
$file = $this->updateMediaItem($mob, $media_item);
}
if ($purpose == "Standard")
{
$duration = $this->getDuration($file);
$title = $this->form_gui->getInput("title") != "" ? $this->form_gui->getInput("title") : basename($file);
$description = $this->form_gui->getInput("description");
$mob->setTitle($title);
$mob->setDescription($description);
$prevpic = $this->form_gui->getInput("preview_pic");
if ($prevpic["size"] > 0)
{
$mob->uploadVideoPreviewPic($prevpic);
}
else
{
$prevpici = $this->form_gui->getItemByPostVar("preview_pic");
if ($prevpici->getDeletionFlag())
{
$mob->removeAdditionalFile($mob->getVideoPreviewPic(true));
}
}
}
}
// set real meta and object data
$mob->update();
//
// @todo: save usage
//
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
$mc_item->setUserId($ilUser->getId());
if (isset($duration))
{
$mc_item->setPlaytime($duration);
}
$mc_item->setTitle($title);
$mc_item->setContent($description);
if ($enable_internal_rss)
{
$mc_item->setVisibility($this->form_gui->getInput("visibility"));
}
$mc_item->update();
$ilCtrl->redirect($this, "listItems");
}
else
{
}
}

+ Here is the call graph for this function:

ilObjMediaCastGUI::updateMediaItem (   $mob,
$mediaItem 
)
private

update media item from form

Parameters
IlObjectMediaObject$mob
IlMediaItem$mediaItem
Returns
string file

Definition at line 684 of file class.ilObjMediaCastGUI.php.

References $_POST, $file, $location, $title, ilObjMediaObject\_getDirectory(), ilUtil\getASCIIFilename(), ilObjMediaObject\getMimeType(), ilUtil\moveUploadedFile(), and ilUtil\renameExecutables().

Referenced by createMediaItemForPurpose(), and updateCastItemObject().

{
$purpose = $mediaItem->getPurpose();
$url_gui = $this->form_gui->getInput ("url_".$purpose);
$file_gui = $this->form_gui->getInput ("file_".$purpose);
if ($url_gui)
{
// http
$file = $this->form_gui->getInput ("url_".$purpose);
$title = basename ($file);
$location = $this->form_gui->getInput ("url_".$purpose);
$locationType = "Reference";
} elseif ($file_gui["size"] > 0){
// lokal
// determine and create mob directory, move uploaded file to directory
$mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
if (!is_dir($mob_dir))
$mob->createDirectory();
$file_name = ilUtil::getASCIIFilename($_FILES['file_'.$purpose]['name']);
$file_name = str_replace(" ", "_", $file_name);
$file = $mob_dir."/".$file_name;
$title = $file_name;
$locationType = "LocalFile";
ilUtil::moveUploadedFile($_FILES['file_'.$purpose]['tmp_name'], $file_name, $file);
}
// check if not automatic mimetype detection
if ($_POST["mimetype_".$purpose] != "")
{
$mediaItem->setFormat($_POST["mimetype_".$purpose]);
}
elseif ($mediaItem->getLocation () != "")
{
$format = ilObjMediaObject::getMimeType($mediaItem->getLocation());
$mediaItem->setFormat($format);
}
if (isset($file))
{
// get mime type, if not already set!
if (!isset($format))
{
}
// set real meta and object data
$mediaItem->setFormat($format);
$mediaItem->setLocation($location);
$mediaItem->setLocationType($locationType);
$mediaItem->setHAlign("Left");
$mediaItem->setHeight(self::isAudio($format)?0:180);
}
if ($purpose == "Standard")
{
if (isset($title))
$mob->setTitle ($title);
if (isset($format))
$mob->setDescription($format);
}
return $file;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjMediaCastGUI::$additionalPurposes = array ("VideoPortable", "AudioPortable")
private

Definition at line 20 of file class.ilObjMediaCastGUI.php.

ilObjMediaCastGUI::$mimeTypes = array()
private

Definition at line 22 of file class.ilObjMediaCastGUI.php.

ilObjMediaCastGUI::$purposeSuffixes = array ()
private

Definition at line 21 of file class.ilObjMediaCastGUI.php.


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