diff --git a/assets/screenshot-1.png b/assets/screenshot-1.png new file mode 100644 index 0000000..aa575cf Binary files /dev/null and b/assets/screenshot-1.png differ diff --git a/assets/screenshot-2.png b/assets/screenshot-2.png new file mode 100644 index 0000000..749ae01 Binary files /dev/null and b/assets/screenshot-2.png differ diff --git a/assets/screenshot-3.png b/assets/screenshot-3.png new file mode 100644 index 0000000..6ea8c7f Binary files /dev/null and b/assets/screenshot-3.png differ diff --git a/controllers/all-audits.php b/controllers/all-audits.php index 105b83c..22fb971 100644 --- a/controllers/all-audits.php +++ b/controllers/all-audits.php @@ -31,21 +31,30 @@ if ( isset($_POST['submit']) && check_admin_referer('msa-add-audit') ) { - /** - * - * This is the main action for creating an audit - * - */ - do_action('msa_create_audit', $_POST); + // Check if they can add a new audit - $_POST['user'] = get_current_user_id(); + if ( apply_filters('msa_can_add_new_audit', true) ) { - $date_range = json_decode(stripcslashes($_POST['date-range']), true); + /** + * + * This is the main action for creating an audit + * + */ + do_action('msa_create_audit', $_POST); - $_POST['after-date'] = $date_range['start']; - $_POST['before-date'] = $date_range['end']; + $_POST['user'] = get_current_user_id(); - msa_add_audit_to_queue($_POST); + $date_range = json_decode(stripcslashes($_POST['date-range']), true); + + $_POST['after-date'] = $date_range['start']; + $_POST['before-date'] = $date_range['end']; + + msa_add_audit_to_queue($_POST); + + } else { + + set_transient('msa_unable_to_create_audit', __('Unable to create your audit because you reached the maximum number of audits you can have. In order to add a new audit you will first need to delete one. If you want want to increase the amount of audits you can have please ') . '' . __('download the extension') . '' ); + } msa_force_redirect(get_admin_url() . 'admin.php?page=msa-all-audits'); } diff --git a/css/theme.css b/css/theme.css new file mode 100644 index 0000000..c766cbb --- /dev/null +++ b/css/theme.css @@ -0,0 +1,57 @@ +/* =================================================================== + * + * My Site Audit https://mysiteaudit.com + * + * Created: 11/20/15 + * Package: Styles/ Theme + * File: theme.css + * Author: Kyle Benk + * + * + * Copyright 2015 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * ================================================================= */ + +/* =================================================================== + * + * This theme is baed on the My Site Audit color palette. + * + * Source: http://www.color-hex.com/color-palette/12493 + * + * ================================================================= */ + +/* Text */ + +.mas-text-default { + color: #333; +} + +.msa-text-primary { + color: #a532f7; +} + +.msa-text-success { + color: #357f26; +} + +.msa-text-warning { + color: #f7a532; +} + +.msa-text-danger { + color: #FA421F; +} + +.msa-text-info { + color: #26357f; +} \ No newline at end of file diff --git a/functions/admin-notices.php b/functions/admin-notices.php index ed9b7c2..9de7147 100644 --- a/functions/admin-notices.php +++ b/functions/admin-notices.php @@ -35,6 +35,20 @@ */ function msa_admin_notices() { + // Unable to create audit + + if ( false !== ( $no_audit = get_transient('msa_unable_to_create_audit') ) ) { + + ?> +