PostOptionList.php
109 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * ====================================================================== |
| 5 | * LICENSE: This file is subject to the terms and conditions defined in * |
| 6 | * file 'license.txt', which is part of this source code package. * |
| 7 | * ====================================================================== |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Post option list |
| 12 | */ |
| 13 | class AAM_Backend_View_PostOptionList { |
| 14 | |
| 15 | /** |
| 16 | * Get post option list |
| 17 | * |
| 18 | * @return array |
| 19 | * |
| 20 | * @access public |
| 21 | */ |
| 22 | public static function get() { |
| 23 | return array( |
| 24 | 'frontend' => array( |
| 25 | 'list' => array( |
| 26 | 'title' => __('List', AAM_KEY), |
| 27 | 'descr' => __('Hide %s however access with a direct URL will be still allowed. When there are more than 500 posts, this option may not be applied immediately because, for performance reasons, AAM checks limited number of posts per request.', AAM_KEY) . sprintf(__(' %sSee in action.%s', AAM_KEY), "<a href='https://youtu.be/2jiu_CL6JJg' target='_blank'>", '</a>'), |
| 28 | 'config' => 'check-post-visibility' |
| 29 | ), |
| 30 | 'read' => array( |
| 31 | 'title' => __('Read', AAM_KEY), |
| 32 | 'descr' => __('Restrict access to read the %s. Any attempts to read, view or open the %s will be denied and redirected based on the Access Denied Redirect rule.', AAM_KEY) . sprintf(__(' %sSee in action.%s', AAM_KEY), "<a href='https://youtu.be/1742nVeGvgs' target='_blank'>", '</a>') |
| 33 | ), |
| 34 | 'limit' => array( |
| 35 | 'title' => __('Limit', AAM_KEY), |
| 36 | 'sub' => __('Teaser message', AAM_KEY), |
| 37 | 'option' => 'frontend.teaser', |
| 38 | 'preview' => 'frontend-teaser-preview', |
| 39 | 'descr' => __('When checked, show defined teaser message instead of the %s content.', AAM_KEY) |
| 40 | ), |
| 41 | 'access_counter' => array( |
| 42 | 'title' => __('Read Counter', AAM_KEY), |
| 43 | 'sub' => __('Threshold', AAM_KEY), |
| 44 | 'option' => 'frontend.access_counter_limit', |
| 45 | 'preview' => 'frontend-access_counter_limit-preview', |
| 46 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 47 | 'descr' => __('Define how many times the %s can be opened to read, view or download. After number of time exceeds the defined threshold, the access will be denied to the %s and redirected based on the Access Denied Redirect rule.', AAM_KEY) |
| 48 | ), |
| 49 | 'comment' => array( |
| 50 | 'title' => __('Comment', AAM_KEY), |
| 51 | 'descr' => __('Restrict access to comment on %s when commenting feature is enabled.', AAM_KEY) |
| 52 | ), |
| 53 | 'redirect' => array( |
| 54 | 'title' => __('Redirect', AAM_KEY), |
| 55 | 'sub' => __('Redirect Rule', AAM_KEY), |
| 56 | 'option' => 'frontend.location', |
| 57 | 'preview' => 'frontend-location-preview', |
| 58 | 'descr' => sprintf(__('Redirect user based on the defined redirect rule when user tries to read the %s. The REDIRECT option will be ignored if READ option checked. For more information about this option please refer to the %sHelp Section%s.', AAM_KEY), '%s', '<a href="https://aamplugin.com/help#post-redirect" target="_blank">', '</a>') |
| 59 | ), |
| 60 | 'protected' => array( |
| 61 | 'title' => __('Password Protected', AAM_KEY), |
| 62 | 'sub' => __('Password', AAM_KEY), |
| 63 | 'option' => 'frontend.password', |
| 64 | 'preview' => 'frontend-option-preview', |
| 65 | 'descr' => __('Password protect the %s. Available with WordPress 4.7.0 or higher.', AAM_KEY) |
| 66 | ), |
| 67 | 'expire' => array( |
| 68 | 'title' => __('Access Expiration', AAM_KEY), |
| 69 | 'sub' => __('Expires:', AAM_KEY), |
| 70 | 'option' => 'frontend.expire_datetime', |
| 71 | 'preview' => 'frontend-expire_datetime-preview', |
| 72 | 'descr' => __('Define when access expires for %s.', AAM_KEY) . sprintf(__('After expiration, the access to %s will be denied and user will be redirected based on the Access Denied Redirect rule. For more information %scheck this article%s or ', AAM_KEY), '%s', "<a href='https://aamplugin.com/help/how-to-set-expiration-date-for-any-wordpress-content' target='_blank'>", '</a>') . sprintf(__(' %ssee in action.%s', AAM_KEY), "<a href='https://youtu.be/IgtgVoWs35w' target='_blank'>", '</a>') |
| 73 | ), |
| 74 | 'monetize' => array( |
| 75 | 'title' => __('Monetized Access', AAM_KEY), |
| 76 | 'sub' => __('E-Product', AAM_KEY), |
| 77 | 'option' => 'frontend.eproduct', |
| 78 | 'preview' => 'frontend-eproduct-preview', |
| 79 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 80 | 'descr' => sprintf(AAM_Backend_View_Helper::preparePhrase('[Premium feature!] Start selling access to the %s. Access will be granted to read, view or download %s only if selected E-Product had been purchased. For more information %scheck this article%s.', 'b'), '%s', '%s', "<a href='https://aamplugin.com/help/how-to-monetize-access-to-the-wordpress-content' target='_blank'>", '</a>') |
| 81 | ), |
| 82 | ), |
| 83 | 'backend' => array( |
| 84 | 'list' => array( |
| 85 | 'title' => __('List', AAM_KEY), |
| 86 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 87 | 'descr' => __('Hide %s however access with a direct URL is still allowed. When there are more than 500 posts, this option may not be applied immediately because, for performance reasons, AAM checks limited number of posts per request.', AAM_KEY), |
| 88 | 'config' => 'check-post-visibility' |
| 89 | ), |
| 90 | 'edit' => array( |
| 91 | 'title' => __('Edit', AAM_KEY), |
| 92 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 93 | 'descr' => __('Restrict access to edit the %s. Any attempts to edit %s will result in redirecting user based on the Access Denied Redirect rule.', AAM_KEY) |
| 94 | ), |
| 95 | 'delete' => array( |
| 96 | 'title' => __('Delete', AAM_KEY), |
| 97 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 98 | 'descr' => __('Restrict access to trash or permanently delete %s.', AAM_KEY) |
| 99 | ), |
| 100 | 'publish' => array( |
| 101 | 'title' => __('Publish', AAM_KEY), |
| 102 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 103 | 'descr' => __('Restrict access to publish the %s. User will be allowed only submit the %s for review.', AAM_KEY) |
| 104 | ) |
| 105 | ) |
| 106 | ); |
| 107 | } |
| 108 | } |
| 109 |