Installer
3 years ago
AdminNotices.php
2 months ago
AjaxHandler.php
1 year ago
Autologin.php
9 months ago
BlockRegistrations.php
10 months ago
BuddyPressBbPress.php
3 years ago
DisableConcurrentLogins.php
2 years ago
EditUserProfile.php
5 months ago
ExtensionManager.php
1 month ago
FileUploader.php
3 months ago
FormPreviewHandler.php
5 months ago
FormRepository.php
1 year ago
FormShortcodeDefaults.php
1 month ago
GDPR.php
3 years ago
Geolocation.php
3 years ago
GlobalSiteAccess.php
3 years ago
ImageUploader.php
1 year ago
LoginAuth.php
1 year ago
Miscellaneous.php
3 years ago
ModifyRedirectDefaultLinks.php
2 hours ago
PPRESS_Session.php
1 year ago
PROFILEPRESS_sql.php
1 year ago
PasswordReset.php
1 year ago
ProfileUrlRewrite.php
4 years ago
RegistrationAuth.php
1 week ago
SendEmail.php
3 years ago
ShortcodeThemeFactory.php
5 years ago
UserAvatar.php
1 year ago
UserSignupLocationListingPage.php
3 years ago
UsernameEmailRestrictLogin.php
4 years ago
WPProfileFieldParserTrait.php
1 year ago
WelcomeEmailAfterSignup.php
1 year ago
default-email-template.php
1 year ago
index.php
3 years ago
FormShortcodeDefaults.php
329 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePress\Core\Classes; |
| 4 | |
| 5 | use ProfilePress\Core\ShortcodeParser\PasswordResetTag; |
| 6 | |
| 7 | class FormShortcodeDefaults |
| 8 | { |
| 9 | protected $form_type; |
| 10 | |
| 11 | public function __construct($form_type) |
| 12 | { |
| 13 | $this->form_type = str_replace('-', '_', $form_type); |
| 14 | } |
| 15 | |
| 16 | public function get_structure() |
| 17 | { |
| 18 | $method = $this->form_type . '_structure'; |
| 19 | |
| 20 | if ( ! method_exists($this, $method)) { |
| 21 | return ''; |
| 22 | } |
| 23 | |
| 24 | return $this->$method(); |
| 25 | } |
| 26 | |
| 27 | public function get_css() |
| 28 | { |
| 29 | $method = $this->form_type . '_css'; |
| 30 | |
| 31 | if ( ! method_exists($this, $method)) { |
| 32 | return ''; |
| 33 | } |
| 34 | |
| 35 | return $this->$method(); |
| 36 | } |
| 37 | |
| 38 | public function success_message() |
| 39 | { |
| 40 | $method = $this->form_type . '_success_message'; |
| 41 | |
| 42 | if ( ! method_exists($this, $method)) { |
| 43 | return ''; |
| 44 | } |
| 45 | |
| 46 | return $this->$method(); |
| 47 | } |
| 48 | |
| 49 | public function user_profile_structure() |
| 50 | { |
| 51 | return <<<HTML |
| 52 | <h1>[profile-username]'s Profile</h1> |
| 53 | |
| 54 | <div class="profile-avatar"> |
| 55 | <img class="avatar" src="[profile-avatar-url]"> |
| 56 | </div> |
| 57 | |
| 58 | <div class="profile-detail"> |
| 59 | |
| 60 | <p>Username: [profile-username]</p> |
| 61 | |
| 62 | <p>Email: [profile-email]</p> |
| 63 | |
| 64 | <p>Website: [profile-website]</p> |
| 65 | |
| 66 | <p>First Name: [profile-first-name]</p> |
| 67 | |
| 68 | <p>Last Name: [profile-last-name]</p> |
| 69 | |
| 70 | <p>Gender: [profile-cpf key="gender"]</p> |
| 71 | </div> |
| 72 | HTML; |
| 73 | |
| 74 | } |
| 75 | |
| 76 | public function login_structure() |
| 77 | { |
| 78 | return <<<HTML |
| 79 | <div class="login-form"> |
| 80 | |
| 81 | <p>[login-username placeholder="Username" class="login-name"]</p> |
| 82 | |
| 83 | <p>[login-password placeholder="Password" class="login-passkey"]</p> |
| 84 | |
| 85 | <p>[login-remember class="remember-me"] Remember Me</p> |
| 86 | |
| 87 | <p>[login-submit value="Sign In" class="login-name"]</p> |
| 88 | |
| 89 | [link-registration class="reg" label="Register Now"] | [link-lost-password class="lostp" label="Forgot Password?"] |
| 90 | |
| 91 | </div> |
| 92 | HTML; |
| 93 | |
| 94 | } |
| 95 | |
| 96 | public function login_css() |
| 97 | { |
| 98 | return <<<CSS |
| 99 | /* css class for the login generated errors */ |
| 100 | |
| 101 | .profilepress-login-status { |
| 102 | background-color: #34495e; |
| 103 | color: #ffffff; |
| 104 | border: medium none; |
| 105 | border-radius: 4px; |
| 106 | font-size: 15px; |
| 107 | font-weight: normal; |
| 108 | line-height: 1.4; |
| 109 | padding: 8px 5px; |
| 110 | } |
| 111 | |
| 112 | .profilepress-login-status a { |
| 113 | color: #ea9629 !important; |
| 114 | } |
| 115 | CSS; |
| 116 | |
| 117 | } |
| 118 | |
| 119 | public function registration_structure() |
| 120 | { |
| 121 | return <<<HTML |
| 122 | <div class="reg-form"> |
| 123 | |
| 124 | <p> |
| 125 | <label for="id-username">Username</label> |
| 126 | [reg-username id="id-username" placeholder="Username" class="registration-name"] |
| 127 | </p> |
| 128 | |
| 129 | <p> |
| 130 | <label for="id-password">Password</label> |
| 131 | [reg-password id="id-password" placeholder="Password" class="registration-passkey"] |
| 132 | </p> |
| 133 | |
| 134 | <p> |
| 135 | <label for="id-email">Email Address</label> |
| 136 | [reg-email id="id-email" placeholder="Email" class="reg-email"] |
| 137 | </p> |
| 138 | |
| 139 | <p> |
| 140 | <label for="id-website">Website</label> |
| 141 | [reg-website class="reg-website" placeholder="Website" id="website-id" required] |
| 142 | </p> |
| 143 | |
| 144 | <p> |
| 145 | <label for="id-nickname">Nickname</label> |
| 146 | [reg-nickname class="nickname" placeholder="Nickname" id="nickname-id"] |
| 147 | </p> |
| 148 | |
| 149 | <p> |
| 150 | <label for="id-firstname">First Name</label> |
| 151 | [reg-first-name class="firstname" id="firstname-id" placeholder="First Name"] |
| 152 | </p> |
| 153 | |
| 154 | <p> |
| 155 | <label for="id-lastname">Last Name</label> |
| 156 | [reg-last-name class="remember-me" id="lastname-id" placeholder="Last Name" required] |
| 157 | </p> |
| 158 | |
| 159 | <p> |
| 160 | [reg-submit value="Register" class="submit" id="submit-button"] |
| 161 | </p> |
| 162 | |
| 163 | <p> |
| 164 | Have an account? [link-login label="Login"] |
| 165 | </p> |
| 166 | |
| 167 | </div> |
| 168 | HTML; |
| 169 | |
| 170 | } |
| 171 | |
| 172 | public function registration_css() |
| 173 | { |
| 174 | return <<<CSS |
| 175 | /* css class for the registration form generated errors */ |
| 176 | |
| 177 | .profilepress-reg-status { |
| 178 | border-radius: 6px; |
| 179 | font-size: 17px; |
| 180 | line-height: 1.471; |
| 181 | padding: 10px 19px; |
| 182 | background-color: #e74c3c; |
| 183 | color: #ffffff; |
| 184 | font-weight: normal; |
| 185 | display: block; |
| 186 | text-align: center; |
| 187 | vertical-align: middle; |
| 188 | margin: 5px 0; |
| 189 | } |
| 190 | CSS; |
| 191 | |
| 192 | } |
| 193 | |
| 194 | public function registration_success_message() |
| 195 | { |
| 196 | return '<div>Registration successful.</div>'; |
| 197 | } |
| 198 | |
| 199 | public function edit_profile_structure() |
| 200 | { |
| 201 | return <<<HTML |
| 202 | <div class="edit-profile"> |
| 203 | |
| 204 | <p> |
| 205 | <label for="id-username">Username</label> |
| 206 | [edit-profile-username id="id-username" placeholder="username" class="edit-profile-name"] |
| 207 | </p> |
| 208 | |
| 209 | <p> |
| 210 | <label for="id-password">Password</label> |
| 211 | [edit-profile-password id="id-password" placeholder="password" class="edit-profile-passkey"] |
| 212 | </p> |
| 213 | |
| 214 | <p> |
| 215 | <label for="id-email">Email Address</label> |
| 216 | [edit-profile-email id="id-email" placeholder="Email" class="reg-email"] |
| 217 | </p> |
| 218 | |
| 219 | <p> |
| 220 | <label for="id-website">Website</label> |
| 221 | [edit-profile-website class="reg-website" placeholder="Website" id="id-website"] |
| 222 | </p> |
| 223 | |
| 224 | <p> |
| 225 | <label for="id-nickname">Nickname</label> |
| 226 | [edit-profile-nickname class="remember-me" placeholder="Nickname" id="id-nickname"] |
| 227 | </p> |
| 228 | |
| 229 | <p> |
| 230 | [pp-user-avatar class="user-avatar"] |
| 231 | </p> |
| 232 | [pp-remove-avatar-button label="Remove" class="removed"] |
| 233 | |
| 234 | <p> |
| 235 | <label for="id-nickname">Profile Picture</label> |
| 236 | [edit-profile-avatar class="avatar" placeholder="avatar" id="id-avatar"] |
| 237 | </p> |
| 238 | |
| 239 | <p> |
| 240 | <label for="id-display-name">Display Name</label> |
| 241 | [edit-profile-display-name class="display-name" placeholder="Display Name" id="id-display-name"] |
| 242 | </p> |
| 243 | |
| 244 | <p> |
| 245 | <label for="id-firstname">First Name</label> |
| 246 | [edit-profile-first-name class="remember-me" id="id-firstname" placeholder="First Name"] |
| 247 | </p> |
| 248 | |
| 249 | <p> |
| 250 | <label for="id-lastname">Last Name</label> |
| 251 | [edit-profile-last-name class="remember-me" id="id-lastname" placeholder="Last Name"] |
| 252 | </p> |
| 253 | |
| 254 | <p> |
| 255 | [edit-profile-submit value="Edit Profile" class="submit" id="submit-button"] |
| 256 | </p> |
| 257 | |
| 258 | </div> |
| 259 | HTML; |
| 260 | |
| 261 | } |
| 262 | |
| 263 | public function edit_profile_css() |
| 264 | { |
| 265 | return <<<CSS |
| 266 | /* css class for the edit profile generated errors */ |
| 267 | |
| 268 | .profilepress-edit-profile-status { |
| 269 | background-color: #34495e; |
| 270 | color: #ffffff; |
| 271 | border: medium none; |
| 272 | border-radius: 4px; |
| 273 | font-size: 15px; |
| 274 | line-height: 1.4; |
| 275 | padding: 8px 5px; |
| 276 | font-weight: bold; |
| 277 | margin:4px 1px; |
| 278 | } |
| 279 | CSS; |
| 280 | |
| 281 | } |
| 282 | |
| 283 | public function edit_profile_success_message() |
| 284 | { |
| 285 | return '<div>Changes saved.</div>'; |
| 286 | } |
| 287 | |
| 288 | public function password_reset_structure() |
| 289 | { |
| 290 | return <<<HTML |
| 291 | <div> |
| 292 | |
| 293 | <p>Please enter your username or email address.</p> |
| 294 | <p>You will receive a link to create a new password via email.</p> |
| 295 | |
| 296 | <p>[user-login id="login" placeholder="Username or E-mail:" class="user-login"]</p> |
| 297 | |
| 298 | <p>[reset-submit value="Reset Password" class="submit" id="submit-button"]</p> |
| 299 | |
| 300 | </div> |
| 301 | HTML; |
| 302 | |
| 303 | } |
| 304 | |
| 305 | public function password_reset_css() |
| 306 | { |
| 307 | return <<<CSS |
| 308 | /* css class for the password reset form generated errors */ |
| 309 | |
| 310 | .profilepress-reset-status { |
| 311 | background-color: #27CCC0; |
| 312 | color: #fff; |
| 313 | padding: 1em 2em 1em 3.5em; |
| 314 | margin: 0 0 2em; |
| 315 | } |
| 316 | CSS; |
| 317 | |
| 318 | } |
| 319 | |
| 320 | public function password_reset_handler() |
| 321 | { |
| 322 | return PasswordResetTag::get_default_handler_form(); |
| 323 | } |
| 324 | |
| 325 | public function password_reset_success_message() |
| 326 | { |
| 327 | return '<div>Check your email for further instructions</div>'; |
| 328 | } |
| 329 | } |