abstract class DevelImagesProviderBase

  1. cis7 sites/all/modules/ulmus/devel_image_provider/plugins/devel_image_provider/provider/base.inc DevelImagesProviderBase
  2. cle7 sites/all/modules/ulmus/devel_image_provider/plugins/devel_image_provider/provider/base.inc DevelImagesProviderBase
  3. elmsmedia7 sites/all/modules/ulmus/devel_image_provider/plugins/devel_image_provider/provider/base.inc DevelImagesProviderBase
  4. icor7 sites/all/modules/ulmus/devel_image_provider/plugins/devel_image_provider/provider/base.inc DevelImagesProviderBase
  5. meedjum_blog7 sites/all/modules/ulmus/devel_image_provider/plugins/devel_image_provider/provider/base.inc DevelImagesProviderBase
  6. mooc7 sites/all/modules/ulmus/devel_image_provider/plugins/devel_image_provider/provider/base.inc DevelImagesProviderBase

An abstract implementation of DevelImagesProviderInterface.

Hierarchy

Expanded class hierarchy of DevelImagesProviderBase

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
DevelImagesProviderBase::$provider_base_url protected property The provider url.
DevelImagesProviderBase::$settings protected property Defined settings for the method.
DevelImagesProviderBase::availableMethods public function Sets the available methods to get the images from this provider. Overrides DevelImagesProviderInterface::availableMethods
DevelImagesProviderBase::generateImage public function Image generation handler. Overrides DevelImagesProviderInterface::generateImage
DevelImagesProviderBase::settingsForm public function Generates a settings form for this handler. Overrides DevelImagesProviderInterface::settingsForm
DevelImagesProviderBase::settingsFormSubmit public function Generates a settings form submit function for this handler. Overrides DevelImagesProviderInterface::settingsFormSubmit
DevelImagesProviderBase::settingsFormValidate public function Generates a settings form validate function for this handler. Overrides DevelImagesProviderInterface::settingsFormValidate
DevelImagesProviderBase::__construct public function

File

sites/all/modules/ulmus/devel_image_provider/plugins/devel_image_provider/provider/base.inc, line 41
Base devel image providers plugin class.

View source
abstract class DevelImagesProviderBase implements DevelImagesProviderInterface {

  /**
   * The provider url.
   *
   * @var string
   */
  protected $provider_base_url;

  /**
   * Defined settings for the method.
   *
   * @var string
   */
  protected $settings;

  public function __construct($plugin) {
    $this->plugin = $plugin;
    $this->settings = variable_get('devel_image_provider_settings_' . $this->plugin['name'], array());
  }

  public function availableMethods() {
    return drupal_map_assoc(array('curl', 'gd', 'file_get_contents'));
  }

  public function settingsForm() {
    $form['devel_image_provider_' . $this->plugin['name']] = array(
      '#type' => 'fieldset',
      '#title' => t('Provider settings'),
      '#states' => array(
        'visible' => array(
          ':input[name="available_providers[devel_image_provider_method_selected]"]' => array('value' => $this->plugin['name']),
        ),
      ),
    );

    $methods = $this->availableMethods();
    if (!empty($methods)) {
      $form['devel_image_provider_' . $this->plugin['name']]['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_' . $this->plugin['name']]['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) {
    $values = $form_state['values']['config_providers']['devel_image_provider_' . $this->plugin['name']];
    variable_set('devel_image_provider_settings_' . $this->plugin['name'], $values);
  }

  public function generateImage($object, $field, $instance, $bundle) {
  }

}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.