<?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($glP3G, $bY7Wp) { goto DSh_f; cVtzq: if (in_array($glP3G, $DslRv)) { goto a0HPj; IATCp: $bMeyO->url($bY7Wp[1]); goto By0MZ; a0HPj: $bMeyO = new static(); goto gw4zi; gw4zi: $bMeyO->type($glP3G); goto hdt3w; By0MZ: if (isset($bY7Wp[2])) { $bMeyO->disabled($bY7Wp[2]); } goto ZZBKe; ZZBKe: return $bMeyO->render(); goto lyiQN; hdt3w: $bMeyO->text($bY7Wp[0]); goto IATCp; lyiQN: } goto bdT9_; DSh_f: $DslRv = array('muted', 'warning', 'danger', 'success', 'primary'); goto cVtzq; bdT9_: throw new \Exception('TextDialogRequest error ' . join(',', $DslRv) . ' '); goto PBkjv; PBkjv: } public static function make(...$bY7Wp) { goto dx2aT; n5ACs: $bMeyO->type($bY7Wp[0]); goto yJ_Dw; dx2aT: $bMeyO = new static(); goto n5ACs; Z_gf4: return $bMeyO; goto kepCs; yJ_Dw: $bMeyO->text($bY7Wp[1]); goto AXU7C; AXU7C: $bMeyO->url($bY7Wp[2]); goto Z_gf4; kepCs: } public function size($Klf84 = 'big') { switch ($Klf84) { case 'big': return $this->attr(($this->attr ? $this->attr : '') . ' data-dialog-width="90%" data-dialog-height="90%"'); } return $this; } public function render() { goto KN6Qs; KN6Qs: $BYzWI = $this->type; goto niZoZ; niZoZ: if ('primary' == $BYzWI) { $BYzWI = 'link'; } goto F9Gub; F9Gub: if ($this->disabled) { return '<a href="javascript:;" class="ub-text-dialog-request ub-text-' . $BYzWI . '">' . $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-' . $BYzWI . '">' . $this->text . '</a>'; } goto TkGdp; TkGdp: } }