Advertisement
Guest User

Views gallery

a guest
Jul 4th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 13.74 KB | None | 0 0
  1. $view = new view;
  2. $view->name = 'gallery';
  3. $view->description = 'Photos belonging to a selected gallery';
  4. $view->tag = '';
  5. $view->base_table = 'node';
  6. $view->core = 0;
  7. $view->api_version = '2';
  8. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  9. $handler = $view->new_display('default', 'Defaults', 'default');
  10. $handler->override_option('relationships', array(
  11.   'field_gallery_nid' => array(
  12.     'label' => 'Gallery',
  13.     'required' => 1,
  14.     'delta' => -1,
  15.     'id' => 'field_gallery_nid',
  16.     'table' => 'node_data_field_gallery',
  17.     'field' => 'field_gallery_nid',
  18.     'relationship' => 'none',
  19.   ),
  20. ));
  21. $handler->override_option('fields', array(
  22.   'field_gallery_image_fid' => array(
  23.     'label' => '',
  24.     'alter' => array(
  25.       'alter_text' => 0,
  26.       'text' => '',
  27.       'make_link' => 0,
  28.       'path' => '',
  29.       'alt' => '',
  30.       'prefix' => '',
  31.       'suffix' => '',
  32.       'help' => '',
  33.       'trim' => 0,
  34.       'max_length' => '',
  35.       'word_boundary' => 1,
  36.       'ellipsis' => 1,
  37.       'strip_tags' => 0,
  38.       'html' => 0,
  39.     ),
  40.     'link_to_node' => 0,
  41.     'label_type' => 'none',
  42.     'format' => 'imagefield__lightshow2__thumb__original',
  43.     'multiple' => array(
  44.       'group' => TRUE,
  45.       'multiple_number' => '',
  46.       'multiple_from' => '',
  47.       'multiple_reversed' => FALSE,
  48.     ),
  49.     'exclude' => 0,
  50.     'id' => 'field_gallery_image_fid',
  51.     'table' => 'node_data_field_gallery_image',
  52.     'field' => 'field_gallery_image_fid',
  53.     'relationship' => 'none',
  54.   ),
  55. ));
  56. $handler->override_option('sorts', array(
  57.   'created' => array(
  58.     'order' => 'DESC',
  59.     'granularity' => 'second',
  60.     'id' => 'created',
  61.     'table' => 'node',
  62.     'field' => 'created',
  63.     'relationship' => 'none',
  64.   ),
  65. ));
  66. $handler->override_option('arguments', array(
  67.   'field_gallery_nid' => array(
  68.     'default_action' => 'not found',
  69.     'style_plugin' => 'default_summary',
  70.     'style_options' => array(),
  71.     'wildcard' => 'all',
  72.     'wildcard_substitution' => 'All',
  73.     'title' => '',
  74.     'default_argument_type' => 'fixed',
  75.     'default_argument' => '',
  76.     'validate_type' => 'node',
  77.     'validate_fail' => 'not found',
  78.     'break_phrase' => 0,
  79.     'not' => 0,
  80.     'id' => 'field_gallery_nid',
  81.     'table' => 'node_data_field_gallery',
  82.     'field' => 'field_gallery_nid',
  83.     'validate_user_argument_type' => 'uid',
  84.     'validate_user_roles' => array(
  85.       2 => 0,
  86.     ),
  87.     'relationship' => 'none',
  88.     'default_options_div_prefix' => '',
  89.     'default_argument_user' => 0,
  90.     'default_argument_fixed' => '',
  91.     'default_argument_php' => '',
  92.     'validate_argument_node_type' => array(
  93.       'gallery' => 'gallery',
  94.     ),
  95.     'validate_argument_node_access' => 1,
  96.     'validate_argument_nid_type' => 'nid',
  97.     'validate_argument_vocabulary' => array(),
  98.     'validate_argument_type' => 'tid',
  99.     'validate_argument_transform' => 0,
  100.     'validate_user_restrict_roles' => 0,
  101.     'validate_argument_php' => '',
  102.   ),
  103. ));
  104. $handler->override_option('filters', array(
  105.   'status_extra' => array(
  106.     'operator' => '=',
  107.     'value' => '',
  108.     'group' => '0',
  109.     'exposed' => FALSE,
  110.     'expose' => array(
  111.       'operator' => FALSE,
  112.       'label' => '',
  113.     ),
  114.     'id' => 'status_extra',
  115.     'table' => 'node',
  116.     'field' => 'status_extra',
  117.     'relationship' => 'none',
  118.   ),
  119. ));
  120. $handler->override_option('access', array(
  121.   'type' => 'none',
  122. ));
  123. $handler->override_option('cache', array(
  124.   'type' => 'none',
  125. ));
  126. $handler->override_option('empty', 'No photos have been added to this gallery.');
  127. $handler->override_option('empty_format', '1');
  128. $handler->override_option('use_ajax', TRUE);
  129. $handler->override_option('items_per_page', 0);
  130. $handler->override_option('use_pager', '1');
  131. $handler->override_option('style_plugin', 'grid');
  132. $handler->override_option('style_options', array(
  133.   'grouping' => '',
  134.   'columns' => '4',
  135.   'alignment' => 'horizontal',
  136.   'fill_single_line' => 1,
  137. ));
  138. $handler = $view->new_display('node_content', 'Full gallery', 'node_content_1');
  139. $handler->override_option('header', '<a href="#" onclick="Lightbox.triggerLightbox(\'lightshow\', \'field_gallery_image\');">Start Slideshow</a>');
  140. $handler->override_option('header_format', '2');
  141. $handler->override_option('types', array(
  142.   'gallery' => 'gallery',
  143. ));
  144. $handler->override_option('modes', array(
  145.   0 => 'full',
  146. ));
  147. $handler->override_option('argument_mode', 'nid');
  148. $handler->override_option('default_argument', 'nid');
  149. $handler->override_option('show_title', 0);
  150. $handler->override_option('show_empty', 0);
  151. $handler = $view->new_display('node_content', 'Gallery image', 'node_content_2');
  152. $handler->override_option('fields', array(
  153.   'field_gallery_image_fid' => array(
  154.     'label' => '',
  155.     'alter' => array(
  156.       'alter_text' => 0,
  157.       'text' => '',
  158.       'make_link' => 0,
  159.       'path' => '',
  160.       'alt' => '',
  161.       'prefix' => '',
  162.       'suffix' => '',
  163.       'help' => '',
  164.       'trim' => 0,
  165.       'max_length' => '',
  166.       'word_boundary' => 1,
  167.       'ellipsis' => 1,
  168.       'strip_tags' => 0,
  169.       'html' => 0,
  170.     ),
  171.     'link_to_node' => 0,
  172.     'label_type' => 'none',
  173.     'format' => 'thumb_linked',
  174.     'multiple' => array(
  175.       'group' => TRUE,
  176.       'multiple_number' => '',
  177.       'multiple_from' => '',
  178.       'multiple_reversed' => FALSE,
  179.     ),
  180.     'exclude' => 0,
  181.     'id' => 'field_gallery_image_fid',
  182.     'table' => 'node_data_field_gallery_image',
  183.     'field' => 'field_gallery_image_fid',
  184.     'relationship' => 'none',
  185.     'override' => array(
  186.       'button' => 'Use default',
  187.     ),
  188.   ),
  189. ));
  190. $handler->override_option('items_per_page', 1);
  191. $handler->override_option('use_pager', '0');
  192. $handler->override_option('style_plugin', 'default');
  193. $handler->override_option('style_options', array(
  194.   'grouping' => '',
  195. ));
  196. $handler->override_option('types', array(
  197.   'gallery' => 'gallery',
  198. ));
  199. $handler->override_option('modes', array(
  200.   0 => 'teaser',
  201. ));
  202. $handler->override_option('argument_mode', 'nid');
  203. $handler->override_option('default_argument', 'nid');
  204. $handler->override_option('show_empty', 0);
  205. $handler = $view->new_display('block', 'Gallery block', 'block_1');
  206. $handler->override_option('fields', array(
  207.   'nid' => array(
  208.     'label' => 'Nid',
  209.     'alter' => array(
  210.       'alter_text' => 0,
  211.       'text' => '',
  212.       'make_link' => 0,
  213.       'path' => '',
  214.       'link_class' => '',
  215.       'alt' => '',
  216.       'prefix' => '',
  217.       'suffix' => '',
  218.       'help' => '',
  219.       'trim' => 0,
  220.       'max_length' => '',
  221.       'word_boundary' => 1,
  222.       'ellipsis' => 1,
  223.       'strip_tags' => 0,
  224.       'html' => 0,
  225.     ),
  226.     'link_to_node' => 0,
  227.     'exclude' => 1,
  228.     'id' => 'nid',
  229.     'table' => 'node',
  230.     'field' => 'nid',
  231.     'override' => array(
  232.       'button' => 'Use default',
  233.     ),
  234.     'relationship' => 'field_gallery_nid',
  235.   ),
  236.   'field_gallery_image_fid' => array(
  237.     'label' => '',
  238.     'alter' => array(
  239.       'alter_text' => 1,
  240.       'text' => '',
  241.       'make_link' => 1,
  242.       'path' => 'node/[nid]',
  243.       'link_class' => '',
  244.       'alt' => '',
  245.       'prefix' => '',
  246.       'suffix' => '',
  247.       'help' => '',
  248.       'trim' => 0,
  249.       'max_length' => '',
  250.       'word_boundary' => 1,
  251.       'ellipsis' => 1,
  252.       'strip_tags' => 0,
  253.       'html' => 0,
  254.     ),
  255.     'link_to_node' => 0,
  256.     'label_type' => 'none',
  257.     'format' => 'short_default',
  258.     'multiple' => array(
  259.       'group' => TRUE,
  260.       'multiple_number' => '',
  261.       'multiple_from' => '',
  262.       'multiple_reversed' => FALSE,
  263.     ),
  264.     'exclude' => 0,
  265.     'id' => 'field_gallery_image_fid',
  266.     'table' => 'node_data_field_gallery_image',
  267.     'field' => 'field_gallery_image_fid',
  268.     'relationship' => 'none',
  269.     'override' => array(
  270.       'button' => 'Use default',
  271.     ),
  272.   ),
  273. ));
  274. $handler->override_option('arguments', array(
  275.   'field_gallery_nid' => array(
  276.     'default_action' => 'ignore',
  277.     'style_plugin' => 'default_summary',
  278.     'style_options' => array(),
  279.     'wildcard' => 'all',
  280.     'wildcard_substitution' => 'All',
  281.     'title' => 'Latest image',
  282.     'breadcrumb' => '',
  283.     'default_argument_type' => 'fixed',
  284.     'default_argument' => '',
  285.     'validate_type' => 'node',
  286.     'validate_fail' => 'not found',
  287.     'break_phrase' => 0,
  288.     'not' => 0,
  289.     'id' => 'field_gallery_nid',
  290.     'table' => 'node_data_field_gallery',
  291.     'field' => 'field_gallery_nid',
  292.     'validate_user_argument_type' => 'uid',
  293.     'validate_user_roles' => array(),
  294.     'relationship' => 'none',
  295.     'default_options_div_prefix' => '',
  296.     'default_argument_user' => 0,
  297.     'default_argument_fixed' => '1',
  298.     'default_argument_php' => '',
  299.     'validate_argument_node_type' => array(
  300.       'gallery' => 'gallery',
  301.     ),
  302.     'validate_argument_node_access' => 1,
  303.     'validate_argument_nid_type' => 'nid',
  304.     'validate_argument_vocabulary' => array(),
  305.     'validate_argument_type' => 'tid',
  306.     'validate_argument_transform' => 0,
  307.     'validate_user_restrict_roles' => 0,
  308.     'validate_argument_php' => '',
  309.     'override' => array(
  310.       'button' => 'Use default',
  311.     ),
  312.     'validate_argument_node_flag_name' => '*relationship*',
  313.     'validate_argument_node_flag_test' => 'flaggable',
  314.     'validate_argument_node_flag_id_type' => 'id',
  315.     'validate_argument_user_flag_name' => '*relationship*',
  316.     'validate_argument_user_flag_test' => 'flaggable',
  317.     'validate_argument_user_flag_id_type' => 'id',
  318.     'validate_argument_is_member' => 0,
  319.     'validate_argument_signup_status' => 'any',
  320.     'validate_argument_signup_node_access' => 1,
  321.   ),
  322. ));
  323. $handler->override_option('items_per_page', 1);
  324. $handler->override_option('use_pager', '0');
  325. $handler->override_option('style_options', array(
  326.   'grouping' => '',
  327.   'columns' => '1',
  328.   'alignment' => 'horizontal',
  329. ));
  330. $handler->override_option('block_description', '');
  331. $handler->override_option('block_caching', -1);
  332. $handler = $view->new_display('block', 'Slideshow block', 'block_2');
  333. $handler->override_option('fields', array(
  334.   'field_gallery_image_fid' => array(
  335.     'label' => '',
  336.     'alter' => array(
  337.       'alter_text' => 0,
  338.       'text' => '',
  339.       'make_link' => 0,
  340.       'path' => '',
  341.       'link_class' => '',
  342.       'alt' => '',
  343.       'prefix' => '',
  344.       'suffix' => '',
  345.       'help' => '',
  346.       'trim' => 0,
  347.       'max_length' => '',
  348.       'word_boundary' => 1,
  349.       'ellipsis' => 1,
  350.       'strip_tags' => 0,
  351.       'html' => 0,
  352.     ),
  353.     'link_to_node' => 1,
  354.     'label_type' => 'none',
  355.     'format' => 'reg_linked',
  356.     'multiple' => array(
  357.       'group' => TRUE,
  358.       'multiple_number' => '',
  359.       'multiple_from' => '',
  360.       'multiple_reversed' => FALSE,
  361.     ),
  362.     'exclude' => 0,
  363.     'id' => 'field_gallery_image_fid',
  364.     'table' => 'node_data_field_gallery_image',
  365.     'field' => 'field_gallery_image_fid',
  366.     'relationship' => 'none',
  367.     'override' => array(
  368.       'button' => 'Use default',
  369.     ),
  370.   ),
  371. ));
  372. $handler->override_option('arguments', array(
  373.   'field_gallery_nid' => array(
  374.     'default_action' => 'default',
  375.     'style_plugin' => 'default_summary',
  376.     'style_options' => array(),
  377.     'wildcard' => 'all',
  378.     'wildcard_substitution' => 'All',
  379.     'title' => '',
  380.     'breadcrumb' => '',
  381.     'default_argument_type' => 'fixed',
  382.     'default_argument_fixed' => '126',
  383.     'default_argument' => '',
  384.     'validate_type' => 'node',
  385.     'validate_fail' => 'not found',
  386.     'break_phrase' => 0,
  387.     'not' => 0,
  388.     'id' => 'field_gallery_nid',
  389.     'table' => 'node_data_field_gallery',
  390.     'field' => 'field_gallery_nid',
  391.     'validate_user_argument_type' => 'uid',
  392.     'validate_user_roles' => array(
  393.       2 => 0,
  394.       5 => 0,
  395.       3 => 0,
  396.       4 => 0,
  397.     ),
  398.     'relationship' => 'none',
  399.     'default_options_div_prefix' => '',
  400.     'default_argument_user' => 0,
  401.     'default_argument_php' => '',
  402.     'validate_argument_node_type' => array(
  403.       'gallery' => 'gallery',
  404.     ),
  405.     'validate_argument_node_access' => 1,
  406.     'validate_argument_nid_type' => 'nid',
  407.     'validate_argument_vocabulary' => array(
  408.       2 => 0,
  409.     ),
  410.     'validate_argument_type' => 'tid',
  411.     'validate_argument_transform' => 0,
  412.     'validate_user_restrict_roles' => 0,
  413.     'validate_argument_php' => '',
  414.     'override' => array(
  415.       'button' => 'Use default',
  416.     ),
  417.   ),
  418. ));
  419. $handler->override_option('items_per_page', 10);
  420. $handler->override_option('offset', NULL);
  421. $handler->override_option('use_pager', 0);
  422. $handler->override_option('pager_element', NULL);
  423. $handler->override_option('style_plugin', 'slideshow');
  424. $handler->override_option('style_options', array(
  425.   'grouping' => '',
  426.   'type' => 'ul',
  427.   'mode' => 'singleframe',
  428.   'singleframe' => array(
  429.     'timeout' => '1000',
  430.     'delay' => '1',
  431.     'speed' => '2000',
  432.     'random' => '0',
  433.     'pause' => '2',
  434.     'controls' => '0',
  435.     'pager' => '2',
  436.     'pager_type' => 'Numbered',
  437.     'pager_hover' => '1',
  438.     'image_count' => '0',
  439.     'effect' => 'fade',
  440.     'sync' => '1',
  441.     'advanced' => '',
  442.     'ie' => array(
  443.       'cleartype' => TRUE,
  444.       'cleartypenobg' => FALSE,
  445.     ),
  446.   ),
  447.   'thumbnailhover' => array(
  448.     'hover_breakout' => 'teaser',
  449.     'teasers_last' => 1,
  450.     'timeout' => '1500',
  451.     'delay' => '0',
  452.     'speed' => '1500',
  453.     'random' => '0',
  454.     'pause' => '1',
  455.     'pager_event' => 'mouseover',
  456.     'controls' => '0',
  457.     'image_count' => '0',
  458.     'effect' => 'fade',
  459.     'sync' => '',
  460.     'advanced' => '',
  461.     'ie' => array(
  462.       'cleartype' => TRUE,
  463.       'cleartypenobg' => FALSE,
  464.     ),
  465.   ),
  466. ));
  467. $handler->override_option('row_options', array(
  468.   'inline' => array(),
  469.   'separator' => '',
  470. ));
  471. $handler->override_option('block_description', '');
  472. $handler->override_option('block_caching', -1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement