/**
  * Generate a settings form for this handler.
  * Uses the standard Drupal FAPI.
  * The element will be attached to the "data" key.
  *
  * @return
  *   An array containing any custom form elements to be displayed in the
  *   profile editing form.
  */
 function buildSettingsForm()
 {
     // Get the parent settings form.
     $form = parent::buildSettingsForm();
     $form[$this->plugin['name']]['include_unpublished'] = array('#title' => t('Include unpublished nodes'), '#type' => 'checkbox', '#default_value' => isset($this->conf['include_unpublished']) ? $this->conf['include_unpublished'] : 0);
     return $form;
 }
 function __construct($plugin, $profile)
 {
     /**
      * The user entity doesn't add any label in their entity keys as they define a
      * "label callback" instead. Therefor we have to tell which field the user
      * entity have as label.
      */
     $this->entity_field_label = 'name';
     parent::__construct($plugin, $profile);
 }
 /**
  * The autocomplete callback function for the Linkit Taxonomy term plugin.
  */
 function autocomplete_callback()
 {
     // The term entity dont use the entity keys bundle definition, its using the
     // vid instead, so lets 'translate' the bundle names to vids.
     if (isset($this->entity_key_bundle) && isset($this->conf['bundles'])) {
         $bundles = array_filter($this->conf['bundles']);
         // Get all vocabularies.
         $vocabularies = taxonomy_vocabulary_get_names();
         // Temp storage for values.
         $tmp_bundles = array();
         foreach ($bundles as $bundle) {
             $tmp_bundles[] = $vocabularies[$bundle]->{$this->entity_key_bundle};
         }
         // Assign the new values as the bundles.
         $this->conf['bundles'] = $tmp_bundles;
     }
     // Call the parent.
     return parent::autocomplete_callback();
 }
 /**
  * Generate a settings form for this handler.
  * Uses the standard Drupal FAPI.
  * The element will be attached to the "data" key.
  *
  * @return
  *   An array containing any custom form elements to be displayed in the
  *   profile editing form.
  */
 function buildSettingsForm()
 {
     $form = parent::buildSettingsForm();
     $form['entity:file']['show_scheme'] = array('#title' => t('Show file scheme'), '#type' => 'checkbox', '#default_value' => isset($this->conf['show_scheme']) ? $this->conf['show_scheme'] : array());
     $form['entity:file']['group_by_scheme'] = array('#title' => t('Group files by scheme'), '#type' => 'checkbox', '#default_value' => isset($this->conf['group_by_scheme']) ? $this->conf['group_by_scheme'] : array());
     $image_extra_info_options = array('thumbnail' => t('Show thumbnails <em>(using the image style !linkit_thumb_link)</em>', array('!linkit_thumb_link' => l('linkit_thumb', 'admin/config/media/image-styles/edit/linkit_thumb'))), 'dimensions' => t('Show pixel dimensions'));
     $form['entity:file']['image_extra_info'] = array('#title' => t('Images'), '#type' => 'checkboxes', '#options' => $image_extra_info_options, '#default_value' => isset($this->conf['image_extra_info']) ? $this->conf['image_extra_info'] : array('thumbnail', 'dimensions'));
     return $form;
 }