<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget; use ModStart\ModStart; class ButtonAjaxRequest extends AbstractWidget { public static function getAssets() { return array('style' => '.ub-button-ajax-request{display:inline-block;}'); } public static function __callStatic($f0dxO, $RSGSj) { goto DhGgi; X1Re_: throw new \Exception('ButtonAjaxRequest error ' . join(',', $eElQG) . ' '); goto NGG1Q; DhGgi: $eElQG = array('muted', 'warning', 'danger', 'success', 'primary'); goto g0mww; g0mww: if (in_array($f0dxO, $eElQG)) { goto XfkZV; GpOSw: $BoHUj->type($f0dxO); goto PR00n; OBhjn: return $BoHUj->render(); goto go7eP; PR00n: $BoHUj->text($RSGSj[0]); goto NdW0W; p5Ptb: $BoHUj->disabled(empty($RSGSj[3]) ? false : true); goto OBhjn; baTRO: $BoHUj->confirm(empty($RSGSj[2]) ? '' : $RSGSj[2]); goto p5Ptb; NdW0W: $BoHUj->url($RSGSj[1]); goto baTRO; XfkZV: $BoHUj = new static(); goto GpOSw; go7eP: } goto X1Re_; NGG1Q: } public function render() { if ($this->disabled) { return '<a href="javascript:;" class="btn ub-button-ajax-request btn-' . $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="btn ub-button-ajax-request btn-' . $this->type . '">' . $this->text . '</a>'; } } }