1 <?php
2 /**
3 * Tabs.php
4 *
5 * @author Elvyrra SAS
6 * @license http://rem.mit-license.org/ MIT
7 */
8
9 namespace Hawk;
10
11 /**
12 * This class is used to display a tabset
13 *
14 * @package Layout
15 */
16 class Tabs extends View{
17
18 /**
19 * Display the tabset
20 *
21 * @param array $data The data to inject in the view
22 *
23 * @return string The generated HTML
24 */
25 public static function make($data){
26 if(empty($data['id'])) {
27 $data['id'] = uniqid();
28 }
29 foreach($data['tabs'] as $i => &$tab){
30 if(empty($tab['id'])) {
31 $tab['id'] = uniqid();
32 }
33 if(empty($data['selected'])) {
34 $data['selected'] = $i;
35 }
36 }
37 return parent::make(Theme::getSelected()->getView('tabs.tpl'), $data);
38 }
39 }