[pLog-svn] r4375 - in plugins/branches/lifetype-1.1/editcomments: . class/action class/view locale templates

reto at devel.lifetype.net reto at devel.lifetype.net
Sun Dec 3 19:15:36 GMT 2006


Author: reto
Date: 2006-12-03 19:15:34 +0000 (Sun, 03 Dec 2006)
New Revision: 4375

Added:
   plugins/branches/lifetype-1.1/editcomments/class/action/adminedittrackbackaction.class.php
   plugins/branches/lifetype-1.1/editcomments/class/action/adminpluginedittrackbacksaction.class.php
   plugins/branches/lifetype-1.1/editcomments/class/action/adminupdatetrackbackaction.class.php
   plugins/branches/lifetype-1.1/editcomments/class/view/adminedittrackbacksview.class.php
   plugins/branches/lifetype-1.1/editcomments/class/view/adminedittrackbackview.class.php
   plugins/branches/lifetype-1.1/editcomments/templates/edittrackback.template
   plugins/branches/lifetype-1.1/editcomments/templates/edittrackbacks.template
Modified:
   plugins/branches/lifetype-1.1/editcomments/locale/locale_en_UK.php
   plugins/branches/lifetype-1.1/editcomments/plugineditcomments.class.php
   plugins/branches/lifetype-1.1/editcomments/readme.txt
Log:
The editComments Plugin is now capable of editing trackbacks, too. (not tested very much yet. But I'd be happy if someone else gives it a try.

@jon: if you think we shouldn't add this feature to the editcomments plugin, I'll of course create an editTrackback plugin.

btw: can you explain why you do this on line 41 of adminupdatecommentaction
 $view = new AdminEditCommentView($this->_blogInfo, $commentId);

a) why do we need that new view there?
b) $commentId will never be a value right there, right?


Added: plugins/branches/lifetype-1.1/editcomments/class/action/adminedittrackbackaction.class.php
===================================================================
--- plugins/branches/lifetype-1.1/editcomments/class/action/adminedittrackbackaction.class.php	2006-12-02 03:09:27 UTC (rev 4374)
+++ plugins/branches/lifetype-1.1/editcomments/class/action/adminedittrackbackaction.class.php	2006-12-03 19:15:34 UTC (rev 4375)
@@ -0,0 +1,25 @@
+<?php
+
+	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/editcomments/class/view/adminedittrackbackview.class.php" );
+
+	/**
+	 * actions that displays the list of comments in the blog.
+	 */
+	class AdminEditTrackbackAction extends AdminAction{
+	
+		function AdminEditTrackbackAction( $actionInfo, $request ){
+			$this->AdminAction( $actionInfo, $request );
+		}
+		
+		function perform(){
+            $trackbackId = $this->_request->getValue("trackbackId");
+
+            $this->_view = new AdminEditTrackbackView($this->_blogInfo, $trackbackId);
+
+			$this->setCommonData();
+			
+			return true;
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.1/editcomments/class/action/adminpluginedittrackbacksaction.class.php
===================================================================
--- plugins/branches/lifetype-1.1/editcomments/class/action/adminpluginedittrackbacksaction.class.php	2006-12-02 03:09:27 UTC (rev 4374)
+++ plugins/branches/lifetype-1.1/editcomments/class/action/adminpluginedittrackbacksaction.class.php	2006-12-03 19:15:34 UTC (rev 4375)
@@ -0,0 +1,17 @@
+<?php
+	include_once( PLOG_CLASS_PATH."plugins/editcomments/class/view/adminedittrackbacksview.class.php" );
+	include_once( PLOG_CLASS_PATH."class/action/admin/adminedittrackbacksaction.class.php" );
+
+	/**
+	 * actions that displays the list of trackbacks in the blog.
+	 */
+	class AdminPluginEditTrackbacksAction extends AdminEditTrackbacksAction {
+    
+		function AdminPluginEditTrackbacksAction ($actionInfo, $request) {
+        
+			$this->AdminEditCommentsAction($actionInfo, $request);
+            $this->_viewClass = "AdminEditTrackbacksView";
+        }
+
+	}
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.1/editcomments/class/action/adminupdatetrackbackaction.class.php
===================================================================
--- plugins/branches/lifetype-1.1/editcomments/class/action/adminupdatetrackbackaction.class.php	2006-12-02 03:09:27 UTC (rev 4374)
+++ plugins/branches/lifetype-1.1/editcomments/class/action/adminupdatetrackbackaction.class.php	2006-12-03 19:15:34 UTC (rev 4375)
@@ -0,0 +1,163 @@
+<?php
+
+include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
+include_once( PLOG_CLASS_PATH."class/data/validator/emailvalidator.class.php" );
+include_once( PLOG_CLASS_PATH."class/data/validator/httpurlvalidator.class.php" );
+include_once( PLOG_CLASS_PATH."class/data/validator/usernamevalidator.class.php" );
+include_once( PLOG_CLASS_PATH."plugins/editcomments/class/view/adminedittrackbackview.class.php" );
+include_once( PLOG_CLASS_PATH."plugins/editcomments/class/view/adminedittrackbacksview.class.php" );
+include_once( PLOG_CLASS_PATH."class/view/admin/adminpostslistview.class.php" );
+
+class AdminUpdateTrackbackAction extends AdminAction {
+    var $_trackbackId;
+    var $_articleId;
+	var $_op;
+    var $_authorEmail;
+    var $_authorUrl;
+    var $_authorName;
+    var $_commentText;
+    var $_commentTopic;
+    var $_commentNormalizedText;
+    var $_commentNormalizedTopic;
+    var $_commentStatus;
+    var $_commentDateTime;
+    var $_commentIp;
+    
+    function AdminUpdateTrackbackAction($actionInfo, $request){
+        $this->AdminAction($actionInfo, $request);
+
+        $this->_op = $actionInfo->getActionParamValue();
+        if($this->_request->getValue("cancel")){
+            $this->_op = "cancel";
+        }
+
+            // articleId is needed, even on a cancel operation
+        $this->registerFieldValidator("articleId", new IntegerValidator());
+        $this->_articleId = $this->_request->getValue( "articleId" );
+
+        if($this->_op == "updateTrackback"){
+
+            // there is actually no trackbackId here, don't know if it's used somewhere else.
+            // I'm programming with no clue...
+            $view = new AdminEditTrackbackView($this->_blogInfo, $trackbackId);
+
+            $this->registerFieldValidator("trackbackId", new IntegerValidator());
+            $this->registerFieldValidator("commentText", new StringValidator());
+            $this->registerFieldValidator("authorName", new StringValidator());
+            $this->registerFieldValidator("commentStatus", new IntegerValidator());
+            $this->registerFieldValidator("commentTopic", new StringValidator(), true);
+            $this->registerFieldValidator("authorEmail", new EmailValidator(), true);
+            $this->registerFieldValidator("authorUrl", new HttpUrlValidator(), true);
+                // no validation...
+            $this->registerField("commentDateTime");
+            $this->registerField("commentIp");
+            
+            $view->setErrorMessage( $this->_locale->tr("invalid_data"));
+            $this->setValidationErrorView( $view );
+            $this->_fetchFields();
+        }
+    }
+    
+
+    function _fetchFields(){
+        include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+        $this->_trackbackId = $this->_request->getValue("trackbackId");
+
+        $this->_authorEmail = Textfilter::filterAllHTML($this->_request->getValue( "authorEmail" ));
+        $this->_authorUrl   = Textfilter::filterAllHTML($this->_request->getValue( "authorUrl" ));
+        if( (strlen($this->_authorUrl) != 0) &&
+            ereg('^https?://',$this->_authorUrl) == false)
+        {
+            $this->_authorUrl = "http://".$this->_authorUrl;
+        }
+        $this->_authorName  = Textfilter::filterAllHTML($this->_request->getValue( "authorName" ));
+        $this->_commentText = trim($this->_request->getValue( "commentText" ));
+        $this->_commentTopic = Textfilter::filterAllHTML($this->_request->getValue( "commentTopic" ));
+        $this->_commentStatus = $this->_request->getValue("commentStatus");
+        $this->_commentIp = $this->_request->getValue("commentIp");
+        $this->_commentNormalizedTopic = Textfilter::normalizeText($this->_commentTopic);
+        $this->_commentNormalizedText = Textfilter::normalizeText($this->_commentText);
+        
+        $this->_commentDateTime = $this->_fetchCommentDateInformation();
+    }
+
+        // copied from AdminPostManagementCommon class
+    function _fetchCommentDateInformation(){
+        $commentDateTime = $this->_request->getValue("commentDateTime");
+        $dateTimeParts = explode(" ", $commentDateTime);
+        $dateParts = explode("/", $dateTimeParts[0] );
+        $timeParts = explode(":",$dateTimeParts[1] );
+        
+        $postTimestamp = new Timestamp();
+        $postTimestamp->setMinutes($timeParts[1]);
+        $postTimestamp->setHour($timeParts[0]);
+        $postTimestamp->setDay($dateParts[0]);
+        $postTimestamp->setMonth($dateParts[1]);
+        $postTimestamp->setYear($dateParts[2]);
+
+        return $postTimestamp->getTimestamp();
+    }
+
+    
+    function perform(){
+        if($this->_op == "updateTrackback"){
+            $trackbacks = new Trackbacks();
+            $trackback = $trackbacks->getTrackback($this->_trackbackId);
+
+            if(!$trackback){
+                $this->_view = new AdminEditTrackbackView($this->_blogInfo, $id);
+                $this->_view->setErrorMessage( $this->_locale->tr("pluginEditTrackbacksFailed") );
+            }
+            else if(!ArticleCommentStatus::isValidStatus($this->_commentStatus)){
+                $this->_view = new AdminEditTrackbackView($this->_blogInfo, $id);
+                $this->_view->setErrorMessage( $this->_locale->tr("pluginEditTrackbacksFailed") );
+            }
+            else{
+                $trackback->setTopic($this->_commentTopic);
+                $trackback->setText($this->_commentText);
+                $trackback->setUserName($this->_authorName);
+                $trackback->setUserEmail($this->_authorEmail);
+                $trackback->setUserUrl($this->_authorUrl);
+                $trackback->setDate($this->_commentDateTime);
+                $trackback->setStatus($this->_commentStatus);
+                $trackback->setClientIp($this->_commentIp);
+                $trackback->setNormalizedTopic($this->_commentNormalizedTopic);
+                $trackback->setNormalizedText($this->_commentNormalizedText);
+ 
+                if($trackbacks->updateComment($trackback)) {
+                    if($this->_articleId) {
+                        $articles = new Articles();
+                        $article = $articles->getBlogArticle($this->_articleId,
+                                                             $this->_blogInfo->getId());
+                        $this->_view = new AdminEditTrackbacksView ($this->_blogInfo,
+                                                                 array("article" => $article));
+                    }
+                    else {
+                        $this->_view = new AdminPostsListView( $this->_blogInfo );
+                    }
+                    $this->_view->setSuccessMessage( $this->_locale->tr("pluginEditTrackbacksOk") );
+                    CacheControl::resetBlogCache( $this->_blogInfo->getId());
+                }
+                else {
+                    $this->_view = new AdminEditTrackbacksView ($this->_blogInfo, $id);
+                    $this->_view->setErrorMessage( $this->_locale->tr("pluginEditTrackbacksFailed") );
+                }
+            }
+        }
+        else if($this->_articleId){
+            $articles = new Articles();
+            $article = $articles->getBlogArticle( $this->_articleId, $this->_blogInfo->getId());
+            
+            $this->_view = new AdminEditTrackbacksView ($this->_blogInfo, array("article" => $article));
+            $this->_view->setSuccessMessage( $this->_locale->tr("pluginEditTrackbacksCancelled") );
+        }
+        else{
+            $this->_view = new AdminPostsListView($this->_blogInfo);
+        }
+
+        $this->setCommonData();
+    }
+}
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.1/editcomments/class/view/adminedittrackbacksview.class.php
===================================================================
--- plugins/branches/lifetype-1.1/editcomments/class/view/adminedittrackbacksview.class.php	2006-12-02 03:09:27 UTC (rev 4374)
+++ plugins/branches/lifetype-1.1/editcomments/class/view/adminedittrackbacksview.class.php	2006-12-03 19:15:34 UTC (rev 4375)
@@ -0,0 +1,124 @@
+<?php
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+	include_once( PLOG_CLASS_PATH."class/dao/trackbacks.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/articlecommentstatus.class.php" );	
+    include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );	
+	include_once( PLOG_CLASS_PATH."class/data/pager/pager.class.php" );
+
+	class AdminEditTrackbacksView extends AdminPluginTemplatedView
+	{
+        var $_article;
+        var $_commentStatus;
+        var $_page;
+        var $_type;
+        
+		function AdminEditTrackbacksView ( $blogInfo, $params = Array() ){
+			$this->AdminPluginTemplatedView( $blogInfo, "editcomments", "edittrackbacks" );
+			$this->_setParameters( $params );
+            $this->_page = $this->getCurrentPageFromRequest();
+            $this->_type = COMMENT_TYPE_TRACKBACK;
+		}
+		
+		/**
+		 * @private
+		 */
+		function _setParameters( $params )
+		{
+			// fetch the article id
+			$this->_article = null;
+			if( isset( $params["article"] ))
+				$this->_article = $params["article"];
+						
+			// load the status
+			if( isset( $params["showStatus"] ))
+				$this->_commentStatus = $params["showStatus"];
+				
+			if( !ArticleCommentStatus::isValidStatus( $this->_commentStatus )) 
+				$this->_commentStatus = COMMENT_STATUS_ALL;	
+				
+			// laod the search terms
+			$this->_searchTerms = "";
+			if( isset( $params["searchTerms"] ))			
+				$this->_searchTerms = $params["searchTerms"];
+		}
+		
+		/**
+		 * show the contents of the view
+		 */
+		function render()
+		{
+			// load the comments and throw the correct event
+			$comments = new CommentsCommon();
+			if( $this->_article ) {
+				// load only the comments of the given post
+				$postComments = $comments->getPostComments( $this->_article->getId(),
+															COMMENT_ORDER_NEWEST_FIRST,
+															$this->_commentStatus, 
+															$this->_type,
+															$this->_page, 
+															DEFAULT_ITEMS_PER_PAGE );
+				// number of comments
+				$numPostComments = $comments->getNumPostComments( $this->_article->getId(), 
+				                                                  $this->_commentStatus,
+																  $this->_type );
+				// id of the article, for the pager...
+				$articleId = $this->_article->getId();
+			}
+			else {
+				// load all comments given the current status
+				$postComments = $comments->getBlogComments( $this->_blogInfo->getId(),
+				                                            COMMENT_ORDER_NEWEST_FIRST,
+				                                            $this->_commentStatus,
+															$this->_type,
+															$this->_searchTerms,
+														    $this->_page,
+														    DEFAULT_ITEMS_PER_PAGE );
+				// number of comments
+				$numPostComments = $comments->getNumBlogComments( $this->_blogInfo->getId(),
+				                                                  $this->_commentStatus,
+																  $this->_type,
+																  $this->_searchTerms );
+				// no article id...
+				$articleId = 0;
+			}
+			$this->notifyEvent( EVENT_COMMENTS_LOADED, Array( "comments", &$postComments ));
+			
+			if( $this->_type == COMMENT_TYPE_COMMENT )
+				$pagerUrl = "?op=editComments";
+			else
+				$pagerUrl = "?op=editTrackbacks";
+
+			if( $this->_commentStatus > -1 )
+				$pagerUrl .= "&amp;articleId={$articleId}&amp;showStatus=".$this->_commentStatus."&amp;searchTerms=".$this->_searchTerms."&amp;page=";
+			else
+				$pagerUrl .= "&amp;articleId={$articleId}&amp;searchTerms=".$this->_searchTerms."&amp;page=";
+				
+			// calculate the pager url
+			$pager = new Pager( $pagerUrl,
+					    $this->_page,
+					    $numPostComments,
+					    DEFAULT_ITEMS_PER_PAGE );					
+														
+			// get a list with all the different comment status
+			$statusList = ArticleCommentStatus::getStatusList( true );
+			$statusListWithoutAll = ArticleCommentStatus::getStatusList( false );
+			
+			// and pass all the information to the templates
+			$this->setValue( "comments", $postComments);
+			$this->setValue( "commentstatus", $statusList );
+			$this->setValue( "commentstatusWithoutAll", $statusListWithoutAll );
+			$this->setValue( "currentstatus", $this->_commentStatus );
+			$this->setValue( "searchTerms", $this->_searchTerms );
+
+			// pass the pager to the view
+			$this->setValue( "pager", $pager );+
+		
+			// pass the common data to the templates
+			$this->setValue( "post", $this->_article );
+						
+			parent::render();
+		}
+
+	}
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.1/editcomments/class/view/adminedittrackbackview.class.php
===================================================================
--- plugins/branches/lifetype-1.1/editcomments/class/view/adminedittrackbackview.class.php	2006-12-02 03:09:27 UTC (rev 4374)
+++ plugins/branches/lifetype-1.1/editcomments/class/view/adminedittrackbackview.class.php	2006-12-03 19:15:34 UTC (rev 4375)
@@ -0,0 +1,36 @@
+<?php
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+	include_once( PLOG_CLASS_PATH."class/dao/trackbacks.class.php" );
+
+	class AdminEditTrackbackView extends AdminPluginTemplatedView
+	{
+        var $_trackbackId;
+        
+		function AdminEditTrackbackView($blogInfo, $trackbackId){
+            $this->_trackbackId = $trackbackId;
+			$this->AdminPluginTemplatedView( $blogInfo, "editcomments", "edittrackback" );
+		}
+		
+		function render(){
+                // fetch trackback
+			$trackbacks = new Trackbacks();
+			$tb = $trackbacks->getTrackBack($this->_trackbackId);
+
+            if($tb){
+                $tbDate = $tb->getDateObject();
+                $this->setValue( "tbYear", $tbDate->getYear());
+                $this->setValue( "tbMonth", $tbDate->getMonth());
+                $this->setValue( "tbDay", $tbDate->getDay());
+                $this->setValue( "tbHour", $tbDate->getHour());
+                $this->setValue( "tbMinutes", $tbDate->getMinutes());
+            }
+
+            $statusList = ArticleCommentStatus::getStatusList();
+            $this->setValue( "tbstatus", $statusList );
+			$this->setValue( "edittrackback", $tb );
+
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Modified: plugins/branches/lifetype-1.1/editcomments/locale/locale_en_UK.php
===================================================================
--- plugins/branches/lifetype-1.1/editcomments/locale/locale_en_UK.php	2006-12-02 03:09:27 UTC (rev 4374)
+++ plugins/branches/lifetype-1.1/editcomments/locale/locale_en_UK.php	2006-12-03 19:15:34 UTC (rev 4375)
@@ -1,11 +1,12 @@
 <?php
-
 $messages["pluginEditCommentsEdit"] = "Edit Comment";
-
+$messages["pluginEditTrackbacksEdit"] = "Edit Trackback";
 $messages["pluginEditCommentsCancel"] = "Cancel";
 $messages["pluginEditCommentsOk"] = "Comment saved successfully!";
+$messages["pluginEditTrackbacksOk"] = "Trackback saved successfully!";
 $messages["pluginEditCommentsCancelled"] = "Comment edits discarded.";
+$messages["pluginEditTrackbacksCancelled"] = "Trackback edits discarded.";
 $messages["pluginEditCommentsFailed"] = "Comment editing failed.";
-
+$messages["pluginEditTrackbacksFailed"] = "Trackback editing failed.";
 $messages["pluginEditCommentsDateFormat"] = "dd/mm/yyyy hh:mm:ss";
 ?>
\ No newline at end of file

Modified: plugins/branches/lifetype-1.1/editcomments/plugineditcomments.class.php
===================================================================
--- plugins/branches/lifetype-1.1/editcomments/plugineditcomments.class.php	2006-12-02 03:09:27 UTC (rev 4374)
+++ plugins/branches/lifetype-1.1/editcomments/plugineditcomments.class.php	2006-12-03 19:15:34 UTC (rev 4375)
@@ -20,11 +20,15 @@
 		function init(){			
                 // Override(!) the default editComments action.  Cool
 			$this->registerAdminAction( "editComments", "AdminPluginEditCommentsAction" );
+            $this->registerAdminAction( "editTrackbacks", "AdminPluginEditTrackbacksAction" );
 
                 // Here are our additional features that we are adding to the regular
                 // comment adding
             $this->registerAdminAction( "editComment", "AdminEditCommentAction" );
 			$this->registerAdminAction( "updateComment", "AdminUpdateCommentAction" );
+            
+            $this->registerAdminAction( "editTrackback", "AdminEditTrackbackAction" );
+			$this->registerAdminAction( "updateTrackback", "AdminUpdateTrackbackAction" );
 		}
 	}  
 ?>
\ No newline at end of file

Modified: plugins/branches/lifetype-1.1/editcomments/readme.txt
===================================================================
--- plugins/branches/lifetype-1.1/editcomments/readme.txt	2006-12-02 03:09:27 UTC (rev 4374)
+++ plugins/branches/lifetype-1.1/editcomments/readme.txt	2006-12-03 19:15:34 UTC (rev 4375)
@@ -1,10 +1,10 @@
 Plugin: EditComments
 Author: Jon Daley
-Release Date: 2006/11/07
-Version: 1.1
+Release Date: 2006/12/03
+Version: 1.2
 
-This plugin allows the blog owner to edit comments via the
-administration interface to fix typos, etc.
+This plugin allows the blog owner to edit comments and trackbacks
+via the administration interface to fix typos, etc.
 
 Install:
 1. Copy the files into your plugin directory like any other plugin.
@@ -16,3 +16,5 @@
    to edit the actual comment.
 3. Click that button, and you should be able to see the topic, text,
    username, url, etc. to manually edit.
+   
+(editing trackbacks works exactly the same way)
\ No newline at end of file

Added: plugins/branches/lifetype-1.1/editcomments/templates/edittrackback.template
===================================================================
--- plugins/branches/lifetype-1.1/editcomments/templates/edittrackback.template	2006-12-02 03:09:27 UTC (rev 4374)
+++ plugins/branches/lifetype-1.1/editcomments/templates/edittrackback.template	2006-12-03 19:15:34 UTC (rev 4375)
@@ -0,0 +1,78 @@
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=editTrackbacks title=$locale->tr("pluginEditTrackbacksEdit")}
+<script type="text/javascript" src="js/calendar/datetimepicker.js"></script>
+
+<form id="editComment" action="admin.php" method="post">
+ <div id="list">
+  {include file="$admintemplatepath/successmessage.template"}
+  {include file="$admintemplatepath/errormessage.template"}
+  <table class="info">
+    <tr>
+     <th>{$locale->tr("topic")}</th>
+     <td><input size="50" type="text" name="commentTopic" id=commentTopic"
+             value="{$edittrackback->getTopic()}" /></td>
+    </tr>
+    <tr>
+     <th style="vertical-align: top">{$locale->tr("text")}</th>
+     <td><textarea name="commentText" id="commentText"
+          rows="10" cols="50">{$edittrackback->getText()}</textarea>
+     </td>
+    </tr>
+    <tr>
+     <th>{$locale->tr("author")}</th>
+     <td><input type="text" name="authorName" id=authorName"
+             value="{$edittrackback->getUsername()}" /></td>
+    </tr>
+    <tr>
+     <th>{$locale->tr("email")}</th>
+     <td><input size="30" type="text" name="authorEmail" id=authorEmail"
+             value="{$edittrackback->getUserEmail()}" /></td>
+    </tr>
+    <tr>
+     <th>{$locale->tr("url")}</th>
+     <td><input size=60 type="text" name="authorUrl" id="authorUrl"
+             value="{$edittrackback->getUserUrl()}" /></td>
+    </tr>
+    <tr>
+	 <th>{$locale->tr("date")}</th>
+      <td>
+         {$locale->tr("pluginEditCommentsDateFormat")}<br/>
+		 <input name="commentDateTime" id="commentDateTime" class="dateTime"
+               readonly="true" type="text" size="20"
+               value="{$tbDay}/{$tbMonth}/{$tbYear} {$tbHour}:{$tbMinutes}" />
+        <a href="javascript:NewCal('commentDateTime','ddmmyyyy',true,24);">
+          <img src="imgs/admin/cal.jpg"
+               alt="{$locale->tr("pick_date")}" 
+               style="border:0px" /></a>
+     </td>
+    </tr>
+    <tr>
+     <th>{$locale->tr("status")}</th>
+     <td>
+       <select name="commentStatus" id="commentStatus">
+         {foreach from=$tbstatus key=name item=status}
+           <option value="{$status}"
+             {if $edittrackback->getStatus() == $status} selected{/if}>
+           {$locale->tr($name)}</option>
+         {/foreach}
+       </select>
+      </td>
+    </tr>
+    <tr>
+     <th>IP</th>
+     <td><input type="text" name="commentIp" id=commentIp"
+             value="{$edittrackback->getClientIp()}" /></td>
+    </tr>
+  </table>
+ </div>
+
+ <div id="list_action_bar">
+  <input type="hidden" name="op" value="updateTrackback" />
+  <input type="hidden" name="trackbackId" value="{$edittrackback->getId()}" />
+  <input type="hidden" name="articleId" value="{$edittrackback->getArticleId()}" />
+  <input type="submit" name="update" value="{$locale->tr("update")}" />
+  <input type="submit" name="cancel" value="{$locale->tr("pluginEditCommentsCancel")}" />
+ </div>
+</form>
+
+{include file="$admintemplatepath/footer.template"}

Added: plugins/branches/lifetype-1.1/editcomments/templates/edittrackbacks.template
===================================================================
--- plugins/branches/lifetype-1.1/editcomments/templates/edittrackbacks.template	2006-12-02 03:09:27 UTC (rev 4374)
+++ plugins/branches/lifetype-1.1/editcomments/templates/edittrackbacks.template	2006-12-03 19:15:34 UTC (rev 4375)
@@ -0,0 +1,144 @@
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=editTrackbacks title=$locale->tr("editTrackbacks")}
+	<script type="text/javascript" src="js/ui/plogui.js"></script>
+	<script type="text/javascript">
+		var errorTrackbackStatusMsg = '{$locale->tr("error_trackback_status")}';
+		var showMassiveChangeOption = '{$locale->tr("show_massive_change_option")}';
+		var hideMassiveChangeOption = '{$locale->tr("hide_massive_change_option")}';
+	</script>
+        <div id="list_nav_bar">
+            <div id="list_nav_select">		
+
+                <form id="showBy" action="admin.php" method="post">
+                <fieldset>
+                <legend>{$locale->tr("show_by")} {if $post}( {$post->getTopic()} ){/if}</legend>
+
+                    <div class="list_nav_option">
+                    <label for="showStatus">{$locale->tr("status")}</label>
+                    <br />
+                    <select name="showStatus" id="showStatus">
+                     {foreach from=$commentstatus key=name item=status}
+                     <option value="{$status}" {if $currentstatus == $status} selected="selected"{/if}>{$locale->tr($name)}</option>
+                     {/foreach}
+                    </select>
+                    </div>
+
+                    <div class="list_nav_option">
+                    <label for="search">{$locale->tr("search_terms")}</label>
+                    <br />
+                    <input type="text" name="searchTerms" value="{$searchTerms}" size="15" id="search" />
+                    </div>										
+					
+                    <div class="list_nav_option">
+                    <br />
+                    <input type="hidden" name="op" value="editTrackbacks" />
+					{if $post}<input type="hidden" name="articleId" value="{$post->getId()}" />{/if}
+                    <input type="submit" name="show" value="{$locale->tr("show")}" class="submit" />
+                    </div>
+
+                </fieldset>
+                </form>
+            </div>
+            <br style="clear:both;" />
+        </div>
+
+        <form id="postTrackbacksList" action="admin.php" method="post">
+        <div class="optionIcon">
+			<a id="optionIconLink" href="#bulkEdit" title="{$locale->tr("show_massive_change_option")}" onclick="switchMassiveOption()">{$locale->tr("show_massive_change_option")}</a>
+		</div>
+        <div id="list">
+		  {include file="$admintemplatepath/successmessage.template"}
+		  {include file="$admintemplatepath/errormessage.template"}
+            <table class="info">
+                <thead>
+                    <tr>
+                        <th style="width:10px;"><input class="checkbox" type="checkbox" name="all" id="all" value="1" onclick="toggleAllChecks('postTrackbacksList');" /></th>
+                        <th style="width:85px;">{$locale->tr("topic")}</th>						
+                        <th style="width:360px;">{$locale->tr("text")}</th>
+                        <th style="width:70px;">{$locale->tr("author")}</th>
+						<th style="width:60px;">{$locale->tr("date")}</th>
+                        <th style="width:60px;">{$locale->tr("status")}</th>
+                        <th style="width:45px;">IP</th>
+                        <th style="width:95px;">{$locale->tr("actions")}</th>
+                    </tr>
+                </thead>
+                <tbody>
+                   {foreach from=$comments item=trackback}
+                    <tr class="{cycle values="odd,even"}">
+                        <td>
+                            <input class="checkbox" type="checkbox" name="trackbackIds[{$trackback->getId()}]" id="trackbackIds[{$trackback->getId()}]" value="{$trackback->getId()}" />
+                        </td>
+                        <td class="col_highlighted">
+                            {$trackback->getTopic()|strip_tags|utf8_wordwrap:12:"<br/>":true}
+                        </td>
+                        <td>
+                            {$trackback->getText()|strip_tags|utf8_wordwrap:35:"<br/>":true}
+                        </td>
+                        <td>
+                            <a href="{$trackback->getUserUrl()}">{$trackback->getUserName()}</a>
+                        </td>
+                        <td>
+                            {assign var=date value=$trackback->getDateObject()}
+                            {$locale->formatDate($date)}
+                        </td>
+                        <td>
+                          {foreach from=$commentstatus key=name item=status}
+                           {if $trackback->getStatus() == $status}{$locale->tr($name)}{/if}
+                          {/foreach}
+                        </td>
+                        <td style="text-align: center;">
+						  {$trackback->getClientIp()}
+                        </td>														                
+                        <td>
+                            <div class="list_action_button">
+                             <a href="?op=deleteTrackback&amp;articleId={if $post}{$post->getId()}{else}0{/if}&amp;trackbackId={$trackback->getId()}" title="{$locale->tr("delete_trackback")}">
+                             	<img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete_trackback")}" />
+                             </a>
+							{if $bayesian_filter_enabled}
+								{if $trackback->getStatus() == 0}
+								    <a href="?op=markTrackback&amp;mode=1&amp;articleId={if $post}{$post->getId()}{else}0{/if}&amp;trackbackId={$trackback->getId()}" title="{$locale->tr("mark_as_spam")}">
+									 <img src="imgs/admin/icon_spam-16.png" alt="{$locale->tr("mark_as_spam")}" />
+									</a>
+								{elseif $trackback->getStatus() == 1}
+									<a href="?op=markTrackback&amp;mode=0&amp;articleId={if $post}{$post->getId()}{else}0{/if}&amp;trackbackId={$trackback->getId()}" title="{$locale->tr("mark_as_no_spam")}">
+									 <img src="imgs/admin/icon_nospam-16.png" alt="{$locale->tr("mark_as_no_spam")}" />
+									</a>
+								{/if}
+							{/if}
+                            {if $trackback->getUserUrl()}
+                                <a href="{$trackback->getUserUrl()}" title="{$locale->tr("url")}">
+                                 <img src="imgs/admin/icon_url-16.png" alt="{$locale->tr("url")}" />
+                                </a>
+                            {/if}
+                            <a href="?op=editTrackback&amp;trackbackId={$trackback->getId()}"><img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
+                            </div>
+                        </td>
+                    </tr>
+                    {/foreach}
+                </tbody>
+            </table>
+        </div>
+        <a name="bulkEdit"></a>
+        <div id="list_action_bar">
+            {adminpager style=list}
+			<input type="hidden" name="articleId" value="{if $post}{$post->getId()}{else}0{/if}" />
+            <input type="button" name="delete" value="{$locale->tr("delete")}" class="submit" onClick="javascript:submitTrackbacksList('deleteTrackbacks');" />
+            <input type="hidden" name="op" value="" />            
+            <div id="massiveChangeOption" style="display: none;">
+                <fieldset>
+                <legend>{$locale->tr("massive_change_option")}</legend>            
+		            <label for="trackbackStatus">{$locale->tr("status")}</label>
+		            <select name="trackbackStatus" id="trackbackStatus">
+		              <option value="-1">-{$locale->tr("select")}-</option>
+		              {foreach from=$commentstatusWithoutAll key=name item=status}
+		                {if ($status != 0 && $status != 1) || $bayesian_filter_enabled}<option value="{$status}">{$locale->tr($name)}</option>{/if}
+		              {/foreach}
+		            </select>
+		            <input type="button" name="changeTrackbacksStatus" value="{$locale->tr("change_status")}" class="submit" onClick="javascript:submitTrackbacksList('changeTrackbacksStatus');" /> 
+		        </fieldset>
+			</div>
+        </div>            
+
+	</form>
+{include file="$admintemplatepath/footernavigation.template"}
+{include file="$admintemplatepath/footer.template"}
\ No newline at end of file



More information about the pLog-svn mailing list