<?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($ZZMEd, $rxS2C) { goto kSdkn; kSdkn: $Rmgm_ = array('primary', 'muted', 'warning', 'danger', 'success'); goto FYzpC; I3xFQ: throw new \Exception('TextAction error ' . join(',', $Rmgm_) . ' '); goto piI1I; FYzpC: if (in_array($ZZMEd, $Rmgm_)) { goto MLchd; MLchd: $ZceHo = new static(); goto tH_wr; Jnatc: $ZceHo->text($rxS2C[0]); goto PAc1K; ka73p: return $ZceHo->render(); goto KxTUF; PAc1K: $ZceHo->attr(empty($rxS2C[1]) ? '' : $rxS2C[1]); goto ka73p; tH_wr: $ZceHo->type($ZZMEd); goto Jnatc; KxTUF: } goto I3xFQ; piI1I: } 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>'; } } }