Commit 9c3a0a80 authored by merlinofchaos's avatar merlinofchaos

#270854 (partially by webchick): modify UI to remove the "overridden" icon and...

#270854 (partially by webchick): modify UI to remove the "overridden" icon and instead change display on items that are "defaulted" to make them more visually unique.
parent 4ef871b4
......@@ -9,6 +9,12 @@
background-color: white;
}
.views-tabset a:visited,
.views-tabset a:hover,
.views-tabset a {
color: #027AC6;
}
.views-tabset .views-tab fieldset {
margin-top: 0;
}
......@@ -483,11 +489,24 @@ div.changed div.view-changed {
}
.views-display .tab-section .inside .overridden {
/* all this so we odn't mess up background-color */
background-image: url(/themes/garland/images/menu-leaf.gif);
/* all this so we don't mess up background-color */
/* background-image: url(../images/overridden.gif);
background-repeat: no-repeat;
background-position: left;
padding-left: 10px;
padding-left: 10px; */
}
.views-display .tab-section .views-category-content.overridden {
background-image: none;
}
.views-display .tab-section .inside .defaulted {
color: #aaa;
font-style: italic;
}
.views-display .tab-section .inside .defaulted a {
font-style: italic;
}
.hilited {
......
......@@ -1067,6 +1067,8 @@ function template_preprocess_views_ui_edit_tab(&$vars) {
$data = &$categories[$option['category']]['data'][$id];
$data['content'] = '';
$data['links'] = '';
$data['overridden'] = FALSE;
$data['defaulted'] = FALSE;
// If there are optional links, build them first so they float properly.
if (!empty($option['links'])) {
......@@ -1081,11 +1083,14 @@ function template_preprocess_views_ui_edit_tab(&$vars) {
$data['content'] .= $display->handler->option_link($option['value'], $id, '', empty($option['desc']) ? '' : $option['desc']);
if (!empty($display->handler->options['defaults'][$id])) {
$display_id = 'default';
$data['defaulted'] = TRUE;
}
else {
$display_id = $display->id;
if ($display->handler->defaultable_sections($id) && !$display->handler->is_default_display()) {
$data['overridden'] = TRUE;
if (!$display->handler->is_default_display()) {
if ($display->handler->defaultable_sections($id)) {
$data['overridden'] = TRUE;
}
}
}
$data['class'] = views_ui_item_css($display_id . '-' . $id);
......@@ -1149,6 +1154,7 @@ function template_preprocess_views_ui_edit_item(&$vars) {
$vars['rearrange'] = NULL;
$vars['add'] = NULL;
$vars['overridden'] = FALSE;
$vars['defaulted'] = FALSE;
return;
}
......@@ -1156,7 +1162,14 @@ function template_preprocess_views_ui_edit_item(&$vars) {
$vars['add'] = l('<span>' . t('Add') . '</span>', "admin/build/views/nojs/add-item/$view->name/$display->id/$type", array('attributes' => array('class' => 'views-button-add views-ajax-link', 'title' => t('Add')), 'html' => true));
$vars['overridden'] = !$display->handler->is_default_display() && !$display->handler->is_defaulted($types[$type]['plural']);
if (!$display->handler->is_default_display()) {
if (!$display->handler->is_defaulted($types[$type]['plural'])) {
$vars['overridden'] = TRUE;
}
else {
$vars['defaulted'] = TRUE;
}
}
$vars['title'] = l($types[$type]['title'], "admin/build/views/nojs/config-type/$view->name/$display->id/$type", array('attributes' => array('class' => 'views-ajax-link')));
// $vars['title'] = l($types[$type]['title'], "admin/build/views/nojs/config-type/$view->name/$display->id/$type", array('attributes' => array('class' => 'views-ajax-link')));
......
......@@ -8,12 +8,26 @@
?>
<?php print $rearrange; ?>
<?php print $add; ?>
<div class="views-category-title<?php if ($overridden) { print ' overridden'; }?>">
<div class="views-category-title<?php
if ($overridden) {
print ' overridden';
}
if ($defaulted) {
print ' defaulted';
}
?>">
<?php print $item_help_icon; ?>
<?php print $title; ?>
</div>
<div class="views-category-content">
<div class="views-category-content<?php
if ($overridden) {
print ' overridden';
}
if ($defaulted) {
print ' defaulted';
}
?>">
<?php if (!empty($no_fields)): ?>
<div><?php print t('The style selected does not utilize fields.'); ?></div>
<?php elseif (empty($fields)): ?>
......
......@@ -44,7 +44,17 @@
</div>
<div class="views-category-content">
<?php foreach ($category['data'] as $data): ?>
<div class="<?php print $data['class']; if (!empty($data['overridden'])) { print ' overridden'; } if (!empty($data['changed'])) { print ' changed'; }?>">
<div class="<?php
print $data['class'];
if (!empty($data['overridden'])) {
print ' overridden';
}
if (!empty($data['defaulted'])) {
print ' defaulted';
}
if (!empty($data['changed'])) {
print ' changed';
}?>">
<?php print $data['links'] . $data['content'] ?>
</div>
<?php endforeach; ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment