<?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($c6VKG, $lLyBI) { goto zy8cT; O1yBd: throw new \Exception('ButtonAjaxRequest error ' . join(',', $YoRvD) . ' '); goto vemiL; zy8cT: $YoRvD = array('muted', 'warning', 'danger', 'success', 'primary'); goto R7dwz; R7dwz: if (in_array($c6VKG, $YoRvD)) { goto YhCjz; WO_Dc: $SKGnU->url($lLyBI[1]); goto AYLOf; AYLOf: $SKGnU->confirm(empty($lLyBI[2]) ? '' : $lLyBI[2]); goto NCDpj; E7XHk: return $SKGnU->render(); goto pTMxG; YhCjz: $SKGnU = new static(); goto k96ER; k96ER: $SKGnU->type($c6VKG); goto veTDL; NCDpj: $SKGnU->disabled(empty($lLyBI[3]) ? false : true); goto E7XHk; veTDL: $SKGnU->text($lLyBI[0]); goto WO_Dc; pTMxG: } goto O1yBd; vemiL: } 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>'; } } }