<?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($L4owo, $nvZ9A) { goto tO1Z9; nqbjz: if (in_array($L4owo, $Ai6oc)) { goto Wui0b; lHWKv: $fNHhl->text($nvZ9A[0]); goto M5GDa; vmLqc: $fNHhl->disabled(empty($nvZ9A[3]) ? false : true); goto amvtw; M5GDa: $fNHhl->url($nvZ9A[1]); goto WeRGv; WeRGv: $fNHhl->confirm(empty($nvZ9A[2]) ? '' : $nvZ9A[2]); goto vmLqc; Wui0b: $fNHhl = new static(); goto eg4uw; eg4uw: $fNHhl->type($L4owo); goto lHWKv; amvtw: return $fNHhl->render(); goto JZhGl; JZhGl: } goto mMp93; tO1Z9: $Ai6oc = array('muted', 'warning', 'danger', 'success', 'primary'); goto nqbjz; mMp93: throw new \Exception('ButtonAjaxRequest error ' . join(',', $Ai6oc) . ' '); goto nAvH3; nAvH3: } 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>'; } } }