1 filter.install filter_update_1002()

Import the image_library view.

Related topics

File

core/modules/filter/filter.install, line 91
Install, update, and uninstall functions for the Filter module.

Code

function filter_update_1002() {
  $view_config = array(
    'name' => 'image_library',
    'description' => 'Displays recently uploaded images for selection when creating content.',
    'tag' => 'default',
    'storage' => 4,
    'disabled' => FALSE,
    'base_table' => 'file_managed',
    'human_name' => 'Image Library',
    'core' => '1.7',
    'display' => array(
      'default' => array(
        'display_title' => 'Master',
        'display_plugin' => 'default',
        'display_options' => array(
          'query' => array(
            'type' => 'views_query',
            'options' => array(),
          ),
          'access' => array(
            'type' => 'perm',
          ),
          'cache' => array(
            'type' => 'none',
          ),
          'exposed_form' => array(
            'type' => 'basic',
          ),
          'pager' => array(
            'type' => 'mini',
            'options' => array(
              'items_per_page' => '20',
              'offset' => '0',
              'id' => '0',
              'total_pages' => '',
              'tags' => array(
                'previous' => '‹ previous',
                'next' => 'next ›',
              ),
              'expose' => array(
                'items_per_page' => 0,
                'items_per_page_label' => 'Items per page',
                'items_per_page_options' => '5, 10, 20, 40, 60',
                'items_per_page_options_all' => 0,
                'items_per_page_options_all_label' => '- All -',
                'offset' => 0,
                'offset_label' => 'Offset',
              ),
            ),
          ),
          'style_plugin' => 'default',
          'row_plugin' => 'fields',
          'fields' => array(
            'uri' => array(
              'id' => 'uri',
              'table' => 'file_managed',
              'field' => 'uri',
              'relationship' => 'none',
              'group_type' => 'group',
              'ui_name' => 'File: Path (thumbnail)',
              'label' => '',
              'exclude' => 1,
              'alter' => array(
                'alter_text' => 0,
                'text' => '',
                'make_link' => 0,
                'path' => '',
                'absolute' => 0,
                'external' => 0,
                'replace_spaces' => 0,
                'path_case' => 'none',
                'trim_whitespace' => 0,
                'alt' => '',
                'rel' => '',
                'link_class' => '',
                'prefix' => '',
                'suffix' => '',
                'target' => '',
                'nl2br' => 0,
                'max_length' => '',
                'word_boundary' => 1,
                'ellipsis' => 1,
                'more_link' => 0,
                'more_link_text' => '',
                'more_link_path' => '',
                'strip_tags' => 0,
                'trim' => 0,
                'preserve_tags' => '',
                'html' => 0,
              ),
              'element_type' => '',
              'element_class' => '',
              'element_label_type' => '',
              'element_label_class' => '',
              'element_label_colon' => FALSE,
              'element_wrapper_type' => '',
              'element_wrapper_class' => '',
              'element_default_classes' => 1,
              'empty' => '',
              'hide_empty' => 0,
              'empty_zero' => 0,
              'hide_alter_empty' => 1,
              'link_to_file' => 0,
              'file_download_path' => 1,
              'image_style' => 'thumbnail',
            ),
            'uri_1' => array(
              'id' => 'uri_1',
              'table' => 'file_managed',
              'field' => 'uri',
              'relationship' => 'none',
              'group_type' => 'group',
              'ui_name' => 'File: Path (full)',
              'label' => '',
              'exclude' => 1,
              'alter' => array(
                'alter_text' => 0,
                'text' => '',
                'make_link' => 0,
                'path' => '',
                'absolute' => 0,
                'external' => 0,
                'replace_spaces' => 0,
                'path_case' => 'none',
                'trim_whitespace' => 0,
                'alt' => '',
                'rel' => '',
                'link_class' => '',
                'prefix' => '',
                'suffix' => '',
                'target' => '',
                'nl2br' => 0,
                'max_length' => '',
                'word_boundary' => 1,
                'ellipsis' => 1,
                'more_link' => 0,
                'more_link_text' => '',
                'more_link_path' => '',
                'strip_tags' => 0,
                'trim' => 0,
                'preserve_tags' => '',
                'html' => 0,
              ),
              'element_type' => '',
              'element_class' => '',
              'element_label_type' => '',
              'element_label_class' => '',
              'element_label_colon' => FALSE,
              'element_wrapper_type' => '',
              'element_wrapper_class' => '',
              'element_default_classes' => 1,
              'empty' => '',
              'hide_empty' => 0,
              'empty_zero' => 0,
              'hide_alter_empty' => 1,
              'link_to_file' => 0,
              'file_download_path' => 1,
              'image_style' => '',
            ),
            'fid' => array(
              'id' => 'fid',
              'table' => 'file_managed',
              'field' => 'fid',
              'relationship' => 'none',
              'group_type' => 'group',
              'ui_name' => '',
              'label' => '',
              'exclude' => 0,
              'alter' => array(
                'alter_text' => 1,
                'text' => '<img class="image-library-image" src="[uri]" data-file-url="[uri_1]" data-fid="[fid]" />',
                'make_link' => 0,
                'path' => '',
                'absolute' => 0,
                'external' => 0,
                'replace_spaces' => 0,
                'path_case' => 'none',
                'trim_whitespace' => 0,
                'alt' => '',
                'rel' => '',
                'link_class' => '',
                'prefix' => '',
                'suffix' => '',
                'target' => '',
                'nl2br' => 0,
                'max_length' => '',
                'word_boundary' => 1,
                'ellipsis' => 1,
                'more_link' => 0,
                'more_link_text' => '',
                'more_link_path' => '',
                'strip_tags' => 0,
                'trim' => 0,
                'preserve_tags' => '',
                'html' => 0,
              ),
              'element_type' => '0',
              'element_class' => '',
              'element_label_type' => '',
              'element_label_class' => '',
              'element_label_colon' => FALSE,
              'element_wrapper_type' => '0',
              'element_wrapper_class' => '',
              'element_default_classes' => 0,
              'empty' => '',
              'hide_empty' => 0,
              'empty_zero' => 0,
              'hide_alter_empty' => 1,
              'link_to_file' => 0,
            ),
            'filename' => array(
              'id' => 'filename',
              'table' => 'file_managed',
              'field' => 'filename',
              'relationship' => 'none',
              'group_type' => 'group',
              'ui_name' => '',
              'label' => '',
              'exclude' => 0,
              'alter' => array(
                'alter_text' => 0,
                'text' => '',
                'make_link' => 0,
                'path' => '',
                'absolute' => 0,
                'external' => 0,
                'replace_spaces' => 0,
                'path_case' => 'none',
                'trim_whitespace' => 0,
                'alt' => '',
                'rel' => '',
                'link_class' => '',
                'prefix' => '',
                'suffix' => '',
                'target' => '',
                'nl2br' => 0,
                'max_length' => '',
                'word_boundary' => 0,
                'ellipsis' => 0,
                'more_link' => 0,
                'more_link_text' => '',
                'more_link_path' => '',
                'strip_tags' => 0,
                'trim' => 0,
                'preserve_tags' => '',
                'html' => 0,
              ),
              'element_type' => 'p',
              'element_class' => 'image-library-filename',
              'element_label_type' => '',
              'element_label_class' => '',
              'element_label_colon' => FALSE,
              'element_wrapper_type' => '',
              'element_wrapper_class' => '',
              'element_default_classes' => 0,
              'empty' => '',
              'hide_empty' => 0,
              'empty_zero' => 0,
              'hide_alter_empty' => 1,
              'link_to_file' => 0,
            ),
          ),
          'filters' => array(
            'filemime' => array(
              'id' => 'filemime',
              'table' => 'file_managed',
              'field' => 'filemime',
              'relationship' => 'none',
              'group_type' => 'group',
              'ui_name' => '',
              'operator' => 'starts',
              'value' => 'image/',
              'group' => '1',
              'exposed' => FALSE,
              'expose' => array(
                'operator_id' => FALSE,
                'label' => '',
                'description' => '',
                'use_operator' => FALSE,
                'operator' => '',
                'identifier' => '',
                'required' => FALSE,
                'remember' => FALSE,
                'multiple' => FALSE,
                'remember_roles' => array(
                  'authenticated' => 'authenticated',
                ),
              ),
              'is_grouped' => FALSE,
              'group_info' => array(
                'label' => '',
                'description' => '',
                'identifier' => '',
                'optional' => TRUE,
                'widget' => 'select',
                'multiple' => FALSE,
                'remember' => 0,
                'default_group' => 'All',
                'default_group_multiple' => array(),
                'group_items' => array(),
              ),
            ),
            'uri' => array(
              'id' => 'uri',
              'table' => 'file_managed',
              'field' => 'uri',
              'relationship' => 'none',
              'group_type' => 'group',
              'ui_name' => '',
              'operator' => 'starts',
              'value' => 'public://',
              'group' => '1',
              'exposed' => FALSE,
              'expose' => array(
                'operator_id' => FALSE,
                'label' => '',
                'description' => '',
                'use_operator' => FALSE,
                'operator' => '',
                'identifier' => '',
                'required' => FALSE,
                'remember' => FALSE,
                'multiple' => FALSE,
                'remember_roles' => array(
                  'authenticated' => 'authenticated',
                ),
              ),
              'is_grouped' => FALSE,
              'group_info' => array(
                'label' => '',
                'description' => '',
                'identifier' => '',
                'optional' => TRUE,
                'widget' => 'select',
                'multiple' => FALSE,
                'remember' => 0,
                'default_group' => 'All',
                'default_group_multiple' => array(),
                'group_items' => array(),
              ),
            ),
          ),
          'sorts' => array(),
          'style_options' => array(
            'grouping' => array(),
            'row_class' => 'image-library-choose-file',
            'default_row_class' => 0,
            'row_class_special' => 0,
          ),
          'use_ajax' => TRUE,
          'header' => array(),
          'row_options' => array(
            'default_field_elements' => 0,
            'inline' => array(),
            'separator' => '',
            'hide_empty' => 0,
          ),
          'empty' => array(
            'area' => array(
              'id' => 'area',
              'table' => 'views',
              'field' => 'area',
              'relationship' => 'none',
              'group_type' => 'group',
              'ui_name' => '',
              'label' => '',
              'empty' => TRUE,
              'content' => "<p>No available images.</p>\r\n",
              'format' => 'filtered_html',
              'tokenize' => 0,
            ),
          ),
        ),
      ),
    ),
  );
  $config = config('views.view.image_library');
  if ($config->isNew()) {
    $config->setData($view_config);
    $config->save();
  }
}