You are here

function viewfield_widget_settings in Viewfield 5

Same name and namespace in other branches
  1. 6.2 viewfield.module \viewfield_widget_settings()
  2. 6 viewfield.module \viewfield_widget_settings()

Implementation of hook_widget_settings().

File

./viewfield.module, line 236
Defines a field type for referencing a view from a node

Code

function viewfield_widget_settings($op, $widget) {
  switch ($op) {
    case 'form':
      $form = array();
      $form['force_default'] = array(
        '#type' => 'checkbox',
        '#title' => t('Force default'),
        '#default_value' => $widget['force_default'],
        '#description' => t('If checked, the user will not be able to change anything about the view at all. It will not even be shown on the edit node page. The default value will be used instead.'),
      );
      return $form;
    case 'save':
      return array(
        'force_default',
      );
    case 'callbacks':
      return array(
        'default value' => CONTENT_CALLBACK_CUSTOM,
      );
  }
}