Commit b27116c5 authored by merlinofchaos's avatar merlinofchaos

"string" handler argument which is used for the node title argument

parent 7c9d559e
......@@ -1648,6 +1648,11 @@ class views_plugin_style extends views_object {
function build_sort() { return TRUE; }
function render($rows) { }
/**
* Inject anything into the query that the style handler needs.
*/
function query() { }
}
/**
......@@ -2005,12 +2010,38 @@ function theme_views_ui_style_plugin_table($form) {
* The default style plugin for summaries.
*/
class views_plugin_style_summary extends views_plugin_style {
function options($display) {
return array(
'count' => TRUE,
'override' => FALSE,
'items_per_page' => 0,
);
}
function query() {
if (!empty($this->options['override'])) {
$this->view->set_items_per_page(intval($this->options['items_per_page']));
}
}
function options_form(&$form, &$form_state) {
$form['count'] = array(
'#type' => 'checkbox',
'#default_value' => !empty($this->options['count']),
'#title' => t('Display record count with link'),
);
$form['override'] = array(
'#type' => 'checkbox',
'#default_value' => !empty($this->options['override']),
'#title' => t('Override number of items to display'),
);
$form['items_per_page'] = array(
'#type' => 'textfield',
'#title' => t('Items to display'),
'#default_value' => $this->options['items_per_page'],
'#process' => array('views_process_dependency'),
'#dependency' => array('edit-style-options-override' => array(TRUE)),
);
}
/**
......
......@@ -459,6 +459,10 @@ class view extends views_db_object {
}
}
// Allow style handler to affect the query:
$this->style_handler->query();
$this->build_info['query'] = $this->query->query();
$this->build_info['count_query'] = $this->query->query(TRUE);
$this->build_info['query_args'] = $this->query->get_where_args();
......
......@@ -23,7 +23,7 @@ function comment_views_data() {
$data['comments']['table']['base'] = array(
'field' => 'cid',
'title' => t('Comments'),
'help' => t('The comments type allows views of your site\'s comments.'),
'help' => t('Your site\'s comments.'),
);
//joins
......
......@@ -63,7 +63,9 @@ function node_views_data() {
'filter' => array(
'handler' => 'views_handler_filter_string',
),
// @todo: argumennt
'argument' => array(
'handler' => 'views_handler_argument_string',
),
);
// nid
......@@ -583,7 +585,6 @@ function template_preprocess_views_view_row_node(&$vars) {
return;
}
// @todo add settings so that this can choose teaser, links, etc.
$vars['node'] = node_view($node, $options['teaser'], FALSE, $options['links']);
}
......
......@@ -25,6 +25,7 @@ function user_views_data() {
'help' => t('Allows views of your site\'s users.'),
);
// @todo: restructure this back to normal.
$data['users']['table']['join']['node']['handler'] = 'views_join';
$data['users']['table']['join']['node']['arguments'] = array('users', 'node', 'uid', 'uid');
......@@ -41,6 +42,10 @@ function user_views_data() {
'handler' => 'views_handler_field_user_name',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
// @todo argument
);
// mail
......@@ -72,13 +77,19 @@ function user_views_data() {
),
// Information for accepting a uid as a filter
'filter' => array(
'handler' => 'views_handler_filter_equality',
'handler' => 'views_handler_filter_numeric',
),
// Information for sorting on a uid.
'sort' => array(
'handler' => 'views_handler_sort',
),
);
// @todo: users_roles table
// @todo: filter on role
// @todo roles field
// @todo: tracker default view (in users.default_views.inc)
return $data;
}
......
......@@ -15,8 +15,8 @@
<?php if (empty($fields)): ?>
<div><?php print t('None defined'); ?></div>
<?php else: ?>
<?php foreach ($fields as $field): ?>
<?php if (!empty($fields['links'])): ?>
<?php foreach ($fields as $pid => $field): ?>
<?php if (!empty($field['links'])): ?>
<?php print $field['links']; ?>
<?php endif; ?>
<div class="<?php print $field['class']; if (!empty($field['changed'])) { print ' changed'; } ?>">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment