|
| 1 | +<?php |
| 2 | + |
| 3 | +// Title of the form. |
| 4 | +$form['title'] = 'Frequently Asked Questions'; |
| 5 | + |
| 6 | +// Optional description of the form. |
| 7 | +$form['description'] = ''; |
| 8 | + |
| 9 | +// Name of the form which cannot contain spaces or foreign characters. |
| 10 | +$form['name'] = 'faq_form'; |
| 11 | + |
| 12 | +// The file that is used to call the form in the browser. |
| 13 | +$form['action'] = 'faq_edit.php'; |
| 14 | + |
| 15 | +// The name of the database table used to store the data |
| 16 | +$form['db_table'] = 'help_faq'; |
| 17 | + |
| 18 | +// The name of the database table index field. |
| 19 | +// This field must be a numeric auto increment column. |
| 20 | +$form['db_table_idx'] = 'hf_id'; |
| 21 | + |
| 22 | +// Should changes to this table be stored in the database history (sys_datalog) table. |
| 23 | +// This should be set to 'yes' for all tables that store configuration information. |
| 24 | +$form['db_history'] = 'no'; |
| 25 | + |
| 26 | +// The name of the tab that is shown when the form is opened |
| 27 | +$form['tab_default'] = 'message'; |
| 28 | + |
| 29 | +// The name of the default list file of this form |
| 30 | +$form['list_default'] = 'faq_list.php'; |
| 31 | + |
| 32 | +// Use the internal authentication system for this table. This should |
| 33 | +// be set to 'yes' in most cases, otherwise 'no'. |
| 34 | +$form['auth'] = 'yes'; |
| 35 | + |
| 36 | +//** Authentication presets. The defaults below does not need to be changed in most cases. |
| 37 | + |
| 38 | +// 0 = id of the user, > 0 id must match with id of current user |
| 39 | +$form['auth_preset']['userid'] = 0; |
| 40 | + |
| 41 | + // 0 = default groupid of the user, > 0 id must match with groupid of current |
| 42 | +$form['auth_preset']['groupid'] = 0; |
| 43 | + |
| 44 | +// Permissions with the following codes: r = read, i = insert, u = update, d = delete |
| 45 | +$form['auth_preset']['perm_user'] = 'riud'; |
| 46 | +$form['auth_preset']['perm_group'] = 'riud'; |
| 47 | +$form['auth_preset']['perm_other'] = 'r'; |
| 48 | + |
| 49 | +// The form definition of the first tab. The name of the tab is called 'message'. We refer |
| 50 | +// to this name in the $form['tab_default'] setting above. |
| 51 | +$form['tabs']['message'] = array( |
| 52 | + 'title' => 'FAQ', // Title of the Tab |
| 53 | + 'width' => 100, // Tab width |
| 54 | + 'template' => 'templates/faq_edit.htm', // Template file name |
| 55 | + 'fields' => array( |
| 56 | + |
| 57 | + //*** BEGIN Datatable columns ********************************** |
| 58 | + |
| 59 | + 'hf_section' => array ( |
| 60 | + 'datatype' => 'INTEGER', |
| 61 | + 'formtype' => 'SELECT', |
| 62 | + 'default' => '', |
| 63 | + 'datasource' => array ( 'type' => 'SQL', |
| 64 | + 'querystring' => 'SELECT hfs_id,hfs_name FROM help_faq_sections', |
| 65 | + 'keyfield' => 'hfs_id', |
| 66 | + 'valuefield' => 'hfs_name' |
| 67 | + ), |
| 68 | + 'validators' => array ( 0 => array ( 'type' => 'ISINT', |
| 69 | + 'errmsg'=> 'recipient_id_is_not_integer'), |
| 70 | + ), |
| 71 | + 'value' => ($_SESSION['s']['user']['typ'] != 'admin')?array(1 => 'Administrator'):'' |
| 72 | + ), |
| 73 | + |
| 74 | + 'hf_question' => array( |
| 75 | + 'datatype' => 'VARCHAR', |
| 76 | + 'formtype' => 'TEXT', |
| 77 | + 'validators' => array( 0 => array( 'type' => 'NOTEMPTY', |
| 78 | + 'errmsg'=> 'subject_is_empty' |
| 79 | + ), |
| 80 | + ), |
| 81 | + 'default' => '', |
| 82 | + 'value' => '', |
| 83 | + 'width' => '30', |
| 84 | + 'maxlength' => '255' |
| 85 | + ), |
| 86 | + |
| 87 | + 'hf_answer' => array( |
| 88 | + 'datatype' => 'TEXT', |
| 89 | + 'formtype' => 'TEXTAREA', |
| 90 | + 'validators' => array( 0 => array( 'type' => 'NOTEMPTY', |
| 91 | + 'errmsg'=> 'message_is_empty' |
| 92 | + ), |
| 93 | + ), |
| 94 | + 'default' => '', |
| 95 | + 'value' => '', |
| 96 | + 'cols' => '30', |
| 97 | + 'rows' => '10', |
| 98 | + 'maxlength' => '255' |
| 99 | + ), |
| 100 | + |
| 101 | + //*** END Datatable columns ********************************** |
| 102 | + ) |
| 103 | +); |
| 104 | +?> |
0 commit comments