Changeset 42 for trunk/bin/module_maker/module.cli.php
- Timestamp:
- Dec 18, 2005 12:16:03 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/module.cli.php
r41 r42 17 17 } else { 18 18 die(basename($_SERVER['argv'][0]) . " Error: invalid arguments. Try like this: 19 19 20 20 " . basename($_SERVER['argv'][0]) . " site_directory name_singular name_plural [clean] 21 21 … … 46 46 break; 47 47 default : 48 48 49 49 } 50 50 … … 91 91 trashFile("$public_dir/$public_script"); 92 92 trashFile("$public_tpl_dir/$public_list_template"); 93 trashFile("$public_tpl_dir/$public_detail_template"); 93 trashFile("$public_tpl_dir/$public_detail_template"); 94 94 echo "End file cleanup\n"; 95 95 die; … … 163 163 if (is_array($cols) && !empty($cols)) { 164 164 foreach ($cols as $col) { 165 165 166 166 // Human readable. 167 167 $field = $col[0]; … … 169 169 $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]); 170 170 $default = $col[4]; 171 171 172 172 // Get primary key. 173 173 // if ('PRI' == $col[3]) { 174 174 // $primary_key = $field; 175 175 // } 176 176 177 177 // Our form will require type="multipart/form-data". 178 178 if (preg_match('/file|image/i', $field)) { 179 179 $upload_file_capability = true; 180 180 } 181 181 182 182 // Column headers. 183 183 $headers[$field] = $field_title; 184 184 185 185 // Get php code for printing variables. 186 186 $public_list_page_vars[] = "<\x3fphp echo oTxt(\$" . $module_name_singular . "_list[\$i]['$field']); \x3f>"; … … 222 222 // Form arguments 223 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=\"<##>\" />"; 224 224 225 225 // Include statement. 226 226 $replace['admin_upload_include'] = "require_once 'codebase/lib/Upload.inc.php';\n"; … … 245 245 // Copy uploaded image name into form data. 246 246 \$_POST['<##>'] = isset(\$_FILES['<##>']) ? \$_FILES['<##>']['name'] : ''; 247 247 248 248 249 249 E_O_F; … … 261 261 $replace['admin_upload_insert'] = <<<E_O_F 262 262 263 263 // Upload files with prepended primary key. 264 264 \$new_file = \$upload->process('<##>', \$%PRIMARY_KEY% . '_' . getFormData('<##>')); 265 265 … … 443 443 if ('var' == $op) { 444 444 if (isset($replace[$_SERVER['argv'][5]])) { 445 445 echo "\n\n" . $replace[$_SERVER['argv'][5]] . "\n\n"; 446 446 } else if (isset($skel_files[$_SERVER['argv'][5]])) { 447 447 echo "\n\n" . preg_replace($search, $replace, $skel_files[$_SERVER['argv'][5]]) . "\n\n"; … … 540 540 global $user_trash_folder; 541 541 static $file_prefix; 542 542 543 543 if (!isset($file_prefix)) { 544 544 $file_prefix = time(); … … 546 546 $file_prefix++; 547 547 } 548 548 549 549 // Make user trash folder. 550 550 if (!dir($user_trash_folder)) {
Note: See TracChangeset
for help on using the changeset viewer.