| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | - die( 'You are not allowed to call this page directly.' ); | |
| 4 | -} | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * @since 2.04 |
| 8 | 5 | */ |
| @@ -85,13 +82,9 @@ | ||
| 85 | 82 | /** |
| 86 | 83 | * Initialize the form_id property |
| 87 | 84 | * |
| 88 | 85 | * @since 2.04 |
| 89 | - * | |
| 90 | 86 | * @param $form_id |
| 91 | - * @param int|string $form_id | |
| 92 | - * | |
| 93 | - * @return void | |
| 94 | 87 | */ |
| 95 | 88 | protected function init_form_id( $form_id ) { |
| 96 | 89 | $this->form_id = (int) $form_id; |
| 97 | 90 | } |
| @@ -99,10 +92,8 @@ | ||
| 99 | 92 | /** |
| 100 | 93 | * Initialize the fields property |
| 101 | 94 | * |
| 102 | 95 | * @since 2.04 |
| 103 | - * | |
| 104 | - * @return void | |
| 105 | 96 | */ |
| 106 | 97 | protected function init_fields() { |
| 107 | 98 | $this->fields = FrmField::get_all_for_form( $this->form_id, '', 'exclude', 'exclude' ); |
| 108 | 99 | } |
| @@ -112,10 +103,8 @@ | ||
| 112 | 103 | * |
| 113 | 104 | * @since 2.05 |
| 114 | 105 | * |
| 115 | 106 | * @param array $atts |
| 116 | - * | |
| 117 | - * @return void | |
| 118 | 107 | */ |
| 119 | 108 | protected function init_plain_text( $atts ) { |
| 120 | 109 | if ( isset( $atts['plain_text'] ) && $atts['plain_text'] ) { |
| 121 | 110 | $this->is_plain_text = true; |
| @@ -127,10 +116,8 @@ | ||
| 127 | 116 | * |
| 128 | 117 | * @since 2.04 |
| 129 | 118 | * |
| 130 | 119 | * @param array $atts |
| 131 | - * | |
| 132 | - * @return void | |
| 133 | 120 | */ |
| 134 | 121 | protected function init_format( $atts ) { |
| 135 | 122 | if ( isset( $atts['format'] ) && is_string( $atts['format'] ) && $atts['format'] !== '' ) { |
| 136 | 123 | $this->format = $atts['format']; |
| @@ -142,10 +129,8 @@ | ||
| 142 | 129 | /** |
| 143 | 130 | * Initialize the table_generator property |
| 144 | 131 | * |
| 145 | 132 | * @since 2.04 |
| 146 | - * | |
| 147 | - * @return void | |
| 148 | 133 | */ |
| 149 | 134 | protected function init_table_generator() { |
| 150 | 135 | $this->table_generator = new FrmTableHTMLGenerator( 'shortcode' ); |
| 151 | 136 | } |
| @@ -161,9 +146,9 @@ | ||
| 161 | 146 | } |
| 162 | 147 | |
| 163 | 148 | if ( $this->format == 'array' ) { |
| 164 | 149 | $content = $this->get_array(); |
| 165 | - } elseif ( $this->is_plain_text_format() ) { | |
| 150 | + } else if ( $this->is_plain_text_format() ) { | |
| 166 | 151 | $content = $this->get_plain_text(); |
| 167 | 152 | } else { |
| 168 | 153 | $content = $this->get_table(); |
| 169 | 154 | } |
| @@ -174,10 +159,8 @@ | ||
| 174 | 159 | /** |
| 175 | 160 | * Return the default HTML array |
| 176 | 161 | * |
| 177 | 162 | * @since 2.04 |
| 178 | - * | |
| 179 | - * @return array | |
| 180 | 163 | */ |
| 181 | 164 | protected function get_array() { |
| 182 | 165 | foreach ( $this->fields as $field ) { |
| 183 | 166 | $this->add_field_array( $field ); |
| @@ -189,10 +172,8 @@ | ||
| 189 | 172 | /** |
| 190 | 173 | * Return the default plain text for an email message |
| 191 | 174 | * |
| 192 | 175 | * @since 2.04 |
| 193 | - * | |
| 194 | - * @return string | |
| 195 | 176 | */ |
| 196 | 177 | protected function get_plain_text() { |
| 197 | 178 | return $this->generate_content_for_all_fields(); |
| 198 | 179 | } |
| @@ -200,10 +181,8 @@ | ||
| 200 | 181 | /** |
| 201 | 182 | * Return the default HTML for an email message |
| 202 | 183 | * |
| 203 | 184 | * @since 2.04 |
| 204 | - * | |
| 205 | - * @return string | |
| 206 | 185 | */ |
| 207 | 186 | protected function get_table() { |
| 208 | 187 | $content = $this->table_generator->generate_table_header(); |
| 209 | 188 | $content .= $this->generate_content_for_all_fields(); |
| @@ -287,10 +266,8 @@ | ||
| 287 | 266 | * |
| 288 | 267 | * @since 2.04 |
| 289 | 268 | * |
| 290 | 269 | * @param stdClass $field |
| 291 | - * | |
| 292 | - * @return void | |
| 293 | 270 | */ |
| 294 | 271 | protected function add_field_array( $field ) { |
| 295 | 272 | if ( in_array( $field->type, $this->skip_fields ) ) { |
| 296 | 273 | return; |
| @@ -305,10 +282,8 @@ | ||
| 305 | 282 | * @since 2.04 |
| 306 | 283 | * |
| 307 | 284 | * @param stdClass $field |
| 308 | 285 | * @param string $value |
| 309 | - * | |
| 310 | - * @return void | |
| 311 | 286 | */ |
| 312 | 287 | protected function add_single_field_array( $field, $value ) { |
| 313 | 288 | $array = array( |
| 314 | 289 | 'label' => '[' . $field->id . ' show=field_label]', |