本文整理汇总了PHP中humhub\widgets\AjaxButton::widget方法的典型用法代码示例。如果您正苦于以下问题:PHP AjaxButton::widget方法的具体用法?PHP AjaxButton::widget怎么用?PHP AjaxButton::widget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类humhub\widgets\AjaxButton
的用法示例。
在下文中一共展示了AjaxButton::widget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderMoreButton
/**
* @inheritdoc
*/
protected function renderMoreButton()
{
$pageCount = $this->pagination->getPageCount();
$currentPage = $this->pagination->getPage() + 1;
if ($currentPage >= $pageCount) {
return '';
}
if (!isset($this->ajaxButtonOptions['ajaxOptions']['url'])) {
$this->ajaxButtonOptions['ajaxOptions']['url'] = $this->pagination->createUrl($currentPage);
}
$moreButton = AjaxButton::widget($this->ajaxButtonOptions);
return Html::tag('div', Html::tag('br') . $moreButton . LoaderWidget::widget(['id' => $this->id . '_loader', 'cssClass' => 'hidden']), ['id' => $this->id, 'class' => 'pagination-container']);
}
示例2: renderPageButton
/**
* @inheritdoc
*/
protected function renderPageButton($label, $page, $class, $disabled, $active)
{
$options = ['class' => $class === '' ? null : $class];
if ($active) {
Html::addCssClass($options, $this->activePageCssClass);
}
if ($disabled) {
Html::addCssClass($options, $this->disabledPageCssClass);
return Html::tag('li', Html::tag('span', $label), $options);
}
$linkOptions = $this->linkOptions;
$linkOptions['data-page'] = $page;
return Html::tag('li', AjaxButton::widget(['label' => $label, 'tag' => 'a', 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new JsExpression($this->jsBeforeSend), 'success' => new JsExpression($this->jsSuccess), 'url' => $this->pagination->createUrl($page)], 'htmlOptions' => $linkOptions]), $options);
}
示例3: address
<div class="modal-body">
<br/>
<?php
echo Yii::t('UserModule.invite', 'Please add the email addresses of people you want to invite below.');
?>
<br/><br/>
<div class="form-group">
<?php
echo $form->field($model, 'emails')->textArea(['rows' => '3', 'placeholder' => Yii::t('UserModule.invite', 'Email address(es)'), 'id' => 'emails'])->label(false)->hint(Yii::t('UserModule.invite', 'Separate multiple email addresses by comma.'));
?>
</div>
</div>
<div class="modal-footer">
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('UserModule.invite', 'Send invite'), 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(){ setModalLoader(); }'), 'success' => new yii\web\JsExpression('function(html){ $("#globalModal").html(html); }'), 'url' => Url::to(['/user/invite'])], 'htmlOptions' => ['class' => 'btn btn-primary']]);
?>
<?php
echo \humhub\widgets\LoaderWidget::widget(['id' => 'invite-loader', 'cssClass' => 'loader-modal hidden']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
</div>
示例4: setModalLoader
<p><?php
echo Yii::t('UserModule.views_auth_login', "Don't have an account? Join the network by entering your e-mail address.");
?>
</p>
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($invite, 'email')->textInput(['id' => 'register-email', 'placeholder' => Yii::t('UserModule.views_auth_login', 'email')]);
?>
<hr>
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('UserModule.views_auth_login', 'Register'), 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(){ setModalLoader(); }'), 'success' => 'function(html){ $("#globalModal").html(html); }', 'url' => Url::to(['/user/auth/login'])], 'htmlOptions' => ['class' => 'btn btn-primary', 'id' => 'registerBtn']]);
?>
<?php
ActiveForm::end();
?>
</div>
<?php
}
?>
</div>
</div>
</div>
示例5: showLoader
<?php
/* Modify textarea for mention input */
echo \humhub\widgets\RichTextEditor::widget(array('id' => 'comment_input_' . $comment->id, 'inputContent' => $comment->message, 'record' => $comment));
?>
<div class="comment-buttons">
<?php
// Creates Uploading Button
echo humhub\modules\file\widgets\FileUploadButton::widget(array('uploaderId' => 'comment_upload_' . $comment->id, 'fileListFieldName' => 'fileList', 'object' => $comment));
?>
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('CommentModule.views_edit', 'Save'), 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(html){ $("#comment_input_' . $comment->id . '_contenteditable").hide(); showLoader("' . $comment->id . '"); }'), 'success' => new yii\web\JsExpression('function(html){ $("#comment_' . $comment->id . '").replaceWith(html); }'), 'url' => Url::to(['/comment/comment/edit', 'id' => $comment->id, 'contentModel' => $comment->object_model, 'contentId' => $comment->object_id])], 'htmlOptions' => ['class' => 'btn btn-default btn-sm btn-comment-submit', 'id' => 'comment_edit_post_' . $comment->id, 'type' => 'submit']]);
?>
</div>
<?php
// Creates a list of already uploaded Files
echo \humhub\modules\file\widgets\FileUploadList::widget(array('uploaderId' => 'comment_upload_' . $comment->id, 'object' => $comment));
?>
<?php
CActiveForm::end();
?>
</div>
<script type="text/javascript">
示例6: showLoader
echo \humhub\widgets\RichText::widget(['text' => $post->message]);
?>
</div>
<?php
echo \humhub\widgets\RichTextEditor::widget(['id' => 'post_input_' . $post->id, 'inputContent' => $post->message]);
?>
<?php
// Creates Uploading Button
echo humhub\modules\file\widgets\FileUploadButton::widget(array('uploaderId' => 'post_upload_' . $post->id, 'object' => $post));
?>
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => 'Save', 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(html){ $("#post_input_' . $post->id . '_contenteditable").hide(); showLoader("' . $post->id . '"); }'), 'success' => new yii\web\JsExpression('function(html){ $(".wall_' . $post->getUniqueId() . '").replaceWith(html); }'), 'url' => Url::to(['/post/post/edit', 'id' => $post->id])], 'htmlOptions' => ['class' => 'btn btn-primary', 'id' => 'post_edit_post_' . $post->id, 'style' => 'position: absolute; left: -90000000px; opacity: 0;']]);
?>
<?php
// Creates a list of already uploaded Files
echo \humhub\modules\file\widgets\FileUploadList::widget(array('uploaderId' => 'post_upload_' . $post->id, 'object' => $post));
?>
<?php
CActiveForm::end();
?>
</div>
<script type="text/javascript">
$('#post_input_<?php
示例7: array
</div>
<div class="form-group" id="selectedUsersField">
<?php
echo $form->labelEx($calendarEntry, 'selected_participants');
?>
<?php
echo $form->textField($calendarEntry, 'selected_participants', array('class' => 'form-control', 'placeholder' => Yii::t('CalendarModule.views_entry_edit', 'Participants')));
?>
</div>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-md-8 text-left">
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('CalendarModule.views_entry_edit', 'Save'), 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(){ setModalLoader(); }'), 'success' => new yii\web\JsExpression('function(html){ $("#globalModal").html(html); }'), 'url' => $contentContainer->createUrl('/calendar/entry/edit', ['id' => $calendarEntry->id])], 'htmlOptions' => ['class' => 'btn btn-primary']]);
?>
<button type="button" class="btn btn-primary"
data-dismiss="modal"><?php
echo Yii::t('CalendarModule.views_entry_edit', 'Close');
?>
</button>
</div>
<div class="col-md-4 text-right">
<?php
if (!$calendarEntry->isNewRecord) {
echo Html::a(Yii::t('CalendarModule.views_entry_edit', 'Delete'), $contentContainer->createUrl('//calendar/entry/delete', array('id' => $calendarEntry->id)), array('class' => 'btn btn-danger'));
}
?>
</div>
示例8: setModalLoader
</div>
<div class="col-md-6">
<?php
echo $form->field($user->profile, 'mobile')->textInput(['placeholder' => Yii::t('TourModule.views_tour_welcome', 'Your mobild phone number')]);
?>
</div>
</div>
<div class="row">
<div class="col-md-12 text-right">
<hr>
<br>
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('TourModule.views_tour_welcome', 'Save and close'), 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(){ setModalLoader(); }'), 'success' => new yii\web\JsExpression('function(html){ $("#globalModal").html(html); }'), 'url' => Url::to(['/tour/tour/welcome'])], 'htmlOptions' => ['class' => 'btn btn-primary']]);
?>
<?php
echo \humhub\widgets\LoaderWidget::widget(['id' => 'invite-loader', 'cssClass' => 'loader-modal hidden']);
?>
</div>
</div>
<?php
ActiveForm::end();
?>
</div>
示例9:
echo $form->field($file, 'description')->label(false)->textArea(array('class' => 'form-control', 'id' => 'cfiles_file_description_' . $file->id, 'placeholder' => Yii::t('CfilesModule.base', 'Edit the file description...')));
?>
<?php
echo \humhub\widgets\RichTextEditor::widget(['id' => 'cfiles_file_description_' . $file->id, 'inputContent' => $file->description, 'record' => $file]);
?>
<?php
//echo $form->field($file, 'description');
?>
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('PostModule.views_edit', 'Save'), 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(html){ }'), 'success' => new yii\web\JsExpression('function(html){$(".wall_' . $file->getUniqueId() . '").replaceWith(html); }'), 'statusCode' => ['400' => new yii\web\JsExpression('function(xhr) { }')], 'url' => $contentContainer->createUrl('/cfiles/edit/file', ['fid' => $currentFolderId, 'id' => $file->getItemId(), 'fromWall' => 1])], 'htmlOptions' => ['class' => 'btn btn-primary']]);
?>
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('CfilesModule.base', 'Close'), 'ajaxOptions' => ['type' => 'GET', 'success' => new yii\web\JsExpression('function(html){$(".wall_' . $file->getUniqueId() . '").replaceWith(html); }'), 'statusCode' => ['400' => new yii\web\JsExpression('function(xhr) { }')], 'url' => $contentContainer->createUrl('/cfiles/edit/file', ['fid' => $currentFolderId, 'id' => $file->getItemId(), 'fromWall' => 1, 'cancel' => 1])], 'htmlOptions' => ['class' => 'btn btn-primary']]);
?>
<?php
CActiveForm::end();
?>
</div>
<div class="preview">
<?php
echo FilePreview::widget(['file' => $file, 'width' => 600, 'height' => 350, 'htmlConf' => ['class' => 'preview', 'id' => 'cfiles-wallout-file-preview-' . $file->id]]);
?>
</div>
</div>
示例10:
echo $title;
?>
</h4>
</div>
<div class="modal-body text-center">
<?php
echo $message;
?>
</div>
<div class="modal-footer">
<?php
if ($buttonTrue != "") {
?>
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => $buttonTrue, 'ajaxOptions' => ['type' => 'POST', 'success' => $confirm, 'url' => $linkHref], 'htmlOptions' => ['return' => 'true', 'class' => 'btn btn-primary', 'data-dismiss' => 'modal']]);
?>
<?php
}
?>
<?php
if ($buttonFalse != "") {
?>
<button type="button" class="btn btn-primary"
data-dismiss="modal"><?php
echo $buttonFalse;
?>
</button>
<?php
}
?>
示例11: setModalLoader
?>
</div>
<div class="col-md-6">
<?php
echo $form->field($model, 'visibility')->radioList($visibilityOptions);
?>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<hr>
<br>
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('SpaceModule.views_create_create', 'Next'), 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(){ setModalLoader(); }'), 'success' => new yii\web\JsExpression('function(html){ $("#globalModal").html(html); }'), 'url' => Url::to(['/space/create/create'])], 'htmlOptions' => ['class' => 'btn btn-primary', 'id' => 'space-create-submit-button']]);
?>
<?php
echo \humhub\widgets\LoaderWidget::widget(['id' => 'create-loader', 'cssClass' => 'loader-modal hidden']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
</div>
示例12: array
">
<div class="comment <?php
if (Yii::$app->user->isGuest) {
?>
guest-mode<?php
}
?>
" id="comments_area_<?php
echo $id;
?>
">
<?php
if ($isLimited) {
?>
<?php
echo AjaxButton::widget(['label' => Yii::t('CommentModule.widgets_views_comments', 'Show all {total} comments.', array('{total}' => $total)), 'ajaxOptions' => ['type' => 'POST', 'success' => new yii\web\JsExpression("function(html) { \$('#comments_area_" . $id . "').html(html); }"), 'url' => Url::to(['/comment/comment/show', 'contentModel' => $modelName, 'contentId' => $modelId])], 'htmlOptions' => ['id' => $id . "_showAllLink", 'class' => 'show show-all-link'], 'tag' => 'a']);
?>
<hr>
<?php
}
?>
<?php
foreach ($comments as $comment) {
?>
<?php
echo \humhub\modules\comment\widgets\Comment::widget(['comment' => $comment]);
?>
<?php
}
?>
示例13: setModalLoader
<?php
echo Yii::t('AdminModule.views_module_setAsDefault', 'Always activated');
?>
</label>
</div>
<br/>
</div>
<?php
}
?>
</div>
</div>
<div class="modal-footer">
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('AdminModule.views_module_setAsDefault', 'Save'), 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(){ setModalLoader(); }'), 'success' => new yii\web\JsExpression('function(html){ $("#globalModal").html(html); }'), 'url' => \yii\helpers\Url::to(['/admin/module/set-as-default', 'moduleId' => $module->id])], 'htmlOptions' => ['class' => 'btn btn-primary']]);
?>
<button type="button" class="btn btn-primary"
data-dismiss="modal"><?php
echo Yii::t('AdminModule.views_module_setAsDefault', 'Close');
?>
</button>
<div id="default-loader" class="loader loader-modal hidden">
<div class="sk-spinner sk-spinner-three-bounce">
<div class="sk-bounce1"></div>
<div class="sk-bounce2"></div>
<div class="sk-bounce3"></div>
</div>
</div>
示例14: array
echo $form->textArea($entry, 'content', array('class' => 'form-control', 'rows' => '7', 'id' => 'newMessageEntryText'));
?>
<?php
echo humhub\widgets\MarkdownEditor::widget(array('fieldId' => 'newMessageEntryText'));
?>
<?php
echo $form->error($entry, 'content');
?>
</div>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-md-6 text-left">
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('MailModule.views_mail_edit', 'Save'), 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => 'function(){ $("#create-message-loader").removeClass("hidden"); }', 'success' => 'function(html){ $("#globalModal").html(html); }', 'url' => Url::to(['/mail/mail/edit-entry', 'messageEntryId' => $entry->id])], 'htmlOptions' => ['class' => 'btn btn-primary']]);
?>
<button type="button" class="btn btn-primary" data-dismiss="modal"><?php
echo Yii::t('MailModule.views_mail_create', 'Close');
?>
</button>
</div>
<div class="col-md-6 text-right">
<?php
echo humhub\widgets\ModalConfirm::widget(array('uniqueID' => 'modal_maildelete_' . $entry->id, 'title' => Yii::t('MailModule.views_mail_show', '<strong>Confirm</strong> message deletion'), 'message' => Yii::t('MailModule.views_mail_show', 'Do you really want to delete this message?'), 'buttonTrue' => Yii::t('MailModule.views_mail_show', 'Delete'), 'buttonFalse' => Yii::t('MailModule.views_mail_show', 'Cancel'), 'linkContent' => Yii::t('MailModule.views_mail_show', 'Delete'), 'cssClass' => 'btn btn-danger', 'linkHref' => Url::to(["/mail/mail/delete-entry", 'messageEntryId' => $entry->id])));
?>
</div>
</div>
示例15: setModalLoader
?>
<?php
}
?>
</h4>
</div>
<div class="modal-body">
<br />
<?php
echo $form->field($folder, 'title');
?>
</div>
<div class="modal-footer">
<?php
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('CfilesModule.base', 'Save'), 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(){ setModalLoader(); }'), 'success' => new yii\web\JsExpression('function(html){ $("#globalModal").html(html); }'), 'url' => $contentContainer->createUrl('/cfiles/browse/edit-folder', ['fid' => $currentFolderId, 'id' => $folder->id])], 'htmlOptions' => ['class' => 'btn btn-primary']]);
?>
<button type="button" class="btn btn-primary"
data-dismiss="modal">
<?php
echo Yii::t('CfilesModule.base', 'Close');
?>
</button>
</div>
<?php
CActiveForm::end();
?>
</div>
</div>