EOF;
}
return $resendPwdHtml;
}
function register(Doku_Event_Handler $controller)
{
/**
* To modify the form and add class
*
* Deprecated object passed by the event but still in use
* https://www.dokuwiki.org/devel:event:html_resendpwdform_output
*/
$controller->register_hook('HTML_RESENDPWDFORM_OUTPUT', 'BEFORE', $this, 'handle_resendpwd_html', array());
/**
* Event using the new object not found anywhere
*
* https://www.dokuwiki.org/devel:event:form_resendpwd_output
*/
}
function handle_resendpwd_html(&$event, $param)
{
/**
* The Login page is created via buffer
* We print before the forms
* to avoid a FOUC
*/
$loginCss = Snippet::createCssSnippet(self::CANONICAL);
$content = $loginCss->getContent();
$class = $loginCss->getClass();
$cssHtml = <<
$content
EOF;
print $cssHtml;
/**
* @var Doku_Form $form
*/
$form = &$event->data;
$class = &$form->params["class"];
if (isset($class)) {
$class = $class . " " . self::FORM_RESEND_PWD_CLASS;
} else {
$class = self::FORM_RESEND_PWD_CLASS;
}
$newFormContent = [];
/**
* Header (Logo / Title)
*/
$newFormContent[] = Identity::getHeaderHTML($form, self::FORM_RESEND_PWD_CLASS);
/**
* Form Attributes
*
*/
foreach ($form->_content as $field) {
if (!is_array($field)) {
continue;
}
$fieldName = $field["name"];
if ($fieldName == null) {
// this is not an input field
if ($field["type"] == "submit") {
/**
* This is important to keep the submit element intact
* for forms integration such as captcha
* The search the submit button to insert before it
*/
$classes = "btn btn-primary btn-block";
if (isset($field["class"])) {
$field["class"] = $field["class"] . " " . $classes;
} else {
$field["class"] = $classes;
}
$newFormContent[] = $field;
}
continue;
}
switch ($fieldName) {
case "login":
$loginText = $field["_text"];
$loginValue = $field["value"];
$loginHTML=<<
EOF;
$newFormContent[] = $loginHTML;
break;
default:
LogUtility::msg("The register field name($fieldName) is unknown", LogUtility::LVL_MSG_ERROR, \ComboStrap\Identity::CANONICAL);
}
}
/**
* Register and Login HTML paragraph
*/
$registerHtml = action_plugin_combo_registration::getRegisterLinkAndParagraph();
if (!empty($registerHtml)) {
$newFormContent[] = $registerHtml;
}
$loginLinkToHtmlForm = action_plugin_combo_login::getLoginParagraphWithLinkToFormPage();
if (!empty($loginLinkToHtmlForm)) {
$newFormContent[] = $loginLinkToHtmlForm;
}
/**
* Update
*/
$form->_content = $newFormContent;
return true;
}
}