<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget; class ButtonDialogRequest extends AbstractWidget { public static function getAssets() { return array('style' => '.ub-button-dialog-request{display:inline-block;}'); } public static function __callStatic($XggBq, $lUGZC) { goto bC2Ux; SRZhK: throw new \Exception('ButtonDialogRequest error ' . join(',', $T9vBG) . ' '); goto vXBTb; bC2Ux: $T9vBG = array('muted', 'warning', 'danger', 'success', 'primary'); goto TJNFb; TJNFb: if (in_array($XggBq, $T9vBG)) { goto t7b9Y; t7b9Y: $IEFeS = new static(); goto s3IXr; HPYAI: $IEFeS->disabled(empty($lUGZC[2]) ? false : true); goto RC7_J; rQQVR: $IEFeS->url($lUGZC[1]); goto HPYAI; TYu3X: $IEFeS->text($lUGZC[0]); goto rQQVR; RC7_J: return $IEFeS->render(); goto goitq; s3IXr: $IEFeS->type($XggBq); goto TYu3X; goitq: } goto SRZhK; vXBTb: } public static function make(...$lUGZC) { goto lJ8pf; hiyGQ: $IEFeS->text($lUGZC[1]); goto d4yH_; d4yH_: $IEFeS->url($lUGZC[2]); goto vpa7h; vpa7h: return $IEFeS; goto fTQt0; lJ8pf: $IEFeS = new static(); goto taYsV; taYsV: $IEFeS->type($lUGZC[0]); goto hiyGQ; fTQt0: } public function size($TUjAS = 'big') { switch ($TUjAS) { case 'big': return $this->attr(($this->attr ? $this->attr : '') . ' data-dialog-width="90%" data-dialog-height="90%"'); } return $this; } public function render() { if ($this->disabled) { return '<a href="javascript:;" class="btn ub-button-dialog-request btn-' . $this->type . '">' . $this->text . '</a>'; } else { return '<a href="javascript:;" ' . ($this->confirm ? 'data-confirm="' . $this->confirm . '"' : '') . ' data-dialog-request="' . $this->url . '" class="btn ub-button-dialog-request btn-' . $this->type . '" ' . ($this->attr ? $this->attr : '') . '>' . $this->text . '</a>'; } } }