<?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($rPkIY, $HPXJC) { goto DEkpk; DEkpk: $XVuOQ = array('muted', 'warning', 'danger', 'success', 'primary'); goto CTC9m; CTC9m: if (in_array($rPkIY, $XVuOQ)) { goto P34qQ; ybxJy: if (isset($HPXJC[2])) { $WwLCq->disabled($HPXJC[2]); } goto uCnV9; feJTw: $WwLCq->text($HPXJC[0]); goto eM9ij; P34qQ: $WwLCq = new static(); goto vV0RI; eM9ij: $WwLCq->url($HPXJC[1]); goto ybxJy; uCnV9: return $WwLCq->render(); goto LIQIT; vV0RI: $WwLCq->type($rPkIY); goto feJTw; LIQIT: } goto sXqM3; sXqM3: throw new \Exception('TextDialogRequest error ' . join(',', $XVuOQ) . ' '); goto aeMiL; aeMiL: } public static function make(...$HPXJC) { goto Ifo5j; HsYZ6: $WwLCq->type($HPXJC[0]); goto ifCIr; huv8k: return $WwLCq; goto J7WVg; ifCIr: $WwLCq->text($HPXJC[1]); goto j4VUQ; Ifo5j: $WwLCq = new static(); goto HsYZ6; j4VUQ: $WwLCq->url($HPXJC[2]); goto huv8k; J7WVg: } public function size($sg5_F = 'big') { switch ($sg5_F) { case 'big': return $this->attr(($this->attr ? $this->attr : '') . ' data-dialog-width="90%" data-dialog-height="90%"'); } return $this; } public function render() { goto MHxWB; MHxWB: $bOB5d = $this->type; goto pWx0o; O90_9: if ($this->disabled) { return '<a href="javascript:;" class="ub-text-dialog-request ub-text-' . $bOB5d . '">' . $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-' . $bOB5d . '">' . $this->text . '</a>'; } goto qYh5U; pWx0o: if ('primary' == $bOB5d) { $bOB5d = 'link'; } goto O90_9; qYh5U: } }