home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (image_plugin_argument_default_image_size.inc)

This example Drupal source code file (image_plugin_argument_default_image_size.inc) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

argument_form, array, extends, foreach, form, function, key, php, radio:options, sizes, title, type, views_plugin_argument_default

The image_plugin_argument_default_image_size.inc Drupal example source code

<?php
// $Id: image_plugin_argument_default_image_size.inc,v 1.1.2.1 2010/08/03 17:43:00 sun Exp $

/**
 * @file
 * Contains the image size argument default plugin.
 */

/**
 * Default argument plugin to pick an image size.
 */
class image_plugin_argument_default_image_size extends views_plugin_argument_default {
  var $option_name = 'default_argument_image_size';

  function argument_form(&$form, &$form_state) {
    foreach (image_get_sizes() as $key => $size) {
      $sizes[$key] = $size['label'];
    }

    $form[$this->option_name] = array(
      '#type' => 'select',
      '#title' => t('Default argument'),
      '#options' => $sizes,
      '#default_value' => $this->get_argument(),
      '#process' => array('views_process_dependency'),
      '#dependency' => array(
        'radio:options[default_action]' => array('default'),
        'radio:options[default_argument_type]' => array($this->id),
      ),
      '#dependency_count' => 2,
    );
  }
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal image_plugin_argument_default_image_size.inc source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.