Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 598

Přidáno uživatelem harryhk před více než 14 roky(ů)

finalni upravy pro funkcnost smokepingu..

Zobrazit rozdíly:

freenetis/trunk/kohana/media/download/smokeping_freenetis
title = Andre-router
host = 10.107.137.1
++++ Andre-router2
menu = Andre-router2
title = Andre-router2
host = 10.107.137.129
+++ Hrubinova
menu = Hrubinova
......
title = Hrubinova-router
host = 10.107.237.1
++++ Hrubínova hotspot
menu = Hrubínova hotspot
title = Hrubínova hotspot
host = 10.107.237.4
+++ Kocourkov-router
menu = Kocourkov-router
title = Kocourkov-router
host = 10.107.37.1
+++ Smokeping test 2
menu = Smokeping test 2
title = Smokeping test 2
host = 10.107.37.156
++ Kukleny
menu = Kukleny
......
menu = Internet
title = Internet
++ CVUT
+ KLFree
menu = CVUT
title = CVUT
menu = KLFree
title = KLFree
+++ FEL
menu = FEL
title = FEL
host = fel.cvut.cz
freenetis/trunk/kohana/media/download/smokeping
title = Andre-router
host = 10.107.137.1
++++ Andre-router2
menu = Andre-router2
title = Andre-router2
host = 10.107.137.129
+++ Hrubinova
menu = Hrubinova
......
title = Hrubinova-router
host = 10.107.237.1
++++ Hrubínova hotspot
menu = Hrubínova hotspot
title = Hrubínova hotspot
host = 10.107.237.4
+++ Kocourkov-router
menu = Kocourkov-router
title = Kocourkov-router
host = 10.107.37.1
+++ Smokeping test 2
menu = Smokeping test 2
title = Smokeping test 2
host = 10.107.37.156
++ Kukleny
menu = Kukleny
......
menu = Internet
title = Internet
++ CVUT
+ KLFree
menu = CVUT
title = CVUT
menu = KLFree
title = KLFree
+++ FEL
menu = FEL
title = FEL
host = fel.cvut.cz
freenetis/trunk/kohana/application/models/smokeping.php
<?php
/**
* @author Lubomir Buben
*/
class Smokeping_Model extends ORM {
//protected $belongs_to = array('user','confirmed_by' => 'user');
public $arr_sql = array('id' => 's.id', 'ip_address' => 's.ip_address', 'menu' => 's.menu', 'title' => 's.title', 'level'=>'s.level', 'parent' => 's.parent', 'device' => 's.device');
public function get_all_records($limit_from = 0, $limit_results = 50, $order_by = 'parent', $order_by_direction = 'ASC', $user_id = null, $filters = array()){
if (in_array($order_by, $this->arr_sql))
$order_by = $this->arr_sql[$order_by];
$where = '';
if(count($filters) > 0)
$where .= 'WHERE ';
foreach($filters as $key => $value)
{
if($key!='submit')
{
if($where!='WHERE ')
$where .= ' AND ';
$where .= $this->arr_sql[$key].' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
}
}
return self::$db->query("SELECT
s.id, s.ip_address, s.title, s.menu, s.parent, s.level,
IF(strcmp(s.device,0),'●','-') AS device
FROM smokepings s
$where
ORDER BY $order_by $order_by_direction
LIMIT $limit_from, $limit_results"
);
}
public function get_record($record_id){
return self::$db->query("SELECT
s.id, s.ip_address, s.title, s.menu, s.parent, s.level
FROM smokepings s
WHERE
s.id = $record_id
"
);
}
public function count_all_records($filter_values = array()){
$where = '';
if (count($filter_values) > 0)
$where .= 'WHERE ';
foreach($filter_values as $key => $value)
{
if($key!='submit')
{
if($where!='WHERE ')
$where .= ' AND ';
$where .= $this->arr_sql[$key].' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
}
}
$records = self::$db->query("SELECT
s.id
FROM smokepings s
$where"
);
return count($records);
}
public function get_parents(){
return self::$db->query("SELECT
s.id, s.menu, s.title, s.level
FROM smokepings s
WHERE
s.device=0
"
);
}
public function count_parents(){
$parents = self::$db->query("SELECT
s.id
FROM smokepings s
WHERE
s.device=0"
);
return count($parents);
}
public function get_root(){
return self::$db->query("SELECT
s.id
FROM smokepings s
WHERE
s.level=0
LIMIT 1
"
);
}
public function find_successor($parent_id){
return self::$db->query("SELECT
s.id, s.device, s.menu, s.title, s.level
FROM smokepings s
WHERE
s.parent=$parent_id
"
);
}
public function count_successors($parent_id){
$successors = self::$db->query("SELECT
s.id
FROM smokepings s
WHERE
s.parent=$parent_id
"
);
return count($successors);
}
public function count_deleted_records($filters=array())
{
$where = 'WHERE ';
$ip=$filters[0];
$admin=$filters[1];
$dur=$filters[2];
$dest=$filters[3];
$and = 0;
if($ip!=0){
$where .= 'ip_address LIKE \'%'.$ip.'%\' ';
$and = 1;
}
if($admin!=0){
if ($and) $where.= 'AND ';
$where .= 'admin = \''.$admin.'\'';
$and = 1;
}
if($dur!=0){
if ($and) $where.= 'AND ';
$where .= 'duration = \''.$dur.'\'';
$and = 1;
}
if($dest!=0){
if ($and) $where.= 'AND ';
$where .= 'destination = \''.$dest.'\'';
}
$redirections = self::$db->query("SELECT id FROM redirections $where"
);
return count($redirections);
}
}
?>
freenetis/trunk/kohana/application/controllers/monitoring.php
<?php
/**
* @author Lubomir Buben
*/
class Monitoring_Controller extends Controller{
private $links;
function __construct(){
parent::__construct();
$array[] = html::anchor(url_lang::base().'monitoring/smokeping', url_lang::lang('texts.Smokeping'));
$array[] = html::anchor(url_lang::base().'monitoring/cacti', url_lang::lang('texts.Cacti'));
$array[] = html::anchor(url_lang::base().'monitoring/settings', url_lang::lang('texts.Settings'));
$this->links = implode(' | ', $array);
}
function index(){
url::redirect(url_lang::base().'monitoring/smokeping');
}
function smokeping($limit_results = 50, $order_by = 'parent', $order_by_direction = 'ASC', $page_word = null, $page = 1){
$this->form = new Forge(url_lang::base()."monitoring/smokeping", '', 'POST', array('id' => 'article_form'));
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
//if (!$this->acl_check_view(get_class($this),'monitoring'))
// Controller::error(ACCESS);
$filter=new Table_Form(url_lang::base()."monitoring/smokeping", "get", array(
new Table_Form_Item('text','ip_address','IP address'),
new Table_Form_Item('text','title','Title'),
"tr",
"td",
new Table_Form_Item('submit','submit','Filter')
)
);
$filter_values = $filter->values();
// get new selector
if (is_numeric($this->input->get('record_per_page')))
$limit_results = (int) $this->input->get('record_per_page');
$smokeping_model = new Smokeping_Model();
$total_records = $smokeping_model->count_all_records($filter_values);
if (($sql_offset = ($page - 1) * $limit_results) > $total_records)
$sql_offset = 0;
$query = $smokeping_model->get_all_records($sql_offset, (int)$limit_results, $order_by, $order_by_direction, NULL, $filter_values);
$grid = new Grid(url_lang::base().'monitoring', null,array(
//'separator' => '<br />-----------',
'use_paginator' => true,
'use_selector' => true,
'current' => $limit_results, // current selected 'records_per_page' value
'selector_increace' => 50, // increace
'selector_min' => 50, // minimum where selector start
'selector_max_multiplier' => 10,
'base_url' => Config::item('locale.lang').'/monitoring/smokeping/'.$limit_results.'/'.$order_by.'/'.$order_by_direction ,
'uri_vlan' => 'page', // pass a string as uri_vlan to trigger former 'label' functionality
'total_items' => $total_records, // use db count query here of course
'items_per_page' => $limit_results, // it may be handy to set defaults for stuff like this in config/pagination.php
'style' => 'classic',
'order_by' => $order_by,
'order_by_direction' => $order_by_direction,
'limit_results' => $limit_results,
//'query_string' => $query_string,
'filter' => $filter->view
));
//if ($this->acl_check_new('Devices_Controller','vlan')){
$grid->add_new_button(url_lang::base().'monitoring/add_smokeping', url_lang::lang('texts.Add smokeping record'));
$grid->add_new_button(url_lang::base().'monitoring/add_smokeping_menu', url_lang::lang('texts.Add smokeping menu item'));
$grid->add_new_button(url_lang::base().'monitoring/generate_smokeping', url_lang::lang('texts.Generate smokeping configuration file'));
//}
$grid->order_field('id')->label('ID')->class('center');
$grid->order_field('title')->label(url_lang::lang('texts.Title'))->class('center');
$grid->order_field('menu')->label(url_lang::lang('texts.Menu'))->class('center');
$grid->order_field('level')->label(url_lang::lang('texts.Level'))->class('center');
$grid->order_field('parent')->label(url_lang::lang('texts.Parent'))->class('center');
$grid->order_field('device')->label(url_lang::lang('texts.Device'))->class('center');
$grid->order_field('ip_address')->label(url_lang::lang('texts.IP address'));
//if ($this->acl_check_view('Devices_Controller','vlan'))
$grid->action_field('id')->label(url_lang::lang('texts.Show')) ->url(url_lang::base().'monitoring/show_smokeping') ->action(url_lang::lang('texts.Show'))->class('center');
//if ($this->acl_check_edit('Devices_Controller','vlan'))
$grid->action_field('id')->label(url_lang::lang('texts.Edit')) ->url(url_lang::base().'monitoring/edit_smokeping') ->action(url_lang::lang('texts.Edit'))->class('center');
//if ($this->acl_check_edit('Devices_Controller','vlan'))
$grid->action_field('id')->label(url_lang::lang('texts.Delete'))->url(url_lang::base().'monitoring/delete_smokeping')->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this smokeping record').'\');"');
$grid->datasource( $query );
$this->template->content = $grid;
$view = new View('main');
$view->title = url_lang::lang('texts.List of all smokeping records');
$view->content = new View('show_all');
$view->content->headline = url_lang::lang('texts.List of all smokeping records');
$view->content->table = $grid;
$view->render(TRUE);
}
function add_smokeping(){
//if (!$this->acl_check_new(get_class($this),'monitoring'))
// Controller::error(ACCESS);
//parents
$smokeping = new Smokeping_Model();
$total_parents = $smokeping->count_parents();
$all_parents = $smokeping->get_parents();
$parent_level[0] = '----- '.url_lang::lang('texts.Select parent').' -----';
foreach ($all_parents as $row){
$parent_level[$row->id]=$row->title;
}
//username + email
$user_id=$this->session->get('member_id');
$user_model = new User_Model();
$user_model->find($user_id);
if ($user_model->id == 0)
Controller::error(RECORD);
$this->form = new Forge(url_lang::base()."monitoring/add_smokeping", '', 'POST', array('id' => 'article_form'));
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
$this->form->group('')->label(url_lang::lang('texts.Basic information'));
$this->form->input('ip_address')->label(url_lang::lang('texts.IP address').':')->rules('required');
$this->form->input('menu')->label(url_lang::lang('texts.Menu').':')->rules('required');
$this->form->input('title')->label(url_lang::lang('texts.Title').':')->rules('required');
$this->form->dropdown('parent')->label(url_lang::lang('texts.Parent').':')->options($parent_level)->rules('required');
$this->form->submit('submit')->value(url_lang::lang('texts.Insert'));
special::required_forge_style($this->form, ' *', 'required');
//----- validate form and save data -----------------------------------
if($this->form->validate()){
$form_data = $this->form->as_array();
foreach($form_data as $key => $value){
$form_data[$key] = htmlspecialchars($value);
}
$smokeping = new Smokeping_Model();
$smokeping->ip_address = $form_data['ip_address'];
$smokeping->menu = $form_data['menu'];
$smokeping->title = $form_data['title'];
$smokeping->device = 1;
$smokeping_parent = new Smokeping_Model($form_data['parent']);
$smokeping->parent = $form_data['parent'];
$smokeping->level = ($smokeping_parent->level)+1;
unset($form_data);
if ($smokeping->save()) {
$this->session->set_flash('message', url_lang::lang('texts.Smokeping record has been successfully added.'));
url::redirect(url_lang::base().'monitoring/smokeping/');
exit;
}
}
//----- end validate --------------------------------------------------
$view = new View('main');
$view->title = url_lang::lang('texts.Add smokeping record');
$view->content = new View('form');
$view->content->link_back = html::anchor(url_lang::base().'monitoring/smokeping', url_lang::lang('texts.Back to the smokeping list'));
$view->content->headline = url_lang::lang('texts.Add smokeping record');
$view->content->form = $this->form->html();
$view->render(TRUE);
}
function add_smokeping_menu(){
//if (!$this->acl_check_new(get_class($this),'monitoring'))
// Controller::error(ACCESS);
//parents
$smokeping = new Smokeping_Model();
$total_parents = $smokeping->count_parents();
$all_parents = $smokeping->get_parents();
//$parent_level[0] = '----- '.url_lang::lang('texts.Select parent').' -----';
$parent_level[0] = '----- '.url_lang::lang('texts.Root (level 0)').' -----';
foreach ($all_parents as $row){
$parent_level[$row->id]=$row->title;
}
//username + email
$user_id=$this->session->get('member_id');
$user_model = new User_Model();
$user_model->find($user_id);
if ($user_model->id == 0)
Controller::error(RECORD);
$this->form = new Forge(url_lang::base()."monitoring/add_smokeping_menu", '', 'POST', array('id' => 'article_form'));
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
$this->form->group('')->label(url_lang::lang('texts.Basic information'));
$this->form->input('menu')->label(url_lang::lang('texts.Menu').':')->rules('required');
$this->form->input('title')->label(url_lang::lang('texts.Title').':')->rules('required');
$this->form->dropdown('parent')->label(url_lang::lang('texts.Parent').':')->options($parent_level);
$this->form->submit('submit')->value(url_lang::lang('texts.Insert'));
special::required_forge_style($this->form, ' *', 'required');
//----- validate form and save data -----------------------------------
if($this->form->validate()){
$form_data = $this->form->as_array();
foreach($form_data as $key => $value){
$form_data[$key] = htmlspecialchars($value);
}
$smokeping = new Smokeping_Model();
$smokeping->menu = $form_data['menu'];
$smokeping->title = $form_data['title'];
$smokeping->device = 0;
if($form_data['parent']==0){
$smokeping->parent = 0;
$smokeping->level = 0;
}else{
$smokeping_parent = new Smokeping_Model($form_data['parent']);
$smokeping->parent = $form_data['parent'];
$smokeping->level = ($smokeping_parent->level)+1;
}
unset($form_data);
if ($smokeping->save()) {
$this->session->set_flash('message', url_lang::lang('texts.Smokeping menu item has been successfully added.'));
url::redirect(url_lang::base().'monitoring/smokeping/');
exit;
}
}
//----- end validate --------------------------------------------------
$view = new View('main');
$view->title = url_lang::lang('texts.Add smokeping menu item');
$view->content = new View('form');
$view->content->link_back = html::anchor(url_lang::base().'monitoring/smokeping', url_lang::lang('texts.Back to the smokeping list'));
$view->content->headline = url_lang::lang('texts.Add smokeping menu item');
$view->content->form = $this->form->html();
$view->render(TRUE);
}
function show_smokeping($smokeping_id = NULL){
//if (!$this->acl_check_view(get_class($this),'redirection'))
// Controller::error(ACCESS);
$smokeping = new Smokeping_Model($smokeping_id);
if (!$smokeping_id || !$smokeping->id){
Controller::error(RECORD);
url::redirect(url_lang::base().'monitoring/smokeping');
}
$link_back = html::anchor(url_lang::base().'monitoring/smokeping', url_lang::lang('texts.Back to the smokeping list'));
$view = new View('main');
$view->title = url_lang::lang('texts.Show smokeping record');
$view->content = new View('monitoring/show');
$view->content->smokeping = $smokeping;
$view->content->link_back = $link_back;
$view->render(TRUE);
}
function edit_smokeping($smokeping_id = NULL){
//if (!$this->acl_check_edit(get_class($this),'redirection'))
// Controller::error(ACCESS);
if (!isset($smokeping_id))
Controller::warning(PARAMETER);
$smokeping = new Smokeping_Model($smokeping_id);
if ($smokeping->id == 0)
Controller::error(RECORD);
//parents
$smokeping_parent = new Smokeping_Model();
$total_parents = $smokeping_parent->count_parents();
$all_parents = $smokeping_parent->get_parents();
if($smokeping->device)
$parent_level[0] = '----- '.url_lang::lang('texts.Select parent').' -----';
else
$parent_level[0] = '----- '.url_lang::lang('texts.Root (level 0)').' -----';
foreach ($all_parents as $row){
$parent_level[$row->id]=$row->title.' ('.$row->level.')';
}
$this->form = new Forge(url_lang::base()."monitoring/edit_smokeping/".$smokeping_id, '', 'POST', array('id' => 'article_form'));
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
$this->form->group('')->label(url_lang::lang('texts.Basic information'));
if($smokeping->device)
$this->form->input('ip_address')->label(url_lang::lang('texts.IP address').':')->rules('required')->value($smokeping->ip_address);
$this->form->input('menu')->label(url_lang::lang('texts.Menu').':')->rules('required')->value($smokeping->menu);
$this->form->input('title')->label(url_lang::lang('texts.Title').':')->rules('required')->value($smokeping->title);
if($smokeping->device)
$this->form->dropdown('parent')->label(url_lang::lang('texts.Parent').':')->options($parent_level)->rules('required')->selected($smokeping->parent);
else
$this->form->dropdown('parent')->label(url_lang::lang('texts.Parent').':')->options($parent_level)->selected($smokeping->parent);
$this->form->submit('submit')->value(url_lang::lang('texts.Insert'));
special::required_forge_style($this->form, ' *', 'required');
//----- validate form and save data -----------------------------------
if($this->form->validate()){
$form_data = $this->form->as_array();
foreach($form_data as $key => $value){
$form_data[$key] = htmlspecialchars($value);
}
$smokeping = new Smokeping_Model($smokeping_id);
if($smokeping->device){
$smokeping->ip_address = $form_data['ip_address'];
$smokeping->device = 1;
}else{
$smokeping->ip_address = "";
$smokeping->device = 0;
}
$smokeping->menu = $form_data['menu'];
$smokeping->title = $form_data['title'];
if($form_data['parent']==0){
$smokeping->parent = 0;
$smokeping->level = 0;
}else{
$smokeping_parent = new Smokeping_Model($form_data['parent']);
$smokeping->parent = $form_data['parent'];
$smokeping->level = ($smokeping_parent->level)+1;
}
unset($form_data);
if ($smokeping->save()) {
$this->session->set_flash('message', url_lang::lang('texts.Smokeping record has been successfully updated.'));
url::redirect(url_lang::base().'monitoring/smokeping/');
exit;
}
}
//----- end validate --------------------------------------------------
$view = new View('main');
$view->title = url_lang::lang('texts.Edit smokeping record');
$view->content = new View('form');
$view->content->form = $this->form->html();
$view->content->link_back = html::anchor(url_lang::base().'monitoring/smokeping', url_lang::lang('texts.Back to the smokeping list'));
$view->content->headline = url_lang::lang('texts.Edit smokeping record');
$view->render(TRUE);
}
function delete_smokeping($smokeping_id = NULL){
//if (!$this->acl_check_delete(get_class($this),'smokeping'))
// Controller::error(ACCESS);
if (!isset($smokeping_id))
Controller::warning(PARAMETER);
$smokeping_model = new Smokeping_Model($smokeping_id);
$linkback = url_lang::base()."monitoring/smokeping/";
//neni to menu, na kterem by byly zavisle dalsi zaznamy?
$smokeping_test = new Smokeping_Model();
$successors = $smokeping_test->count_successors($smokeping_id);
if ($successors>0){
$this->session->set_flash('message', url_lang::lang('texts.Cannot delete, there are other records depending on this one.'));
url::redirect($linkback);
}
if ($smokeping_model->delete()){
$this->session->set_flash('message', url_lang::lang('texts.Smokeping record has been successfully deleted.'));
} else {
$this->session->set_flash('message', url_lang::lang('texts.Error - cant delete smokeping record.'));
}
url::redirect($linkback);
}
function generate_smokeping(){
$smokeping = new Smokeping_Model();
$total_records = $smokeping->count_all_records();
$text = $this->find_successor(0);
$fp = FOpen ('media/download/smokeping_freenetis',"w");
if ($fp){
FWrite ($fp, $text);
FClose ($fp);
}
system ('cat media/download/smokeping_general media/download/smokeping_freenetis > media/download/smokeping');
url::redirect(url_lang::base().'../media/download/download.php?file=smokeping');
//url::redirect(url_lang::base().'monitoring/smokeping');
return;
}
function find_successor($id=null){
$smokeping = new Smokeping_Model();
$successor = $smokeping->find_successor($id);
$text = "";
foreach ($successor as $row){
for($i=0; $i<$row->level+1; $i++){
$text .= "+";
}
$text .= " $row->menu\n\nmenu = $row->menu\ntitle = $row->title\n";
if($row->device){ //narazili jsme na uzel, ktery je NODem (IP adresa atd.)
$smokeping_node = new Smokeping_Model($row->id);
$text .= "host = $smokeping_node->ip_address\n\n";
} else { //narazili jsme pouze na polozku menu
$text .= "\n";
$text .= $this->find_successor($row->id);
}
}
return $text;
}
function settings(){
if (!$this->acl_check_view(get_class($this),'redirection'))
Controller::error(ACCESS);
$smokeping_model = new Smokeping_Model();
$total_records = $smokeping_model->count_all_records();
$query = $smokeping_model->get_all_records();
$grid = new Grid(url_lang::base().'redirection', null,array(
//'separator' => '<br />-----------',
'use_paginator' => true,
'use_selector' => true,
'current' => $limit_results, // current selected 'records_per_page' value
'selector_increace' => 20, // increace
'selector_min' => 20, // minimum where selector start
'selector_max_multiplier' => 10,
'base_url' => Config::item('locale.lang').'/monitoring/settings/',
'uri_vlan' => 'page', // pass a string as uri_vlan to trigger former 'label' functionality
'total_items' => $total_records, // use db count query here of course
'items_per_page' => $limit_results, // it may be handy to set defaults for stuff like this in config/pagination.php
'style' => 'classic',
'order_by' => $order_by,
'order_by_direction' => $order_by_direction,
'limit_results' => $limit_results,
//'query_string' => $query_string,
'filter' => $filter->view
));
//if ($this->acl_check_new('Devices_Controller','vlan')){
$grid->add_new_button(url_lang::base().'redirection/addip', url_lang::lang('texts.Redirect IP address'));
$grid->add_new_button(url_lang::base().'redirection/addrange', url_lang::lang('texts.Redirect range of IP addresses'));
$grid->add_new_button(url_lang::base().'redirection/addsubnet', url_lang::lang('texts.Redirect IP subnet'));
$grid->add_new_button(url_lang::base().'redirection/adduser', url_lang::lang('texts.Redirect the user'));
if (isset($_REQUEST["submit"])){
if($_GET['ip_address']!=null) $ip_address = $_GET['ip_address'];
else $ip_address = 0;
if($_GET['admin']!=null) $admin = $_GET['admin'];
else $admin = 0;
if($_GET['duration']!=null) $duration = $_GET['duration'];
else $duration = 0;
if($_GET['destination']!=null) $destination = $_GET['destination'];
else $destination = 0;
$grid->add_new_button(url_lang::base().'redirection/delete_list/'.$limit_results.'/'.$ip_address.'/'.$admin.'/'.$duration.'/'.$destination, url_lang::lang('texts.Delete selection'));
}
//}
//$grid->order_field('id')->label('ID')->class('center');
$grid->order_field('ip_address')->label(url_lang::lang('texts.IP address'));
$grid->order_field('dur')->label(url_lang::lang('texts.Duration'))->class('center');
$grid->order_field('dest')->label(url_lang::lang('texts.Destination website'))->class('center');
$grid->order_field('admin')->label(url_lang::lang('texts.Admin'))->class('center');
$grid->order_field('message')->label(url_lang::lang('texts.Message'))->class('center');
$grid->order_field('note')->label(url_lang::lang('texts.Comment'))->class('center');
$grid->order_field('locksign')->label(url_lang::lang('texts.Lock'))->class('center');
//if ($this->acl_check_view('Devices_Controller','vlan'))
$grid->action_field('id')->label(url_lang::lang('texts.Show')) ->url(url_lang::base().'redirection/show') ->action(url_lang::lang('texts.Show'))->class('center');
//if ($this->acl_check_edit('Devices_Controller','vlan'))
$grid->action_field('id')->label(url_lang::lang('texts.Edit')) ->url(url_lang::base().'redirection/edit') ->action(url_lang::lang('texts.Edit'))->class('center');
//if ($this->acl_check_edit('Devices_Controller','vlan'))
$grid->action_field('id')->label(url_lang::lang('texts.Delete'))->url(url_lang::base().'redirection/delete')->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to cancel this redirection').'\');"');
// $grid->action_field('id')->label(url_lang::lang('texts.Delete'))->url(url_lang::base().'redirection/delete')->action(url_lang::lang('texts.Delete'))->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this user').'\');"');
$grid->datasource( $query );
$this->template->content = $grid;
$view = new View('main');
$view->title = url_lang::lang('texts.List of all redirected records');
$view->content = new View('show_all');
$view->content->headline = url_lang::lang('texts.List of all redirected records');
$view->content->table = $grid;
$view->render(TRUE);
}
}
?>

Také k dispozici: Unified diff