<?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($rPkIY, $HPXJC) { goto k_CFr; k_CFr: $XVuOQ = array('muted', 'warning', 'danger', 'success', 'primary'); goto evcBB; evcBB: if (in_array($rPkIY, $XVuOQ)) { goto aPpvR; fPxVx: $WwLCq->text($HPXJC[0]); goto fxjlv; tWTpK: $WwLCq->disabled(empty($HPXJC[3]) ? false : true); goto y3nBD; fxjlv: $WwLCq->url($HPXJC[1]); goto OxwE8; ulopm: $WwLCq->type($rPkIY); goto fPxVx; y3nBD: return $WwLCq->render(); goto H_u_U; OxwE8: $WwLCq->confirm(empty($HPXJC[2]) ? '' : $HPXJC[2]); goto tWTpK; aPpvR: $WwLCq = new static(); goto ulopm; H_u_U: } goto kMrQY; kMrQY: throw new \Exception('ButtonAjaxRequest error ' . join(',', $XVuOQ) . ' '); goto dBrek; dBrek: } 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>'; } } }