first commit
This commit is contained in:
55
public/partials/profile/allow-anonymous.php
Normal file
55
public/partials/profile/allow-anonymous.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* Copyright 2019 Peter Putzer.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package mundschenk-at/avatar-privacy
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
/**
|
||||
* Frontend profile form `allow_anonymous` checkbox.
|
||||
*
|
||||
* Required template variables:
|
||||
*
|
||||
* @var string $nonce The nonce itself.
|
||||
* @var string $action The nonce action.
|
||||
* @var string $field_name The name of the checkbox `<input>` element.
|
||||
* @var string $value The checkbox value.
|
||||
* @var string $show_description True if the long description should be displayed.
|
||||
*/
|
||||
?>
|
||||
<div class="avatar-privacy-allow-anonymous">
|
||||
<?php \wp_nonce_field( $action, $nonce ); ?>
|
||||
<input
|
||||
id="<?php echo \esc_attr( $field_name ); ?>"
|
||||
name="<?php echo \esc_attr( $field_name ); ?>"
|
||||
type="checkbox"
|
||||
value="true"
|
||||
<?php \checked( $value ); ?>
|
||||
/>
|
||||
<label for="<?php echo \esc_attr( $field_name ); ?>"><?php \esc_html_e( 'Allow logged-out comments with my profile picture.', 'avatar-privacy' ); ?></label><br />
|
||||
<?php if ( ! empty( $show_description ) ) : ?>
|
||||
<p class="description">
|
||||
<?php \esc_html_e( 'Check this box if you want to be able to use your profile picture while logged-out.', 'avatar-privacy' ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
59
public/partials/profile/use-gravatar.php
Normal file
59
public/partials/profile/use-gravatar.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* Copyright 2019-2021 Peter Putzer.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package mundschenk-at/avatar-privacy
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
use Avatar_Privacy\Tools\Template as T;
|
||||
|
||||
/**
|
||||
* Frontend profile form `use_gravatar` checkbox.
|
||||
*
|
||||
* Required template variables:
|
||||
*
|
||||
* @var T $template The templating helper.
|
||||
* @var string $nonce The nonce itself.
|
||||
* @var string $action The nonce action.
|
||||
* @var string $field_name The name of the checkbox `<input>` element.
|
||||
* @var string $value The checkbox value.
|
||||
* @var string $show_description True if the long description should be displayed.
|
||||
*/
|
||||
?>
|
||||
<div class="avatar-privacy-use-gravatar">
|
||||
<?php \wp_nonce_field( $action, $nonce ); ?>
|
||||
<input
|
||||
id="<?php echo \esc_attr( $field_name ); ?>"
|
||||
name="<?php echo \esc_attr( $field_name ); ?>"
|
||||
type="checkbox"
|
||||
value="true"
|
||||
<?php \checked( $value ); ?>
|
||||
/>
|
||||
<label for="<?php echo \esc_attr( $field_name ); ?>"><?php echo \wp_kses( $template->get_use_gravatar_label( 'user' ), T::ALLOWED_HTML_LABEL ); ?></label><br />
|
||||
<?php if ( ! empty( $show_description ) ) : ?>
|
||||
<p class="description">
|
||||
<?php \esc_html_e( "Uncheck this box if you don't want to display the gravatar for your e-mail address (or don't have an account on Gravatar.com).", 'avatar-privacy' ); ?>
|
||||
<?php \esc_html_e( 'This setting will only take effect if you have not uploaded a local profile picture.', 'avatar-privacy' ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
65
public/partials/profile/user-avatar-upload.php
Normal file
65
public/partials/profile/user-avatar-upload.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of Avatar Privacy.
|
||||
*
|
||||
* Copyright 2019-2021 Peter Putzer.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* ***
|
||||
*
|
||||
* @package mundschenk-at/avatar-privacy
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
use Avatar_Privacy\Tools\Template as T;
|
||||
|
||||
/**
|
||||
* Required template variables:
|
||||
*
|
||||
* @var int $user_id The ID of the edited user.
|
||||
* @var T $template The templating helper.
|
||||
* @var string $nonce The nonce itself.
|
||||
* @var string $action The nonce action.
|
||||
* @var string $upload_field The name of the uploader `<input>` element.
|
||||
* @var string $erase_field The name of the erase checkbox `<input>` element.
|
||||
* @var bool $uploads_disabled Whether the uploads system has been disabled completely..
|
||||
* @var bool $can_upload Whether the currently active user can upload files.
|
||||
* @var bool $has_local_avatar Whether a local avatar has been uploaded.
|
||||
* @var int $size The width/height of the avatar preview image (in pixels).
|
||||
* @var bool $show_description Whether the field description should be shown.
|
||||
*/
|
||||
|
||||
?>
|
||||
<div class="avatar-privacy-user-avatar-upload">
|
||||
<?php echo \get_avatar( $user_id, $size ); ?>
|
||||
|
||||
<?php if ( $can_upload ) : ?>
|
||||
<p class="avatar-privacy-upload-fields">
|
||||
<?php \wp_nonce_field( $action, $nonce ); ?>
|
||||
<input type="file" id="<?php echo \esc_attr( $upload_field ); ?>" name="<?php echo \esc_attr( $upload_field ); ?>" accept="image/*" />
|
||||
<?php if ( $has_local_avatar ) : ?>
|
||||
<input type="checkbox" id="<?php echo \esc_attr( $erase_field ); ?>" name="<?php echo \esc_attr( $erase_field ); ?>" value="true" />
|
||||
<label for="<?php echo \esc_attr( $erase_field ); ?>"><?php \esc_html_e( 'Delete local avatar picture.', 'avatar-privacy' ); ?></label><br />
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php if ( ! $uploads_disabled && $show_description ) : ?>
|
||||
<p class="description">
|
||||
<?php echo \wp_kses( $template->get_uploader_description( $can_upload, $has_local_avatar ), T::ALLOWED_HTML_LABEL ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
Reference in New Issue
Block a user