- Timestamp:
- Feb 17, 2020 11:01:55 PM (4 years ago)
- Location:
- trunk/bin/module_maker
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/form_template.cli.php
r612 r718 209 209 case 'dec' : 210 210 case 'numeric' : 211 default :212 211 $output[$field] = <<<E_O_F 213 212 … … 225 224 case 'time' : 226 225 case 'year' : 227 default :228 226 $output[$field] = <<<E_O_F 229 227 -
trunk/bin/module_maker/skel/admin.php
r664 r718 56 56 57 57 // Configure the cache object. 58 $cache = new Cache('%NAME_PLURAL%');58 $cache =& Cache::getInstance('%NAME_PLURAL%'); 59 59 $cache->setParam(array('enabled' => true, 'expires' => 60)); 60 60 … … 64 64 $page = new PageNumbers(); 65 65 $page->setPerPage(getFormData('per_page'), 100); 66 $page->setPageNumber(getFormData('page_number' ));66 $page->setPageNumber(getFormData('page_number', (getFormData('sort') ? 1 : null))); 67 67 68 68 // Query parameters to retain always. … … 94 94 switch (getFormData('op')) { 95 95 96 case 'add' 96 case 'add': 97 97 // Initialize variables for the form template. 98 $frm = &addRecordForm();98 $frm = addRecordForm(); 99 99 $nav->add(_("Add %ITEM_TITLE%")); 100 100 $main_template = '%ADMIN_FORM_TEMPLATE%'; 101 101 break; 102 102 103 case 'edit' 103 case 'edit': 104 104 // Initialize variables for the form template. 105 $frm = &editRecordForm(getFormData('%PRIMARY_KEY%'));105 $frm = editRecordForm(getFormData('%PRIMARY_KEY%')); 106 106 $nav->add(_("Edit %ITEM_TITLE%")); 107 107 $main_template = '%ADMIN_FORM_TEMPLATE%'; 108 108 break; 109 109 110 case 'del' 110 case 'del': 111 111 deleteRecord(getFormData('%PRIMARY_KEY%'));%ADMIN_UPLOAD_DEL% 112 112 if ($app->validBoomerangURL('%NAME_PLURAL%')) { … … 118 118 break; 119 119 120 case 'insert' 120 case 'insert': 121 121 if (getFormdata('cancel', false)) { 122 122 if ($app->validBoomerangURL('%NAME_PLURAL%')) { … … 129 129 validateInput(); 130 130 if ($fv->anyErrors()) { 131 $frm = &addRecordForm();131 $frm = addRecordForm(); 132 132 $frm = array_merge($frm, getFormData()); 133 133 $nav->add(_("Add %ITEM_TITLE%")); … … 147 147 break; 148 148 149 case 'update' 149 case 'update': 150 150 if (getFormdata('reset', false)) { 151 151 $app->raiseMsg(_("Saved values have been reloaded."), MSG_NOTICE, __FILE__, __LINE__); … … 165 165 validateInput(); 166 166 if ($fv->anyErrors()) { 167 $frm = &editRecordForm(getFormData('%PRIMARY_KEY%'));167 $frm = editRecordForm(getFormData('%PRIMARY_KEY%')); 168 168 $frm = array_merge($frm, getFormData()); 169 169 $nav->add(_("Edit %ITEM_TITLE%")); … … 216 216 %FORM_VALIDATION% 217 217 218 function &addRecordForm()218 function addRecordForm() 219 219 { 220 220 // Set default values for the reset of the fields. … … 232 232 } 233 233 234 function &editRecordForm($id)234 function editRecordForm($id) 235 235 { 236 236 global $lock, $locally_carried_queries;
Note: See TracChangeset
for help on using the changeset viewer.