Esempio n. 1
0
 public function run()
 {
     $this->autoSavePath .= $this->parentType . '/' . $this->parentId;
     $this->options['id'] .= $this->parentId;
     $this->widgetOptions['id'] .= $this->parentId;
     switch ($this->_enableRevisions) {
         case true:
             $this->revisionsModel->setScenario('validateNew');
             $revisionOptions = ['role' => $this->options['role'], 'id' => $this->options['id'] . $this->parentId, 'data-dave-path' => $this->autoSavePath, 'data-use-redactor' => $this->enableRedactor];
             Asset::register($this->getView());
             break;
         default:
             $revisionOptions = [];
             break;
     }
     switch ($this->enableRedactor) {
         case true:
             $this->editorOptions['id'] = 'message' . uniqid();
             $this->editorOptions['model'] = $this->model;
             $this->editorOptions['attribute'] = $this->name;
             $this->editorOptions['options']['value'] = $this->value;
             $input = Editor::widget($this->editorOptions);
             break;
         default:
             $input = Html::activeTextarea($this->model, $this->name, $revisionOption);
             break;
     }
     $result = Html::tag('div', '', ['role' => 'revisionStatus']);
     echo Html::tag('div', $input . $result, $this->widgetOptions);
 }
Esempio n. 2
0
?>
	<h3>Reply</h3>
    <?php 
$form = (include \Yii::getAlias("@nitm/views/layouts/form/header.php"));
?>
	<?php 
switch (isset($widget->inline) && $widget->inline == true) {
    case false:
        echo Html::button('Click to Reply', ['role' => "startEditor", 'data-container' => 'messages-form' . $widget->uniqid, 'data-editor' => $widget->editor, 'data-id' => $widget->parentId, 'data-use-modal' => $widget->useModal ? 'true' : 'false', 'class' => 'btn btn-default center-block']);
        break;
    default:
        $widget->editorOptions['id'] = 'reply-message' . $widget->uniqid;
        $widget->editorOptions['model'] = $model;
        $widget->editorOptions['attribute'] = 'message';
        $widget->editorOptions['role'] = 'message';
        echo Editor::widget($widget->editorOptions);
        break;
}
?>
	<?php 
echo Html::tag("div", '', ["role" => "replyToIndicator", "class" => "message-reply-to"]) . $widget->getActions($widget->useModal || !$widget->inline);
?>
	<?php 
echo Html::activeHiddenInput($model, "reply_to", ['value' => null, 'role' => 'replyTo']);
?>
    <?php 
ActiveForm::end();
?>

</div>
Esempio n. 3
0
?>
	<?php 
$form = ActiveForm::begin(['id' => 'chat-form0', "action" => "/reply/new/chat/0", 'method' => 'post', "options" => ['data-editor' => $editor, 'data-parent' => 'chat-messages', "role" => "chatForm"], "fieldConfig" => ["inputOptions" => ["class" => "form-control"]], 'validateOnSubmit' => true, "enableAjaxValidation" => true]);
?>
	<?php 
switch (isset($inline) && $inline == true) {
    case false:
        echo Html::button('Click to Reply', ['role' => "startEditor", 'data-container' => 'messagesForm' . $parentId, 'data-editor' => 'redactor', 'data-id' => $parentId, 'data-use-modal' => @$useModal ? 'true' : 'false', 'class' => 'btn btn-default center-block']);
        break;
    default:
        echo $form->field($model, 'title', ['addon' => ['prepend' => ['content' => \nitm\widgets\priority\Priority::widget(['size' => 'small', 'type' => 'addon', 'inputsInline' => true, 'addonType' => 'radiolist', 'attribute' => 'priority', 'model' => $model, 'form' => $form]), 'asButton' => true], 'groupOptions' => ['class' => 'input-group input-group-sm']], 'options' => ['class' => 'chat-message-title']])->textInput(['placeholder' => "Optional title", 'tag' => 'span'])->label("Title", ['class' => 'sr-only']);
        $editorOptions['id'] = 'chat-message' . $parentId;
        $editorOptions['model'] = $model;
        $editorOptions['attribute'] = 'message';
        $editorOptions['role'] = 'message';
        echo Editor::widget($editorOptions);
        break;
}
echo Html::tag("div", '', ["role" => "replyToIndicator", "class" => "message-reply-to"]) . $widget->getActions($useModal || !$inline);
?>
	<?php 
echo Html::activeHiddenInput($model, "reply_to", ['value' => null, "role" => "replyTo"]);
?>
    <?php 
ActiveForm::end();
?>

<script type='text/javascript'>
$nitm.onModuleLoad('replies', function () {
	$nitm.module('replies').initCreating('chat-form<?php 
echo $parentId;