PostOptionList.php
172 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 still allow access with direct URL.', 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 view, read or download %s. Any attempts to open %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 | 'modal' => 'modal-teaser', |
| 40 | 'descr' => __('Replace %s content with defined teaser message.', AAM_KEY) |
| 41 | ), |
| 42 | 'access_counter' => array( |
| 43 | 'title' => __('Read Counter', AAM_KEY), |
| 44 | 'sub' => __('Threshold', AAM_KEY), |
| 45 | 'option' => 'frontend.access_counter_limit', |
| 46 | 'preview' => 'frontend-access_counter_limit-preview', |
| 47 | 'modal' => 'modal-access-counter', |
| 48 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 49 | 'descr' => __('Define how many times %s can be read, viewed or download. After number of times exceeds the specified threshold, access will be denied and redirected based on the Access Denied Redirect rule.', AAM_KEY) |
| 50 | ), |
| 51 | 'comment' => array( |
| 52 | 'title' => __('Comment', AAM_KEY), |
| 53 | 'descr' => __('Restrict access to comment on %s if commenting is allowed.', AAM_KEY) |
| 54 | ), |
| 55 | 'redirect' => array( |
| 56 | 'title' => __('Redirect', AAM_KEY), |
| 57 | 'sub' => __('Redirect Rule', AAM_KEY), |
| 58 | 'option' => 'frontend.location', |
| 59 | 'preview' => 'frontend-location-preview', |
| 60 | 'modal' => 'modal-redirect', |
| 61 | 'descr' => __('Redirect user based on the defined redirect rule when user tries to read the %s. The REDIRECT option will be ignored if READ option is checked.', AAM_KEY), |
| 62 | ), |
| 63 | 'protected' => array( |
| 64 | 'title' => __('Password Protected', AAM_KEY), |
| 65 | 'sub' => __('Password', AAM_KEY), |
| 66 | 'option' => 'frontend.password', |
| 67 | 'preview' => 'frontend-option-preview', |
| 68 | 'modal' => 'modal-password', |
| 69 | 'descr' => __('Protect access to %s with password. Available with WordPress 4.7.0 or higher.', AAM_KEY) |
| 70 | ), |
| 71 | 'expire' => array( |
| 72 | 'title' => __('Access Expiration', AAM_KEY), |
| 73 | 'sub' => __('Expires', AAM_KEY), |
| 74 | 'option' => 'frontend.expire_datetime', |
| 75 | 'preview' => 'frontend-expire_datetime-preview', |
| 76 | 'modal' => 'modal-access-expires', |
| 77 | 'descr' => __('Define when access will expire for %s.', AAM_KEY) . sprintf(__('After expiration, the access to %s will be denied and 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>') |
| 78 | ), |
| 79 | 'monetize' => array( |
| 80 | 'title' => __('Monetized Access', AAM_KEY), |
| 81 | 'sub' => __('E-Product', AAM_KEY), |
| 82 | 'option' => 'frontend.eproduct', |
| 83 | 'preview' => 'frontend-eproduct-preview', |
| 84 | 'modal' => 'modal-eproduct', |
| 85 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 86 | 'descr' => sprintf(AAM_Backend_View_Helper::preparePhrase('[Premium feature!] Start selling access to %s. Access will be granted to open %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>') |
| 87 | ) |
| 88 | ), |
| 89 | 'backend' => array( |
| 90 | 'list' => array( |
| 91 | 'title' => __('List', AAM_KEY), |
| 92 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 93 | 'descr' => __('Hide %s however still allow access with direct URL.', AAM_KEY), |
| 94 | 'config' => 'check-post-visibility' |
| 95 | ), |
| 96 | 'edit' => array( |
| 97 | 'title' => __('Edit', AAM_KEY), |
| 98 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 99 | 'descr' => __('Restrict access to edit %s. Any attempts to edit %s will result in redirecting user based on the Access Denied Redirect rule.', AAM_KEY) |
| 100 | ), |
| 101 | 'delete' => array( |
| 102 | 'title' => __('Delete', AAM_KEY), |
| 103 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 104 | 'descr' => __('Restrict access to trash or permanently delete %s.', AAM_KEY) |
| 105 | ), |
| 106 | 'publish' => array( |
| 107 | 'title' => __('Publish', AAM_KEY), |
| 108 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 109 | 'descr' => __('Restrict access to publish %s. User will be allowed only to submit %s for review.', AAM_KEY) |
| 110 | ) |
| 111 | ), |
| 112 | 'api' => array( |
| 113 | 'list' => array( |
| 114 | 'title' => __('List', AAM_KEY), |
| 115 | 'descr' => __('Hide %s however still allow access to retrieve %s.', AAM_KEY), |
| 116 | 'config' => 'check-post-visibility' |
| 117 | ), |
| 118 | 'read' => array( |
| 119 | 'title' => __('Read', AAM_KEY), |
| 120 | 'descr' => __('Restrict access to retrieve %s. Any attempts to retrieve %s will be denied.', AAM_KEY) |
| 121 | ), |
| 122 | 'limit' => array( |
| 123 | 'title' => __('Limit', AAM_KEY), |
| 124 | 'sub' => __('Teaser message', AAM_KEY), |
| 125 | 'option' => 'api.teaser', |
| 126 | 'preview' => 'api-teaser-preview', |
| 127 | 'modal' => 'modal-teaser', |
| 128 | 'descr' => __('Replace %s content with defined teaser message.', AAM_KEY) |
| 129 | ), |
| 130 | 'access_counter' => array( |
| 131 | 'title' => __('Read Counter', AAM_KEY), |
| 132 | 'sub' => __('Threshold', AAM_KEY), |
| 133 | 'option' => 'api.access_counter_limit', |
| 134 | 'preview' => 'api-access_counter_limit-preview', |
| 135 | 'modal' => 'modal-access-counter', |
| 136 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 137 | 'descr' => __('Define how many times %s can be retrieved. After number of time exceeds the defined threshold, the access will be denied to %s.', AAM_KEY) |
| 138 | ), |
| 139 | 'comment' => array( |
| 140 | 'title' => __('Comment', AAM_KEY), |
| 141 | 'descr' => __('Restrict access to comment on %s if commenting feature is enabled.', AAM_KEY) |
| 142 | ), |
| 143 | 'protected' => array( |
| 144 | 'title' => __('Password Protected', AAM_KEY), |
| 145 | 'sub' => __('Password', AAM_KEY), |
| 146 | 'option' => 'api.password', |
| 147 | 'preview' => 'api-option-preview', |
| 148 | 'modal' => 'modal-password', |
| 149 | 'descr' => __('Protected %s with password. Available with WordPress 4.7.0 or higher.', AAM_KEY) |
| 150 | ), |
| 151 | 'expire' => array( |
| 152 | 'title' => __('Access Expiration', AAM_KEY), |
| 153 | 'sub' => __('Expires', AAM_KEY), |
| 154 | 'option' => 'api.expire_datetime', |
| 155 | 'preview' => 'api-expire_datetime-preview', |
| 156 | 'modal' => 'modal-access-expires', |
| 157 | 'descr' => __('Define when access expires to %s.', AAM_KEY) . sprintf(__('After expiration, the access to %s will be denied. 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>') |
| 158 | ), |
| 159 | 'edit' => array( |
| 160 | 'title' => __('Update', AAM_KEY), |
| 161 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 162 | 'descr' => __('Restrict access to update %s. Any attempts to update %s will be denied.', AAM_KEY) |
| 163 | ), |
| 164 | 'delete' => array( |
| 165 | 'title' => __('Delete', AAM_KEY), |
| 166 | 'exclude' => array(AAM_Core_Subject_Visitor::UID), |
| 167 | 'descr' => __('Restrict access to trash or permanently delete %s.', AAM_KEY) |
| 168 | ) |
| 169 | ) |
| 170 | ); |
| 171 | } |
| 172 | } |