Source for file extradataclass.php

Documentation is available at extradataclass.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: extradataclass.php,v 1.5 2004/11/22 03:41:16 jan Exp $
10 */
11
12 require_once('basicclass.php');
13
14 class extradata extends basic {
15
16 function extradata() {
17 $this->basic();
18 $this->addcolumn('name', 0, UI_CLASS);
19
20 $this->removeview('createvariant');
21 $this->removeview('createfuture');
22 $this->removeview('approvepublish');
23 $this->removeview('requestapproval');
24 $this->removeview('category');
25
26 $this->allowduplicate = false;
27 }
28
29 function prv_updateobject($objectid, $arr) {
30 basic::prv_updateobject($objectid, $arr);
31 $this->_adodb->execute("delete from extradata_data where objectid = '$objectid'");
32 $i = 0;
33 foreach($arr['fieldname'] as $name) {
34 if ($name != '') $this->_adodb->execute("insert into extradata_data (objectid, name, type, description, sortorder) values ('$objectid','".$arr['fieldname'][$i]."','".$arr['fieldtype'][$i]."','".$arr['fielddescription'][$i]."','".$arr['fieldsortorder'][$i]."')");
35 $i++;
36 }
37 }
38
39 function prv_readobject($objectid) {
40 $res =& $this->_adodb->execute("select name,type,description,sortorder from extradata_data where objectid = '$objectid' order by sortorder");
41 while ($row = $res->fetchrow()) {
42 $arr['fieldname'][] = $row['name'];
43 $arr['fieldtype'][] = $row['type'];
44 $arr['fielddescription'][] = $row['description'];
45 $arr['fieldsortorder'][] = $row['sortorder'];
46 }
47 return $arr;
48 }
49
50 }

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