Issue #1762352 by aspilicious, dawehner, damiankloip: Clean up /camelCase methods on View.
parent
b774fcbf5f
commit
c29f2e2dd0
|
@ -118,17 +118,17 @@ function views_ui_preview($view, $display_id, $args = array()) {
|
|||
}
|
||||
}
|
||||
|
||||
$view->set_exposed_input($exposed_input);
|
||||
$view->setExposedInput($exposed_input);
|
||||
|
||||
if (!$view->set_display($display_id)) {
|
||||
if (!$view->setDisplay($display_id)) {
|
||||
return t('Invalid display id @display', array('@display' => $display_id));
|
||||
}
|
||||
|
||||
$view->set_arguments($args);
|
||||
$view->setArguments($args);
|
||||
|
||||
// Store the current view URL for later use:
|
||||
if ($view->display_handler->get_option('path')) {
|
||||
$path = $view->get_url();
|
||||
$path = $view->getUrl();
|
||||
}
|
||||
|
||||
// Make view links come back to preview.
|
||||
|
@ -190,7 +190,7 @@ function views_ui_preview($view, $display_id, $args = array()) {
|
|||
}
|
||||
}
|
||||
if ($show_info) {
|
||||
$rows['query'][] = array('<strong>' . t('Title') . '</strong>', filter_xss_admin($view->get_title()));
|
||||
$rows['query'][] = array('<strong>' . t('Title') . '</strong>', filter_xss_admin($view->getTitle()));
|
||||
if (isset($path)) {
|
||||
$path = l($path, $path);
|
||||
}
|
||||
|
@ -781,7 +781,7 @@ function views_ui_taxonomy_autocomplete_validate($element, &$form_state) {
|
|||
*/
|
||||
function theme_views_ui_view_info($variables) {
|
||||
$view = $variables['view'];
|
||||
$title = $view->get_human_name();
|
||||
$title = $view->getHumanName();
|
||||
|
||||
$displays = _views_ui_get_displays_list($view);
|
||||
$displays = empty($displays) ? t('None') : format_plural(count($displays), 'Display', 'Displays') . ': ' . '<em>' . implode(', ', $displays) . '</em>';
|
||||
|
@ -913,7 +913,7 @@ function views_ui_build_preview($view, $display_id, $render = TRUE) {
|
|||
$build['preview'] = array(
|
||||
'#theme_wrappers' => array('container'),
|
||||
'#attributes' => array('id' => 'views-live-preview'),
|
||||
'#markup' => $render ? views_ui_preview($view->clone_view(), $display_id, $args) : '',
|
||||
'#markup' => $render ? views_ui_preview($view->cloneView(), $display_id, $args) : '',
|
||||
);
|
||||
|
||||
return $build;
|
||||
|
@ -942,12 +942,12 @@ function views_ui_edit_form($form, &$form_state, $view, $display_id = NULL) {
|
|||
$form_state['no_cache'] = TRUE;
|
||||
|
||||
if ($display_id) {
|
||||
if (!$view->set_display($display_id)) {
|
||||
if (!$view->setDisplay($display_id)) {
|
||||
$form['#markup'] = t('Invalid display id @display', array('@display' => $display_id));
|
||||
return $form;
|
||||
}
|
||||
|
||||
$view->fix_missing_relationships();
|
||||
$view->fixMissingRelationships();
|
||||
}
|
||||
|
||||
$form['#attached']['js'][] = ctools_attach_js('collapsible-div');
|
||||
|
@ -1999,7 +1999,7 @@ function views_ui_import_validate($form, &$form_state) {
|
|||
// Make sure base table gets set properly if it got moved.
|
||||
$view->update();
|
||||
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
|
||||
$broken = FALSE;
|
||||
|
||||
|
@ -2026,7 +2026,7 @@ function views_ui_import_validate($form, &$form_state) {
|
|||
}
|
||||
}
|
||||
|
||||
foreach (View::views_object_types() as $type => $info) {
|
||||
foreach (View::viewsObjectTypes() as $type => $info) {
|
||||
$handlers = $display->handler->get_handlers($type);
|
||||
if ($handlers) {
|
||||
foreach ($handlers as $id => $handler) {
|
||||
|
@ -2118,7 +2118,7 @@ function views_ui_edit_view_form_submit($form, &$form_state) {
|
|||
}
|
||||
|
||||
$form_state['view']->save();
|
||||
drupal_set_message(t('The view %name has been saved.', array('%name' => $form_state['view']->get_human_name())));
|
||||
drupal_set_message(t('The view %name has been saved.', array('%name' => $form_state['view']->getHumanName())));
|
||||
|
||||
// Remove this view from cache so we can edit it properly.
|
||||
views_temp_store()->delete($form_state['view']->name);
|
||||
|
@ -2154,7 +2154,7 @@ function views_ui_edit_form_get_bucket($type, $view, $display) {
|
|||
$build = array(
|
||||
'#theme_wrappers' => array('views_ui_display_tab_bucket'),
|
||||
);
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
|
||||
$build['#overridden'] = FALSE;
|
||||
$build['#defaulted'] = FALSE;
|
||||
|
@ -2344,7 +2344,7 @@ function views_ui_edit_form_get_bucket($type, $view, $display) {
|
|||
* Regenerate the current tab for AJAX updates.
|
||||
*/
|
||||
function views_ui_regenerate_tab(&$view, &$output, $display_id) {
|
||||
if (!$view->set_display('default')) {
|
||||
if (!$view->setDisplay('default')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3156,7 +3156,7 @@ function views_ui_edit_details_form($form, &$form_state) {
|
|||
'#type' => 'textfield',
|
||||
'#title' => t('Human-readable name'),
|
||||
'#description' => t('A descriptive human-readable name for this view. Spaces are allowed'),
|
||||
'#default_value' => $view->get_human_name(),
|
||||
'#default_value' => $view->getHumanName(),
|
||||
);
|
||||
$form['details']['tag'] = array(
|
||||
'#type' => 'textfield',
|
||||
|
@ -3200,7 +3200,7 @@ function views_ui_edit_display_form($form, &$form_state) {
|
|||
$display_id = $form_state['display_id'];
|
||||
$section = $form_state['section'];
|
||||
|
||||
if (!$view->set_display($display_id)) {
|
||||
if (!$view->setDisplay($display_id)) {
|
||||
views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
|
||||
}
|
||||
$display = &$view->display[$display_id];
|
||||
|
@ -3276,8 +3276,8 @@ function views_ui_config_type_form($form, &$form_state) {
|
|||
$display_id = $form_state['display_id'];
|
||||
$type = $form_state['type'];
|
||||
|
||||
$types = View::views_object_types();
|
||||
if (!$view->set_display($display_id)) {
|
||||
$types = View::viewsObjectTypes();
|
||||
if (!$view->setDisplay($display_id)) {
|
||||
views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
|
||||
}
|
||||
$display = &$view->display[$display_id];
|
||||
|
@ -3308,7 +3308,7 @@ function views_ui_config_type_form($form, &$form_state) {
|
|||
* Submit handler for type configuration form
|
||||
*/
|
||||
function views_ui_config_type_form_submit($form, &$form_state) {
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
$display = &$form_state['view']->display[$form_state['display_id']];
|
||||
|
||||
// Store in cache
|
||||
|
@ -3323,8 +3323,8 @@ function views_ui_rearrange_form($form, &$form_state) {
|
|||
$display_id = $form_state['display_id'];
|
||||
$type = $form_state['type'];
|
||||
|
||||
$types = View::views_object_types();
|
||||
if (!$view->set_display($display_id)) {
|
||||
$types = View::viewsObjectTypes();
|
||||
if (!$view->setDisplay($display_id)) {
|
||||
views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
|
||||
}
|
||||
$display = &$view->display[$display_id];
|
||||
|
@ -3555,7 +3555,7 @@ function theme_views_ui_build_group_filter_form($variables) {
|
|||
* Submit handler for rearranging form.
|
||||
*/
|
||||
function views_ui_rearrange_form_submit($form, &$form_state) {
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
$display = &$form_state['view']->display[$form_state['display_id']];
|
||||
|
||||
$old_fields = $display->handler->get_option($types[$form_state['type']]['plural']);
|
||||
|
@ -3591,8 +3591,8 @@ function views_ui_rearrange_filter_form($form, &$form_state) {
|
|||
$display_id = $form_state['display_id'];
|
||||
$type = $form_state['type'];
|
||||
|
||||
$types = View::views_object_types();
|
||||
if (!$view->set_display($display_id)) {
|
||||
$types = View::viewsObjectTypes();
|
||||
if (!$view->setDisplay($display_id)) {
|
||||
views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
|
||||
}
|
||||
$display = &$view->display[$display_id];
|
||||
|
@ -3857,7 +3857,7 @@ function theme_views_ui_rearrange_filter_form(&$vars) {
|
|||
* Submit handler for rearranging form
|
||||
*/
|
||||
function views_ui_rearrange_filter_form_submit($form, &$form_state) {
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
$display = &$form_state['view']->display[$form_state['display_id']];
|
||||
$remember_groups = array();
|
||||
|
||||
|
@ -3975,12 +3975,12 @@ function views_ui_add_item_form($form, &$form_state) {
|
|||
),
|
||||
);
|
||||
|
||||
if (!$view->set_display($display_id)) {
|
||||
if (!$view->setDisplay($display_id)) {
|
||||
views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
|
||||
}
|
||||
$display = &$view->display[$display_id];
|
||||
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
$ltitle = $types[$type]['ltitle'];
|
||||
$section = $types[$type]['plural'];
|
||||
|
||||
|
@ -3995,7 +3995,7 @@ function views_ui_add_item_form($form, &$form_state) {
|
|||
views_ui_standard_display_dropdown($form, $form_state, $section);
|
||||
|
||||
// Figure out all the base tables allowed based upon what the relationships provide.
|
||||
$base_tables = $view->get_base_tables();
|
||||
$base_tables = $view->getBaseTables();
|
||||
$options = views_fetch_fields(array_keys($base_tables), $type, $display->handler->use_group_by());
|
||||
|
||||
if (!empty($options)) {
|
||||
|
@ -4096,7 +4096,7 @@ function views_ui_add_item_form($form, &$form_state) {
|
|||
*/
|
||||
function views_ui_add_item_form_submit($form, &$form_state) {
|
||||
$type = $form_state['type'];
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
$section = $types[$type]['plural'];
|
||||
|
||||
// Handle the override select.
|
||||
|
@ -4212,7 +4212,7 @@ function views_ui_config_item_form($form, &$form_state) {
|
|||
'#attributes' => array('class' => array('scroll')),
|
||||
),
|
||||
);
|
||||
if (!$view->set_display($display_id)) {
|
||||
if (!$view->setDisplay($display_id)) {
|
||||
views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
|
||||
}
|
||||
$item = $view->get_item($display_id, $type, $id);
|
||||
|
@ -4223,7 +4223,7 @@ function views_ui_config_item_form($form, &$form_state) {
|
|||
$form['markup'] = array('#markup' => t("Error: handler for @table > @field doesn't exist!", array('@table' => $item['table'], '@field' => $item['field'])));
|
||||
}
|
||||
else {
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
|
||||
// If this item can come from the default display, show a dropdown
|
||||
// that lets the user choose which display the changes should apply to.
|
||||
|
@ -4273,7 +4273,7 @@ function views_ui_config_item_form($form, &$form_state) {
|
|||
// We want this relationship option to get saved even if the user
|
||||
// skips submitting the form.
|
||||
$view->set_item_option($display_id, $type, $id, 'relationship', $rel);
|
||||
$temp_view = $view->clone_view();
|
||||
$temp_view = $view->cloneView();
|
||||
views_ui_cache_set($temp_view);
|
||||
}
|
||||
|
||||
|
@ -4343,7 +4343,7 @@ function views_ui_config_item_form_submit_temporary($form, &$form_state) {
|
|||
// Run it through the handler's submit function.
|
||||
$form_state['handler']->options_submit($form['options'], $form_state);
|
||||
$item = $form_state['handler']->options;
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
|
||||
// For footer/header $handler_type is area but $type is footer/header.
|
||||
// For all other handle types it's the same.
|
||||
|
@ -4355,7 +4355,7 @@ function views_ui_config_item_form_submit_temporary($form, &$form_state) {
|
|||
$override = NULL;
|
||||
if ($form_state['view']->display_handler->use_group_by() && !empty($item['group_type'])) {
|
||||
if (empty($form_state['view']->query)) {
|
||||
$form_state['view']->init_query();
|
||||
$form_state['view']->initQuery();
|
||||
}
|
||||
$aggregate = $form_state['view']->query->get_aggregation_info();
|
||||
if (!empty($aggregate[$item['group_type']]['handler'][$type])) {
|
||||
|
@ -4397,7 +4397,7 @@ function views_ui_config_item_form_submit($form, &$form_state) {
|
|||
// Run it through the handler's submit function.
|
||||
$form_state['handler']->options_submit($form['options'], $form_state);
|
||||
$item = $form_state['handler']->options;
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
|
||||
// For footer/header $handler_type is area but $type is footer/header.
|
||||
// For all other handle types it's the same.
|
||||
|
@ -4409,7 +4409,7 @@ function views_ui_config_item_form_submit($form, &$form_state) {
|
|||
$override = NULL;
|
||||
if ($form_state['view']->display_handler->use_group_by() && !empty($item['group_type'])) {
|
||||
if (empty($form_state['view']->query)) {
|
||||
$form_state['view']->init_query();
|
||||
$form_state['view']->initQuery();
|
||||
}
|
||||
$aggregate = $form_state['view']->query->get_aggregation_info();
|
||||
if (!empty($aggregate[$item['group_type']]['handler'][$type])) {
|
||||
|
@ -4458,11 +4458,11 @@ function views_ui_config_item_group_form($type, &$form_state) {
|
|||
'#attributes' => array('class' => array('scroll')),
|
||||
),
|
||||
);
|
||||
if (!$view->set_display($display_id)) {
|
||||
if (!$view->setDisplay($display_id)) {
|
||||
views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
|
||||
}
|
||||
|
||||
$view->init_query();
|
||||
$view->initQuery();
|
||||
|
||||
$item = $view->get_item($display_id, $type, $id);
|
||||
|
||||
|
@ -4473,7 +4473,7 @@ function views_ui_config_item_group_form($type, &$form_state) {
|
|||
}
|
||||
else {
|
||||
$handler->init($view, $item);
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
|
||||
$form['#title'] = t('Configure group settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->ui_name()));
|
||||
|
||||
|
@ -4562,7 +4562,7 @@ function views_ui_config_item_extra_form($form, &$form_state) {
|
|||
'#attributes' => array('class' => array('scroll')),
|
||||
),
|
||||
);
|
||||
if (!$view->set_display($display_id)) {
|
||||
if (!$view->setDisplay($display_id)) {
|
||||
views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
|
||||
}
|
||||
$item = $view->get_item($display_id, $type, $id);
|
||||
|
@ -4574,7 +4574,7 @@ function views_ui_config_item_extra_form($form, &$form_state) {
|
|||
}
|
||||
else {
|
||||
$handler->init($view, $item);
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
|
||||
$form['#title'] = t('Configure extra settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->ui_name()));
|
||||
|
||||
|
@ -4633,7 +4633,7 @@ function views_ui_config_style_form($form, &$form_state) {
|
|||
'#attributes' => array('class' => array('scroll')),
|
||||
),
|
||||
);
|
||||
if (!$view->set_display($display_id)) {
|
||||
if (!$view->setDisplay($display_id)) {
|
||||
views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
|
||||
}
|
||||
$item = $view->get_item($display_id, $type, $id);
|
||||
|
@ -4645,7 +4645,7 @@ function views_ui_config_style_form($form, &$form_state) {
|
|||
}
|
||||
else {
|
||||
$handler->init($view, $item);
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
|
||||
$form['#title'] = t('Configure summary style for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->ui_name()));
|
||||
|
||||
|
@ -5311,7 +5311,7 @@ function views_ui_add_template_page() {
|
|||
$rows = array();
|
||||
foreach ($templates as $name => $template) {
|
||||
$rows[] = array(
|
||||
array('data' => check_plain($template->get_human_name())),
|
||||
array('data' => check_plain($template->getHumanName())),
|
||||
array('data' => check_plain($template->description)),
|
||||
array('data' => l('add', 'admin/structure/views/template/' . $template->name . '/add')),
|
||||
);
|
||||
|
@ -5370,8 +5370,8 @@ function views_ui_field_list() {
|
|||
$fields = array();
|
||||
foreach ($views as $view) {
|
||||
foreach ($view->display as $display_id => $display) {
|
||||
if ($view->set_display($display_id)) {
|
||||
foreach (View::views_object_types() as $type => $info) {
|
||||
if ($view->setDisplay($display_id)) {
|
||||
foreach (View::viewsObjectTypes() as $type => $info) {
|
||||
foreach ($view->get_items($type, $display_id) as $item) {
|
||||
$data = views_fetch_data($item['table']);
|
||||
if (isset($data[$item['field']]) && isset($data[$item['field']][$type])
|
||||
|
|
|
@ -66,7 +66,7 @@ class Analyzer {
|
|||
* 'warning' and 'error'.
|
||||
*/
|
||||
public function getMessages() {
|
||||
$this->view->init_display();
|
||||
$this->view->initDisplay();
|
||||
$messages = module_invoke_all('views_analyze', $this->view);
|
||||
|
||||
return $messages;
|
||||
|
|
|
@ -94,7 +94,7 @@ abstract class HandlerBase extends PluginBase {
|
|||
$options['field'] = $this->actual_field;
|
||||
}
|
||||
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
$plural = $this->plugin_type;
|
||||
if (isset($types[$this->plugin_type]['plural'])) {
|
||||
$plural = $types[$this->plugin_type]['plural'];
|
||||
|
@ -179,7 +179,7 @@ abstract class HandlerBase extends PluginBase {
|
|||
|
||||
// If grouping, check to see if the aggregation method needs to modify the field.
|
||||
if ($this->view->display_handler->use_group_by()) {
|
||||
$this->view->init_query();
|
||||
$this->view->initQuery();
|
||||
if ($this->query) {
|
||||
$info = $this->query->get_aggregation_info();
|
||||
if (!empty($info[$this->options['group_type']]['method'])) {
|
||||
|
@ -314,7 +314,7 @@ abstract class HandlerBase extends PluginBase {
|
|||
function groupby_form(&$form, &$form_state) {
|
||||
$view = &$form_state['view'];
|
||||
$display_id = $form_state['display_id'];
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
$type = $form_state['type'];
|
||||
$id = $form_state['id'];
|
||||
|
||||
|
@ -323,7 +323,7 @@ abstract class HandlerBase extends PluginBase {
|
|||
|
||||
$form['#section'] = $display_id . '-' . $type . '-' . $id;
|
||||
|
||||
$view->init_query();
|
||||
$view->initQuery();
|
||||
$info = $view->query->get_aggregation_info();
|
||||
foreach ($info as $id => $aggregate) {
|
||||
$group_types[$id] = $aggregate['title'];
|
||||
|
|
|
@ -131,7 +131,7 @@ abstract class PluginBase extends ComponentPluginBase {
|
|||
|
||||
if (!empty($this->view)) {
|
||||
// Ensure we have a localization plugin.
|
||||
$this->view->init_localization();
|
||||
$this->view->initLocalization();
|
||||
|
||||
// Set up default localization keys. Handlers and such set this for us
|
||||
if (empty($localization_keys) && isset($this->localization_keys)) {
|
||||
|
@ -170,7 +170,7 @@ abstract class PluginBase extends ComponentPluginBase {
|
|||
// Don't localize strings during editing. When editing, we need to work with
|
||||
// the original data, not the translated version.
|
||||
else if (empty($this->view->editing) && !empty($definition[$key]['translatable']) && !empty($value) || !empty($definition['contains'][$key]['translatable']) && !empty($value)) {
|
||||
if (!empty($this->view) && $this->view->is_translatable()) {
|
||||
if (!empty($this->view) && $this->view->isTranslatable()) {
|
||||
// Allow other modules to make changes to the string before it's
|
||||
// sent for translation.
|
||||
// The $keys array is built from the view name, any localization keys
|
||||
|
|
|
@ -67,8 +67,8 @@ class Result extends AreaPluginBase {
|
|||
$output = '';
|
||||
$format = $this->options['content'];
|
||||
// Calculate the page totals.
|
||||
$current_page = (int) $this->view->get_current_page() + 1;
|
||||
$per_page = (int) $this->view->get_items_per_page();
|
||||
$current_page = (int) $this->view->getCurrentPage() + 1;
|
||||
$per_page = (int) $this->view->getItemsPerPage();
|
||||
$count = count($this->view->result);
|
||||
// @TODO: Maybe use a possible is views empty functionality.
|
||||
// Not every view has total_rows set, use view->result instead.
|
||||
|
|
|
@ -66,7 +66,7 @@ class View extends AreaPluginBase {
|
|||
if (empty($view) || !$view->access($display_id)) {
|
||||
return;
|
||||
}
|
||||
$view->set_display($display_id);
|
||||
$view->setDisplay($display_id);
|
||||
|
||||
// Avoid recursion
|
||||
$view->parent_views += $this->view->parent_views;
|
||||
|
|
|
@ -877,7 +877,7 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
/**
|
||||
* Provide the argument to use to link from the summary to the next level;
|
||||
* this will be called once per row of a summary, and used as part of
|
||||
* $view->get_url().
|
||||
* $view->getUrl().
|
||||
*
|
||||
* @param $data
|
||||
* The query results for the row.
|
||||
|
|
|
@ -116,7 +116,7 @@ abstract class CachePluginBase extends PluginBase {
|
|||
$data = array(
|
||||
'result' => $this->view->result,
|
||||
'total_rows' => isset($this->view->total_rows) ? $this->view->total_rows : 0,
|
||||
'current_page' => $this->view->get_current_page(),
|
||||
'current_page' => $this->view->getCurrentPage(),
|
||||
);
|
||||
cache($this->table)->set($this->get_results_key(), $data, $this->cache_set_expire($type));
|
||||
break;
|
||||
|
@ -147,7 +147,7 @@ abstract class CachePluginBase extends PluginBase {
|
|||
if (!$cutoff || $cache->created > $cutoff) {
|
||||
$this->view->result = $cache->data['result'];
|
||||
$this->view->total_rows = $cache->data['total_rows'];
|
||||
$this->view->set_current_page($cache->data['current_page']);
|
||||
$this->view->setCurrentPage($cache->data['current_page']);
|
||||
$this->view->execute_time = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -243,18 +243,18 @@ class Attachment extends DisplayPluginBase {
|
|||
|
||||
// Get a fresh view because our current one has a lot of stuff on it because it's
|
||||
// already been executed.
|
||||
$view = $this->view->clone_view();
|
||||
$view = $this->view->cloneView();
|
||||
$view->original_args = $view->args;
|
||||
|
||||
$args = $this->get_option('inherit_arguments') ? $this->view->args : array();
|
||||
$view->set_arguments($args);
|
||||
$view->set_display($this->display->id);
|
||||
$view->setArguments($args);
|
||||
$view->setDisplay($this->display->id);
|
||||
if ($this->get_option('inherit_pager')) {
|
||||
$view->display_handler->usesPager = $this->view->display[$display_id]->handler->usesPager();
|
||||
$view->display_handler->set_option('pager', $this->view->display[$display_id]->handler->get_option('pager'));
|
||||
}
|
||||
|
||||
$attachment = $view->execute_display($this->display->id, $args);
|
||||
$attachment = $view->executeDisplay($this->display->id, $args);
|
||||
|
||||
switch ($this->get_option('attachment_position')) {
|
||||
case 'before':
|
||||
|
|
|
@ -54,10 +54,10 @@ class Block extends DisplayPluginBase {
|
|||
|
||||
if (empty($desc)) {
|
||||
if ($this->display->display_title == $this->definition['title']) {
|
||||
$desc = t('View: !view', array('!view' => $this->view->get_human_name()));
|
||||
$desc = t('View: !view', array('!view' => $this->view->getHumanName()));
|
||||
}
|
||||
else {
|
||||
$desc = t('View: !view: !display', array('!view' => $this->view->get_human_name(), '!display' => $this->display->display_title));
|
||||
$desc = t('View: !view: !display', array('!view' => $this->view->getHumanName(), '!display' => $this->display->display_title));
|
||||
}
|
||||
}
|
||||
return array(
|
||||
|
@ -75,7 +75,7 @@ class Block extends DisplayPluginBase {
|
|||
// Prior to this being called, the $view should already be set to this
|
||||
// display, and arguments should be set on the view.
|
||||
$info['content'] = $this->view->render();
|
||||
$info['subject'] = filter_xss_admin($this->view->get_title());
|
||||
$info['subject'] = filter_xss_admin($this->view->getTitle());
|
||||
if (!empty($this->view->result) || $this->get_option('empty') || !empty($this->view->style_plugin->definition['even empty'])) {
|
||||
return $info;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ class Block extends DisplayPluginBase {
|
|||
);
|
||||
break;
|
||||
case 'exposed_form_options':
|
||||
$this->view->init_handlers();
|
||||
$this->view->initHandlers();
|
||||
if (!$this->uses_exposed() && parent::uses_exposed()) {
|
||||
$form['exposed_form_options']['warning'] = array(
|
||||
'#weight' => -10,
|
||||
|
|
|
@ -43,14 +43,14 @@ class DefaultDisplay extends DisplayPluginBase {
|
|||
*
|
||||
* For the simplest use:
|
||||
* @code
|
||||
* $output = $view->execute_display('default', $args);
|
||||
* $output = $view->executeDisplay('default', $args);
|
||||
* @endcode
|
||||
*
|
||||
* For more complex usages, a view can be partially built:
|
||||
* @code
|
||||
* $view->set_arguments($args);
|
||||
* $view->setArguments($args);
|
||||
* $view->build('default'); // Build the query
|
||||
* $view->pre_execute(); // Pre-execute the query.
|
||||
* $view->preExecute(); // Pre-execute the query.
|
||||
* $view->execute(); // Run the query
|
||||
* $output = $view->render(); // Render the view
|
||||
* @endcode
|
||||
|
@ -61,7 +61,7 @@ class DefaultDisplay extends DisplayPluginBase {
|
|||
*
|
||||
* You can also do:
|
||||
* @code
|
||||
* $view->set_arguments($args);
|
||||
* $view->setArguments($args);
|
||||
* $output = $view->render('default'); // Render the view
|
||||
* @endcode
|
||||
*
|
||||
|
|
|
@ -722,7 +722,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
}
|
||||
|
||||
function get_url() {
|
||||
return $this->view->get_url();
|
||||
return $this->view->getUrl();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -866,7 +866,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
function get_handlers($type) {
|
||||
if (!isset($this->handlers[$type])) {
|
||||
$this->handlers[$type] = array();
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
$plural = $types[$type]['plural'];
|
||||
|
||||
foreach ($this->get_option($plural) as $id => $info) {
|
||||
|
@ -887,7 +887,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
$override = NULL;
|
||||
if ($this->use_group_by() && !empty($info['group_type'])) {
|
||||
if (empty($this->view->query)) {
|
||||
$this->view->init_query();
|
||||
$this->view->initQuery();
|
||||
}
|
||||
$aggregate = $this->view->query->get_aggregation_info();
|
||||
if (!empty($aggregate[$info['group_type']]['handler'][$type])) {
|
||||
|
@ -1214,7 +1214,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
);
|
||||
}
|
||||
|
||||
$this->view->init_query();
|
||||
$this->view->initQuery();
|
||||
if ($this->view->query->get_aggregation_info()) {
|
||||
$options['group_by'] = array(
|
||||
'category' => 'other',
|
||||
|
@ -1577,7 +1577,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
$plugin_name = $query_options['type'];
|
||||
|
||||
$form['#title'] .= t('Query options');
|
||||
$this->view->init_query();
|
||||
$this->view->initQuery();
|
||||
if ($this->view->query) {
|
||||
$form['query'] = array(
|
||||
'#tree' => TRUE,
|
||||
|
@ -2478,7 +2478,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
|
||||
if ($path) {
|
||||
if (empty($override_path)) {
|
||||
$path = $this->view->get_url(NULL, $path);
|
||||
$path = $this->view->getUrl(NULL, $path);
|
||||
}
|
||||
$url_options = array();
|
||||
if (!empty($this->view->exposed_raw_input)) {
|
||||
|
@ -2572,11 +2572,11 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
* overridden on an individual display.
|
||||
*/
|
||||
function pre_execute() {
|
||||
$this->view->set_use_ajax($this->isAJAXEnabled());
|
||||
$this->view->setUseAJAX($this->isAJAXEnabled());
|
||||
if ($this->usesMore() && !$this->use_more_always()) {
|
||||
$this->view->get_total_rows = TRUE;
|
||||
}
|
||||
$this->view->init_handlers();
|
||||
$this->view->initHandlers();
|
||||
if ($this->uses_exposed()) {
|
||||
$exposed_form = $this->get_plugin('exposed_form');
|
||||
$exposed_form->pre_execute();
|
||||
|
@ -2657,7 +2657,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
}
|
||||
|
||||
// Validate handlers
|
||||
foreach (View::views_object_types() as $type => $info) {
|
||||
foreach (View::viewsObjectTypes() as $type => $info) {
|
||||
foreach ($this->get_handlers($type) as $handler) {
|
||||
$result = $handler->validate();
|
||||
if (!empty($result) && is_array($result)) {
|
||||
|
@ -2682,7 +2682,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
*
|
||||
*/
|
||||
function is_identifier_unique($id, $identifier) {
|
||||
foreach (View::views_object_types() as $type => $info) {
|
||||
foreach (View::viewsObjectTypes() as $type => $info) {
|
||||
foreach ($this->get_handlers($type) as $key => $handler) {
|
||||
if ($handler->can_expose() && $handler->is_exposed()) {
|
||||
if ($handler->is_a_group()) {
|
||||
|
@ -2729,7 +2729,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
if (arg(0) == 'admin' && arg(1) == 'structure' && arg(2) == 'views') {
|
||||
return;
|
||||
}
|
||||
$this->view->init_handlers();
|
||||
$this->view->initHandlers();
|
||||
|
||||
if ($this->uses_exposed() && $this->get_option('exposed_block')) {
|
||||
$exposed_form = $this->get_plugin('exposed_form');
|
||||
|
@ -2786,7 +2786,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
else {
|
||||
$type = $option;
|
||||
}
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
foreach ($storage[$option] as $id => $info) {
|
||||
if (!empty($types[$type]['type'])) {
|
||||
$handler_type = $types[$type]['type'];
|
||||
|
@ -2800,7 +2800,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
$override = NULL;
|
||||
if ($this->use_group_by() && !empty($info['group_type'])) {
|
||||
if (empty($this->view->query)) {
|
||||
$this->view->init_query();
|
||||
$this->view->initQuery();
|
||||
}
|
||||
$aggregate = $this->view->query->get_aggregation_info();
|
||||
if (!empty($aggregate[$info['group_type']]['handler'][$type])) {
|
||||
|
@ -2944,7 +2944,7 @@ abstract class DisplayPluginBase extends PluginBase {
|
|||
else {
|
||||
$type = $option;
|
||||
}
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
foreach ($storage[$option] as $id => $info) {
|
||||
if (!empty($types[$type]['type'])) {
|
||||
$handler_type = $types[$type]['type'];
|
||||
|
|
|
@ -243,10 +243,10 @@ class Feed extends Page {
|
|||
// attach a feed icon.
|
||||
$plugin = $this->get_plugin();
|
||||
if ($plugin) {
|
||||
$clone = $this->view->clone_view();
|
||||
$clone->set_display($this->display->id);
|
||||
$clone->build_title();
|
||||
$plugin->attach_to($display_id, $this->get_path(), $clone->get_title());
|
||||
$clone = $this->view->cloneView();
|
||||
$clone->setDisplay($this->display->id);
|
||||
$clone->buildTitle();
|
||||
$plugin->attach_to($display_id, $this->get_path(), $clone->getTitle());
|
||||
|
||||
// Clean up
|
||||
$clone->destroy();
|
||||
|
|
|
@ -81,7 +81,7 @@ class Page extends DisplayPluginBase {
|
|||
|
||||
$bits = explode('/', $this->get_option('path'));
|
||||
$page_arguments = array($this->view->name, $this->display->id);
|
||||
$this->view->init_handlers();
|
||||
$this->view->initHandlers();
|
||||
$view_arguments = $this->view->argument;
|
||||
|
||||
// Replace % with %views_arg for menu autoloading and add to the
|
||||
|
@ -247,7 +247,7 @@ class Page extends DisplayPluginBase {
|
|||
throw new AccessDeniedHttpException();
|
||||
}
|
||||
|
||||
$this->view->get_breadcrumb(TRUE);
|
||||
$this->view->getBreadcrumb(TRUE);
|
||||
|
||||
|
||||
// And now render the view.
|
||||
|
@ -255,7 +255,7 @@ class Page extends DisplayPluginBase {
|
|||
|
||||
// First execute the view so it's possible to get tokens for the title.
|
||||
// And the title, which is much easier.
|
||||
drupal_set_title(filter_xss_admin($this->view->get_title()), PASS_THROUGH);
|
||||
drupal_set_title(filter_xss_admin($this->view->getTitle()), PASS_THROUGH);
|
||||
return $render;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class Counter extends FieldPluginBase {
|
|||
$pager = $this->view->pager;
|
||||
// Get the base count of the pager.
|
||||
if ($pager->use_pager()) {
|
||||
$count += ($pager->get_items_per_page() * $pager->get_current_page() + $pager->get_offset());
|
||||
$count += ($pager->get_items_per_page() * $pager->get_current_page() + $pager->set_offset());
|
||||
}
|
||||
// Add the counter for the current site.
|
||||
$count += $this->view->row_index + 1;
|
||||
|
|
|
@ -34,7 +34,7 @@ class Combine extends String {
|
|||
|
||||
function options_form(&$form, &$form_state) {
|
||||
parent::options_form($form, $form_state);
|
||||
$this->view->init_style();
|
||||
$this->view->initStyle();
|
||||
|
||||
// Allow to choose all fields as possible
|
||||
if ($this->view->style_plugin->usesFields()) {
|
||||
|
|
|
@ -142,7 +142,7 @@ abstract class LocalizationPluginBase extends PluginBase {
|
|||
}
|
||||
|
||||
function process_locale_strings($op) {
|
||||
$this->view->init_display();
|
||||
$this->view->initDisplay();
|
||||
|
||||
foreach ($this->view->display as $display_id => $display) {
|
||||
$translatable = array();
|
||||
|
|
|
@ -1420,7 +1420,7 @@ class Sql extends QueryPluginBase {
|
|||
// Store the view in the object to be able to use it later.
|
||||
$this->view = $view;
|
||||
|
||||
$view->init_pager();
|
||||
$view->initPager();
|
||||
|
||||
// Let the pager modify the query to add limits.
|
||||
$view->pager->query();
|
||||
|
|
|
@ -39,7 +39,7 @@ class DefaultSummary extends StylePluginBase {
|
|||
|
||||
function query() {
|
||||
if (!empty($this->options['override'])) {
|
||||
$this->view->set_items_per_page(intval($this->options['items_per_page']));
|
||||
$this->view->setItemsPerPage(intval($this->options['items_per_page']));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,13 +35,13 @@ class Rss extends StylePluginBase {
|
|||
function attach_to($display_id, $path, $title) {
|
||||
$display = $this->view->display[$display_id]->handler;
|
||||
$url_options = array();
|
||||
$input = $this->view->get_exposed_input();
|
||||
$input = $this->view->getExposedInput();
|
||||
if ($input) {
|
||||
$url_options['query'] = $input;
|
||||
}
|
||||
$url_options['absolute'] = TRUE;
|
||||
|
||||
$url = url($this->view->get_url(NULL, $path), $url_options);
|
||||
$url = url($this->view->getUrl(NULL, $path), $url_options);
|
||||
if ($display->has_path()) {
|
||||
if (empty($this->preview)) {
|
||||
drupal_add_feed($url, $title);
|
||||
|
|
|
@ -152,7 +152,7 @@ class BasicTest extends ViewTestBase {
|
|||
$saved_view = clone $view;
|
||||
|
||||
// Execute with a view
|
||||
$view->set_arguments(array(27));
|
||||
$view->setArguments(array(27));
|
||||
$this->executeView($view);
|
||||
|
||||
// Build the expected result.
|
||||
|
|
|
@ -47,8 +47,8 @@ class GlossaryTest extends ViewTestBase {
|
|||
|
||||
// Execute glossary view
|
||||
$view = views_get_view('glossary');
|
||||
$view->set_display('attachment');
|
||||
$view->execute_display('attachment');
|
||||
$view->setDisplay('attachment');
|
||||
$view->executeDisplay('attachment');
|
||||
|
||||
// Check that the amount of nodes per char.
|
||||
$result_nodes_per_char = array();
|
||||
|
|
|
@ -37,7 +37,7 @@ class ArgumentStringTest extends HandlerTestBase {
|
|||
}
|
||||
|
||||
$view = $this->viewGlossary();
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
$this->executeView($view);
|
||||
|
||||
$count_field = 'nid';
|
||||
|
|
|
@ -44,7 +44,7 @@ class FieldTest extends HandlerTestBase {
|
|||
*/
|
||||
function _testHideIfEmpty() {
|
||||
$view = $this->getBasicView();
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
$this->executeView($view);
|
||||
|
||||
$column_map_reversed = array_flip($this->column_map);
|
||||
|
@ -262,7 +262,7 @@ class FieldTest extends HandlerTestBase {
|
|||
*/
|
||||
function _testEmptyText() {
|
||||
$view = $this->getBasicView();
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
$this->executeView($view);
|
||||
|
||||
$column_map_reversed = array_flip($this->column_map);
|
||||
|
@ -299,8 +299,8 @@ class FieldTest extends HandlerTestBase {
|
|||
*/
|
||||
function testIsValueEmpty() {
|
||||
$view = $this->getBasicView();
|
||||
$view->init_display();
|
||||
$view->init_handlers();
|
||||
$view->initDisplay();
|
||||
$view->initHandlers();
|
||||
$field = $view->field['name'];
|
||||
|
||||
$this->assertFalse($field->is_value_empty("not empty", TRUE), 'A normal string is not empty.');
|
||||
|
|
|
@ -42,12 +42,12 @@ class FilterDateTest extends HandlerTestBase {
|
|||
function testOffset() {
|
||||
$view = $this->views_test_offset();
|
||||
// Test offset for simple operator.
|
||||
$view->set_display('default');
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->initHandlers();
|
||||
$view->filter['created']->operator = '>';
|
||||
$view->filter['created']->value['type'] = 'offset';
|
||||
$view->filter['created']->value['value'] = '+1 hour';
|
||||
$view->execute_display('default');
|
||||
$view->executeDisplay('default');
|
||||
$expected_result = array(
|
||||
array('nid' => $this->nodes[3]->nid),
|
||||
);
|
||||
|
@ -55,13 +55,13 @@ class FilterDateTest extends HandlerTestBase {
|
|||
$view->destroy();
|
||||
|
||||
// Test offset for between operator.
|
||||
$view->set_display('default');
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->initHandlers();
|
||||
$view->filter['created']->operator = 'between';
|
||||
$view->filter['created']->value['type'] = 'offset';
|
||||
$view->filter['created']->value['max'] = '+2 days';
|
||||
$view->filter['created']->value['min'] = '+1 hour';
|
||||
$view->execute_display('default');
|
||||
$view->executeDisplay('default');
|
||||
$expected_result = array(
|
||||
array('nid' => $this->nodes[3]->nid),
|
||||
);
|
||||
|
@ -76,12 +76,12 @@ class FilterDateTest extends HandlerTestBase {
|
|||
function testBetween() {
|
||||
// Test between with min and max.
|
||||
$view = $this->views_test_between();
|
||||
$view->set_display('default');
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->initHandlers();
|
||||
$view->filter['created']->operator = 'between';
|
||||
$view->filter['created']->value['min'] = format_date(150000, 'custom', 'Y-m-d H:s');
|
||||
$view->filter['created']->value['max'] = format_date(250000, 'custom', 'Y-m-d H:s');
|
||||
$view->execute_display('default');
|
||||
$view->executeDisplay('default');
|
||||
$expected_result = array(
|
||||
array('nid' => $this->nodes[1]->nid),
|
||||
);
|
||||
|
@ -90,11 +90,11 @@ class FilterDateTest extends HandlerTestBase {
|
|||
|
||||
// Test between with just max.
|
||||
$view = $this->views_test_between();
|
||||
$view->set_display('default');
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->initHandlers();
|
||||
$view->filter['created']->operator = 'between';
|
||||
$view->filter['created']->value['max'] = format_date(250000, 'custom', 'Y-m-d H:s');
|
||||
$view->execute_display('default');
|
||||
$view->executeDisplay('default');
|
||||
$expected_result = array(
|
||||
array('nid' => $this->nodes[0]->nid),
|
||||
array('nid' => $this->nodes[1]->nid),
|
||||
|
@ -104,12 +104,12 @@ class FilterDateTest extends HandlerTestBase {
|
|||
|
||||
// Test not between with min and max.
|
||||
$view = $this->views_test_between();
|
||||
$view->set_display('default');
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->initHandlers();
|
||||
$view->filter['created']->operator = 'not between';
|
||||
$view->filter['created']->value['min'] = format_date(150000, 'custom', 'Y-m-d H:s');
|
||||
$view->filter['created']->value['max'] = format_date(250000, 'custom', 'Y-m-d H:s');
|
||||
$view->execute_display('default');
|
||||
$view->executeDisplay('default');
|
||||
$expected_result = array(
|
||||
array('nid' => $this->nodes[0]->nid),
|
||||
array('nid' => $this->nodes[2]->nid),
|
||||
|
@ -120,11 +120,11 @@ class FilterDateTest extends HandlerTestBase {
|
|||
|
||||
// Test not between with just max.
|
||||
$view = $this->views_test_between();
|
||||
$view->set_display('default');
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->initHandlers();
|
||||
$view->filter['created']->operator = 'not between';
|
||||
$view->filter['created']->value['max'] = format_date(150000, 'custom', 'Y-m-d H:s');
|
||||
$view->execute_display('default');
|
||||
$view->executeDisplay('default');
|
||||
$expected_result = array(
|
||||
array('nid' => $this->nodes[1]->nid),
|
||||
array('nid' => $this->nodes[2]->nid),
|
||||
|
|
|
@ -67,7 +67,7 @@ class FilterEqualityTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Name, Operator: =, Value: Ringo
|
||||
$filters['name']['group_info']['default_group'] = 1;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -118,7 +118,7 @@ class FilterEqualityTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Name, Operator: !=, Value: Ringo
|
||||
$filters['name']['group_info']['default_group'] = 2;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
|
|
@ -110,7 +110,7 @@ class FilterInOperatorTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Age, Operator: in, Value: 26, 30
|
||||
$filters['age']['group_info']['default_group'] = 1;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -139,7 +139,7 @@ class FilterInOperatorTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Age, Operator: in, Value: 26, 30
|
||||
$filters['age']['group_info']['default_group'] = 2;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
|
|
@ -72,7 +72,7 @@ class FilterNumericTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Age, Operator: =, Value: 28
|
||||
$filters['age']['group_info']['default_group'] = 1;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -163,7 +163,7 @@ class FilterNumericTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Age, Operator: between, Value: 26 and 29
|
||||
$filters['age']['group_info']['default_group'] = 2;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
|
||||
|
@ -191,7 +191,7 @@ class FilterNumericTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Age, Operator: between, Value: 26 and 29
|
||||
$filters['age']['group_info']['default_group'] = 3;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
|
||||
|
@ -280,7 +280,7 @@ class FilterNumericTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Age, Operator: empty, Value:
|
||||
$filters['age']['group_info']['default_group'] = 4;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
|
||||
|
@ -296,7 +296,7 @@ class FilterNumericTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Age, Operator: empty, Value:
|
||||
$filters['age']['group_info']['default_group'] = 5;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
|
||||
|
@ -345,8 +345,8 @@ class FilterNumericTest extends HandlerTestBase {
|
|||
),
|
||||
));
|
||||
|
||||
$view->set_display('default');
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->initHandlers();
|
||||
|
||||
$id_operators = $view->filter['id']->operators();
|
||||
$age_operators = $view->filter['age']->operators();
|
||||
|
|
|
@ -108,7 +108,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Name, Operator: =, Value: Ringo
|
||||
$filters['name']['group_info']['default_group'] = 1;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -162,7 +162,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
// Filter: Name, Operator: !=, Value: Ringo
|
||||
$filters['name']['group_info']['default_group'] = '2';
|
||||
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -216,7 +216,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Name, Operator: contains, Value: ing
|
||||
$filters['name']['group_info']['default_group'] = '3';
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -288,7 +288,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Name, Operator: contains, Value: ing
|
||||
$filters['name']['group_info']['default_group'] = '3';
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -307,7 +307,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Description, Operator: contains, Value: actor
|
||||
$filters['description']['group_info']['default_group'] = '1';
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -352,7 +352,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Name, Operator: starts, Value: George
|
||||
$filters['description']['group_info']['default_group'] = 2;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -402,7 +402,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Name, Operator: not_starts, Value: George
|
||||
$filters['description']['group_info']['default_group'] = 3;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -455,7 +455,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Descriptino, Operator: ends, Value: Beatles
|
||||
$filters['description']['group_info']['default_group'] = 4;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -505,7 +505,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Description, Operator: not_ends, Value: Beatles
|
||||
$filters['description']['group_info']['default_group'] = 5;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -557,7 +557,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Description, Operator: not (does not contains), Value: Beatles
|
||||
$filters['description']['group_info']['default_group'] = 6;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -608,7 +608,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Name, Operator: shorterthan, Value: 5
|
||||
$filters['name']['group_info']['default_group'] = 4;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -653,7 +653,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Name, Operator: longerthan, Value: 4
|
||||
$filters['name']['group_info']['default_group'] = 5;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
@ -695,7 +695,7 @@ class FilterStringTest extends HandlerTestBase {
|
|||
|
||||
// Filter: Description, Operator: empty, Value:
|
||||
$filters['description']['group_info']['default_group'] = 7;
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
$view->display['page_1']->handler->override_option('filters', $filters);
|
||||
|
||||
$this->executeView($view);
|
||||
|
|
|
@ -44,7 +44,7 @@ class AccessTest extends PluginTestBase {
|
|||
function testAccessNone() {
|
||||
$view = $this->view_access_none();
|
||||
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
|
||||
$this->assertTrue($view->display_handler->access($this->admin_user), t('Admin-Account should be able to access the view everytime'));
|
||||
$this->assertTrue($view->display_handler->access($this->web_user));
|
||||
|
@ -57,7 +57,7 @@ class AccessTest extends PluginTestBase {
|
|||
function testAccessPerm() {
|
||||
$view = $this->view_access_perm();
|
||||
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$access_plugin = $view->display_handler->get_plugin('access');
|
||||
|
||||
$this->assertTrue($view->display_handler->access($this->admin_user), t('Admin-Account should be able to access the view everytime'));
|
||||
|
@ -71,7 +71,7 @@ class AccessTest extends PluginTestBase {
|
|||
function testAccessRole() {
|
||||
$view = $this->view_access_role();
|
||||
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$access_plugin = $view->display_handler->get_plugin('access');
|
||||
|
||||
$this->assertTrue($view->display_handler->access($this->admin_user), t('Admin-Account should be able to access the view everytime'));
|
||||
|
@ -89,7 +89,7 @@ class AccessTest extends PluginTestBase {
|
|||
function testStaticAccessPlugin() {
|
||||
$view = $this->view_access_static();
|
||||
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$access_plugin = $view->display_handler->get_plugin('access');
|
||||
|
||||
$this->assertFalse($access_plugin->access($this->normal_user));
|
||||
|
@ -101,7 +101,7 @@ class AccessTest extends PluginTestBase {
|
|||
$expected_hook_menu = array(
|
||||
'views_test_test_static_access_callback', array(FALSE)
|
||||
);
|
||||
$hook_menu = $view->execute_hook_menu('page_1');
|
||||
$hook_menu = $view->executeHookMenu('page_1');
|
||||
$this->assertEqual($expected_hook_menu, $hook_menu['test_access_static']['access arguments'][0]);
|
||||
|
||||
$expected_hook_menu = array(
|
||||
|
@ -120,7 +120,7 @@ class AccessTest extends PluginTestBase {
|
|||
variable_set('test_dynamic_access_argument1', $argument1);
|
||||
variable_set('test_dynamic_access_argument2', $argument2);
|
||||
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$access_plugin = $view->display_handler->get_plugin('access');
|
||||
|
||||
$this->assertFalse($access_plugin->access($this->normal_user));
|
||||
|
@ -128,14 +128,14 @@ class AccessTest extends PluginTestBase {
|
|||
$access_plugin->options['access'] = TRUE;
|
||||
$this->assertFalse($access_plugin->access($this->normal_user));
|
||||
|
||||
$view->set_arguments(array($argument1, $argument2));
|
||||
$view->setArguments(array($argument1, $argument2));
|
||||
$this->assertTrue($access_plugin->access($this->normal_user));
|
||||
|
||||
// FALSE comes from hook_menu caching.
|
||||
$expected_hook_menu = array(
|
||||
'views_test_test_dynamic_access_callback', array(FALSE, 1, 2)
|
||||
);
|
||||
$hook_menu = $view->execute_hook_menu('page_1');
|
||||
$hook_menu = $view->executeHookMenu('page_1');
|
||||
$this->assertEqual($expected_hook_menu, $hook_menu['test_access_dynamic']['access arguments'][0]);
|
||||
|
||||
$expected_hook_menu = array(
|
||||
|
|
|
@ -67,9 +67,9 @@ class ArgumentDefaultTest extends PluginTestBase {
|
|||
function testArgumentDefaultFixed() {
|
||||
$view = $this->view_argument_default_fixed();
|
||||
|
||||
$view->set_display('default');
|
||||
$view->pre_execute();
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->preExecute();
|
||||
$view->initHandlers();
|
||||
|
||||
$this->assertEqual($view->argument['null']->get_default_argument(), $this->random, 'Fixed argument should be used by default.');
|
||||
|
||||
|
@ -78,9 +78,9 @@ class ArgumentDefaultTest extends PluginTestBase {
|
|||
// Make sure that a normal argument provided is used
|
||||
$view = $this->view_argument_default_fixed();
|
||||
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$random_string = $this->randomString();
|
||||
$view->execute_display('default', array($random_string));
|
||||
$view->executeDisplay('default', array($random_string));
|
||||
|
||||
$this->assertEqual($view->args[0], $random_string, 'Provided argument should be used.');
|
||||
}
|
||||
|
@ -100,9 +100,7 @@ class ArgumentDefaultTest extends PluginTestBase {
|
|||
$view->name = 'test_argument_default_fixed';
|
||||
$view->description = '';
|
||||
$view->tag = '';
|
||||
$view->view_php = '';
|
||||
$view->base_table = 'node';
|
||||
$view->is_cacheable = FALSE;
|
||||
$view->api_version = '3.0';
|
||||
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@ class ArgumentValidatorTest extends PluginTestBase {
|
|||
function testArgumentValidatePhp() {
|
||||
$string = $this->randomName();
|
||||
$view = $this->view_test_argument_validate_php($string);
|
||||
$view->set_display('default');
|
||||
$view->pre_execute();
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->preExecute();
|
||||
$view->initHandlers();
|
||||
$this->assertTrue($view->argument['null']->validate_arg($string));
|
||||
// Reset safed argument validation.
|
||||
$view->argument['null']->argument_validated = NULL;
|
||||
|
@ -36,9 +36,9 @@ class ArgumentValidatorTest extends PluginTestBase {
|
|||
|
||||
function testArgumentValidateNumeric() {
|
||||
$view = $this->view_argument_validate_numeric();
|
||||
$view->set_display('default');
|
||||
$view->pre_execute();
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->preExecute();
|
||||
$view->initHandlers();
|
||||
$this->assertFalse($view->argument['null']->validate_arg($this->randomString()));
|
||||
// Reset safed argument validation.
|
||||
$view->argument['null']->argument_validated = NULL;
|
||||
|
|
|
@ -87,7 +87,7 @@ class CacheTest extends PluginTestBase {
|
|||
function testTimeCaching() {
|
||||
// Create a basic result which just 2 results.
|
||||
$view = $this->getBasicView();
|
||||
$view->set_display();
|
||||
$view->setDisplay();
|
||||
$view->display_handler->override_option('cache', array(
|
||||
'type' => 'time',
|
||||
'results_lifespan' => '3600',
|
||||
|
@ -108,7 +108,7 @@ class CacheTest extends PluginTestBase {
|
|||
|
||||
// The Result should be the same as before, because of the caching.
|
||||
$view = $this->getBasicView();
|
||||
$view->set_display();
|
||||
$view->setDisplay();
|
||||
$view->display_handler->override_option('cache', array(
|
||||
'type' => 'time',
|
||||
'results_lifespan' => '3600',
|
||||
|
@ -128,7 +128,7 @@ class CacheTest extends PluginTestBase {
|
|||
function testNoneCaching() {
|
||||
// Create a basic result which just 2 results.
|
||||
$view = $this->getBasicView();
|
||||
$view->set_display();
|
||||
$view->setDisplay();
|
||||
$view->display_handler->override_option('cache', array(
|
||||
'type' => 'none',
|
||||
));
|
||||
|
@ -148,7 +148,7 @@ class CacheTest extends PluginTestBase {
|
|||
|
||||
// The Result changes, because the view is not cached.
|
||||
$view = $this->getBasicView();
|
||||
$view->set_display();
|
||||
$view->setDisplay();
|
||||
$view->display_handler->override_option('cache', array(
|
||||
'type' => 'none',
|
||||
));
|
||||
|
@ -166,7 +166,7 @@ class CacheTest extends PluginTestBase {
|
|||
// Some hook_views_pre_render in views_test.module adds the test css/js file.
|
||||
// so they should be added to the css/js storage.
|
||||
$view = $this->getBasicView();
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
$view->name = 'test_cache_header_storage';
|
||||
$view->display_handler->override_option('cache', array(
|
||||
'type' => 'time',
|
||||
|
@ -179,7 +179,7 @@ class CacheTest extends PluginTestBase {
|
|||
drupal_static_reset('drupal_add_css');
|
||||
drupal_static_reset('drupal_add_js');
|
||||
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
$view->preview();
|
||||
$css = drupal_add_css();
|
||||
$css_path = drupal_get_path('module', 'views_test') . '/views_cache.test.css';
|
||||
|
@ -200,13 +200,13 @@ class CacheTest extends PluginTestBase {
|
|||
$system_js_path = drupal_get_path('module', 'system') . '/system.cron.js';
|
||||
drupal_add_js($system_js_path);
|
||||
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
$view->preview();
|
||||
$view->destroy();
|
||||
drupal_static_reset('drupal_add_css');
|
||||
drupal_static_reset('drupal_add_js');
|
||||
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
$view->preview();
|
||||
|
||||
$css = drupal_add_css();
|
||||
|
|
|
@ -27,7 +27,7 @@ class DisplayTest extends PluginTestBase {
|
|||
*/
|
||||
function testFilterGroupsOverriding() {
|
||||
$view = $this->viewFilterGroupsUpdating();
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
|
||||
// mark is as overridden, yes FALSE, means overridden.
|
||||
$view->display['page']->handler->set_override('filter_groups', FALSE);
|
||||
|
|
|
@ -43,7 +43,7 @@ class ExposedFormTest extends PluginTestBase {
|
|||
$this->drupalGet('test_rename_reset_button');
|
||||
// Rename the label of the reset button.
|
||||
$view = views_get_view('test_rename_reset_button');
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
|
||||
$exposed_form = $view->display_handler->get_option('exposed_form');
|
||||
$exposed_form['options']['reset_button_label'] = $expected_label = $this->randomName();
|
||||
|
|
|
@ -127,7 +127,7 @@ class PagerTest extends PluginTestBase {
|
|||
$this->drupalCreateNode();
|
||||
}
|
||||
$view = $this->viewsPagerNoLimit();
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$this->executeView($view);
|
||||
$this->assertEqual(count($view->result), 11, 'Make sure that every item is returned in the result');
|
||||
|
||||
|
@ -135,7 +135,7 @@ class PagerTest extends PluginTestBase {
|
|||
|
||||
// Setup and test a offset.
|
||||
$view = $this->viewsPagerNoLimit();
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
|
||||
$pager = array(
|
||||
'type' => 'none',
|
||||
|
@ -181,7 +181,7 @@ class PagerTest extends PluginTestBase {
|
|||
|
||||
$view = $this->viewsPagerNoLimit();
|
||||
$view->get_total_rows = TRUE;
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$this->executeView($view);
|
||||
|
||||
$this->assertEqual($view->total_rows, 23, "'total_rows' is calculated when pager type is 'none' and 'get_total_rows' is TRUE.");
|
||||
|
@ -205,14 +205,14 @@ class PagerTest extends PluginTestBase {
|
|||
$this->drupalCreateNode();
|
||||
}
|
||||
$view = $this->viewsPagerLimit();
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$this->executeView($view);
|
||||
$this->assertEqual(count($view->result), 5, 'Make sure that only a certain count of items is returned');
|
||||
$view->destroy();
|
||||
|
||||
// Setup and test a offset.
|
||||
$view = $this->viewsPagerLimit();
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
|
||||
$pager = array(
|
||||
'type' => 'none',
|
||||
|
@ -264,14 +264,14 @@ class PagerTest extends PluginTestBase {
|
|||
$this->drupalCreateNode();
|
||||
}
|
||||
$view = $this->viewsPagerFull();
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$this->executeView($view);
|
||||
$this->assertEqual(count($view->result), 5, 'Make sure that only a certain count of items is returned');
|
||||
$view->destroy();
|
||||
|
||||
// Setup and test a offset.
|
||||
$view = $this->viewsPagerFull();
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
|
||||
$pager = array(
|
||||
'type' => 'full',
|
||||
|
@ -286,7 +286,7 @@ class PagerTest extends PluginTestBase {
|
|||
|
||||
// Test items per page = 0
|
||||
$view = $this->viewPagerFullZeroItemsPerPage();
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$this->executeView($view);
|
||||
|
||||
$this->assertEqual(count($view->result), 11, 'All items are return');
|
||||
|
@ -298,7 +298,7 @@ class PagerTest extends PluginTestBase {
|
|||
|
||||
// Setup and test a offset.
|
||||
$view = $this->viewsPagerFull();
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
|
||||
$pager = array(
|
||||
'type' => 'full',
|
||||
|
@ -435,7 +435,7 @@ class PagerTest extends PluginTestBase {
|
|||
$this->drupalCreateNode();
|
||||
}
|
||||
$view = $this->viewsPagerFullFields();
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$this->executeView($view);
|
||||
$view->use_ajax = TRUE; // force the value again here
|
||||
$view->pager = NULL;
|
||||
|
@ -450,48 +450,48 @@ class PagerTest extends PluginTestBase {
|
|||
$view = $this->viewsPagerFull();
|
||||
// On the first round don't initialize the pager.
|
||||
|
||||
$this->assertEqual($view->get_items_per_page(), NULL, 'If the pager is not initialized and no manual override there is no items per page.');
|
||||
$this->assertEqual($view->getItemsPerPage(), NULL, 'If the pager is not initialized and no manual override there is no items per page.');
|
||||
$rand_number = rand(1, 5);
|
||||
$view->set_items_per_page($rand_number);
|
||||
$this->assertEqual($view->get_items_per_page(), $rand_number, 'Make sure get_items_per_page uses the settings of set_items_per_page.');
|
||||
$view->setItemsPerPage($rand_number);
|
||||
$this->assertEqual($view->getItemsPerPage(), $rand_number, 'Make sure get_items_per_page uses the settings of set_items_per_page.');
|
||||
|
||||
$this->assertEqual($view->get_offset(), NULL, 'If the pager is not initialized and no manual override there is no offset.');
|
||||
$this->assertEqual($view->getOffset(), NULL, 'If the pager is not initialized and no manual override there is no offset.');
|
||||
$rand_number = rand(1, 5);
|
||||
$view->set_offset($rand_number);
|
||||
$this->assertEqual($view->get_offset(), $rand_number, 'Make sure get_offset uses the settings of set_offset.');
|
||||
$view->setOffset($rand_number);
|
||||
$this->assertEqual($view->getOffset(), $rand_number, 'Make sure get_offset uses the settings of set_offset.');
|
||||
|
||||
$this->assertEqual($view->get_current_page(), NULL, 'If the pager is not initialized and no manual override there is no current page.');
|
||||
$this->assertEqual($view->getCurrentPage(), NULL, 'If the pager is not initialized and no manual override there is no current page.');
|
||||
$rand_number = rand(1, 5);
|
||||
$view->set_current_page($rand_number);
|
||||
$this->assertEqual($view->get_current_page(), $rand_number, 'Make sure get_current_page uses the settings of set_current_page.');
|
||||
$view->setCurrentPage($rand_number);
|
||||
$this->assertEqual($view->getCurrentPage(), $rand_number, 'Make sure get_current_page uses the settings of set_current_page.');
|
||||
|
||||
$view->destroy();
|
||||
|
||||
// On this round enable the pager.
|
||||
$view->init_display();
|
||||
$view->init_query();
|
||||
$view->init_pager();
|
||||
$view->initDisplay();
|
||||
$view->initQuery();
|
||||
$view->initPager();
|
||||
|
||||
$this->assertEqual($view->get_items_per_page(), 5, 'Per default the view has 5 items per page.');
|
||||
$this->assertEqual($view->getItemsPerPage(), 5, 'Per default the view has 5 items per page.');
|
||||
$rand_number = rand(1, 5);
|
||||
$view->set_items_per_page($rand_number);
|
||||
$view->setItemsPerPage($rand_number);
|
||||
$rand_number = rand(6, 11);
|
||||
$view->pager->set_items_per_page($rand_number);
|
||||
$this->assertEqual($view->get_items_per_page(), $rand_number, 'Make sure get_items_per_page uses the settings of set_items_per_page.');
|
||||
$this->assertEqual($view->getItemsPerPage(), $rand_number, 'Make sure get_items_per_page uses the settings of set_items_per_page.');
|
||||
|
||||
$this->assertEqual($view->get_offset(), 0, 'Per default a view has a 0 offset.');
|
||||
$this->assertEqual($view->getOffset(), 0, 'Per default a view has a 0 offset.');
|
||||
$rand_number = rand(1, 5);
|
||||
$view->set_offset($rand_number);
|
||||
$view->setOffset($rand_number);
|
||||
$rand_number = rand(6, 11);
|
||||
$view->pager->set_offset($rand_number);
|
||||
$this->assertEqual($view->get_offset(), $rand_number, 'Make sure get_offset uses the settings of set_offset.');
|
||||
$this->assertEqual($view->getOffset(), $rand_number, 'Make sure get_offset uses the settings of set_offset.');
|
||||
|
||||
$this->assertEqual($view->get_current_page(), 0, 'Per default the current page is 0.');
|
||||
$this->assertEqual($view->getCurrentPage(), 0, 'Per default the current page is 0.');
|
||||
$rand_number = rand(1, 5);
|
||||
$view->set_current_page($rand_number);
|
||||
$view->setCurrentPage($rand_number);
|
||||
$rand_number = rand(6, 11);
|
||||
$view->pager->set_current_page($rand_number);
|
||||
$this->assertEqual($view->get_current_page(), $rand_number, 'Make sure get_current_page uses the settings of set_current_page.');
|
||||
$this->assertEqual($view->getCurrentPage(), $rand_number, 'Make sure get_current_page uses the settings of set_current_page.');
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@ class StyleTest extends PluginTestBase {
|
|||
function testGroupingLegacy() {
|
||||
$view = $this->getBasicView();
|
||||
// Setup grouping by the job.
|
||||
$view->init_display();
|
||||
$view->init_style();
|
||||
$view->initDisplay();
|
||||
$view->initStyle();
|
||||
$view->style_plugin->options['grouping'] = 'job';
|
||||
|
||||
// Reduce the amount of items to make the test a bit easier.
|
||||
|
@ -131,8 +131,8 @@ class StyleTest extends PluginTestBase {
|
|||
function _testGrouping($stripped = FALSE) {
|
||||
$view = $this->getBasicView();
|
||||
// Setup grouping by the job and the age field.
|
||||
$view->init_display();
|
||||
$view->init_style();
|
||||
$view->initDisplay();
|
||||
$view->initStyle();
|
||||
$view->style_plugin->options['grouping'] = array(
|
||||
array('field' => 'job'),
|
||||
array('field' => 'age'),
|
||||
|
@ -265,8 +265,8 @@ class StyleTest extends PluginTestBase {
|
|||
$view = $this->getBasicView();
|
||||
|
||||
// Setup some random css class.
|
||||
$view->init_display();
|
||||
$view->init_style();
|
||||
$view->initDisplay();
|
||||
$view->initStyle();
|
||||
$random_name = $this->randomName();
|
||||
$view->style_plugin->options['row_class'] = $random_name . " test-token-[name]";
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ class QueryGroupByTest extends ViewTestBase {
|
|||
$this->drupalCreateNode($node_2);
|
||||
|
||||
$view = $this->viewsAggregateCountView();
|
||||
$output = $view->execute_display();
|
||||
$output = $view->executeDisplay();
|
||||
|
||||
$this->assertEqual(count($view->result), 2, 'Make sure the count of items is right.');
|
||||
|
||||
|
@ -138,7 +138,7 @@ class QueryGroupByTest extends ViewTestBase {
|
|||
$this->drupalCreateNode($node_2);
|
||||
|
||||
$view = $this->viewsGroupByViewHelper($group_by);
|
||||
$output = $view->execute_display();
|
||||
$output = $view->executeDisplay();
|
||||
|
||||
$this->assertEqual(count($view->result), 2, 'Make sure the count of items is right.');
|
||||
// Group by nodetype to identify the right count.
|
||||
|
@ -237,7 +237,7 @@ class QueryGroupByTest extends ViewTestBase {
|
|||
}
|
||||
|
||||
$view = $this->viewsGroupByCountViewOnlyFilters();
|
||||
$output = $view->execute_display();
|
||||
$output = $view->executeDisplay();
|
||||
|
||||
$this->assertTrue(strpos($view->build_info['query'], 'GROUP BY'), t('Make sure that GROUP BY is in the query'));
|
||||
$this->assertTrue(strpos($view->build_info['query'], 'HAVING'), t('Make sure that HAVING is in the query'));
|
||||
|
|
|
@ -57,11 +57,11 @@ class TranslatableTest extends ViewTestBase {
|
|||
*/
|
||||
public function testUnpackTranslatable() {
|
||||
$view = $this->view_unpack_translatable();
|
||||
$view->init_localization();
|
||||
$view->initLocalization();
|
||||
|
||||
$this->assertEqual('Drupal\views_test\Plugin\views\localization\LocalizationTest', get_class($view->localization_plugin), 'Make sure that init_localization initializes the right translation plugin');
|
||||
|
||||
$view->export_locale_strings();
|
||||
$view->exportLocaleStrings();
|
||||
|
||||
$expected_strings = $this->strings;
|
||||
$result_strings = $view->localization_plugin->get_export_strings();
|
||||
|
@ -86,7 +86,7 @@ class TranslatableTest extends ViewTestBase {
|
|||
*/
|
||||
public function testTranslation() {
|
||||
$view = $this->view_unpack_translatable();
|
||||
$view->set_display('default');
|
||||
$view->setDisplay('default');
|
||||
$this->executeView($view);
|
||||
|
||||
$expected_strings = array();
|
||||
|
@ -108,7 +108,7 @@ class TranslatableTest extends ViewTestBase {
|
|||
public function testTranslationKey() {
|
||||
$view = $this->view_unpack_translatable();
|
||||
$view->editing = TRUE;
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
|
||||
// Don't run translation. We just want to get the right keys.
|
||||
|
||||
|
|
|
@ -35,9 +35,9 @@ class ArgumentDefaultTest extends UserTestBase {
|
|||
|
||||
$view = $this->view_plugin_argument_default_current_user();
|
||||
|
||||
$view->set_display('default');
|
||||
$view->pre_execute();
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->preExecute();
|
||||
$view->initHandlers();
|
||||
|
||||
$this->assertEqual($view->argument['null']->get_default_argument(), $account->uid, 'Uid of the current user is used.');
|
||||
// Switch back.
|
||||
|
|
|
@ -32,9 +32,9 @@ class ArgumentValidateTest extends UserTestBase {
|
|||
$account = $this->account;
|
||||
// test 'uid' case
|
||||
$view = $this->view_argument_validate_user('uid');
|
||||
$view->set_display('default');
|
||||
$view->pre_execute();
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->preExecute();
|
||||
$view->initHandlers();
|
||||
$this->assertTrue($view->argument['null']->validate_arg($account->uid));
|
||||
// Reset safed argument validation.
|
||||
$view->argument['null']->argument_validated = NULL;
|
||||
|
@ -50,9 +50,9 @@ class ArgumentValidateTest extends UserTestBase {
|
|||
$account = $this->account;
|
||||
// test 'name' case
|
||||
$view = $this->view_argument_validate_user('name');
|
||||
$view->set_display('default');
|
||||
$view->pre_execute();
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->preExecute();
|
||||
$view->initHandlers();
|
||||
$this->assertTrue($view->argument['null']->validate_arg($account->name));
|
||||
// Reset safed argument validation.
|
||||
$view->argument['null']->argument_validated = NULL;
|
||||
|
@ -68,9 +68,9 @@ class ArgumentValidateTest extends UserTestBase {
|
|||
$account = $this->account;
|
||||
// test 'either' case
|
||||
$view = $this->view_argument_validate_user('either');
|
||||
$view->set_display('default');
|
||||
$view->pre_execute();
|
||||
$view->init_handlers();
|
||||
$view->setDisplay('default');
|
||||
$view->preExecute();
|
||||
$view->initHandlers();
|
||||
$this->assertTrue($view->argument['null']->validate_arg($account->name));
|
||||
// Reset safed argument validation.
|
||||
$view->argument['null']->argument_validated = NULL;
|
||||
|
|
|
@ -26,7 +26,7 @@ class HandlerFieldUserNameTest extends UserTestBase {
|
|||
|
||||
function testUserName() {
|
||||
$view = $this->view_user_name();
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
$this->executeView($view);
|
||||
|
||||
$view->row_index = 0;
|
||||
|
|
|
@ -54,7 +54,7 @@ class UserTest extends UserTestBase {
|
|||
public function testRelationship() {
|
||||
$view = $this->test_view_user_relationship();
|
||||
|
||||
$view->execute_display();
|
||||
$view->executeDisplay();
|
||||
$expected = array();
|
||||
for ($i = 0; $i <= 1; $i++) {
|
||||
$expected[$i] = array(
|
||||
|
|
|
@ -234,7 +234,7 @@ class ViewStorageTest extends WebTestBase {
|
|||
|
||||
// Ensure the right display_plugin is created/instantiated.
|
||||
$this->assertEqual($new_display->display_plugin, 'page', 'New page display "test" uses the right display plugin.');
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
$this->assertTrue($new_display->handler instanceof Page, 'New page display "test" uses the right display plugin.');
|
||||
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ class ViewTest extends ViewTestBase {
|
|||
// Validating a view shouldn't change the active display.
|
||||
// @todo: Create an extra validation view.
|
||||
$view = $this->view_test_destroy();
|
||||
$view->set_display('page_1');
|
||||
$view->setDisplay('page_1');
|
||||
|
||||
$view->validate();
|
||||
|
||||
|
|
|
@ -162,8 +162,8 @@ abstract class ViewTestBase extends WebTestBase {
|
|||
* @param array $args
|
||||
*/
|
||||
protected function executeView($view, $args = array()) {
|
||||
$view->set_display();
|
||||
$view->pre_execute($args);
|
||||
$view->setDisplay();
|
||||
$view->preExecute($args);
|
||||
$view->execute();
|
||||
$this->verbose('<pre>Executed view: ' . ((string) $view->build_info['query']) . '</pre>');
|
||||
}
|
||||
|
|
|
@ -273,7 +273,7 @@ class View extends ViewStorage {
|
|||
* this attempts to do some automatic updates that must happen
|
||||
* to ensure older views will at least try to work.
|
||||
*/
|
||||
function update() {
|
||||
public function update() {
|
||||
// When views are converted automatically the base_table should be renamed
|
||||
// to have a working query.
|
||||
$this->base_table = views_move_table($this->base_table);
|
||||
|
@ -284,7 +284,7 @@ class View extends ViewStorage {
|
|||
* Returns a list of the sub-object types used by this view. These types are
|
||||
* stored on the display, and are used in the build process.
|
||||
*/
|
||||
function display_objects() {
|
||||
public function displayObjects() {
|
||||
return array('argument', 'field', 'sort', 'filter', 'relationship', 'header', 'footer', 'empty');
|
||||
}
|
||||
|
||||
|
@ -292,14 +292,14 @@ class View extends ViewStorage {
|
|||
* Set the arguments that come to this view. Usually from the URL
|
||||
* but possibly from elsewhere.
|
||||
*/
|
||||
function set_arguments($args) {
|
||||
public function setArguments($args) {
|
||||
$this->args = $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change/Set the current page for the pager.
|
||||
*/
|
||||
function set_current_page($page) {
|
||||
public function setCurrentPage($page) {
|
||||
$this->current_page = $page;
|
||||
|
||||
// If the pager is already initialized, pass it through to the pager.
|
||||
|
@ -311,7 +311,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Get the current page from the pager.
|
||||
*/
|
||||
function get_current_page() {
|
||||
public function getCurrentPage() {
|
||||
// If the pager is already initialized, pass it through to the pager.
|
||||
if (!empty($this->pager)) {
|
||||
return $this->pager->get_current_page();
|
||||
|
@ -325,7 +325,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Get the items per page from the pager.
|
||||
*/
|
||||
function get_items_per_page() {
|
||||
public function getItemsPerPage() {
|
||||
// If the pager is already initialized, pass it through to the pager.
|
||||
if (!empty($this->pager)) {
|
||||
return $this->pager->get_items_per_page();
|
||||
|
@ -339,7 +339,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Set the items per page on the pager.
|
||||
*/
|
||||
function set_items_per_page($items_per_page) {
|
||||
public function setItemsPerPage($items_per_page) {
|
||||
$this->items_per_page = $items_per_page;
|
||||
|
||||
// If the pager is already initialized, pass it through to the pager.
|
||||
|
@ -351,7 +351,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Get the pager offset from the pager.
|
||||
*/
|
||||
function get_offset() {
|
||||
public function getOffset() {
|
||||
// If the pager is already initialized, pass it through to the pager.
|
||||
if (!empty($this->pager)) {
|
||||
return $this->pager->get_offset();
|
||||
|
@ -365,7 +365,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Set the offset on the pager.
|
||||
*/
|
||||
function set_offset($offset) {
|
||||
public function setOffset($offset) {
|
||||
$this->offset = $offset;
|
||||
|
||||
// If the pager is already initialized, pass it through to the pager.
|
||||
|
@ -377,7 +377,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Determine if the pager actually uses a pager.
|
||||
*/
|
||||
function use_pager() {
|
||||
public function usePager() {
|
||||
if (!empty($this->pager)) {
|
||||
return $this->pager->use_pager();
|
||||
}
|
||||
|
@ -388,7 +388,7 @@ class View extends ViewStorage {
|
|||
* tablesorting and exposed filters will be fetched via an AJAX call
|
||||
* rather than a page refresh.
|
||||
*/
|
||||
function set_use_ajax($use_ajax) {
|
||||
public function setUseAJAX($use_ajax) {
|
||||
$this->use_ajax = $use_ajax;
|
||||
}
|
||||
|
||||
|
@ -396,14 +396,14 @@ class View extends ViewStorage {
|
|||
* Set the exposed filters input to an array. If unset they will be taken
|
||||
* from $_GET when the time comes.
|
||||
*/
|
||||
function set_exposed_input($filters) {
|
||||
public function setExposedInput($filters) {
|
||||
$this->exposed_input = $filters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Figure out what the exposed input for this view is.
|
||||
*/
|
||||
function get_exposed_input() {
|
||||
public function getExposedInput() {
|
||||
// Fill our input either from $_GET or from something previously set on the
|
||||
// view.
|
||||
if (empty($this->exposed_input)) {
|
||||
|
@ -434,7 +434,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Set the display for this view and initialize the display handler.
|
||||
*/
|
||||
function init_display($reset = FALSE) {
|
||||
public function initDisplay($reset = FALSE) {
|
||||
// The default display is always the first one in the list.
|
||||
if (isset($this->current_display)) {
|
||||
return TRUE;
|
||||
|
@ -479,12 +479,12 @@ class View extends ViewStorage {
|
|||
* @param $displays
|
||||
* Either a single display id or an array of display ids.
|
||||
*/
|
||||
function choose_display($displays) {
|
||||
public function chooseDisplay($displays) {
|
||||
if (!is_array($displays)) {
|
||||
return $displays;
|
||||
}
|
||||
|
||||
$this->init_display();
|
||||
$this->initDisplay();
|
||||
|
||||
foreach ($displays as $display_id) {
|
||||
if ($this->display[$display_id]->handler->access()) {
|
||||
|
@ -501,10 +501,10 @@ class View extends ViewStorage {
|
|||
* @param $display_id
|
||||
* The id of the display to mark as current.
|
||||
*/
|
||||
function set_display($display_id = NULL) {
|
||||
public function setDisplay($display_id = NULL) {
|
||||
// If we have not already initialized the display, do so. But be careful.
|
||||
if (empty($this->current_display)) {
|
||||
$this->init_display();
|
||||
$this->initDisplay();
|
||||
|
||||
// If handlers were not initialized, and no argument was sent, set up
|
||||
// to the default display.
|
||||
|
@ -513,7 +513,7 @@ class View extends ViewStorage {
|
|||
}
|
||||
}
|
||||
|
||||
$display_id = $this->choose_display($display_id);
|
||||
$display_id = $this->chooseDisplay($display_id);
|
||||
|
||||
// If no display id sent in and one wasn't chosen above, we're finished.
|
||||
if (empty($display_id)) {
|
||||
|
@ -549,7 +549,7 @@ class View extends ViewStorage {
|
|||
* Note that arguments may have changed which style plugin we use, so
|
||||
* check the view object first, then ask the display handler.
|
||||
*/
|
||||
function init_style() {
|
||||
public function initStyle() {
|
||||
if (isset($this->style_plugin)) {
|
||||
return is_object($this->style_plugin);
|
||||
}
|
||||
|
@ -576,7 +576,7 @@ class View extends ViewStorage {
|
|||
* This will try to add relationships automatically if it can, and will
|
||||
* remove the handlers if it cannot.
|
||||
*/
|
||||
function fix_missing_relationships() {
|
||||
public function fixMissingRelationships() {
|
||||
if (isset($this->relationships_fixed)) {
|
||||
return;
|
||||
}
|
||||
|
@ -604,7 +604,7 @@ class View extends ViewStorage {
|
|||
$base_tables = array_keys($base_tables);
|
||||
$missing_base_tables = array();
|
||||
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
foreach ($types as $key => $info) {
|
||||
foreach ($this->display_handler->get_option($info['plural']) as $id => $options) {
|
||||
$options['table'] = views_move_table($options['table']);
|
||||
|
@ -660,11 +660,11 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Acquire and attach all of the handlers.
|
||||
*/
|
||||
function init_handlers() {
|
||||
public function initHandlers() {
|
||||
if (empty($this->inited)) {
|
||||
$this->fix_missing_relationships();
|
||||
foreach (View::views_object_types() as $key => $info) {
|
||||
$this->_init_handler($key, $info);
|
||||
$this->fixMissingRelationships();
|
||||
foreach (View::viewsObjectTypes() as $key => $info) {
|
||||
$this->_initHandler($key, $info);
|
||||
}
|
||||
$this->inited = TRUE;
|
||||
}
|
||||
|
@ -676,7 +676,7 @@ class View extends ViewStorage {
|
|||
* Like style initialization, pager initialization is held until late
|
||||
* to allow for overrides.
|
||||
*/
|
||||
function init_pager() {
|
||||
public function initPager() {
|
||||
if (!isset($this->pager)) {
|
||||
$this->pager = $this->display_handler->get_plugin('pager');
|
||||
|
||||
|
@ -687,7 +687,7 @@ class View extends ViewStorage {
|
|||
// These overrides may have been set earlier via $view->set_*
|
||||
// functions.
|
||||
if (isset($this->items_per_page)) {
|
||||
$this->pager->set_items_per_page($this->items_per_page);
|
||||
$this->pager->setItemsPerPage($this->items_per_page);
|
||||
}
|
||||
|
||||
if (isset($this->offset)) {
|
||||
|
@ -699,7 +699,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Render the pager, if necessary.
|
||||
*/
|
||||
public function render_pager($exposed_input) {
|
||||
public function renderPager($exposed_input) {
|
||||
if (!empty($this->pager) && $this->pager->use_pager()) {
|
||||
return $this->pager->render($exposed_input);
|
||||
}
|
||||
|
@ -711,7 +711,7 @@ class View extends ViewStorage {
|
|||
* Create a list of base tables eligible for this view. Used primarily
|
||||
* for the UI. Display must be already initialized.
|
||||
*/
|
||||
function get_base_tables() {
|
||||
public function getBaseTables() {
|
||||
$base_tables = array(
|
||||
$this->base_table => TRUE,
|
||||
'#global' => TRUE,
|
||||
|
@ -726,8 +726,8 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Run the pre_query() on all active handlers.
|
||||
*/
|
||||
function _pre_query() {
|
||||
foreach (View::views_object_types() as $key => $info) {
|
||||
protected function _preQuery() {
|
||||
foreach (View::viewsObjectTypes() as $key => $info) {
|
||||
$handlers = &$this->$key;
|
||||
$position = 0;
|
||||
foreach ($handlers as $id => $handler) {
|
||||
|
@ -741,8 +741,8 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Run the post_execute() on all active handlers.
|
||||
*/
|
||||
function _post_execute() {
|
||||
foreach (View::views_object_types() as $key => $info) {
|
||||
protected function _postExecute() {
|
||||
foreach (View::viewsObjectTypes() as $key => $info) {
|
||||
$handlers = &$this->$key;
|
||||
foreach ($handlers as $id => $handler) {
|
||||
$handlers[$id]->post_execute($this->result);
|
||||
|
@ -756,9 +756,9 @@ class View extends ViewStorage {
|
|||
* @param $key
|
||||
* One of 'argument', 'field', 'sort', 'filter', 'relationship'
|
||||
* @param $info
|
||||
* The $info from views_object_types for this object.
|
||||
* The $info from viewsObjectTypes for this object.
|
||||
*/
|
||||
function _init_handler($key, $info) {
|
||||
protected function _initHandler($key, $info) {
|
||||
// Load the requested items from the display onto the object.
|
||||
$this->$key = $this->display_handler->get_handlers($key);
|
||||
|
||||
|
@ -776,7 +776,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Build all the arguments.
|
||||
*/
|
||||
function _build_arguments() {
|
||||
protected function _buildArguments() {
|
||||
// Initially, we want to build sorts and fields. This can change, though,
|
||||
// if we get a summary view.
|
||||
if (empty($this->argument)) {
|
||||
|
@ -841,7 +841,7 @@ class View extends ViewStorage {
|
|||
// Since we're really generating the breadcrumb for the item above us,
|
||||
// check the default action of this argument.
|
||||
if ($this->display_handler->uses_breadcrumb() && $argument->uses_breadcrumb()) {
|
||||
$path = $this->get_url($breadcrumb_args);
|
||||
$path = $this->getUrl($breadcrumb_args);
|
||||
if (strpos($path, '%') === FALSE) {
|
||||
if (!empty($argument->options['breadcrumb_enable']) && !empty($argument->options['breadcrumb'])) {
|
||||
$breadcrumb = $argument->options['breadcrumb'];
|
||||
|
@ -887,7 +887,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Do some common building initialization.
|
||||
*/
|
||||
function init_query() {
|
||||
public function initQuery() {
|
||||
if (!empty($this->query)) {
|
||||
$class = get_class($this->query);
|
||||
if ($class && $class != 'stdClass') {
|
||||
|
@ -922,13 +922,13 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Build the query for the view.
|
||||
*/
|
||||
function build($display_id = NULL) {
|
||||
public function build($display_id = NULL) {
|
||||
if (!empty($this->built)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($this->current_display) || $display_id) {
|
||||
if (!$this->set_display($display_id)) {
|
||||
if (!$this->setDisplay($display_id)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -950,7 +950,7 @@ class View extends ViewStorage {
|
|||
'query_args' => array(),
|
||||
);
|
||||
|
||||
$this->init_query();
|
||||
$this->initQuery();
|
||||
|
||||
// Call a module hook and see if it wants to present us with a
|
||||
// pre-built query or instruct us not to build the query for
|
||||
|
@ -958,10 +958,10 @@ class View extends ViewStorage {
|
|||
// @todo: Implement this. Use the same mechanism Panels uses.
|
||||
|
||||
// Run through our handlers and ensure they have necessary information.
|
||||
$this->init_handlers();
|
||||
$this->initHandlers();
|
||||
|
||||
// Let the handlers interact with each other if they really want.
|
||||
$this->_pre_query();
|
||||
$this->_preQuery();
|
||||
|
||||
if ($this->display_handler->uses_exposed()) {
|
||||
$exposed_form = $this->display_handler->get_plugin('exposed_form');
|
||||
|
@ -994,16 +994,16 @@ class View extends ViewStorage {
|
|||
$this->build_sort = TRUE;
|
||||
|
||||
// Arguments can, in fact, cause this whole thing to abort.
|
||||
if (!$this->_build_arguments()) {
|
||||
if (!$this->_buildArguments()) {
|
||||
$this->build_time = microtime(TRUE) - $start;
|
||||
$this->attach_displays();
|
||||
$this->attachDisplays();
|
||||
return $this->built;
|
||||
}
|
||||
|
||||
// Initialize the style; arguments may have changed which style we use,
|
||||
// so waiting as long as possible is important. But we need to know
|
||||
// about the style when we go to build fields.
|
||||
if (!$this->init_style()) {
|
||||
if (!$this->initStyle()) {
|
||||
$this->build_info['fail'] = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1055,7 +1055,7 @@ class View extends ViewStorage {
|
|||
$this->build_time = microtime(TRUE) - $start;
|
||||
|
||||
// Attach displays
|
||||
$this->attach_displays();
|
||||
$this->attachDisplays();
|
||||
|
||||
// Let modules modify the view just after building it.
|
||||
foreach (module_implements('views_post_build') as $module) {
|
||||
|
@ -1069,11 +1069,13 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Internal method to build an individual set of handlers.
|
||||
*
|
||||
* @todo Some filter needs this function, even it is internal.
|
||||
*
|
||||
* @param string $key
|
||||
* The type of handlers (filter etc.) which should be iterated over to
|
||||
* build the relationship and query information.
|
||||
*/
|
||||
function _build($key) {
|
||||
public function _build($key) {
|
||||
$handlers = &$this->$key;
|
||||
foreach ($handlers as $id => $data) {
|
||||
|
||||
|
@ -1116,7 +1118,7 @@ class View extends ViewStorage {
|
|||
* Return whether the executing was successful, for example an argument
|
||||
* could stop the process.
|
||||
*/
|
||||
function execute($display_id = NULL) {
|
||||
public function execute($display_id = NULL) {
|
||||
if (empty($this->built)) {
|
||||
if (!$this->build($display_id)) {
|
||||
return FALSE;
|
||||
|
@ -1157,7 +1159,7 @@ class View extends ViewStorage {
|
|||
// Enforce the array key rule as documented in
|
||||
// views_plugin_query::execute().
|
||||
$this->result = array_values($this->result);
|
||||
$this->_post_execute();
|
||||
$this->_postExecute();
|
||||
if ($cache) {
|
||||
$cache->cache_set('results');
|
||||
}
|
||||
|
@ -1184,7 +1186,7 @@ class View extends ViewStorage {
|
|||
* @return (string|NULL)
|
||||
* Return the output of the rendered view or NULL if something failed in the process.
|
||||
*/
|
||||
function render($display_id = NULL) {
|
||||
public function render($display_id = NULL) {
|
||||
$this->execute($display_id);
|
||||
|
||||
// Check to see if the build failed.
|
||||
|
@ -1203,7 +1205,7 @@ class View extends ViewStorage {
|
|||
|
||||
$start = microtime(TRUE);
|
||||
if (!empty($this->live_preview) && $config->get('ui.show.additional_queries')) {
|
||||
$this->start_query_capture();
|
||||
$this->startQueryCapture();
|
||||
}
|
||||
|
||||
$exposed_form = $this->display_handler->get_plugin('exposed_form');
|
||||
|
@ -1229,7 +1231,7 @@ class View extends ViewStorage {
|
|||
}
|
||||
|
||||
// Initialize the style plugin.
|
||||
$this->init_style();
|
||||
$this->initStyle();
|
||||
|
||||
// Give field handlers the opportunity to perform additional queries
|
||||
// using the entire resultset prior to rendering.
|
||||
|
@ -1292,7 +1294,7 @@ class View extends ViewStorage {
|
|||
}
|
||||
|
||||
if (!empty($this->live_preview) && $config->get('ui.show.additional_queries')) {
|
||||
$this->end_query_capture();
|
||||
$this->endQueryCapture();
|
||||
}
|
||||
$this->render_time = microtime(TRUE) - $start;
|
||||
|
||||
|
@ -1314,7 +1316,7 @@ class View extends ViewStorage {
|
|||
* @return string
|
||||
* The rendered output of the field.
|
||||
*/
|
||||
function render_field($field, $row) {
|
||||
public function renderField($field, $row) {
|
||||
if (isset($this->field[$field]) && isset($this->result[$row])) {
|
||||
return $this->field[$field]->advanced_render($this->result[$row]);
|
||||
}
|
||||
|
@ -1332,19 +1334,19 @@ class View extends ViewStorage {
|
|||
*
|
||||
* If you simply want to view the display, use View::preview() instead.
|
||||
*/
|
||||
function execute_display($display_id = NULL, $args = array()) {
|
||||
if (empty($this->current_display) || $this->current_display != $this->choose_display($display_id)) {
|
||||
if (!$this->set_display($display_id)) {
|
||||
public function executeDisplay($display_id = NULL, $args = array()) {
|
||||
if (empty($this->current_display) || $this->current_display != $this->chooseDisplay($display_id)) {
|
||||
if (!$this->setDisplay($display_id)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
$this->pre_execute($args);
|
||||
$this->preExecute($args);
|
||||
|
||||
// Execute the view
|
||||
$output = $this->display_handler->execute();
|
||||
|
||||
$this->post_execute();
|
||||
$this->postExecute();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
@ -1355,19 +1357,19 @@ class View extends ViewStorage {
|
|||
* Can also be called when views are embedded, as this guarantees
|
||||
* normalized output.
|
||||
*/
|
||||
function preview($display_id = NULL, $args = array()) {
|
||||
public function preview($display_id = NULL, $args = array()) {
|
||||
if (empty($this->current_display) || ((!empty($display_id)) && $this->current_display != $display_id)) {
|
||||
if (!$this->set_display($display_id)) {
|
||||
if (!$this->setDisplay($display_id)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
$this->preview = TRUE;
|
||||
$this->pre_execute($args);
|
||||
$this->preExecute($args);
|
||||
// Preview the view.
|
||||
$output = $this->display_handler->preview();
|
||||
|
||||
$this->post_execute();
|
||||
$this->postExecute();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
@ -1375,7 +1377,7 @@ class View extends ViewStorage {
|
|||
* Run attachments and let the display do what it needs to do prior
|
||||
* to running.
|
||||
*/
|
||||
function pre_execute($args = array()) {
|
||||
public function preExecute($args = array()) {
|
||||
$this->old_view[] = views_get_current_view();
|
||||
views_set_current_view($this);
|
||||
$display_id = $this->current_display;
|
||||
|
@ -1383,7 +1385,7 @@ class View extends ViewStorage {
|
|||
// Prepare the view with the information we have, but only if we were
|
||||
// passed arguments, as they may have been set previously.
|
||||
if ($args) {
|
||||
$this->set_arguments($args);
|
||||
$this->setArguments($args);
|
||||
}
|
||||
|
||||
// Let modules modify the view just prior to executing it.
|
||||
|
@ -1402,7 +1404,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Unset the current view, mostly.
|
||||
*/
|
||||
function post_execute() {
|
||||
public function postExecute() {
|
||||
// unset current view so we can be properly destructed later on.
|
||||
// Return the previous value in case we're an attachment.
|
||||
|
||||
|
@ -1416,7 +1418,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Run attachment displays for the view.
|
||||
*/
|
||||
function attach_displays() {
|
||||
public function attachDisplays() {
|
||||
if (!empty($this->is_attachment)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1443,11 +1445,11 @@ class View extends ViewStorage {
|
|||
* @param $callbacks
|
||||
* A menu callback array passed from views_menu_alter().
|
||||
*/
|
||||
function execute_hook_menu($display_id = NULL, &$callbacks = array()) {
|
||||
public function executeHookMenu($display_id = NULL, &$callbacks = array()) {
|
||||
// Prepare the view with the information we have.
|
||||
|
||||
// This was probably already called, but it's good to be safe.
|
||||
if (!$this->set_display($display_id)) {
|
||||
if (!$this->setDisplay($display_id)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1461,11 +1463,11 @@ class View extends ViewStorage {
|
|||
* Called to get hook_block information from the view and the
|
||||
* named display handler.
|
||||
*/
|
||||
function execute_hook_block_list($display_id = NULL) {
|
||||
public function executeHookBlockList($display_id = NULL) {
|
||||
// Prepare the view with the information we have.
|
||||
|
||||
// This was probably already called, but it's good to be safe.
|
||||
if (!$this->set_display($display_id)) {
|
||||
if (!$this->setDisplay($display_id)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1479,14 +1481,14 @@ class View extends ViewStorage {
|
|||
* Determine if the given user has access to the view. Note that
|
||||
* this sets the display handler if it hasn't been.
|
||||
*/
|
||||
function access($displays = NULL, $account = NULL) {
|
||||
public function access($displays = NULL, $account = NULL) {
|
||||
// Noone should have access to disabled views.
|
||||
if (!empty($this->disabled)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!isset($this->current_display)) {
|
||||
$this->init_display();
|
||||
$this->initDisplay();
|
||||
}
|
||||
|
||||
if (!$account) {
|
||||
|
@ -1534,9 +1536,9 @@ class View extends ViewStorage {
|
|||
* Get the view's current title. This can change depending upon how it
|
||||
* was built.
|
||||
*/
|
||||
function get_title() {
|
||||
public function getTitle() {
|
||||
if (empty($this->display_handler)) {
|
||||
if (!$this->set_display('default')) {
|
||||
if (!$this->setDisplay('default')) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1550,7 +1552,7 @@ class View extends ViewStorage {
|
|||
}
|
||||
|
||||
// Allow substitutions from the first row.
|
||||
if ($this->init_style()) {
|
||||
if ($this->initStyle()) {
|
||||
$title = $this->style_plugin->tokenize_value($title, 0);
|
||||
}
|
||||
return $title;
|
||||
|
@ -1561,7 +1563,7 @@ class View extends ViewStorage {
|
|||
*
|
||||
* The tokens in the title get's replaced before rendering.
|
||||
*/
|
||||
function set_title($title) {
|
||||
public function setTitle($title) {
|
||||
$this->build_info['title'] = $title;
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1571,7 +1573,7 @@ class View extends ViewStorage {
|
|||
*
|
||||
* When a certain view doesn't have a human readable name return the machine readable name.
|
||||
*/
|
||||
function get_human_name() {
|
||||
public function getHumanName() {
|
||||
if (!empty($this->human_name)) {
|
||||
$human_name = $this->human_name;
|
||||
}
|
||||
|
@ -1584,16 +1586,16 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Force the view to build a title.
|
||||
*/
|
||||
function build_title() {
|
||||
$this->init_display();
|
||||
public function buildTitle() {
|
||||
$this->initDisplay();
|
||||
|
||||
if (empty($this->built)) {
|
||||
$this->init_query();
|
||||
$this->initQuery();
|
||||
}
|
||||
|
||||
$this->init_handlers();
|
||||
$this->initHandlers();
|
||||
|
||||
$this->_build_arguments();
|
||||
$this->_buildArguments();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1601,13 +1603,13 @@ class View extends ViewStorage {
|
|||
*
|
||||
* This URL will be adjusted for arguments.
|
||||
*/
|
||||
function get_url($args = NULL, $path = NULL) {
|
||||
public function getUrl($args = NULL, $path = NULL) {
|
||||
if (!empty($this->override_url)) {
|
||||
return $this->override_url;
|
||||
}
|
||||
|
||||
if (!isset($path)) {
|
||||
$path = $this->get_path();
|
||||
$path = $this->getPath();
|
||||
}
|
||||
if (!isset($args)) {
|
||||
$args = $this->args;
|
||||
|
@ -1665,13 +1667,13 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Get the base path used for this view.
|
||||
*/
|
||||
function get_path() {
|
||||
public function getPath() {
|
||||
if (!empty($this->override_path)) {
|
||||
return $this->override_path;
|
||||
}
|
||||
|
||||
if (empty($this->display_handler)) {
|
||||
if (!$this->set_display('default')) {
|
||||
if (!$this->setDisplay('default')) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1684,7 +1686,7 @@ class View extends ViewStorage {
|
|||
* @param $set
|
||||
* If true, use drupal_set_breadcrumb() to install the breadcrumb.
|
||||
*/
|
||||
function get_breadcrumb($set = FALSE) {
|
||||
public function getBreadcrumb($set = FALSE) {
|
||||
// Now that we've built the view, extract the breadcrumb.
|
||||
$base = TRUE;
|
||||
$breadcrumb = array();
|
||||
|
@ -1712,13 +1714,6 @@ class View extends ViewStorage {
|
|||
return $breadcrumb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this view cacheable?
|
||||
*/
|
||||
function is_cacheable() {
|
||||
return $this->is_cacheable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up query capturing.
|
||||
*
|
||||
|
@ -1728,7 +1723,7 @@ class View extends ViewStorage {
|
|||
* can do that without forcing a db rewrite by just manipulating
|
||||
* $conf. This is kind of evil but it works.
|
||||
*/
|
||||
function start_query_capture() {
|
||||
public function startQueryCapture() {
|
||||
global $conf, $queries;
|
||||
if (empty($conf['dev_query'])) {
|
||||
$this->fix_dev_query = TRUE;
|
||||
|
@ -1750,7 +1745,7 @@ class View extends ViewStorage {
|
|||
*
|
||||
* @see View::start_query_capture()
|
||||
*/
|
||||
function end_query_capture() {
|
||||
public function endQueryCapture() {
|
||||
global $conf, $queries;
|
||||
if (!empty($this->fix_dev_query)) {
|
||||
$conf['dev_query'] = FALSE;
|
||||
|
@ -1780,7 +1775,7 @@ class View extends ViewStorage {
|
|||
*
|
||||
* I'd call this clone() but it's reserved.
|
||||
*/
|
||||
function copy() {
|
||||
public function copy() {
|
||||
$code = $this->export();
|
||||
eval($code);
|
||||
return $view;
|
||||
|
@ -1800,7 +1795,7 @@ class View extends ViewStorage {
|
|||
* @return Drupal\views\View
|
||||
* The cloned view.
|
||||
*/
|
||||
function clone_view() {
|
||||
public function cloneView() {
|
||||
$clone = clone $this;
|
||||
|
||||
$keys = array('current_display', 'display_handler', 'build_info', 'built', 'executed', 'attachment_before', 'attachment_after', 'field', 'argument', 'filter', 'sort', 'relationship', 'header', 'footer', 'empty', 'query', 'inited', 'style_plugin', 'plugin_name', 'exposed_data', 'exposed_input', 'exposed_widgets', 'many_to_one_tables', 'feed_icon');
|
||||
|
@ -1833,7 +1828,7 @@ class View extends ViewStorage {
|
|||
* Unset references so that a $view object may be properly garbage
|
||||
* collected.
|
||||
*/
|
||||
function destroy() {
|
||||
public function destroy() {
|
||||
foreach (array_keys($this->display) as $display_id) {
|
||||
if (isset($this->display[$display_id]->handler)) {
|
||||
$this->display[$display_id]->handler->destroy();
|
||||
|
@ -1841,7 +1836,7 @@ class View extends ViewStorage {
|
|||
}
|
||||
}
|
||||
|
||||
foreach (View::views_object_types() as $type => $info) {
|
||||
foreach (View::viewsObjectTypes() as $type => $info) {
|
||||
if (isset($this->$type)) {
|
||||
$handlers = &$this->$type;
|
||||
foreach ($handlers as $id => $item) {
|
||||
|
@ -1897,8 +1892,8 @@ class View extends ViewStorage {
|
|||
* @return
|
||||
* TRUE if the view is valid; an array of error strings if it is not.
|
||||
*/
|
||||
function validate() {
|
||||
$this->init_display();
|
||||
public function validate() {
|
||||
$this->initDisplay();
|
||||
|
||||
$errors = array();
|
||||
$this->display_errors = NULL;
|
||||
|
@ -1919,14 +1914,14 @@ class View extends ViewStorage {
|
|||
}
|
||||
}
|
||||
|
||||
$this->set_display($current_display);
|
||||
$this->setDisplay($current_display);
|
||||
return $errors ? $errors : TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find and initialize the localizer plugin.
|
||||
*/
|
||||
function init_localization() {
|
||||
public function initLocalization() {
|
||||
// @todo The check for the view was added to ensure that
|
||||
// $this->localization_plugin->init() is run.
|
||||
if (isset($this->localization_plugin) && is_object($this->localization_plugin) && isset($this->localization_plugin->view)) {
|
||||
|
@ -1952,7 +1947,7 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Determine whether a view supports admin string translation.
|
||||
*/
|
||||
function is_translatable() {
|
||||
public function isTranslatable() {
|
||||
// If the view is normal or overridden, use admin string translation.
|
||||
// A newly created view won't have a type. Accept this.
|
||||
return (!isset($this->type) || in_array($this->type, array(t('Normal'), t('Overridden')))) ? TRUE : FALSE;
|
||||
|
@ -1961,32 +1956,32 @@ class View extends ViewStorage {
|
|||
/**
|
||||
* Send strings for localization.
|
||||
*/
|
||||
function save_locale_strings() {
|
||||
$this->process_locale_strings('save');
|
||||
public function saveLocaleStrings() {
|
||||
$this->processLocaleStrings('save');
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete localized strings.
|
||||
*/
|
||||
function delete_locale_strings() {
|
||||
$this->process_locale_strings('delete');
|
||||
public function deleteLocaleStrings() {
|
||||
$this->processLocaleStrings('delete');
|
||||
}
|
||||
|
||||
/**
|
||||
* Export localized strings.
|
||||
*/
|
||||
function export_locale_strings() {
|
||||
$this->process_locale_strings('export');
|
||||
public function exportLocaleStrings() {
|
||||
$this->processLocaleStrings('export');
|
||||
}
|
||||
|
||||
/**
|
||||
* Process strings for localization, deletion or export to code.
|
||||
*/
|
||||
function process_locale_strings($op) {
|
||||
public function processLocaleStrings($op) {
|
||||
// Ensure this view supports translation, we have a display, and we
|
||||
// have a localization plugin.
|
||||
// @fixme Export does not init every handler.
|
||||
if (($this->is_translatable() || $op == 'export') && $this->init_display() && $this->init_localization()) {
|
||||
if (($this->isTranslatable() || $op == 'export') && $this->initDisplay() && $this->initLocalization()) {
|
||||
$this->localization_plugin->process_locale_strings($op);
|
||||
}
|
||||
}
|
||||
|
@ -1995,7 +1990,7 @@ class View extends ViewStorage {
|
|||
* Providea a list of views object types used in a view, with some information
|
||||
* about them.
|
||||
*/
|
||||
public static function views_object_types() {
|
||||
public static function viewsObjectTypes() {
|
||||
static $retval = NULL;
|
||||
|
||||
// Statically cache this so t() doesn't run a bajillion times.
|
||||
|
|
|
@ -217,8 +217,8 @@ class ViewStorage extends ConfigurableBase implements ViewStorageInterface {
|
|||
* The unique ID for this handler instance.
|
||||
*/
|
||||
function add_item($display_id, $type, $table, $field, $options = array(), $id = NULL) {
|
||||
$types = View::views_object_types();
|
||||
$this->set_display($display_id);
|
||||
$types = View::viewsObjectTypes();
|
||||
$this->setDisplay($display_id);
|
||||
|
||||
$fields = $this->display[$display_id]->handler->get_option($types[$type]['plural']);
|
||||
|
||||
|
@ -256,14 +256,14 @@ class ViewStorage extends ConfigurableBase implements ViewStorageInterface {
|
|||
* An array of handler instances of a given type for this display.
|
||||
*/
|
||||
function get_items($type, $display_id = NULL) {
|
||||
$this->set_display($display_id);
|
||||
$this->setDisplay($display_id);
|
||||
|
||||
if (!isset($display_id)) {
|
||||
$display_id = $this->current_display;
|
||||
}
|
||||
|
||||
// Get info about the types so we can get the right data.
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
return $this->display[$display_id]->handler->get_option($types[$type]['plural']);
|
||||
}
|
||||
|
||||
|
@ -283,9 +283,9 @@ class ViewStorage extends ConfigurableBase implements ViewStorageInterface {
|
|||
*/
|
||||
function get_item($display_id, $type, $id) {
|
||||
// Get info about the types so we can get the right data.
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
// Initialize the display
|
||||
$this->set_display($display_id);
|
||||
$this->setDisplay($display_id);
|
||||
|
||||
// Get the existing configuration
|
||||
$fields = $this->display[$display_id]->handler->get_option($types[$type]['plural']);
|
||||
|
@ -309,9 +309,9 @@ class ViewStorage extends ConfigurableBase implements ViewStorageInterface {
|
|||
*/
|
||||
function set_item($display_id, $type, $id, $item) {
|
||||
// Get info about the types so we can get the right data.
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
// Initialize the display.
|
||||
$this->set_display($display_id);
|
||||
$this->setDisplay($display_id);
|
||||
|
||||
// Get the existing configuration.
|
||||
$fields = $this->display[$display_id]->handler->get_option($types[$type]['plural']);
|
||||
|
|
|
@ -505,7 +505,7 @@ function views_taxonomy_set_breadcrumb(&$breadcrumb, &$argument) {
|
|||
}
|
||||
else {
|
||||
$args[$argument->position] = $parent->tid;
|
||||
$path = $argument->view->get_url($args);
|
||||
$path = $argument->view->getUrl($args);
|
||||
}
|
||||
$breadcrumb[$path] = check_plain($parent->name);
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ class views_ui extends ctools_export_ui {
|
|||
$title = $view->human_name;
|
||||
}
|
||||
else {
|
||||
$title = $view->get_title();
|
||||
$title = $view->getTitle();
|
||||
if (empty($title)) {
|
||||
$title = $view->name;
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ class views_ui extends ctools_export_ui {
|
|||
$template->type = t('Default');
|
||||
|
||||
$output = $this->clone_page($js, $input, $template, $step);
|
||||
drupal_set_title(t('Create view from template @template', array('@template' => $template->get_human_name())));
|
||||
drupal_set_title(t('Create view from template @template', array('@template' => $template->getHumanName())));
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
@ -404,10 +404,10 @@ function views_ui_clone_form($form, &$form_state) {
|
|||
}
|
||||
do {
|
||||
if (empty($form_state['item']->is_template)) {
|
||||
$name = format_plural($counter, 'Clone of', 'Clone @count of') . ' ' . $view->get_human_name();
|
||||
$name = format_plural($counter, 'Clone of', 'Clone @count of') . ' ' . $view->getHumanName();
|
||||
}
|
||||
else {
|
||||
$name = $view->get_human_name();
|
||||
$name = $view->getHumanName();
|
||||
if ($counter > 1) {
|
||||
$name .= ' ' . $counter;
|
||||
}
|
||||
|
|
|
@ -83,11 +83,11 @@ function template_preprocess_views_view(&$vars) {
|
|||
|
||||
// @todo: Figure out whether this belongs into views_ui_preprocess_views_view.
|
||||
// Render title for the admin preview.
|
||||
$vars['title'] = !empty($view->views_ui_context) ? filter_xss_admin($view->get_title()) : '';
|
||||
$vars['title'] = !empty($view->views_ui_context) ? filter_xss_admin($view->getTitle()) : '';
|
||||
|
||||
if ($view->display_handler->render_pager()) {
|
||||
$exposed_input = isset($view->exposed_raw_input) ? $view->exposed_raw_input : NULL;
|
||||
$vars['pager'] = $view->render_pager($exposed_input);
|
||||
$vars['pager'] = $view->renderPager($exposed_input);
|
||||
}
|
||||
|
||||
$vars['attachment_before'] = !empty($view->attachment_before) ? $view->attachment_before : '';
|
||||
|
@ -130,7 +130,7 @@ function template_preprocess_views_view(&$vars) {
|
|||
'view_path' => check_plain(current_path()),
|
||||
// Pass through URL to ensure we get e.g. language prefixes.
|
||||
// 'view_base_path' => isset($view->display['page']) ? substr(url($view->display['page']->display_options['path']), strlen($base_path)) : '',
|
||||
'view_base_path' => $view->get_path(),
|
||||
'view_base_path' => $view->getPath(),
|
||||
'view_dom_id' => $vars['dom_id'],
|
||||
// To fit multiple views on a page, the programmer may have
|
||||
// overridden the display's pager_element.
|
||||
|
@ -390,7 +390,7 @@ function template_preprocess_views_view_summary(&$vars) {
|
|||
if (!empty($argument->options['summary_options']['base_path'])) {
|
||||
$base_path = $argument->options['summary_options']['base_path'];
|
||||
}
|
||||
$vars['rows'][$id]->url = url($view->get_url($args, $base_path), $url_options);
|
||||
$vars['rows'][$id]->url = url($view->getUrl($args, $base_path), $url_options);
|
||||
$vars['rows'][$id]->count = intval($row->{$argument->count_alias});
|
||||
if (isset($active_urls[$vars['rows'][$id]->url])) {
|
||||
$vars['row_classes'][$id] = 'active';
|
||||
|
@ -440,7 +440,7 @@ function template_preprocess_views_view_summary_unformatted(&$vars) {
|
|||
if (!empty($argument->options['summary_options']['base_path'])) {
|
||||
$base_path = $argument->options['summary_options']['base_path'];
|
||||
}
|
||||
$vars['rows'][$id]->url = url($view->get_url($args, $base_path), $url_options);
|
||||
$vars['rows'][$id]->url = url($view->getUrl($args, $base_path), $url_options);
|
||||
$vars['rows'][$id]->count = intval($row->{$argument->count_alias});
|
||||
if (isset($active_urls[$vars['rows'][$id]->url])) {
|
||||
$vars['row_classes'][$id] = 'active';
|
||||
|
@ -860,7 +860,7 @@ function template_preprocess_views_view_rss(&$vars) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
$title = $view->get_title();
|
||||
$title = $view->getTitle();
|
||||
}
|
||||
$vars['title'] = check_plain($title);
|
||||
|
||||
|
@ -872,7 +872,7 @@ function template_preprocess_views_view_rss(&$vars) {
|
|||
}
|
||||
|
||||
if ($path) {
|
||||
$path = $view->get_url(NULL, $path);
|
||||
$path = $view->getUrl(NULL, $path);
|
||||
$url_options = array('absolute' => TRUE);
|
||||
if (!empty($view->exposed_raw_input)) {
|
||||
$url_options['query'] = $view->exposed_raw_input;
|
||||
|
|
38
views.module
38
views.module
|
@ -488,7 +488,7 @@ function views_menu_alter(&$callbacks) {
|
|||
$views = views_get_applicable_views('uses_hook_menu');
|
||||
foreach ($views as $data) {
|
||||
list($view, $display_id) = $data;
|
||||
$result = $view->execute_hook_menu($display_id, $callbacks);
|
||||
$result = $view->executeHookMenu($display_id, $callbacks);
|
||||
if (is_array($result)) {
|
||||
// The menu system doesn't support having two otherwise
|
||||
// identical paths with different placeholders. So we
|
||||
|
@ -566,13 +566,13 @@ function views_arg_load($value, $name, $display_id, $index) {
|
|||
}
|
||||
|
||||
if ($view = views_get_view($name)) {
|
||||
$view->set_display($display_id);
|
||||
$view->init_handlers();
|
||||
$view->setDisplay($display_id);
|
||||
$view->initHandlers();
|
||||
|
||||
$ids = array_keys($view->argument);
|
||||
|
||||
$indexes = array();
|
||||
$path = explode('/', $view->get_path());
|
||||
$path = explode('/', $view->getPath());
|
||||
|
||||
foreach ($path as $id => $piece) {
|
||||
if ($piece == '%' && !empty($ids)) {
|
||||
|
@ -613,7 +613,7 @@ function views_page($name, $display_id) {
|
|||
|
||||
// Load the view and render it.
|
||||
if ($view = views_get_view($name)) {
|
||||
return $view->execute_display($display_id, $args);
|
||||
return $view->executeDisplay($display_id, $args);
|
||||
}
|
||||
|
||||
// Fallback; if we get here no view was found or handler was not valid.
|
||||
|
@ -696,7 +696,7 @@ function views_block_info() {
|
|||
continue;
|
||||
}
|
||||
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
foreach ($view->display as $display_id => $display) {
|
||||
|
||||
if (isset($display->handler) && !empty($display->handler->definition['uses_hook_block'])) {
|
||||
|
@ -767,7 +767,7 @@ function views_block_view($delta) {
|
|||
$type = '-' . $type;
|
||||
if ($view = views_get_view($name)) {
|
||||
if ($view->access($display_id)) {
|
||||
$view->set_display($display_id);
|
||||
$view->setDisplay($display_id);
|
||||
if (isset($view->display_handler)) {
|
||||
$output = $view->display_handler->view_special_blocks($type);
|
||||
// Before returning the block output, convert it to a renderable
|
||||
|
@ -790,7 +790,7 @@ function views_block_view($delta) {
|
|||
// Load the view
|
||||
if ($view = views_get_view($name)) {
|
||||
if ($view->access($display_id)) {
|
||||
$output = $view->execute_display($display_id);
|
||||
$output = $view->executeDisplay($display_id);
|
||||
// Before returning the block output, convert it to a renderable array
|
||||
// with contextual links.
|
||||
views_add_block_contextual_links($output, $view, $display_id);
|
||||
|
@ -1546,8 +1546,8 @@ function views_get_applicable_views($type) {
|
|||
if (!empty($plugin[$type])) {
|
||||
// This view uses_hook_menu. Clone it so that different handlers
|
||||
// don't trip over each other, and add it to the list.
|
||||
$v = $view->clone_view();
|
||||
if ($v->set_display($id) && $v->display_handler->get_option('enabled')) {
|
||||
$v = $view->cloneView();
|
||||
if ($v->setDisplay($id) && $v->display_handler->get_option('enabled')) {
|
||||
$result[] = array($v, $id);
|
||||
}
|
||||
// In PHP 4.4.7 and presumably earlier, if we do not unset $v
|
||||
|
@ -1687,7 +1687,7 @@ function views_get_views_as_options($views_only = FALSE, $filter = 'all', $exclu
|
|||
foreach ($views as $view) {
|
||||
// Return only views.
|
||||
if ($views_only && $view->name != $exclude_view_name) {
|
||||
$options[$view->name] = $view->get_human_name();
|
||||
$options[$view->name] = $view->getHumanName();
|
||||
}
|
||||
// Return views with display ids.
|
||||
else {
|
||||
|
@ -1748,7 +1748,7 @@ function views_get_view($name) {
|
|||
$view = entity_load('view', $name);
|
||||
if ($view) {
|
||||
$view->update();
|
||||
return $view->clone_view();
|
||||
return $view->cloneView();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1835,7 +1835,7 @@ function views_form($form, &$form_state, $view, $output) {
|
|||
|
||||
$form = array();
|
||||
$query = drupal_get_query_parameters();
|
||||
$form['#action'] = url($view->get_url(), array('query' => $query));
|
||||
$form['#action'] = url($view->getUrl(), array('query' => $query));
|
||||
// Tell the preprocessor whether it should hide the header, footer, pager...
|
||||
$form['show_view_elements'] = array(
|
||||
'#type' => 'value',
|
||||
|
@ -2008,7 +2008,7 @@ function views_exposed_form($form, &$form_state) {
|
|||
$view = &$form_state['view'];
|
||||
$display = &$form_state['display'];
|
||||
|
||||
$form_state['input'] = $view->get_exposed_input();
|
||||
$form_state['input'] = $view->getExposedInput();
|
||||
|
||||
// Let form plugins know this is for exposed widgets.
|
||||
$form_state['exposed'] = TRUE;
|
||||
|
@ -2231,7 +2231,7 @@ function _views_query_tag_alter_condition(AlterableInterface $query, &$condition
|
|||
*
|
||||
* Note that this function does NOT display the title of the view. If you want
|
||||
* to do that, you will need to do what this function does manually, by
|
||||
* loading the view, getting the preview and then getting $view->get_title().
|
||||
* loading the view, getting the preview and then getting $view->getTitle().
|
||||
*
|
||||
* @param $name
|
||||
* The name of the view to embed.
|
||||
|
@ -2283,15 +2283,15 @@ function views_get_view_result($name, $display_id = NULL) {
|
|||
$view = views_get_view($name);
|
||||
if (is_object($view)) {
|
||||
if (is_array($args)) {
|
||||
$view->set_arguments($args);
|
||||
$view->setArguments($args);
|
||||
}
|
||||
if (is_string($display_id)) {
|
||||
$view->set_display($display_id);
|
||||
$view->setDisplay($display_id);
|
||||
}
|
||||
else {
|
||||
$view->init_display();
|
||||
$view->initDisplay();
|
||||
}
|
||||
$view->pre_execute();
|
||||
$view->preExecute();
|
||||
$view->execute();
|
||||
return $view->result;
|
||||
}
|
||||
|
|
|
@ -70,12 +70,12 @@ function views_tokens($type, $tokens, array $data = array(), array $options = ar
|
|||
break;
|
||||
|
||||
case 'title':
|
||||
$title = $view->get_title();
|
||||
$title = $view->getTitle();
|
||||
$replacements[$original] = $sanitize ? check_plain($title) : $title;
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
if ($path = $view->get_url()) {
|
||||
if ($path = $view->getUrl()) {
|
||||
$replacements[$original] = url($path, $url_options);
|
||||
}
|
||||
break;
|
||||
|
@ -84,7 +84,7 @@ function views_tokens($type, $tokens, array $data = array(), array $options = ar
|
|||
|
||||
// [view:url:*] nested tokens. This only works if Token module is installed.
|
||||
if ($url_tokens = token_find_with_prefix($tokens, 'url')) {
|
||||
if ($path = $view->get_url()) {
|
||||
if ($path = $view->getUrl()) {
|
||||
$replacements += token_generate('url', $url_tokens, array('path' => $path), $options);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -271,7 +271,7 @@ function views_ui_custom_theme() {
|
|||
function views_ui_edit_page_title($view) {
|
||||
module_load_include('inc', 'views_ui', 'includes/admin');
|
||||
$bases = views_fetch_base_tables();
|
||||
$name = $view->get_human_name();
|
||||
$name = $view->getHumanName();
|
||||
if (isset($bases[$view->base_table])) {
|
||||
$name .= ' (' . $bases[$view->base_table]['title'] . ')';
|
||||
}
|
||||
|
@ -479,7 +479,7 @@ function views_ui_view_preview_section_handler_links($view, $type, $title = FALS
|
|||
$handlers = $view->display_handler->get_handlers($type);
|
||||
$links = array();
|
||||
|
||||
$types = View::views_object_types();
|
||||
$types = View::viewsObjectTypes();
|
||||
if ($title) {
|
||||
$links[$type . '-title'] = array(
|
||||
'title' => $types[$type]['title'],
|
||||
|
@ -768,7 +768,7 @@ function _views_ui_get_paths($view) {
|
|||
$all_paths[] = t('Edit this view to add a display.');
|
||||
}
|
||||
else {
|
||||
$view->init_display(); // Make sure all the handlers are set up
|
||||
$view->initDisplay(); // Make sure all the handlers are set up
|
||||
foreach ($view->display as $display) {
|
||||
if (!empty($display->handler) && $display->handler->has_path()) {
|
||||
$one_path = $display->handler->get_option('path');
|
||||
|
|
Loading…
Reference in New Issue