summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/omnisearch')
-rw-r--r--plugins/jetpack/modules/omnisearch/omnisearch-core.php5
-rw-r--r--plugins/jetpack/modules/omnisearch/omnisearch-media.php46
-rw-r--r--plugins/jetpack/modules/omnisearch/omnisearch.css19
-rw-r--r--plugins/jetpack/modules/omnisearch/rtl/omnisearch-rtl.css21
4 files changed, 84 insertions, 7 deletions
diff --git a/plugins/jetpack/modules/omnisearch/omnisearch-core.php b/plugins/jetpack/modules/omnisearch/omnisearch-core.php
index 1b19a466..f0d3fb84 100644
--- a/plugins/jetpack/modules/omnisearch/omnisearch-core.php
+++ b/plugins/jetpack/modules/omnisearch/omnisearch-core.php
@@ -27,6 +27,11 @@ class Jetpack_Omnisearch {
require_once( dirname(__FILE__) . '/omnisearch-comments.php' );
new Jetpack_Omnisearch_Comments;
+ if ( current_user_can( 'upload_files' ) ) {
+ require_once( dirname(__FILE__) . '/omnisearch-media.php' );
+ new Jetpack_Omnisearch_Media;
+ }
+
if ( current_user_can( 'install_plugins' ) ) {
require_once( dirname(__FILE__) . '/omnisearch-plugins.php' );
new Jetpack_Omnisearch_Plugins;
diff --git a/plugins/jetpack/modules/omnisearch/omnisearch-media.php b/plugins/jetpack/modules/omnisearch/omnisearch-media.php
new file mode 100644
index 00000000..17899a0a
--- /dev/null
+++ b/plugins/jetpack/modules/omnisearch/omnisearch-media.php
@@ -0,0 +1,46 @@
+<?php
+
+if( ! class_exists( 'WP_Media_List_Table' ) )
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php' );
+
+class Jetpack_Omnisearch_Media extends WP_Media_List_Table {
+ static $instance;
+
+ function __construct() {
+ self::$instance = $this;
+ add_filter( 'omnisearch_results', array( $this, 'search'), 10, 2 );
+ }
+
+ function search( $results, $search_term ) {
+ $search_url = esc_url( add_query_arg( 's', $search_term, admin_url( 'upload.php' ) ) );
+ $search_link = sprintf( ' <a href="%s" class="add-new-h2">%s</a>', $search_url, esc_html__('Search Media', 'jetpack') );
+ $html = '<h2>' . esc_html__('Media', 'jetpack') . $search_link . '</h2>';
+ parent::__construct();
+
+ ob_start();
+ $this->prepare_items();
+ $columns = $this->get_columns();
+ unset( $columns['cb'] );
+ $this->_column_headers = array( $columns, array(), array() );
+ $this->display();
+ $html .= ob_get_clean();
+
+ $label = __( 'Media', 'jetpack' );
+ $results[ $label ] = $html;
+ return $results;
+ }
+
+ function get_sortable_columns() {
+ return array();
+ }
+
+ function get_bulk_actions() {
+ return array();
+ }
+
+ function pagination( $which ) {}
+
+ function extra_tablenav( $which ) {}
+}
+
+
diff --git a/plugins/jetpack/modules/omnisearch/omnisearch.css b/plugins/jetpack/modules/omnisearch/omnisearch.css
index f0265b70..6dc1784f 100644
--- a/plugins/jetpack/modules/omnisearch/omnisearch.css
+++ b/plugins/jetpack/modules/omnisearch/omnisearch.css
@@ -19,7 +19,7 @@ input.omnisearch {
width: 100%;
}
-.admin-color-mp6 input.omnisearch {
+.mp6 input.omnisearch {
line-height: 1.35;
}
@@ -40,7 +40,7 @@ button.omnisearch-submit {
bottom: 0;
}
-.admin-color-mp6 button.omnisearch-submit {
+.mp6 button.omnisearch-submit {
padding: 0.3em 0.5em 0.1em;
}
@@ -113,10 +113,22 @@ button.omnisearch-submit span {
width: 15%;
}
-.comments .column-author {
+.wp-list-table.comments .column-author {
width: 20%;
}
+.wp-list-table.media th {
+ white-space: nowrap;
+}
+
+.wp-list-table.media .column-parent {
+ width: 15%;
+}
+
+.wp-list-table.media .column-comments span.vers {
+ display: block;
+}
+
.tablenav {
height: 0;
}
@@ -124,3 +136,4 @@ button.omnisearch-submit span {
.omnisearch-results .tablenav.top {
margin: 5px 0;
}
+
diff --git a/plugins/jetpack/modules/omnisearch/rtl/omnisearch-rtl.css b/plugins/jetpack/modules/omnisearch/rtl/omnisearch-rtl.css
index 2a5de7e1..50cb1d6f 100644
--- a/plugins/jetpack/modules/omnisearch/rtl/omnisearch-rtl.css
+++ b/plugins/jetpack/modules/omnisearch/rtl/omnisearch-rtl.css
@@ -1,4 +1,4 @@
-/* This file was automatically generated on Jun 19 2013 20:38:31 */
+/* This file was automatically generated on Sep 05 2013 19:17:53 */
h2.page-title small {
@@ -21,7 +21,7 @@ input.omnisearch {
width: 100%;
}
-.admin-color-mp6 input.omnisearch {
+.mp6 input.omnisearch {
line-height: 1.35;
}
@@ -42,7 +42,7 @@ button.omnisearch-submit {
bottom: 0;
}
-.admin-color-mp6 button.omnisearch-submit {
+.mp6 button.omnisearch-submit {
padding: 0.3em 0.5em 0.1em;
}
@@ -115,10 +115,22 @@ button.omnisearch-submit span {
width: 15%;
}
-.comments .column-author {
+.wp-list-table.comments .column-author {
width: 20%;
}
+.wp-list-table.media th {
+ white-space: nowrap;
+}
+
+.wp-list-table.media .column-parent {
+ width: 15%;
+}
+
+.wp-list-table.media .column-comments span.vers {
+ display: block;
+}
+
.tablenav {
height: 0;
}
@@ -126,3 +138,4 @@ button.omnisearch-submit span {
.omnisearch-results .tablenav.top {
margin: 5px 0;
}
+