Changeset 408
- Timestamp:
- Aug 30, 2012 5:52:29 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/skel/admin.php
r405 r408 67 67 $page->setPageNumber(getFormData('page_number')); 68 68 69 // Search limiters retain their values between page requests. 70 $app->carryQuery('search_query'); 71 $app->carryQuery('filter___///__'); 69 // Query parameters to retain always. 70 $app->carryQuery(array( 71 'filter___///__', 72 )); 73 74 // Query parameters to retain only locally. 75 $locally_carried_queries = array( 76 'search_query', 77 ); 72 78 %ADMIN_UPLOAD_CONFIG% 73 79 /******************************************************************** … … 107 113 if ($app->validBoomerangURL('%NAME_PLURAL%')) { 108 114 // Display boomerang page. 109 $app->dieBoomerangURL('%NAME_PLURAL%' );115 $app->dieBoomerangURL('%NAME_PLURAL%', $locally_carried_queries); 110 116 } 111 117 // Display default page. 112 $app->dieURL($_SERVER['PHP_SELF'] );118 $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries); 113 119 break; 114 120 … … 117 123 if ($app->validBoomerangURL('%NAME_PLURAL%')) { 118 124 // Display boomerang page. 119 $app->dieBoomerangURL('%NAME_PLURAL%' );125 $app->dieBoomerangURL('%NAME_PLURAL%', $locally_carried_queries); 120 126 } 121 127 // Display default page. 122 $app->dieURL($_SERVER['PHP_SELF'] );128 $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries); 123 129 } 124 130 validateInput(); … … 132 138 if (getFormdata('repeat', false)) { 133 139 // Display function again. 134 $app->dieURL($_SERVER['PHP_SELF'] . '?op=add' );140 $app->dieURL($_SERVER['PHP_SELF'] . '?op=add', $locally_carried_queries); 135 141 } else if ($app->validBoomerangURL('%NAME_PLURAL%')) { 136 142 // Display boomerang page. 137 $app->dieBoomerangURL('%NAME_PLURAL%' );143 $app->dieBoomerangURL('%NAME_PLURAL%', $locally_carried_queries); 138 144 } 139 145 // Display default page. 140 $app->dieURL($_SERVER['PHP_SELF'] );146 $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries); 141 147 } 142 148 break; … … 145 151 if (getFormdata('reset', false)) { 146 152 $app->raiseMsg(_("Saved values have been reloaded."), MSG_NOTICE, __FILE__, __LINE__); 147 $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . getFormData('%PRIMARY_KEY%') );153 $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . getFormData('%PRIMARY_KEY%'), $locally_carried_queries); 148 154 } 149 155 if (getFormdata('cancel', false)) { … … 153 159 if ($app->validBoomerangURL('%NAME_PLURAL%')) { 154 160 // Display boomerang page. 155 $app->dieBoomerangURL('%NAME_PLURAL%' );161 $app->dieBoomerangURL('%NAME_PLURAL%', $locally_carried_queries); 156 162 } 157 163 // Display default page. 158 $app->dieURL($_SERVER['PHP_SELF'] );164 $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries); 159 165 } 160 166 validateInput(); … … 170 176 $qid = $db->query("SELECT %PRIMARY_KEY% FROM %DB_TBL% WHERE %PRIMARY_KEY% > '" . $db->escapeString(getFormData('%PRIMARY_KEY%')) . "' ORDER BY %PRIMARY_KEY% ASC LIMIT 1"); 171 177 if (list($next_id) = mysql_fetch_row($qid)) { 172 $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $next_id );178 $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $next_id, $locally_carried_queries); 173 179 } else { 174 180 $app->raiseMsg(_("Cannot edit next, the end of the list was reached"), MSG_NOTICE, __FILE__, __LINE__); … … 176 182 } else if ($app->validBoomerangURL('%NAME_PLURAL%')) { 177 183 // Display boomerang page. 178 $app->dieBoomerangURL('%NAME_PLURAL%' );184 $app->dieBoomerangURL('%NAME_PLURAL%', $locally_carried_queries); 179 185 } 180 186 // Display default page. 181 $app->dieURL($_SERVER['PHP_SELF'] );187 $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries); 182 188 } 183 189 break; … … 185 191 case _("Save rank") : 186 192 updateRank(getFormData('rank')); 187 $app->dieURL($_SERVER['PHP_SELF'] );193 $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries); 188 194 break; 189 195 … … 199 205 200 206 include 'header.ihtml'; 207 $app->carryQuery($locally_carried_queries); 201 208 include $main_template; 202 209 include 'footer.ihtml'; … … 244 251 $app->logMsg('Could not find record with %PRIMARY_KEY%: ' . $id, LOG_WARNING, __FILE__, __LINE__); 245 252 $app->raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__); 246 $app->dieBoomerangURL( );253 $app->dieBoomerangURL('%NAME_PLURAL%', $locally_carried_queries); 247 254 } 248 255 … … 289 296 $app->logMsg('Could not find record with %PRIMARY_KEY%: ' . $id, LOG_WARNING, __FILE__, __LINE__); 290 297 $app->raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__); 291 $app->dieBoomerangURL( );298 $app->dieBoomerangURL('%NAME_PLURAL%', $locally_carried_queries); 292 299 } 293 300 -
trunk/services/admins.php
r405 r408 81 81 $page->setPageNumber(getFormData('page_number')); 82 82 83 // Search limiters retain their values between page requests. 84 $app->carryQuery('search_query'); 85 83 // Query parameters to retain only locally. 84 $locally_carried_queries = array( 85 'search_query', 86 ); 86 87 87 88 /******************************************************************** … … 121 122 if ($app->validBoomerangURL('admins')) { 122 123 // Display boomerang page. 123 $app->dieBoomerangURL('admins' );124 $app->dieBoomerangURL('admins', $locally_carried_queries); 124 125 } 125 126 // Display default page. 126 $app->dieURL($_SERVER['PHP_SELF'] );127 $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries); 127 128 break; 128 129 … … 131 132 if ($app->validBoomerangURL('admins')) { 132 133 // Display boomerang page. 133 $app->dieBoomerangURL('admins' );134 $app->dieBoomerangURL('admins', $locally_carried_queries); 134 135 } 135 136 // Display default page. 136 $app->dieURL($_SERVER['PHP_SELF'] );137 $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries); 137 138 } 138 139 validateInput(); … … 146 147 if (getFormdata('repeat', false)) { 147 148 // Display function again. 148 $app->dieURL($_SERVER['PHP_SELF'] . '?op=add' );149 $app->dieURL($_SERVER['PHP_SELF'] . '?op=add', $locally_carried_queries); 149 150 } else if ($app->validBoomerangURL('admins')) { 150 151 // Display boomerang page. 151 $app->dieBoomerangURL('admins' );152 $app->dieBoomerangURL('admins', $locally_carried_queries); 152 153 } 153 154 // Display default page. 154 $app->dieURL($_SERVER['PHP_SELF'] );155 $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries); 155 156 } 156 157 break; … … 159 160 if (getFormdata('reset', false)) { 160 161 $app->raiseMsg(_("Saved values have been reloaded."), MSG_NOTICE, __FILE__, __LINE__); 161 $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . getFormData('admin_id') );162 $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . getFormData('admin_id'), $locally_carried_queries); 162 163 } 163 164 if (getFormdata('cancel', false)) { … … 167 168 if ($app->validBoomerangURL('admins')) { 168 169 // Display boomerang page. 169 $app->dieBoomerangURL('admins' );170 $app->dieBoomerangURL('admins', $locally_carried_queries); 170 171 } 171 172 // Display default page. 172 $app->dieURL($_SERVER['PHP_SELF'] );173 $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries); 173 174 } 174 175 validateInput(); … … 184 185 $qid = $db->query("SELECT " . $auth->getParam('db_primary_key') . " FROM " . $auth->getParam('db_table') . " WHERE " . $auth->getParam('db_primary_key') . " > '" . $db->escapeString(getFormData('admin_id')) . "' ORDER BY " . $auth->getParam('db_primary_key') . " ASC LIMIT 1"); 185 186 if (list($next_id) = mysql_fetch_row($qid)) { 186 $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $next_id );187 $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $next_id, $locally_carried_queries); 187 188 } else { 188 189 $app->raiseMsg(_("Cannot edit next, the end of the list was reached"), MSG_NOTICE, __FILE__, __LINE__); … … 190 191 } else if ($app->validBoomerangURL('admins')) { 191 192 // Display boomerang page. 192 $app->dieBoomerangURL('admins' );193 $app->dieBoomerangURL('admins', $locally_carried_queries); 193 194 } 194 195 // Display default page. 195 $app->dieURL($_SERVER['PHP_SELF'] );196 $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries); 196 197 } 197 198 break; … … 208 209 209 210 include 'header.ihtml'; 211 $app->carryQuery($locally_carried_queries); 210 212 include 'codebase/services/templates/' . $main_template; 211 213 include 'footer.ihtml'; … … 305 307 $app->logMsg('Could not find record with admin_id: ' . $id, LOG_WARNING, __FILE__, __LINE__); 306 308 $app->raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__); 307 $app->dieBoomerangURL( );309 $app->dieBoomerangURL('admins', $locally_carried_queries); 308 310 } 309 311 … … 366 368 $app->logMsg('Could not find record with admin_id: ' . $id, LOG_WARNING, __FILE__, __LINE__); 367 369 $app->raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__); 368 $app->dieBoomerangURL( );370 $app->dieBoomerangURL('admins', $locally_carried_queries); 369 371 } 370 372
Note: See TracChangeset
for help on using the changeset viewer.