<?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(...$CUZy6) { goto ReQC9; v4_z7: $o5T8w->type($CUZy6[0]); goto KakoZ; ReQC9: $o5T8w = new static(); goto v4_z7; Y7zas: return $o5T8w; goto dP9fl; SL8AK: $o5T8w->url($CUZy6[2]); goto Y7zas; KakoZ: $o5T8w->text($CUZy6[1]); goto SL8AK; dP9fl: } public static function __callStatic($L1g9F, $CUZy6) { goto Cs1Sl; UG264: if (in_array($L1g9F, $GdddG)) { goto CPklh; CPklh: $o5T8w = new static(); goto wqY1C; DT9cx: $o5T8w->disabled(empty($CUZy6[3]) ? false : true); goto yUGaM; dP5JL: $o5T8w->text($CUZy6[0]); goto qPv8y; wqY1C: $o5T8w->type($L1g9F); goto dP5JL; yUGaM: return $o5T8w->render(); goto HAFRc; qPv8y: $o5T8w->url($CUZy6[1]); goto AYPoj; AYPoj: $o5T8w->confirm(empty($CUZy6[2]) ? '' : $CUZy6[2]); goto DT9cx; HAFRc: } goto taE1v; Cs1Sl: $GdddG = array('primary', 'muted', 'warning', 'danger', 'success'); goto UG264; taE1v: throw new \Exception('TextAjaxRequest error ' . join(',', $GdddG) . ' '); goto S2Jzo; S2Jzo: } 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>'; } } }