2 //=======================================================================
3 // File: JPD_EDITCLASS.PHP
4 // Description: Edit class information
6 // Author: Johan Persson (johanp@aditus.nu)
7 // Ver: $Id: jpd_editclass.php,v 1.3 2002/07/03 23:32:12 aditus Exp $
9 // License: This code is released under QPL 1.0
10 // Copyright (C) 2001,2002 Johan Persson
11 //=======================================================================
14 include "de_utils.php";
16 class EditClassTable extends DBTableEdit {
17 function EditClassTable($aDBUtils,$aTitle) {
18 parent::DBTableEdit('editclass',$aDBUtils);
20 $aDBUtils->GetClassList($cl);
21 $yn = array(" Private ",0," Public ",1);
23 array('file',1,1,2,'File:',LBLPOS_TOP,FLDPOS_LEFT,FLDTYPE_STATICTEXT),
24 array('linenbr',1,3,1,'Line:',LBLPOS_TOP,FLDPOS_LEFT,FLDTYPE_STATICTEXT),
25 array('desc',2,1,3,'Description:',LBLPOS_TOP,FLDPOS_LEFT,FLDTYPE_TEXTAREA,60,20),
26 array('ref1',3,1,1,'See also:',LBLPOS_TOP,FLDPOS_LEFT,FLDTYPE_DROPDOWN,$cl),
27 array('ref2',3,2,1,' ',LBLPOS_TOP,FLDPOS_LEFT,FLDTYPE_DROPDOWN,$cl),
28 array('ref3',4,1,1,'',LBLPOS_LEFT,FLDPOS_LEFT,FLDTYPE_DROPDOWN,$cl),
29 array('ref4',4,2,1,'',LBLPOS_LEFT,FLDPOS_LEFT,FLDTYPE_DROPDOWN,$cl),
30 array('public',5,1,1,'Scope:',LBLPOS_TOP,FLDPOS_LEFT,FLDTYPE_DROPDOWNCODE,$yn),
31 array('timestamp',5,2,1,'Last edit:',LBLPOS_TOP,FLDPOS_LEFT,FLDTYPE_TIMESTAMP),
32 array('_x_save',5,3,1,'',LBLPOS_LEFT,FLDPOS_RIGHT,FLDTYPE_SAVE),
35 $hidden = array('name','parentname','numfuncs');
36 $this->Set('tbl_class'.$aDBUtils->iProject,$formSpec,$hidden);
37 $this->iFormLayout->SetTitle($aTitle);
40 function Verify($aValues,&$aErrFld) {
45 class ClassEdDriver extends DocEditDriver {
46 function ClassEdDriver() {
47 $this->DocEditDriver();
49 function Run($aKey='') {
50 global $HTTP_POST_VARS;
52 HTMLGenerator::DocHeader('Edit DDDA Class','Modify or create existing class');
53 HTMLGenerator::DocPreamble();
55 $HTTP_POST_VARS['key'] = $aKey;
56 $r = $this->iDBUtils->GetClassKey($aKey);
58 if( !empty($r['fld_parentname']) )
59 $ext = ' <font color=lightgrey>extends '.$r['fld_parentname'].'</font>';
63 $e = new EditClassTable($this->iDBUtils,$r['fld_name'].$ext);
64 $e->Run($HTTP_POST_VARS);
68 $d = new ClassEdDriver();
69 $key = @$HTTP_GET_VARS['key']+0;