Elgg
Version 2.3
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
views
default
navigation
tabs.php
Go to the documentation of this file.
1
<?php
17
$options
=
$vars
;
18
19
$type
=
elgg_extract
(
'type'
,
$vars
,
'horizontal'
);
20
21
if
(
$type
==
'horizontal'
) {
22
$options
[
'class'
] =
"elgg-tabs elgg-htabs"
;
23
}
else
{
24
$options
[
'class'
] =
"elgg-tabs elgg-vtabs"
;
25
}
26
if
(isset(
$vars
[
'class'
])) {
27
$options
[
'class'
] =
"{$options['class']} {$vars['class']}"
;
28
}
29
30
unset(
$options
[
'tabs'
]);
31
unset(
$options
[
'type'
]);
32
33
$attributes
=
elgg_format_attributes
(
$options
);
34
35
if
(isset(
$vars
[
'tabs'
]) && is_array(
$vars
[
'tabs'
]) && !empty(
$vars
[
'tabs'
])) {
36
?>
37
<ul <?php echo $attributes; ?>>
38
<?php
39
foreach
(
$vars
[
'tabs'
] as
$info
) {
40
$class
=
elgg_extract
(
'class'
, $info,
''
);
41
$id
=
elgg_extract
(
'id'
, $info,
''
);
42
43
$selected =
elgg_extract
(
'selected'
, $info, FALSE);
44
if
($selected) {
45
$class
.=
' elgg-state-selected'
;
46
}
47
48
$class_str = (
$class
) ?
"class=\"$class\""
:
''
;
49
$id_str = (
$id
) ?
"id=\"$id\""
:
''
;
50
51
$options
=
$info
;
52
unset(
$options
[
'class'
]);
53
unset(
$options
[
'id'
]);
54
unset(
$options
[
'selected'
]);
55
56
if
(!isset($info[
'href'
]) && isset($info[
'url'
])) {
57
$options
[
'href'
] = $info[
'url'
];
58
unset(
$options
[
'url'
]);
59
}
60
if
(!isset($info[
'text'
]) && isset($info[
'title'
])) {
61
$options
[
'text'
] =
$options
[
'title'
];
62
unset(
$options
[
'title'
]);
63
}
64
if
(isset($info[
'link_class'
])) {
65
$options
[
'class'
] =
$options
[
'link_class'
];
66
unset(
$options
[
'link_class'
]);
67
}
68
69
if
(isset($info[
'link_id'
])) {
70
$options
[
'id'
] =
$options
[
'link_id'
];
71
unset(
$options
[
'link_id'
]);
72
}
73
74
$link
=
elgg_view
(
'output/url'
,
$options
);
75
76
echo
"<li $id_str $class_str>$link</li>"
;
77
}
78
?>
79
</
ul
>
80
<?php
81
}
$options
$options
Tab navigation.
Definition:
tabs.php:17
$class
$class
Definition:
field.php:20
$link
$link
Definition:
container.php:14
$info
if($screenshots) $info
Definition:
details.php:58
ul
ul
Definition:
admin.css.php:44
$type
$type
Definition:
tabs.php:19
echo
elgg echo
Translates a string.
Definition:
languages.js:48
$id
$id
Tabbed module component Provides support for inline and ajax tabbing.
Definition:
tabs.php:33
elgg_view
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition:
views.php:336
elgg_format_attributes
elgg_format_attributes(array $attrs=array())
Converts an associative array into a string of well-formed HTML/XML attributes Returns a concatenated...
Definition:
output.php:129
elgg_extract
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition:
elgglib.php:1375
$attributes
$attributes
Definition:
tabs.php:33
$vars
if(!isset($vars['id'])) $vars['id']
Definition:
tabs.php:37
Generated on Sat Dec 21 2024 00:01:05 for Elgg by
1.8.11