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

Drupal example source code file (views_plugin_argument_default_fixed.inc)

This example Drupal source code file (views_plugin_argument_default_fixed.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

array, convert_options, default_value, extends, form, function, isset, options, php, return, title, type, variable, views_plugin_argument_default

The views_plugin_argument_default_fixed.inc Drupal example source code

<?php
// $Id: views_plugin_argument_default_fixed.inc,v 1.1.4.2 2010/01/28 22:45:04 dereine Exp $
/**
 * @file
 * Contains the fixed argument default plugin.
 */

/**
 * The fixed argument default handler.
 */
class views_plugin_argument_default_fixed extends views_plugin_argument_default {
  function option_definition() {
    $options = parent::option_definition();
    $options['argument'] = array('default' => '');

    return $options;
  }

  function options_form(&$form, &$form_state) {
    $form['argument'] = array(
      '#type' => 'textfield',
      '#title' => t('Default argument'),
      '#default_value' => $this->options['argument'],
    );
  }

  /**
   * Return the default argument.
   */
  function get_argument() {
    return $this->options['argument'];
  }

  function convert_options(&$options) {
    if (!isset($options['argument']) && isset($this->argument->options['default_argument_fixed'])) {
      $options['argument'] = $this->argument->options['default_argument_fixed'];
    }
  }
}

/**
 * @}
 */

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal views_plugin_argument_default_fixed.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.