]>
src.bluestatic.org Git - bugdar.git/blob - includes/api_userhelp.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 $GLOBALS['isso:callback']->load('api', null);
24 require_once('./includes/functions_datastore.php');
29 * @author Iris Studios, Inc.
30 * @copyright Copyright ©2002 - [#]year[#], Iris Studios, Inc.
35 class UserHelpAPI
extends API
43 'keystring' => array(TYPE_STR
, REQ_YES
, ':self'),
44 'title' => array(TYPE_STR
, REQ_YES
, 'verify_noempty'),
45 'body' => array(TYPE_STR
, REQ_YES
)
53 var $table = 'fieldhelp';
60 var $prefix = TABLE_PREFIX
;
62 // ###################################################################
64 * A static function that returns an array of all the keystrings that
65 * are not allowed to be deleted
69 * @return array Array of keystrings
71 function not_able_to_delete()
90 // ###################################################################
96 function post_insert()
101 // ###################################################################
107 function post_update()
112 // ###################################################################
118 function pre_delete()
120 if (in_array($this->values
['keystring'], UserHelpAPI
::not_able_to_delete()))
127 // ###################################################################
133 function post_delete()
138 // ###################################################################
144 function verify_keystring()
146 if (!is_bool($ne = $this->verify_noempty('keystring')))
151 if (preg_match('#[^a-z0-9_]#', $this->values
['keystring']))
153 return $this->registry
->lang
->string('The unique key can only contain lowercase letters, underscores, and numbers.');
156 if ($this->registry
->db
->query_first("SELECT * FROM " . TABLE_PREFIX
. "fieldhelp WHERE keystring = '" . $this->registry
->escape($this->values
['keystring']) . "'"))
158 return $this->registry
->lang
->string('The unique key must be unique.');
165 /*=====================================================================*\
166 || ###################################################################
169 || ###################################################################
170 \*=====================================================================*/