Changeset 109 for branches/1.1dev/bin
- Timestamp:
- Apr 26, 2006 11:24:39 PM (18 years ago)
- Location:
- branches/1.1dev/bin/module_maker
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1dev/bin/module_maker/_config.inc.php
r80 r109 9 9 if ($_SERVER['argc'] > 1 && '' != $site_base && is_dir($site_base)) { 10 10 // First arg is path to current site. Realpath removes trailing /s 11 define('COMMON_BASE', $_SERVER['argv'][1]); 11 12 define('SITE_BASE', $site_base); 12 13 } else { -
branches/1.1dev/bin/module_maker/list_template.cli.php
r90 r109 77 77 $listrows[] = "<\x3fphp echo strlen(\$list[\$i]['$field'])<50 \x3f oTxt(\$list[\$i]['$field'], true) : oTxt(trim(substr(\$list[\$i]['$field'], 0, 50)) . '...'); \x3f>"; 78 78 } else if (preg_match('/.*(begin|start).*date.*/i', $field)) { 79 $listrows[] = "<\x3fphp echo '0000-00-00' == \$list[\$i]['$field'] ? '' : date( $CFG->date_format, strtotime(\$list[\$i]['$field'])); \x3f>";79 $listrows[] = "<\x3fphp echo '0000-00-00' == \$list[\$i]['$field'] ? '' : date(\$CFG->date_format, strtotime(\$list[\$i]['$field'])); \x3f>"; 80 80 } else if (preg_match('/.*(end|expire).*date.*/i', $field)) { 81 $listrows[] = "<\x3fphp echo '9999-12-31' == \$list[\$i]['$field'] ? '' : date( $CFG->date_format, strtotime(\$list[\$i]['$field'])); \x3f>";81 $listrows[] = "<\x3fphp echo '9999-12-31' == \$list[\$i]['$field'] ? '' : date(\$CFG->date_format, strtotime(\$list[\$i]['$field'])); \x3f>"; 82 82 } else if (preg_match('/datetime/i', $type)) { 83 $listrows[] = "<\x3fphp echo '0000-00-00 00:00:00' == \$list[\$i]['$field'] ? '' : date( $CFG->date_format, strtotime(\$list[\$i]['$field'])); \x3f>";83 $listrows[] = "<\x3fphp echo '0000-00-00 00:00:00' == \$list[\$i]['$field'] ? '' : date(\$CFG->date_format, strtotime(\$list[\$i]['$field'])); \x3f>"; 84 84 } else if (preg_match('/date/i', $type)) { 85 $listrows[] = "<\x3fphp echo '0000-00-00' == \$list[\$i]['$field'] ? '' : date( $CFG->date_format, strtotime(\$list[\$i]['$field'])); \x3f>";85 $listrows[] = "<\x3fphp echo '0000-00-00' == \$list[\$i]['$field'] ? '' : date(\$CFG->date_format, strtotime(\$list[\$i]['$field'])); \x3f>"; 86 86 } else if (preg_match('/(amount|_rate)/i', $field)) { 87 87 $listrows[] = "<\x3fphp printf('$%01.2f', \$list[\$i]['$field']); \x3f>"; -
branches/1.1dev/bin/module_maker/module.cli.php
r90 r109 258 258 echo "Generating admin form table rows...\n"; 259 259 $output = array(); 260 exec(dirname($_SERVER['argv'][0]) . "/form_template.cli.php $db_tbl", $output, $return_val);260 exec(dirname($_SERVER['argv'][0]) . "/form_template.cli.php " . COMMON_BASE . " $db_tbl", $output, $return_val); 261 261 if ($return_val == 0) { 262 262 $search['adm_form_table_rows'] = '/%ADM_FORM_TABLE_ROWS%/'; … … 268 268 echo "Generating admin list table header rows...\n"; 269 269 $output = array(); 270 exec(dirname($_SERVER['argv'][0]) . "/list_template.cli.php $db_tbl headerrows", $output, $return_val);270 exec(dirname($_SERVER['argv'][0]) . "/list_template.cli.php " . COMMON_BASE . " $db_tbl headerrows", $output, $return_val); 271 271 if ($return_val == 0) { 272 272 $search['adm_list_header_rows'] = '/%ADM_LIST_HEADER_ROWS%/'; … … 278 278 echo "Generating admin list table rows...\n"; 279 279 $output = array(); 280 exec(dirname($_SERVER['argv'][0]) . "/list_template.cli.php $db_tbl listrows", $output, $return_val);280 exec(dirname($_SERVER['argv'][0]) . "/list_template.cli.php " . COMMON_BASE . " $db_tbl listrows", $output, $return_val); 281 281 if ($return_val == 0) { 282 282 $search['adm_list_rows'] = '/%ADM_LIST_ROWS%/'; … … 288 288 echo "Generating sortorder...\n"; 289 289 $output = array(); 290 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php $db_tbl sortorder", $output, $return_val);290 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php " . COMMON_BASE . " $db_tbl sortorder", $output, $return_val); 291 291 if ($return_val == 0) { 292 292 $search['sort_order'] = '/%SORT_ORDER%/'; … … 298 298 echo "Generating insert data...\n"; 299 299 $output = array(); 300 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php $db_tbl insert", $output, $return_val);300 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php " . COMMON_BASE . " $db_tbl insert", $output, $return_val); 301 301 if ($return_val == 0) { 302 302 $search['insert'] = '/%INSERT%/'; … … 308 308 echo "Generating update data...\n"; 309 309 $output = array(); 310 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php $db_tbl update", $output, $return_val);310 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php " . COMMON_BASE . " $db_tbl update", $output, $return_val); 311 311 if ($return_val == 0) { 312 312 $search['update'] = '/%UPDATE%/'; … … 318 318 echo "Generating search data...\n"; 319 319 $output = array(); 320 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php $db_tbl search", $output, $return_val);320 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php " . COMMON_BASE . " $db_tbl search", $output, $return_val); 321 321 if ($return_val == 0) { 322 322 $search['search'] = '/%SEARCH%/'; … … 328 328 echo "Generating form validation data...\n"; 329 329 $output = array(); 330 exec(dirname($_SERVER['argv'][0]) . "/validation.cli.php $db_tbl", $output, $return_val);330 exec(dirname($_SERVER['argv'][0]) . "/validation.cli.php " . COMMON_BASE . " $db_tbl", $output, $return_val); 331 331 if ($return_val == 0) { 332 332 $search['form_validation'] = '/%FORM_VALIDATION%/'; -
branches/1.1dev/bin/module_maker/skel/adm_list.ihtml
r30 r109 1 1 2 2 <?php include 'form_error_header.ihtml'; ?> 3 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">4 <?php printHiddenSession(false); ?>5 3 6 4 <div id="commandbox"> 7 <span class="nowrap commandtext"><a href="<?php echo ohref($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span> 8 <br /> 5 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"> 6 <?php printHiddenSession(false); ?> 7 <span class="nowrap commandtext"><a href="<?php echo ohref($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span> 8 <br /> 9 9 10 <input type="text" class="forminputtext" 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" name="list" value="<?php echo _("Search"); ?>" /> 10 <input type="text" class="forminputtext" 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" name="list" value="<?php echo _("Search"); ?>" /> 15 </form> 15 16 </div> 16 17 17 18 <?php include 'adm_list_info.ihtml'; ?> 18 19 19 <table class="list"> 20 <tr> 21 <th> </th> 22 <th> </th> 23 %ADM_LIST_HEADER_ROWS% 24 <th> </th> 25 </tr> 26 <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?> 27 <tr> 28 <td class="padleft nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" href="<?php echo ohref($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="<?php echo $CFG->admin_url; ?>/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> </td> 29 <td class="padleft nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" href="<?php echo ohref("$CFG->admin_url/record_versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=" . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="<?php echo $CFG->admin_url; ?>/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> </td> 30 %ADM_LIST_ROWS% 31 <td class="padleft nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" href="<?php echo 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]['______RECORD_NAME______'])) ?>')"><img src="<?php echo $CFG->admin_url; ?>/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> </td> 32 </tr> 20 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> 21 <?php printHiddenSession(false); ?> 22 <table class="list"> 23 <tr> 24 <th> </th> 25 <th> </th> 26 %ADM_LIST_HEADER_ROWS% 27 <th> </th> 28 </tr> 29 <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?> 30 <tr> 31 <td class="padleft nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" href="<?php echo ohref($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="<?php echo $CFG->admin_url; ?>/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> </td> 32 <td class="padleft nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" href="<?php echo ohref("$CFG->admin_url/record_versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=" . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="<?php echo $CFG->admin_url; ?>/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> </td> 33 %ADM_LIST_ROWS% 34 <td class="padleft nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" href="<?php echo 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]['______RECORD_NAME______'])) ?>')"><img src="<?php echo $CFG->admin_url; ?>/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> </td> 35 </tr> 36 <?php } ?> 37 </table> 38 39 <?php if ($page->total_pages > 1) { ?> 40 <div class="nowrap commandtext" style="float: right;"><?php echo _("Pages:"); ?> <?php $page->printPageNumbers() ?></div> 33 41 <?php } ?> 34 </table> 35 36 <?php if ($page->total_pages > 1) { ?> 37 <div class="nowrap commandtext" style="float: right;"><?php echo _("Pages:"); ?> <?php $page->printPageNumbers() ?></div> 38 <?php } ?> 39 <?php if ($page->total_items > 0) { ?> 40 <div class="commanditem"><input type="submit" name="op" value="<?php echo _("Save rank"); ?>" /></div> 41 <?php } ?> 42 <?php if ($page->total_items > 0) { ?> 43 <div class="commanditem"><input type="submit" name="op" value="<?php echo _("Save rank"); ?>" /></div> 44 <?php } ?> 42 45 </form>
Note: See TracChangeset
for help on using the changeset viewer.