/** * Overrides LinkitSearchPlugin::buildSettingsForm(). */ 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, '#description' => t('In order to see unpublished nodes, the user most also have permissions to do so. ')); return $form; }
/** * Overrides LinkitSearchPluginEntity::buildSettingsForm(). */ 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'] : ''); $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'] : ''); $image_extra_info_options = array('thumbnail' => t('Show thumbnails <em>(using the image style !linkit_thumb_link)</em>', array('!linkit_thumb_link' => l(t('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; }
/** * Overrides LinkitSearchPluginEntity::__construct(). */ function __construct($plugin, $profile) { /** * The user entity doesn't add any label in their entity keys as they define a * "label callback" instead. Therefore we have to tell which field the user * entity have as label. */ $this->entity_field_label = 'name'; parent::__construct($plugin, $profile); }
/** * Overrides LinkitSearchPlugin::buildSettingsForm(). */ function buildSettingsForm() { $form = parent::buildSettingsForm(); // The entity plugin uses the entity name for the #token_types, but terms // is a special case, its name is "Taxonomy_term" and the tokens are defined // (in the taxonomy module) with just "term". // If the token modules is installed. if (isset($form[$this->plugin['name']]['token_help']['help']['#token_types'])) { $form[$this->plugin['name']]['token_help']['help']['#token_types'] = array('term'); } else { // Get supported tokens for the term entity type. $tokens = linkit_extract_tokens('term'); $form[$this->plugin['name']]['result_description']['#description'] = t('Available tokens: %tokens.', array('%tokens' => implode(', ', $tokens))); } return $form; }
/** * Overrides LinkitSearchPluginEntity::buildSettingsForm(). */ 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'] : ''); $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'] : ''); $form['entity:file']['url_type'] = array('#title' => t('URL type'), '#type' => 'radios', '#options' => array(LINKIT_FILE_URL_TYPE_DIRECT => t('Direct file link'), LINKIT_FILE_URL_TYPE_DOWNLOAD => t('Download file link'), LINKIT_FILE_URL_TYPE_ENTITY => t('Entity view page')), '#default_value' => isset($this->conf['url_type']) ? $this->conf['url_type'] : $this->getDefaultUrlType()); // We can only support the download type if we have version 2.x of the file_entity module. if (!(module_exists('file_entity') && function_exists('file_entity_download_uri'))) { unset($form['entity:file']['url_type']['#options'][LINKIT_FILE_URL_TYPE_DOWNLOAD]); } $image_extra_info_options = array('thumbnail' => t('Show thumbnails <em>(using the image style !linkit_thumb_link)</em>', array('!linkit_thumb_link' => l(t('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; }