Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Suport input Select by Event o Function ..? #815

Closed
EOM opened this issue Apr 18, 2017 · 3 comments
Closed

Add Suport input Select by Event o Function ..? #815

EOM opened this issue Apr 18, 2017 · 3 comments
Milestone

Comments

@EOM
Copy link

EOM commented Apr 18, 2017

Hi,
add suport, type input Select in now version..?
https://github.com/croogo/croogo/blob/master/Settings/View/Helper/SettingsFormHelper.php
To be able to generate select for example get list timezone_abbreviations_list() in Setting "Site"

@EOM
Copy link
Author

EOM commented Apr 18, 2017

Example Insert code
SettingsFormHelper
...
input()

} elseif (is_int(array_search('select-function', (array)explode(':', $inputType)[0])) === true) {
		    
		    /* function tzlist(){
		        $l = array();
		        foreach(timezone_abbreviations_list() as $timezone){
                         foreach($timezone as $val){
                                if(isset($val['timezone_id'])){
                                        $l[$val['timezone_id']]=$val['timezone_id'];
                                }
                            }
                        }
		        return $l;
		    }*/
	
            $func = explode(':', $inputType)[0];
            $func = str_ireplace($func.':','',$inputType);
		    if(function_exists($func)){
		        $options = $func();
		    }else{
		        $options=array();
		    }
			$output = $this->Form->input("Setting.$i.value", array(
				'type' => 'select',
				'options' => $options,
				'value' => $setting['Setting']['value'],
				'help' => $setting['Setting']['description'],
				'label' => $label,
			));
		}

@rchavik rchavik added this to the 3.0 milestone Apr 19, 2017
@rchavik
Copy link
Member

rchavik commented Apr 19, 2017

I've been meaning to implement this feature. I'll use your patch as a base for this.

@rchavik
Copy link
Member

rchavik commented Apr 22, 2017

@dakota has already implemented this in the 3.x branch.

@rchavik rchavik removed this from the 3.0 milestone Apr 22, 2017
@rchavik rchavik added this to the 2.3.1 milestone Dec 6, 2017
@rchavik rchavik closed this as completed Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants