<?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($FOLBJ) { parent::__construct(IdUtil::generate('LayoutTab')); $this->layoutClosure = $FOLBJ; } public function postSetup() { goto NmzcD; dkasx: $GR5Ef = $this->column(); goto gH2na; V07CP: $this->context->html($this->column() . '_end')->html('</div></div>' . $EAeVI)->plain(); goto i25DB; PBhDd: call_user_func($this->layoutClosure, $this); goto HJpuy; HJpuy: $O6YhQ = array_map(function ($sEiap) { return '<a href="javascript:;">' . $sEiap . '</a>'; }, $this->tabTitles); goto yPsGP; gH2na: $EAeVI = "<script>\n\$(function(){\n    var tab = \$('[data-layout-tab={$GR5Ef}]');\n    tab.find('.ub-nav-tab').html({$O6YhQ});\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 V07CP; NmzcD: $this->context->html($this->column() . '_end')->html('<div data-layout-tab="' . $this->column() . '"><div class="ub-nav-tab"></div><div>')->plain(); goto PBhDd; yPsGP: $O6YhQ = SerializeUtil::jsonEncode(join('', $O6YhQ)); goto dkasx; i25DB: } public function tab($sEiap, $FOLBJ) { goto T5kYA; WJSR8: $this->context->html($this->column() . '_end')->html('</div>')->plain(); goto HFgX2; XIDjw: $this->context->html($this->column() . '_end')->html('<div class="ub-nav-tab-body hidden">')->plain(); goto Z1OJN; Z1OJN: call_user_func($FOLBJ, $this->context); goto WJSR8; T5kYA: $this->tabTitles[] = $sEiap; goto XIDjw; HFgX2: } public function render() { return ''; } }