<?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($rPkIY, $HPXJC) { goto FUBoH; FUBoH: $XVuOQ = array('muted', 'warning', 'danger', 'success', 'primary'); goto GlUJj; kgSto: throw new \Exception('ButtonDialogRequest error ' . join(',', $XVuOQ) . ' '); goto SNfam; GlUJj: if (in_array($rPkIY, $XVuOQ)) { goto W3d0q; hak8p: $WwLCq->text($HPXJC[0]); goto ZuuLs; sJVJ2: $WwLCq->disabled(empty($HPXJC[2]) ? false : true); goto DQXo5; h79eA: $WwLCq->type($rPkIY); goto hak8p; DQXo5: return $WwLCq->render(); goto ZbiRA; W3d0q: $WwLCq = new static(); goto h79eA; ZuuLs: $WwLCq->url($HPXJC[1]); goto sJVJ2; ZbiRA: } goto kgSto; SNfam: } public static function make(...$HPXJC) { goto rfGiQ; bd_bU: return $WwLCq; goto Ve_Sk; USeF8: $WwLCq->text($HPXJC[1]); goto AXEl2; Rb60K: $WwLCq->type($HPXJC[0]); goto USeF8; rfGiQ: $WwLCq = new static(); goto Rb60K; AXEl2: $WwLCq->url($HPXJC[2]); goto bd_bU; Ve_Sk: } 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() { 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>'; } } }