<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget; use ModStart\ModStart; class ButtonAjaxRequest extends AbstractWidget { public static function getAssets() { return array('style' => '.ub-button-ajax-request{display:inline-block;}'); } public static function __callStatic($XggBq, $lUGZC) { goto dN0sJ; dN0sJ: $T9vBG = array('muted', 'warning', 'danger', 'success', 'primary'); goto jaaEX; jaaEX: if (in_array($XggBq, $T9vBG)) { goto yy_Zl; YlFVQ: $IEFeS->type($XggBq); goto iSRPo; RbAY7: $IEFeS->disabled(empty($lUGZC[3]) ? false : true); goto U9ZDx; U9ZDx: return $IEFeS->render(); goto tbL3D; JRZGH: $IEFeS->url($lUGZC[1]); goto Dg1f3; iSRPo: $IEFeS->text($lUGZC[0]); goto JRZGH; Dg1f3: $IEFeS->confirm(empty($lUGZC[2]) ? '' : $lUGZC[2]); goto RbAY7; yy_Zl: $IEFeS = new static(); goto YlFVQ; tbL3D: } goto JD5u_; JD5u_: throw new \Exception('ButtonAjaxRequest error ' . join(',', $T9vBG) . ' '); goto skhUN; skhUN: } public function render() { if ($this->disabled) { return '<a href="javascript:;" class="btn ub-button-ajax-request btn-' . $this->type . '">' . $this->text . '</a>'; } else { return '<a href="javascript:;" ' . ($this->confirm ? 'data-confirm="' . $this->confirm . '"' : '') . ' data-ajax-request-loading data-ajax-request="' . $this->url . '" class="btn ub-button-ajax-request btn-' . $this->type . '">' . $this->text . '</a>'; } } }