Changeset 109


Ignore:
Timestamp:
Apr 26, 2006 11:24:39 PM (18 years ago)
Author:
scdev
Message:

Q - Upgraded module_maker

Location:
branches/1.1dev
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1dev/bin/module_maker/_config.inc.php

    r80 r109  
    99if ($_SERVER['argc'] > 1 && '' != $site_base && is_dir($site_base)) {
    1010    // First arg is path to current site. Realpath removes trailing /s
     11    define('COMMON_BASE', $_SERVER['argv'][1]);
    1112    define('SITE_BASE', $site_base);
    1213} else {
  • branches/1.1dev/bin/module_maker/list_template.cli.php

    r90 r109  
    7777            $listrows[] = "<\x3fphp echo strlen(\$list[\$i]['$field'])<50 \x3f oTxt(\$list[\$i]['$field'], true) : oTxt(trim(substr(\$list[\$i]['$field'], 0, 50)) . '...'); \x3f>";
    7878        } 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>";
    8080        } 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>";
    8282        } 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>";
    8484        } 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>";
    8686        } else if (preg_match('/(amount|_rate)/i', $field)) {
    8787            $listrows[] = "<\x3fphp printf('$%01.2f', \$list[\$i]['$field']); \x3f>";
  • branches/1.1dev/bin/module_maker/module.cli.php

    r90 r109  
    258258echo "Generating admin form table rows...\n";
    259259$output = array();
    260 exec(dirname($_SERVER['argv'][0]) . "/form_template.cli.php $db_tbl", $output, $return_val);
     260exec(dirname($_SERVER['argv'][0]) . "/form_template.cli.php " . COMMON_BASE . " $db_tbl", $output, $return_val);
    261261if ($return_val == 0) {
    262262    $search['adm_form_table_rows'] = '/%ADM_FORM_TABLE_ROWS%/';
     
    268268echo "Generating admin list table header rows...\n";
    269269$output = array();
    270 exec(dirname($_SERVER['argv'][0]) . "/list_template.cli.php $db_tbl headerrows", $output, $return_val);
     270exec(dirname($_SERVER['argv'][0]) . "/list_template.cli.php " . COMMON_BASE . "  $db_tbl headerrows", $output, $return_val);
    271271if ($return_val == 0) {
    272272    $search['adm_list_header_rows'] = '/%ADM_LIST_HEADER_ROWS%/';
     
    278278echo "Generating admin list table rows...\n";
    279279$output = array();
    280 exec(dirname($_SERVER['argv'][0]) . "/list_template.cli.php $db_tbl listrows", $output, $return_val);
     280exec(dirname($_SERVER['argv'][0]) . "/list_template.cli.php " . COMMON_BASE . "  $db_tbl listrows", $output, $return_val);
    281281if ($return_val == 0) {
    282282    $search['adm_list_rows'] = '/%ADM_LIST_ROWS%/';
     
    288288echo "Generating sortorder...\n";
    289289$output = array();
    290 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php $db_tbl sortorder", $output, $return_val);
     290exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php " . COMMON_BASE . "  $db_tbl sortorder", $output, $return_val);
    291291if ($return_val == 0) {
    292292    $search['sort_order'] = '/%SORT_ORDER%/';
     
    298298echo "Generating insert data...\n";
    299299$output = array();
    300 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php $db_tbl insert", $output, $return_val);
     300exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php " . COMMON_BASE . "  $db_tbl insert", $output, $return_val);
    301301if ($return_val == 0) {
    302302    $search['insert'] = '/%INSERT%/';
     
    308308echo "Generating update data...\n";
    309309$output = array();
    310 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php $db_tbl update", $output, $return_val);
     310exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php " . COMMON_BASE . "  $db_tbl update", $output, $return_val);
    311311if ($return_val == 0) {
    312312    $search['update'] = '/%UPDATE%/';
     
    318318echo "Generating search data...\n";
    319319$output = array();
    320 exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php $db_tbl search", $output, $return_val);
     320exec(dirname($_SERVER['argv'][0]) . "/sql.cli.php " . COMMON_BASE . "  $db_tbl search", $output, $return_val);
    321321if ($return_val == 0) {
    322322    $search['search'] = '/%SEARCH%/';
     
    328328echo "Generating form validation data...\n";
    329329$output = array();
    330 exec(dirname($_SERVER['argv'][0]) . "/validation.cli.php $db_tbl", $output, $return_val);
     330exec(dirname($_SERVER['argv'][0]) . "/validation.cli.php " . COMMON_BASE . " $db_tbl", $output, $return_val);
    331331if ($return_val == 0) {
    332332    $search['form_validation'] = '/%FORM_VALIDATION%/';
  • branches/1.1dev/bin/module_maker/skel/adm_list.ihtml

    r30 r109  
    11
    22<?php include 'form_error_header.ihtml'; ?>
    3 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    4 <?php printHiddenSession(false); ?>
    53
    64<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 />
    99   
    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, '&mdash;', city, '&mdash;', 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, '&mdash;', city, '&mdash;', title)", '<##>_id', getFormData('filter_<##>'), array('Any <##>'), 'ORDER BY <##> ASC'); ?>
     13        </select>
     14        <input type="submit" name="list" value="<?php echo _("Search"); ?>" />
     15    </form>
    1516</div>
    1617
    1718<?php include 'adm_list_info.ihtml'; ?>
    1819
    19 <table class="list">
    20     <tr>
    21         <th>&nbsp;</th>
    22         <th>&nbsp;</th>
    23 %ADM_LIST_HEADER_ROWS%
    24         <th>&nbsp;</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> &nbsp;</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> &nbsp;</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> &nbsp;</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>&nbsp;</th>
     25            <th>&nbsp;</th>
     26    %ADM_LIST_HEADER_ROWS%
     27            <th>&nbsp;</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> &nbsp;</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> &nbsp;</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> &nbsp;</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:"); ?>&nbsp;<?php $page->printPageNumbers() ?></div>
    3341    <?php } ?>
    34 </table>
    35 
    36 <?php if ($page->total_pages > 1) { ?>
    37 <div class="nowrap commandtext" style="float: right;"><?php echo _("Pages:"); ?>&nbsp;<?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 } ?>
    4245</form>
  • branches/1.1dev/lib/Hierarchy.inc.php

    r91 r109  
    712712            for ($i=0; $i<$num_children; $i++) {
    713713
    714                 // Preventing circular references (Except when including current  item in list).
     714                // Preventing circular references (Except when including current item in list).
    715715                if ($my_children[$i]['child_type'] == $child_type && $my_children[$i]['child_id'] == $child_id && !($_return_flag && $include_curr)) {
    716716                    logMsg(sprintf(_("Circular reference detected: %s has itself as a parent."), $this->toStringID($my_children[$i]['child_type'], $my_children[$i]['child_id'])), LOG_ERR, __FILE__, __LINE__);
     
    748748    }
    749749   
     750    /*
     751    * Returns an array converted from a stack to a multidimentional hierarchy based on the parent types and ids.
     752    *
     753    * @access   public
     754    * @param    array   $curr           The starting array to convert from.
     755    * @param    string  $child_type     Optional root node type to start from.
     756    * @param    int     $child_id       Optional root node id to start from.
     757    * @return   array                   Multidimentional array.
     758    * @author   Quinn Comendant <quinn@strangecode.com>
     759    * @version  1.0
     760    * @since    26 Apr 2006 15:40:30
     761    */
    750762    function convertListToTree($curr, $child_type=null, $child_id=null, $_indent=0)
    751763    {
     
    814826    }
    815827
     828    /*
     829    * Prints a nested HTML list from input array generated by convertListToTree().
     830    *
     831    * @access   public
     832    * @param    array   $in     Input array.
     833    * @author   Quinn Comendant <quinn@strangecode.com>
     834    * @version  1.0
     835    * @since    26 Apr 2006 15:50:00
     836    */
    816837    function printTree($in)
    817838    {
Note: See TracChangeset for help on using the changeset viewer.