<?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(...$lLyBI) { goto epy_W; FTAth: $SKGnU->url($lLyBI[2]); goto H6Jzz; rghz_: $SKGnU->text($lLyBI[1]); goto FTAth; epy_W: $SKGnU = new static(); goto xyGm9; H6Jzz: return $SKGnU; goto NSmHO; xyGm9: $SKGnU->type($lLyBI[0]); goto rghz_; NSmHO: } public static function __callStatic($c6VKG, $lLyBI) { goto famjm; famjm: $YoRvD = array('primary', 'muted', 'warning', 'danger', 'success'); goto hNhzY; RuTAC: throw new \Exception('TextAjaxRequest error ' . join(',', $YoRvD) . ' '); goto WxLuY; hNhzY: if (in_array($c6VKG, $YoRvD)) { goto jXrJO; jXrJO: $SKGnU = new static(); goto PB7qV; PB7qV: $SKGnU->type($c6VKG); goto KMB0f; YAufj: $SKGnU->disabled(empty($lLyBI[3]) ? false : true); goto wJlMU; wJlMU: return $SKGnU->render(); goto kuas4; KMB0f: $SKGnU->text($lLyBI[0]); goto fc4eO; PPAiH: $SKGnU->confirm(empty($lLyBI[2]) ? '' : $lLyBI[2]); goto YAufj; fc4eO: $SKGnU->url($lLyBI[1]); goto PPAiH; kuas4: } goto RuTAC; WxLuY: } 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>'; } } }