View file veppa_wallpaper/sys/app/views/admin/tags.php

File size: 1.07Kb
<h1><?php echo __('Tags')?></h1>
<p><?php echo __('Delete tags by clicking on [x] on left of tag. Tags smaller than 2 letters displayed in red.')?></p>
<div class="tags">
<?php

if($tags)
{
	$echo = '';
	foreach($tags as $key => $val)
	{
		
		if(strlen($key)<3)
		{
			$style = 'color:#f00;';
		}
		else
		{
			$style='';
		}
		
		$echo .= '<span class="tag">
				<a href="'.Tag::url($key).'" target="_blank" 
					style="font-size:'.(100 + $val*10 ).'%; '.$style.'">'.$key.'</a> 
				<a href="#" class="delete_tag button small red">x</a> , 
				&nbsp;&nbsp;&nbsp; </span>';
	}
	echo $echo;
}
?>
</div>

<script type="text/javascript">
// delete tags


$(function (){
	$('span.tag a.delete_tag').click(function(){
		var $me = $(this);
		var $tag = $me.parent('span.tag');
		var tag = $('a:first',$tag).html();
		
		if(confirm('Do you want to delete tag: '+tag+'?'))
		{
			$.post(URL_BASE+'admin/tags/delete/',{tag:tag},function (data){
				if(data=='ok')
				{
					$tag.remove();
				}
			});
		}
		
		return false;
	});
});

</script>