]> git.mjollnir.org Git - s9y.git/commitdiff
Added links to view an entry in reasonable places
authorgarvinhicking <garvinhicking>
Sat, 18 Feb 2006 17:25:13 +0000 (17:25 +0000)
committergarvinhicking <garvinhicking>
Sat, 18 Feb 2006 17:25:13 +0000 (17:25 +0000)
docs/NEWS
include/admin/comments.inc.php
include/admin/entries.inc.php
include/functions_config.inc.php

index 9b9667cbba3150459552eb0812f2c7792457dfcc..b921a072f4a47bdbe081bd3f99a861e5c36b8a8b 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,9 @@
 Version 1.1-alpha1()
 ------------------------------------------------------------------------
 
+   * Added links to view an entry in reasonable places (comments / entry
+     overview) (garvinhicking)
+
    * Added on-the-fly synchronizing of the Serendipity media database
      with the file system (Marty, garvinhicking)
 
@@ -10,7 +13,7 @@ Version 1.1-alpha1()
 
    * Added config option for specifying number of entries in the RSS
      feed (garvinhicking)
-   
+
    * Added option whether to issue the "SET NAMES" mysql command
      (garvinhicking)
 
index 5807f5a9100bba7167813266fdb09ba2f36f5e3c..f46770062185876bae90ba825f4c8bd2959768d4 100644 (file)
@@ -226,7 +226,7 @@ function highlightComment(id, checkvalue) {
     <tr>
         <td><?php echo COMMENTS; ?>:</td>
         <td><select name="serendipity[filter][perpage]">
-        <?php 
+        <?php
             $filter_vals = array(10, 20, 50, COMMENTS_FILTER_ALL);
             foreach($filter_vals AS $filter_val) { ?>
             <option value="<?php echo $filter_val; ?>" <?php echo ($commentsPerPage == $filter_val ? ' selected="selected"' : ''); ?>><?php echo $filter_val; ?></option>
@@ -302,6 +302,7 @@ foreach ($sql as $rs) {
         'entry_id'  => $rs['entry_id']
     );
 
+    $entrylink = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id'];
     if (strlen($comment['fullBody']) > strlen($comment['summary']) ) {
         $comment['summary'] .= ' ...';
         $comment['excerpt'] = true;
@@ -314,7 +315,7 @@ foreach ($sql as $rs) {
 
         $comment['fullBody'] = $comment['summary'] = nl2br(htmlspecialchars($comment['fullBody']));
     }
-    
+
     serendipity_plugin_api::hook_event('backend_view_comment', $comment);
     $class = 'serendipity_admin_list_item_' . (($i % 2 == 0 ) ? 'even' : 'uneven');
     $header_class = ($comment['status'] == 'pending' ? 'serendipityAdminMsgNote' : '');
@@ -388,6 +389,7 @@ foreach ($sql as $rs) {
 <?php if ($comment['excerpt']) { ?>
           <a href="#c<?php echo $comment['id'] ?>" onclick="FT_toggle(<?php echo $comment['id'] ?>); return false;" title="<?php echo VIEW; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo VIEW; ?>" /><span id="<?php echo $comment['id'] ?>_text"><?php echo VIEW ?></span></a>
 <?php } ?>
+          <a target="_blank" href="<?php echo $entrylink; ?>" title="<?php echo VIEW; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo EDIT; ?>" /><?php echo VIEW ?></a>
           <a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=edit&amp;serendipity[id]=<?php echo $comment['id'] ?>&amp;serendipity[entry_id]=<?php echo $comment['entry_id'] ?>&amp;<?php echo serendipity_setFormToken('url'); ?>" title="<?php echo EDIT; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/edit.png'); ?>" alt="<?php echo EDIT; ?>" /><?php echo EDIT ?></a>
           <a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=delete&amp;serendipity[id]=<?php echo $comment['id'] ?>&amp;serendipity[entry_id]=<?php echo $comment['entry_id'] ?>&amp;<?php echo serendipity_setFormToken('url'); ?>" onclick='return confirm("<?php echo sprintf(COMMENT_DELETE_CONFIRM, $comment['id'], htmlspecialchars($comment['author'])) ?>")' title="<?php echo DELETE ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/delete.png'); ?>" alt="<?php echo DELETE; ?>" /><?php echo DELETE ?></a>
           <?php echo $comment['action_more']; ?>
index 98546a39899c9e352e355ba1cf2a02e173a7a43d..0a6f7a4751b59ce0f6d6ab7648f61eb626a6fb2e 100644 (file)
@@ -208,7 +208,7 @@ function serendipity_drawList() {
 <?php
         // Print the entries
         $rows = 0;
-        foreach ( $entries as $entry ) {
+        foreach ($entries as $entry) {
             $rows++;
             // Find out if the entry has been modified later than 30 minutes after creation
             if ($entry['timestamp'] <= ($entry['last_modified'] - 60*30)) {
@@ -249,10 +249,12 @@ function serendipity_drawList() {
                     }
                     echo implode(', ', $cats);
                 }
+                $entry['link']      = serendipity_archiveURL($entry['id'], $entry['title'], 'serendipityHTTPPath', true, array('timestamp' => $entry['timestamp']));
                 ?>
 
                         </td>
                         <td align="right">
+                            <a target="_blank" href="<?php echo $entry['link']; ?>" title="<?php echo VIEW . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo VIEW; ?>" /><?php echo VIEW ?></a>
                             <a href="?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=edit&amp;serendipity[id]=<?php echo $entry['id']; ?>" title="<?php echo EDIT . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/edit.png'); ?>" alt="<?php echo EDIT; ?>" /><?php echo EDIT ?></a>
                             <a href="?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=delete&amp;serendipity[id]=<?php echo $entry['id']; ?>" title="<?php echo DELETE . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/delete.png'); ?>" alt="<?php echo DELETE; ?>" /><?php echo DELETE ?></a>
                         </td>
@@ -347,7 +349,7 @@ switch($serendipity['GET']['adminAction']) {
         // Save the entry, or just display a preview
         $use_legacy = true;
         serendipity_plugin_api::hook_event('backend_entry_iframe', $use_legacy);
-        
+
         if ($use_legacy) {
             if ($serendipity['POST']['preview'] != 'true') {
                 /* We don't need an iframe to save a draft */
@@ -368,15 +370,15 @@ switch($serendipity['GET']['adminAction']) {
                 if (!is_numeric($entry['timestamp'])) {
                     $entry['timestamp']  = time();
                 }
-    
+
                 if (!isset($entry['trackbacks']) || !$entry['trackbacks']) {
                     $entry['trackbacks'] = 0;
                 }
-    
+
                 if (!isset($entry['comments']) || !$entry['comments']) {
                     $entry['comments']   = 0;
                 }
-    
+
                 if (!isset($entry['realname']) || !$entry['realname']) {
                     if (!empty($serendipity['realname'])) {
                         $entry['realname']   = $serendipity['realname'];
@@ -384,7 +386,7 @@ switch($serendipity['GET']['adminAction']) {
                         $entry['realname']   = $serendipity['serendipityUser'];
                     }
                 }
-    
+
                 $categories = (array)$entry['categories'];
                 $entry['categories'] = array();
                 foreach ($categories as $catid) {
@@ -393,17 +395,17 @@ switch($serendipity['GET']['adminAction']) {
                     }
                     $entry['categories'][] = serendipity_fetchCategoryInfo($catid);
                 }
-    
+
                 if (count($entry['categories']) < 1) {
                     unset($entry['categories']);
                 }
-    
+
                 if (isset($entry['id'])) {
                     $serendipity['GET']['id'] = $entry['id'];
                 } else {
                     $serendipity['GET']['id'] = 1;
                 }
-    
+
                 if ($serendipity['use_iframe']) {
                     echo '<div class="serendipityAdminMsgSuccess">' . IFRAME_PREVIEW . '</div><br />';
                     serendipity_iframe_create('preview', $entry);
index 1ebecd71ddec678f3727db5111826ef58c282dd4..9dcd0c9c548e4d48d26f228d98a48b55ded29c09 100644 (file)
@@ -571,7 +571,8 @@ function serendipity_iframe(&$entry, $mode = null, $use_smarty = true) {
                     // it needs to be stored with the new ID.
                     echo '<script type="text/javascript">parent.document.forms[\'serendipityEntry\'][\'serendipity[id]\'].value = "' . $serendipity['lastSavedEntry'] . '";</script>';
                 }
-                echo '<div class="serendipityAdminMsgSuccess">' . ENTRY_SAVED . '</div>';
+                $entrylink = serendipity_archiveURL($entry['id'], $entry['title'], 'serendipityHTTPPath', true, array('timestamp' => $entry['timestamp']));
+                echo '<div class="serendipityAdminMsgSuccess">' . ENTRY_SAVED . ' (<a href="' . $entrylink . '" target="_blank">' . VIEW . '</a>)</div>';
             }
             echo '<br style="clear: both" />';
 
@@ -1523,10 +1524,10 @@ function serendipity_ACL_SQL(&$cond, $append_category = false, $type = 'category
             $cond['joins'] .= " LEFT JOIN {$serendipity['dbPrefix']}category c
                                        ON ec.categoryid = c.categoryid";
         }
-        
+
         switch($type) {
             case 'directory':
-                $sql_artifact_column = 'i.path IS NULL OR 
+                $sql_artifact_column = 'i.path IS NULL OR
                                         acl_acc.groupid IS NULL';
                 $sql_artifact = 'AND acl_acc.artifact_index = i.path';
                 break;