PhpLabWare version 0.3 
/plugins/ -> skeleton_plugin.php

1  <?php
2 
3  // plugin_inc.php - skeleton file for plugin codes
4  // plugin_inc.php - author: Nico Stuurman
5 
6  /*
7  Copyright 2002, Nico Stuurman
8 
9  This is a skeleton file to code your own plugins.
10  To use it, rename this file to something meaningfull,
11  add the path and name to this file (relative to the phplabware root)
12  in the column 'plugin_code' of 'tableoftables', and code away.
13  And, when you make something nice, please send us a copy!
14 
15  This program is free software: you can redistribute it and/ormodify it under
16  the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
17 
18  */
19 
20 
21  ////
22  // !This function is called after a record has been added
23  // As an example, it is used to write some data concerning the
24  // new record to a file for inclusion in a webpage
25  /*
26  function plugin_add ($db,$tableid,$id)
27  {
28  }
29  */
30 
31 
32  ////
33  // !Change/calculate/check values just before they are added/modified
34  // $fieldvalues is an array with the column names as key.
35  // Any changes you make in the values of $fieldvalues will result in
36  // changes in the database.
37  // You could, for instance, calculate a value of a field based on other fields
38  // make sure this function returns true (or does not exist), or additions/modification
39  // will fail!
40  function plugin_check_data($db,&$fieldvalues,$table_desc,$modify=false)
41  {
42     return true;
43  }
44 
45  ////
46  // !Overrides the standard 'show record'function
47  function plugin_show($db,$tableinfo,$id,$USER,$system_settings,$backbutton=true)
48  {
49  }
50 
51 
52  ////
53  // !Extends the search query
54  // $query is the complete query that you can change and must return
55  // $fieldvalues is an array with the column names as key.
56  // if there is an $existing_clause (boolean) you should prepend your additions
57  // with ' AND' or ' OR', otherwise you should not
58  function plugin_search($query,$fieldvalues,$existing_clause)
59  {
60     return $query;
61  }
62 
63 
64  ////
65  // !Extends function getvalues
66  // $allfields is a 2-D array containing the field names of the table in the first dimension
67  // and name,columnid,label,datatype,display_table,display_record,ass_t,ass_column,
68  // ass_local_key,required,modifiable,text,values in the 2nd D
69  function plugin_getvalues($db,&$allfields,$id,$tableid)
70  {
71  }
72 
73  ////
74  // !Extends function display_add
75  // This function let's you change values before they are display in the display_add function
76  function plugin_display_add ($db,$tableid,&$nowfield)
77  {
78  }
79 
80  ////
81  // !Extends function display_add
82  // This lets you add information to every specific item
83  function plugin_display_add ($db,$tableid,$nowfield)
84  {
85  }
86 
87 
88  ?>


Generated: Sun Oct 5 21:17:35 2003 SourceForge Logo Generated by PHPXref 0.2