e107 icon indicating copy to clipboard operation
e107 copied to clipboard

FR - add parameter class to signup shortcode

Open Jimmi08 opened this issue 6 years ago • 4 comments

Only note,

	function sc_signup_form_open()
	{
		return "<form action='".e_SELF."' method='post' id='signupform' autocomplete='off'><div>".e107::getForm()->token()."</div>";
	}

just to save time with styling. PS. I can PR this in future, so this is more reminder if this change is ok.

Jimmi08 avatar Jun 11 '19 10:06 Jimmi08

Next limited part: FPW button

	function sc_fpw_submit($parm=null)
	{
		// return '<button type="submit" name="pwsubmit" class="button btn btn-primary btn-block reset">'.$label.'</button>';
		// return "<input class='button btn btn-primary btn-block' type='submit' name='pwsubmit' value='".$label."' />";	
		$label = deftrue('LAN_FPW_102', LAN_SUBMIT);
		return e107::getForm()->button('pwsubmit', $label); 
	}

it calls, in fact, adminnutton() method, wouldn't be better call it directly? This really looks too overcomplicated for simple submit button.

Jimmi08 avatar Jun 11 '19 11:06 Jimmi08

Don't know what's the change in post 1. Post 2 using the button() function makes sense, so you can make general changes to buttons in 1 place. It would make sense to be able to supply some options via the $parm parameter in my opinion. That would help with styling the button.

SimSync avatar Jun 11 '19 17:06 SimSync

@SimSync post 1 - parameter $class there is only ID. I can manually fix this in style.css but with next update original css, I need to do it again.. it's just saving time

post 2 - you are right. Simple submit button with parameters would be nice (like with other elements). Now it's calling next method and it outputs not needed code.

Jimmi08 avatar Jun 11 '19 17:06 Jimmi08

Workaround for forgotten password button with theme shortcodes:

This is needed: {FPW_SUBMIT: class=btn primary-btn rounded-full} It is not supported

Fix in theme shortcodes:

	function sc_fpw_submit($parm = null)
	{
		$label = deftrue('LAN_FPW_102', LAN_SUBMIT);
 		return e107::getForm()->button('pwsubmit', $label, 'submit', '',  array('class'=>'btn primary-btn rounded-full' ) );
	}

Result:

image

Jimmi08 avatar Jul 29 '22 09:07 Jimmi08