<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Layout; use ModStart\Core\Util\IdUtil; use ModStart\Core\Util\SerializeUtil; use ModStart\Field\AbstractField; class LayoutTab extends AbstractField { protected $isLayoutField = true; private $layoutClosure = null; private $tabTitles = array(); public function __construct($H7deD) { parent::__construct(IdUtil::generate('LayoutTab')); $this->layoutClosure = $H7deD; } public function postSetup() { goto RxOvZ; UYT3c: call_user_func($this->layoutClosure, $this); goto B1FMu; RxOvZ: $this->context->html($this->column() . '_end')->html('<div data-layout-tab="' . $this->column() . '"><div class="ub-nav-tab"></div><div>')->plain(); goto UYT3c; H190l: $ReP61 = "<script>\n\$(function(){\n    var tab = \$('[data-layout-tab={$t_tdX}]');\n    tab.find('.ub-nav-tab').html({$lqIIM});\n    var tabAs = tab.find('.ub-nav-tab > a');\n    var active = function(index){\n        tabAs.removeClass('active').eq(index).addClass('active');\n        tab.find('.ub-nav-tab-body').addClass('hidden').eq(index).removeClass('hidden');\n    };\n    active(0);\n    tab.on('click','a',function(){\n        active(tabAs.index(this));\n    });\n});\n</script>"; goto Mw4_2; FMQ0H: $lqIIM = SerializeUtil::jsonEncode(join('', $lqIIM)); goto nhr0B; nhr0B: $t_tdX = $this->column(); goto H190l; B1FMu: $lqIIM = array_map(function ($WtBPF) { return '<a href="javascript:;">' . $WtBPF . '</a>'; }, $this->tabTitles); goto FMQ0H; Mw4_2: $this->context->html($this->column() . '_end')->html('</div></div>' . $ReP61)->plain(); goto b4Dvj; b4Dvj: } public function tab($WtBPF, $H7deD) { goto AUo_h; AUo_h: $this->tabTitles[] = $WtBPF; goto ypWNf; b4gmS: $this->context->html($this->column() . '_end')->html('</div>')->plain(); goto rCTIA; ypWNf: $this->context->html($this->column() . '_end')->html('<div class="ub-nav-tab-body hidden">')->plain(); goto p_i4N; p_i4N: call_user_func($H7deD, $this->context); goto b4gmS; rCTIA: } public function render() { return ''; } }