- Timestamp:
- Jan 9, 2006 11:22:24 AM (18 years ago)
- Location:
- trunk/bin/module_maker
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/form_template.cli.php
r50 r51 62 62 if (preg_match('/.*_id$/i', $field)) { 63 63 $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, '—', <##>)", '$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, '—', <##>)", '$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> 78 71 E_O_F; 79 72 continue; … … 83 76 if (preg_match('/file|image/i', $field)) { 84 77 $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> 95 85 E_O_F; 96 86 continue; … … 100 90 if (preg_match('/pass/i', $field)) { 101 91 $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>" /> 108 95 E_O_F; 109 96 continue; … … 115 102 case 'enum' : 116 103 $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> 125 107 E_O_F; 126 108 break; … … 129 111 case 'set' : 130 112 $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> 137 116 E_O_F; 138 117 break; … … 141 120 case 'toggle' : 142 121 $output[$field] = <<<E_O_F 143 <tr> 144 <td> </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> 125 E_O_F; 126 break; 127 128 // Textarea small 154 129 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> 136 E_O_F; 137 break; 138 139 // Textarea big 155 140 case 'mediumtext' : 156 141 case 'longtext' : 157 case 'tinyblob' :158 case 'blob' :159 142 case 'mediumblob' : 160 143 case 'longblob' : 161 144 $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> 148 E_O_F; 149 break; 150 151 // Number 173 152 case 'tinyint' : 174 153 case 'bit' : … … 188 167 case 'dec' : 189 168 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>" /> 174 E_O_F; 175 break; 176 177 // Date 191 178 case 'date' : 192 179 case 'datetime' : … … 194 181 case 'time' : 195 182 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>" /> 188 E_O_F; 189 break; 190 191 // Text 197 192 case 'char' : 198 193 case 'varchar' : 194 case 'tinytext' : 195 case 'tinyblob' : 199 196 default : 200 197 $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>" /> 207 201 E_O_F; 208 202 break; -
trunk/bin/module_maker/list_template.cli.php
r50 r51 107 107 108 108 <\x3fphp \$fv->printErrorMessages(); \x3f> 109 <form action="<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>" method="post">110 <\x3fphp App::printHiddenSession(false); \x3f>111 109 112 110 <div id="commandbox"> 111 <form action="<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>" method="get"> 112 <\x3fphp App::printHiddenSession(false); \x3f> 113 113 <span class="nowrap commandtext"><a href="<\x3fphp echo App::oHREF(\$_SERVER['PHP_SELF'] . '?op=add'); \x3f>"><\x3fphp echo _("Add <##>"); \x3f></a></span> 114 114 <br /> … … 119 119 </select> 120 120 <input type="submit" name="list" value="<\x3fphp echo _("Search"); \x3f>" /> 121 </form> 121 122 </div> 122 123 123 124 <?php include 'list_info.ihtml'; \x3f> 124 125 126 <form action="<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>" method="post"> 125 127 <table class="list"> 126 128 <tr> … … 147 149 <\x3fphp for (\$i = 0; \$i <= \$page->last_item - \$page->first_item && \$page->total_items > 0; \$i++) { \x3f> 148 150 <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> </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> </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> </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> </td> 151 153 152 154 E_O_F; … … 162 164 163 165 echo 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> </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> </td> 165 167 </tr> 166 168 <\x3fphp } \x3f> -
trunk/bin/module_maker/module.cli.php
r50 r51 205 205 206 206 $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">'; 208 208 $search['admin_upload_include'] = '/%ADMIN_UPLOAD_INCLUDE%/'; 209 209 $replace['admin_upload_include'] = ''; … … 221 221 if ($upload_file_capability) { 222 222 // 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=\"<##>\" />"; 224 224 225 225 // Include statement. -
trunk/bin/module_maker/skel/adm_form.ihtml
r50 r51 6 6 <input type="hidden" name="%PRIMARY_KEY%" value="<?php echo $frm['%PRIMARY_KEY%']; ?>" /> 7 7 8 <table> 9 <tr> 10 <td> </td> 11 <td><?php printSubmitButtons($frm['submit_buttons']); ?></td> 12 </tr> 8 <?php printSubmitButtons($frm['submit_buttons']); ?> 9 13 10 %ADM_FORM_TABLE_ROWS% 14 <tr> 15 <td> </td> 16 <td><?php printSubmitButtons($frm['submit_buttons']); ?></td> 17 </tr> 18 </table> 11 12 <?php printSubmitButtons($frm['submit_buttons']); ?> 19 13 </form> -
trunk/bin/module_maker/skel/adm_list.ihtml
r50 r51 1 1 2 2 <?php $fv->printErrorMessages(); ?> 3 4 <div id="commandbox"> 3 5 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"> 4 6 <?php App::printHiddenSession(false); ?> 5 6 <div id="commandbox">7 7 <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span> 8 8 <br /> … … 13 13 </select> 14 14 <input type="submit" value="<?php echo _("Search"); ?>" /> 15 </form> 15 16 </div> 16 </form>17 17 18 18 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Note: See TracChangeset
for help on using the changeset viewer.