| @@ 234-251 (lines=18) @@ | ||
| 231 | * |
|
| 232 | * @since 2.0 |
|
| 233 | */ |
|
| 234 | public function input ( $name, $value = null, $options = null, $pod = null, $id = null ) { |
|
| 235 | $options = (array) $options; |
|
| 236 | $form_field_type = PodsForm::$field_type; |
|
| 237 | ||
| 238 | if ( is_array( $value ) ) |
|
| 239 | $value = implode( "\n", $value ); |
|
| 240 | ||
| 241 | if ( isset( $options[ 'name' ] ) && false === PodsForm::permission( self::$type, $options[ 'name' ], $options, null, $pod, $id ) ) { |
|
| 242 | if ( pods_var( 'read_only', $options, false ) ) |
|
| 243 | $options[ 'readonly' ] = true; |
|
| 244 | else |
|
| 245 | return; |
|
| 246 | } |
|
| 247 | elseif ( !pods_has_permissions( $options ) && pods_var( 'read_only', $options, false ) ) |
|
| 248 | $options[ 'readonly' ] = true; |
|
| 249 | ||
| 250 | pods_view( PODS_DIR . 'ui/fields/textarea.php', compact( array_keys( get_defined_vars() ) ) ); |
|
| 251 | } |
|
| 252 | ||
| 253 | /** |
|
| 254 | * Change the value or perform actions after validation but before saving to the DB |
|
| @@ 109-126 (lines=18) @@ | ||
| 106 | * |
|
| 107 | * @since 2.0 |
|
| 108 | */ |
|
| 109 | public function input ( $name, $value = null, $options = null, $pod = null, $id = null ) { |
|
| 110 | $options = (array) $options; |
|
| 111 | $form_field_type = PodsForm::$field_type; |
|
| 112 | ||
| 113 | if ( is_array( $value ) ) |
|
| 114 | $value = implode( ' ', $value ); |
|
| 115 | ||
| 116 | if ( isset( $options[ 'name' ] ) && false === PodsForm::permission( self::$type, $options[ 'name' ], $options, null, $pod, $id ) ) { |
|
| 117 | if ( pods_var( 'read_only', $options, false ) ) |
|
| 118 | $options[ 'readonly' ] = true; |
|
| 119 | else |
|
| 120 | return; |
|
| 121 | } |
|
| 122 | elseif ( !pods_has_permissions( $options ) && pods_var( 'read_only', $options, false ) ) |
|
| 123 | $options[ 'readonly' ] = true; |
|
| 124 | ||
| 125 | pods_view( PODS_DIR . 'ui/fields/password.php', compact( array_keys( get_defined_vars() ) ) ); |
|
| 126 | } |
|
| 127 | ||
| 128 | /** |
|
| 129 | * Validate a value before it's saved |
|
| @@ 161-178 (lines=18) @@ | ||
| 158 | * |
|
| 159 | * @since 2.0 |
|
| 160 | */ |
|
| 161 | public function input ( $name, $value = null, $options = null, $pod = null, $id = null ) { |
|
| 162 | $options = (array) $options; |
|
| 163 | $form_field_type = PodsForm::$field_type; |
|
| 164 | ||
| 165 | if ( is_array( $value ) ) |
|
| 166 | $value = implode( ' ', $value ); |
|
| 167 | ||
| 168 | if ( isset( $options[ 'name' ] ) && false === PodsForm::permission( self::$type, $options[ 'name' ], $options, null, $pod, $id ) ) { |
|
| 169 | if ( pods_var( 'read_only', $options, false ) ) |
|
| 170 | $options[ 'readonly' ] = true; |
|
| 171 | else |
|
| 172 | return; |
|
| 173 | } |
|
| 174 | elseif ( !pods_has_permissions( $options ) && pods_var( 'read_only', $options, false ) ) |
|
| 175 | $options[ 'readonly' ] = true; |
|
| 176 | ||
| 177 | pods_view( PODS_DIR . 'ui/fields/text.php', compact( array_keys( get_defined_vars() ) ) ); |
|
| 178 | } |
|
| 179 | ||
| 180 | /** |
|
| 181 | * Validate a value before it's saved |
|
| @@ 227-244 (lines=18) @@ | ||
| 224 | * |
|
| 225 | * @since 2.0 |
|
| 226 | */ |
|
| 227 | public function input ( $name, $value = null, $options = null, $pod = null, $id = null ) { |
|
| 228 | $options = (array) $options; |
|
| 229 | $form_field_type = PodsForm::$field_type; |
|
| 230 | ||
| 231 | if ( is_array( $value ) ) |
|
| 232 | $value = implode( ' ', $value ); |
|
| 233 | ||
| 234 | if ( isset( $options[ 'name' ] ) && false === PodsForm::permission( self::$type, $options[ 'name' ], $options, null, $pod, $id ) ) { |
|
| 235 | if ( pods_var( 'read_only', $options, false ) ) |
|
| 236 | $options[ 'readonly' ] = true; |
|
| 237 | else |
|
| 238 | return; |
|
| 239 | } |
|
| 240 | elseif ( !pods_has_permissions( $options ) && pods_var( 'read_only', $options, false ) ) |
|
| 241 | $options[ 'readonly' ] = true; |
|
| 242 | ||
| 243 | pods_view( PODS_DIR . 'ui/fields/oembed.php', compact( array_keys( get_defined_vars() ) ) ); |
|
| 244 | } |
|
| 245 | ||
| 246 | /** |
|
| 247 | * Validate a value before it's saved |
|