auth->makePermissions([ dcAuth::PERMISSION_ADMIN, ])); $s = dcCore::app()->blog->settings->get(basename(__DIR__)); if (!empty($_POST['saveconfig'])) { try { $allowed_ip = []; foreach (explode("\n", $_POST['construction_allowed_ip']) as $ip) { $allowed_ip[] = trim($ip); } $extra_urls = []; foreach (explode(',', $_POST['construction_extra_urls']) as $url) { $extra_urls[] = trim($url); } $s->put('flag', empty($_POST['construction_flag']) ? false : true); $s->put('allowed_ip', json_encode($allowed_ip)); $s->put('title', $_POST['construction_title']); $s->put('message', $_POST['construction_message']); $s->put('extra_urls', json_encode($extra_urls)); dcCore::app()->blog->triggerBlog(); dcAdminNotices::addSuccessNotice( __('Settings successfully updated.') ); dcCore::app()->adminurl->redirect( 'admin.plugin.' . basename(__DIR__) ); } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } } $nb_rows = count(json_decode($s->get('allowed_ip'), true)); if ($nb_rows < 2) { $nb_rows = 2; } elseif ($nb_rows > 10) { $nb_rows = 10; } $editor = dcCore::app()->auth->getOption('editor'); echo '