Source for file listcolclass.php

Documentation is available at listcolclass.php


1 <?php
2 /**
3 * @author Jan H. Andersen <jha@ipwsystems.dk>
4 * @author Martin R. Larsen <mrl@ipwsystems.dk>
5 * @copyright {@link http://www.ipwsystems.dk/ IPW Systems a.s}
6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
7 * @package METAjour
8 * @subpackage core
9 * $Id: listcolclass.php,v 1.3 2005/02/10 08:24:00 SYSTEM Exp $
10 */
11
12 require_once('basicclass.php');
13
14 class listcol extends basic {
15
16 function listcol() {
17 $this->basic();
18 $this->addcolumn('name', 0, UI_CLASS);
19 $this->addcolumn('makedefault', 0, UI_CHECKBOX);
20
21 $this->removeview('createvariant');
22 $this->removeview('createfuture');
23 $this->removeview('approvepublish');
24 $this->removeview('requestapproval');
25 $this->removeview('category');
26 }
27
28 function prv_updateobject($objectid, $arr) {
29 basic::prv_updateobject($objectid, $arr);
30 $this->_adodb->execute("delete from listcol_data where objectid = '$objectid'");
31 $i = 0;
32 foreach($arr['fieldname'] as $name) {
33 if ($name != '') $this->_adodb->execute("insert into listcol_data (objectid, name, sortorder) values ('$objectid','".$arr['fieldname'][$i]."','".$arr['fieldsortorder'][$i]."')");
34 $i++;
35 }
36 }
37
38 function prv_readobject($objectid) {
39 $res =& $this->_adodb->execute("select name,sortorder from listcol_data where objectid = '$objectid' order by sortorder");
40 while ($row = $res->fetchrow()) {
41 $arr['fieldname'][] = $row['name'];
42 $arr['fieldsortorder'][] = $row['sortorder'];
43 }
44 return $arr;
45 }
46
47 }
48
49 ?>

Documentation generated on Thu, 9 Jun 2005 06:52:45 +0200 by phpDocumentor 1.2.3