JoomlaPolska / jezyk-J4

Język polski dla Joomla 4
GNU General Public License v2.0
3 stars 5 forks source link

[4.2] user profile dob field #195

Closed joomlapl-bot closed 2 years ago

joomlapl-bot commented 2 years ago

PR w związku ze zmianą oryginału https://github.com/joomla/joomla-cms/pull/38065 Poniżej zmiany w oryginale:

Click to expand the diff! ```diff diff --git a/administrator/language/en-GB/plg_user_profile.ini b/administrator/language/en-GB/plg_user_profile.ini index a2c2a57c1b37..9c752b56d7ad 100644 --- a/administrator/language/en-GB/plg_user_profile.ini +++ b/administrator/language/en-GB/plg_user_profile.ini @@ -12,6 +12,8 @@ PLG_USER_PROFILE_FIELD_ADDRESS1_LABEL="Address 1" PLG_USER_PROFILE_FIELD_ADDRESS2_LABEL="Address 2" PLG_USER_PROFILE_FIELD_CITY_LABEL="City" PLG_USER_PROFILE_FIELD_COUNTRY_LABEL="Country" +PLG_USER_PROFILE_FIELD_DOB_DESCRIPTION="Year-Month-Day, eg 2019-01-27." ; Adapt to the format you entered in the 'DATE_FORMAT_CALENDAR_DATE' +PLG_USER_PROFILE_FIELD_DOB_HINT="YYYY-MM-DD" ; Adapt to the format you entered in the 'DATE_FORMAT_CALENDAR_DATE' PLG_USER_PROFILE_FIELD_DOB_LABEL="Date of Birth" PLG_USER_PROFILE_FIELD_FAVORITE_BOOK_LABEL="Favourite Book" PLG_USER_PROFILE_FIELD_NAME_PROFILE_REQUIRE_USER="User profile fields for profile edit form" @@ -27,5 +29,4 @@ PLG_USER_PROFILE_FILL_FIELD_DESC_SITE="If required, please fill this field." PLG_USER_PROFILE_OPTION_AGREE="Agree" PLG_USER_PROFILE_OPTION_DO_NOT_AGREE="I do not agree" PLG_USER_PROFILE_SLIDER_LABEL="User Profile" -PLG_USER_PROFILE_SPACER_DOB="The date of birth entered should use the format Year-Month-Day, eg 2019-01-27." ; Adapt to the format you entered in the 'DATE_FORMAT_CALENDAR_DATE' PLG_USER_PROFILE_XML_DESCRIPTION="User Profile Plugin" diff --git a/layouts/plugins/user/profile/fields/dob.php b/layouts/plugins/user/profile/fields/dob.php deleted file mode 100644 index 2aa0f0e42994..000000000000 --- a/layouts/plugins/user/profile/fields/dob.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -defined('_JEXEC') or die; - -extract($displayData); - -/** - * Layout variables - * ----------------- - * @var string $text infotext to be displayed - */ - -// Closing the opening .control-group and .control-label div so we can add our info text on own line ?> -
-
- -
diff --git a/plugins/user/profile/forms/profile.xml b/plugins/user/profile/forms/profile.xml index 38a1bfce5c5e..fa6d0a724ecc 100644 --- a/plugins/user/profile/forms/profile.xml +++ b/plugins/user/profile/forms/profile.xml @@ -89,9 +89,10 @@ - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -namespace Joomla\Plugin\User\Profile\Field; - -\defined('JPATH_PLATFORM') or die; - -use Joomla\CMS\Factory; -use Joomla\CMS\Form\Field\CalendarField; -use Joomla\CMS\Language\Text; -use Joomla\CMS\Layout\FileLayout; - -/** - * Provides input for "Date of Birth" field - * - * @package Joomla.Plugin - * @subpackage User.profile - * @since 3.3.7 - */ -class DobField extends CalendarField -{ - /** - * The form field type. - * - * @var string - * @since 3.3.7 - */ - protected $type = 'Dob'; - - /** - * Method to get the field label markup. - * - * @return string The field label markup. - * - * @since 3.3.7 - */ - protected function getLabel() - { - $label = parent::getLabel(); - - // Get the info text from the XML element, defaulting to empty. - $text = $this->element['info'] ? (string) $this->element['info'] : ''; - $text = $this->translateLabel ? Text::_($text) : $text; - - if ($text) - { - $app = Factory::getApplication(); - $view = $app->input->getString('view', ''); - - // Only display the tip when editing profile - if ($view === 'registration' || $view === 'profile' || $app->isClient('administrator')) - { - $layout = new FileLayout('plugins.user.profile.fields.dob'); - $info = $layout->render(array('text' => $text)); - $label = $info . $label; - } - } - - return $label; - } -} ```