'使用该小工具可以添加一个捐赠工具')); } function __construct(){ $this->WS_AliDo_Widget(); } //前台HTML function widget( $args, $ins ) { if( $ins['show'] =='close' ) return; require_once( 'cls.option.php' ); $options = new WS_AliDo_Option( WS_ALIDO_ID ); $gateway = $options->get('gateway'); $donateurl = $options->get('donateurl'); $email = $options->get('email'); if( $gateway == 'alipay' && !empty($donateurl) ) $donateLink = $donateurl; elseif( $gateway == 'api' && !empty($email) ) $donateLink = WS_ALIDO_URL . '/redirect.php?bill'; else $donateLink = "javascript:alert('还没设置收款账号呢');"; $imgButton = WS_ALIDO_IMG_URL . '/' . $options->get('button'); extract( $args ); $html = << .ws_alido_widget_wrap{margin:0;padding:0;border:none;} .ws_alido_widget_wrap a{display:block;margin:10px auto;text-align:center} $before_widget $before_title {$ins['title']} $after_title
$after_widget HTML; echo $html; } //更新事件数据过滤器 function update( $new_instance, $old_instance ) { return array_merge($old_instance,$new_instance); } //后台HTML function form($ins) { isset($ins['show']) || $ins['show'] = 'show'; isset($ins['title']) || $ins['title'] = '期待你的捐赠' ?>