<?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($TUuqF, $MVaFK) { goto bvk8n; S2dT9: if (in_array($TUuqF, $U0Xav)) { goto KzTvv; KzTvv: $xU_gb = new static(); goto NXXGm; RJ5pU: $xU_gb->disabled(empty($MVaFK[3]) ? false : true); goto QZWXp; NXXGm: $xU_gb->type($TUuqF); goto x5XgH; q7R_i: $xU_gb->confirm(empty($MVaFK[2]) ? '' : $MVaFK[2]); goto RJ5pU; x5XgH: $xU_gb->text($MVaFK[0]); goto exHdA; exHdA: $xU_gb->url($MVaFK[1]); goto q7R_i; QZWXp: return $xU_gb->render(); goto Z13Q3; Z13Q3: } goto CfNGE; bvk8n: $U0Xav = array('muted', 'warning', 'danger', 'success', 'primary'); goto S2dT9; CfNGE: throw new \Exception('ButtonAjaxRequest error ' . join(',', $U0Xav) . ' '); goto LtwSN; LtwSN: } 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>'; } } }