2014-01-18 10:02:16 +02:00
|
|
|
<?php defined('SYSPATH') OR die('No direct script access.');
|
|
|
|
|
|
|
|
/**
|
2014-02-05 10:10:05 +02:00
|
|
|
* Course index view controller.
|
2014-01-18 10:02:16 +02:00
|
|
|
* @package Views
|
|
|
|
* @author Oreolek
|
|
|
|
**/
|
2014-02-05 10:10:05 +02:00
|
|
|
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;
|
2016-10-19 08:17:04 +03:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|