<?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($glP3G, $bY7Wp) { goto AO8Ri; WrTrB: throw new \Exception('ButtonAjaxRequest error ' . join(',', $DslRv) . ' '); goto XW75h; qw_x6: if (in_array($glP3G, $DslRv)) { goto kxzOs; QJ32W: $bMeyO->disabled(empty($bY7Wp[3]) ? false : true); goto RU3Zd; SO6MV: $bMeyO->type($glP3G); goto Wn30u; kxzOs: $bMeyO = new static(); goto SO6MV; j1xl_: $bMeyO->confirm(empty($bY7Wp[2]) ? '' : $bY7Wp[2]); goto QJ32W; RU3Zd: return $bMeyO->render(); goto u8c31; ks_Ug: $bMeyO->url($bY7Wp[1]); goto j1xl_; Wn30u: $bMeyO->text($bY7Wp[0]); goto ks_Ug; u8c31: } goto WrTrB; AO8Ri: $DslRv = array('muted', 'warning', 'danger', 'success', 'primary'); goto qw_x6; XW75h: } 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>'; } } }