<?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($rDg26) { parent::__construct(IdUtil::generate('LayoutTab')); $this->layoutClosure = $rDg26; } public function postSetup() { goto ho72e; Kz7Dc: $BlfaU = $this->column(); goto u_oLw; kzlp9: $DVBAT = array_map(function ($Cq64_) { return '<a href="javascript:;">' . $Cq64_ . '</a>'; }, $this->tabTitles); goto XuQE3; GMGX_: call_user_func($this->layoutClosure, $this); goto kzlp9; u_oLw: $GTC5M = "<script>\n\$(function(){\n    var tab = \$('[data-layout-tab={$BlfaU}]');\n    tab.find('.ub-nav-tab').html({$DVBAT});\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 pD0jA; XuQE3: $DVBAT = SerializeUtil::jsonEncode(join('', $DVBAT)); goto Kz7Dc; ho72e: $this->context->html($this->column() . '_end')->html('<div data-layout-tab="' . $this->column() . '"><div class="ub-nav-tab"></div><div>')->plain(); goto GMGX_; pD0jA: $this->context->html($this->column() . '_end')->html('</div></div>' . $GTC5M)->plain(); goto jS1HT; jS1HT: } public function tab($Cq64_, $rDg26) { goto KIfHy; fKP3h: $this->context->html($this->column() . '_end')->html('<div class="ub-nav-tab-body hidden">')->plain(); goto fXoLE; N0o17: $this->context->html($this->column() . '_end')->html('</div>')->plain(); goto OFv5P; fXoLE: call_user_func($rDg26, $this->context); goto N0o17; KIfHy: $this->tabTitles[] = $Cq64_; goto fKP3h; OFv5P: } public function render() { return ''; } }