Changeset 51 for trunk/bin


Ignore:
Timestamp:
Jan 9, 2006 11:22:24 AM (18 years ago)
Author:
scdev
Message:

${1}

Location:
trunk/bin/module_maker
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/module_maker/form_template.cli.php

    r50 r51  
    6262        if (preg_match('/.*_id$/i', $field)) {
    6363            $output[$field] = <<<E_O_F
    64     <tr>
    65         <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    66         <td>
    67             <select name="$field" class="small">
    68             <\x3fphp printSelectForm('<##>_tbl', "CONCAT(<##>_id, '&mdash;', <##>)", '$field', \$frm['$field'], true, 'ORDER BY $field ASC'); \x3f>
    69             </select>
    70             <span class="commandtext">
    71                 <span class="commanditem"><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>
    72                 <\x3fphp if ('' != \$frm['<##>_id']) { \x3f>
    73                     <span class="commanditem"><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>
    74                 <\x3fphp } \x3f>
    75             </span>
    76         </td>
    77     </tr>
     64
     65<label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label>
     66<select name="$field" id="$field" class="small"><\x3fphp printSelectForm('<##>_tbl', "CONCAT(<##>_id, '&mdash;', <##>)", '$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>
     68    <\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    <\x3fphp } \x3f>
    7871E_O_F;
    7972            continue;
     
    8376        if (preg_match('/file|image/i', $field)) {
    8477            $output[$field] = <<<E_O_F
    85     <tr>
    86         <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    87         <td>
    88             <input type="file" name="$field" />
    89             <\x3fphp if ('' != \$upload->getFilenameGlob(getFormData('$primary_key') . '_*') && getFormData('op') == 'edit' || getFormData('op') == 'update') { \x3f>
    90             <div class="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>
    91             <\x3fphp } \x3f>
    92             <div class="help"><\x3fphp printf(_("File to upload must have one of the following file-name extensions: %s."), join(', ', \$upload->getParam('valid_file_extensions'))) \x3f></div>
    93         </td>
    94     </tr>
     78
     79<label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label>
     80<input type="file" name="$field" id="$field" />
     81    <\x3fphp if ('' != \$upload->getFilenameGlob(getFormData('$primary_key') . '_*') && getFormData('op') == 'edit' || getFormData('op') == 'update') { \x3f>
     82    <div class="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    <\x3fphp } \x3f>
     84    <div class="help"><\x3fphp printf(_("File to upload must have one of the following file-name extensions: %s."), join(', ', \$upload->getParam('valid_file_extensions'))) \x3f></div>
    9585E_O_F;
    9686            continue;
     
    10090        if (preg_match('/pass/i', $field)) {
    10191            $output[$field] = <<<E_O_F
    102     <tr>
    103         <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    104         <td>
    105             <input type="password" class="medium" size="50" name="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
    106         </td>
    107     </tr>
     92
     93<label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label>
     94<input type="password" class="medium" size="50" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
    10895E_O_F;
    10996            continue;
     
    115102        case 'enum' :
    116103            $output[$field] = <<<E_O_F
    117     <tr>
    118         <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    119         <td>
    120             <select name="$field">
    121             <\x3fphp printSetSelectForm('$db_tbl', '$field', \$frm['$field'], true); \x3f>
    122             </select>
    123         </td>
    124     </tr>
     104
     105<label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label>
     106<select name="$field" id="$field"><\x3fphp printSetSelectForm('$db_tbl', '$field', \$frm['$field'], true); \x3f></select>
    125107E_O_F;
    126108            break;
     
    129111        case 'set' :
    130112            $output[$field] = <<<E_O_F
    131     <tr>
    132         <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    133         <td>
    134             <\x3fphp printSetCheckboxes('$db_tbl', '$field', \$frm['$field'], 1) \x3f>
    135         </td>
    136     </tr>
     113
     114<label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label>
     115<\x3fphp printSetCheckboxes('$db_tbl', '$field', \$frm['$field'], 1) \x3f>
    137116E_O_F;
    138117            break;
     
    141120        case 'toggle' :
    142121            $output[$field] = <<<E_O_F
    143     <tr>
    144         <td>&nbsp;</td>
    145         <td>
    146             <input type="checkbox" name="$field" <\x3fphp frmChecked(!empty(\$frm['$field'])) \x3f> /><label><\x3fphp echo _("$title"); \x3f></label>
    147         </td>
    148     </tr>
    149 E_O_F;
    150             break;
    151 
    152         // Textarea
    153         case 'tinytext' :
     122
     123<label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \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>
     125E_O_F;
     126            break;
     127
     128        // Textarea small
    154129        case 'text' :
     130        case 'tinyblob' :
     131        case 'blob' :
     132            $output[$field] = <<<E_O_F
     133
     134<label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label>
     135<textarea class="large short" cols="75" rows="4" name="$field" id="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
     136E_O_F;
     137            break;
     138
     139        // Textarea big
    155140        case 'mediumtext' :
    156141        case 'longtext' :
    157         case 'tinyblob' :
    158         case 'blob' :
    159142        case 'mediumblob' :
    160143        case 'longblob' :
    161144            $output[$field] = <<<E_O_F
    162     <tr>
    163         <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    164         <td>
    165             <textarea class="large" cols="75" rows="4" name="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
    166         </td>
    167     </tr>
    168 E_O_F;
    169             break;
    170 
    171 
    172         // Text
     145
     146<label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label>
     147<textarea class="large tall" cols="75" rows="4" name="$field" id="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
     148E_O_F;
     149            break;
     150
     151        // Number
    173152        case 'tinyint' :
    174153        case 'bit' :
     
    188167        case 'dec' :
    189168        case 'numeric' :
    190 
     169        default :
     170            $output[$field] = <<<E_O_F
     171
     172<label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label>
     173<input type="text" class="tiny" size="12" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     174E_O_F;
     175            break;
     176
     177        // Date
    191178        case 'date' :
    192179        case 'datetime' :
     
    194181        case 'time' :
    195182        case 'year' :
    196 
     183        default :
     184            $output[$field] = <<<E_O_F
     185
     186<label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label>
     187<input type="text" class="medium" size="25" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     188E_O_F;
     189            break;
     190
     191        // Text
    197192        case 'char' :
    198193        case 'varchar' :
     194        case 'tinytext' :
     195        case 'tinyblob' :
    199196        default :
    200197            $output[$field] = <<<E_O_F
    201     <tr>
    202         <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    203         <td>
    204             <input type="text" class="medium" size="50" name="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
    205         </td>
    206     </tr>
     198
     199<label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label>
     200<input type="text" class="medium" size="50" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
    207201E_O_F;
    208202            break;
  • trunk/bin/module_maker/list_template.cli.php

    r50 r51  
    107107
    108108<\x3fphp \$fv->printErrorMessages(); \x3f>
    109 <form action="<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>" method="post">
    110 <\x3fphp App::printHiddenSession(false); \x3f>
    111109
    112110<div id="commandbox">
     111<form action="<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>" method="get">
     112<\x3fphp App::printHiddenSession(false); \x3f>
    113113    <span class="nowrap commandtext"><a href="<\x3fphp echo App::oHREF(\$_SERVER['PHP_SELF'] . '?op=add'); \x3f>"><\x3fphp echo _("Add <##>"); \x3f></a></span>
    114114    <br />
     
    119119    </select>
    120120    <input type="submit" name="list" value="<\x3fphp echo _("Search"); \x3f>" />
     121</form>
    121122</div>
    122123
    123124<?php include 'list_info.ihtml'; \x3f>
    124125
     126<form action="<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>" method="post">
    125127<table class="list">
    126128    <tr>
     
    147149    <\x3fphp for (\$i = 0; \$i <= \$page->last_item - \$page->first_item && \$page->total_items > 0; \$i++) { \x3f>
    148150    <tr>
    149         <td class="nowrap"><a title="<\x3fphp printf(_("Edit %s"), oTxt(\$list[\$i]['______RECORD_NAME______'])) \x3f>" href="<\x3fphp echo App::oHREF(\$_SERVER['PHP_SELF'] . '?op=edit&$primary_key=' . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> &nbsp;</td>
    150         <td class="nowrap"><a title="<\x3fphp printf(_("Versions of %s"), oTxt(\$list[\$i]['______RECORD_NAME______'])) \x3f>" href="<\x3fphp echo App::oHREF("/admin/versions.php?record_table=$db_tbl&record_key=$primary_key&boomerang=true&record_val=" . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> &nbsp;</td>
     151        <td class="nowrap"><a title="<\x3fphp printf(_("Edit %s"), oTxt(\$list[\$i]['<##>'])) \x3f>" href="<\x3fphp echo App::oHREF(\$_SERVER['PHP_SELF'] . '?op=edit&$primary_key=' . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> &nbsp;</td>
     152        <td class="nowrap"><a title="<\x3fphp printf(_("Versions of %s"), oTxt(\$list[\$i]['<##>'])) \x3f>" href="<\x3fphp echo App::oHREF("/admin/versions.php?record_table=$db_tbl&record_key=$primary_key&boomerang=true&record_val=" . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> &nbsp;</td>
    151153
    152154E_O_F;
     
    162164
    163165echo isset($op) ? '' : <<<E_O_F
    164         <td class="nowrap" align="right"><a title="<\x3fphp printf(_("Delete %s"), oTxt(\$list[\$i]['______RECORD_NAME______'])) \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]['______RECORD_NAME______'])) \x3f>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> &nbsp;</td>
     166        <td class="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> &nbsp;</td>
    165167    </tr>
    166168    <\x3fphp } \x3f>
  • trunk/bin/module_maker/module.cli.php

    r50 r51  
    205205
    206206$search['admin_form_tag_init'] = '/%ADMIN_FORM_TAG_INIT%/';
    207 $replace['admin_form_tag_init'] = "<form method=\"post\" action=\"<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>\">";
     207$replace['admin_form_tag_init'] = '<form method="post" action="<\x3fphp echo \$_SERVER[\'PHP_SELF\']; \x3f>" class="sc-form">';
    208208$search['admin_upload_include'] = '/%ADMIN_UPLOAD_INCLUDE%/';
    209209$replace['admin_upload_include'] = '';
     
    221221if ($upload_file_capability) {
    222222    // Form arguments
    223     $replace['admin_form_tag_init'] = "<form enctype=\"multipart/form-data\" method=\"post\" action=\"<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>\">\n<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"<##>\" />";
     223    $replace['admin_form_tag_init'] = "<form enctype=\"multipart/form-data\" method=\"post\" action=\"<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>\" class=\"sc-form\">\n<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"<##>\" />";
    224224
    225225    // Include statement.
  • trunk/bin/module_maker/skel/adm_form.ihtml

    r50 r51  
    66<input type="hidden" name="%PRIMARY_KEY%" value="<?php echo $frm['%PRIMARY_KEY%']; ?>" />
    77
    8 <table>
    9     <tr>
    10         <td>&nbsp;</td>
    11         <td><?php printSubmitButtons($frm['submit_buttons']); ?></td>
    12     </tr>
     8<?php printSubmitButtons($frm['submit_buttons']); ?>
     9
    1310%ADM_FORM_TABLE_ROWS%
    14     <tr>
    15         <td>&nbsp;</td>
    16         <td><?php printSubmitButtons($frm['submit_buttons']); ?></td>
    17     </tr>
    18 </table>
     11
     12<?php printSubmitButtons($frm['submit_buttons']); ?>
    1913</form>
  • trunk/bin/module_maker/skel/adm_list.ihtml

    r50 r51  
    11
    22<?php $fv->printErrorMessages(); ?>
     3
     4<div id="commandbox">
    35<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
    46<?php App::printHiddenSession(false); ?>
    5 
    6 <div id="commandbox">
    77    <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span>
    88    <br />
     
    1313    </select>
    1414    <input type="submit" value="<?php echo _("Search"); ?>" />
     15</form>
    1516</div>
    16 </form>
    1717
    1818<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Note: See TracChangeset for help on using the changeset viewer.