Revize 1447
Přidáno uživatelem David Raška před více než 12 roky(ů)
freenetis/branches/network/application/controllers/notifications.php | ||
---|---|---|
}
|
||
|
||
/**
|
||
* Shows notification settings and enables their editing.
|
||
*
|
||
* @author Jiri Svitak
|
||
*/
|
||
public function settings()
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_edit('Messages_Controller', 'message'))
|
||
Controller::error(ACCESS);
|
||
|
||
// creating of new forge
|
||
$this->form = new Forge('notifications/settings');
|
||
|
||
$this->form->group('General settings');
|
||
|
||
$this->form->input('payment_notice_boundary')
|
||
->label(__('Payment notice boundary')." (".
|
||
$this->settings->get('currency')."): ".
|
||
help::hint('payment_notice_boundary'))
|
||
->value($this->settings->get('payment_notice_boundary'));
|
||
|
||
$this->form->input('debtor_boundary')
|
||
->label(__('Debtor boundary')." (".
|
||
$this->settings->get('currency')."): ".
|
||
help::hint('debtor_boundary'))
|
||
->value($this->settings->get('debtor_boundary'));
|
||
|
||
$this->form->input('initial_immunity')
|
||
->label(__('Initial immunity').': '.
|
||
help::hint('initial_immunity'))
|
||
->rules('required|valid_numeric')
|
||
->value($this->settings->get('initial_immunity'));
|
||
|
||
$this->form->input('initial_debtor_immunity')
|
||
->label(__('Initial debtor immunity').': '.
|
||
help::hint('initial_debtor_immunity'))
|
||
->rules('required|valid_numeric')
|
||
->value($this->settings->get('initial_debtor_immunity'));
|
||
|
||
$this->form->group('Redirection');
|
||
|
||
$this->form->input('gateway')
|
||
->label(__('Gateway IP address').":")
|
||
->value($this->settings->get('gateway'));
|
||
|
||
$this->form->input('redirection_port_self_cancel')
|
||
->label(__('Port for self-canceling').": ".help::hint('redirection_port_self_cancel'))
|
||
->rules('valid_numeric')
|
||
->value($this->settings->get('redirection_port_self_cancel'));
|
||
|
||
$this->form->input('redirection_logo_url')
|
||
->label(__('Redirection logo URL').":")
|
||
->value($this->settings->get('redirection_logo_url'));
|
||
|
||
$this->form->input('self_cancel_text')
|
||
->label(__('Text for self cancel anchor').": ".
|
||
help::hint('self_cancel_text'))
|
||
->value($this->settings->get('self_cancel_text'));
|
||
|
||
$this->form->group('E-mail');
|
||
|
||
$this->form->input('email_subject_prefix')
|
||
->label(__('E-mail subject prefix').':')
|
||
->value($this->settings->get('email_subject_prefix'));
|
||
|
||
$this->form->submit('submit')->value(__('Save'));
|
||
|
||
// form validate
|
||
if ($this->form->validate())
|
||
{
|
||
$form_data = $this->form->as_array(FALSE);
|
||
$issaved = true;
|
||
|
||
foreach ($form_data as $name => $value)
|
||
{
|
||
$issaved = $issaved && Settings::set($name, $value);
|
||
}
|
||
|
||
if ($issaved)
|
||
{ // if all action were succesfull
|
||
status::success('Notification settings have been successfully updated.');
|
||
}
|
||
else
|
||
{ // if not
|
||
status::error('Notification settings have not been updated.');
|
||
}
|
||
|
||
url::redirect('notifications/settings');
|
||
}
|
||
// create view for this template
|
||
$view = new View('main');
|
||
$view->title = __('Notification settings');
|
||
$view->breadcrumbs = __('Notification settings');
|
||
$view->content = new View('form');
|
||
$view->content->form = $this->form->html();
|
||
$view->content->headline = __('Notification settings');
|
||
$view->render(TRUE);
|
||
}
|
||
|
||
/**
|
||
* Sets whitelist type to all IP addresses of member.
|
||
*
|
||
* @author Jiri Svitak
|
freenetis/branches/network/application/controllers/settings.php | ||
---|---|---|
'approval' => __('Approval'),
|
||
'voip' => __('VoIP'),
|
||
'sms' => __('SMS'),
|
||
'notifications' => __('Notifications'),
|
||
'logging' => __('Logging'),
|
||
'monitoring' => __('Monitoring'),
|
||
'registration_export' => __('Export of registration')
|
||
... | ... | |
}
|
||
|
||
/**
|
||
* Shows notification settings and enables their editing.
|
||
*
|
||
* @author Jiri Svitak
|
||
*/
|
||
public function notifications()
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_edit('Messages_Controller', 'message'))
|
||
Controller::error(ACCESS);
|
||
|
||
// creating of new forge
|
||
$this->form = new Forge('settings/notifications');
|
||
|
||
$this->form->group('General settings');
|
||
|
||
$this->form->input('payment_notice_boundary')
|
||
->label(__('Payment notice boundary')." (".
|
||
$this->settings->get('currency')."): ".
|
||
help::hint('payment_notice_boundary'))
|
||
->value($this->settings->get('payment_notice_boundary'));
|
||
|
||
$this->form->input('debtor_boundary')
|
||
->label(__('Debtor boundary')." (".
|
||
$this->settings->get('currency')."): ".
|
||
help::hint('debtor_boundary'))
|
||
->value($this->settings->get('debtor_boundary'));
|
||
|
||
$this->form->input('initial_immunity')
|
||
->label(__('Initial immunity').': '.
|
||
help::hint('initial_immunity'))
|
||
->rules('required|valid_numeric')
|
||
->value($this->settings->get('initial_immunity'));
|
||
|
||
$this->form->input('initial_debtor_immunity')
|
||
->label(__('Initial debtor immunity').': '.
|
||
help::hint('initial_debtor_immunity'))
|
||
->rules('required|valid_numeric')
|
||
->value($this->settings->get('initial_debtor_immunity'));
|
||
|
||
$this->form->group('Redirection');
|
||
|
||
$this->form->input('gateway')
|
||
->label(__('Gateway IP address').":")
|
||
->value($this->settings->get('gateway'));
|
||
|
||
$this->form->input('redirection_port_self_cancel')
|
||
->label(__('Port for self-canceling').": ".help::hint('redirection_port_self_cancel'))
|
||
->rules('valid_numeric')
|
||
->value($this->settings->get('redirection_port_self_cancel'));
|
||
|
||
$this->form->input('redirection_logo_url')
|
||
->label(__('Redirection logo URL').":")
|
||
->value($this->settings->get('redirection_logo_url'));
|
||
|
||
$this->form->input('self_cancel_text')
|
||
->label(__('Text for self cancel anchor').": ".
|
||
help::hint('self_cancel_text'))
|
||
->value($this->settings->get('self_cancel_text'));
|
||
|
||
$this->form->group('E-mail');
|
||
|
||
$this->form->input('email_subject_prefix')
|
||
->label(__('E-mail subject prefix').':')
|
||
->value($this->settings->get('email_subject_prefix'));
|
||
|
||
$this->form->submit('submit')->value(__('Save'));
|
||
|
||
// form validate
|
||
if ($this->form->validate())
|
||
{
|
||
$form_data = $this->form->as_array(FALSE);
|
||
$issaved = true;
|
||
|
||
foreach ($form_data as $name => $value)
|
||
{
|
||
$issaved = $issaved && Settings::set($name, $value);
|
||
}
|
||
|
||
if ($issaved)
|
||
{ // if all action were succesfull
|
||
status::success('Notification settings have been successfully updated.');
|
||
}
|
||
else
|
||
{ // if not
|
||
status::error('Notification settings have not been updated.');
|
||
}
|
||
|
||
url::redirect('settings/notifications');
|
||
}
|
||
|
||
// create view for this template
|
||
$view = new View('main');
|
||
$view->title = __('System') . ' - ' . __('Notification settings');
|
||
$view->content = new View('settings/main');
|
||
$view->content->current = 'notifications';
|
||
$view->content->content = $this->form->html();
|
||
$view->content->headline = __('Notification settings');
|
||
|
||
$view->render(TRUE);
|
||
}
|
||
|
||
/**
|
||
* Settings for logging
|
||
*
|
||
* @author Michal Kliment
|
freenetis/branches/network/application/views/menu.php | ||
---|---|---|
<li><?php echo html::anchor('redirect/show_all', __('Activated redirections')) ?></li>
|
||
<li><?php echo html::anchor('notifications/show_whitelisted_members', __('Whitelist')) ?></li>
|
||
<li><?php echo html::anchor('messages/show_all', __('Messages')) ?></li>
|
||
<li><?php echo html::anchor('notifications/settings', __('Settings')) ?></li>
|
||
</ul>
|
||
</li>
|
||
<?php endif ?>
|
freenetis/branches/network/application/views/js/settings.php | ||
---|---|---|
<?php
|
||
/**
|
||
* Settings javascript view.
|
||
*/
|
||
|
||
// IDE complementation
|
||
if (FALSE): ?><script type="text/javascript"><?php endif;
|
||
|
||
if ($base):
|
||
?>
|
||
|
||
function load_data_from_url(url)
|
||
{
|
||
$.ajaxSetup({ async: false });
|
||
$("#settings-content").load("<?php echo url_lang::base() ?>settings/"+url+" #settings-content");
|
||
editorInit();
|
||
$.getScript('<?php echo url_lang::base() ?>js/settings/'+str_replace('<?php echo url_lang::base() ?>', '', url)+'/0?nobase=1');
|
||
}
|
||
|
||
$(".tabs a").click(function (){
|
||
|
||
var url = str_replace("<?php echo url_lang::base() ?>settings/", "", $(this).attr('href'));
|
||
|
||
$(".tabs a").parent().removeClass('current');
|
||
|
||
$(this).parent().addClass('current');
|
||
|
||
load_data_from_url(url);
|
||
|
||
window.location.href = '#'+url;
|
||
|
||
return false;
|
||
});
|
||
|
||
if (window.location.hash)
|
||
$(window.location.hash+"-link").trigger('click');
|
||
|
||
/*$("form").live('submit', function (){
|
||
var values = {};
|
||
|
||
$("form input, form select, form textarea").not("form input[type=radio]:not(:checked), form input[type=checkbox]:not(:checked)").each(function (){
|
||
values[$(this).attr('name')] = $(this).val();
|
||
});
|
||
|
||
$.ajaxSetup({ async: false });
|
||
|
||
$.post($(this).attr("action"), values, function(data) {
|
||
$("#settings-content").html($('<div>').append($(data).find(".status-message").clone()).remove().html()+$(data).find("#settings-content").html());
|
||
$('html, body').animate({scrollTop: 0}, 'slow');
|
||
});
|
||
|
||
editorInit();
|
||
|
||
return false;
|
||
});*/
|
||
|
||
<?php endif ?>
|
Také k dispozici: Unified diff
Upravy:
- Presunuti nastaveni upozornovani k ostatnim nastavenim
- Zruseni javasriptoveho prepinani tabu v nastaveni