You are here

function media_variable_default in D7 Media 7

The default variables within the Media namespace.

Parameters

string $name: Optional variable name to retrieve the default. Note that it has not yet been pre-pended with the MEDIA_VARIABLE_NAMESPACE namespace at this time. @return unknown The default value of this variable, if it's been set, or NULL, unless $name is NULL, in which case we return an array of all default values.

@see media_variable_get() @see media_variable_set() @see media_variable_del()

3 calls to media_variable_default()
media_uninstall in ./media.install
Implements hook_uninstall().
media_update_7003 in ./media.install
We now prefix media namespaced variables with media__, so fix old variables.
media_variable_get in includes/media.variables.inc
Wrapper for variable_get() that uses the Media variable registry.

File

includes/media.variables.inc, line 112
Contains the variables used by media and their defaults.

Code

function media_variable_default($name = NULL) {
  static $defaults;
  if (!isset($defaults)) {
    $defaults = array(
      'wysiwyg_title' => t('Media browser'),
      'wysiwyg_icon_title' => t('Add media'),
      //@todo: We should do this per type actually.  For "other" it should be a link.
      'wysiwyg_default_view_mode' => 'media_large',
      // Types which can be selected when embedding media vs wysiwyg.
      'wysiwyg_allowed_types' => array(
        'audio',
        'image',
        'video',
      ),
      // Attributes which can be modified via the wysiwyg and persist.
      'wysiwyg_allowed_attributes' => array(
        'height',
        'width',
        'hspace',
        'vspace',
        'border',
        'align',
        'style',
        'alt',
        'title',
        'class',
        'id',
      ),
      'field_select_media_text' => t('Select media'),
      'field_remove_media_text' => t('Remove media'),
      // Name of the theme to use in media popup dialogs, defaults to admin_theme
      'dialog_theme' => '',
      // @TODO: Make a configuration form with this.
      'file_extensions' => 'jpg jpeg gif png txt doc docx xls xlsx pdf ppt pptx pps ppsx odt ods odp mp3 mov m4v mp4 mpeg avi ogg oga ogv wmv ico',
      'max_filesize' => '',
      'debug' => FALSE,
      'file_list_size' => 10,
      // Used in media.xml.inc: how long to cache retrieved remote data.
      'xml_cache_expire' => 3600,
      // Browser defaults in media.browser.inc.
      'browser_viewtype_default' => 'thumbnails',
      'browser_pager_limit' => 40,
      'import_batch_size' => 20,
      'fromurl_supported_schemes' => array(
        'http',
        'https',
        'ftp',
        'smb',
        'ftps',
      ),
      'type_icon_directory' => drupal_get_path('module', 'media') . '/images/types',
      'icon_base_directory' => drupal_get_path('module', 'media') . '/images/icons',
      'icon_set' => 'default',
      // This is set in media_enable().  It will show a persistant dsm on every page
      // until the user runs the batch operation provided by media_admin_rebuild_types_form().
      'show_file_type_rebuild_nag' => FALSE,
      // Deprecated variables no longer in use, but should still be uninstalled.
      'browser_library_empty_message' => NULL,
    );
  }
  if (!isset($name)) {
    return $defaults;
  }
  if (isset($defaults[$name])) {
    return $defaults[$name];
  }
}