<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget; use ModStart\ModStart; class TextAjaxRequest extends AbstractWidget { public static function getAssets() { return array('style' => '.ub-text-ajax-request{display:inline-block;margin-right:0.5rem;}'); } public static function make(...$nvZ9A) { goto ek1m0; ek1m0: $fNHhl = new static(); goto bk2G1; AONVI: return $fNHhl; goto SVKOo; mNKCc: $fNHhl->url($nvZ9A[2]); goto AONVI; wTWDv: $fNHhl->text($nvZ9A[1]); goto mNKCc; bk2G1: $fNHhl->type($nvZ9A[0]); goto wTWDv; SVKOo: } public static function __callStatic($L4owo, $nvZ9A) { goto Plh9G; QPuyq: throw new \Exception('TextAjaxRequest error ' . join(',', $Ai6oc) . ' '); goto yQLUy; Plh9G: $Ai6oc = array('primary', 'muted', 'warning', 'danger', 'success'); goto lBOF0; lBOF0: if (in_array($L4owo, $Ai6oc)) { goto jZicT; mz8Pk: $fNHhl->url($nvZ9A[1]); goto ZHx8g; TFn0d: $fNHhl->text($nvZ9A[0]); goto mz8Pk; jZicT: $fNHhl = new static(); goto ritlT; ritlT: $fNHhl->type($L4owo); goto TFn0d; ZHx8g: $fNHhl->confirm(empty($nvZ9A[2]) ? '' : $nvZ9A[2]); goto dqp0C; dqp0C: $fNHhl->disabled(empty($nvZ9A[3]) ? false : true); goto kS1AY; kS1AY: return $fNHhl->render(); goto nHnLP; nHnLP: } goto QPuyq; yQLUy: } public function render() { if ($this->disabled) { return '<a href="javascript:;" class="ub-text-ajax-request ub-text-' . $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="ub-text-ajax-request ub-text-' . $this->type . '" ' . ' ' . ($this->attr ? $this->attr : '') . '>' . $this->text . '</a>'; } } }