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

File size: 1.06Kb
<h1><?php echo __('Categories')?></h1>

<table class="grid">
	<tr>
		<th><?php echo __('Name')?></th>
		<th><?php echo __('Edit')?></th>
		<th><?php echo __('Delete')?></th>
	</tr>
	<?php 
	if($categories)
	{
		foreach($categories as $c)
		{
			echo '<tr class="r'.($tr_row++%2).'">';
			echo '<td><a href="'.get_url('admin/categories/'.$c->id.'/').'">'.View::escape($c->name).'</a></td>';
			echo '<td><a href="'.get_url('admin/categories/edit/'.$c->id.'/').'" class="button small">'.__('edit').'</a></td>';
			echo '<td><a href="'.get_url('admin/categories/delete/'.$c->id.'/').'" class="button small red">'.__('delete').'</a></td>';
			echo '</tr>';
		}
	}
	else
	{
		echo '<tr><td colspan="4">'.__('No categories found. You can add categories here.').'</td></tr>';
	}
	?>
</table>
<script>
$(function(){ $('.activate').click(activateCategory); });

function activateCategory()
{
	var $me = $(this);
	var id = $me.attr('c_id');
	$.post(URL_BASE+'admin/categories/activate/',{id:id},function(data){
		$me.text(data);
	});
	return false;
}
</script>