Commit be6f421c authored by webchick's avatar webchick

Issue #1849610 by mgifford, edrupal, dawehner, rootwork, falcon03: Improve...

Issue #1849610 by mgifford, edrupal, dawehner, rootwork, falcon03: Improve 'add' links accessibility.
parent 4d02ee3c
......@@ -919,17 +919,24 @@ public function getFormBucket(ViewUI $view, $type, $display) {
// Create an array of actions to pass to theme_links
$actions = array();
$count_handlers = count($executable->display_handler->getHandlers($type));
// Create the add text variable for the add action.
$add_text = t('Add <span class="element-invisible">@type</span>', array('@type' => $types[$type]['ltitle']));
$actions['add'] = array(
'title' => t('Add'),
'title' => $add_text,
'href' => "admin/structure/views/nojs/add-item/{$view->id()}/{$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'), 'id' => 'views-add-' . $type),
'html' => TRUE,
);
if ($count_handlers > 0) {
// Create the rearrange text variable for the rearrange action.
$rearrange_text = $type == 'filter' ? t('And/Or Rearrange <span class="element-invisible">filter criteria</span>') : t('Rearrange <span class="element-invisible">@type</span>', array('@type' => $types[$type]['ltitle']));
$actions['rearrange'] = array(
'title' => $rearrange_text,
'href' => $rearrange_url,
'attributes' => array('class' => array($class, 'views-ajax-link'), 'title' => t('Rearrange'), 'id' => 'views-rearrange-' . $type),
'attributes' => array('class' => array($class, 'views-ajax-link'), 'id' => 'views-rearrange-' . $type),
'html' => TRUE,
);
}
......
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