<?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($L1g9F, $CUZy6) { goto RH9Ej; RH9Ej: $GdddG = array('muted', 'warning', 'danger', 'success', 'primary'); goto Y1ksk; z0dM8: throw new \Exception('ButtonAjaxRequest error ' . join(',', $GdddG) . ' '); goto dPfmk; Y1ksk: if (in_array($L1g9F, $GdddG)) { goto E1QYx; E1QYx: $o5T8w = new static(); goto DSbc6; IjsGX: $o5T8w->disabled(empty($CUZy6[3]) ? false : true); goto rmBpo; rmBpo: return $o5T8w->render(); goto UpJWm; DSbc6: $o5T8w->type($L1g9F); goto yEiwR; hRvr8: $o5T8w->url($CUZy6[1]); goto X1Da9; yEiwR: $o5T8w->text($CUZy6[0]); goto hRvr8; X1Da9: $o5T8w->confirm(empty($CUZy6[2]) ? '' : $CUZy6[2]); goto IjsGX; UpJWm: } goto z0dM8; dPfmk: } 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>'; } } }