- Timestamp:
- Jun 8, 2006 5:36:10 AM (18 years ago)
- Location:
- trunk/bin/module_maker
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/form_template.cli.php
r136 r154 34 34 35 35 $exclude = array('added_by_user_id', 'added_datetime', 'hit_count', 'modified_datetime', 'modified_by_user_id'); 36 $primary_key = ' <##>';36 $primary_key = '__///__'; 37 37 $output = array(); 38 38 … … 64 64 65 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>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>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> 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 70 <\x3fphp } \x3f> 71 71 E_O_F; … … 80 80 <input type="file" name="$field" id="$field" /> 81 81 <\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>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> 83 83 <\x3fphp } \x3f> 84 84 <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> -
trunk/bin/module_maker/list_template.cli.php
r151 r154 46 46 } 47 47 48 $primary_key = ' <##>';48 $primary_key = '__///__'; 49 49 50 50 // Loop through columns … … 111 111 <form action="<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>" method="get"> 112 112 <\x3fphp \$app->printHiddenSession(false); \x3f> 113 <span class="sc-nowrap commandtext"><a href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . '?op=add'); \x3f>"><\x3fphp echo _("Add <##>"); \x3f></a></span>113 <span class="sc-nowrap commandtext"><a href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . '?op=add'); \x3f>"><\x3fphp echo _("Add __///__"); \x3f></a></span> 114 114 <br /> 115 115 116 <input type="text" class="sc-small" size="20" name="search_query" value="<\x3fphp echo getFormData('search_query'); \x3f>" title="<\x3fphp echo oTxt(_("Fields searched: <##>.")); \x3f>" />117 <select name="filter_ <##>">118 <\x3fphp // printSelectForm(' <##>_tbl', "CONCAT(<##>_id, '—', city, '—', title)", '<##>_id', getFormData('filter_<##>'), array('Any <##>'), 'ORDER BY <##>ASC'); \x3f>116 <input type="text" class="sc-small" size="20" name="search_query" value="<\x3fphp echo getFormData('search_query'); \x3f>" title="<\x3fphp echo oTxt(_("Fields searched: __///__.")); \x3f>" /> 117 <select name="filter___///__"> 118 <\x3fphp // printSelectForm('__///___tbl', "CONCAT(__///___id, '—', city, '—', title)", '__///___id', getFormData('filter___///__'), array('Any __///__'), 'ORDER BY __///__ ASC'); \x3f> 119 119 </select> 120 120 <input type="submit" name="list" value="<\x3fphp echo _("Search"); \x3f>" /> … … 149 149 <\x3fphp for (\$i = 0; \$i <= \$page->last_item - \$page->first_item && \$page->total_items > 0; \$i++) { \x3f> 150 150 <tr> 151 <td class="sc-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="sc-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 <td class="sc-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="sc-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> 153 153 154 154 E_O_F; … … 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
r151 r154 223 223 if ($upload_file_capability) { 224 224 // Form arguments 225 $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=\" <##>\" />";225 $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=\"__///__\" />"; 226 226 227 227 // Include statement. … … 234 234 \$upload = new Upload(); 235 235 \$upload->setParam(array( 236 'upload_path' => COMMON_BASE . '/html/_db_files/ <##>',236 'upload_path' => COMMON_BASE . '/html/_db_files/__///__', 237 237 'dest_file_perms' => 0666, 238 238 'allow_overwriting' => false, … … 246 246 247 247 // Copy uploaded image name into form data. 248 \$_POST[' <##>'] = isset(\$_FILES['<##>']) ? \$_FILES['<##>']['name'] : '';248 \$_POST['__///__'] = isset(\$_FILES['__///__']) ? \$_FILES['__///__']['name'] : ''; 249 249 250 250 … … 264 264 265 265 // Upload files with prepended primary key. 266 \$new_file = \$upload->process(' <##>', \$%PRIMARY_KEY% . '_' . getFormData('<##>'));266 \$new_file = \$upload->process('__///__', \$%PRIMARY_KEY% . '_' . getFormData('__///__')); 267 267 268 268 // If file upload errors, redirect to edit operation for the inserted record. … … 276 276 277 277 // Upload new files. 278 if (getFormData(' <##>')) {278 if (getFormData('__///__')) { 279 279 // Get old file names for deletion. 280 280 \$old_file = \$upload->getFilenameGlob(getFormData('%PRIMARY_KEY%') . '_*'); 281 281 // Process new file upload with prepended primary key. 282 \$new_file = \$upload->process(' <##>', getFormData('%PRIMARY_KEY%') . '_' . getFormData('<##>'));282 \$new_file = \$upload->process('__///__', getFormData('%PRIMARY_KEY%') . '_' . getFormData('__///__')); 283 283 if (false === \$new_file || \$upload->anyErrors()) { 284 284 // Upload failed. Reload form. Display errors. -
trunk/bin/module_maker/skel/adm_list.ihtml
r136 r154 8 8 <br /> 9 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'); ?>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 13 </select> 14 14 <input type="submit" value="<?php echo _("Search"); ?>" /> … … 28 28 <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?> 29 29 <tr> 30 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i][' <##>'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> </td>31 <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>30 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['__///__'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> </td> 31 <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 32 %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>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> 34 34 </tr> 35 35 <?php } ?> -
trunk/bin/module_maker/skel/admin.php
r153 r154 50 50 // Search limiters retain their values between page requests. 51 51 $app->carryQuery('search_query'); 52 $app->carryQuery('filter_ <##>');52 $app->carryQuery('filter___///__'); 53 53 %ADMIN_UPLOAD_CONFIG% 54 54 /******************************************************************** … … 235 235 236 236 // Lock this record. 237 $lock->set('%DB_TBL%', '%PRIMARY_KEY%', $id, $frm[' <##>']);237 $lock->set('%DB_TBL%', '%PRIMARY_KEY%', $id, $frm['__///__']); 238 238 239 239 // Set misc values for the form. … … 268 268 // Get the information for this object. 269 269 $qid = $db->query(" 270 SELECT <##>270 SELECT __///__ 271 271 FROM %DB_TBL% 272 272 WHERE %PRIMARY_KEY% = '" . $db->escapeString($id) . "' … … 301 301 // Create version. 302 302 $version = Version::getInstance($GLOBALS['auth']); 303 $version->create('%DB_TBL%', '%PRIMARY_KEY%', $last_insert_id, $frm[' <##>']);304 305 $app->raiseMsg(sprintf(_("The %ITEM_TITLE% <em>%s</em> has been added."), $frm[' <##>']), MSG_SUCCESS, __FILE__, __LINE__);303 $version->create('%DB_TBL%', '%PRIMARY_KEY%', $last_insert_id, $frm['__///__']); 304 305 $app->raiseMsg(sprintf(_("The %ITEM_TITLE% <em>%s</em> has been added."), $frm['__///__']), MSG_SUCCESS, __FILE__, __LINE__); 306 306 307 307 return $last_insert_id; … … 326 326 // Create version. 327 327 $version = Version::getInstance($GLOBALS['auth']); 328 $version->create('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%'], $frm[' <##>']);329 330 $app->raiseMsg(sprintf(_("The %ITEM_TITLE% <em>%s</em> has been updated."), $frm[' <##>']), MSG_SUCCESS, __FILE__, __LINE__);328 $version->create('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%'], $frm['__///__']); 329 330 $app->raiseMsg(sprintf(_("The %ITEM_TITLE% <em>%s</em> has been updated."), $frm['__///__']), MSG_SUCCESS, __FILE__, __LINE__); 331 331 332 332 // Unlock record. … … 352 352 } 353 353 354 if (getFormData('filter_ <##>', false)) {354 if (getFormData('filter___///__', false)) { 355 355 // Limit by filter. 356 $where_clause .= (empty($where_clause) ? 'WHERE' : 'AND') . " <##> = '" . $db->escapeString(getFormData('filter_<##>')) . "'";356 $where_clause .= (empty($where_clause) ? 'WHERE' : 'AND') . " __///__ = '" . $db->escapeString(getFormData('filter___///__')) . "'"; 357 357 } 358 358 -
trunk/bin/module_maker/skel/public.ihtml
r136 r154 1 1 <p><?php echo nl2br(fancyTxt(oTxt($item['content'], true))); ?></p> 2 <p><em><?php echo sprintf(_("Published %s"), date($app->getParam('date_format'), strtotime($item[' <##>']))); ?></em></p>2 <p><em><?php echo sprintf(_("Published %s"), date($app->getParam('date_format'), strtotime($item['__///__']))); ?></em></p> 3 3 4 4 <!-- -
trunk/bin/module_maker/skel/public.php
r143 r154 38 38 WHERE %PRIMARY_KEY% = '" . $db->escapeString(getFormData('%PRIMARY_KEY%')) . "' 39 39 AND publish = 'true' 40 <##>AND (publish_date <= CURDATE() OR publish_date = '0000-00-00')41 <##>AND (expire_date > CURDATE() OR expire_date = '0000-00-00')40 __///__AND (publish_date <= CURDATE() OR publish_date = '0000-00-00') 41 __///__AND (expire_date > CURDATE() OR expire_date = '0000-00-00') 42 42 "); 43 43 if (!$item = mysql_fetch_assoc($qid)) { … … 54 54 55 55 // Set title and main template. 56 $nav->addPage($item[' <##>']);56 $nav->addPage($item['__///__']); 57 57 $main_template = '%PUBLIC_DETAIL_TEMPLATE%'; 58 58 -
trunk/bin/module_maker/skel/public_list.ihtml
r136 r154 10 10 <?php } ?> 11 11 <p> 12 <em><?php echo date($app->getParam('date_format'), strtotime($%NAME_SINGULAR%_list[$i][' <##>'])); ?></em> — <?php echo nl2br(fancyTxt(oTxt($%NAME_SINGULAR%_list[$i]['summary'], true))); ?>12 <em><?php echo date($app->getParam('date_format'), strtotime($%NAME_SINGULAR%_list[$i]['__///__'])); ?></em> — <?php echo nl2br(fancyTxt(oTxt($%NAME_SINGULAR%_list[$i]['summary'], true))); ?> 13 13 14 14 <?php if (strlen(trim($%NAME_SINGULAR%_list[$i]['content'])) > 0) { // Link only if content is available. ?> -
trunk/bin/module_maker/sql.cli.php
r151 r154 52 52 53 53 $sort_columns = ''; 54 $primary_key = ' <##>';54 $primary_key = '__///__'; 55 55 56 56 // Loop through columns
Note: See TracChangeset
for help on using the changeset viewer.