• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Modules/MediaCast/classes/class.ilMediaCastTableGUI.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2006 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 include_once("Services/Table/classes/class.ilTable2GUI.php");
00025 
00034 class ilMediaCastTableGUI extends ilTable2GUI
00035 {
00036 
00037         function ilMediaCastTableGUI($a_parent_obj, $a_parent_cmd = "")
00038         {
00039                 global $ilCtrl, $lng;
00040                 
00041                 parent::__construct($a_parent_obj, $a_parent_cmd);
00042                 
00043                 $this->addColumn("", "f", "1");
00044                 $this->addColumn($lng->txt("mcst_entry"), "", "33%");
00045                 $this->addColumn("", "", "33%");
00046                 $this->addColumn("", "", "34%");
00047                 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
00048                 $this->setRowTemplate("tpl.table_media_cast_row.html",
00049                         "Modules/MediaCast");
00050                 $this->setDefaultOrderField("creation_date");
00051                 $this->setDefaultOrderDirection("desc");
00052 
00053         }
00054         
00059         protected function fillRow($a_set)
00060         {
00061                 global $lng, $ilCtrl, $ilAccess;
00062                 
00063                 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
00064                 
00065                 $news_set = new ilSetting("news");
00066                 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
00067 
00068                 // edit link
00069                 $ilCtrl->setParameterByClass("ilobjmediacastgui", "item_id", $a_set["id"]);
00070                 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
00071                 {
00072                         $this->tpl->setCurrentBlock("edit");
00073                         $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
00074                         $this->tpl->setVariable("CMD_EDIT",
00075                                 $ilCtrl->getLinkTargetByClass("ilobjmediacastgui", "editCastItem"));
00076                         $this->tpl->setVariable("TXT_DET_PLAYTIME", $lng->txt("mcst_det_playtime"));
00077                         $this->tpl->setVariable("CMD_DET_PLAYTIME",
00078                                 $ilCtrl->getLinkTargetByClass("ilobjmediacastgui", "determinePlaytime"));
00079                         $this->tpl->parseCurrentBlock();
00080                 }
00081                 $this->tpl->setVariable("TXT_DOWNLOAD", $lng->txt("download"));
00082                 $this->tpl->setVariable("CMD_DOWNLOAD",
00083                         $ilCtrl->getLinkTargetByClass("ilobjmediacastgui", "downloadItem"));
00084 
00085                         
00086                 // access
00087                 if ($enable_internal_rss)
00088                 {
00089                         $this->tpl->setCurrentBlock("access");
00090                         $this->tpl->setVariable("TXT_ACCESS", $lng->txt("news_news_item_visibility"));
00091                         if ($a_set["visibility"] == NEWS_PUBLIC)
00092                         {
00093                                 $this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_public"));
00094                         }
00095                         else
00096                         {
00097                                 $this->tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_users"));
00098                         }
00099                         $this->tpl->parseCurrentBlock();
00100                 }
00101                 
00102                 $ilCtrl->setParameterByClass("ilobjmediacastgui", "item_id", "");
00103 
00104                 if (ilObject::_exists($a_set["mob_id"]))
00105                 {
00106                         if ($a_set["update_date"] != "")
00107                         {
00108                                 $this->tpl->setCurrentBlock("last_update");
00109                                 $this->tpl->setVariable("TXT_LAST_UPDATE",
00110                                         $lng->txt("last_update"));
00111                                 $this->tpl->setVariable("VAL_LAST_UPDATE",
00112                                         $a_set["update_date"]);
00113                                 $this->tpl->parseCurrentBlock();
00114                         }
00115                         
00116                         $mob = new ilObjMediaObject($a_set["mob_id"]);
00117                         $med = $mob->getMediaItem("Standard");
00118                         
00119                         $this->tpl->setVariable("VAL_TITLE",
00120                                 $a_set["title"]);
00121                         $this->tpl->setVariable("VAL_DESCRIPTION",
00122                                 $a_set["content"]);
00123                         $this->tpl->setVariable("TXT_FILENAME",
00124                                 $lng->txt("filename"));
00125                         $this->tpl->setVariable("VAL_FILENAME",
00126                                 $mob->getTitle());
00127                         $this->tpl->setVariable("TXT_CREATED",
00128                                 $lng->txt("created"));
00129                         $this->tpl->setVariable("VAL_CREATED",
00130                                 $a_set["creation_date"]);
00131                         $this->tpl->setVariable("TXT_DURATION",
00132                                 $lng->txt("mcst_play_time"));
00133                         $this->tpl->setVariable("VAL_DURATION",
00134                                 $a_set["playtime"]);
00135                                 
00136                         include_once("./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
00137                         $mpl = new ilMediaPlayerGUI();
00138                         if (strcasecmp("Reference", $med->getLocationType()) == 0)
00139                                 $mpl->setFile($med->getLocation());
00140                         else
00141                                 $mpl->setFile(ilObjMediaObject::_getURL($mob->getId())."/".$med->getLocation());
00142                         $mpl->setDisplayHeight($med->getHeight());
00143 
00144                         $this->tpl->setVariable("PLAYER",
00145                                 $mpl->getMp3PlayerHtml());
00146                         $this->tpl->setVariable("VAL_ID", $a_set["id"]);
00147                 }
00148                 
00149         }
00150 
00151 }
00152 ?>

Generated on Fri Dec 13 2013 17:56:52 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1