Guest

bas

By: a guest on Dec 30th, 2009  |  syntax: PHP  |  size: 4.97 KB  |  hits: 123  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. $view = new view;
  2. $view->name = 'user_attachments';
  3. $view->description = 'Prikaz korisnikovih attachmenta';
  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;
  10. $handler = $view->new_display('default', 'Defaults', 'default');
  11. $handler->override_option('relationships', array(
  12.   'upload_fid' => array(
  13.     'id' => 'upload_fid',
  14.     'table' => 'node',
  15.     'field' => 'upload_fid',
  16.   ),
  17.   'uid' => array(
  18.     'label' => 'korisnik',
  19.     'required' => 0,
  20.     'id' => 'uid',
  21.     'table' => 'node_revisions',
  22.     'field' => 'uid',
  23.     'relationship' => 'none',
  24.   ),
  25. ));
  26. $handler->override_option('fields', array(
  27.   'fid' => array(
  28.     'label' => 'File ID',
  29.     'alter' => array(
  30.       'alter_text' => 0,
  31.       'text' => '',
  32.       'make_link' => 0,
  33.       'path' => '',
  34.       'link_class' => '',
  35.       'alt' => '',
  36.       'prefix' => '',
  37.       'suffix' => '',
  38.       'target' => '',
  39.       'help' => '',
  40.       'trim' => 0,
  41.       'max_length' => '',
  42.       'word_boundary' => 1,
  43.       'ellipsis' => 1,
  44.       'strip_tags' => 0,
  45.       'html' => 0,
  46.     ),
  47.     'empty' => '',
  48.     'hide_empty' => 1,
  49.     'empty_zero' => 0,
  50.     'link_to_file' => 0,
  51.     'exclude' => 0,
  52.     'id' => 'fid',
  53.     'table' => 'files',
  54.     'field' => 'fid',
  55.     'relationship' => 'upload_fid',
  56.   ),
  57.   'filename' => array(
  58.     'label' => 'Naziv',
  59.     'alter' => array(
  60.       'alter_text' => 0,
  61.       'text' => '',
  62.       'make_link' => 0,
  63.       'path' => '',
  64.       'link_class' => '',
  65.       'alt' => '',
  66.       'prefix' => '',
  67.       'suffix' => '',
  68.       'target' => '',
  69.       'help' => '',
  70.       'trim' => 0,
  71.       'max_length' => '',
  72.       'word_boundary' => 1,
  73.       'ellipsis' => 1,
  74.       'strip_tags' => 0,
  75.       'html' => 0,
  76.     ),
  77.     'empty' => '',
  78.     'hide_empty' => 0,
  79.     'empty_zero' => 0,
  80.     'link_to_file' => 0,
  81.     'exclude' => 0,
  82.     'id' => 'filename',
  83.     'table' => 'files',
  84.     'field' => 'filename',
  85.     'relationship' => 'upload_fid',
  86.   ),
  87.   'filepath' => array(
  88.     'id' => 'filepath',
  89.     'table' => 'files',
  90.     'field' => 'filepath',
  91.     'relationship' => 'upload_fid',
  92.   ),
  93.   'filesize' => array(
  94.     'id' => 'filesize',
  95.     'table' => 'files',
  96.     'field' => 'filesize',
  97.   ),
  98.   'timestamp' => array(
  99.     'label' => 'Upload date',
  100.     'alter' => array(
  101.       'alter_text' => 0,
  102.       'text' => '',
  103.       'make_link' => 0,
  104.       'path' => '',
  105.       'link_class' => '',
  106.       'alt' => '',
  107.       'prefix' => '',
  108.       'suffix' => '',
  109.       'target' => '',
  110.       'help' => '',
  111.       'trim' => 0,
  112.       'max_length' => '',
  113.       'word_boundary' => 1,
  114.       'ellipsis' => 1,
  115.       'strip_tags' => 0,
  116.       'html' => 0,
  117.     ),
  118.     'empty' => '',
  119.     'hide_empty' => 0,
  120.     'empty_zero' => 0,
  121.     'date_format' => 'small',
  122.     'custom_date_format' => '',
  123.     'exclude' => 0,
  124.     'id' => 'timestamp',
  125.     'table' => 'files',
  126.     'field' => 'timestamp',
  127.     'relationship' => 'upload_fid',
  128.   ),
  129. ));
  130. $handler->override_option('filters', array(
  131.   'fid' => array(
  132.     'operator' => 'not empty',
  133.     'value' => array(
  134.       'value' => '',
  135.       'min' => '',
  136.       'max' => '',
  137.     ),
  138.     'group' => '0',
  139.     'exposed' => FALSE,
  140.     'expose' => array(
  141.       'operator' => FALSE,
  142.       'label' => '',
  143.     ),
  144.     'id' => 'fid',
  145.     'table' => 'files',
  146.     'field' => 'fid',
  147.     'relationship' => 'upload_fid',
  148.   ),
  149.   'uid_current' => array(
  150.     'operator' => '=',
  151.     'value' => '1',
  152.     'group' => '0',
  153.     'exposed' => FALSE,
  154.     'expose' => array(
  155.       'operator' => FALSE,
  156.       'label' => '',
  157.     ),
  158.     'id' => 'uid_current',
  159.     'table' => 'users',
  160.     'field' => 'uid_current',
  161.     'relationship' => 'uid',
  162.   ),
  163. ));
  164. $handler->override_option('access', array(
  165.   'type' => 'none',
  166. ));
  167. $handler->override_option('cache', array(
  168.   'type' => 'none',
  169. ));
  170. $handler->override_option('use_pager', '0');
  171. $handler->override_option('distinct', 1);
  172. $handler->override_option('style_plugin', 'table');
  173. $handler->override_option('style_options', array(
  174.   'grouping' => '',
  175.   'override' => 1,
  176.   'sticky' => 0,
  177.   'order' => 'asc',
  178.   'columns' => array(
  179.     'fid' => 'fid',
  180.     'filename' => 'filename',
  181.     'filepath' => 'filepath',
  182.   ),
  183.   'info' => array(
  184.     'fid' => array(
  185.       'sortable' => 0,
  186.       'separator' => '',
  187.     ),
  188.     'filename' => array(
  189.       'sortable' => 0,
  190.       'separator' => '',
  191.     ),
  192.     'filepath' => array(
  193.       'sortable' => 0,
  194.       'separator' => '',
  195.     ),
  196.   ),
  197.   'default' => '-1',
  198. ));
  199. $handler = $view->new_display('page', 'Stranica', 'page_1');
  200. $handler->override_option('path', 'user/%/attachmenti');
  201. $handler->override_option('menu', array(
  202.   'type' => 'tab',
  203.   'title' => 'Attachmenti',
  204.   'description' => '',
  205.   'weight' => '0',
  206.   'name' => 'navigation',
  207. ));
  208. $handler->override_option('tab_options', array(
  209.   'type' => 'none',
  210.   'title' => '',
  211.   'description' => '',
  212.   'weight' => 0,
  213. ));