- Timestamp:
- Nov 14, 2005 6:22:44 AM (19 years ago)
- Location:
- trunk/bin/module_maker
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/_config.inc.php
r18 r19 6 6 $common_base = realpath($_SERVER['argv'][1]); 7 7 8 9 if ( 2 == $_SERVER['argc']&& '' != $common_base && is_dir($common_base)) {8 // Test argument. 9 if ($_SERVER['argc'] > 1 && '' != $common_base && is_dir($common_base)) { 10 10 // First arg is path to current site. Realpath removes trailing /s 11 11 define('COMMON_BASE', $common_base); 12 12 } else { 13 die("Error: Single argument must be the directory path to an existing site (ex: /home/sc/www.strangecode.com).\n"); 13 die("Error: First argument must be the directory path to an existing site (ex: /home/sc/www.strangecode.com).\n"); 14 } 15 16 // Make sure necessary files exist. 17 if (!file_exists(COMMON_BASE . '/global/db_auth.inc.php')) { 18 die("Error: First argument directory must contain the global/db_auth.inc.php file with valid MySQL credentials.\n"); 14 19 } 15 20 -
trunk/bin/module_maker/form_template.cli.php
r18 r19 33 33 } 34 34 35 $exclude = array('added_by_ admin_id', 'added_datetime', 'hit_count', 'modified_datetime', 'modified_by_admin_id');35 $exclude = array('added_by_user_id', 'added_datetime', 'hit_count', 'modified_datetime', 'modified_by_user_id'); 36 36 $primary_key_field = ''; 37 37 $output = array(); -
trunk/bin/module_maker/list_template.cli.php
r18 r19 87 87 } else if (preg_match('/(amount|_rate)/i', $field)) { 88 88 $listrows[] = "<\x3fphp printf('$%01.2f', \$list[\$i]['$field']); \x3f>"; 89 } else if (preg_match('/(added_by_ admin_id)/i', $field)) {89 } else if (preg_match('/(added_by_user_id)/i', $field)) { 90 90 $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['added_admin_username']); \x3f>"; 91 } else if (preg_match('/(modified_by_ admin_id)/i', $field)) {91 } else if (preg_match('/(modified_by_user_id)/i', $field)) { 92 92 $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['modified_admin_username']); \x3f>"; 93 93 } else if ('rank' == $field) { … … 146 146 <tr> 147 147 <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> 148 <td class="nowrap"><a title="<\x3fphp printf(_("Versions of %s"), oTxt(\$list[\$i]['______RECORD_NAME______'])) \x3f>" href="<\x3fphp echo App::oHREF("/admin/ record_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>148 <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> 149 149 150 150 E_O_F; -
trunk/bin/module_maker/skel/adm_form.ihtml
r18 r19 9 9 <tr> 10 10 <td> </td> 11 <td valign="top"> 12 <?php if (!empty($frm['submit_caption'])) { ?><input type="submit" name="submit" value="<?php echo oTxt($frm['submit_caption']); ?>" /><?php } ?> 13 <?php if (!empty($frm['repeat_caption'])) { ?><input type="submit" name="repeat" value="<?php echo oTxt($frm['repeat_caption']); ?>" /><?php } ?> 14 <?php if (!empty($frm['reset_caption'])) { ?><input type="submit" name="reset" value="<?php echo oTxt($frm['reset_caption']); ?>" /><?php } ?> 15 <?php if (!empty($frm['cancel_caption'])) { ?><input type="submit" name="cancel" value="<?php echo oTxt($frm['cancel_caption']); ?>" /><?php } ?> 16 </td> 11 <td valign="top"><?php printSubmitButtons($frm['submit_buttons']); ?></td> 17 12 </tr> 18 13 %ADM_FORM_TABLE_ROWS% 19 14 <tr> 20 15 <td> </td> 21 <td valign="top"> 22 <?php if (!empty($frm['submit_caption'])) { ?><input type="submit" name="submit" value="<?php echo oTxt($frm['submit_caption']); ?>" /><?php } ?> 23 <?php if (!empty($frm['repeat_caption'])) { ?><input type="submit" name="repeat" value="<?php echo oTxt($frm['repeat_caption']); ?>" /><?php } ?> 24 <?php if (!empty($frm['reset_caption'])) { ?><input type="submit" name="reset" value="<?php echo oTxt($frm['reset_caption']); ?>" /><?php } ?> 25 <?php if (!empty($frm['cancel_caption'])) { ?><input type="submit" name="cancel" value="<?php echo oTxt($frm['cancel_caption']); ?>" /><?php } ?> 26 </td> 16 <td valign="top"><?php printSubmitButtons($frm['submit_buttons']); ?></td> 27 17 </tr> 28 18 </table> -
trunk/bin/module_maker/skel/adm_list.ihtml
r18 r19 27 27 <tr> 28 28 <td class="padleft nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" 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> 29 <td class="padleft nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" href="<?php echo App::oHREF('/admin/ record_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>29 <td class="padleft nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" 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 30 %ADM_LIST_ROWS% 31 31 <td class="padleft nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" 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]['______RECORD_NAME______'])) ?>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> </td> -
trunk/bin/module_maker/skel/admin.php
r18 r19 217 217 218 218 // Lock this record. 219 $lock->set('%DB_TBL%', '%PRIMARY_KEY%', $id, $frm[' address']);219 $lock->set('%DB_TBL%', '%PRIMARY_KEY%', $id, $frm['<##>']); 220 220 221 221 // Set misc values for the form. … … 277 277 278 278 // Create version. 279 $version = new RecordVersion( );279 $version = new RecordVersion($GLOBALS['auth']); 280 280 $version->create('%DB_TBL%', '%PRIMARY_KEY%', $last_insert_id, $frm['<##>']); 281 281 … … 300 300 301 301 // Create version. 302 $version = new RecordVersion( );302 $version = new RecordVersion($GLOBALS['auth']); 303 303 $version->create('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%'], $frm['<##>']); 304 304 … … 349 349 a2.username AS modified_admin_username 350 350 FROM %DB_TBL% 351 LEFT JOIN admin_tbl a1 ON (%DB_TBL%.added_by_ admin_id = a1.admin_id)352 LEFT JOIN admin_tbl a2 ON (%DB_TBL%.modified_by_ admin_id = a2.admin_id)351 LEFT JOIN admin_tbl a1 ON (%DB_TBL%.added_by_user_id = a1.admin_id) 352 LEFT JOIN admin_tbl a2 ON (%DB_TBL%.modified_by_user_id = a2.admin_id) 353 353 $where_clause 354 354 " . $so->getSortOrderSQL() . " -
trunk/bin/module_maker/sql.cli.php
r18 r19 73 73 // Toggle types. 74 74 $c[$field] = "'\" . isset(\$frm['$field']) . \"'"; 75 } else if ('added_by_ admin_id' == $field || 'modified_by_admin_id' == $field) {75 } else if ('added_by_user_id' == $field || 'modified_by_user_id' == $field) { 76 76 // Toggle types. 77 77 $c[$field] = "'\" . addslashes(\$auth->getVal('user_id')) . \"'"; … … 94 94 // Insert SQL. 95 95 if (!isset($op) || 'insert' == $op) { 96 $insert_skip_columns = array('modified_datetime', 'modified_by_ admin_id');96 $insert_skip_columns = array('modified_datetime', 'modified_by_user_id'); 97 97 $insert_c = array(); 98 98 foreach ($c as $k=>$v) { … … 120 120 // Update SQL. 121 121 if (!isset($op) || 'update' == $op) { 122 $update_skip_columns = array('added_datetime', 'added_by_ admin_id');122 $update_skip_columns = array('added_datetime', 'added_by_user_id'); 123 123 $comma = ''; 124 124 $key_eq_val = ''; … … 181 181 // Search SQL 182 182 if (!isset($op) || 'search' == $op) { 183 $search_skip_columns = array('added_datetime', 'added_by_ admin_id', 'modified_datetime', 'modified_by_admin_id', 'publish', 'featured');183 $search_skip_columns = array('added_datetime', 'added_by_user_id', 'modified_datetime', 'modified_by_user_id', 'publish', 'featured'); 184 184 $search_columns = $db_tbl . '.' . join(" LIKE '%\" . addslashes(\$qry_words[\$i]) . \"%'\n OR $db_tbl.", array_diff(array_keys($c), $search_skip_columns)); 185 185 echo <<<E_O_F -
trunk/bin/module_maker/validation.cli.php
r18 r19 34 34 35 35 // Exclude these fields. 36 $exclude = array('added_by_ admin_id', 'added_datetime', 'hit_count', 'modified_datetime', 'modified_by_admin_id');36 $exclude = array('added_by_user_id', 'added_datetime', 'hit_count', 'modified_datetime', 'modified_by_user_id'); 37 37 38 38 // Loop through columns
Note: See TracChangeset
for help on using the changeset viewer.