mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'ci' of https://github.com/FH-Complete/FHC-Core into ci
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$this->load->view('templates/header', array('title' => 'TemplateEdit', 'tinymce' => true, 'jsonforms' => true));
|
||||
$this->load->view('templates/header', array('title' => 'TemplateEdit', 'jquery' => true, 'textile' => true));
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
@@ -9,10 +9,18 @@
|
||||
<form method="post" action="../saveText/<?=$phrase_inhalt_id?>">
|
||||
<input type="hidden" name="phrase_inhalt_id" value="<?php echo $phrase_inhalt_id; ?>" />
|
||||
<table>
|
||||
<tr><td>OE</td><td><?php echo $this->templatelib->widget("organisationseinheit_widget", array('oe_kurzbz' => $orgeinheit_kurzbz)); ?></td></tr>
|
||||
<tr><td>Sprache</td><td><input type="text" name="sprache" value="<?php echo $sprache?>"></td></tr>
|
||||
<tr><td>Text</td><td><textarea name="text" cols="50" rows="5"><?php echo $text ?></textarea></td></tr>
|
||||
<tr><td>Beschreibung</td><td><textarea name="description" cols="50" rows="5"><?php echo $description ?></textarea></td></tr>
|
||||
<tr>
|
||||
<td>OE</td>
|
||||
<td><?php echo $this->templatelib->widget("organisationseinheit_widget", array('oe_kurzbz' => $orgeinheit_kurzbz)); ?></td>
|
||||
<td>Preview</td>
|
||||
</tr>
|
||||
<tr><td>Sprache</td><td><?php echo $this->templatelib->widget("sprache_widget", array('sprache' => $sprache)); ?></td><td></td></tr>
|
||||
<tr><td>Text</td><td><textarea name="text" style="width:500px; height:300px;" id="markitup"><?php echo $text ?></textarea></td>
|
||||
<td valign="top">
|
||||
<div id="textile-preview" style="width:500px; height:300px; border: 1px solid gray; overflow: auto;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>Beschreibung</td><td><textarea name="description" style="width:500px; height:100px;"><?php echo $description ?></textarea></td><td></td></tr>
|
||||
<?php
|
||||
// This is an example to show that you can load stuff from inside the template file
|
||||
//echo $this->templatelib->widget("tinymce_widget", array('name' => 'text', 'text' => $text));
|
||||
@@ -24,6 +32,33 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
initTextile();
|
||||
});
|
||||
|
||||
function initTextile() {
|
||||
var $content = $('#markitup'); // my textarea
|
||||
var $preview = $('#textile-preview'); // the preview div
|
||||
|
||||
//$content.markItUp(); // init markitup
|
||||
|
||||
// use a simple timer to check if the textarea content has changed
|
||||
var value = $content.val();
|
||||
$preview.html(textile.convert(value));
|
||||
setInterval(function () {
|
||||
var newValue = $content.val();
|
||||
if (value != newValue) {
|
||||
value = newValue;
|
||||
$preview.html(textile.convert(newValue)); // convert the textile to html
|
||||
}
|
||||
}, 500);
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<!--
|
||||
<iframe name="TemplatePreview" width="100%" src=""/>
|
||||
-->
|
||||
|
||||
@@ -10,6 +10,7 @@ isset($title) ? $title = 'VileSci - '.$title : $title = 'VileSci';
|
||||
!isset($tinymce) ? $tinymce = false : $tinymce = $tinymce;
|
||||
!isset($jsoneditor) ? $jsoneditor = false : $jsoneditor = $jsoneditor;
|
||||
!isset($jsonforms) ? $jsonforms = false : $jsonforms = $jsonforms;
|
||||
!isset($textile) ? $textile = false : $textile = $textile;
|
||||
|
||||
if ($tablesort)
|
||||
$jquery = true;
|
||||
@@ -32,14 +33,14 @@ if ($tablesort)
|
||||
|
||||
<?php if($tablesort && !empty($tableid)) : ?>
|
||||
<script language="Javascript" type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#<?php echo $tableid; ?>").tablesorter(
|
||||
{
|
||||
sortList: [[<?php echo $sortList; ?>]],
|
||||
widgets: ["<?php echo $widgets; ?>"],
|
||||
headers: {<?php echo $headers; ?>}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif ?>
|
||||
@@ -48,6 +49,10 @@ if ($tablesort)
|
||||
<script type="text/javascript" src="<?php echo base_url('vendor/tinymce/tinymce/tinymce.min.js');?>"></script>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if($textile) : ?>
|
||||
<script type="text/javascript" src="<?php echo base_url('include/js/textile.min.js');?>"></script>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if($jsoneditor) : ?>
|
||||
<link href="<?php echo base_url('vendor/jsoneditor/dist/jsoneditor.css');?>" rel="stylesheet" type="text/css">
|
||||
<script src="<?php echo base_url('vendor/jsoneditor/dist/jsoneditor.js');?>"></script>
|
||||
@@ -59,4 +64,3 @@ if ($tablesort)
|
||||
<?php endif ?>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<select name="<?php echo 'sprache'; ?>">
|
||||
<?php foreach($items as $item): ?>
|
||||
<option value="<?php echo $item['sprache']; ?>" <?php if ($item['selected']) echo 'selected'?>>
|
||||
<?php echo $item['sprache']; ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* OE widget
|
||||
*/
|
||||
class sprache_widget extends Widget
|
||||
{
|
||||
public function display($data)
|
||||
{
|
||||
$this->load->model('system/Sprache_model');
|
||||
$res = $this->Sprache_model->loadWhole();
|
||||
//var_dump($res);
|
||||
foreach ($res->retval as $obj)
|
||||
{
|
||||
$item = array('sprache' => $obj->sprache);
|
||||
if (isset($data['sprache']) && $obj->sprache == $data['sprache'])
|
||||
$item['selected'] = true;
|
||||
else
|
||||
$item['selected'] = false;
|
||||
$data['items'][] = $item;
|
||||
}
|
||||
if (! isset($data['sprache']))
|
||||
$data['sprache'] = 'German';
|
||||
$this->view('widgets/sprache', $data);
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user