<?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(...$g59Hh) { goto vr8G6; vr8G6: $qRCHN = new static(); goto eytay; eytay: $qRCHN->type($g59Hh[0]); goto mQ1qo; vDHPk: $qRCHN->url($g59Hh[2]); goto Exohz; Exohz: return $qRCHN; goto EdfPi; mQ1qo: $qRCHN->text($g59Hh[1]); goto vDHPk; EdfPi: } public static function __callStatic($sQIr6, $g59Hh) { goto LhC_E; LhC_E: $KDM3X = array('primary', 'muted', 'warning', 'danger', 'success'); goto c0Xo3; szEBT: throw new \Exception('TextAjaxRequest error ' . join(',', $KDM3X) . ' '); goto ijtU5; c0Xo3: if (in_array($sQIr6, $KDM3X)) { goto Sb5W0; Sb5W0: $qRCHN = new static(); goto RUcpz; nCCm9: $qRCHN->confirm(empty($g59Hh[2]) ? '' : $g59Hh[2]); goto G7BUG; nDsoZ: $qRCHN->text($g59Hh[0]); goto O3IUm; O3IUm: $qRCHN->url($g59Hh[1]); goto nCCm9; G7BUG: $qRCHN->disabled(empty($g59Hh[3]) ? false : true); goto RR0bg; RR0bg: return $qRCHN->render(); goto Vj06i; RUcpz: $qRCHN->type($sQIr6); goto nDsoZ; Vj06i: } goto szEBT; ijtU5: } 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>'; } } }