Changeset 154 for trunk/bin


Ignore:
Timestamp:
Jun 8, 2006 5:36:10 AM (18 years ago)
Author:
scdev
Message:

${1}

Location:
trunk/bin/module_maker
Files:
9 edited

Legend:

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

    r136 r154  
    3434
    3535$exclude = array('added_by_user_id', 'added_datetime', 'hit_count', 'modified_datetime', 'modified_by_user_id');
    36 $primary_key = '<##>';
     36$primary_key = '__///__';
    3737$output = array();
    3838
     
    6464
    6565<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, '&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>
     66<select name="$field" id="$field" class="sc-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>
    7070    <\x3fphp } \x3f>
    7171E_O_F;
     
    8080<input type="file" name="$field" id="$field" />
    8181    <\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>
    8383    <\x3fphp } \x3f>
    8484    <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  
    4646}
    4747
    48 $primary_key = '<##>';
     48$primary_key = '__///__';
    4949
    5050// Loop through columns
     
    111111<form action="<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>" method="get">
    112112<\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>
    114114    <br />
    115115
    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, '&mdash;', city, '&mdash;', 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, '&mdash;', city, '&mdash;', title)", '__///___id', getFormData('filter___///__'), array('Any __///__'), 'ORDER BY __///__ ASC'); \x3f>
    119119    </select>
    120120    <input type="submit" name="list" value="<\x3fphp echo _("Search"); \x3f>" />
     
    149149    <\x3fphp for (\$i = 0; \$i <= \$page->last_item - \$page->first_item && \$page->total_items > 0; \$i++) { \x3f>
    150150    <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> &nbsp;</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> &nbsp;</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> &nbsp;</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> &nbsp;</td>
    153153
    154154E_O_F;
     
    164164
    165165echo 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> &nbsp;</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> &nbsp;</td>
    167167    </tr>
    168168    <\x3fphp } \x3f>
  • trunk/bin/module_maker/module.cli.php

    r151 r154  
    223223if ($upload_file_capability) {
    224224    // 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=\"__///__\" />";
    226226
    227227    // Include statement.
     
    234234\$upload = new Upload();
    235235\$upload->setParam(array(
    236     'upload_path' => COMMON_BASE . '/html/_db_files/<##>',
     236    'upload_path' => COMMON_BASE . '/html/_db_files/__///__',
    237237    'dest_file_perms' => 0666,
    238238    'allow_overwriting' => false,
     
    246246
    247247// Copy uploaded image name into form data.
    248 \$_POST['<##>'] = isset(\$_FILES['<##>']) ? \$_FILES['<##>']['name'] : '';
     248\$_POST['__///__'] = isset(\$_FILES['__///__']) ? \$_FILES['__///__']['name'] : '';
    249249
    250250
     
    264264
    265265        // Upload files with prepended primary key.
    266         \$new_file = \$upload->process('<##>',  \$%PRIMARY_KEY% . '_' . getFormData('<##>'));
     266        \$new_file = \$upload->process('__///__',  \$%PRIMARY_KEY% . '_' . getFormData('__///__'));
    267267
    268268        // If file upload errors, redirect to edit operation for the inserted record.
     
    276276
    277277        // Upload new files.
    278         if (getFormData('<##>')) {
     278        if (getFormData('__///__')) {
    279279            // Get old file names for deletion.
    280280            \$old_file = \$upload->getFilenameGlob(getFormData('%PRIMARY_KEY%') . '_*');
    281281            // 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('__///__'));
    283283            if (false === \$new_file || \$upload->anyErrors()) {
    284284                // Upload failed. Reload form. Display errors.
  • trunk/bin/module_maker/skel/adm_list.ihtml

    r136 r154  
    88    <br />
    99
    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, '&mdash;', city, '&mdash;', 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, '&mdash;', city, '&mdash;', title)", '__///___id', getFormData('filter___///__'), array('Any __///__'), 'ORDER BY __///__ ASC'); ?>
    1313    </select>
    1414    <input type="submit" value="<?php echo _("Search"); ?>" />
     
    2828    <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?>
    2929    <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> &nbsp;</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> &nbsp;</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> &nbsp;</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> &nbsp;</td>
    3232%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> &nbsp;</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> &nbsp;</td>
    3434    </tr>
    3535    <?php } ?>
  • trunk/bin/module_maker/skel/admin.php

    r153 r154  
    5050// Search limiters retain their values between page requests.
    5151$app->carryQuery('search_query');
    52 $app->carryQuery('filter_<##>');
     52$app->carryQuery('filter___///__');
    5353%ADMIN_UPLOAD_CONFIG%
    5454/********************************************************************
     
    235235
    236236    // Lock this record.
    237     $lock->set('%DB_TBL%', '%PRIMARY_KEY%', $id, $frm['<##>']);
     237    $lock->set('%DB_TBL%', '%PRIMARY_KEY%', $id, $frm['__///__']);
    238238
    239239    // Set misc values for the form.
     
    268268    // Get the information for this object.
    269269    $qid = $db->query("
    270         SELECT <##>
     270        SELECT __///__
    271271        FROM %DB_TBL%
    272272        WHERE %PRIMARY_KEY% = '" . $db->escapeString($id) . "'
     
    301301    // Create version.
    302302    $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__);
    306306
    307307    return $last_insert_id;
     
    326326    // Create version.
    327327    $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__);
    331331
    332332    // Unlock record.
     
    352352    }
    353353
    354     if (getFormData('filter_<##>', false)) {
     354    if (getFormData('filter___///__', false)) {
    355355        // 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___///__')) . "'";
    357357    }
    358358
  • trunk/bin/module_maker/skel/public.ihtml

    r136 r154  
    11<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>
    33
    44<!--
  • trunk/bin/module_maker/skel/public.php

    r143 r154  
    3838        WHERE %PRIMARY_KEY% = '" . $db->escapeString(getFormData('%PRIMARY_KEY%')) . "'
    3939        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')
    4242    ");
    4343    if (!$item = mysql_fetch_assoc($qid)) {
     
    5454
    5555    // Set title and main template.
    56     $nav->addPage($item['<##>']);
     56    $nav->addPage($item['__///__']);
    5757    $main_template = '%PUBLIC_DETAIL_TEMPLATE%';
    5858
  • trunk/bin/module_maker/skel/public_list.ihtml

    r136 r154  
    1010        <?php } ?>
    1111        <p>
    12         <em><?php echo date($app->getParam('date_format'), strtotime($%NAME_SINGULAR%_list[$i]['<##>'])); ?></em> &mdash; <?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> &mdash; <?php echo nl2br(fancyTxt(oTxt($%NAME_SINGULAR%_list[$i]['summary'], true))); ?>
    1313
    1414        <?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  
    5252
    5353$sort_columns = '';
    54 $primary_key = '<##>';
     54$primary_key = '__///__';
    5555
    5656// Loop through columns
Note: See TracChangeset for help on using the changeset viewer.