Ticket #6015: 6015.4.diff
| File 6015.4.diff, 4.6 KB (added by DD32, 5 years ago) |
|---|
-
wp-admin/includes/plugin-install.php
68 68 } 69 69 ?> 70 70 71 <p><?php _e('Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> via this page.') ?></p>71 <p><?php _e('Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> or upload a plugin in .zip format via this page.') ?></p> 72 72 73 73 <h4><?php _e('Search') ?></h4> 74 <?php install_search_form() ?> 74 <?php install_search_form( 75 '<a href="' . add_query_arg('show-help', !isset($_REQUEST['show-help'])) .'" onclick="jQuery(\'#search-help\').toggle(); return false;">' . 76 __('[need help?]') . '</a>') ?> 77 <div id="search-help" style="display: <?php echo isset($_REQUEST['show-help']) ? 'block' : 'none'; ?>;"> 75 78 <p> <?php _e('You may search based on 3 criteria:') ?><br /> 76 79 <?php _e('<strong>Term:</strong> Searches plugins names and descriptions for the specified term') ?><br /> 77 80 <?php _e('<strong>Tag:</strong> Searches for plugins tagged as such') ?><br /> 78 81 <?php _e('<strong>Author:</strong> Searches for plugins created by the Author, or which the Author contributed to.') ?></p> 82 </div> 79 83 84 <h4><?php _e('Install a plugin in .zip format') ?></h4> 85 <p><?php _e('If you have a plugin in a .zip format, You may install it by uploading it here.') ?></p> 86 <form> 87 <input type="file" name="pluginzip" /> 88 <input type="submit" value="<?php _e('Install Now') ?>" />(Not working yet) 89 </form> 90 80 91 <h4><?php _e('Popular tags') ?></h4> 81 <p><?php _e('You may also search based on these popular tags, These are tags which are most popular on WordPress.org') ?></p>92 <p><?php _e('You may also browse based on the most popular tags on wordpress.org') ?></p> 82 93 <?php 83 94 84 95 $api_tags = install_popular_tags(); … … 93 104 echo wp_generate_tag_cloud($tags, array( 'single_text' => __('%d plugin'), 'multiple_text' => __('%d plugins') ) ); 94 105 } 95 106 96 function install_search_form( ){107 function install_search_form($after_submit = '') { 97 108 $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : ''; 98 109 $term = isset($_REQUEST['s']) ? $_REQUEST['s'] : ''; 99 110 … … 105 116 </select> 106 117 <input type="text" name="s" id="search-field" value="<?php echo attribute_escape($term) ?>" /> 107 118 <input type="submit" name="search" value="<?php echo attribute_escape(__('Search')) ?>" clas="button" /> 119 <?php if ( ! empty($after_submit) ) echo $after_submit ?> 108 120 </form><?php 109 121 } 110 122 … … 132 144 $api = plugins_api('query_plugins', $args); 133 145 display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']); 134 146 } 135 add_action('install_plugins_upload', 'install_upload_custom', 10, 1);136 function install_upload_custom($page){137 //$args = array('browse' => 'updated', 'page' => $page);138 //$api = plugins_api('query_plugins', $args);139 //display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']);140 echo '<h1>Not Implemented</h1> <p>Will utilise SwfUpload(if available) & unzip .zip plugin packages</p>';141 }142 147 143 148 function display_plugins_table($plugins, $page = 1, $totalpages = 1){ 144 149 global $tab; -
wp-admin/plugin-install.php
14 14 wp_enqueue_script( 'plugin-install' ); 15 15 add_thickbox(); 16 16 17 //These are the tabs which are shown on the page, Note that 'install' and 'plugin-information' are valid hooks, but not shown here due to not requiring the header17 //These are the tabs which are shown on the page, 18 18 $tabs = array( 19 19 'search' => __('Search Plugins'), 20 'upload' => __('Upload a Plugin'),21 20 'featured' => __('Featured Plugins'), 22 21 'popular' => __('Popular Plugins'), 23 22 'new' => __('Newest Plugins'), 24 23 'updated' => __('Recently Updated Plugins') 25 24 ); 25 $nonmenu_tags = array('install', 'plugin-information', 'upload'); //Valid actions to perform which do not have a Menu item. 26 26 27 27 $tabs = apply_filters('install_plugins_tabs', $tabs ); 28 28 29 if( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, array('install', 'plugin-information')) ) ){29 if( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ){ 30 30 $tab_actions = array_keys($tabs); 31 31 $tab = $tab_actions[0]; 32 32 }