Improve usability
authorgarvinhicking <garvinhicking>
Thu, 6 Oct 2005 09:36:53 +0000 (09:36 +0000)
committergarvinhicking <garvinhicking>
Thu, 6 Oct 2005 09:36:53 +0000 (09:36 +0000)
docs/NEWS
include/admin/entries.inc.php

index b0339085db1f39b17b7dd66ea25dd6ca3d3634f3..ec09295cc10eae375951471c6e7285e5e4b680fa 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,9 @@
 Version 0.9-beta2 ()
 ------------------------------------------------------------------------
 
+    * Admin entry overview: Show pagination on bottom of the list and
+      allow filtering for showing drafts/publishs (garvinhicking)
+
     * Fix spartacus plugin to be able to upgrade plugins (garvinhicking)
 
     * Fix track exits plugin to redirect to the right URL when no URL-ID
index 3de98062e9be5baf3313071696efb891da6fe1f1..a7756fef7714a654699fe42ca8d8e4ac58140b62 100644 (file)
@@ -23,7 +23,7 @@ $per_page = array('12', '16', '50', '100');
 function serendipity_drawList() {
     global $serendipity, $sort_order, $per_page;
 
-    $filter_import = array('author', 'category');
+    $filter_import = array('author', 'category', 'isdraft');
     $sort_import   = array('perPage', 'ordermode', 'order');
     foreach($filter_import AS $f_import) {
         serendipity_restoreVar($serendipity['COOKIE']['entrylist_filter_' . $f_import], $serendipity['GET']['filter'][$f_import]);
@@ -59,6 +59,14 @@ function serendipity_drawList() {
         $filter[] = "ec.categoryid = '" . serendipity_db_escape_string($serendipity['GET']['filter']['category']) . "'";
     }
 
+    if (!empty($serendipity['GET']['filter']['isdraft'])) {
+        if ($serendipity['GET']['filter']['isdraft'] == 'draft') {
+            $filter[] = "e.isdraft = 'true'";
+        } elseif ($serendipity['GET']['filter']['isdraft'] == 'publish') {
+            $filter[] = "e.isdraft = 'false'";
+        }
+    }
+
     if (!empty($serendipity['GET']['filter']['body'])) {
         if ($serendipity['dbType'] == 'mysql') {
             $filter[] = "MATCH (title,body,extended) AGAINST ('" . serendipity_db_escape_string($serendipity['GET']['filter']['body']) . "')";
@@ -92,8 +100,8 @@ function serendipity_drawList() {
             <td class="serendipity_admin_filters_headline" colspan="6"><strong><?php echo FILTERS ?></strong> - <?php echo FIND_ENTRIES ?></td>
         </tr>
         <tr>
-            <td width="80"><?php echo AUTHOR ?></td>
-            <td>
+            <td valign="top" width="80"><?php echo AUTHOR ?></td>
+            <td valign="top">
                 <select name="serendipity[filter][author]">
                     <option value="">--</option>
 <?php
@@ -103,10 +111,14 @@ function serendipity_drawList() {
                             echo '<option value="' . $user['authorid'] . '" ' . (isset($serendipity['GET']['filter']['author']) && $serendipity['GET']['filter']['author'] == $user['authorid'] ? 'selected="selected"' : '') . '>' . $user['realname'] . '</option>' . "\n";
                         }
                     }
-?>              </select>
+?>              </select> <select name="serendipity[filter][isdraft]">
+                    <option value="all"><?php echo COMMENTS_FILTER_ALL; ?></option>
+                    <option value="draft"   <?php echo (isset($serendipity['GET']['filter']['isdraft']) &&  $serendipity['GET']['filter']['isdraft'] == 'draft' ? 'selected="selected"' : ''); ?>><?php echo DRAFT; ?></option>
+                    <option value="publish" <?php echo (isset($serendipity['GET']['filter']['isdraft']) &&  $serendipity['GET']['filter']['isdraft'] == 'publish' ? 'selected="selected"' : ''); ?>><?php echo PUBLISH; ?></option>
+                </select>
             </td>
-            <td width="80"><?php echo CATEGORY ?></td>
-            <td>
+            <td valign="top" width="80"><?php echo CATEGORY ?></td>
+            <td valign="top">
                 <select name="serendipity[filter][category]">
                     <option value="">--</option>
 <?php
@@ -117,14 +129,16 @@ function serendipity_drawList() {
                     }
 ?>              </select>
             </td>
-            <td width="80"><?php echo CONTENT ?></td>
-            <td><input size="10" type="text" name="serendipity[filter][body]" value="<?php echo (isset($serendipity['GET']['filter']['body']) ? htmlspecialchars($serendipity['GET']['filter']['body']) : '') ?>" /></td>
+            <td valign="top" width="80"><?php echo CONTENT ?></td>
+            <td valign="top"><input size="10" type="text" name="serendipity[filter][body]" value="<?php echo (isset($serendipity['GET']['filter']['body']) ? htmlspecialchars($serendipity['GET']['filter']['body']) : '') ?>" /></td>
         </tr>
         <tr>
             <td class="serendipity_admin_filters_headline" colspan="6"><strong><?php echo SORT_ORDER ?></strong></td>
         </tr>
         <tr>
-            <td><?php echo SORT_BY ?></td>
+            <td>
+                <?php echo SORT_BY ?>
+            </td>
             <td>
                 <select name="serendipity[sort][order]">
 <?php