| @@ -5,24 +5,39 @@ | ||
| 5 | 5 | |
| 6 | 6 | if ( class_exists( '\Elementor\Widget_Base' ) ) { |
| 7 | 7 | class FrmElementorWidget extends \Elementor\Widget_Base { |
| 8 | 8 | |
| 9 | + /** | |
| 10 | + * @return string | |
| 11 | + */ | |
| 9 | 12 | public function get_name() { |
| 10 | 13 | return 'formidable'; |
| 11 | 14 | } |
| 12 | 15 | |
| 16 | + /** | |
| 17 | + * @return string | |
| 18 | + */ | |
| 13 | 19 | public function get_title() { |
| 14 | 20 | return FrmAppHelper::get_menu_name() . ' ' . __( 'Forms', 'formidable' ); |
| 15 | 21 | } |
| 16 | 22 | |
| 23 | + /** | |
| 24 | + * @return string | |
| 25 | + */ | |
| 17 | 26 | public function get_icon() { |
| 18 | 27 | return FrmAppHelper::get_menu_icon_class(); |
| 19 | 28 | } |
| 20 | 29 | |
| 30 | + /** | |
| 31 | + * @return array | |
| 32 | + */ | |
| 21 | 33 | public function get_categories() { |
| 22 | 34 | return array( 'general' ); |
| 23 | 35 | } |
| 24 | 36 | |
| 37 | + /** | |
| 38 | + * @return void | |
| 39 | + */ | |
| 25 | 40 | protected function register_controls() { |
| 26 | 41 | $this->start_controls_section( |
| 27 | 42 | 'section_form_dropdown', |
| 28 | 43 | array( |
| @@ -56,8 +71,14 @@ | ||
| 56 | 71 | |
| 57 | 72 | $this->end_controls_section(); |
| 58 | 73 | } |
| 59 | 74 | |
| 75 | + /** | |
| 76 | + * @param string $key | |
| 77 | + * @param string $title | |
| 78 | + * | |
| 79 | + * @return void | |
| 80 | + */ | |
| 60 | 81 | private function add_basic_switcher_control( $key, $title ) { |
| 61 | 82 | $this->add_control( |
| 62 | 83 | $key, |
| 63 | 84 | array( |
| @@ -66,8 +87,11 @@ | ||
| 66 | 87 | ) |
| 67 | 88 | ); |
| 68 | 89 | } |
| 69 | 90 | |
| 91 | + /** | |
| 92 | + * @return array | |
| 93 | + */ | |
| 70 | 94 | private function get_form_options() { |
| 71 | 95 | $query = array(); |
| 72 | 96 | $where = apply_filters( 'frm_forms_dropdown', $query, 'form' ); |
| 73 | 97 | $forms = FrmForm::get_published_forms( $where, 999, 'exclude' ); |
| @@ -80,8 +104,11 @@ | ||
| 80 | 104 | |
| 81 | 105 | return $options; |
| 82 | 106 | } |
| 83 | 107 | |
| 108 | + /** | |
| 109 | + * @return void | |
| 110 | + */ | |
| 84 | 111 | protected function render() { |
| 85 | 112 | $settings = $this->get_settings_for_display(); |
| 86 | 113 | $form_id = isset( $settings['form_id'] ) ? absint( $settings['form_id'] ) : 0; |
| 87 | 114 | $title = isset( $settings['title'] ) && 'yes' === $settings['title']; |