<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget; use ModStart\ModStart; class TextAction extends AbstractWidget { public static function getAssets() { return array('style' => '.ub-text-action{display:inline-block;margin-right:0.5rem;}'); } public static function __callStatic($glP3G, $bY7Wp) { goto NY94s; NY94s: $DslRv = array('primary', 'muted', 'warning', 'danger', 'success'); goto TLNgT; FTclK: throw new \Exception('TextAction error ' . join(',', $DslRv) . ' '); goto j3Spr; TLNgT: if (in_array($glP3G, $DslRv)) { goto kg0Io; WOJKN: $bMeyO->text($bY7Wp[0]); goto dtVtY; teI8W: return $bMeyO->render(); goto I8gpW; dtVtY: $bMeyO->attr(empty($bY7Wp[1]) ? '' : $bY7Wp[1]); goto teI8W; UYoS6: $bMeyO->type($glP3G); goto WOJKN; kg0Io: $bMeyO = new static(); goto UYoS6; I8gpW: } goto FTclK; j3Spr: } public function render() { if ($this->disabled) { return '<a href="javascript:;" class="ub-text-action ub-text-muted">' . $this->text . '</span>'; } else { return '<a href="javascript:;" class="ub-text-action ub-text-' . ($this->type == 'primary' ? '' : $this->type) . '" ' . $this->attr . '>' . $this->text . '</span>'; } } }