public function submitButton(array $htmlOptions = array()) { $html = '<div class="row button-row">'; $htmlOptions = X2Html::mergeHtmlOptions($htmlOptions, array('class' => 'x2-button')); $html .= X2Html::submitButton(Yii::t('actions', 'Save'), $htmlOptions); $html .= '</div>'; return $html; }
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>
* 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". *****************************************************************************************/ Yii::app()->clientScript->registerCss('editGlobalCssCSS', "\n\n#global-css-editor + .CodeMirror {\n height: 500px;\n}\n\n"); Yii::app()->clientScript->registerScript('editGlobalCssJS', "\n\$(window).on ('resize', function () {\n var editor\$ = \$('#global-css-editor').next ();\n editor\$.height (\$(window).height () - editor\$.offset ().top - 100);\n}).resize ();\n", CClientScript::POS_READY); ?> <div class="page-title"><h2><?php echo CHtml::encode(Yii::t('admin', 'Edit Global CSS')); ?> </h2></div> <div class='form' id='global-css-edit-form-outer'> <?php if (!X2Flashes::hasFlashes('error')) { $form = $this->beginWidget('X2ActiveForm', array('formModel' => $formModel)); X2Flashes::renderFlashes('error'); X2Flashes::renderFlashes('success'); echo $form->labelEx($formModel, 'css'); echo $form->codeEditor($formModel, 'css', array('id' => 'global-css-editor')); echo X2Html::submitButton(Yii::t('app', 'Save Stylesheet'), array('class' => 'x2-button')); $this->endWidget(); } ?> </div>
public function run() { // If form is empty, we will not add the form wrappers if (!empty($this->form)) { parent::run(); return; } $this->form = $this->beginWidget('CActiveForm', array('id' => $this->modelName . '-form', 'enableAjaxValidation' => false)); parent::run(); echo X2Html::tag('div', array('class' => 'row buttons save-button-row')); $text = $this->model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save'); echo X2Html::submitButton($text, array('class' => 'x2-button', 'id' => 'save-button', 'tabindex' => 24)); echo '</div>'; $this->endWidget(); }