<?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($ZZMEd, $rxS2C) { goto Ff8uy; A_jyi: throw new \Exception('TextDialogRequest error ' . join(',', $Rmgm_) . ' '); goto NUmRF; Ff8uy: $Rmgm_ = array('muted', 'warning', 'danger', 'success', 'primary'); goto dlxW0; dlxW0: if (in_array($ZZMEd, $Rmgm_)) { goto zNB0g; zNB0g: $ZceHo = new static(); goto s2Z2s; sfroU: $ZceHo->text($rxS2C[0]); goto GXSpN; s2Z2s: $ZceHo->type($ZZMEd); goto sfroU; XoioQ: return $ZceHo->render(); goto kkSiV; GXSpN: $ZceHo->url($rxS2C[1]); goto bPZg0; bPZg0: if (isset($rxS2C[2])) { $ZceHo->disabled($rxS2C[2]); } goto XoioQ; kkSiV: } goto A_jyi; NUmRF: } public static function make(...$rxS2C) { goto Om4MT; GBRAg: $ZceHo->text($rxS2C[1]); goto whXvh; whXvh: $ZceHo->url($rxS2C[2]); goto I07KY; Om4MT: $ZceHo = new static(); goto A5MqM; A5MqM: $ZceHo->type($rxS2C[0]); goto GBRAg; I07KY: return $ZceHo; goto JNjBa; JNjBa: } public function size($DlhlZ = 'big') { switch ($DlhlZ) { case 'big': return $this->attr(($this->attr ? $this->attr : '') . ' data-dialog-width="90%" data-dialog-height="90%"'); } return $this; } public function render() { goto WbC_a; WbC_a: $pW0Nz = $this->type; goto E64OU; E64OU: if ('primary' == $pW0Nz) { $pW0Nz = 'link'; } goto x0COY; x0COY: if ($this->disabled) { return '<a href="javascript:;" class="ub-text-dialog-request ub-text-' . $pW0Nz . '">' . $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-' . $pW0Nz . '">' . $this->text . '</a>'; } goto hQlY7; hQlY7: } }