refreshPage($this->indexHTML($input, $vars))->toArray(); } function indexHTML($input, $vars = array()){ $vars['zones_used'] = zone\Repository::factory()->getServersZonesUsed(); $vars['email_zone_created'] = notification\Repository::factory()->byName(notification\NotificationNameEnum::ZONE_CREATED_EMAIL)->count(); $vars['email_zone_edited'] = notification\Repository::factory()->byName(notification\NotificationNameEnum::ZONE_EDITED_EMAIL)->count(); $vars['email_zone_removed'] = notification\Repository::factory()->byName(notification\NotificationNameEnum::ZONED_REMOVED_EMAIL)->count(); $vars['tutorial'] = main\models\custom\globalsetting\GlobalSetting::byKey(main\models\custom\globalsetting\GlobalSettingEnum::TUTORIAL_DISABLED)!='on'?true:false; return array( 'tpl' => 'main' ,'vars' => $vars ); } function refreshNotificationTableJSON($input, $vars = array()) { $notifications = new notification\Repository(); $helper = new main\mgLibs\custom\RepoTableHelper($notifications, $input); $vars = $helper->getDataTableArray(); foreach($helper->get() as $notification) { //$notification = RowFormatter::format($notification); $vars['data'][] = $this->dataTablesParseRow('notification-row', ['notification' => $notification]); } return $vars; } function disableTutorialJSON($input, $vars = array()) { main\models\custom\globalsetting\GlobalSetting::set(main\models\custom\globalsetting\GlobalSettingEnum::TUTORIAL_DISABLED, 'on'); return AjaxResponse::I()->refreshPage($this->indexHTML($input))->toArray(); } }