<?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($sQIr6, $g59Hh) { goto bPMxp; bPMxp: $KDM3X = array('muted', 'warning', 'danger', 'success', 'primary'); goto sEIKz; c8TM6: throw new \Exception('ButtonAjaxRequest error ' . join(',', $KDM3X) . ' '); goto FJhAE; sEIKz: if (in_array($sQIr6, $KDM3X)) { goto SmbKI; SmbKI: $qRCHN = new static(); goto WOorn; J0so5: $qRCHN->text($g59Hh[0]); goto BY2er; BY2er: $qRCHN->url($g59Hh[1]); goto g8aj6; WOorn: $qRCHN->type($sQIr6); goto J0so5; kt7_a: return $qRCHN->render(); goto EH1VD; KVpfu: $qRCHN->disabled(empty($g59Hh[3]) ? false : true); goto kt7_a; g8aj6: $qRCHN->confirm(empty($g59Hh[2]) ? '' : $g59Hh[2]); goto KVpfu; EH1VD: } goto c8TM6; FJhAE: } 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>'; } } }