<?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($L4owo, $nvZ9A) { goto gMkcL; gMkcL: $Ai6oc = array('muted', 'warning', 'danger', 'success', 'primary'); goto IYWk1; z5thI: throw new \Exception('ButtonDialogRequest error ' . join(',', $Ai6oc) . ' '); goto bQefP; IYWk1: if (in_array($L4owo, $Ai6oc)) { goto AVzKI; gg5K3: $fNHhl->url($nvZ9A[1]); goto wpcnf; AVzKI: $fNHhl = new static(); goto X1JUP; wpcnf: $fNHhl->disabled(empty($nvZ9A[2]) ? false : true); goto KDQ3l; X1JUP: $fNHhl->type($L4owo); goto inH9I; inH9I: $fNHhl->text($nvZ9A[0]); goto gg5K3; KDQ3l: return $fNHhl->render(); goto PAV3R; PAV3R: } goto z5thI; bQefP: } public static function make(...$nvZ9A) { goto wlOeL; jU5Ll: $fNHhl->text($nvZ9A[1]); goto iMTlA; wlOeL: $fNHhl = new static(); goto ZYT3V; iMTlA: $fNHhl->url($nvZ9A[2]); goto iwcvf; iwcvf: return $fNHhl; goto WXold; ZYT3V: $fNHhl->type($nvZ9A[0]); goto jU5Ll; WXold: } public function size($yNOaD = 'big') { switch ($yNOaD) { 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>'; } } }