Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 206

Přidáno uživatelem Michal Kliment před více než 15 roky(ů)

Dodelany pristupove prava u administrace prekladu.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'transfers' => 'Transakce',
'translated term' => 'Přeložený výraz',
'translation' => 'Překlad',
'translation was successfuly added' => 'Překlad byl úspěšně přidán.',
'translation was successfully added' => 'Překlad byl úspěšně přidán',
'translation was successfully deleted' => 'Překlad byl úspěšně smazán',
'translation was successfully updated' => 'Překlad byl úspěšně aktualizován',
'translations' => 'Překlady',
'type of contact' => 'Typ kontaktu',
'type' => 'Typ',
freenetis/trunk/kohana/application/controllers/translations.php
*/
function show_all($limit_results = 200, $order_by = 'id', $order_by_direction = 'ASC')
{
// user access check - quimi's version; doesn't work
// check if logged user have access right to view all translations
//if (!$this->acl_check_view(get_class($this),'translations'))
// Controller::Error(1);
if (!$this->acl_check_view(get_class($this),'translation'))
Controller::Error(1);
// get new selector
if (is_numeric($this->input->get('record_per_page')))
......
));
// add button for new translation
// quimi's access control
//if ($this->acl_check_new(get_class($this), 'translations'))
// check if logged user have access right to add new translation
if ($this->acl_check_new(get_class($this), 'translation'))
$grid->add_new_button(url_lang::base().'translations/add', url_lang::lang('texts.Add new translation'));
// set grid fields
$grid->order_field('original_term')->label(url_lang::lang('texts.Original term'));
$grid->order_field('translated_term')->label(url_lang::lang('texts.Translated term'));
$grid->order_field('lang')->label(url_lang::lang('texts.Language'));
// quimi's rights
//if ($this->acl_check_edit(get_class($this), 'members'))
// check if logged user have access right to edit this translation
if ($this->acl_check_edit(get_class($this), 'translation'))
$grid->action_field('id') ->label(url_lang::lang('texts.Edit')) ->url(url_lang::base().'translations/edit')->action(url_lang::lang('texts.Edit'));
// quimi's rights
//if ($this->acl_check_edit(get_class($this), 'members'))
// check if logged user have access right to delete this translation
if ($this->acl_check_delete(get_class($this), 'translation'))
$grid->action_field('id') ->label(url_lang::lang('texts.Delete')) ->url(url_lang::base().'translations/delete')->action(url_lang::lang('texts.Delete'));
// set grid datasource
......
$view = new View('template');
$view->header = new View('base/header');
$view->footer = new View('base/footer');
$view->content = $grid;
$view->content = new View('show_all');
$view->content->table = $grid;
$view->content->headline = '';
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Translations');
$view->render(TRUE);
......
*/
function add()
{
// quimi's version of access control
//if (!$this->acl_check_new(get_class($this),'translations'))
// Controller::error(1);
// access control
if (!$this->acl_check_new(get_class($this),'translation'))
Controller::error(1);
// form for new translation
$form = new Forge(url_lang::base().'translations/add', '', 'POST', array('id' => 'article_form'));
......
// was translation successfully saved?
if ($translation_data->save())
{
$this->session->set_flash('message', url_lang::lang('texts.Translation was successfully added.'));
$this->session->set_flash('message', url_lang::lang('texts.Translation was successfully added').'.');
url::redirect(url_lang::base().'translations/show_all');
}
else
......
*/
function edit($id = NULL)
{
// quimi's version of access control
//if (!$this->acl_check_new(get_class($this),'translations'))
// Controller::error(1);
// access control
if (!$this->acl_check_new(get_class($this),'translation'))
Controller::error(1);
if (isset($id))
{
......
unset($form_data);
if ($translation_model->save())
{
$this->session->set_flash('message', url_lang::lang('texts.Translation was successfully updated.'));
$this->session->set_flash('message', url_lang::lang('texts.Translation was successfully updated').'.');
url::redirect(url_lang::base().'translations/show_all');
exit;
}
......
*/
function delete($id = NULL)
{
// quimi's version of access control
//if (!$this->acl_check_new(get_class($this),'translations'))
// Controller::error(1);
// access control
if (!$this->acl_check_delete(get_class($this),'translation'))
Controller::error(1);
if (isset($id))
{
$translation_model = new Translation_Model();
$translation_model->find($id, FALSE)->delete($id);
if ($translation_model->save())
{
$this->session->set_flash('message', url_lang::lang('texts.Translation was successfully deleted').'.');
url::redirect(url_lang::base().'translations/show_all');
}
else
{
$this->session->set_flash('message', url_lang::lang('texts.Error - can\'t delete translation.'));
$this->session->set_flash('message', url_lang::lang('texts.Error - cant delete translation').'.');
}
}
else

Také k dispozici: Unified diff