[pLog-svn] r4261 - in plugins/branches/lifetype-1.1: .
editcomments/class/action editcomments/class/view
editcomments/locale editcomments/templates unported
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Wed Nov 8 04:27:12 GMT 2006
Author: jondaley
Date: 2006-11-08 04:27:10 +0000 (Wed, 08 Nov 2006)
New Revision: 4261
Added:
plugins/branches/lifetype-1.1/editcomments/
plugins/branches/lifetype-1.1/editcomments/class/action/adminplugineditcommentsaction.class.php
plugins/branches/lifetype-1.1/editcomments/class/action/adminupdatecommentaction.class.php
plugins/branches/lifetype-1.1/editcomments/class/view/admineditcommentsview.class.php
plugins/branches/lifetype-1.1/editcomments/locale/locale_en_UK.php
plugins/branches/lifetype-1.1/editcomments/templates/editcomment.template
plugins/branches/lifetype-1.1/editcomments/templates/editcomments.template
Removed:
plugins/branches/lifetype-1.1/editcomments/class/action/adminplugineditcommentsaction.class.php
plugins/branches/lifetype-1.1/editcomments/class/action/adminupdatecommentaction.class.php
plugins/branches/lifetype-1.1/editcomments/class/view/admineditcommentsview.class.php
plugins/branches/lifetype-1.1/editcomments/locale/locale_en_UK.php
plugins/branches/lifetype-1.1/editcomments/templates/editcomment.template
plugins/branches/lifetype-1.1/editcomments/templates/editcomments.template
plugins/branches/lifetype-1.1/unported/editcomments/
Log:
updated to 1.1
Copied: plugins/branches/lifetype-1.1/editcomments (from rev 4258, plugins/branches/lifetype-1.1/unported/editcomments)
Deleted: plugins/branches/lifetype-1.1/editcomments/class/action/adminplugineditcommentsaction.class.php
===================================================================
--- plugins/branches/lifetype-1.1/unported/editcomments/class/action/adminplugineditcommentsaction.class.php 2006-11-08 03:31:00 UTC (rev 4258)
+++ plugins/branches/lifetype-1.1/editcomments/class/action/adminplugineditcommentsaction.class.php 2006-11-08 04:27:10 UTC (rev 4261)
@@ -1,36 +0,0 @@
-<?php
-
- include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
- include_once( PLOG_CLASS_PATH."plugins/editcomments/class/view/admineditcommentsview.class.php" );
-
- /**
- * actions that displays the list of comments in the blog.
- */
- class AdminPluginEditCommentsAction extends AdminAction{
-
- function AdminPluginEditCommentsAction($actionInfo, $request){
- $this->AdminAction($actionInfo, $request);
- }
-
- function perform(){
- $articleId = $this->_request->getValue( "articleId" );
- $showStatus = $this->_request->getValue( "showStatus" );
-
- $articles = new Articles();
- $article = $articles->getBlogArticle( $articleId, $this->_blogInfo->getId());
- if( !$article ) {
- $this->_view = new AdminPostsListView( $this->_blogInfo );
- $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_post" ));
- }
- else{
- $this->_view = new AdminEditCommentsView( $this->_blogInfo,
- Array("article" => $article,
- "showStatus" => $showStatus));
- }
-
- $this->setCommonData();
-
- return true;
- }
- }
-?>
\ No newline at end of file
Copied: plugins/branches/lifetype-1.1/editcomments/class/action/adminplugineditcommentsaction.class.php (from rev 4260, plugins/branches/lifetype-1.1/unported/editcomments/class/action/adminplugineditcommentsaction.class.php)
Deleted: plugins/branches/lifetype-1.1/editcomments/class/action/adminupdatecommentaction.class.php
===================================================================
--- plugins/branches/lifetype-1.1/unported/editcomments/class/action/adminupdatecommentaction.class.php 2006-11-08 03:31:00 UTC (rev 4258)
+++ plugins/branches/lifetype-1.1/editcomments/class/action/adminupdatecommentaction.class.php 2006-11-08 04:27:10 UTC (rev 4261)
@@ -1,138 +0,0 @@
-<?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/admineditcommentview.class.php" );
-include_once( PLOG_CLASS_PATH."plugins/editcomments/class/view/admineditcommentsview.class.php" );
-include_once( PLOG_CLASS_PATH."class/view/admin/adminpostslistview.class.php" );
-
-class AdminUpdateCommentAction extends AdminAction{
- var $_commentId;
- var $_articleId;
- var $_op;
-
- function AdminUpdateCommentAction($actionInfo, $request){
- $this->AdminAction($actionInfo, $request);
-
- $this->_commentId = $this->_request->getValue("commentId");
- $this->_articleId = $this->_request->getValue("articleId");
- $this->_op = $actionInfo->getActionParamValue();
- if($this->_request->getValue("cancel")){
- $this->_op = "cancel";
- }
-
- if($this->_op == "updateComment"){
- $view = new AdminEditCommentView($this->_blogInfo, $commentId);
-
- $this->registerFieldValidator("commentId", new IntegerValidator());
- $this->registerFieldValidator("commentText", new StringValidator());
- $this->registerFieldValidator("authorName", new StringValidator());
- $this->registerFieldValidator("commentStatus", new IntegerValidator());
- // no validation??
- $this->registerField("commentTopic");
- $this->registerField("authorEmail");
- $this->registerField("authorUrl");
- $this->registerField("commentDateTime");
- $this->registerField("commentIp");
-
- $view->setErrorMessage( $this->_locale->tr("invalid_data"));
- $this->setValidationErrorView( $view );
- }
- }
-
- function _updateComment($id, $topic, $text, $user_name, $user_email,
- $user_url, $client_ip, $status, $date){
- if(!ArticleCommentStatus::isValidStatus($status))
- return false;
-
- $prefix = Db::getPrefix();
- $filter = new TextFilter();
- $db =& Db::getDb();
-
- $query = "UPDATE ".$prefix."articles_comments ";
- $query .= "set topic='".Db::qstr($topic)."', ";
- $query .= "text='".Db::qstr($text)."', ";
- $query .= "user_name='".Db::qstr($user_name)."', ";
- $query .= "user_email='".Db::qstr($user_email)."', ";
- $query .= "user_url='".Db::qstr($user_url)."', ";
- $query .= "client_ip='".$client_ip."', ";
- $query .= "status=".$status.", ";
- $query .= "date='".$date->getTimestamp()."', ";
- $query .= "normalized_text='".Db::qstr($filter->normalizeText($text))."', ";
- $query .= "normalized_topic='".Db::qstr($filter->normalizeText($topic))."' ";
- $query .= "WHERE id=".$id;
-// print $query;
- return($db->Execute( $query ));
-
- return false;
- }
-
- // 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;
- }
-
-
- function perform(){
- if($this->_op == "updateComment"){
- $topic = $this->_request->getValue("commentTopic");
- $text = $this->_request->getValue("commentText");
- $name = $this->_request->getValue("authorName");
- $email = $this->_request->getValue("authorEmail");
- $url = $this->_request->getValue("authorUrl");
- $dateTime = $this->_fetchCommentDateInformation();
- $status = $this->_request->getValue("commentStatus");
- $ip = $this->_request->getValue("commentIp");
-
- if($this->_updateComment($this->_commentId, $topic, $text, $name, $email,
- $url, $ip, $status, $dateTime)){
- if($this->_articleId){
- $articles = new Articles();
- $article = $articles->getBlogArticle($this->_articleId,
- $this->_blogInfo->getId());
- $this->_view = new AdminEditCommentsView($this->_blogInfo,
- array("article" => $article));
- }
- else{
- $this->_view = new AdminPostsListView( $this->_blogInfo );
- }
- $this->_view->setSuccessMessage( $this->_locale->tr("edit_comment_ok") );
- CacheControl::resetBlogCache( $this->_blogInfo->getId());
- }
- else{
- $this->_view = new AdminEditCommentView($this->_blogInfo, $id);
- $this->_view->setErrorMessage( $this->_locale->tr("edit_comment_failed") );
- }
- }
- else if($this->_articleId){
- $articles = new Articles();
- $article = $articles->getBlogArticle( $this->_articleId, $this->_blogInfo->getId());
-
- $this->_view = new AdminEditCommentsView($this->_blogInfo, array("article" => $article));
- $this->_view->setSuccessMessage( $this->_locale->tr("edit_comment_cancelled") );
- }
- else{
- $this->_view = new AdminPostsListView($this->_blogInfo);
- }
-
-
- $this->setCommonData();
- }
-}
-?>
\ No newline at end of file
Copied: plugins/branches/lifetype-1.1/editcomments/class/action/adminupdatecommentaction.class.php (from rev 4260, plugins/branches/lifetype-1.1/unported/editcomments/class/action/adminupdatecommentaction.class.php)
Deleted: plugins/branches/lifetype-1.1/editcomments/class/view/admineditcommentsview.class.php
===================================================================
--- plugins/branches/lifetype-1.1/unported/editcomments/class/view/admineditcommentsview.class.php 2006-11-08 03:31:00 UTC (rev 4258)
+++ plugins/branches/lifetype-1.1/editcomments/class/view/admineditcommentsview.class.php 2006-11-08 04:27:10 UTC (rev 4261)
@@ -1,84 +0,0 @@
-<?php
-
- include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
- include_once( PLOG_CLASS_PATH."class/dao/articlecomments.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 AdminEditCommentsView extends AdminPluginTemplatedView
- {
- var $_article;
- var $_commentStatus;
- var $_page;
-
- function AdminEditCommentsView( $blogInfo, $params = Array() ){
- $this->AdminPluginTemplatedView( $blogInfo, "editcomments", "editcomments" );
- $this->_setParameters( $params );
- $this->_page = $this->getCurrentPageFromRequest();
-
- }
-
- function render(){
- // load the comments and throw the correct event
- $comments = new ArticleComments();
- $postComments = $comments->getPostComments( $this->_article->getId(),
- COMMENT_ORDER_NEWEST_FIRST,
- $this->_commentStatus,
- $this->_page,
- DEFAULT_ITEMS_PER_PAGE );
- $this->notifyEvent( EVENT_COMMENTS_LOADED, Array( "comments", &$postComments ));
- // number of comments
- $numPostComments = $comments->getNumPostComments( $this->_article->getId(), $this->_commentStatus );
-
- if( $this->_commentStatus > -1 )
- $pagerUrl = "?op=editComments&articleId=".$this->_article->getId()."&showStatus=".$this->_commentStatus."&page=";
- else
- $pagerUrl = "?op=editComments&articleId=".$this->_article->getId()."&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 );
- // and pass all the information to the templates
- $this->setValue( "comments", $postComments);
- $this->setValue( "commentstatus", $statusList );
- $this->setValue( "currentstatus", $this->_commentStatus );
-
- // pass the pager to the view
- $this->setValue( "pager", $pager );+
-
- // pass the common data to the templates
- $this->setValue( "post", $this->_article );
-
- parent::render();
-
-/*// print "admineditcommentsview->render";
- // fetch comments
- // TODO: set max? show grouped by post?
- $_articleComments = new ArticleComments();
- $comments = $_articleComments->getBlogComments( $this->_blogInfo->getId());
-
- // create a view and export the settings to the template
- $this->setValue( "editcomments", $comments );
-
- parent::render();*/
- }
-
- function _setParameters( $params )
- {
- // fetch the article id
- $this->_article = $params["article"];
-
- // load the status
- $this->_commentStatus = $params["showStatus"];
- if( !ArticleCommentStatus::isValidStatus( $this->_commentStatus ))
- $this->_commentStatus = COMMENT_STATUS_ALL;
- }
-
- }
-?>
\ No newline at end of file
Copied: plugins/branches/lifetype-1.1/editcomments/class/view/admineditcommentsview.class.php (from rev 4260, plugins/branches/lifetype-1.1/unported/editcomments/class/view/admineditcommentsview.class.php)
Deleted: plugins/branches/lifetype-1.1/editcomments/locale/locale_en_UK.php
===================================================================
--- plugins/branches/lifetype-1.1/unported/editcomments/locale/locale_en_UK.php 2006-11-08 03:31:00 UTC (rev 4258)
+++ plugins/branches/lifetype-1.1/editcomments/locale/locale_en_UK.php 2006-11-08 04:27:10 UTC (rev 4261)
@@ -1,11 +0,0 @@
-<?php
-
-$messages["editComments"] = "Edit Comments";
-$messages["editComment"] = "Edit Comment";
-
-$messages["editCommentCancel"] = "Cancel";
-$messages["edit_comment_ok"] = "Comment saved successfully!";
-$messages["edit_comment_cancelled"] = "Comment edits discarded.";
-
-$messages["edit_date_format"] = "dd/mm/yyyy hh:mm:ss";
-?>
\ No newline at end of file
Copied: plugins/branches/lifetype-1.1/editcomments/locale/locale_en_UK.php (from rev 4260, plugins/branches/lifetype-1.1/unported/editcomments/locale/locale_en_UK.php)
Deleted: plugins/branches/lifetype-1.1/editcomments/templates/editcomment.template
===================================================================
--- plugins/branches/lifetype-1.1/unported/editcomments/templates/editcomment.template 2006-11-08 03:31:00 UTC (rev 4258)
+++ plugins/branches/lifetype-1.1/editcomments/templates/editcomment.template 2006-11-08 04:27:10 UTC (rev 4261)
@@ -1,78 +0,0 @@
-{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=editPosts title=$locale->tr("editComment")}
-<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="{$editcomment->getTopic()}" /></td>
- </tr>
- <tr>
- <th style="vertical-align: top">{$locale->tr("text")}</th>
- <td><textarea name="commentText" id="commentText"
- rows="10" cols="50">{$editcomment->getText()}</textarea>
- </td>
- </tr>
- <tr>
- <th>{$locale->tr("author")}</th>
- <td><input type="text" name="authorName" id=authorName"
- value="{$editcomment->getUsername()}" /></td>
- </tr>
- <tr>
- <th>{$locale->tr("email")}</th>
- <td><input size="30" type="text" name="authorEmail" id=authorEmail"
- value="{$editcomment->getUserEmail()}" /></td>
- </tr>
- <tr>
- <th>{$locale->tr("url")}</th>
- <td><input size=60 type="text" name="authorUrl" id="authorUrl"
- value="{$editcomment->getUserUrl()}" /></td>
- </tr>
- <tr>
- <th>{$locale->tr("date")}</th>
- <td>
- {$locale->tr("edit_date_format")}<br/>
- <input name="commentDateTime" id="commentDateTime" class="dateTime"
- readonly="true" type="text" size="20"
- value="{$commentDay}/{$commentMonth}/{$commentYear} {$commentHour}:{$commentMinutes}" />
- <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=$commentstatus key=name item=status}
- <option value="{$status}"
- {if $editcomment->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="{$editcomment->getClientIp()}" /></td>
- </tr>
- </table>
- </div>
-
- <div id="list_action_bar">
- <input type="hidden" name="op" value="updateComment" />
- <input type="hidden" name="commentId" value="{$editcomment->getId()}" />
- <input type="hidden" name="articleId" value="{$editcomment->getArticleId()}" />
- <input type="submit" name="update" value="{$locale->tr("update")}" />
- <input type="submit" name="cancel" value="{$locale->tr("editCommentCancel")}" />
- </div>
-</form>
-
-{include file="$admintemplatepath/footer.template"}
Copied: plugins/branches/lifetype-1.1/editcomments/templates/editcomment.template (from rev 4260, plugins/branches/lifetype-1.1/unported/editcomments/templates/editcomment.template)
Deleted: plugins/branches/lifetype-1.1/editcomments/templates/editcomments.template
===================================================================
--- plugins/branches/lifetype-1.1/unported/editcomments/templates/editcomments.template 2006-11-08 03:31:00 UTC (rev 4258)
+++ plugins/branches/lifetype-1.1/editcomments/templates/editcomments.template 2006-11-08 04:27:10 UTC (rev 4261)
@@ -1,112 +0,0 @@
-{* copied from /templates/admin/editcomments.template *}
-{include file="$admintemplatepath/header.template"}
-{include file="$admintemplatepath/navigation.template" showOpt=editPosts title=$locale->tr("editComments")}
- <div id="list_nav_bar">
- <div id="list_nav_select">
-
- <form id="showBy" action="admin.php" method="post">
- <fieldset>
- <legend>{$locale->tr("show_by")}</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">
- <br />
- <input type="hidden" name="op" value="editComments" />
- <input type="hidden" name="articleId" value="{$post->getId()}" />
- <input type="submit" name="show" value="{$locale->tr("show")}" class="submit" />
- </div>
-
- </fieldset>
- </form>
- </div>
- <br style="clear:both;" />
- </div>
-
- <form id="postCommentsList" action="admin.php" method="post">
- <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" class="check" name="all" id="all" value="1" onclick="toggleAllChecks('postCommentsList');" /></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 stlye="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=comment}
- <tr class="{cycle values="odd, even"}">
- <td>
- <input class="checkbox" type="checkbox" name="commentIds[{$comment->getId()}]" id="checks_{$comment->getId()}" value="{$comment->getId()}" />
- </td>
- <td class="col_highlighted">
- {$comment->getTopic()|strip_tags}
- </td>
- <td>
- {$comment->getText()}
- </td>
- <td>
- <a href="mailto:{$comment->getUserEmail()}">
- {$comment->getUsername()}
- </a>
- </td>
- <td>
- {assign var=date value=$comment->getDateObject()}
- {$locale->formatDate($date)}
- </td>
- <td>
- {foreach from=$commentstatus key=name item=status}
- {if $comment->getStatus() == $status}{$locale->tr($name)}{/if}
- {/foreach}
- </td>
- <td style="text-align: center;">
- {$comment->getClientIp()}
- </td>
- <td>
- <div class="list_action_button">
- <a href="?op=deleteComment&commentId={$comment->getId()}&articleId={$post->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
- {if $comment->getStatus() == 0}
- <a href="?op=markComment&mode=1&articleId={$comment->getArticleId()}&commentId={$comment->getId()}">
- <img src="imgs/admin/icon_spam-16.png" alt="{$locale->tr("mark_as_spam")}" />
- </a>
- {elseif $comment->getStatus() == 1}
- <a href="?op=markComment&mode=0&articleId={$comment->getArticleId()}&commentId={$comment->getId()}">
- <img src="imgs/admin/icon_nospam-16.png" alt="{$locale->tr("mark_as_no_spam")}" />
- </a>
- {/if}
- {if $comment->getUserUrl()}
- <a href="{$comment->getUserUrl()}">
- <img src="imgs/admin/icon_url-16.png" alt="{$locale->tr("url")}" />
- {/if}
- <a href="?op=editComment&commentId={$comment->getId()}"><img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
- </div>
- </td>
- </tr>
- {/foreach}
- </tbody>
- </table>
- </div>
-
- <div id="list_action_bar">
- {include file="$admintemplatepath/adminpager.template" style=list}
- <input type="submit" name="delete" value="{$locale->tr("delete")}" class="submit" />
- <input type="hidden" name="articleId" value="{$post->getId()}" />
- <input type="hidden" name="op" value="deleteComments" />
- </div>
- </form>
-{include file="$admintemplatepath/footer.template"}
Copied: plugins/branches/lifetype-1.1/editcomments/templates/editcomments.template (from rev 4260, plugins/branches/lifetype-1.1/unported/editcomments/templates/editcomments.template)
More information about the pLog-svn
mailing list