- Updates settings to use task scheduler method names from the newly

introduced config class
This commit is contained in:
Vlad
2016-07-19 09:00:35 -04:00
parent 6dd3c6acda
commit 5ed0a5819c
3 changed files with 10 additions and 3 deletions

View File

@@ -255,6 +255,7 @@ class Menu {
$data = array( $data = array(
'settings' => $settings, 'settings' => $settings,
'segments' => Segment::getPublic()->findArray(), 'segments' => Segment::getPublic()->findArray(),
'task_scheduler' => TaskScheduler::getAvailableMethods(),
'pages' => Pages::getAll(), 'pages' => Pages::getAll(),
'flags' => $flags, 'flags' => $flags,
'current_user' => wp_get_current_user(), 'current_user' => wp_get_current_user(),

View File

@@ -74,6 +74,13 @@ class Populator {
private function createDefaultSettings() { private function createDefaultSettings() {
$current_user = wp_get_current_user(); $current_user = wp_get_current_user();
if(!Setting::getValue('task_scheduler')) {
// disable task scheduler (cron) be default
Setting::setValue('task_scheduler', array(
'method' => TaskScheduler::METHOD_WORDPRESS
));
}
// default sender info based on current user // default sender info based on current user
$sender = array( $sender = array(
'name' => $current_user->display_name, 'name' => $current_user->display_name,

View File

@@ -40,9 +40,8 @@
<input <input
type="radio" type="radio"
name="task_scheduler[method]" name="task_scheduler[method]"
value="WordPress" value="<%= task_scheduler.wordpress %>"
<% if not(settings.task_scheduler.method) <% if (settings.task_scheduler.method == task_scheduler.wordpress) %>
or (settings.task_scheduler.method == 'WordPress') %>
checked="checked" checked="checked"
<% endif %> <% endif %>
/><%= __('Visitors to your website (recommended)') %> /><%= __('Visitors to your website (recommended)') %>