Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 104

Přidáno uživatelem Tomáš Dulík před asi 16 roky(ů)

Kosmetické úpravy ve zdrojácích.
Ikony v menu nahrazeny ikonami Gnome se zaručenou licencí GPL (zdroj doplněn do hlavičky komentáře každé ikony)
Do nového adresáře media/images/icons nahrány ikony z phpmyadmin-a, které se (snad) budou hodit v dalších verzích

Zobrazit rozdíly:

freenetis/trunk/kohana/media/css/style.css
list-style-type:none;
background: #FFFFFF url(../images/bg-gray2.gif) repeat-x;
border:1px #ebebeb solid;
margin-bottom:20px;
margin-bottom:10px;
}
#menu li.account {
background: #FFFFFF url(../images/menu/account.jpg) 5px 5px no-repeat;
background: #FFFFFF url(../images/menu/stock_contact.png) 10px 10px no-repeat;
}
#menu li.transfer {
background: #FFFFFF url(../images/menu/transfer.jpg) 5px 5px no-repeat;
background: #FFFFFF url(../images/menu/emblem-money.png) 5px 5px no-repeat;
}
#menu li.users {
background: #FFFFFF url(../images/menu/user.jpg) 5px 5px no-repeat;
background: #FFFFFF url(../images/menu/kuser.png) 5px 5px no-repeat;
}
#menu li.networks {
background: #FFFFFF url(../images/menu/network.jpg) 5px 5px no-repeat;
background: #FFFFFF url(../images/menu/gnome-fs-network.png) 5px 5px no-repeat;
}
/* -------#end MENU-------- */
/* ------------------------ */
freenetis/trunk/kohana/application/controllers/members.php
$grid->action_field('member_id') ->label(url_lang::lang('texts.Show')) ->url(url_lang::base().'members/show') ->action(url_lang::lang('texts.Show'));
if ($this->acl_check_2D('freenetis', 'edit_all'))
$grid->action_field('member_id') ->label(url_lang::lang('texts.Edit')) ->url(url_lang::base().'members/edit') ->action(url_lang::lang('texts.Edit'));
if ($this->acl_check_2D('freenetis', 'delete_all'))
$grid->action_field('member_id') ->label(url_lang::lang('texts.Delete')) ->url(url_lang::base().'members/delete') ->action(url_lang::lang('texts.Delete'))->script('onclick="return potvrd(\''.url_lang::lang('texts.delete_member').'\');"');
// if ($this->acl_check_2D('freenetis', 'delete_all'))
// $grid->action_field('member_id') ->label(url_lang::lang('texts.Delete')) ->url(url_lang::base().'members/delete') ->action(url_lang::lang('texts.Delete'))->script('onclick="return potvrd(\''.url_lang::lang('texts.delete_member').'\');"');
$grid->datasource( $dotaz );
$this->template->content = $grid;
......
}
else
{
$view->form = new View('registration');
$view = new View('template');
$view->form = new View('registration');
$view = new View('template');
$view->header = new View('base/header');
$view->content = new View('members_add');
$view->footer = new View('base/footer');
freenetis/trunk/kohana/application/controllers/users.php
$form->input('surname')->label(url_lang::lang('texts.surname').':')->rules('required|length[3,60]')->value($user_model->surname);
$form->input('post_title')->label(url_lang::lang('texts.post title').':')->rules('length[3,30]')->value($user_model->post_title);
$form->group('')->label(url_lang::lang('texts.Contact informations'));
if ($this->gacl_class->acl_check('freenetis', 'edit_own', 'all', $_SESSION['username'],get_class($this),'edit_phone')) $form->input('phone')->label(url_lang::lang('texts.phone').':')->rules('required|length[3,40]')->callback(array($this, 'valid_phone'))->value($user_model->phone);
if ($this->gacl_class->acl_check('freenetis', 'edit_own', 'all', $_SESSION['username'],get_class($this),'edit_email')) $form->input('email')->label(url_lang::lang('texts.email').':')->rules('length[3,50]|valid_email')->callback(array($this, 'valid_email'))->value($user_model->email);
if ($this->gacl_class->acl_check('freenetis', 'edit_own', 'all', $_SESSION['username'],get_class($this),'edit_phone'))
$form->input('phone')
->label(url_lang::lang('texts.phone').':')
->rules('required|length[3,40]')->callback(array($this, 'valid_phone'))->value($user_model->phone);
if ($this->gacl_class->acl_check('freenetis', 'edit_own', 'all', $_SESSION['username'],get_class($this),'edit_email'))
$form->input('email')->label(url_lang::lang('texts.email').':')
->rules('length[3,50]|valid_email')
->value($user_model->email);
$form->group('')->label(url_lang::lang('texts.Completive informations'));
$form->date('birthday')->label(url_lang::lang('texts.birthday').':')->years(date('Y')-100, date('Y'))->rules('required')->value(strtotime($user_model->birthday));
......
}
else
{
$view->form = new View('registration');
$view = new View('template');
$view->header = new View('base/header');
......
$view->content->form = $form->html();
$view->content->user_data = $user_model;
$view->render(TRUE);
}
}
else
{
freenetis/trunk/kohana/application/controllers/ip_addresses.php
}
} else {
//$form->IP_address->value("ahoj");
// $form->IP_address->value("ahoj"); //demo of how to fill a field after validation error
}
//----- end validate --------------------------------------------------
......
exit;
}
} else { //not valid
}
//----- end validate --------------------------------------------------
freenetis/trunk/kohana/application/libraries/MY_Controller.php
<?php
class Controller extends Controller_Core {
public $gacl_class;
private $myMenu;
public $arr;
public function __construct(){
parent::__construct();
//authentication goes here for example
public $gacl_class;
private $myMenu;
public $arr;
public function __construct(){
parent::__construct();
//authentication goes here for example
if (!$this->session->get('user_id', 0) && url_lang::current()!='login' && url_lang::current()!='registration' && url_lang::current()!='accounts/parse_ebank_account')
{
// Not logged in - redirect to login page
......
}
require_once(APPPATH.'vendors/phpgacl/gacl.class.php');
$this->gacl_class = new gacl();
}
/**
* acl_check_2D checks the current user's rights to access an $aco_section/$aco_value
*/
public function acl_check_2D($aco_section, $aco_value) {
return $this->gacl_class->acl_check($aco_section, $aco_value, 'all', $_SESSION['username']);
}
/**
* acl_check_3D checks the current user's rights to access
* an $axo_value object in ***current controller*** (!!!) by
* operation specified by $aco_section/$aco_value
*/
public function acl_check_3D($aco_section, $aco_value, $axo_value) {
return $this->gacl_class->acl_check($aco_section, $aco_value, 'all', $_SESSION['username'],get_class($this),$axo_value);
}
/* public function do_something(){
//method available in all controllers
}*/
}
/**
* acl_check_2D checks the current user's rights to access an $aco_section/$aco_value
*/
public function acl_check_2D($aco_section, $aco_value) {
return $this->gacl_class->acl_check($aco_section, $aco_value, 'all', $_SESSION['username']);
}
/**
* acl_check_3D checks the current user's rights to access
* an $axo_value object in ***current controller*** (!!!) by
* operation specified by $aco_section/$aco_value
*/
public function acl_check_3D($aco_section, $aco_value, $axo_value) {
return $this->gacl_class->acl_check($aco_section, $aco_value, 'all', $_SESSION['username'],get_class($this),$axo_value);
}
/* public function do_something(){
//method available in all controllers
}*/
public function render_menu ($active = null)
{
......
<ul>
<li>'.html::anchor(url_lang::base().$url, url_lang::lang('texts.My profile')).'</li>';
if ($this->gacl_class->acl_check('menu', 'my_users', 'all', $_SESSION['username'])) $myMenu .= '<li>'.html::anchor(url_lang::base().'members/users/'.$this->session->get('member_id'), url_lang::lang('texts.My users')).'</li>';
if ($this->acl_check_2D('menu', 'my_users')) $myMenu .= '<li>'.html::anchor(url_lang::base().'members/users/'.$this->session->get('member_id'), url_lang::lang('texts.My users')).'</li>';
if ($this->gacl_class->acl_check('menu', 'my_transfers', 'all', $_SESSION['username'])) $myMenu .= '<li>'.html::anchor(url_lang::base().'accounts/transfers/'.$this->session->get('member_id'), url_lang::lang('texts.My transfers')).'</li>';
if ($this->gacl_class->acl_check('menu', 'my_devices', 'all', $_SESSION['username'])) $myMenu .= ' <li>'.html::anchor(url_lang::base().'devices/show_my', url_lang::lang('texts.My devices')).'</li>';
if ($this->acl_check_2D('menu', 'my_transfers')) $myMenu .= '<li>'.html::anchor(url_lang::base().'accounts/transfers/'.$this->session->get('member_id'), url_lang::lang('texts.My transfers')).'</li>';
if ($this->acl_check_2D('menu', 'my_devices')) $myMenu .= ' <li>'.html::anchor(url_lang::base().'devices/show_my', url_lang::lang('texts.My devices')).'</li>';
$myMenu .= ' </ul>
</li>';
$acc_menu = '';
if ($this->gacl_class->acl_check('menu', 'unconfirmed_works', 'all', $_SESSION['username'])) $acc_menu = '<li>'.html::anchor(url_lang::base().'works/uncorfirmed/', url_lang::lang('texts.Unconfirmed works')).'</li>';
if ($this->acl_check_2D('menu', 'unconfirmed_works'))
$acc_menu = '<li>'.html::anchor(url_lang::base().'works/uncorfirmed/', url_lang::lang('texts.Unconfirmed works')).'</li>';
if ($this->gacl_class->acl_check('menu', 'unidentified_transfers', 'all', $_SESSION['username'])) $acc_menu .= '<li style="padding-bottom:8px;">'.html::anchor(url_lang::base().'accounts/unidentified_transfers/', url_lang::lang('texts.Unidentified transfers')).'</li>';
if ($this->acl_check_2D('menu', 'unidentified_transfers'))
$acc_menu .= '<li style="padding-bottom:8px;">'.html::anchor(url_lang::base().'accounts/unidentified_transfers/', url_lang::lang('texts.Unidentified transfers')).'</li>';
if ($this->gacl_class->acl_check('menu', 'accounts', 'all', $_SESSION['username'])) $acc_menu .= '<li>'.html::anchor(url_lang::base().'accounts/main_accounts/master', url_lang::lang('texts.Bank account')).'</li>
<li>'.html::anchor(url_lang::base().'accounts/main_accounts/infrastructure', url_lang::lang('texts.Infrastructure account')).'</li>
<li>'.html::anchor(url_lang::base().'accounts/main_accounts/operating', url_lang::lang('texts.Operating account')).'</li>';
if ($this->acl_check_2D('menu', 'accounts'))
$acc_menu .= '<li>'.html::anchor(url_lang::base().'accounts/main_accounts/master', url_lang::lang('texts.Bank account')).'</li>
<li>'.html::anchor(url_lang::base().'accounts/main_accounts/infrastructure', url_lang::lang('texts.Infrastructure account')).'</li>
<li>'.html::anchor(url_lang::base().'accounts/main_accounts/operating', url_lang::lang('texts.Operating account')).'</li>';
if ($acc_menu != '') $myMenu .= '<li class="transfer"><h2>'.url_lang::lang('texts.Transfers').'</h2>
<ul>
......
</ul>
</li>';
if ($this->gacl_class->acl_check('menu', 'users_members', 'all', $_SESSION['username'])) $myMenu .= '<li class="users"><h2>'.url_lang::lang('texts.Users').'</h2>
<ul>
<li>'.html::anchor(url_lang::base().'members', url_lang::lang('texts.Members')).'</li>
<li>'.html::anchor(url_lang::base().'users', url_lang::lang('texts.Users')).'</li>
</ul>
</li>';
if ($this->gacl_class->acl_check('menu', 'network', 'all', $_SESSION['username'])) $myMenu .= '<li class="networks"><h2>'.url_lang::lang('texts.Networks').'</h2>
<ul>
<li>'.html::anchor(url_lang::base().'devices', url_lang::lang('texts.Devices')).'</li>
<li>'.html::anchor(url_lang::base().'segments', url_lang::lang('texts.Segments')).'</li>
<li>'.html::anchor(url_lang::base().'ifaces', url_lang::lang('texts.Interfaces')).'</li>
<li>'.html::anchor(url_lang::base().'ports', url_lang::lang('texts.Ports')).'</li>
<li>'.html::anchor(url_lang::base().'vlan_ifaces', url_lang::lang('texts.Vlan interfaces')).'</li>
<li>'.html::anchor(url_lang::base().'vlans', url_lang::lang('texts.Vlans')).'</li>
<li>'.html::anchor(url_lang::base().'ip_addresses', url_lang::lang('texts.IP addresses')).'</li>
<li>'.html::anchor(url_lang::base().'subnets', url_lang::lang('texts.Subnets')).'</li>
</ul>
</li>
';
if ($this->acl_check_2D('menu', 'users_members'))
$myMenu .= '<li class="users"><h2>'.url_lang::lang('texts.Users').'</h2>
<ul>
<li>'.html::anchor(url_lang::base().'members', url_lang::lang('texts.Members')).'</li>
<li>'.html::anchor(url_lang::base().'users', url_lang::lang('texts.Users')).'</li>
</ul>
</li>';
if ($this->acl_check_2D('menu', 'network'))
$myMenu .= '<li class="networks"><h2>'.url_lang::lang('texts.Networks').'</h2>
<ul>
<li>'.html::anchor(url_lang::base().'devices', url_lang::lang('texts.Devices')).'</li>
<li>'.html::anchor(url_lang::base().'segments', url_lang::lang('texts.Segments')).'</li>
<li>'.html::anchor(url_lang::base().'ifaces', url_lang::lang('texts.Interfaces')).'</li>
<li>'.html::anchor(url_lang::base().'ports', url_lang::lang('texts.Ports')).'</li>
<li>'.html::anchor(url_lang::base().'vlan_ifaces', url_lang::lang('texts.Vlan interfaces')).'</li>
<li>'.html::anchor(url_lang::base().'vlans', url_lang::lang('texts.Vlans')).'</li>
<li>'.html::anchor(url_lang::base().'ip_addresses', url_lang::lang('texts.IP addresses')).'</li>
<li>'.html::anchor(url_lang::base().'subnets', url_lang::lang('texts.Subnets')).'</li>
</ul>
</li>
';
$myMenu .= '</ul>';

Také k dispozici: Unified diff