Advertisement
Guest User

Drupal views

a guest
Sep 6th, 2010
824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 12.08 KB | None | 0 0
  1. $view = new view;
  2. $view->name = 'master';
  3. $view->description = '';
  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.   'content_profile_rel' => array(
  13.     'id' => 'content_profile_rel',
  14.     'table' => 'users',
  15.     'field' => 'content_profile_rel',
  16.   ),
  17.   'vid' => array(
  18.     'id' => 'vid',
  19.     'table' => 'term_node',
  20.     'field' => 'vid',
  21.   ),
  22. ));
  23. $handler->override_option('fields', array(
  24.   'field_country_value' => array(
  25.     'label' => 'Country',
  26.     'alter' => array(
  27.       'alter_text' => 0,
  28.       'text' => '',
  29.       'make_link' => 0,
  30.       'path' => '',
  31.       'link_class' => '',
  32.       'alt' => '',
  33.       'prefix' => '',
  34.       'suffix' => '',
  35.       'target' => '',
  36.       'help' => '',
  37.       'trim' => 0,
  38.       'max_length' => '',
  39.       'word_boundary' => 1,
  40.       'ellipsis' => 1,
  41.       'html' => 0,
  42.       'strip_tags' => 0,
  43.     ),
  44.     'empty' => '',
  45.     'hide_empty' => 1,
  46.     'empty_zero' => 0,
  47.     'link_to_node' => 0,
  48.     'label_type' => 'widget',
  49.     'format' => 'default',
  50.     'multiple' => array(
  51.       'group' => TRUE,
  52.       'multiple_number' => '',
  53.       'multiple_from' => '',
  54.       'multiple_reversed' => FALSE,
  55.     ),
  56.     'exclude' => 0,
  57.     'id' => 'field_country_value',
  58.     'table' => 'node_data_field_country',
  59.     'field' => 'field_country_value',
  60.     'override' => array(
  61.       'button' => 'Override',
  62.     ),
  63.     'relationship' => 'none',
  64.   ),
  65.   'field_eventdate_value' => array(
  66.     'label' => 'EventDate',
  67.     'alter' => array(
  68.       'alter_text' => 0,
  69.       'text' => '',
  70.       'make_link' => 0,
  71.       'path' => '',
  72.       'link_class' => '',
  73.       'alt' => '',
  74.       'prefix' => '',
  75.       'suffix' => '',
  76.       'target' => '',
  77.       'help' => '',
  78.       'trim' => 0,
  79.       'max_length' => '',
  80.       'word_boundary' => 1,
  81.       'ellipsis' => 1,
  82.       'html' => 0,
  83.       'strip_tags' => 0,
  84.     ),
  85.     'empty' => '',
  86.     'hide_empty' => 0,
  87.     'empty_zero' => 0,
  88.     'link_to_node' => 0,
  89.     'label_type' => 'widget',
  90.     'format' => 'default',
  91.     'multiple' => array(
  92.       'multiple_number' => '',
  93.       'multiple_from' => '',
  94.       'multiple_to' => '',
  95.       'group' => TRUE,
  96.     ),
  97.     'repeat' => array(
  98.       'show_repeat_rule' => '',
  99.     ),
  100.     'fromto' => array(
  101.       'fromto' => 'both',
  102.     ),
  103.     'exclude' => 0,
  104.     'id' => 'field_eventdate_value',
  105.     'table' => 'node_data_field_eventdate',
  106.     'field' => 'field_eventdate_value',
  107.     'override' => array(
  108.       'button' => 'Override',
  109.     ),
  110.     'relationship' => 'none',
  111.   ),
  112.   'title' => array(
  113.     'label' => 'Name(Desc)',
  114.     'alter' => array(
  115.       'alter_text' => 0,
  116.       'text' => '',
  117.       'make_link' => 0,
  118.       'path' => '',
  119.       'link_class' => '',
  120.       'alt' => '',
  121.       'prefix' => '',
  122.       'suffix' => '',
  123.       'target' => '',
  124.       'help' => '',
  125.       'trim' => 0,
  126.       'max_length' => '',
  127.       'word_boundary' => 1,
  128.       'ellipsis' => 1,
  129.       'html' => 0,
  130.       'strip_tags' => 1,
  131.     ),
  132.     'empty' => '',
  133.     'hide_empty' => 0,
  134.     'empty_zero' => 0,
  135.     'link_to_node' => 0,
  136.     'exclude' => 0,
  137.     'id' => 'title',
  138.     'table' => 'node',
  139.     'field' => 'title',
  140.     'relationship' => 'none',
  141.   ),
  142.   'field_internationalcode_value' => array(
  143.     'label' => 'Coin',
  144.     'alter' => array(
  145.       'alter_text' => 0,
  146.       'text' => '',
  147.       'make_link' => 0,
  148.       'path' => '',
  149.       'link_class' => '',
  150.       'alt' => '',
  151.       'prefix' => '',
  152.       'suffix' => '',
  153.       'target' => '',
  154.       'help' => '',
  155.       'trim' => 0,
  156.       'max_length' => '',
  157.       'word_boundary' => 1,
  158.       'ellipsis' => 1,
  159.       'html' => 0,
  160.       'strip_tags' => 0,
  161.     ),
  162.     'empty' => '',
  163.     'hide_empty' => 0,
  164.     'empty_zero' => 0,
  165.     'link_to_node' => 0,
  166.     'label_type' => 'custom',
  167.     'format' => 'default',
  168.     'multiple' => array(
  169.       'group' => TRUE,
  170.       'multiple_number' => '',
  171.       'multiple_from' => '',
  172.       'multiple_reversed' => FALSE,
  173.     ),
  174.     'exclude' => 0,
  175.     'id' => 'field_internationalcode_value',
  176.     'table' => 'node_data_field_internationalcode',
  177.     'field' => 'field_internationalcode_value',
  178.     'relationship' => 'none',
  179.   ),
  180.   'field_volatility_value' => array(
  181.     'label' => 'Importance',
  182.     'alter' => array(
  183.       'alter_text' => 0,
  184.       'text' => '',
  185.       'make_link' => 0,
  186.       'path' => '',
  187.       'link_class' => '',
  188.       'alt' => '',
  189.       'prefix' => '',
  190.       'suffix' => '',
  191.       'target' => '',
  192.       'help' => '',
  193.       'trim' => 0,
  194.       'max_length' => '',
  195.       'word_boundary' => 1,
  196.       'ellipsis' => 1,
  197.       'html' => 0,
  198.       'strip_tags' => 0,
  199.     ),
  200.     'empty' => '',
  201.     'hide_empty' => 0,
  202.     'empty_zero' => 0,
  203.     'link_to_node' => 0,
  204.     'label_type' => 'custom',
  205.     'format' => 'default',
  206.     'multiple' => array(
  207.       'group' => TRUE,
  208.       'multiple_number' => '',
  209.       'multiple_from' => '',
  210.       'multiple_reversed' => FALSE,
  211.     ),
  212.     'exclude' => 0,
  213.     'id' => 'field_volatility_value',
  214.     'table' => 'node_data_field_volatility',
  215.     'field' => 'field_volatility_value',
  216.     'relationship' => 'none',
  217.   ),
  218.   'field_htmldescription_value' => array(
  219.     'label' => 'HTMLDescription',
  220.     'alter' => array(
  221.       'alter_text' => 0,
  222.       'text' => '',
  223.       'make_link' => 0,
  224.       'path' => '',
  225.       'link_class' => '',
  226.       'alt' => '',
  227.       'prefix' => '',
  228.       'suffix' => '',
  229.       'target' => '',
  230.       'help' => '',
  231.       'trim' => 0,
  232.       'max_length' => '',
  233.       'word_boundary' => 1,
  234.       'ellipsis' => 1,
  235.       'html' => 0,
  236.       'strip_tags' => 0,
  237.     ),
  238.     'empty' => '',
  239.     'hide_empty' => 0,
  240.     'empty_zero' => 0,
  241.     'link_to_node' => 0,
  242.     'label_type' => 'widget',
  243.     'format' => 'default',
  244.     'multiple' => array(
  245.       'group' => TRUE,
  246.       'multiple_number' => '',
  247.       'multiple_from' => '',
  248.       'multiple_reversed' => FALSE,
  249.     ),
  250.     'exclude' => 0,
  251.     'id' => 'field_htmldescription_value',
  252.     'table' => 'node_data_field_htmldescription',
  253.     'field' => 'field_htmldescription_value',
  254.     'override' => array(
  255.       'button' => 'Override',
  256.     ),
  257.     'relationship' => 'none',
  258.   ),
  259. ));
  260. $handler->override_option('sorts', array(
  261.   'field_internationalcode_value' => array(
  262.     'order' => 'ASC',
  263.     'delta' => -1,
  264.     'id' => 'field_internationalcode_value',
  265.     'table' => 'node_data_field_internationalcode',
  266.     'field' => 'field_internationalcode_value',
  267.     'relationship' => 'content_profile_rel',
  268.     'override' => array(
  269.       'button' => 'Override',
  270.     ),
  271.   ),
  272.   'field_volatility_value' => array(
  273.     'order' => 'ASC',
  274.     'delta' => -1,
  275.     'id' => 'field_volatility_value',
  276.     'table' => 'node_data_field_volatility',
  277.     'field' => 'field_volatility_value',
  278.     'relationship' => 'vid',
  279.     'override' => array(
  280.       'button' => 'Override',
  281.     ),
  282.   ),
  283. ));
  284. $handler->override_option('arguments', array(
  285.   'field_internationalcode_value' => array(
  286.     'default_action' => 'ignore',
  287.     'style_plugin' => 'default_summary',
  288.     'style_options' => array(),
  289.     'wildcard' => 'all',
  290.     'wildcard_substitution' => 'All',
  291.     'title' => '',
  292.     'breadcrumb' => '',
  293.     'default_argument_type' => 'fixed',
  294.     'default_argument' => '',
  295.     'validate_type' => 'none',
  296.     'validate_fail' => 'not found',
  297.     'glossary' => 0,
  298.     'limit' => '0',
  299.     'case' => 'none',
  300.     'path_case' => 'none',
  301.     'transform_dash' => 0,
  302.     'id' => 'field_internationalcode_value',
  303.     'table' => 'node_data_field_internationalcode',
  304.     'field' => 'field_internationalcode_value',
  305.     'validate_user_argument_type' => 'uid',
  306.     'validate_user_roles' => array(
  307.       '2' => 0,
  308.       '4' => 0,
  309.       '5' => 0,
  310.       '3' => 0,
  311.     ),
  312.     'relationship' => 'none',
  313.     'default_options_div_prefix' => '',
  314.     'default_argument_fixed' => '',
  315.     'default_argument_user' => 0,
  316.     'default_argument_php' => '',
  317.     'validate_argument_node_type' => array(
  318.       'webform' => 0,
  319.       'data' => 0,
  320.       'event' => 0,
  321.       'feed' => 0,
  322.       'feed_item' => 0,
  323.       'page' => 0,
  324.       'profile' => 0,
  325.       'story' => 0,
  326.     ),
  327.     'validate_argument_node_access' => 0,
  328.     'validate_argument_nid_type' => 'nid',
  329.     'validate_argument_vocabulary' => array(
  330.       '1' => 0,
  331.     ),
  332.     'validate_argument_type' => 'tid',
  333.     'validate_argument_transform' => 0,
  334.     'validate_user_restrict_roles' => 0,
  335.     'validate_argument_php' => '<?php
  336. if ($args[0]) {
  337.     $view->filter[0][\'value\'] = $args[0]; // set the value of filter[0]
  338. }
  339.  
  340. if ($args[1]) {
  341.    $view->filter[1][\'value\'] = $args[1]; // set the value of filter[1]
  342. }
  343.  
  344. $view->is_cacheable = 0;
  345. ?>',
  346.   ),
  347.   'field_volatility_value' => array(
  348.     'default_action' => 'ignore',
  349.     'style_plugin' => 'default_summary',
  350.     'style_options' => array(),
  351.     'wildcard' => 'all',
  352.     'wildcard_substitution' => 'All',
  353.     'title' => '',
  354.     'breadcrumb' => '',
  355.     'default_argument_type' => 'fixed',
  356.     'default_argument' => '',
  357.     'validate_type' => 'none',
  358.     'validate_fail' => 'not found',
  359.     'break_phrase' => 1,
  360.     'add_table' => 1,
  361.     'require_value' => 1,
  362.     'reduce_duplicates' => 1,
  363.     'id' => 'field_volatility_value',
  364.     'table' => 'node_data_field_volatility',
  365.     'field' => 'field_volatility_value',
  366.     'validate_user_argument_type' => 'uid',
  367.     'validate_user_roles' => array(
  368.       '2' => 0,
  369.       '4' => 0,
  370.       '5' => 0,
  371.       '3' => 0,
  372.     ),
  373.     'relationship' => 'none',
  374.     'default_options_div_prefix' => '',
  375.     'default_argument_fixed' => '',
  376.     'default_argument_user' => 0,
  377.     'default_argument_php' => '',
  378.     'validate_argument_node_type' => array(
  379.       'webform' => 0,
  380.       'data' => 0,
  381.       'event' => 0,
  382.       'feed' => 0,
  383.       'feed_item' => 0,
  384.       'page' => 0,
  385.       'profile' => 0,
  386.       'story' => 0,
  387.     ),
  388.     'validate_argument_node_access' => 0,
  389.     'validate_argument_nid_type' => 'nid',
  390.     'validate_argument_vocabulary' => array(
  391.       '1' => 0,
  392.     ),
  393.     'validate_argument_type' => 'tid',
  394.     'validate_argument_transform' => 0,
  395.     'validate_user_restrict_roles' => 0,
  396.     'validate_argument_php' => '',
  397.   ),
  398. ));
  399. $handler->override_option('filters', array(
  400.   'type' => array(
  401.     'operator' => 'in',
  402.     'value' => array(
  403.       'event' => 'event',
  404.     ),
  405.     'group' => '0',
  406.     'exposed' => FALSE,
  407.     'expose' => array(
  408.       'operator' => FALSE,
  409.       'label' => '',
  410.     ),
  411.     'id' => 'type',
  412.     'table' => 'node',
  413.     'field' => 'type',
  414.     'override' => array(
  415.       'button' => 'Override',
  416.     ),
  417.     'relationship' => 'none',
  418.   ),
  419. ));
  420. $handler->override_option('access', array(
  421.   'type' => 'none',
  422. ));
  423. $handler->override_option('cache', array(
  424.   'type' => 'none',
  425. ));
  426. $handler->override_option('title', 'Forex Calender');
  427. $handler->override_option('use_pager', '1');
  428. $handler->override_option('pager_element', 1);
  429. $handler->override_option('style_plugin', 'table');
  430. $handler->override_option('style_options', array(
  431.   'grouping' => '',
  432.   'override' => 1,
  433.   'sticky' => 0,
  434.   'order' => 'asc',
  435.   'columns' => array(
  436.     'field_country_value' => 'field_country_value',
  437.     'field_eventdate_value' => 'field_eventdate_value',
  438.     'title' => 'title',
  439.     'field_internationalcode_value' => 'field_internationalcode_value',
  440.     'field_volatility_value' => 'field_volatility_value',
  441.   ),
  442.   'info' => array(
  443.     'field_country_value' => array(
  444.       'sortable' => 0,
  445.       'separator' => '',
  446.     ),
  447.     'field_eventdate_value' => array(
  448.       'sortable' => 1,
  449.       'separator' => '',
  450.     ),
  451.     'title' => array(
  452.       'sortable' => 0,
  453.       'separator' => '',
  454.     ),
  455.     'field_internationalcode_value' => array(
  456.       'sortable' => 1,
  457.       'separator' => '',
  458.     ),
  459.     'field_volatility_value' => array(
  460.       'sortable' => 1,
  461.       'separator' => '',
  462.     ),
  463.   ),
  464.   'default' => '-1',
  465. ));
  466. $handler->override_option('row_plugin', 'node');
  467. $handler = $view->new_display('page', 'Page', 'page_1');
  468. $handler->override_option('path', 'master');
  469. $handler->override_option('menu', array(
  470.   'type' => 'none',
  471.   'title' => '',
  472.   'description' => '',
  473.   'weight' => 0,
  474.   'name' => 'navigation',
  475. ));
  476. $handler->override_option('tab_options', array(
  477.   'type' => 'none',
  478.   'title' => '',
  479.   'description' => '',
  480.   'weight' => 0,
  481.   'name' => 'navigation',
  482. ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement