Code Duplication    Length = 21-21 lines in 4 locations

classes/fields/paragraph.php 1 location

@@ 206-226 (lines=21) @@
203
	/**
204
	 * {@inheritdoc}
205
	 */
206
	public function input( $name, $value = null, $options = null, $pod = null, $id = null ) {
207
208
		$options         = (array) $options;
209
		$form_field_type = PodsForm::$field_type;
210
211
		if ( is_array( $value ) ) {
212
			$value = implode( "\n", $value );
213
		}
214
215
		if ( isset( $options['name'] ) && false === PodsForm::permission( static::$type, $options['name'], $options, null, $pod, $id ) ) {
216
			if ( pods_v( 'read_only', $options, false ) ) {
217
				$options['readonly'] = true;
218
			} else {
219
				return;
220
			}
221
		} elseif ( ! pods_has_permissions( $options ) && pods_v( 'read_only', $options, false ) ) {
222
			$options['readonly'] = true;
223
		}
224
225
		pods_view( PODS_DIR . 'ui/fields/textarea.php', compact( array_keys( get_defined_vars() ) ) );
226
	}
227
228
	/**
229
	 * {@inheritdoc}

classes/fields/password.php 1 location

@@ 81-101 (lines=21) @@
78
	/**
79
	 * {@inheritdoc}
80
	 */
81
	public function input( $name, $value = null, $options = null, $pod = null, $id = null ) {
82
83
		$options         = (array) $options;
84
		$form_field_type = PodsForm::$field_type;
85
86
		if ( is_array( $value ) ) {
87
			$value = implode( ' ', $value );
88
		}
89
90
		if ( isset( $options['name'] ) && false === PodsForm::permission( static::$type, $options['name'], $options, null, $pod, $id ) ) {
91
			if ( pods_v( 'read_only', $options, false ) ) {
92
				$options['readonly'] = true;
93
			} else {
94
				return;
95
			}
96
		} elseif ( ! pods_has_permissions( $options ) && pods_v( 'read_only', $options, false ) ) {
97
			$options['readonly'] = true;
98
		}
99
100
		pods_view( PODS_DIR . 'ui/fields/password.php', compact( array_keys( get_defined_vars() ) ) );
101
	}
102
103
	/**
104
	 * {@inheritdoc}

classes/fields/text.php 1 location

@@ 127-147 (lines=21) @@
124
	/**
125
	 * {@inheritdoc}
126
	 */
127
	public function input( $name, $value = null, $options = null, $pod = null, $id = null ) {
128
129
		$options         = (array) $options;
130
		$form_field_type = PodsForm::$field_type;
131
132
		if ( is_array( $value ) ) {
133
			$value = implode( ' ', $value );
134
		}
135
136
		if ( isset( $options['name'] ) && false === PodsForm::permission( static::$type, $options['name'], $options, null, $pod, $id ) ) {
137
			if ( pods_v( 'read_only', $options, false ) ) {
138
				$options['readonly'] = true;
139
			} else {
140
				return;
141
			}
142
		} elseif ( ! pods_has_permissions( $options ) && pods_v( 'read_only', $options, false ) ) {
143
			$options['readonly'] = true;
144
		}
145
146
		pods_view( PODS_DIR . 'ui/fields/text.php', compact( array_keys( get_defined_vars() ) ) );
147
	}
148
149
	/**
150
	 * {@inheritdoc}

classes/fields/oembed.php 1 location

@@ 174-194 (lines=21) @@
171
	/**
172
	 * {@inheritdoc}
173
	 */
174
	public function input( $name, $value = null, $options = null, $pod = null, $id = null ) {
175
176
		$options         = (array) $options;
177
		$form_field_type = PodsForm::$field_type;
178
179
		if ( is_array( $value ) ) {
180
			$value = implode( ' ', $value );
181
		}
182
183
		if ( isset( $options['name'] ) && false === PodsForm::permission( static::$type, $options['name'], $options, null, $pod, $id ) ) {
184
			if ( pods_v( 'read_only', $options, false ) ) {
185
				$options['readonly'] = true;
186
			} else {
187
				return;
188
			}
189
		} elseif ( ! pods_has_permissions( $options ) && pods_v( 'read_only', $options, false ) ) {
190
			$options['readonly'] = true;
191
		}
192
193
		pods_view( PODS_DIR . 'ui/fields/oembed.php', compact( array_keys( get_defined_vars() ) ) );
194
	}
195
196
	/**
197
	 * {@inheritdoc}