diff options
Diffstat (limited to 'views/default/annotation')
| -rw-r--r-- | views/default/annotation/annotate.php | 59 | ||||
| -rw-r--r-- | views/default/annotation/generic_comment.php | 25 | ||||
| -rwxr-xr-x | views/default/annotation/latest_comments.php | 39 | 
3 files changed, 70 insertions, 53 deletions
| diff --git a/views/default/annotation/annotate.php b/views/default/annotation/annotate.php index 0348a0ce8..9e0d20881 100644 --- a/views/default/annotation/annotate.php +++ b/views/default/annotation/annotate.php @@ -1,40 +1,27 @@  <?php -/** - * Elgg comment river view  - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ -$performed_by = get_entity($vars['item']->subject_guid); -$object = get_entity($vars['item']->object_guid); -$url = $object->getURL(); -$title = $object->title; -if (!$title) { -	$title = elgg_echo('untitled'); -} -$subtype = get_subtype_from_id($object->subtype); - -//grab the annotation, if one exists -if ($vars['item']->annotation_id != 0) { -	$comment = get_annotation($vars['item']->annotation_id)->value; -} -$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; -$string = sprintf(elgg_echo("river:posted:generic"),$url) . " "; -$string .= elgg_echo("{$subtype}:river:annotate") . " | <a href=\"{$object->getURL()}\">" . $title . "</a>"; -$string .= "<div class=\"river_content_display\">"; - -if ($comment) { -	$contents = strip_tags($comment);//this is so we don't get large images etc in the activity river -	if (strlen($contents) > 200) { -		$string .= substr($contents, 0, strpos($contents, ' ', 200)) . "..."; -	} else { -		$string .= $contents; +	$performed_by = get_entity($vars['item']->subject_guid); +	$object = get_entity($vars['item']->object_guid); +	$url = $object->getURL(); +	$title = $object->title; +	if(!$title) +		$title = elgg_echo('file:untitled'); +	$subtype = get_subtype_from_id($object->subtype); +	//grab the annotation, if one exists +	if($vars['item']->annotation_id != 0) +		$comment = get_annotation($vars['item']->annotation_id)->value;  +	$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; +	$string = "<div class=\"river_content_title\">" . sprintf(elgg_echo("river:posted:generic"),$url) . " "; +	$string .= elgg_echo("{$subtype}:river:annotate") . "  <a href=\"{$object->getURL()}\">" . $title . "</a> " . friendly_time($object->time_created) . "</div>"; +	if(get_context() != 'riverdashboard'){ +		$string .= "<div class=\"river_content_display\">"; +		if($comment){ +			$contents = strip_tags($comment);//this is so we don't get large images etc in the activity river +			if(strlen($contents) > 200) +	        		$string .= substr($contents, 0, strpos($contents, ' ', 200)) . "..."; +	    		else +		    		$string .= $contents; +       	} +		$string .= "</div>";  	} -} - -$string .= "</div>"; -  echo $string;
\ No newline at end of file diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php index ca0f69eaf..7395d781a 100644 --- a/views/default/annotation/generic_comment.php +++ b/views/default/annotation/generic_comment.php @@ -1,12 +1,6 @@  <?php  /**   * Elgg generic comment - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - *   */  $owner = get_user($vars['annotation']->owner_guid); @@ -25,21 +19,13 @@ $owner = get_user($vars['annotation']->owner_guid);  		?>  	</div>  	<div class="generic_comment_details"> - -		<!-- output the actual comment --> -		<?php echo elgg_view("output/longtext",array("value" => $vars['annotation']->value)); ?> - -		<p class="generic_comment_owner"> -			<a href="<?php echo $owner->getURL(); ?>"><?php echo $owner->name; ?></a> <?php echo friendly_time($vars['annotation']->time_created); ?> -		</p> -  		<?php  			// if the user looking at the comment can edit, show the delete link  			if ($vars['annotation']->canEdit()) {  			?> -		<p> +		<div class="delete_button">  			<?php  				echo elgg_view("output/confirmlink",array( @@ -49,10 +35,15 @@ $owner = get_user($vars['annotation']->owner_guid);  				));  			?> -		</p> +		</div>  			<?php  			} //end of can edit if statement  		?> -	</div><!-- end of generic_comment_details --> +		<p class="generic_comment_owner"> +			<a href="<?php echo $owner->getURL(); ?>"><?php echo $owner->name; ?></a> <?php echo friendly_time($vars['annotation']->time_created); ?> +		</p> +		<!-- output the actual comment --> +		<div class="generic_comment_body"><?php echo elgg_view("output/longtext",array("value" => $vars['annotation']->value)); ?></div> +	</div><div class="clearfloat"></div><!-- end of generic_comment_details -->  </div><!-- end of generic_comment div -->
\ No newline at end of file diff --git a/views/default/annotation/latest_comments.php b/views/default/annotation/latest_comments.php new file mode 100755 index 000000000..85ddfab7b --- /dev/null +++ b/views/default/annotation/latest_comments.php @@ -0,0 +1,39 @@ +<?php +/** + * Display latest comments on objects + **/ +	  +if($vars['comments']){ +	global $CONFIG; +		 +	echo "<div class='sidebar container'>"; +	echo "<h2>" . elgg_echo('latestcomments') . "</h2>";		 +	foreach($vars['comments'] as $comment){ +	   //grab the entity the comment is on +	   $entity = get_entity($comment->entity_guid); +		//comment owner +		$comment_owner = get_user($comment->owner_guid); +		$friendlytime = friendly_time($comment->time_created); // get timestamp for comment +	 +		//set the title +		if($entity->title) +			$objecttitle = $entity->title; +		else +			$objecttitle = elgg_echo('file:untitled');			 +				 +		//if the entity has been deleted, don't link to it +		if($entity){ +			$url = $entity->getURL(); // get url to file for comment link +			$url_display = "<a href=\"{$url}\">{$objecttitle}</a>"; +			//$owner = $entity->getOwnerEntity(); // get file owner +		}else{ +			$url_display = $objecttitle; +		} +	 +		echo "<div class='LatestComment'><span class='generic_comment_icon'>" . elgg_view("profile/icon",array('entity' => $comment_owner, 'size' => 'tiny')) . "</span>"; +		echo "<p class='owner_timestamp'><a href=\"{$vars['url']}pg/profile/{$comment_owner->username}\">{$comment_owner->name}</a> " . elgg_echo('on') . " {$url_display} <small>{$friendlytime}</small></p>"; +		echo "<div class='clearfloat'></div></div>"; +	 +	} +	echo "</div>"; +}
\ No newline at end of file | 
