You are here

function _itweak_upload_get_insert_widget_settings in iTweak Upload 6.2

2 calls to _itweak_upload_get_insert_widget_settings()
itweak_upload_upload_form_current in ./itweak_upload.module
Implementation of theme_upload_form_current(). Theme the upload form for current attachments.
_itweak_upload_insert_form in ./itweak_upload.admin.inc

File

./itweak_upload.module, line 513
iTweakUpload - Tweak attachments display and file upload forms.

Code

function _itweak_upload_get_insert_widget_settings($node_type) {
  $load_vars = TRUE;
  if ($node_type != 'default') {
    $load_vars = variable_get('itweak_upload_insert_override_default_' . $node_type, 0);
    $widget = _itweak_upload_get_insert_widget_settings('default');

    // recursion (at most once)
  }
  else {
    $widget = array(
      'type' => 'itweak_upload_widget',
      'insert' => 1,
      'insert_styles' => array(
        'auto' => 'auto',
      ),
      'insert_default' => 'auto',
      'insert_class' => 'itu-insert-file',
      'insert_width' => '',
    );
  }
  if ($load_vars) {
    $widget = array(
      'type' => 'itweak_upload_widget',
      'insert' => variable_get('itweak_upload_insert_enable_' . $node_type, $widget['insert']),
      'insert_styles' => array_filter(variable_get('itweak_upload_insert_styles_' . $node_type, $widget['insert_styles'])),
      // array_filter() to bring settings format inline with D6 Form API
      'insert_default' => variable_get('itweak_upload_insert_default_' . $node_type, $widget['insert_default']),
      'insert_class' => variable_get('itweak_upload_insert_class_' . $node_type, $widget['insert_class']),
      'insert_width' => variable_get('itweak_upload_insert_width_' . $node_type, $widget['insert_width']),
    );
  }
  return $widget;
}