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

Services/MetaData/classes/class.ilMDCopyrightTableGUI.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 
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 ?>

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