Recent Topics

Plugin Support for Form Input type Attribute 'number'

Started by on Nov 24, 2017 – Contents updated: Dec 08, 2017

Nov 24, 2017 08:12    

in inc/plugins/_plugin.funcs.php

See screenshot in next below:

		case 'float':
		case 'integer':
		case 'text':
			// Default: "text input"
			if( isset($parmeta['size']) )
			{
				$size = (int)$parmeta['size'];
			}
			else
			{ // Default size:
				$size = 15;
			}
			if( isset($parmeta['maxlength']) )
			{
				$params['maxlength'] = (int)$parmeta['maxlength'];
			}
			else
			{ // do not use size as maxlength, if not given!
				$params['maxlength'] = '';
			}

			if( isset( $parmeta['hide_label'] ) )
			{ // This param is used to hide a label
				$params['hide_label'] = $parmeta['hide_label'];
			}

			$Form->text_input( $input_name, $set_value, $size, $set_label, '', $params ); // TEMP: Note already in params
			break;

after

case 'number':
		case 'float':
		case 'integer':
		case 'text':
			// Default: "text input"
			if( isset($parmeta['size']) )
			{
				$size = (int)$parmeta['size'];
			}
			else
			{ // Default size:
				$size = 15;
			}
			if( isset($parmeta['maxlength']) )
			{
				$params['maxlength'] = (int)$parmeta['maxlength'];
			}
			else
			{ // do not use size as maxlength, if not given!
				$params['maxlength'] = '';
			}

			if( isset( $parmeta['hide_label'] ) )
			{ // This param is used to hide a label
				$params['hide_label'] = $parmeta['hide_label'];
			}
			
			if( $parmeta['type'] == 'number' ){ $params['type'] = 'number';}

			$Form->text_input( $input_name, $set_value, $size, $set_label, '', $params ); // TEMP: Note already in params
			break;

https://github.com/midnight-studios/b2evolution/pull/3/files#diff-6a349809c4639c2880536ebbd9cfe12d

Nov 29, 2017 03:26

will check. You know you can attach images directly to new posts now?

Nov 29, 2017 06:56

I really don't see how one can add directly to the post. Am i missing something?

Nov 30, 2017 01:23

Humpf! The permissions were wrong! :/ How about now? ;)

Something else: if you submit pull requests in addition to forum posts, you double the followup/sorting work for us. In that case can you please post cross links between forum post <-> pull request?

Thanks.

Nov 30, 2017 07:37

I apologize @fplanque, the last thing I want is to make things more difficult for you. I will do so. Thanks.

Nov 30, 2017 07:40

Awesome, that is very cool.

This post has 1 feedback awaiting moderation...


Form is loading...

powered by b2evolution free blog software – This forum is powered by b2evolution CMS, a complete engine for your website.