Advertisement
mejpark

Drupal 6 view to display hidden icon field

May 4th, 2011
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.85 KB | None | 0 0
  1. $view = new view;
  2. $view->name = 'icon';
  3. $view->description = 'Display icon on pages';
  4. $view->tag = '';
  5. $view->view_php = '';
  6. $view->base_table = 'node';
  7. $view->is_cacheable = FALSE;
  8. $view->api_version = 2;
  9. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  10. $handler = $view->new_display('default', 'Defaults', 'default');
  11. $handler->override_option('relationships', array(
  12.   'nid' => array(
  13.     'label' => 'Image file',
  14.     'required' => 0,
  15.     'image_size' => array(
  16.       'thumbnail' => 'thumbnail',
  17.     ),
  18.     'id' => 'nid',
  19.     'table' => 'image_node',
  20.     'field' => 'nid',
  21.     'relationship' => 'none',
  22.   ),
  23. ));
  24. $handler->override_option('fields', array(
  25.   'field_course_icon_fid' => array(
  26.     'label' => 'Course icon',
  27.     'alter' => array(
  28.       'alter_text' => 0,
  29.       'text' => '',
  30.       'make_link' => 0,
  31.       'path' => '',
  32.       'link_class' => '',
  33.       'alt' => '',
  34.       'prefix' => '',
  35.       'suffix' => '',
  36.       'target' => '',
  37.       'help' => '',
  38.       'trim' => 0,
  39.       'max_length' => '',
  40.       'word_boundary' => 1,
  41.       'ellipsis' => 1,
  42.       'html' => 0,
  43.       'strip_tags' => 0,
  44.     ),
  45.     'empty' => '',
  46.     'hide_empty' => 0,
  47.     'empty_zero' => 0,
  48.     'link_to_node' => 0,
  49.     'label_type' => 'widget',
  50.     'format' => 'default',
  51.     'multiple' => array(
  52.       'group' => TRUE,
  53.       'multiple_number' => '',
  54.       'multiple_from' => '',
  55.       'multiple_reversed' => FALSE,
  56.     ),
  57.     'exclude' => 0,
  58.     'id' => 'field_course_icon_fid',
  59.     'table' => 'node_data_field_course_icon',
  60.     'field' => 'field_course_icon_fid',
  61.     'relationship' => 'none',
  62.   ),
  63. ));
  64. $handler->override_option('arguments', array(
  65.   'field_course_icon_fid' => array(
  66.     'default_action' => 'ignore',
  67.     'style_plugin' => 'default_summary',
  68.     'style_options' => array(),
  69.     'wildcard' => 'all',
  70.     'wildcard_substitution' => 'All',
  71.     'title' => '',
  72.     'breadcrumb' => '',
  73.     'default_argument_type' => 'fixed',
  74.     'default_argument' => '',
  75.     'validate_type' => 'none',
  76.     'validate_fail' => 'not found',
  77.     'break_phrase' => 0,
  78.     'not' => 0,
  79.     'id' => 'field_course_icon_fid',
  80.     'table' => 'node_data_field_course_icon',
  81.     'field' => 'field_course_icon_fid',
  82.     'validate_user_argument_type' => 'uid',
  83.     'validate_user_roles' => array(
  84.       '2' => 0,
  85.     ),
  86.     'relationship' => 'none',
  87.     'default_options_div_prefix' => '',
  88.     'default_argument_fixed' => '',
  89.     'default_argument_user' => 0,
  90.     'default_argument_image_size' => '_original',
  91.     'default_argument_php' => '',
  92.     'validate_argument_node_type' => array(
  93.       'poll' => 0,
  94.       'image' => 0,
  95.       'book' => 0,
  96.       'demo_featured' => 0,
  97.       'event' => 0,
  98.       'full_time_course' => 0,
  99.       'job' => 0,
  100.       'news' => 0,
  101.       'page' => 0,
  102.       'webform' => 0,
  103.     ),
  104.     'validate_argument_node_access' => 0,
  105.     'validate_argument_nid_type' => 'nid',
  106.     'validate_argument_vocabulary' => array(
  107.       '1' => 0,
  108.       '2' => 0,
  109.     ),
  110.     'validate_argument_type' => 'tid',
  111.     'validate_argument_transform' => 0,
  112.     'validate_user_restrict_roles' => 0,
  113.     'image_size' => array(
  114.       '_original' => '_original',
  115.       'thumbnail' => 'thumbnail',
  116.       'preview' => 'preview',
  117.     ),
  118.     'validate_argument_php' => '',
  119.   ),
  120. ));
  121. $handler->override_option('access', array(
  122.   'type' => 'none',
  123. ));
  124. $handler->override_option('cache', array(
  125.   'type' => 'none',
  126. ));
  127. $handler->override_option('items_per_page', 1);
  128. $handler->override_option('row_options', array(
  129.   'inline' => array(),
  130.   'separator' => '',
  131.   'hide_empty' => 0,
  132. ));
  133. $handler = $view->new_display('block', 'Block', 'block_1');
  134. $handler->override_option('fields', array(
  135.   'field_course_icon_fid' => array(
  136.     'label' => 'Course icon',
  137.     'alter' => array(
  138.       'alter_text' => 0,
  139.       'text' => '',
  140.       'make_link' => 0,
  141.       'path' => '',
  142.       'link_class' => '',
  143.       'alt' => '',
  144.       'prefix' => '',
  145.       'suffix' => '',
  146.       'target' => '',
  147.       'help' => '',
  148.       'trim' => 0,
  149.       'max_length' => '',
  150.       'word_boundary' => 1,
  151.       'ellipsis' => 1,
  152.       'html' => 0,
  153.       'strip_tags' => 0,
  154.     ),
  155.     'empty' => '',
  156.     'hide_empty' => 0,
  157.     'empty_zero' => 0,
  158.     'link_to_node' => 0,
  159.     'label_type' => 'widget',
  160.     'format' => 'default',
  161.     'multiple' => array(
  162.       'group' => TRUE,
  163.       'multiple_number' => '',
  164.       'multiple_from' => '',
  165.       'multiple_reversed' => FALSE,
  166.     ),
  167.     'exclude' => 0,
  168.     'id' => 'field_course_icon_fid',
  169.     'table' => 'node_data_field_course_icon',
  170.     'field' => 'field_course_icon_fid',
  171.     'override' => array(
  172.       'button' => 'Use default',
  173.     ),
  174.     'relationship' => 'none',
  175.   ),
  176. ));
  177. $handler->override_option('block_description', '');
  178. $handler->override_option('block_caching', -1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement