mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
- Added new view application/views/system/messages/FAShtmlWriteTemplate.php to be used with FAS/SeaMonkey and TinyMCE3
- Replaced TinyMCE V4 with V5 - Dropped TinyMCE V4 - Added new JS public/js/messaging/fasMessageWrite.js to be included by application/views/system/messages/FAShtmlWriteTemplate.php
This commit is contained in:
@@ -37,7 +37,7 @@ class FASMessages extends Auth_Controller
|
||||
|
||||
// Loads the view to write a new message with a template
|
||||
$this->load->view(
|
||||
'system/messages/htmlWriteTemplate',
|
||||
'system/messages/FAShtmlWriteTemplate',
|
||||
$this->CLMessagesModel->prepareHtmlWriteTemplatePrestudents($prestudents)
|
||||
);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class FASMessages extends Auth_Controller
|
||||
|
||||
// Loads the view to write a new message with a template
|
||||
$this->load->view(
|
||||
'system/messages/htmlWriteTemplate',
|
||||
'system/messages/FAShtmlWriteTemplate',
|
||||
$this->CLMessagesModel->prepareHtmlWriteTemplatePrestudents($prestudents, $message_id, $recipient_id)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
'jqueryui1' => true,
|
||||
'ajaxlib' => true,
|
||||
'tablesorter2' => true,
|
||||
'tinymce4' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'addons' => true,
|
||||
'navigationwidget' => true,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
'dialoglib' => true,
|
||||
'ajaxlib' => true,
|
||||
'tablesorter2' => true,
|
||||
'tinymce4' => true,
|
||||
'tinymce5' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'addons' => true,
|
||||
'navigationwidget' => true,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
'dialoglib' => true,
|
||||
'ajaxlib' => true,
|
||||
'tablesorter2' => true,
|
||||
'tinymce4' => true,
|
||||
'tinymce5' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'addons' => true,
|
||||
'navigationwidget' => true,
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Write a new message or reply using templates',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'bootstrap3' => true,
|
||||
'ajaxlib' => true,
|
||||
'fontawesome4' => true,
|
||||
'tinymce3' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'dialoglib' => true,
|
||||
'widgets' => true,
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css'),
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/fasMessageWrite.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">
|
||||
|
||||
<?php echo ucfirst($this->p->t('ui', 'nachrichtSenden')); ?>
|
||||
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<form id="sendForm" method="post" action="<?php echo site_url('/system/messages/Messages/sendImplicitTemplate'); ?>">
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1 msgfieldcol-left">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('global', 'empfaenger')); ?>:
|
||||
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-lg-11 msgfieldcol-right">
|
||||
<?php echo $recipientsList; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1 msgfield msgfieldcol-left">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('global', 'betreff')); ?>:
|
||||
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-7">
|
||||
<input id="subject" class="form-control" type="text" value="<?php echo $subject; ?>" name="subject">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-lg-9">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('global', 'nachricht')); ?>:
|
||||
|
||||
</label>
|
||||
<textarea id="bodyTextArea" name="body">
|
||||
|
||||
<?php echo $body; ?>
|
||||
|
||||
</textarea>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<div class="form-group">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('ui', 'felder')); ?>:
|
||||
|
||||
</label>
|
||||
|
||||
<?php
|
||||
$size = count($variables) > 19 ? 19 : count($variables);
|
||||
echo $this->widgetlib->widget(
|
||||
'MultipleDropdown_widget',
|
||||
array('elements' => success($variables)),
|
||||
array(
|
||||
'name' => 'variables[]',
|
||||
'id' => 'variables',
|
||||
'size' => $size,
|
||||
'multiple' => true
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<br>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('ui', 'meineFelder')); ?>:
|
||||
|
||||
</label>
|
||||
|
||||
<?php
|
||||
$size = count($user_fields) > 5 ? 5 : count($user_fields);
|
||||
echo $this->widgetlib->widget(
|
||||
'MultipleDropdown_widget',
|
||||
array('elements' => success($user_fields)),
|
||||
array(
|
||||
'name' => 'user_fields[]',
|
||||
'id' => 'user_fields',
|
||||
'size' => $size,
|
||||
'multiple' => true
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-xs-3">
|
||||
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Vorlage_widget',
|
||||
array('oe_kurzbz' => $organisationUnits, 'isAdmin' => $senderIsAdmin),
|
||||
array('name' => 'vorlage', 'id' => 'vorlageDnD')
|
||||
);
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<button id="sendButton" class="btn btn-default pull-right" type="button">
|
||||
|
||||
<?php echo $this->p->t('ui', 'senden'); ?>
|
||||
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('global', 'vorschau')); ?>:
|
||||
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well" id="templatePreviewDiv">
|
||||
<div class="row">
|
||||
<div class="col-sm-12" style="display: inline">
|
||||
<div class="form-group form-inline">
|
||||
<div class="input-group">
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Dropdown_widget',
|
||||
array(
|
||||
'elements' => success($recipientsArray),
|
||||
'emptyElement' => ucfirst($this->p->t('global', 'empfaenger')).'...'
|
||||
),
|
||||
array(
|
||||
'name' => 'recipients[]',
|
||||
'id' => 'recipients'
|
||||
)
|
||||
);
|
||||
?>
|
||||
<span class="input-group-btn">
|
||||
<a class="btn btn-default" href="#templatePreviewDiv" id="refresh">
|
||||
<?php echo ucfirst($this->p->t('ui', 'refresh')); ?>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<textarea id="tinymcePreview"></textarea>
|
||||
</div>
|
||||
|
||||
<?php echo $recipients_ids; ?>
|
||||
<?php echo $relationmessage_id; ?>
|
||||
<?php echo $type; ?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view("templates/FHC-Footer"); ?>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
'tabulator4' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tinymce4' => true,
|
||||
'tinymce5' => true,
|
||||
'phrases' => array('global', 'ui'),
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css'),
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/read.js')
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
'sbadmintemplate3' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tinymce4' => true,
|
||||
'tinymce5' => true,
|
||||
'phrases' => array('global', 'ui'),
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css'),
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/write.js')
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
'sbadmintemplate3' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tinymce4' => true,
|
||||
'tinymce5' => true,
|
||||
'phrases' => array('global', 'ui'),
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css'),
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/writeReply.js')
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'jquery3' => true,
|
||||
'bootstrap3' => true,
|
||||
'fontawesome4' => true,
|
||||
'tinymce4' => true,
|
||||
'tinymce5' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/message.css'),
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/messageWriteReply.js')
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
'bootstrap3' => true,
|
||||
'ajaxlib' => true,
|
||||
'fontawesome4' => true,
|
||||
'tinymce4' => true,
|
||||
'tinymce5' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'dialoglib' => true,
|
||||
'widgets' => true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$this->load->view('templates/header', array('title' => 'VorlageEdit', 'tinymce4' => true, 'jsonforms' => true));
|
||||
$this->load->view('templates/header', array('title' => 'VorlageEdit', 'tinymce5' => true, 'jsonforms' => true));
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
$tablesorter2 = isset($tablesorter2) ? $tablesorter2 : false;
|
||||
$tabulator4 = isset($tabulator4) ? $tabulator4 : false;
|
||||
$tabulator5 = isset($tabulator5) ? $tabulator5 : false;
|
||||
$tinymce4 = isset($tinymce4) ? $tinymce4 : false;
|
||||
$tinymce3 = isset($tinymce3) ? $tinymce3 : false;
|
||||
$tinymce5 = isset($tinymce5) ? $tinymce5 : false;
|
||||
$vue3 = isset($vue3) ? $vue3 : false;
|
||||
$primevue3 = isset($primevue3) ? $primevue3 : false;
|
||||
|
||||
@@ -100,8 +100,8 @@
|
||||
// Tabulator 5 JS
|
||||
if ($tabulator5 === true) generateJSsInclude('vendor/olifolkerd/tabulator5/dist/js/tabulator.min.js');
|
||||
|
||||
// Tinymce 4 JS
|
||||
if ($tinymce4 === true) generateJSsInclude('vendor/tinymce/tinymce4/tinymce.min.js');
|
||||
// Tinymce 3 JS
|
||||
if ($tinymce3 === true) generateJSsInclude('include/tiny_mce/tiny_mce.js');
|
||||
|
||||
// Tinymce 5 JS
|
||||
if ($tinymce5 === true) generateJSsInclude('vendor/tinymce/tinymce5/tinymce.min.js');
|
||||
|
||||
@@ -79,9 +79,6 @@
|
||||
// Tabulator 5 CSS
|
||||
if ($tabulator5 === true) generateCSSsInclude('vendor/olifolkerd/tabulator5/dist/css/tabulator_bootstrap5.min.css');
|
||||
|
||||
// Tinymce 4 CSS
|
||||
if ($tinymce4 === true) generateCSSsInclude('public/css/TinyMCE4.css');
|
||||
|
||||
// Tinymce 5 CSS
|
||||
if ($tinymce5 === true) generateCSSsInclude('public/css/TinyMCE5.css');
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ if($jqueryV1 && $jqueryV2) show_error("Two JQuery versions used: composer and in
|
||||
<?php endif ?>
|
||||
|
||||
<?php if($tinymce) : ?>
|
||||
<script type="text/javascript" src="<?php echo base_url('vendor/tinymce/tinymce4/tinymce.min.js');?>"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url('vendor/tinymce/tinymce5/tinymce.min.js');?>"></script>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if($textile) : ?>
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
plugins: [<?php echo $plugins; ?>],
|
||||
toolbar: "<?php echo $toolbar; ?>"
|
||||
});
|
||||
</script>
|
||||
<<?=$selector?> name="<?=$name?>" style="<?=$style?>"><?=$text?></<?=$selector?>>
|
||||
</script>
|
||||
<<?=$selector?> name="<?=$name?>" style="<?=$style?>"><?=$text?></<?=$selector?>>
|
||||
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
// ********************************************************
|
||||
// JS used by view system/messages/htmlWriteTemplate
|
||||
// ********************************************************
|
||||
|
||||
function tinymcePreviewSetContent()
|
||||
{
|
||||
if ($("#tinymcePreview"))
|
||||
{
|
||||
if ($("#recipients").children(":selected").val() > -1)
|
||||
{
|
||||
parseMessageText($("#recipients").children(":selected").val(), tinyMCE.get("bodyTextArea").getContent());
|
||||
}
|
||||
else
|
||||
{
|
||||
tinyMCE.get("tinymcePreview").setContent("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function parseMessageText(receiver_id, text)
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
"system/messages/Messages/parseMessageText",
|
||||
{
|
||||
receiver_id: receiver_id,
|
||||
text: text,
|
||||
type: $("#type").val()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
|
||||
if (FHC_AjaxClient.hasData(data))
|
||||
{
|
||||
tinyMCE.get("tinymcePreview").setContent(FHC_AjaxClient.getData(data));
|
||||
}
|
||||
else if (FHC_AjaxClient.isError(data))
|
||||
{
|
||||
FHC_DialogLib.alertError(data.retval);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$(document).ready(function ()
|
||||
{
|
||||
|
||||
tinymce.init({
|
||||
theme : "advanced",
|
||||
mode : "textareas"
|
||||
});
|
||||
|
||||
if ($("#variables"))
|
||||
{
|
||||
$("#variables").dblclick(function ()
|
||||
{
|
||||
if ($("#bodyTextArea"))
|
||||
{
|
||||
//if editor active add at cursor position, otherwise at end
|
||||
if (tinymce.activeEditor.id === "bodyTextArea")
|
||||
tinymce.activeEditor.execCommand('mceInsertContent', false, $(this).children(":selected").val());
|
||||
else
|
||||
tinyMCE.get("bodyTextArea").setContent(tinyMCE.get("bodyTextArea").getContent() + $(this).children(":selected").val());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#user_fields"))
|
||||
{
|
||||
$("#user_fields").dblclick(function ()
|
||||
{
|
||||
if ($("#bodyTextArea"))
|
||||
{
|
||||
//if editor active add at cursor position, otherwise at end
|
||||
if (tinymce.activeEditor.id === "bodyTextArea")
|
||||
tinymce.activeEditor.execCommand('mceInsertContent', false, $(this).children(":selected").val());
|
||||
else
|
||||
tinyMCE.get("bodyTextArea").setContent(tinyMCE.get("bodyTextArea").getContent() + $(this).children(":selected").val());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#recipients"))
|
||||
{
|
||||
$("#recipients").change(tinymcePreviewSetContent);
|
||||
}
|
||||
|
||||
if ($("#refresh"))
|
||||
{
|
||||
$("#refresh").click(tinymcePreviewSetContent);
|
||||
}
|
||||
|
||||
if ($("#sendButton") && $("#sendForm"))
|
||||
{
|
||||
$("#sendButton").click(function ()
|
||||
{
|
||||
if ($("#subject") && $("#subject").val() != '' && tinyMCE.get("bodyTextArea").getContent() != '')
|
||||
{
|
||||
$("#sendForm").submit();
|
||||
}
|
||||
else
|
||||
{
|
||||
FHC_DialogLib.alertInfo("Subject and text are required fields!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#vorlageDnD"))
|
||||
{
|
||||
$("#vorlageDnD").change(function ()
|
||||
{
|
||||
var vorlage_kurzbz = this.value;
|
||||
|
||||
if (vorlage_kurzbz != '')
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallGet(
|
||||
"system/messages/Messages/getVorlage",
|
||||
{
|
||||
vorlage_kurzbz: vorlage_kurzbz
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
|
||||
if (FHC_AjaxClient.hasData(data))
|
||||
{
|
||||
var msg = FHC_AjaxClient.getData(data);
|
||||
|
||||
tinyMCE.get("bodyTextArea").setContent(msg[0].text);
|
||||
$("#subject").val(msg[0].subject);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#subject").focus();
|
||||
|
||||
});
|
||||
@@ -42,8 +42,8 @@ function parseMessageText(receiver_id, text)
|
||||
);
|
||||
}
|
||||
|
||||
$(document).ready(function ()
|
||||
{
|
||||
$(document).ready(function () {
|
||||
|
||||
tinymce.init({
|
||||
selector: "#bodyTextArea",
|
||||
plugins: "autoresize",
|
||||
@@ -60,7 +60,12 @@ $(document).ready(function ()
|
||||
menubar: false,
|
||||
toolbar: false,
|
||||
statusbar: false,
|
||||
readonly: 1
|
||||
readonly: 1,
|
||||
autoresize_on_init: false,
|
||||
autoresize_min_height: 400,
|
||||
autoresize_max_height: 700,
|
||||
autoresize_bottom_margin: 10,
|
||||
auto_focus: "bodyTextArea"
|
||||
});
|
||||
|
||||
if ($("#variables"))
|
||||
|
||||
@@ -63,7 +63,7 @@ $(document).ready(function () {
|
||||
tinymce.init({
|
||||
selector: "#body",
|
||||
plugins: "autoresize",
|
||||
autoresize_min_height: 150,
|
||||
autoresize_min_height: 300,
|
||||
autoresize_max_height: 600,
|
||||
autoresize_bottom_margin: 10
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user