abstract class DevelImageProviderPluginBase in Devel images provider 8
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\devel_image_provider\Plugin\Type\DevelImageProviderPluginBase implements DevelImageProviderPluginInterface
Expanded class hierarchy of DevelImageProviderPluginBase
1 file declares its use of DevelImageProviderPluginBase
- DummyImageProvider.php in lib/
Drupal/ devel_image_provider/ Plugin/ devel_image_provider/ provider/ DummyImageProvider.php - Contains \Drupal\devel_image_provider\Plugin\devel_image_provider\provider\DummyImageProvider.
File
- lib/
Drupal/ devel_image_provider/ Plugin/ Type/ DevelImageProviderPluginBase.php, line 14 - Contains \Drupal\devel_image_provider\DevelImageProviderPluginBase.
Namespace
Drupal\devel_image_provider\Plugin\TypeView source
abstract class DevelImageProviderPluginBase extends PluginBase implements DevelImageProviderPluginInterface {
/**
* The provider url.
*
* @var string
*/
protected $base_url;
/**
* Defined settings for the method.
*
* @var string
*/
protected $settings;
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->settings = variable_get('devel_image_provider_settings_' . $plugin_id, array());
}
public function availableMethods() {
return drupal_map_assoc(array(
'curl',
'gd',
'file_get_contents',
));
}
public function settingsForm() {
$info = $this
->getDefinition();
$form['devel_image_provider_' . $info['id']] = array(
'#type' => 'details',
'#collapsed' => FALSE,
'#title' => t('Provider settings'),
'#states' => array(
'visible' => array(
':input[name="devel_generate_image_function"]' => array(
'value' => 'devel_image_provider_generate',
),
':input[name="available_providers[devel_image_provider_method_selected]"]' => array(
'value' => $info['id'],
),
),
),
);
$methods = $this
->availableMethods();
if (!empty($methods)) {
$form['devel_image_provider_' . $info['id']]['devel_image_provider_get_method'] = array(
'#type' => 'radios',
'#title' => t('Method to get files'),
'#default_value' => isset($this->settings['devel_image_provider_get_method']) ? $this->settings['devel_image_provider_get_method'] : 'file_get_contents',
'#options' => $this
->availableMethods(),
);
}
$form['devel_image_provider_' . $info['id']]['devel_image_provider_gray'] = array(
'#type' => 'checkbox',
'#title' => t('Gray version'),
'#default_value' => isset($this->settings['devel_image_provider_gray']) ? $this->settings['devel_image_provider_gray'] : NULL,
);
return $form;
}
public function settingsFormValidate(&$form, &$form_state) {
}
public function settingsFormSubmit(&$form, &$form_state) {
$info = $this
->getDefinition();
$values = $form_state['values']['config_providers']['devel_image_provider_' . $info['id']];
variable_set('devel_image_provider_settings_' . $info['id'], $values);
}
public function generateImage($object, $field, $instance, $bundle) {
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DevelImageProviderPluginBase:: |
protected | property | The provider url. | |
DevelImageProviderPluginBase:: |
protected | property | Defined settings for the method. | |
DevelImageProviderPluginBase:: |
public | function |
Sets the available methods to get the images from this provider. Overrides DevelImageProviderPluginInterface:: |
|
DevelImageProviderPluginBase:: |
public | function |
Image generation handler. Overrides DevelImageProviderPluginInterface:: |
1 |
DevelImageProviderPluginBase:: |
public | function |
Generates a settings form for this handler. Overrides DevelImageProviderPluginInterface:: |
1 |
DevelImageProviderPluginBase:: |
public | function |
Generates a settings form submit function for this handler. Overrides DevelImageProviderPluginInterface:: |
|
DevelImageProviderPluginBase:: |
public | function |
Generates a settings form validate function for this handler. Overrides DevelImageProviderPluginInterface:: |
|
DevelImageProviderPluginBase:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. |