private function generateNewUrl($uri) { $page = $this->pager->getLastPage(); if(vjComment::getListOrder() == "DESC") { $page = $this->pager->getFirstPage(); } $url = commentTools::rewriteUrlForPage($uri, $page, $this->generateCryptModel(), false); return $url . "#" . $this->pager->getNbResults(); }
protected function doUpdateObject($values) { $values['body'] = nl2br($values['body']); // if comment is a reply, update the body value if (isset($values['reply']) && $values['reply'] != "" && ($obj = Doctrine::getTable('Comment')->find($values['reply']))) { $tmp = commentTools::setQuote($obj->getAuthor(), $obj->body); $values['body'] = $tmp . $values['body']; } else { $values['reply'] = null; } parent::doUpdateObject($values); }
<td rowspan="2" class="infos"> <a name="<?php echo $i ?>" class="ancre">#<?php echo $i ?></a> <?php if(!$obj->is_delete): ?> <?php echo link_to_function( image_tag('/vjCommentPlugin/images/comments.png', array( 'alt' => 'reply' )) , "reply('".$obj->getId()."','".$obj->getAuthor()."')", array('title' => __('Reply to this comment', array(), 'vjComment'))) ?> <?php echo link_to_function( image_tag('/vjCommentPlugin/images/error.png', array( 'alt' => 'report' )) , 'window.open( \''.url_for('@comment_reporting?id='.$obj->getId().'&num='.$i).'\', \''.__('Add new comment', array(), 'vjComment').'\', "menubar=no, status=no, scrollbars=no, menubar=no, width=565, height=300")', array('target' => '_blank', 'title' => __('Report this comment - New window', array(), 'vjComment') )) ?><br /> <?php endif; ?> <?php if(commentTools::isGravatarAvailable() && !$obj->is_delete): ?> <?php echo gravatar_image_tag($obj->getEmail()) ?> <?php endif ?> </td>
<?php if ($object->hasComments()) { ?> <?php use_helper('Date', 'JavascriptBase', 'I18N'); ?> <?php use_stylesheet("/vjCommentPlugin/css/comment.min.css"); ?> <?php use_javascript("/vjCommentPlugin/js/reply.min.js"); ?> <?php if (commentTools::isGravatarAvailable()) { ?> <?php use_helper('Gravatar'); ?> <?php } ?> <div><h1><?php echo __('Comments list', array(), 'vjComment'); ?> </h1></div> <table class="list-comments" summary=""> <?php foreach ($object->getAllComments() as $c) { ?> <?php
<div class="pagination"> <?php if($position == "back"): ?> <?php include_partial('comment/back_to_top', array('route' => $route, 'crypt' => $crypt, 'text' => false)) ?> <?php endif; ?> <a href="<?php echo url_for(commentTools::rewriteUrlForPage($route, 1, $crypt)) ?>"> <?php echo image_tag('/vjCommentPlugin/images/resultset_first.png', array('alt' => __('First page of comments', array(), 'vjComment'), 'title' => __('First page of comments', array(), 'vjComment'))) ?> </a> <a href="<?php echo url_for(commentTools::rewriteUrlForPage($route, $pager->getPreviousPage(), $crypt)) ?>"> <?php echo image_tag('/vjCommentPlugin/images/resultset_previous.png', array('alt' => __('Previous page of comments', array(), 'vjComment'), 'title' => __('Previous page of comments', array(), 'vjComment'))) ?> </a> <?php foreach ($pager->getLinks() as $page): ?> <?php if ($page == $pager->getPage()): ?> <?php echo $page ?> <?php else: ?> <a href="<?php echo url_for(commentTools::rewriteUrlForPage($route, $page, $crypt)) ?>"><?php echo $page ?></a> <?php endif; ?> <?php endforeach; ?> <a href="<?php echo url_for(commentTools::rewriteUrlForPage($route, $pager->getNextPage(), $crypt)) ?>"> <?php echo image_tag('/vjCommentPlugin/images/resultset_next.png', array('alt' => __('Next page of comments', array(), 'vjComment'), 'title' => __('Next page of comments', array(), 'vjComment'))) ?> </a> <a href="<?php echo url_for(commentTools::rewriteUrlForPage($route, $pager->getLastPage(), $crypt)) ?>"> <?php echo image_tag('/vjCommentPlugin/images/resultset_last.png', array('alt' => __('Last page of comments', array(), 'vjComment'), 'title' => __('Last page of comments', array(), 'vjComment'))) ?> </a> </div>
public function executeEdit(sfWebRequest $request) { $this->comment = $this->getRoute()->getObject(); $this->form = $this->configuration->getForm($this->comment); $this->form->setDefault('body', commentTools::removeBrAndBlockquote($this->comment->body)); }
<?php use_stylesheet('/vjCommentPlugin/css/infoBulle.min.css'); ?> <a class="info"> <?php echo commentTools::cleanQuote($comment->getBody(ESC_RAW)); ?> <span class="body"> <?php echo $comment->getBody(ESC_RAW); ?> </span> </a>
public function getBodyCleanQuotes() { return commentTools::cleanQuote($this->getBody()); }