<?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(...$HPXJC) { goto gfimh; gfimh: $WwLCq = new static(); goto L4b1K; nZ10d: $WwLCq->text($HPXJC[1]); goto UGK2n; MNm6J: return $WwLCq; goto FEpQx; UGK2n: $WwLCq->url($HPXJC[2]); goto MNm6J; L4b1K: $WwLCq->type($HPXJC[0]); goto nZ10d; FEpQx: } public static function __callStatic($rPkIY, $HPXJC) { goto HdzJu; mVSMQ: if (in_array($rPkIY, $XVuOQ)) { goto lnanQ; J5YBU: $WwLCq->url($HPXJC[1]); goto uSRY0; VRAQM: return $WwLCq->render(); goto WE63r; k8BLJ: $WwLCq->type($rPkIY); goto ot5xp; ot5xp: $WwLCq->text($HPXJC[0]); goto J5YBU; lnanQ: $WwLCq = new static(); goto k8BLJ; JjhJ8: $WwLCq->disabled(empty($HPXJC[3]) ? false : true); goto VRAQM; uSRY0: $WwLCq->confirm(empty($HPXJC[2]) ? '' : $HPXJC[2]); goto JjhJ8; WE63r: } goto sGvfi; HdzJu: $XVuOQ = array('primary', 'muted', 'warning', 'danger', 'success'); goto mVSMQ; sGvfi: throw new \Exception('TextAjaxRequest error ' . join(',', $XVuOQ) . ' '); goto pUYz4; pUYz4: } 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>'; } } }