]> git.llucax.com Git - mecon/meconlib.git/blob - lib/MECON/Graph/external/jpgraph/src/utils/jpdocgen/jpd_editclass.php
51b330c2d6a81aba1e2cbba22d82519c54c478f9
[mecon/meconlib.git] / lib / MECON / Graph / external / jpgraph / src / utils / jpdocgen / jpd_editclass.php
1 <?php
2 //=======================================================================
3 // File:                JPD_EDITCLASS.PHP
4 // Description: Edit class information
5 // Created:     2001-04-15
6 // Author:              Johan Persson (johanp@aditus.nu)
7 // Ver:                 $Id: jpd_editclass.php,v 1.3 2002/07/03 23:32:12 aditus Exp $
8 //
9 // License:     This code is released under QPL 1.0 
10 // Copyright (C) 2001,2002 Johan Persson 
11 //=======================================================================
12
13 include "jpdb.php";
14 include "de_utils.php";
15
16 class EditClassTable extends DBTableEdit {
17         function EditClassTable($aDBUtils,$aTitle) {
18                 parent::DBTableEdit('editclass',$aDBUtils);
19
20                 $aDBUtils->GetClassList($cl);   
21                 $yn = array("  Private  ",0,"  Public  ",1);
22                 $formSpec = array(
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,'&nbsp;',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),                        
33                 );
34                         
35                 $hidden = array('name','parentname','numfuncs');        
36                 $this->Set('tbl_class'.$aDBUtils->iProject,$formSpec,$hidden);
37                 $this->iFormLayout->SetTitle($aTitle);          
38         }
39         
40         function Verify($aValues,&$aErrFld) {
41                 return true;
42         }
43 }
44
45 class ClassEdDriver extends DocEditDriver {
46         function ClassEdDriver() {
47                 $this->DocEditDriver();
48         }
49         function Run($aKey='') {
50                 global $HTTP_POST_VARS;
51
52                 HTMLGenerator::DocHeader('Edit DDDA Class','Modify or create existing class');
53                 HTMLGenerator::DocPreamble();
54                 
55                 $HTTP_POST_VARS['key'] = $aKey;
56                 $r = $this->iDBUtils->GetClassKey($aKey);
57
58                 if( !empty($r['fld_parentname']) )
59                         $ext = ' <font color=lightgrey>extends '.$r['fld_parentname'].'</font>';
60                 else
61                         $ext = '';
62                         
63                 $e = new EditClassTable($this->iDBUtils,$r['fld_name'].$ext);
64                 $e->Run($HTTP_POST_VARS);
65         }
66 }
67
68 $d = new ClassEdDriver();
69 $key = @$HTTP_GET_VARS['key']+0;
70 $d->Run($key);
71 $d->Close();
72
73 ?>