本文整理汇总了PHP中X2Html::ajaxSubmitButton方法的典型用法代码示例。如果您正苦于以下问题:PHP X2Html::ajaxSubmitButton方法的具体用法?PHP X2Html::ajaxSubmitButton怎么用?PHP X2Html::ajaxSubmitButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类X2Html
的用法示例。
在下文中一共展示了X2Html::ajaxSubmitButton方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* X2Engine" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by X2Engine".
*****************************************************************************************/
$folderForm = $this->beginWidget('X2ActiveForm', array('formModel' => $model, 'id' => 'folder-form-inner'));
X2Flashes::renderFlashes('error');
X2Flashes::renderFlashes('success');
echo $folderForm->labelEx($model, 'name');
echo $folderForm->textField($model, 'name');
echo $folderForm->hiddenField($model, 'parentFolder');
echo $folderForm->labelEx($model, 'visibility');
echo $folderForm->dropDownList($model, 'visibility', X2PermissionsBehavior::getVisibilityOptions(), array('data-default' => 1));
echo X2Html::ajaxSubmitButton('', '', array('dataType' => 'json', 'success' => 'function(data){
var folderForm$ = $("#folder-form")
if (data.success) {
folderForm$.dialog("close");
x2.forms.clearForm ($("#folder-form form"), true);
x2.flashes.displayFlashes({
success:[' . CJSON::encode(Yii::t('docs', 'Folder created.')) . ']});
$.fn.yiiGridView.update("folder-contents", {complete:function(){
x2.folderManager.setUpDragAndDrop(); }});
} else {
folderForm$.find ("form").replaceWith (data.form);
}
}'), array('class' => 'x2-button', 'live' => false, 'style' => 'display: none;'));
$this->endWidget();
示例2: array
window.location = "' . $this->createUrl('/topics/topics/view', array('id' => $topic->id, 'latest' => true)) . '";
}
});
return false;
}
});
$(document).on("ready",function(){
x2.topicReplyForm.setUpFileUpload();
});
', CClientScript::POS_READY);
?>
<div class='form'>
<?php
$form = $this->beginWidget('X2ActiveForm', array('formModel' => $model));
echo $form->textArea($model, 'text');
$model->topicId = isset($topic->id) ? $topic->id : null;
echo $form->hiddenField($model, 'topicId');
echo '<div id="topic-reply-submit-buttons">';
if ($method !== 'new-reply') {
echo X2Html::submitButton($topic->isNewRecord ? Yii::t('topics', 'Create') : Yii::t('topics', 'Update'), array('class' => 'x2-button highlight', 'id' => 'topic-save-button'));
$this->widget('FileUploader', array('id' => 'topic-reply-attachment', 'url' => '/topics/create', 'viewParams' => array('showButton' => false)));
} else {
echo X2Html::ajaxSubmitButton('Post', $this->createUrl('/topics/newReply'), array('beforeSend' => 'function(){x2.forms.inputLoading($("#topic-reply-submit"));}', 'method' => 'POST', 'success' => 'function(data){ window.location = "' . $this->createUrl('/topics/view', array('id' => $topic->id)) . '?replyId="+data }'), array('class' => 'x2-button highlight', 'id' => 'topic-reply-submit'));
$this->widget('FileUploader', array('id' => 'topic-reply-attachment', 'url' => '/site/upload', 'mediaParams' => array('associationType' => 'topicReply', 'TopicReplies[topicId]' => $topic->id), 'viewParams' => array('showButton' => false)));
}
echo CHtml::button(Yii::t('app', 'Attach A File/Photo'), array('class' => 'x2-button', 'onclick' => 'x2.topicReplyForm.fileUploader.toggle ()', 'id' => "toggle-attachment-menu-button"));
echo '</div>';
$this->endWidget();
?>
</div>
示例3: array
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* X2Engine" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by X2Engine".
*****************************************************************************************/
$folderForm = $this->beginWidget('X2ActiveForm', array('formModel' => $model, 'id' => 'folder-form-inner'));
X2Flashes::renderFlashes('error');
X2Flashes::renderFlashes('success');
echo $folderForm->labelEx($model, 'name');
echo $folderForm->textField($model, 'name');
echo $folderForm->hiddenField($model, 'parentFolder');
echo $folderForm->labelEx($model, 'visibility');
echo $folderForm->dropDownList($model, 'visibility', X2PermissionsBehavior::getVisibilityOptions(), array('data-default' => 1));
echo X2Html::ajaxSubmitButton('', '', array('dataType' => 'json', 'success' => 'function(data){
var folderForm$ = $("#folder-form")
if (data.success) {
folderForm$.dialog("close");
x2.forms.clearForm ($("#folder-form form"), true);
$.fn.yiiListView.update("folder-contents", {complete:function(){
x2.foldersManager.setUpDragAndDrop(); }});
} else {
folderForm$.find ("form").replaceWith (data.form);
}
}'), array('class' => 'x2-button', 'live' => false, 'style' => 'display: none;'));
$this->endWidget();