From e01caedd48d82019939df5fb91138762196e2225 Mon Sep 17 00:00:00 2001 From: Vlad Ghita Date: Fri, 22 Jun 2012 14:15:58 +0300 Subject: [PATCH] Added configuration option for supported field types. --- fields/field.url.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fields/field.url.php b/fields/field.url.php index 1ff5915..cdc3521 100644 --- a/fields/field.url.php +++ b/fields/field.url.php @@ -11,6 +11,15 @@ class FieldURL extends Field { + /** + * Compatible field types. Only Entry URL atm. + * + * @var array + */ + public $field_types; + + + /*------------------------------------------------------------------------------------------------*/ /* Definition */ /*------------------------------------------------------------------------------------------------*/ @@ -20,6 +29,8 @@ public function __construct(){ $this->_name = 'URL'; $this->_required = 'yes'; + + $this->field_types = array('entry_url'); } public function createTable(){ @@ -64,7 +75,7 @@ public function displaySettingsPanel(&$wrapper, $errors = null){ $fields = array(); foreach( $section_fields as $f ){ - if( $f->get('type') === 'entry_url' ){ + if( in_array($f->get('type'), $this->field_types) ){ $fields[] = array( $f->get('id'), is_array($this->get('related_field_id')) ? in_array($f->get('id'), $this->get('related_field_id')) : false,