Commit e42f0d8c authored by aspilicious's avatar aspilicious Committed by tim.plunkett
Browse files

Issue #1719188 by aspilicious: Coder cleanup.

parent 18bb8159
......@@ -146,7 +146,7 @@ function views_revert_views() {
drush_set_error(dt("The view specified '@viewname' is not overridden.", array('@viewname' => $viewname)));
}
// If the view is overriden, revert it.
elseif ($is_overridden){
elseif ($is_overridden) {
views_revert_view($views[$viewname]);
$i++;
}
......@@ -317,7 +317,7 @@ function drush_views_list() {
);
// setup a row for each view
foreach($views as $id => $view){
foreach ($views as $id => $view) {
// if options were specified, check that first
// mismatch push the loop to the next view
if ($with_tags && !in_array($view->tag, $tags)) {
......@@ -343,7 +343,7 @@ function drush_views_list() {
// place the row in the appropiate array,
// so we can have disabled views at the bottom
if($view->disabled) {
if ($view->disabled) {
$disabled_views[] = $row;
}
else{
......@@ -352,7 +352,7 @@ function drush_views_list() {
unset($row);
// gather some statistics
switch($view->type) {
switch ($view->type) {
case dt('Normal'):
$indb++;
break;
......
......@@ -909,8 +909,7 @@ function summary_basics($count_field = TRUE) {
// Add the number of nodes counter
$distinct = ($this->view->display_handler->get_option('distinct') && empty($this->query->no_distinct));
$count_alias = $this->query->add_field($this->query->base_table, $this->query->base_field, 'num_records',
array('count' => TRUE, 'distinct' => $distinct));
$count_alias = $this->query->add_field($this->query->base_table, $this->query->base_field, 'num_records', array('count' => TRUE, 'distinct' => $distinct));
$this->query->add_groupby($this->name_alias);
if ($count_field) {
......
......@@ -44,7 +44,7 @@ function get_default_argument($raw = FALSE) {
if (!$raw && $this->options['default_argument_type'] == 'date') {
return date($this->arg_format, REQUEST_TIME);
}
else if (!$raw && in_array($this->options['default_argument_type'], array('node_created', 'node_changed'))) {
elseif (!$raw && in_array($this->options['default_argument_type'], array('node_created', 'node_changed'))) {
foreach (range(1, 3) as $i) {
$node = menu_get_object('node', $i);
if (!empty($node)) {
......
......@@ -1255,7 +1255,7 @@ function render_text($alter) {
if (!empty($alter['make_link']) && !empty($alter['path'])) {
if (!isset($tokens)) {
$tokens = $this->get_render_tokens($alter);
$tokens = $this->get_render_tokens($alter);
}
$value = $this->render_as_link($alter, $value, $tokens);
}
......@@ -1341,7 +1341,7 @@ function render_as_link($alter, $text, $tokens) {
// If no scheme is provided in the $path, assign the default 'http://'.
// This allows a url of 'www.example.com' to be converted to 'http://www.example.com'.
// Only do this on for external URLs.
if ($alter['external']){
if ($alter['external']) {
if (!isset($url['scheme'])) {
// There is no scheme, add the default 'http://' to the $path.
$path = "http://$path";
......@@ -1386,7 +1386,7 @@ function render_as_link($alter, $text, $tokens) {
$options['attributes']['rel'] = $rel;
}
$target = check_plain(trim(strtr($alter['target'],$tokens)));
$target = check_plain(trim(strtr($alter['target'], $tokens)));
if (!empty($target)) {
$options['attributes']['target'] = $target;
}
......@@ -1530,13 +1530,14 @@ function get_token_values_recursive(array $array, array $parent_keys = array())
foreach ($array as $param => $val) {
if (is_array($val)) {
// Copy parent_keys array, so we don't afect other elements of this iteration.
$child_parent_keys = $parent_keys;
$child_parent_keys[] = $param;
// Get the child tokens.
$child_tokens = $this->get_token_values_recursive($val, $child_parent_keys);
// Add them to the current tokens array.
$tokens += $child_tokens;
// Copy parent_keys array, so we don't affect other elements of this
// iteration.
$child_parent_keys = $parent_keys;
$child_parent_keys[] = $param;
// Get the child tokens.
$child_tokens = $this->get_token_values_recursive($val, $child_parent_keys);
// Add them to the current tokens array.
$tokens += $child_tokens;
}
else {
// Create a token key based on array element structure.
......
......@@ -37,7 +37,7 @@ function construct() {
if (isset($this->definition['accept null'])) {
$this->accept_null = (bool) $this->definition['accept null'];
}
else if (isset($this->definition['accept_null'])) {
elseif (isset($this->definition['accept_null'])) {
$this->accept_null = (bool) $this->definition['accept_null'];
}
$this->value_options = NULL;
......
......@@ -156,7 +156,7 @@ function admin_summary() {
$options = $this->operator_options('short');
$output = '';
if(!empty($options[$this->operator])) {
if (!empty($options[$this->operator])) {
$output = check_plain($options[$this->operator]);
}
if (in_array($this->operator, $this->operator_values(1))) {
......@@ -269,11 +269,11 @@ function op_word($field) {
preg_match_all('/ (-?)("[^"]+"|[^" ]+)/i', ' ' . $this->value, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$phrase = false;
$phrase = FALSE;
// Strip off phrase quotes
if ($match[2]{0} == '"') {
$match[2] = substr($match[2], 1, -1);
$phrase = true;
$phrase = TRUE;
}
$words = trim($match[2], ',?!();:-');
$words = $phrase ? array($words) : preg_split('/ /', $words, -1, PREG_SPLIT_NO_EMPTY);
......
......@@ -45,7 +45,7 @@ function views_ui_get_admin_css() {
'group' => CSS_THEME,
);
}
else if (file_exists($theme_path . "/views-admin.$theme_key.css")) {
elseif (file_exists($theme_path . "/views-admin.$theme_key.css")) {
$list[$theme_path . "/views-admin.$theme_key.css"] = array(
'group' => CSS_THEME,
);
......@@ -95,7 +95,7 @@ function views_ui_check_advanced_help() {
$filename = db_query_range("SELECT filename FROM {system} WHERE type = 'module' AND name = 'advanced_help'", 0, 1)
->fetchField();
if ($filename && file_exists($filename)) {
drupal_set_message(t('If you <a href="@modules">enable the advanced help module</a>, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('@modules' => url('admin/modules'),'@hide' => url('admin/structure/views/settings'))));
drupal_set_message(t('If you <a href="@modules">enable the advanced help module</a>, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('@modules' => url('admin/modules'), '@hide' => url('admin/structure/views/settings'))));
}
else {
drupal_set_message(t('If you install the advanced help module from !href, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('!href' => l('http://drupal.org/project/advanced_help', 'http://drupal.org/project/advanced_help'), '@hide' => url('admin/structure/views/settings'))));
......@@ -589,7 +589,7 @@ function views_ui_add_ajax_trigger(&$wrapping_element, $trigger_key, $refresh_pa
$wrapping_element[$button_key]['#value'] = t('Update "@title" choice (@number)', array(
'@title' => $button_title,
'@number' => ++$seen_buttons[$button_title],
));
));
}
// Attach custom data to the triggering element and submit button, so we can
......@@ -848,7 +848,7 @@ function theme_views_ui_view_info($variables) {
$output .= '<div class="views-ui-view-title">' . $title . "</div>\n";
$output .= '<div class="views-ui-view-displays">' . $displays . "</div>\n";
$output .= '<div class="views-ui-view-storage">' . $type . "</div>\n";
$output .= '<div class="views-ui-view-base">' . t('Type') . ': ' . $variables['base']. "</div>\n";
$output .= '<div class="views-ui-view-base">' . t('Type') . ': ' . $variables['base'] . "</div>\n";
return $output;
}
......@@ -1187,7 +1187,7 @@ function views_ui_preview_form($form, &$form_state, $view, $display_id = 'defaul
$form_state['no_cache'] = TRUE;
$form_state['view'] = $view;
$form['#attributes'] = array('class' => array('clearfix',));
$form['#attributes'] = array('class' => array('clearfix'));
// Add a checkbox controlling whether or not this display auto-previews.
$form['live_preview'] = array(
......@@ -1555,29 +1555,29 @@ function views_ui_get_display_tab_details($view, $display) {
$display_title = views_ui_get_display_label($view, $display->id, FALSE);
$build = array(
'#theme_wrappers' => array('container'),
'#attributes' => array('id' => 'edit-display-settings-details',),
'#attributes' => array('id' => 'edit-display-settings-details'),
);
$plugin = views_fetch_plugin_data('display', $view->display[$display->id]->display_plugin);
// The following is for display purposes only. We need to determine if there is more than one button and wrap
// the buttons in a .ctools-dropbutton class if more than one is present. Otherwise, we'll just wrap the
// actions in the .ctools-button class.
$isDisplayDeleted = !empty($display->deleted);
$isDeletable = empty($plugin['no remove']);
$is_display_deleted = !empty($display->deleted);
$is_deletable = empty($plugin['no remove']);
// The master display cannot be cloned.
$isDefault = $display->id == 'default';
$is_default = $display->id == 'default';
// @todo: Figure out why get_option doesn't work here.
$isEnabled = $display->handler->get_option('enabled');
$is_enabled = $display->handler->get_option('enabled');
if (!$isDisplayDeleted && $isDeletable && !$isDefault) {
if (!$is_display_deleted && $is_deletable && !$is_default) {
$prefix = '<div class="ctools-no-js ctools-button ctools-dropbutton"><div class="ctools-link"><a href="#" class="ctools-twisty ctools-text">open</a></div><div class="ctools-content"><ul class="horizontal right actions">';
$suffix = '</ul></div></div>';
$itemElement = 'li';
$item_element = 'li';
}
else {
$prefix = '<div class="ctools-button"><div class="ctools-content"><ul class="horizontal right actions">';
$suffix = '</ul></div></div>';
$itemElement = 'li';
$item_element = 'li';
}
if ($display->id != 'default') {
......@@ -1591,15 +1591,15 @@ function views_ui_get_display_tab_details($view, $display) {
'#suffix' => $suffix,
);
if (!$isDisplayDeleted) {
if (!$isEnabled) {
if (!$is_display_deleted) {
if (!$is_enabled) {
$build['top']['actions']['enable'] = array(
'#type' => 'submit',
'#value' => t('enable @display_title', array('@display_title' => $display_title)),
'#limit_validation_errors' => array(),
'#submit' => array('views_ui_edit_form_submit_enable_display', 'views_ui_edit_form_submit_delay_destination'),
'#prefix' => '<' . $itemElement . ' class="enable">',
"#suffix" => '</' . $itemElement . '>',
'#prefix' => '<' . $item_element . ' class="enable">',
"#suffix" => '</' . $item_element . '>',
);
}
// Add a link to view the page.
......@@ -1611,39 +1611,39 @@ function views_ui_get_display_tab_details($view, $display) {
'#title' => t('view @display', array('@display' => $display->display_title)),
'#options' => array('alt' => array(t("Go to the real page for this display"))),
'#href' => $path,
'#prefix' => '<' . $itemElement . ' class="view">',
"#suffix" => '</' . $itemElement . '>',
'#prefix' => '<' . $item_element . ' class="view">',
"#suffix" => '</' . $item_element . '>',
);
}
}
if (!$isDefault) {
if (!$is_default) {
$build['top']['actions']['duplicate'] = array(
'#type' => 'submit',
'#value' => t('clone @display_title', array('@display_title' => $display_title)),
'#limit_validation_errors' => array(),
'#submit' => array('views_ui_edit_form_submit_duplicate_display', 'views_ui_edit_form_submit_delay_destination'),
'#prefix' => '<' . $itemElement . ' class="duplicate">',
"#suffix" => '</' . $itemElement . '>',
'#prefix' => '<' . $item_element . ' class="duplicate">',
"#suffix" => '</' . $item_element . '>',
);
}
if ($isDeletable) {
if ($is_deletable) {
$build['top']['actions']['delete'] = array(
'#type' => 'submit',
'#value' => t('delete @display_title', array('@display_title' => $display_title)),
'#limit_validation_errors' => array(),
'#submit' => array('views_ui_edit_form_submit_delete_display', 'views_ui_edit_form_submit_delay_destination'),
'#prefix' => '<' . $itemElement . ' class="delete">',
"#suffix" => '</' . $itemElement . '>',
'#prefix' => '<' . $item_element . ' class="delete">',
"#suffix" => '</' . $item_element . '>',
);
}
if ($isEnabled) {
if ($is_enabled) {
$build['top']['actions']['disable'] = array(
'#type' => 'submit',
'#value' => t('disable @display_title', array('@display_title' => $display_title)),
'#limit_validation_errors' => array(),
'#submit' => array('views_ui_edit_form_submit_disable_display', 'views_ui_edit_form_submit_delay_destination'),
'#prefix' => '<' . $itemElement . ' class="disable">',
"#suffix" => '</' . $itemElement . '>',
'#prefix' => '<' . $item_element . ' class="disable">',
"#suffix" => '</' . $item_element . '>',
);
}
}
......@@ -1653,8 +1653,8 @@ function views_ui_get_display_tab_details($view, $display) {
'#value' => t('undo delete of @display_title', array('@display_title' => $display_title)),
'#limit_validation_errors' => array(),
'#submit' => array('views_ui_edit_form_submit_undo_delete_display', 'views_ui_edit_form_submit_delay_destination'),
'#prefix' => '<' . $itemElement . ' class="undo-delete">',
"#suffix" => '</' . $itemElement . '>',
'#prefix' => '<' . $item_element . ' class="undo-delete">',
"#suffix" => '</' . $item_element . '>',
);
}
......@@ -1668,7 +1668,7 @@ function views_ui_get_display_tab_details($view, $display) {
$build['columns'] = array();
$build['columns']['#theme_wrappers'] = array('container');
$build['columns']['#attributes'] = array('id' => 'edit-display-settings-main', 'class' => array('clearfix', 'views-display-columns'),);
$build['columns']['#attributes'] = array('id' => 'edit-display-settings-main', 'class' => array('clearfix', 'views-display-columns'));
$build['columns']['first']['#theme_wrappers'] = array('container');
$build['columns']['first']['#attributes'] = array('class' => array('views-display-column', 'first'));
......@@ -1693,9 +1693,9 @@ function views_ui_get_display_tab_details($view, $display) {
if (!config('views.settings')->get('views_ui_show_advanced_column')) {
$build['columns']['third']['#attributes']['class'][] = 'ctools-collapsed';
}
$build['columns']['third']['advanced'] = array('#markup' => '<h3 class="ctools-collapsible-handle"><a href="">' . t('Advanced') . '</a></h3>',);
$build['columns']['third']['advanced'] = array('#markup' => '<h3 class="ctools-collapsible-handle"><a href="">' . t('Advanced') . '</a></h3>');
$build['columns']['third']['collapse']['#theme_wrappers'] = array('container');
$build['columns']['third']['collapse']['#attributes'] = array('class' => array('ctools-collapsible-content',),);
$build['columns']['third']['collapse']['#attributes'] = array('class' => array('ctools-collapsible-content'));
// Each option (e.g. title, access, display as grid/table/list) fits into one
// of several "buckets," or boxes (Format, Fields, Sort, and so on).
......@@ -2248,7 +2248,7 @@ function views_ui_edit_form_get_bucket($type, $view, $display) {
$actions['add'] = array(
'title' => t('Add'),
'href' => "admin/structure/views/nojs/add-item/$view->name/$display->id/$type",
'attributes'=> array('class' => array('icon compact add', 'views-ajax-link'), 'title' => t('Add'), 'id' => 'views-add-' . $type),
'attributes' => array('class' => array('icon compact add', 'views-ajax-link'), 'title' => t('Add'), 'id' => 'views-add-' . $type),
'html' => TRUE,
);
if ($count_handlers > 0) {
......@@ -2347,11 +2347,11 @@ function views_ui_edit_form_get_bucket($type, $view, $display) {
}
if ($display->handler->use_group_by() && $handler->use_group_by()) {
$build['fields'][$id]['#settings_links'][] = l('<span class="label">' . t('Aggregation settings') . '</span>', "admin/structure/views/nojs/config-item-group/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-button-configure views-ajax-link', 'title' => t('Aggregation settings')), 'html' => true));
$build['fields'][$id]['#settings_links'][] = l('<span class="label">' . t('Aggregation settings') . '</span>', "admin/structure/views/nojs/config-item-group/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-button-configure views-ajax-link', 'title' => t('Aggregation settings')), 'html' => TRUE));
}
if ($handler->has_extra_options()) {
$build['fields'][$id]['#settings_links'][] = l('<span class="label">' . t('Settings') . '</span>', "admin/structure/views/nojs/config-item-extra/$view->name/$display->id/$type/$id", array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => t('Settings')), 'html' => true));
$build['fields'][$id]['#settings_links'][] = l('<span class="label">' . t('Settings') . '</span>', "admin/structure/views/nojs/config-item-extra/$view->name/$display->id/$type/$id", array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => t('Settings')), 'html' => TRUE));
}
if ($grouping) {
......@@ -3106,7 +3106,7 @@ function _views_position_sort($display1, $display2) {
* Submit handler for rearranging display form
*/
function views_ui_reorder_displays_form_submit($form, &$form_state) {
foreach($form_state['input'] as $display => $info) {
foreach ($form_state['input'] as $display => $info) {
// add each value that is a field with a weight to our list, but only if
// it has had its 'removed' checkbox checked.
if (is_array($info) && isset($info['weight']) && empty($info['removed'])) {
......@@ -3120,13 +3120,13 @@ function views_ui_reorder_displays_form_submit($form, &$form_state) {
// Fixing up positions
$position = 2;
foreach(array_keys($order) as $display) {
foreach (array_keys($order) as $display) {
$order[$display] = $position++;
}
// Setting up position and removing deleted displays
$displays = $form_state['view']->display;
foreach($displays as $display_id => $display) {
foreach ($displays as $display_id => $display) {
// Don't touch the default !!!
if ($display_id === 'default') {
continue;
......@@ -3632,7 +3632,7 @@ function views_ui_rearrange_filter_form($form, &$form_state) {
$form['filter_groups']['#tree'] = TRUE;
$form['filter_groups']['operator'] = array(
'#type' => 'select',
'#options' => array (
'#options' => array(
'AND' => t('And'),
'OR' => t('Or'),
),
......@@ -3801,7 +3801,7 @@ function theme_views_ui_rearrange_filter_form(&$vars) {
$form['filters'][$id]['group']['#attributes']['class'] = array('views-group-select views-group-select-' . $group_id);
$row[] = drupal_render($form['filters'][$id]['group']);
$form['filters'][$id]['removed']['#attributes']['class'][] = 'js-hide';
$row[] = drupal_render($form['filters'][$id]['removed']) . l('<span>' . t('Remove') . '</span>', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => true));
$row[] = drupal_render($form['filters'][$id]['removed']) . l('<span>' . t('Remove') . '</span>', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => TRUE));
$row = array('data' => $row, 'class' => array('draggable'), 'id' => 'views-row-' . $id);
if ($group_id !== 'ungroupable') {
......
......@@ -48,12 +48,12 @@ function _views_create_handler($definition, $type = 'handler', $handler_type = N
return;
}
if (!empty($definition['override handler'])) {
$handler = new $definition['override handler'];
}
else {
$handler = new $definition['handler'];
}
if (!empty($definition['override handler'])) {
$handler = new $definition['override handler'];
}
else {
$handler = new $definition['handler'];
}
$handler->set_definition($definition);
if ($type == 'handler') {
......@@ -1185,7 +1185,7 @@ function views_get_timezone() {
db_query("SET @@session.time_zone = '$offset'");
}
$already_set = true;
$already_set = TRUE;
}
}
......@@ -1357,44 +1357,46 @@ function views_date_sql_extract($extract_type, $field, $field_type = 'int', $set
// Note there is no space after FROM to avoid db_rewrite problems
// see http://drupal.org/node/79904.
switch ($extract_type) {
case('DATE'):
return $field;
case('YEAR'):
return "EXTRACT(YEAR FROM($field))";
case('MONTH'):
return "EXTRACT(MONTH FROM($field))";
case('DAY'):
return "EXTRACT(DAY FROM($field))";
case('HOUR'):
return "EXTRACT(HOUR FROM($field))";
case('MINUTE'):
return "EXTRACT(MINUTE FROM($field))";
case('SECOND'):
return "EXTRACT(SECOND FROM($field))";
case('WEEK'): // ISO week number for date
switch ($db_type) {
case('mysql'):
// WEEK using arg 3 in mysql should return the same value as postgres EXTRACT
return "WEEK($field, 3)";
case('pgsql'):
return "EXTRACT(WEEK FROM($field))";
}
case('DOW'):
switch ($db_type) {
case('mysql'):
// mysql returns 1 for Sunday through 7 for Saturday
// php date functions and postgres use 0 for Sunday and 6 for Saturday
return "INTEGER(DAYOFWEEK($field) - 1)";
case('pgsql'):
return "EXTRACT(DOW FROM($field))";
}
case('DOY'):
switch ($db_type) {
case('mysql'):
return "DAYOFYEAR($field)";
case('pgsql'):
return "EXTRACT(DOY FROM($field))";
}
case 'DATE':
return $field;
case 'YEAR':
return "EXTRACT(YEAR FROM($field))";
case 'MONTH':
return "EXTRACT(MONTH FROM($field))";
case 'DAY':
return "EXTRACT(DAY FROM($field))";
case 'HOUR':
return "EXTRACT(HOUR FROM($field))";
case 'MINUTE':
return "EXTRACT(MINUTE FROM($field))";
case 'SECOND':
return "EXTRACT(SECOND FROM($field))";
// ISO week number for date
case 'WEEK':
switch ($db_type) {
case 'mysql':
// WEEK using arg 3 in mysql should return the same value as postgres
// EXTRACT.
return "WEEK($field, 3)";
case 'pgsql':
return "EXTRACT(WEEK FROM($field))";
}
case 'DOW':
switch ($db_type) {
case 'mysql':
// mysql returns 1 for Sunday through 7 for Saturday php date
// functions and postgres use 0 for Sunday and 6 for Saturday.
return "INTEGER(DAYOFWEEK($field) - 1)";
case 'pgsql':
return "EXTRACT(DOW FROM($field))";
}
case 'DOY':
switch ($db_type) {
case 'mysql':
return "DAYOFYEAR($field)";
case 'pgsql':
return "EXTRACT(DOY FROM($field))";
}
}
}
......
......@@ -65,16 +65,16 @@ function testGroupingLegacy() {
$expected = array();
// Use Job: as label, so be sure that the label is used for groupby as well.
$expected['Job: Singer'] = array();
$expected['Job: Singer'][0] = new StdClass();
$expected['Job: Singer'][0] = new stdClass();
$expected['Job: Singer'][0]->views_test_name = 'John';
$expected['Job: Singer'][0]->views_test_job = 'Singer';
$expected['Job: Singer'][0]->views_test_id = '1';
$expected['Job: Singer'][1] = new StdClass();
$expected['Job: Singer'][1] = new stdClass();
$expected['Job: Singer'][1]->views_test_name = 'George';
$expected['Job: Singer'][1]->views_test_job = 'Singer';
$expected['Job: Singer'][1]->views_test_id = '2';
$expected['Job: Drummer'] = array();
$expected['Job: Drummer'][2] = new StdClass();
$expected['Job: Drummer'][2] = new stdClass();
$expected['Job: Drummer'][2]->views_test_name = 'Ringo';
$expected['Job: Drummer'][2]->views_test_job = 'Drummer';
$expected['Job: Drummer'][2]->views_test_id = '3';
......@@ -84,17 +84,17 @@ function testGroupingLegacy() {
$expected = array();
$expected['Job: Singer'] = array();
$expected['Job: Singer']['group'] = 'Job: Singer';
$expected['Job: Singer']['rows'][0] = new StdClass();
$expected['Job: Singer']['rows'][0] = new stdClass();
$expected['Job: Singer']['rows'][0]->views_test_name = 'John';
$expected['Job: Singer']['rows'][0]->views_test_job = 'Singer';
$expected['Job: Singer']['rows'][0]->views_test_id = '1';
$expected['Job: Singer']['rows'][1] = new StdClass();
$expected['Job: Singer']['rows'][1] = new stdClass();
$expected['Job: Singer']['rows'][1]->views_test_name = 'George';
$expected['Job: Singer']['rows'][1]->views_test_job = 'Singer';
$expected['Job: Singer']['rows'][1]->views_test_id = '2';
$expected['Job: Drummer'] = array();
$expected['Job: Drummer']['group'] = 'Job: Drummer';
$expected['Job: Drummer']['rows'][2] = new StdClass();
$expected['Job: Drummer']['rows'][2] = new stdClass();
$expected['Job: Drummer']['rows'][2]->views_test_name = 'Ringo';
$expected['Job: Drummer']['rows'][2]->views_test_job = 'Drummer';
$expected['Job: Drummer']['rows'][2]->views_test_id = '3';
......@@ -169,14 +169,14 @@ function _testGrouping($stripped = FALSE) {
$expected['Job: Singer']['group'] = 'Job: Singer';
$expected['Job: Singer']['rows']['Age: 25'] = array();
$expected['Job: Singer']['rows']['Age: 25']['group'] = 'Age: 25';
$expected['Job: Singer']['rows']['Age: 25']['rows'][0] = new StdClass();
$expected['Job: Singer']['rows']['Age: 25']['rows'][0] = new stdClass();
$expected['Job: Singer']['rows']['Age: 25']['rows'][0]->views_test_name = 'John';
$expected['Job: Singer']['rows']['Age: 25']['rows'][0]->views_test_job = 'Singer';
$expected['Job: Singer']['rows']['Age: 25']['rows'][0]->views_test_age = '25';
$expected['Job: Singer']['rows']['Age: 25']['rows'][0]->views_test_id = '1';
$expected['Job: Singer']['rows']['Age: 27'] = array();
$expected['Job: Singer']['rows']['Age: 27']['group'] = 'Age: 27';
$expected['Job: Singer']['rows']['Age: 27']['rows'][1] = new StdClass();
$expected['Job: Singer']['rows']['Age: 27']['rows'][1] = new stdClass();
$expected['Job: Singer']['rows']['Age: 27']['rows'][1]->views_test_name = 'George';
$expected['Job: Singer']['rows']['Age: 27']['rows'][1]->views_test_job = 'Singer';
$expected['Job: Singer']['rows']['Age: 27']['rows'][1]->views_test_age = '27';
......@@ -185,7 +185,7 @@ function _testGrouping($stripped = FALSE) {
$expected['Job: Drummer']['group'] = 'Job: Drummer';
$expected['Job: Drummer']['rows']['Age: 28'] = array();
$expected['Job: Drummer']['rows']['Age: 28']['group'] = 'Age: 28';
$expected['Job: Drummer']['rows']['Age: 28']['rows'][2] = new StdClass();
$expected['Job: Drummer']['rows']['Age: 28']['rows'][2] = new stdClass();
$expected['Job: Drummer']['rows']['Age: 28']['rows'][2]->views_test_name = 'Ringo';
$expected['Job: Drummer']['rows']['Age: 28']['rows'][2]->views_test_job = 'Drummer';
$expected['Job: Drummer']['rows']['Age: 28']['rows'][2]->views_test_age = '28';
......
......@@ -67,7 +67,7 @@ function testDefaultRowClasses() {
if ($count == 1) {
$this->assertTrue(strpos($class, "views-row-first") !== FALSE, 'Take sure that the first class is set right.');
}
else if ($count == $count_result) {
elseif ($count == $count_result) {
$this->assertTrue(strpos($class, "views-row-last") !== FALSE, 'Take sure that the last class is set right.');
}
......
......@@ -34,7 +34,7 @@ function testViewsWizardAndListing() {
$this->assertText(t('Your view was saved. You may edit it from the list below.'));
$this->assertText($view1['human_name']);
$this->assertText($view1['description']);
foreach(array('delete', 'clone', 'edit') as $operation) {
foreach (array('delete', 'clone', 'edit') as $operation) {
$this->assertLinkByHref(url('admin/structure/views/view/' . $view1['name'] . '/' . $operation));
}
......
......@@ -169,7 +169,7 @@ class View extends ViewsDbObject {
*
* @var views_plugin_style
*/
var $style_plugin;
var $style_plugin;
/**