1
0
Fork 0
mirror of https://github.com/Oreolek/kangana.git synced 2024-07-02 22:55:04 +03:00
kangana/application/classes/View/Course/Index.php

44 lines
1.4 KiB
PHP
Raw Normal View History

2014-01-18 10:02:16 +02:00
<?php defined('SYSPATH') OR die('No direct script access.');
/**
* Course index view controller.
2014-01-18 10:02:16 +02:00
* @package Views
* @author Oreolek
**/
class View_Course_Index extends View_Index {
2014-01-18 10:02:16 +02:00
protected $is_admin = TRUE; // admin only view
public $show_date = FALSE;
public $content;
2014-02-02 05:25:58 +02:00
public function get_header()
{
return array(
2016-10-11 08:37:54 +03:00
I18n::translate('Title'),
I18n::translate('Description'),
I18n::translate('Subscribers'),
I18n::translate('Edit'),
I18n::translate('Delete')
2014-02-02 05:25:58 +02:00
);
}
2016-10-12 06:22:02 +03:00
2014-01-18 10:02:16 +02:00
/**
* An internal function to prepare item data.
**/
protected function show_item($item)
{
2016-10-11 08:37:54 +03:00
if ( ! $item instanceof ORM)
2014-01-18 10:02:16 +02:00
{
return FALSE;
}
$output = array(
'description' => $item->description,
'view_link' => HTML::anchor(Route::url('default', array('controller' => Request::current()->controller(), 'action' => 'view','id' => $item->id)),$item->title, array('class' => 'link_view')),
2016-10-11 08:37:54 +03:00
'edit_link' => HTML::anchor(Route::url('default', array('controller' => Request::current()->controller(), 'action' => 'edit','id' => $item->id)), I18n::translate('Edit'), array('class' => 'link_edit')),
'delete_link' => HTML::anchor(Route::url('default', array('controller' => Request::current()->controller(), 'action' => 'delete','id' => $item->id)), I18n::translate('Delete'), array('class' => 'link_delete')),
2014-02-02 05:25:58 +02:00
'client_count' => $item->count_clients(),
2014-01-18 10:02:16 +02:00
);
return $output;
}
}