1
0
Fork 0
mirror of https://github.com/Oreolek/kangana.git synced 2024-07-08 01:24:23 +03:00
kangana/application/classes/View/Instant/Index.php

42 lines
1.3 KiB
PHP
Raw Normal View History

<?php defined('SYSPATH') OR die('No direct script access.');
/**
* Instant index view controller.
* @package Views
* @author Oreolek
**/
class View_Instant_Index extends View_Index {
protected $is_admin = TRUE; // admin only view
public $show_date = FALSE;
public $subscription_id;
/**
* An internal function to prepare item data.
**/
protected function show_item($item)
{
2016-10-11 08:37:54 +03:00
if ( ! $item instanceof ORM)
{
return FALSE;
}
$output = array(
'description' => $item->text,
2016-10-11 08:37:54 +03:00
'view_link' => $item->subject,
'is_sent' => I18n::translate('Sent'),
2014-02-18 10:11:50 +02:00
'edit_link' => FALSE,
'send_button' => HTML::anchor(Route::url('default', array('controller' => 'Instant', 'action' => 'send','id' => $item->id)), Form::btn('send', 'Send to subscribers')),
);
2014-02-18 10:11:50 +02:00
if ($item->sent == 0)
{
2016-10-11 08:37:54 +03:00
$output['edit_link'] = HTML::anchor(Route::url('default', array('controller' => 'Instant', 'action' => 'edit','id' => $item->id)), I18n::translate('Edit'), array('class' => 'link_edit'));
2014-02-18 10:11:50 +02:00
}
return $output;
}
public function link_new()
{
2016-10-11 08:37:54 +03:00
return HTML::anchor(Route::url('default', array('controller' => 'Instant', 'action' => 'create', 'id' => $this->subscription_id)), I18n::translate('Add'), array('class' => 'link_new'));
}
}