]> git.nbdom.net Git - nb.git/commitdiff
Clear code
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 18 Jul 2016 23:33:13 +0000 (00:33 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 18 Jul 2016 23:33:13 +0000 (00:33 +0100)
lib/php/db/wp.php

index a5f70d89dbe3cf96aeb7739220a3dbb9bd84d4c6..3557bbd08f8b1a6891b1d25fb65d2ac5169cc609 100644 (file)
@@ -1,4 +1,8 @@
 <?php
+if (!class_exists('WP_List_Table')) {
+  echo "Hi there! I'm just a plugin, not much I can do when called directly.\n";
+  exit;
+}
 class html_table extends WP_List_Table {
 
   public $_table;
@@ -17,9 +21,12 @@ class html_table extends WP_List_Table {
   }
 
        public function search_box( $text='Search', $input_id='search' ) {
-    echo '<form id="searchform" role="search" method="get" action="'.$_SERVER['SCRIPT_NAME'].'">';
-
-    echo '<h1>Table: '
+    echo ''
+      #.'<div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="Screen Options Tab">'
+      .'<div>'
+      .'<form id="searchform" role="search" method="get" action="'.$_SERVER['SCRIPT_NAME'].'">'
+      .'<fieldset class="screen-options">'
+      .'<h1>Table: '
 
       .'<select name="table" onchange="if(this.value != \'0\') this.form.submit();">'
       .join("",array_map(function($a){
@@ -73,8 +80,12 @@ class html_table extends WP_List_Table {
       #echo '<div>';
     }
 
-    echo '</p>';
-    echo '</form>';
+    echo ''
+      .'</p>'
+      .'</fieldset>'
+      .'</form>'
+      .'</div>'
+    ;
 
     if (0) {
       // Query / Search