<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget; use ModStart\ModStart; class TextDialogRequest extends AbstractWidget { public static function getAssets() { return array('style' => '.ub-text-dialog-request{display:inline-block;margin-right:0.5rem;}'); } public static function __callStatic($L1g9F, $CUZy6) { goto nK1KD; BTKqj: if (in_array($L1g9F, $GdddG)) { goto OT1c1; kBVx1: if (isset($CUZy6[2])) { $o5T8w->disabled($CUZy6[2]); } goto grR1d; OT1c1: $o5T8w = new static(); goto KWyKQ; LkN6U: $o5T8w->text($CUZy6[0]); goto coI2E; grR1d: return $o5T8w->render(); goto q1sie; coI2E: $o5T8w->url($CUZy6[1]); goto kBVx1; KWyKQ: $o5T8w->type($L1g9F); goto LkN6U; q1sie: } goto FYcHu; nK1KD: $GdddG = array('muted', 'warning', 'danger', 'success', 'primary'); goto BTKqj; FYcHu: throw new \Exception('TextDialogRequest error ' . join(',', $GdddG) . ' '); goto KDTeH; KDTeH: } public static function make(...$CUZy6) { goto wU38G; wU38G: $o5T8w = new static(); goto WQIwe; wJhi6: $o5T8w->text($CUZy6[1]); goto oJDM8; fBWCZ: return $o5T8w; goto VQ_aa; oJDM8: $o5T8w->url($CUZy6[2]); goto fBWCZ; WQIwe: $o5T8w->type($CUZy6[0]); goto wJhi6; VQ_aa: } public function size($VRgM7 = 'big') { switch ($VRgM7) { case 'big': return $this->attr(($this->attr ? $this->attr : '') . ' data-dialog-width="90%" data-dialog-height="90%"'); } return $this; } public function render() { goto aefRy; mWkiO: if ('primary' == $XcezL) { $XcezL = 'link'; } goto QwBTH; aefRy: $XcezL = $this->type; goto mWkiO; QwBTH: if ($this->disabled) { return '<a href="javascript:;" class="ub-text-dialog-request ub-text-' . $XcezL . '">' . $this->text . '</a>'; } else { return '<a href="javascript:;" ' . ($this->confirm ? 'data-confirm="' . $this->confirm . '"' : '') . ' ' . ($this->width ? 'data-dialog-width="' . $this->width . '"' : '') . ' ' . ($this->height ? 'data-dialog-height="' . $this->height . '"' : '') . ' ' . ($this->attr ? $this->attr : '') . ' data-dialog-request="' . $this->url . '" class="ub-text-dialog-request ub-text-' . $XcezL . '">' . $this->text . '</a>'; } goto wD2G7; wD2G7: } }