mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 13:24:41 +03:00
Add warnings about need for button regeneration
This commit is contained in:
parent
f9b6eeb92c
commit
fc2c9d791a
@ -55,6 +55,7 @@ class FeaturesController extends AbstractController
|
|||||||
|
|
||||||
$page['canmodify'] = is_capable(CAN_ADMINISTRATE, $operator);
|
$page['canmodify'] = is_capable(CAN_ADMINISTRATE, $operator);
|
||||||
$page['stored'] = $request->query->get('stored');
|
$page['stored'] = $request->query->get('stored');
|
||||||
|
$page['regeneratebutton'] = $request->query->get('regenerate');
|
||||||
$page['title'] = getlocal('Messenger settings');
|
$page['title'] = getlocal('Messenger settings');
|
||||||
$page['menuid'] = 'settings';
|
$page['menuid'] = 'settings';
|
||||||
$page = array_merge($page, prepare_menu($operator));
|
$page = array_merge($page, prepare_menu($operator));
|
||||||
@ -77,10 +78,15 @@ class FeaturesController extends AbstractController
|
|||||||
{
|
{
|
||||||
csrf_check_token($request);
|
csrf_check_token($request);
|
||||||
|
|
||||||
|
$regenerate_button = false;
|
||||||
|
|
||||||
// Update options in the database.
|
// Update options in the database.
|
||||||
$options = $this->getOptionsList();
|
$options = $this->getOptionsList();
|
||||||
foreach ($options as $opt) {
|
foreach ($options as $opt) {
|
||||||
$value = $request->request->get($opt) == 'on' ? '1' : '0';
|
$value = $request->request->get($opt) == 'on' ? '1' : '0';
|
||||||
|
if (($opt === 'enabletracking') && (Settings::get($opt) != $value)) {
|
||||||
|
$regenerate_button = true;
|
||||||
|
}
|
||||||
Settings::set($opt, $value);
|
Settings::set($opt, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +100,7 @@ class FeaturesController extends AbstractController
|
|||||||
// Redirect the current operator to the same page using GET method.
|
// Redirect the current operator to the same page using GET method.
|
||||||
$redirect_to = $this->generateUrl(
|
$redirect_to = $this->generateUrl(
|
||||||
'settings_features',
|
'settings_features',
|
||||||
array('stored' => true)
|
array('stored' => true, 'regenerate' => $regenerate_button)
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this->redirect($redirect_to);
|
return $this->redirect($redirect_to);
|
||||||
|
@ -83,6 +83,7 @@ class PerformanceController extends AbstractController
|
|||||||
|
|
||||||
$page['enabletracking'] = Settings::get('enabletracking');
|
$page['enabletracking'] = Settings::get('enabletracking');
|
||||||
$page['stored'] = $request->query->get('stored');
|
$page['stored'] = $request->query->get('stored');
|
||||||
|
$page['regeneratebutton'] = $request->query->get('regenerate');
|
||||||
$page['title'] = getlocal("Messenger settings");
|
$page['title'] = getlocal("Messenger settings");
|
||||||
$page['menuid'] = "settings";
|
$page['menuid'] = "settings";
|
||||||
|
|
||||||
@ -107,6 +108,8 @@ class PerformanceController extends AbstractController
|
|||||||
$errors = array();
|
$errors = array();
|
||||||
$params = array();
|
$params = array();
|
||||||
|
|
||||||
|
$regenerate_button = false;
|
||||||
|
|
||||||
$params['online_timeout'] = $request->request->get('onlinetimeout');
|
$params['online_timeout'] = $request->request->get('onlinetimeout');
|
||||||
if (!is_numeric($params['online_timeout'])) {
|
if (!is_numeric($params['online_timeout'])) {
|
||||||
$errors[] = wrong_field("Operator online time threshold");
|
$errors[] = wrong_field("Operator online time threshold");
|
||||||
@ -141,6 +144,10 @@ class PerformanceController extends AbstractController
|
|||||||
$params['updatefrequency_tracking'] = $request->request->get('frequencytracking');
|
$params['updatefrequency_tracking'] = $request->request->get('frequencytracking');
|
||||||
if (!is_numeric($params['updatefrequency_tracking'])) {
|
if (!is_numeric($params['updatefrequency_tracking'])) {
|
||||||
$errors[] = wrong_field("Tracking refresh time");
|
$errors[] = wrong_field("Tracking refresh time");
|
||||||
|
} else {
|
||||||
|
if (Settings::get('updatefrequency_tracking') != $params['updatefrequency_tracking']) {
|
||||||
|
$regenerate_button = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$params['visitors_limit'] = $request->request->get('visitorslimit');
|
$params['visitors_limit'] = $request->request->get('visitorslimit');
|
||||||
@ -177,7 +184,7 @@ class PerformanceController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Redirect the current operator to the same page using get method.
|
// Redirect the current operator to the same page using get method.
|
||||||
$redirect_to = $this->generateUrl('settings_performance', array('stored' => true));
|
$redirect_to = $this->generateUrl('settings_performance', array('stored' => true, 'regenerate' => $regenerate_button));
|
||||||
|
|
||||||
return $this->redirect($redirect_to);
|
return $this->redirect($redirect_to);
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,11 @@
|
|||||||
<div id="form-message">{{l10n "Features activated"}}</div>
|
<div id="form-message">{{l10n "Features activated"}}</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if regeneratebutton}}
|
||||||
|
<br/>
|
||||||
|
<div id="form-message"><img src="{{asset "@CurrentStyle/images/dash/warning.png"}}" alt="" class="warning" /> {{l10n "<a href=\"{0}\">Regenerate the chat button</a> for options to take effect" (route "button_code")}}</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<form name="features" method="post" action="{{route "settings_features_save"}}">
|
<form name="features" method="post" action="{{route "settings_features_save"}}">
|
||||||
{{csrfTokenInput}}
|
{{csrfTokenInput}}
|
||||||
<input type="hidden" name="sent" value="true"/>
|
<input type="hidden" name="sent" value="true"/>
|
||||||
|
@ -13,6 +13,11 @@
|
|||||||
<div id="form-message">{{l10n "Changes saved"}}</div>
|
<div id="form-message">{{l10n "Changes saved"}}</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if regeneratebutton}}
|
||||||
|
<br/>
|
||||||
|
<div id="form-message"><img src="{{asset "@CurrentStyle/images/dash/warning.png"}}" alt="" class="warning" /> {{l10n "<a href=\"{0}\">Regenerate the chat button</a> for options to take effect" (route "button_code")}}</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<form name="performance" method="post" action="{{route "settings_performance_save"}}">
|
<form name="performance" method="post" action="{{route "settings_performance_save"}}">
|
||||||
{{csrfTokenInput}}
|
{{csrfTokenInput}}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user