- Timestamp:
- Dec 16, 2007 7:21:57 AM (16 years ago)
- Location:
- trunk/bin/module_maker
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/form_template.cli.php
r270 r295 62 62 if (preg_match('/.*_id$/i', $field)) { 63 63 $output[$field] = <<<E_O_F 64 65 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label> 66 <select name="$field" id="$field" class="sc-small"><\x3fphp printSelectForm('__///___tbl', "CONCAT(__///___id, '—', __///__)", '$field', \$frm['$field'], true, 'ORDER BY $field ASC'); \x3f></select> 67 <span class="commanditem commandtext"><a href="<\x3fphp echo \$app->oHREF('__///__.php?op=add&boomerang=true'); \x3f>" onclick"javascript:return confirm('<\x3fphp echo _("Notice: You are about to leave this form page and any changes you may have made without saving will be lost."); \x3f>')"><\x3fphp echo _("Add __///__") \x3f></a></span> 64 65 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 66 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 67 <select name="$field" id="$field" class="sc-small"><\x3fphp printSelectForm('__///___tbl', "CONCAT(__///___id, '—', __///__)", '$field', \$frm['$field'], true, 'ORDER BY $field ASC'); \x3f></select> 68 <span class="commanditem commandtext"><a href="<\x3fphp echo \$app->oHREF('__///__.php?op=add&boomerang=true'); \x3f>" onclick="javascript:return confirm('<\x3fphp echo _("Notice: You are about to leave this form page and any changes you may have made without saving will be lost."); \x3f>');"><\x3fphp echo _("Add __///__") \x3f></a></span> 68 69 <\x3fphp if ('' != \$frm['__///___id']) { \x3f> 69 <span class="commanditem commandtext"><a href="<\x3fphp echo \$app->oHREF('__///__.php?op=edit&boomerang=true&__///___id=' . \$frm['__///___id']); \x3f>" onclick"javascript:return confirm('<\x3fphp echo _("Notice: You are about to leave this form page and any changes you may have made without saving will be lost."); \x3f>')"><\x3fphp echo sprintf(_("Edit __///__ <em>%s</em>"), \$frm['__///__']) \x3f></a></span>70 <span class="commanditem commandtext"><a href="<\x3fphp echo \$app->oHREF('__///__.php?op=edit&boomerang=true&__///___id=' . \$frm['__///___id']); \x3f>" onclick="javascript:return confirm('<\x3fphp echo _("Notice: You are about to leave this form page and any changes you may have made without saving will be lost."); \x3f>');"><\x3fphp echo sprintf(_("Edit __///__ <em>%s</em>"), \$frm['__///__']) \x3f></a></span> 70 71 <\x3fphp } \x3f> 72 </div> 71 73 E_O_F; 72 74 continue; … … 77 79 $output[$field] = <<<E_O_F 78 80 79 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label> 80 <input type="file" name="$field" id="$field" /> 81 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 82 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 83 <input type="file" name="$field" id="$field" /> 81 84 <\x3fphp if ('' != \$upload->getFilenameGlob(getFormData('$primary_key') . '_*') && getFormData('op') == 'edit' || getFormData('op') == 'update') { \x3f> 82 <div class="sc-help"><\x3fphp printf(_("The current file <a href=\"%s/%2\\\$s\"><strong>%2\\\$s</strong></a> will be deleted if a new file is selected for upload."), '/_db_files/__///__', \$upload->getFilenameGlob(getFormData('$primary_key') . '_*')) \x3f></div>85 <div class="sc-help"><\x3fphp printf(_("The current file <a href=\"%s/%2\\\$s\"><strong>%2\\\$s</strong></a> will be deleted if a new file is selected for upload."), '/_db_files/__///__', \$upload->getFilenameGlob(getFormData('$primary_key') . '_*')) \x3f></div> 83 86 <\x3fphp } \x3f> 84 87 <div class="sc-help"><\x3fphp printf(_("File to upload must have one of the following file-name extensions: %s."), join(', ', \$upload->getParam('valid_file_extensions'))) \x3f></div> 88 </div> 85 89 E_O_F; 86 90 continue; … … 91 95 $output[$field] = <<<E_O_F 92 96 93 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label> 94 <input type="password" class="sc-medium" size="50" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" /> 97 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 98 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 99 <input type="password" name="$field" id="$field" class="sc-medium" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" /> 100 </div> 95 101 E_O_F; 96 102 continue; … … 103 109 $output[$field] = <<<E_O_F 104 110 105 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label> 106 <select name="$field" id="$field"><\x3fphp printSetSelectForm('$db_tbl', '$field', \$frm['$field'], true); \x3f></select> 111 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 112 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 113 <select name="$field" id="$field"><\x3fphp printSetSelectForm('$db_tbl', '$field', \$frm['$field'], true); \x3f></select> 114 </div> 107 115 E_O_F; 108 116 break; … … 112 120 $output[$field] = <<<E_O_F 113 121 114 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label> 115 <\x3fphp printSetCheckboxes('$db_tbl', '$field', \$frm['$field'], 1) \x3f> 122 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 123 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 124 <\x3fphp printSetCheckboxes('$db_tbl', '$field', \$frm['$field'], 1) \x3f> 125 </div> 116 126 E_O_F; 117 127 break; … … 121 131 $output[$field] = <<<E_O_F 122 132 123 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label> 124 <input type="checkbox" name="$field" id="$field" <\x3fphp frmChecked(!empty(\$frm['$field'])) \x3f> /><label class="left"><\x3fphp echo _("Check this box to $title"); \x3f></label> 133 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 134 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 135 <label><input type="checkbox" name="$field" id="$field" <\x3fphp frmChecked(!empty(\$frm['$field'])) \x3f> /><\x3fphp echo _("Check this box to $title"); \x3f></label> 136 </div> 125 137 E_O_F; 126 138 break; … … 132 144 $output[$field] = <<<E_O_F 133 145 134 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label> 135 <textarea class="sc-large sc-short" cols="75" rows="4" name="$field" id="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea> 146 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 147 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 148 <textarea name="$field" id="$field" rows="8" cols="40" class="sc-short sc-medium"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea> 149 </div> 136 150 E_O_F; 137 151 break; … … 144 158 $output[$field] = <<<E_O_F 145 159 146 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label> 147 <textarea class="sc-large sc-tall" cols="75" rows="4" name="$field" id="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea> 160 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 161 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 162 <textarea name="$field" id="$field" rows="8" cols="40" class="sc-short sc-medium"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea> 163 </div> 148 164 E_O_F; 149 165 break; … … 170 186 $output[$field] = <<<E_O_F 171 187 172 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label> 173 <input type="text" class="sc-tiny" size="12" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" /> 188 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 189 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 190 <input type="text" name="$field" id="$field" class="sc-tiny" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" /> 191 </div> 174 192 E_O_F; 175 193 break; … … 184 202 $output[$field] = <<<E_O_F 185 203 186 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label> 187 <input type="text" class="sc-medium" size="25" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" /> 204 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 205 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 206 <input type="text" name="$field" id="$field" class="sc-small" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" /> 207 </div> 188 208 E_O_F; 189 209 break; … … 197 217 $output[$field] = <<<E_O_F 198 218 199 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label> 200 <input type="text" class="sc-medium" size="50" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" /> 219 <div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>"> 220 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 221 <input type="text" name="$field" id="$field" class="sc-medium" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" /> 222 </div> 201 223 E_O_F; 202 224 break; -
trunk/bin/module_maker/list_template.cli.php
r270 r295 90 90 $listrows[] = "<\x3fphp printf('$%01.2f', \$list[\$i]['$field']); \x3f>"; 91 91 } else if (preg_match('/(added_by_user_id)/i', $field)) { 92 $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['added_ admin_username']); \x3f>";92 $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['added_by_username']); \x3f>"; 93 93 } else if (preg_match('/(modified_by_user_id)/i', $field)) { 94 $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['modified_ admin_username']); \x3f>";94 $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['modified_by_username']); \x3f>"; 95 95 } else if ('rank' == $field) { 96 96 $listrows[] = "<input type=\"text\" name=\"rank[<\x3fphp echo \$list[\$i]['$primary_key']; \x3f>]\" value=\"<\x3fphp echo \$list[\$i]['rank']; \x3f>\" size=\"5\" />"; … … 164 164 165 165 echo isset($op) ? '' : <<<E_O_F 166 <td class="sc-nowrap" align="right"><a title="<\x3fphp printf(_("Delete %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . "?op=del&$primary_key=" . \$list[\$i]['$primary_key']); \x3f>" onclick"javascript:return confirm('<\x3fphp printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt(\$list[\$i]['__///__'])) \x3f>') "><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0" /></a> </td>166 <td class="sc-nowrap" align="right"><a title="<\x3fphp printf(_("Delete %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . "?op=del&$primary_key=" . \$list[\$i]['$primary_key']); \x3f>" onclick"javascript:return confirm('<\x3fphp printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt(\$list[\$i]['__///__'])) \x3f>');"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0" /></a> </td> 167 167 </tr> 168 168 <\x3fphp } \x3f> -
trunk/bin/module_maker/module.cli.php
r259 r295 137 137 138 138 // Make sure requested table is in database. 139 if (!isset($tables)) { 140 die(sprintf("%s Warning: %s does not exist in database %s. No DB tables found!", basename($_SERVER['argv'][0]), $db_tbl, $app->getParam('db_name'))); 141 } 139 142 if (!in_array($db_tbl, $tables)) { 140 143 die(sprintf("%s Warning: %s does not exist in database %s. Please select one of: \n\n%s\n\n", basename($_SERVER['argv'][0]), $db_tbl, $app->getParam('db_name'), join("\n", $tables))); … … 207 210 208 211 $search['admin_form_tag_init'] = '/%ADMIN_FORM_TAG_INIT%/'; 209 $replace['admin_form_tag_init'] = '<form method="post" action="<\x3fphp echo \$_SERVER[\'PHP_SELF\']; \x3f>" class="sc-form">';212 $replace['admin_form_tag_init'] = "<form method=\"post\" action=\"<\x3fphp echo oTxt(\$_SERVER['PHP_SELF']); \x3f>\" class=\"sc-form\">"; 210 213 $search['admin_upload_include'] = '/%ADMIN_UPLOAD_INCLUDE%/'; 211 214 $replace['admin_upload_include'] = ''; -
trunk/bin/module_maker/skel/adm_form.ihtml
r136 r295 6 6 <input type="hidden" name="%PRIMARY_KEY%" value="<?php echo $frm['%PRIMARY_KEY%']; ?>" /> 7 7 8 <?php printSubmitButtons($frm['submit_buttons']); ?> 8 <div class="sc-form-row sc-submit-buttons"> 9 <?php printSubmitButtons($frm['submit_buttons']); ?> 10 </div> 9 11 10 12 %ADM_FORM_TABLE_ROWS% 11 13 12 <?php printSubmitButtons($frm['submit_buttons']); ?> 14 <div class="sc-form-row sc-submit-buttons"> 15 <?php printSubmitButtons($frm['submit_buttons']); ?> 16 </div> 13 17 </form> -
trunk/bin/module_maker/skel/adm_list.ihtml
r270 r295 3 3 4 4 <div id="commandbox"> 5 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get">6 <?php $app->printHiddenSession(false); ?>7 5 <span class="sc-nowrap commandtext"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span> 8 < br />9 10 <input type="text" class="sc-small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: __///__ %SEARCH_FIELDS%.")); ?>" />11 <select name="filter___///__">12 <?php // printSelectForm('__///___tbl', "CONCAT(__///___id, '—', city, '—', title)", '__///___id', getFormData('filter___///__'), array('Any __///__'), 'ORDER BY __///__ ASC'); ?>13 </select>14 <input type="submit" value="<?php echo _("Search"); ?>" />15 </form>6 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form"> 7 <?php $app->printHiddenSession(false); ?> 8 <input type="text" class="sc-small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: __///__ %SEARCH_FIELDS%.")); ?>" /> 9 <select name="filter___///__" class="sc-small"> 10 <?php // printSelectForm('__///___tbl', "CONCAT(__///___id, '—', city, '—', title)", '__///___id', getFormData('filter___///__'), array('Any __///__'), 'ORDER BY __///__ ASC'); ?> 11 </select> 12 <input type="submit" value="<?php echo _("Filter"); ?>" /> 13 </form> 16 14 </div> 17 15 … … 31 29 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF('/admin/versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> </td> 32 30 %ADM_LIST_ROWS% 33 <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onclick"javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['__///__'])) ?>') "><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0" /></a> </td>31 <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onclick"javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['__///__'])) ?>');"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0" /></a> </td> 34 32 </tr> 35 33 <?php } ?> -
trunk/bin/module_maker/skel/admin.php
r202 r295 203 203 'new_op' => 'insert', 204 204 'submit_buttons' => array( 205 'submit' => _("Add %ITEM_TITLE%"),206 'repeat' => _("Add & repeat"),207 'cancel' => _("Cancel"),205 array('name' => 'submit', 'value' => _("Add %ITEM_TITLE%"), 'accesskey' => 's'), 206 array('name' => 'repeat', 'value' => _("Add & repeat"), 'accesskey' => 'r'), 207 array('name' => 'cancel', 'value' => _("Cancel"), 'accesskey' => 'c'), 208 208 ), 209 209 ); … … 216 216 global $lock; 217 217 $db =& DB::getInstance(); 218 $app =& App::getInstance(); 218 219 219 220 $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id); … … 242 243 'new_op' => 'update', 243 244 'submit_buttons' => array( 244 'submit' => _("Save changes"),245 'repeat' => _("Save & edit next"),246 'reset' => _("Reset"),247 'cancel' => _("Cancel"),245 array('name' => 'submit', 'value' => _("Save changes"), 'accesskey' => 's'), 246 array('name' => 'repeat', 'value' => _("Save & edit next"), 'accesskey' => 'e'), 247 array('name' => 'reset', 'value' => _("Reset"), 'accesskey' => 'r'), 248 array('name' => 'cancel', 'value' => _("Cancel"), 'accesskey' => 'c'), 248 249 ), 249 250 ), $frm); … … 257 258 global $cache; 258 259 $db =& DB::getInstance(); 260 $app =& App::getInstance(); 259 261 260 262 $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id); … … 292 294 global $cache; 293 295 $db =& DB::getInstance(); 296 $app =& App::getInstance(); 294 297 295 298 // Remove any stale cached list data. … … 313 316 global $lock; 314 317 global $cache; 318 $db =& DB::getInstance(); 315 319 $app =& App::getInstance(); 316 320 … … 342 346 global $cache; 343 347 $db =& DB::getInstance(); 348 $app =& App::getInstance(); 344 349 345 350 $where_clause = ''; … … 374 379 SELECT 375 380 %DB_TBL%.*, 376 a1.username AS added_ admin_username,377 a2.username AS modified_ admin_username381 a1.username AS added_by_username, 382 a2.username AS modified_by_username 378 383 FROM %DB_TBL% 379 LEFT JOIN admin_tbl a1 ON (%DB_TBL%.added_by_user_id = a1.admin_id)380 LEFT JOIN admin_tbl a2 ON (%DB_TBL%.modified_by_user_id = a2.admin_id)384 LEFT JOIN user_tbl a1 ON (%DB_TBL%.added_by_user_id = a1.user_id) 385 LEFT JOIN user_tbl a2 ON (%DB_TBL%.modified_by_user_id = a2.user_id) 381 386 $where_clause 382 387 " . $so->getSortOrderSQL() . " … … 398 403 // First try to return from the cache. 399 404 if ($cache->exists('list')) { 400 return $cache->get('list'); 405 $list = $cache->get('list'); 406 return $list; 401 407 } 402 408 … … 419 425 global $cache; 420 426 $db =& DB::getInstance(); 427 $app =& App::getInstance(); 421 428 422 429 if (!is_array($ranks)) {
Note: See TracChangeset
for help on using the changeset viewer.