Skip to content

Commit

Permalink
Added configuration option for supported field types.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Ghita committed Jun 22, 2012
1 parent a261b2f commit e01caed
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fields/field.url.php
Expand Up @@ -11,6 +11,15 @@
class FieldURL extends Field
{

/**
* Compatible field types. Only Entry URL atm.
*
* @var array
*/
public $field_types;



/*------------------------------------------------------------------------------------------------*/
/* Definition */
/*------------------------------------------------------------------------------------------------*/
Expand All @@ -20,6 +29,8 @@ public function __construct(){

$this->_name = 'URL';
$this->_required = 'yes';

$this->field_types = array('entry_url');
}

public function createTable(){
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e01caed

Please sign in to comment.