Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00032 include_once('Services/Table/classes/class.ilTable2GUI.php');
00033 include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
00034
00035 class ilMDCopyrightTableGUI extends ilTable2GUI
00036 {
00037 protected $lng = null;
00038 protected $ctrl;
00039 protected $parent_obj;
00040
00048 public function __construct($a_parent_obj,$a_parent_cmd = '')
00049 {
00050 global $lng,$ilCtrl;
00051
00052 $this->lng = $lng;
00053 $this->ctrl = $ilCtrl;
00054
00055 parent::__construct($a_parent_obj,$a_parent_cmd);
00056 $this->addColumn('','f',1);
00057 $this->addColumn($this->lng->txt('title'),'title',"30%");
00058 $this->addColumn($this->lng->txt('md_used'),'used',"5%");
00059 $this->addColumn($this->lng->txt('md_copyright_preview'),'preview',"50%");
00060 $this->addColumn('','edit',"15%");
00061
00062 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
00063 $this->setRowTemplate("tpl.show_copyright_row.html","Services/MetaData");
00064 $this->setDefaultOrderField("title");
00065 $this->setDefaultOrderDirection("asc");
00066 }
00067
00075 public function fillRow($a_set)
00076 {
00077 $this->tpl->setVariable('VAL_ID',$a_set['id']);
00078 $this->tpl->setVariable('VAL_TITLE',$a_set['title']);
00079 if(strlen($a_set['description']))
00080 {
00081 $this->tpl->setVariable('VAL_DESCRIPTION',$a_set['description']);
00082 }
00083 $this->tpl->setVariable('VAL_USAGE',$a_set['used']);
00084 $this->tpl->setVariable('VAL_PREVIEW',$a_set['preview']);
00085
00086 $this->ctrl->setParameter($this->getParentObject(),'entry_id',$a_set['id']);
00087 $this->tpl->setVariable('EDIT_LINK',$this->ctrl->getLinkTarget($this->getParentObject(),'editEntry'));
00088 $this->ctrl->clearParameters($this->getParentObject());
00089
00090 $this->tpl->setVariable('TXT_EDIT',$this->lng->txt('edit'));
00091
00092
00093
00094
00095 }
00096
00104 public function parseSelections()
00105 {
00106 foreach(ilMDCopyrightSelectionEntry::_getEntries() as $entry)
00107 {
00108 $tmp_arr['id'] = $entry->getEntryId();
00109 $tmp_arr['title'] = $entry->getTitle();
00110 $tmp_arr['description'] = $entry->getDescription();
00111 $tmp_arr['used'] = $entry->getUsage();
00112 $tmp_arr['preview'] = $entry->getCopyright();
00113
00114 $entry_arr[] = $tmp_arr;
00115 }
00116 $this->setData($entry_arr ? $entry_arr : array());
00117 }
00118
00119 }
00120
00121
00122 ?>