From 8c73e5da141ea76f10973936267aa726d8892ad3 Mon Sep 17 00:00:00 2001 From: Ismayil Khayredinov Date: Fri, 23 Dec 2011 16:19:23 +0100 Subject: fixes for tab rendering --- views/default/navigation/tabs.php | 92 ++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 41 deletions(-) (limited to 'views') diff --git a/views/default/navigation/tabs.php b/views/default/navigation/tabs.php index e8fde3579..219646c64 100644 --- a/views/default/navigation/tabs.php +++ b/views/default/navigation/tabs.php @@ -5,8 +5,8 @@ * @uses string $vars['type'] horizontal || vertical - Defaults to horizontal * @uses string $vars['class'] Additional class to add to ul * @uses array $vars['tabs'] A multi-dimensional array of tab entries in the format array( - * 'title' => string, // Title of link - * 'url' => string, // URL for the link + * 'text' => string, // Title of link + * 'href' => string, // URL for the link * 'class' => string // Class of the li element * 'id' => string, // ID of the li element * 'selected' => bool // if this li element is currently selected @@ -15,58 +15,68 @@ * ) */ +$options = elgg_clean_vars($vars); + $type = elgg_extract('type', $vars, 'horizontal'); + if ($type == 'horizontal') { - $type_class = "elgg-tabs elgg-htabs"; + $options['class'] = "elgg-tabs elgg-htabs"; } else { - $type_class = "elgg-tabs elgg-vtabs"; + $options['class'] = "elgg-tabs elgg-vtabs"; } - if (isset($vars['class'])) { - $type_class = "$type_class {$vars['class']}"; + $options['class'] = "{$options['class']} {$vars['class']}"; } +unset($options['tabs']); +unset($options['type']); + +$options = elgg_format_attributes($options); + if (isset($vars['tabs']) && is_array($vars['tabs']) && !empty($vars['tabs'])) { -?> - + Date: Fri, 23 Dec 2011 23:48:53 +0100 Subject: fixes spacing. add a note on text/title --- views/default/navigation/tabs.php | 77 +++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 39 deletions(-) (limited to 'views') diff --git a/views/default/navigation/tabs.php b/views/default/navigation/tabs.php index 219646c64..6159fbfa5 100644 --- a/views/default/navigation/tabs.php +++ b/views/default/navigation/tabs.php @@ -5,7 +5,7 @@ * @uses string $vars['type'] horizontal || vertical - Defaults to horizontal * @uses string $vars['class'] Additional class to add to ul * @uses array $vars['tabs'] A multi-dimensional array of tab entries in the format array( - * 'text' => string, // Title of link + * 'text' => string, // The string between the tags. If not set, 'title' parameter will be used instead * 'href' => string, // URL for the link * 'class' => string // Class of the li element * 'id' => string, // ID of the li element @@ -14,7 +14,6 @@ * 'url_id' => string, // ID to pass to the link * ) */ - $options = elgg_clean_vars($vars); $type = elgg_extract('type', $vars, 'horizontal'); @@ -34,49 +33,49 @@ unset($options['type']); $options = elgg_format_attributes($options); if (isset($vars['tabs']) && is_array($vars['tabs']) && !empty($vars['tabs'])) { - ?> - + Date: Wed, 4 Jan 2012 21:31:53 -0500 Subject: updated options on navigation/tabs --- mod/embed/views/default/navigation/menu/embed.php | 2 +- views/default/navigation/tabs.php | 24 +++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'views') diff --git a/mod/embed/views/default/navigation/menu/embed.php b/mod/embed/views/default/navigation/menu/embed.php index 1a6a18f05..bca673f59 100644 --- a/mod/embed/views/default/navigation/menu/embed.php +++ b/mod/embed/views/default/navigation/menu/embed.php @@ -10,7 +10,7 @@ foreach ($vars['menu']['default'] as $menu_item) { $tabs[] = array( 'title' => $menu_item->getText(), 'url' => 'embed/tab/' . $menu_item->getName(), - 'url_class' => 'embed-section', + 'link_class' => 'embed-section', 'selected' => $menu_item->getSelected(), ); } diff --git a/views/default/navigation/tabs.php b/views/default/navigation/tabs.php index 6159fbfa5..95e3f2669 100644 --- a/views/default/navigation/tabs.php +++ b/views/default/navigation/tabs.php @@ -5,13 +5,13 @@ * @uses string $vars['type'] horizontal || vertical - Defaults to horizontal * @uses string $vars['class'] Additional class to add to ul * @uses array $vars['tabs'] A multi-dimensional array of tab entries in the format array( - * 'text' => string, // The string between the tags. If not set, 'title' parameter will be used instead + * 'text' => string, // The string between the tags * 'href' => string, // URL for the link * 'class' => string // Class of the li element * 'id' => string, // ID of the li element - * 'selected' => bool // if this li element is currently selected - * 'url_class' => string, // Class to pass to the link - * 'url_id' => string, // ID to pass to the link + * 'selected' => bool // if this tab is currently selected (applied to li element) + * 'link_class' => string, // Class to pass to the link + * 'link_id' => string, // ID to pass to the link * ) */ $options = elgg_clean_vars($vars); @@ -30,11 +30,11 @@ if (isset($vars['class'])) { unset($options['tabs']); unset($options['type']); -$options = elgg_format_attributes($options); +$attributes = elgg_format_attributes($options); if (isset($vars['tabs']) && is_array($vars['tabs']) && !empty($vars['tabs'])) { ?> -