_settings[ 'type' ][ 'options' ] = array( array( 'label' => __( 'Single', 'ninja-forms' ), 'value' => 'single', ), array( 'label' => __( 'Multiple', 'ninja-forms' ), 'value' => 'multiple', ), ); /* * Add a refresh extra for the groups fieldset. */ $this->_settings[ 'fieldset' ][ 'label' ] = __( 'Lists', 'ninja-forms' ) . ' ' . __( 'refresh', 'ninja-forms' ) . ''; $this->_settings[ 'fieldset' ][ 'deps' ] = array( 'type' => 'multiple' ); /* * Hide the 'type' and 'fieldset' ('groups') settings until they are ready for use. */ $this->_settings[ 'type' ][ 'group' ] = ''; $this->_settings[ 'fieldset' ][ 'group' ] = ''; } protected function addList( $name, $label ) { $this->_settings[ 'fieldset' ][ 'settings' ][] = array( 'name' => $name, 'type' => 'toggle', 'label' => $label, 'width' => 'full', 'value' => '' ); } protected function addLists( array $lists = array() ) { if( empty( $lists ) ) return; foreach( $lists as $name => $label ){ $this->addList( $name, $label ); } } public function get_parent_type(){ return $this->_parent_type; } }