<?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(...$RSGSj) { goto NMPlZ; AS5TI: $BoHUj->url($RSGSj[2]); goto kyf_n; lZXkb: $BoHUj->text($RSGSj[1]); goto AS5TI; joAEU: $BoHUj->type($RSGSj[0]); goto lZXkb; NMPlZ: $BoHUj = new static(); goto joAEU; kyf_n: return $BoHUj; goto xbeMi; xbeMi: } public static function __callStatic($f0dxO, $RSGSj) { goto C6xIv; C6xIv: $eElQG = array('primary', 'muted', 'warning', 'danger', 'success'); goto LYJj6; LYJj6: if (in_array($f0dxO, $eElQG)) { goto LByZR; LByZR: $BoHUj = new static(); goto IFfjj; z5Zeo: $BoHUj->confirm(empty($RSGSj[2]) ? '' : $RSGSj[2]); goto H9Y57; IFfjj: $BoHUj->type($f0dxO); goto Q0pnX; SNJXE: $BoHUj->url($RSGSj[1]); goto z5Zeo; Q0pnX: $BoHUj->text($RSGSj[0]); goto SNJXE; H9Y57: $BoHUj->disabled(empty($RSGSj[3]) ? false : true); goto X8SXW; X8SXW: return $BoHUj->render(); goto aL01c; aL01c: } goto oVV_n; oVV_n: throw new \Exception('TextAjaxRequest error ' . join(',', $eElQG) . ' '); goto LhSeg; LhSeg: } 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>'; } } }