Commit 8beebb55 authored by merlinofchaos's avatar merlinofchaos

Empty master branch.

parent 429d3608
This diff is collapsed.
Welcome to Views 2. Please see the advanced help for more information.
If you're having trouble installing this module, please ensure that your
tar program is not flattening the directory tree, truncating filenames
or losing files.
Installing Views:
Place the entirety of this directory in sites/all/modules/views
Navigate to administer >> build >> modules. Enable Views and Views UI.
If upgrading from Drupal 5 and Views 1, your views need to be
converted manually. See administer >> build >> modules >> views >> tools >> convert.
If you're new to Views, try the Simple Views module which can create some
often used Views for you, this might save you some time.
Recommended modules for use with Views:
CCK
Voting API
Views Bonus Pack
Views Bulk Operations
Experimental modules:
Views OR
\ No newline at end of file
master branch is unused. Please see versioned branches instead.
This diff is collapsed.
table.views-entry {
clear: right; /* RTL */
}
table.views-entry td.view-ops {
text-align: left; /* RTL */
}
#views-ui-list-views-form .form-item {
padding-left: 1em; /* RTL */
float: right; /* RTL */
}
#edit-order-wrapper {
clear: right; /* RTL */
}
#edit-views-apply,
#edit-views-reset {
float: right; /* RTL */
}
.views-entry .advanced-help-link {
padding-left: 3px; /* RTL */
}
table.views-entry {
margin: 3px 0;
border: 1px solid #ddd;
background-color: white;
color: #494949; /* matches garland */
clear: left; /* LTR */
width: 100%;
}
table.views-entry tbody {
border: none;
}
table.views-entry td.view-ops {
width: 45%;
text-align: right; /* LTR */
background-color: #eee;
}
table.views-entry td.view-name {
background-color: #eee;
}
table.views-entry .description {
vertical-align: top;
}
body form#views-ui-list-views-form {
margin: 0 0 1.5em 0;
}
#views-ui-list-views-form .form-item {
padding-right: 1em; /* LTR */
float: left; /* LTR */
margin-top: 0;
margin-bottom: 0;
}
#edit-order-wrapper {
clear: left; /* LTR */
}
#edit-views-apply,
#edit-views-reset {
margin-top: 1.65em;
float: left; /* LTR */
}
.views-entry .advanced-help-link {
position: relative;
top: 2px;
padding-right: 3px; /* LTR */
}
table.view-disabled {
color: #999;
}
table.views-entry td {
line-height: 1.4;
padding-bottom: 10px;
}
table.view-disabled td {
line-height: 1.4;
padding-bottom: 10px;
background: none;
}
table.view-enabled td.view-name,
table.view-enabled td.view-ops,
table.view-disabled td.view-name,
table.view-disabled td.view-ops {
line-height: 1.6;
padding-bottom: 0.3em;
}
table.views-entry td.view-name,
table.views-entry td.view-ops {
background: #eee;
}
table.view-enabled td.view-name,
table.view-enabled td.view-ops {
background: #E4F0F8;
}
/* $Id */
.ui-tabs-hide {
display: none;
}
.views-exposed-form .views-exposed-widget {
float: left;
padding: .5em 1em 0 0;
}
.views-exposed-form .views-exposed-widget .form-submit {
margin-top: 1.6em;
}
.views-exposed-form .form-item,
.views-exposed-form .form-submit {
margin-top: 0;
margin-bottom: 0;
}
.views-exposed-form label {
font-weight: bold;
}
.views-exposed-widgets {
margin-bottom: .5em;
}
html.js a.views-throbbing,
html.js span.views-throbbing {
background:url(../images/status-active.gif) no-repeat right center;
padding-right:18px;
}
/* administrative hover links */
div.view div.views-admin-links {
font-size: xx-small;
margin-right: 1em;
margin-top: 1em;
width: 95%;
}
.block div.view div.views-admin-links {
margin-top: 0;
}
div.view div.views-admin-links ul {
padding-left: 0;
}
div.view div.views-admin-links li a {
color: #ccc;
}
div.view div.views-admin-links li {
padding-bottom: 2px;
z-index: 201;
}
div.view div.views-admin-links-hover a,
div.view div.views-admin-links:hover a {
color: #000;
}
div.view div.views-admin-links-hover,
div.view div.views-admin-links:hover {
background: transparent;;
}
div.view div.views-admin-links a:before {
content: "[";
}
div.view div.views-admin-links a:after {
content: "]";
}
div.view div.views-hide {
display: none;
}
/** For IE we add the class via js; for other browsers we rely on :hover **/
div.view div.views-hide-hover,
div.view:hover div.views-hide {
display: block;
position: absolute;
z-index: 200;
}
/* don't do this one in IE */
div.view:hover div.views-hide {
margin-top: -1.5em;
}
/* Remove the border on tbody that system puts in */
.views-view-grid tbody {
border-top: none;
}
This diff is collapsed.
- If the interface text is *bolded*, it got strong tags.
- If it's a button they need to click, that's *bold* too.
- If the text is not bolded (ex: links to click, options to check), it
got /italicized/.
- If it's user-entered text it got 'single quotes'.
This diff is collapsed.
<?php
/**
* Abstract argument handler for dates.
*
* Adds an option to set a default argument based on the current date.
*
* @param $arg_format
* The format string to use on the current time when
* creating a default date argument.
*
* Definitions terms:
* - many to one: If true, the "many to one" helper will be used.
* - invalid input: A string to give to the user for obviously invalid input.
* This is deprecated in favor of argument validators.
* @see views_many_to_one_helper
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_date extends views_handler_argument_formula {
var $option_name = 'default_argument_date';
var $arg_format = 'Y-m-d';
/**
* Add an option to set the default value to the current date.
*/
function default_argument_form(&$form, &$form_state) {
parent::default_argument_form($form, $form_state);
$form['default_argument_type']['#options'] += array('date' => t('Current date'));
$form['default_argument_type']['#options'] += array('node_created' => t("Current node's creation time"));
$form['default_argument_type']['#options'] += array('node_changed' => t("Current node's update time")); }
/**
* Set the empty argument value to the current date,
* formatted appropriately for this argument.
*/
function get_default_argument($raw = FALSE) {
if (!$raw && $this->options['default_argument_type'] == 'date') {
return date($this->arg_format, time());
}
else if (!$raw) {
foreach (range(1, 3) as $i) {
$node = menu_get_object('node', $i);
if (!empty($node)) {
continue;
}
}
if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
}
if (empty($node)) {
return parent::get_default_argument();
}
else if ($this->options['default_argument_type'] == 'node_created') {
return date($this->arg_format, $node->created);
}
else if ($this->options['default_argument_type'] == 'node_changed') {
return date($this->arg_format, $node->changed);
}
}
else {
return parent::get_default_argument($raw);
}
}
}
<?php
/**
* Abstract argument handler for simple formulae.
*
* Child classes of this object should implement summary_argument, at least.
*
* Definition terms:
* - formula: The formula to use for this handler.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_formula extends views_handler_argument {
var $formula = NULL;
/**
* Constructor
*/
function construct() {
parent::construct();
if (!empty($this->definition['formula'])) {
$this->formula = $this->definition['formula'];
}
}
function get_formula() {
return str_replace('***table***', $this->table_alias, $this->formula);
}
/**
* Build the summary query based on a formula
*/
function summary_query() {
$this->ensure_my_table();
// Now that our table is secure, get our formula.
$formula = $this->get_formula();
// Add the field.
$this->base_alias = $this->name_alias = $this->query->add_field(NULL, $formula, $this->field);
$this->query->set_count_field(NULL, $formula, $this->field);
return $this->summary_basics(FALSE);
}
/**
* Build the query based upon the formula
*/
function query() {
$this->ensure_my_table();
// Now that our table is secure, get our formula.
$formula = $this->get_formula();
$this->query->add_where(0, "$formula = '%s'", $this->argument);
}
}
<?php
/**
* An argument handler for use in fields that have a many to one relationship
* with the table(s) to the left. This adds a bunch of options that are
* reasonably common with this type of relationship.
* Definition terms:
* - numeric: If true, the field will be considered numeric. Probably should
* always be set TRUE as views_handler_argument_string has many to one
* capabilities.
*
* @ingroup views_argument_handlers
*/
class views_handler_argument_many_to_one extends views_handler_argument {
function init(&$view, &$options) {
parent::init($view, $options);
$this->helper = new views_many_to_one_helper($this);
// Ensure defaults for these, during summaries and stuff:
$this->operator = 'or';
$this->value = array();
}
function option_definition() {
$options = parent::option_definition();
if (!empty($this->definition['numeric'])) {
$options['break_phrase'] = array('default' => FALSE);
}
$options['add_table'] = array('default' => FALSE);
$options['require_value'] = array('default' => FALSE);
views_many_to_one_helper::option_definition($options);
return $options;
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
// allow + for or, , for and
if (!empty($this->definition['numeric'])) {
$form['break_phrase'] = array(
'#type' => 'checkbox',
'#title' => t('Allow multiple terms per argument.'),
'#description' => t('If selected, users can enter multiple arguments in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'),
'#default_value' => !empty($this->options['break_phrase']),
);
}
$form['add_table'] = array(
'#type' => 'checkbox',
'#title' => t('Allow multiple arguments to work together.'),
'#description' => t('If selected, multiple instances of this argument can work together, as though multiple terms were supplied to the same argument. This setting is not compatible with the "Reduce duplicates" setting.'),
'#default_value' => !empty($this->options['add_table']),
);
$form['require_value'] = array(
'#type' => 'checkbox',
'#title' => t('Do not display items with no value in summary'),
'#default_value' => !empty($this->options['require_value']),
);
$this->helper->options_form($form, $form_state);
}
/**
* Override ensure_my_table so we can control how this joins in.
* The operator actually has influence over joining.
*/
function ensure_my_table() {
$this->helper->ensure_my_table();
}
function query() {
if (empty($this->argument)) {
parent::ensure_my_table();
$this->query->add_where(0, "$this->table_alias.$this->real_field IS NULL");
return;
}
if (!empty($this->options['break_phrase'])) {
views_break_phrase($this->argument, $this);
}
else {
$this->value = array($this->argument);
$this->operator = 'or';
}
$this->helper->add_filter();
}
function title() {
if (!$this->argument) {
return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized');
}
if (!empty($this->options['break_phrase'])) {
views_break_phrase($this->argument, $this);
}
else {
$this->value = array($this->argument);
$this->operator = 'or';
}
// @todo -- both of these should check definition for alternate keywords.
if (empty($this->value)) {
return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized');
}
if ($this->value === array(-1)) {
return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input');
}
return implode($this->operator == 'or' ? ' + ' : ', ', $this->title_query());
}
function summary_query() {
$field = $this->table . '.' . $this->field;
$join = $this->get_join();
if (!empty($this->options['require_value'])) {
$join->type = 'INNER';
}
if (empty($this->options['add_table']) || empty($this->view->many_to_one_tables[$field])) {
$this->table_alias = $this->query->ensure_table($this->table, $this->relationship, $join);
}
else {
$this->table_alias = $this->helper->summary_join();
}
// Add the field.
$this->base_alias = $this->query->add_field($this->table_alias, $this->real_field);
$this->summary_name_field();
return $this->summary_basics();
}
function summary_argument($data) {
$value = $data->{$this->base_alias};
if (empty($value)) {
$value = 0;
}
return $value;
}
/**
* Override for specific title lookups.
*/
function title_query() {
return $this->value;
}
}
<?php
/**
* Argument handler that ignores the argument.
*/
class views_handler_argument_null extends views_handler_argument {
function option_definition() {
$options = parent::option_definition();
$options['must_not_be'] = array('default' => FALSE);
return $options;
}
/**
* Override options_form() so that only the relevant options
* are displayed to the user.
*/
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['must_not_be'] = array(
'#type' => 'checkbox',
'#title' => t('Fail basic validation if any argument is given'),
'#default_value' => !empty($this->options['must_not_be']),
'#description' => t('By checking this field, you can use this to make sure views with more arguments than necessary fail validation.'),
);
unset($form['wildcard']);
unset($form['wildcard_substitution']);
}
/**
* Override default_actions() to remove actions that don't
* make sense for a null argument.
*/
function default_actions($which = NULL) {
if ($which) {
if (in_array($which, array('ignore', 'not found', 'empty', 'default'))) {
return parent::default_actions($which);
}
return;
}
$actions = parent::default_actions();
unset($actions['summary asc']);