diff --git a/assets/css/src/modal.styl b/assets/css/src/modal.styl index 9ae9bcd290..a5995ca665 100644 --- a/assets/css/src/modal.styl +++ b/assets/css/src/modal.styl @@ -159,23 +159,6 @@ body.mailpoet_modal_opened margin: 0 text-align: right -.mailpoet_button - padding: 3px 15px - border: 1px solid #444 - font-weight: normal - cursor: pointer - background-color: #222 - color: #cfcfcf - font-size: 1em - -.mailpoet_button:hover - background-color: #00aacc - color: #fff - -.mailpoet_button:active - background-color: #00ccff - color: #fff - @media screen and (max-width: 782px) #mailpoet_modal_overlay.mailpoet_panel_overlay top: 46px diff --git a/lib/Config/Changelog.php b/lib/Config/Changelog.php new file mode 100644 index 0000000000..f11d94b48e --- /dev/null +++ b/lib/Config/Changelog.php @@ -0,0 +1,27 @@ +setupWidget(); $this->setupAnalytics(); $this->setupPermissions(); + $this->setupChangelog(); } function setupDB() { @@ -104,4 +105,9 @@ class Initializer { $permissions = new Permissions(); $permissions->init(); } + + function setupChangelog() { + $changelog = new Changelog(); + $changelog->init(); + } } diff --git a/lib/Config/Menu.php b/lib/Config/Menu.php index a88ba27775..5e236d4c2d 100644 --- a/lib/Config/Menu.php +++ b/lib/Config/Menu.php @@ -34,7 +34,7 @@ class Menu { 'MailPoet', 'manage_options', 'mailpoet', - array($this, 'welcome'), + array($this, 'home'), $this->assets_url . '/img/menu_icon.png', 30 ); @@ -94,31 +94,42 @@ class Menu { 'mailpoet-export', array($this, 'export') ); - // add_submenu_page( - // 'mailpoet', - // __('Newsletter editor'), - // __('Newsletter editor'), - // 'manage_options', - // 'mailpoet-newsletter-editor', - // array($this, 'newletterEditor') - // ); - $this->registered_pages(); - } - function registered_pages() { - global $_registered_pages; - $pages = array( - 'mailpoet-welcome' => array($this, 'welcome'), - 'mailpoet-form-editor' => array($this, 'formEditor'), - 'mailpoet-newsletter-editor' => array($this, 'newletterEditor') + add_submenu_page( + null, + __('Welcome'), + __('Welcome'), + 'manage_options', + 'mailpoet-welcome', + array($this, 'welcome') + ); + + add_submenu_page( + null, + __('Update'), + __('Update'), + 'manage_options', + 'mailpoet-update', + array($this, 'update') + ); + + add_submenu_page( + null, + __('Form editor'), + __('Form editor'), + 'manage_options', + 'mailpoet-form-editor', + array($this, 'formEditor') + ); + + add_submenu_page( + null, + __('Newsletter editor'), + __('Newsletter editor'), + 'manage_options', + 'mailpoet-newsletter-editor', + array($this, 'newletterEditor') ); - foreach($pages as $menu_slug => $callback) { - $hookname = get_plugin_page_hookname($menu_slug, null); - if(!empty($hookname)) { - add_action($hookname, $callback); - } - $_registered_pages[$hookname] = true; - } } function home() { @@ -135,6 +146,15 @@ class Menu { echo $this->renderer->render('welcome.html', $data); } + function update() { + $data = array( + 'settings' => Setting::getAll(), + 'current_user' => wp_get_current_user() + ); + + echo $this->renderer->render('update.html', $data); + } + function settings() { $settings = Setting::getAll(); diff --git a/lib/Models/Setting.php b/lib/Models/Setting.php index 2d4c1de17b..e4b0960783 100644 --- a/lib/Models/Setting.php +++ b/lib/Models/Setting.php @@ -28,6 +28,13 @@ class Setting extends Model { } } + public static function setValue($key, $value) { + return Setting::createOrUpdate(array( + 'name' => $key, + 'value' => $value + )); + } + public static function getAll() { $settingsCollection = self::findMany(); $settings = array(); diff --git a/views/update.html b/views/update.html new file mode 100644 index 0000000000..252ec5b871 --- /dev/null +++ b/views/update.html @@ -0,0 +1,20 @@ +<% extends 'layout.html' %> + +<% block content %> +