<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Tags::HTML::ChangePassword - Tags helper for change password.

SYNOPSIS
     use Tags::HTML::ChangePassword;

     my $obj = Tags::HTML::ChangePassword-&gt;new(%params);
     $obj-&gt;cleanup;
     $obj-&gt;prepare($message_types_hr);
     $obj-&gt;init($messages_ar);
     $obj-&gt;process;
     $obj-&gt;process_css;

METHODS
  "new"
     my $obj = Tags::HTML::ChangePassword-&gt;new(%params);

    Constructor.

    *       "css"

            'CSS::Struct::Output' object for process_css processing.

            Default value is undef.

    *       "css_change_password"

            CSS class for form.

            Default value is 'form-change-password'.

    *       "form_method"

            Form method.

            Possible values are 'post' and 'get'.

            Default value is 'post'.

    *       "lang"

            Language in ISO 639-3 code.

            Default value is 'eng'.

    *       "tags"

            'Tags::Output' object.

            Default value is undef.

    *       "text"

            Hash reference with keys defined language in ISO 639-3 code and
            value with hash reference with texts.

            Required keys are 'login', 'password_label', 'username_label'
            and 'submit'.

            Default value is:

             {
                    'eng' =&gt; {
                            'change_password' =&gt; 'Change password',
                            'old_password_label' =&gt; 'Old password',
                            'password1_label' =&gt; 'New password',
                            'password2_label' =&gt; 'Confirm new password',
                            'submit' =&gt; 'Save Changes',
                    },
             }

    Returns instance of object.

  "cleanup"
     $obj-&gt;cleanup;

    Process cleanup after page run.

    Returns undef.

  "init"
     $obj-&gt;init($messages_ar);

    Initialize object. Variable $message_ar is reference to array with
    Data::Message::Simple instances.

    Returns undef.

  "prepare"
     $obj-&gt;prepare($message_types_hr);

    Prepare object. Variable $message_types_hr is reference to hash with
    message type keys and CSS color as value. Message types are defined in
    Data::Message::Simple.

    Returns undef.

  "process"
     $obj-&gt;process;

    Process Tags structure for register form.

    Returns undef.

  "process_css"
     $obj-&gt;process_css;

    Process CSS::Struct structure for register form.

    Returns undef.

ERRORS
     new():
             From Class::Utils::set_params():
                     Unknown parameter '%s'.
             From Tags::HTML::new():
                     Parameter 'css' must be a 'CSS::Struct::Output::*' class.
                     Parameter 'tags' must be a 'Tags::Output::*' class.

     init():
             No messages to init.

     prepare():
             No message types to init.

     process():
             From Tags::HTML::process():
                     Parameter 'tags' isn't defined.
             Bad message data object.
             Text for lang '%s' and key '%s' doesn't exist.

     process_css():
             From Tags::HTML::process_css():
                     Parameter 'css' isn't defined.
             Message types must be a hash reference.

EXAMPLE1
     use strict;
     use warnings;

     use CSS::Struct::Output::Indent;
     use Tags::HTML::ChangePassword;
     use Tags::Output::Indent;

     # Object.
     my $css = CSS::Struct::Output::Indent-&gt;new;
     my $tags = Tags::Output::Indent-&gt;new;
     my $obj = Tags::HTML::ChangePassword-&gt;new(
             'css' =&gt; $css,
             'tags' =&gt; $tags,
     );

     # Process login button.
     $obj-&gt;process_css;
     $obj-&gt;process;

     # Print out.
     print "CSS\n";
     print $css-&gt;flush."\n\n";
     print "HTML\n";
     print $tags-&gt;flush."\n";

     # Output:
     # CSS
     # .form-change-password {
     #      width: 300px;
     #      background-color: #f2f2f2;
     #      padding: 20px;
     #      border-radius: 5px;
     #      box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
     # }
     # .form-change-password fieldset {
     #      border: none;
     #      padding: 0;
     #      margin-bottom: 20px;
     # }
     # .form-change-password legend {
     #      font-weight: bold;
     #      margin-bottom: 10px;
     # }
     # .form-change-password p {
     #      margin: 0;
     #      padding: 10px 0;
     # }
     # .form-change-password label {
     #      display: block;
     #      font-weight: bold;
     #      margin-bottom: 5px;
     # }
     # .form-change-password input[type="text"], .form-change-password input[type="password"] {
     #      width: 100%;
     #      padding: 8px;
     #      border: 1px solid #ccc;
     #      border-radius: 3px;
     # }
     # .form-change-password button[type="submit"] {
     #      width: 100%;
     #      padding: 10px;
     #      background-color: #4CAF50;
     #      color: #fff;
     #      border: none;
     #      border-radius: 3px;
     #      cursor: pointer;
     # }
     # .form-change-password button[type="submit"]:hover {
     #      background-color: #45a049;
     # }
     # .form-change-password .messages {
     #      text-align: center;
     # }
     # 
     # HTML
     # &lt;form class="form-change-password" method="post"&gt;
     #   &lt;fieldset&gt;
     #     &lt;legend&gt;
     #       Change password
     #     &lt;/legend&gt;
     #     &lt;p&gt;
     #       &lt;label for="old_password"&gt;
     #       &lt;/label&gt;
     #       Old password
     #       &lt;input type="password" name="old_password" id="old_password" autofocus=
     #         "autofocus"&gt;
     #       &lt;/input&gt;
     #     &lt;/p&gt;
     #     &lt;p&gt;
     #       &lt;label for="password1"&gt;
     #         New password
     #       &lt;/label&gt;
     #       &lt;input type="password" name="password1" id="password1"&gt;
     #       &lt;/input&gt;
     #     &lt;/p&gt;
     #     &lt;p&gt;
     #       &lt;label for="password2"&gt;
     #         Confirm new password
     #       &lt;/label&gt;
     #       &lt;input type="password" name="password2" id="password2"&gt;
     #       &lt;/input&gt;
     #     &lt;/p&gt;
     #     &lt;p&gt;
     #       &lt;button type="submit" name="change_password" value="change_password"&gt;
     #         Save Changes
     #       &lt;/button&gt;
     #     &lt;/p&gt;
     #   &lt;/fieldset&gt;
     # &lt;/form&gt;

EXAMPLE2
     use strict;
     use warnings;
 
     use CSS::Struct::Output::Indent;
     use Plack::App::Tags::HTML;
     use Plack::Runner;
     use Tags::HTML::ChangePassword;
     use Tags::Output::Indent;
     use Unicode::UTF8 qw(decode_utf8);
 
     my $css = CSS::Struct::Output::Indent-&gt;new;
     my $tags = Tags::Output::Indent-&gt;new(
             'xml' =&gt; 1,
             'preserved' =&gt; ['style'],
     );
     my $register = Tags::HTML::ChangePassword-&gt;new(
             'css' =&gt; $css,
             'tags' =&gt; $tags,
     );
     $register-&gt;process_css;
     my $app = Plack::App::Tags::HTML-&gt;new(
             'component' =&gt; 'Tags::HTML::Container',
             'data' =&gt; [sub {
                     my $self = shift;
                     $register-&gt;process;
                     return;
             }],
             'css' =&gt; $css,
             'tags' =&gt; $tags,
     )-&gt;to_app;
     Plack::Runner-&gt;new-&gt;run($app);

     # Output screenshot is in images/ directory.

DEPENDENCIES
    Class::Utils, Error::Pure, List::Util, Readonly, Tags::HTML,
    Tags::HTML::Messages.

SEE ALSO
    Tags::HTML::Login::Access
        Tags helper for login access.

    Tags::HTML::Login::Button
        Tags helper for login button.

    Tags::HTML::Login::Register
        Tags helper for login register.

REPOSITORY
    &lt;https://github.com/michal-josef-spacek/Tags-HTML-ChangePassword&gt;

AUTHOR
    Michal Josef Å&nbsp;paÄek &lt;mailto:skim@cpan.org&gt;

    &lt;http://skim.cz&gt;

LICENSE AND COPYRIGHT
    Â© 2024 Michal Josef Å&nbsp;paÄek

    BSD 2-Clause License

VERSION
    0.03

</pre></body></html>