Source for file profileclass.php

Documentation is available at profileclass.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: profileclass.php,v 1.7 2005/01/28 02:47:46 jan Exp $
10 */
11
12 require_once('basicclass.php');
13
14 class profile extends basic {
15
16 function profile() {
17 $this->basic();
18 $this->addcolumn('name',0,UI_STRING);
19
20 $this->removeview('createvariant');
21 $this->removeview('createfuture');
22 $this->removeview('approvepublish');
23 $this->removeview('requestapproval');
24 $this->removeview('category');
25 $this->addview('default');
26 }
27
28 function prv_createobject(&$arr) {
29 basic::prv_createobject($arr);
30 if (is_array($arr['fielddata'])) {
31 foreach($arr['fielddata'] as $field) {
32 $i = strpos($field,'#');
33 $type = substr($field,0,$i);
34 $view = substr($field,$i+1);
35 $this->_adodb->execute("insert into profile_data (objectid, type, view) values ('".$this->getObjectId()."','$type','$view')");
36 }
37 }
38 }
39
40 function prv_updateobject($objectid, $arr) {
41 basic::prv_updateobject($objectid, $arr);
42 $this->_adodb->execute("delete from profile_data where objectid = '$objectid'");
43 if (is_array($arr['fielddata'])) {
44 foreach($arr['fielddata'] as $field) {
45 $i = strpos($field,'#');
46 $type = substr($field,0,$i);
47 $view = substr($field,$i+1);
48 $this->_adodb->execute("insert into profile_data (objectid, type, view) values ('$objectid','$type','$view')");
49 }
50 }
51 }
52
53 function prv_readobject($objectid) {
54 $res =& $this->_adodb->execute("select type,view from profile_data where objectid = '$objectid'");
55 while ($row = $res->fetchrow()) {
56 $arr[$row['type']][$row['view']] = true;
57 }
58 return $arr;
59 }
60
61 }
62
63 ?>

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