<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget; use ModStart\ModStart; class TextAjaxRequest extends AbstractWidget { public static function getAssets() { return array('style' => '.ub-text-ajax-request{display:inline-block;margin-right:0.5rem;}'); } public static function make(...$bY7Wp) { goto f7MG9; VOyh0: $bMeyO->text($bY7Wp[1]); goto Wh6yF; cSq_F: $bMeyO->type($bY7Wp[0]); goto VOyh0; f7MG9: $bMeyO = new static(); goto cSq_F; K8sou: return $bMeyO; goto s37YD; Wh6yF: $bMeyO->url($bY7Wp[2]); goto K8sou; s37YD: } public static function __callStatic($glP3G, $bY7Wp) { goto F0G1S; FJaj8: if (in_array($glP3G, $DslRv)) { goto pBzhq; ugRl7: $bMeyO->text($bY7Wp[0]); goto cUHZw; z0z_0: $bMeyO->confirm(empty($bY7Wp[2]) ? '' : $bY7Wp[2]); goto xg5g9; DYjN4: $bMeyO->type($glP3G); goto ugRl7; pBzhq: $bMeyO = new static(); goto DYjN4; cUHZw: $bMeyO->url($bY7Wp[1]); goto z0z_0; xg5g9: $bMeyO->disabled(empty($bY7Wp[3]) ? false : true); goto oS9Ul; oS9Ul: return $bMeyO->render(); goto HUHjp; HUHjp: } goto Py0Ab; F0G1S: $DslRv = array('primary', 'muted', 'warning', 'danger', 'success'); goto FJaj8; Py0Ab: throw new \Exception('TextAjaxRequest error ' . join(',', $DslRv) . ' '); goto gfJFz; gfJFz: } public function render() { if ($this->disabled) { return '<a href="javascript:;" class="ub-text-ajax-request ub-text-' . $this->type . '">' . $this->text . '</a>'; } else { return '<a href="javascript:;" ' . ($this->confirm ? 'data-confirm="' . $this->confirm . '"' : '') . ' data-ajax-request-loading data-ajax-request="' . $this->url . '" class="ub-text-ajax-request ub-text-' . $this->type . '" ' . ' ' . ($this->attr ? $this->attr : '') . '>' . $this->text . '</a>'; } } }