<?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(...$rxS2C) { goto B7LYy; B7LYy: $ZceHo = new static(); goto QPScg; Pg_HD: $ZceHo->text($rxS2C[1]); goto EMdl7; EMdl7: $ZceHo->url($rxS2C[2]); goto DMFLF; QPScg: $ZceHo->type($rxS2C[0]); goto Pg_HD; DMFLF: return $ZceHo; goto ocWol; ocWol: } public static function __callStatic($ZZMEd, $rxS2C) { goto N_kjD; N_kjD: $Rmgm_ = array('primary', 'muted', 'warning', 'danger', 'success'); goto oSWy3; oSWy3: if (in_array($ZZMEd, $Rmgm_)) { goto JEDmW; JEDmW: $ZceHo = new static(); goto D0SWo; AC8LE: $ZceHo->disabled(empty($rxS2C[3]) ? false : true); goto ZMnwp; ZMnwp: return $ZceHo->render(); goto kN0SD; D0SWo: $ZceHo->type($ZZMEd); goto vdHB2; vdHB2: $ZceHo->text($rxS2C[0]); goto p6I19; b0boC: $ZceHo->confirm(empty($rxS2C[2]) ? '' : $rxS2C[2]); goto AC8LE; p6I19: $ZceHo->url($rxS2C[1]); goto b0boC; kN0SD: } goto VhCrw; VhCrw: throw new \Exception('TextAjaxRequest error ' . join(',', $Rmgm_) . ' '); goto NpPda; NpPda: } 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>'; } } }