| 1 |
<?php
|
| 2 |
// $Id: subuser.views_default.inc,v 1.2 2009/04/24 04:11:59 boombatower Exp $
|
| 3 |
/**
|
| 4 |
* @file
|
| 5 |
* Allows users of a particular role to create sub user account in another role.
|
| 6 |
*
|
| 7 |
* Copyright 2008-2009 by Jimmy Berry ("boombatower", http://drupal.org/user/214218)
|
| 8 |
*/
|
| 9 |
|
| 10 |
/**
|
| 11 |
* Implementation of hook_default_view_views().
|
| 12 |
*/
|
| 13 |
function subuser_views_default_views() {
|
| 14 |
$view = new view;
|
| 15 |
$view->name = 'subusers';
|
| 16 |
$view->description = '';
|
| 17 |
$view->tag = 'users';
|
| 18 |
$view->view_php = '';
|
| 19 |
$view->base_table = 'users';
|
| 20 |
$view->is_cacheable = FALSE;
|
| 21 |
$view->api_version = 2;
|
| 22 |
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
|
| 23 |
$handler = $view->new_display('default', 'Defaults', 'default');
|
| 24 |
$handler->override_option('fields', array(
|
| 25 |
'uid' => array(
|
| 26 |
'label' => 'Uid',
|
| 27 |
'alter' => array(
|
| 28 |
'alter_text' => 0,
|
| 29 |
'text' => '',
|
| 30 |
'make_link' => 0,
|
| 31 |
'path' => '',
|
| 32 |
'alt' => '',
|
| 33 |
'prefix' => '',
|
| 34 |
'suffix' => '',
|
| 35 |
'help' => '',
|
| 36 |
'trim' => 0,
|
| 37 |
'max_length' => '',
|
| 38 |
'word_boundary' => 1,
|
| 39 |
'ellipsis' => 1,
|
| 40 |
'html' => 0,
|
| 41 |
),
|
| 42 |
'link_to_user' => 0,
|
| 43 |
'exclude' => 1,
|
| 44 |
'id' => 'uid',
|
| 45 |
'table' => 'users',
|
| 46 |
'field' => 'uid',
|
| 47 |
'relationship' => 'none',
|
| 48 |
),
|
| 49 |
'name' => array(
|
| 50 |
'label' => 'Name',
|
| 51 |
'link_to_user' => 1,
|
| 52 |
'exclude' => 0,
|
| 53 |
'id' => 'name',
|
| 54 |
'table' => 'users',
|
| 55 |
'field' => 'name',
|
| 56 |
'relationship' => 'none',
|
| 57 |
),
|
| 58 |
'nothing_1' => array(
|
| 59 |
'label' => 'Operations',
|
| 60 |
'alter' => array(
|
| 61 |
'text' => 'Edit',
|
| 62 |
'make_link' => 1,
|
| 63 |
'path' => 'user/[uid]/edit',
|
| 64 |
'alt' => '',
|
| 65 |
'prefix' => '',
|
| 66 |
'suffix' => '',
|
| 67 |
'help' => '',
|
| 68 |
'trim' => 0,
|
| 69 |
'max_length' => '',
|
| 70 |
'word_boundary' => 1,
|
| 71 |
'ellipsis' => 1,
|
| 72 |
'html' => 0,
|
| 73 |
),
|
| 74 |
'exclude' => 0,
|
| 75 |
'id' => 'nothing_1',
|
| 76 |
'table' => 'views',
|
| 77 |
'field' => 'nothing',
|
| 78 |
'relationship' => 'none',
|
| 79 |
),
|
| 80 |
'nothing' => array(
|
| 81 |
'label' => '',
|
| 82 |
'alter' => array(
|
| 83 |
'text' => 'Switch',
|
| 84 |
'make_link' => 1,
|
| 85 |
'path' => 'subuser/switch/[uid]',
|
| 86 |
'alt' => '',
|
| 87 |
'prefix' => '',
|
| 88 |
'suffix' => '',
|
| 89 |
'help' => '',
|
| 90 |
'trim' => 0,
|
| 91 |
'max_length' => '',
|
| 92 |
'word_boundary' => 1,
|
| 93 |
'ellipsis' => 1,
|
| 94 |
'html' => 0,
|
| 95 |
),
|
| 96 |
'exclude' => 0,
|
| 97 |
'id' => 'nothing',
|
| 98 |
'table' => 'views',
|
| 99 |
'field' => 'nothing',
|
| 100 |
'relationship' => 'none',
|
| 101 |
),
|
| 102 |
));
|
| 103 |
$handler->override_option('arguments', array(
|
| 104 |
'parent_id' => array(
|
| 105 |
'default_action' => 'default',
|
| 106 |
'style_plugin' => 'default_summary',
|
| 107 |
'style_options' => array(),
|
| 108 |
'wildcard' => 'all',
|
| 109 |
'wildcard_substitution' => 'All',
|
| 110 |
'title' => '',
|
| 111 |
'default_argument_type' => 'user',
|
| 112 |
'default_argument' => '',
|
| 113 |
'validate_type' => 'none',
|
| 114 |
'validate_fail' => 'not found',
|
| 115 |
'break_phrase' => 0,
|
| 116 |
'not' => 0,
|
| 117 |
'id' => 'parent_id',
|
| 118 |
'table' => 'user_relationship',
|
| 119 |
'field' => 'parent_id',
|
| 120 |
'relationship' => 'none',
|
| 121 |
'default_options_div_prefix' => '',
|
| 122 |
'default_argument_user' => 0,
|
| 123 |
'default_argument_fixed' => '',
|
| 124 |
'default_argument_php' => '',
|
| 125 |
'validate_argument_node_type' => array(
|
| 126 |
'webform' => 0,
|
| 127 |
'blog' => 0,
|
| 128 |
'client' => 0,
|
| 129 |
'event' => 0,
|
| 130 |
'image' => 0,
|
| 131 |
'images' => 0,
|
| 132 |
'page' => 0,
|
| 133 |
'revent' => 0,
|
| 134 |
'story' => 0,
|
| 135 |
'venue' => 0,
|
| 136 |
),
|
| 137 |
'validate_argument_node_access' => 0,
|
| 138 |
'validate_argument_nid_type' => 'nid',
|
| 139 |
'validate_argument_vocabulary' => array(
|
| 140 |
'1' => 0,
|
| 141 |
'4' => 0,
|
| 142 |
'2' => 0,
|
| 143 |
),
|
| 144 |
'validate_argument_type' => 'tid',
|
| 145 |
'validate_argument_php' => '',
|
| 146 |
),
|
| 147 |
));
|
| 148 |
$handler->override_option('access', array(
|
| 149 |
'type' => 'none',
|
| 150 |
));
|
| 151 |
$handler->override_option('use_ajax', TRUE);
|
| 152 |
$handler->override_option('use_pager', 'mini');
|
| 153 |
$handler->override_option('style_plugin', 'table');
|
| 154 |
|
| 155 |
$views[$view->name] = $view;
|
| 156 |
|
| 157 |
return $views;
|
| 158 |
}
|