<?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 __callStatic($TUuqF, $MVaFK) { goto FCTgW; ShrZ1: throw new \Exception('TextAjaxRequest error ' . join(',', $U0Xav) . ' '); goto bN_mC; a36IU: if (in_array($TUuqF, $U0Xav)) { goto DmYRd; DmYRd: $xU_gb = new static(); goto AdEhg; F6G8o: $xU_gb->text($MVaFK[0]); goto i60mv; VP8h2: $xU_gb->confirm(empty($MVaFK[2]) ? '' : $MVaFK[2]); goto KTbHS; KTbHS: $xU_gb->disabled(empty($MVaFK[3]) ? false : true); goto Ybp81; AdEhg: $xU_gb->type($TUuqF); goto F6G8o; Ybp81: return $xU_gb->render(); goto NVWDH; i60mv: $xU_gb->url($MVaFK[1]); goto VP8h2; NVWDH: } goto ShrZ1; FCTgW: $U0Xav = array('primary', 'muted', 'warning', 'danger', 'success'); goto a36IU; bN_mC: } 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->text . '</a>'; } } }