Changeset 701 for trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_upgrade.php
- Timestamp:
- Apr 20, 2011, 3:41:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_upgrade.php
r700 r701 4 4 return (object)$latest_version; 5 5 } 6 7 6 8 7 function list_xpress_update( $update=null ) { 9 8 global $xoops_config,$xpress_config; … … 26 25 } 27 26 28 27 $show_buttons = false; 29 28 if (version_compare($xpress_version, $latest_version, '>')){ 30 29 echo '<h3 class="response">'; 31 printf(__('You are using a XPressME Integration Kit development version (% 1$s). Cool! Please <a href="%2$s">stay updated</a>.', 'xpressme') , $xpress_version , $latest['develop_url']);30 printf(__('You are using a XPressME Integration Kit development version (%s). Cool! Please stay updated.', 'xpressme') , $xpress_version); 32 31 echo '</h3>'; 33 34 32 } else if (version_compare($xpress_version, $latest_version, '<')) { 35 33 echo '<h3 class="response">'; … … 38 36 39 37 if ($latest['diff_response'] == 'diff_exists'){ 40 // echo '<p>';41 // printf(__('You can download the differential file from version %s to %s and upgrade it manually:', 'xpressme'),$xpress_version,$latest['diff_latest_version']);42 // echo '</p>';43 38 $download_diff ='<a class="button" href="' . $latest['diff_package'] . '">'; 44 // $download_diff .= sprintf(__('Download differential file for %s', 'xpressme') , $latest['diff_latest_version']);45 39 $download_diff .= sprintf(__('Download differential file for %s', 'xpressme') , $xpress_version); 46 40 $download_diff .='</a>'; 47 41 } 48 $message = sprintf(__('You can update to <a href="http://codex.wordpress.org/Version_%1$s">XPressME Integration Kit Ver %2$s</a> automatically or download the package and install it manually:'), $update->current, $latest_version);42 $message = sprintf(__('You can update to XPressME Integration Kit Ver %s</a> automatically or download the package and install it manually:'), $latest_version); 49 43 $submit = __('Update Automatically'); 50 44 $form_action = 'admin.php?page=upgrade_page&action=do-xpress-upgrade'; … … 64 58 65 59 // develop 60 $develop_show = false; 66 61 if ($latest['develop_response'] == 'development_exists' 67 62 && !empty($latest['develop_package']) 68 63 ) 69 64 { 70 echo '<h3 class="response">'; 71 printf(__('You can use the development version %s download the package and install it manually:', 'xpressme'),$latest['develop_latest_version']); 72 echo '</h3>'; 73 echo '<a class="button" href="' . $latest['develop_package'] . '">'; 74 printf(__('Download %s', 'xpressme') , $latest['develop_latest_version']); 75 echo '</a>'; 65 $develop_latest_version=$latest['develop_latest_version']; 66 $develop_form_action = 'admin.php?page=upgrade_page&action=do-xpress-develop_upgrade'; 67 // $develop_message =sprintf(__('You can use the development version %s download the package and install it manually:', 'xpressme'),$latest['develop_latest_version']); 68 $develop_message = sprintf(__('You can update to XPressME Integration Kit development version %s automatically or download the package and install it manually:'), $develop_latest_version); 69 70 $develop_show = true; 71 $develop_package=$latest['develop_package']; 72 $develop_submit = __('Update Automatically'); 73 $develop_download = sprintf(__('Download %s', 'xpressme') , $develop_latest_version); 74 $develop_download_diff = ''; 76 75 // develop diff 77 76 if ($latest['diff_develop_response'] == 'diff_develop_exists' … … 79 78 ) 80 79 { 81 echo '<p>'; 82 printf(__('You can download the differential file from version %s to %s and upgrade it manually:', 'xpressme'),$xpress_version,$latest['diff_develop_latest_version']); 83 echo '</p>'; 84 echo '<a class="button" href="' . $latest['diff_develop_package'] . '">'; 85 printf(__('Download differential file for %s', 'xpressme') , $latest['diff_develop_latest_version']); 86 echo '</a>'; 80 $develop_download_diff = '<a class="button" href="' . $latest['diff_develop_package'] . '">'; 81 $develop_download_difff .= sprintf(__('Download differential file for %s', 'xpressme') , $latest['diff_develop_latest_version']); 82 $develop_download_diff .= '</a>'; 87 83 } 88 84 } … … 102 98 } 103 99 echo '</form>'; 100 101 if ($develop_show){ 102 echo '<p>'; 103 echo $develop_message; 104 echo '</p>'; 105 echo '<form method="post" action="' . $develop_form_action . '" name="develop_upgrade" class="develop_upgrade">'; 106 echo '<p>'; 107 echo '<input name="version" value="'. esc_attr($update->current) .'" type="hidden"/>'; 108 echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>'; 109 echo '<input id="upgrade" class="button" type="submit" value="' . esc_attr($develop_submit) . '" name="develop_upgrade" /> '; 110 echo '<a href="' . esc_url($develop_package) . '" class="button">' . $develop_download . '</a> '; 111 echo $develop_download_diff; 112 echo '</form>'; 113 } 104 114 } else { 105 115 echo '<h3 class="response">'; … … 116 126 } 117 127 118 function do_xpress_upgrade( $ reinstall = false ) {128 function do_xpress_upgrade( $develop = false,$reinstall = false ) { 119 129 global $wp_filesystem; 120 130 … … 133 143 if ( !$update ) 134 144 return; 135 145 if ( $develop ) 146 $update->package = $update->develop_package; 136 147 137 148 if ( ! WP_Filesystem($credentials, ABSPATH) ) { … … 180 191 list_xpress_update(); 181 192 } elseif ( 'do-xpress-upgrade' == $action) { 182 do_xpress_upgrade(); 193 $update_develop = false; 194 do_xpress_upgrade($update_develop); 195 } else if ( 'do-xpress-develop_upgrade' == $action) { 196 $update_develop = true; 197 do_xpress_upgrade($update_develop); 183 198 } 184 199 }
Note: See TracChangeset
for help on using the changeset viewer.