- Added new FilterWidget in the Administration menu for the phrases

- Extension installer is visible only for system/extensions
- Removed the old phrases editor from Vilesci
- system/checksystem.php does not call anymore system/phrasesupdate.php
- system/phrasesupdate.php has been removed
- Added new directory application/phrases
- application/phrases contains one file for each phrases category, and one file contains all the phrases for that category
- Added new controller system/phrases/Manager to install phrases in the core
- Added new constants CORE_PHRASES_DIRECTORY, INSERT_BY, APP, CATEGORY, PHRASE, SPRACHE, TEXT and DESCRIPTION to libraries/PhrasesLib
- libraries/PhrasesLib now loads EPrintfLib
- Removed public methods getPhraseByApp, getPhraseInhalt, delPhrasentext, savePhrase, getPhrasentextById, insertPhraseinhalt, getVorlagetextById and updatePhraseInhalt from libraries/PhrasesLib
- Renamed public method getJSON to toJSON in libraries/PhrasesLib
- Added new public methods installFromCore and installFrom to libraries/PhrasesLib
- Added new private methods _installPhrases and _addPhrases to libraries/PhrasesLib
This commit is contained in:
Paolo
2021-11-16 17:22:24 +01:00
parent 63105951a0
commit d7b700f781
38 changed files with 12498 additions and 14401 deletions
@@ -1,101 +0,0 @@
<?php
$this->load->view('templates/header', array('title' => 'TemplateEdit', 'jquery' => true, 'textile' => true));
?>
<div class="row">
<div class="span4">
<h2>Phrasentext: <?=$phrasentext_id?></h2>
<form method="post" action="../saveText/<?=$phrasentext_id?>">
<input type="hidden" name="phrase_inhalt_id" value="<?php echo $phrasentext_id; ?>" />
<table>
<tr>
<td>OE</td>
<td>
<?php
echo $this->widgetlib->widget(
'Organisationseinheit_widget',
array(DropdownWidget::SELECTED_ELEMENT => $orgeinheit_kurzbz),
array('name' => 'organisationseinheit', 'id' => 'organisationseinheitDnD')
);
?>
</td>
<td>Preview</td>
</tr>
<tr>
<td>Orgform</td>
<td>
<?php
echo $this->widgetlib->widget(
'Orgform_widget',
array(DropdownWidget::SELECTED_ELEMENT => $orgform_kurzbz),
array('name' => 'orgform', 'id' => 'orgformDnD')
);
?>
</td>
<td></td>
</tr>
<tr>
<td>Sprache</td>
<td>
<?php
echo $this->widgetlib->widget(
'Sprache_widget',
array(DropdownWidget::SELECTED_ELEMENT => $sprache),
array('name' => 'sprache', 'id' => 'spracheDnD')
);
?>
</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><h3>Formatierung (Textile) Hilfe:</h3><br/>
<code>
_emphasis_
*strong*
??citation??
-deleted text-
+inserted text+
^superscript^
</code><br/>
<a href="https://warpedvisions.org/projects/textile-cheat-sheet/" target="_blank">Textile CheatSheet</a>
</td></tr>
<tr><td colspan="2" align="right"><button type="submit">Save</button></td></tr>
</table>
</form>
</div>
</div>
<script>
$(document).ready(function () {
initTextile();
});
function initTextile() {
var $content = $('#markitup'); // my textarea
var $preview = $('#textile-preview'); // the preview div
// use a simple timer to check if the textarea content has changed
var value = $content.val();
$preview.html(textile.parse(value));
setInterval(function () {
var newValue = $content.val();
if (value != newValue) {
value = newValue;
$preview.html(textile.parse(newValue)); // convert the textile to html
}
}, 500);
};
</script>
</body>
</html>
@@ -1,20 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<html lang="de_AT">
<head>
<title>VileSci - Phrasen</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<frameset rows="30%,*">
<frame src="Phrases/table" id="PhrasesTop" name="PhrasesTop" frameborder="0" />
<frame src="Phrases/edit" id="PhrasesBottom" name="PhrasesBottom" frameborder="0" />
<noframes>
<body bgcolor="#FFFFFF">
This application works only with a frames-enabled browser.<br />
<a href="PhrasesList">Use without frames</a>
</body>
</noframes>
</frameset>
</html>
@@ -1,17 +0,0 @@
<?php
$this->load->view('templates/header', array('title' => 'PhrasesEdit'));
?>
<div class="row">
<div class="span4">
<h2>Phrase: <?php echo $phrase->phrase_id; ?></h2>
<form method="post" action="../save">
Bezeichnung: <input type="text" name="phrase" value="<?php echo $phrase->phrase; ?>" />
<input type="hidden" name="phrase_id" value="<?php echo $phrase->phrase_id; ?>" />
<button type="submit">Save</button>
</form>
</div>
</div>
</body>
</html>
@@ -1,28 +0,0 @@
<?php
$this->load->view('templates/header', array('title' => 'PhrasesList', 'tablesort' => true, 'tableid' => 't1', 'headers' => '3:{sorter:false}'));
?>
<div class="row">
<div class="span4">
<h2>Phrasen</h2>
<table id="t1" class="tablesorter">
<thead>
<tr><th class='table-sortable:default'>ID</th>
<th>App</th>
<th class='table-sortable:default'>Phrase</th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($phrases as $p): ?>
<tr><td><a href="edit/<?php echo $p->phrase_id; ?>" target="PhrasesBottom"><?php echo $p->phrase_id; ?></a></td>
<td><?php echo $p->app; ?></td>
<td><a href="edit/<?php echo $p->phrase_id; ?>" target="PhrasesBottom"><?php echo $p->phrase; ?></a></td>
<td><a href="view/<?php echo $p->phrase_id; ?>" target="PhrasesTop">Phrasentexte bearbeiten</a></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
</div>
</body>
</html>
@@ -0,0 +1,47 @@
<?php
$this->load->view(
'templates/FHC-Header',
array(
'title' => 'Phrases Viewer',
'jquery' => true,
'jqueryui' => true,
'bootstrap' => true,
'fontawesome' => true,
'sbadmintemplate' => true,
'tablesorter' => true,
'ajaxlib' => true,
'phrases' => array(
'ui' => array('bitteEintragWaehlen')
),
'filterwidget' => true,
'navigationwidget' => true,
'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css',
'customJSs' => array('public/js/bootstrapper.js')
)
);
?>
<body>
<div id="wrapper">
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h3 class="page-header">
Phrases Viewer
</h3>
</div>
</div>
<div>
<?php $this->load->view('system/phrases/phrasesViewerData.php'); ?>
</div>
</div>
</div>
</div>
</body>
<?php $this->load->view('templates/FHC-Footer'); ?>
@@ -0,0 +1,47 @@
<?php
$filterWidgetArray = array(
'query' => '
SELECT p.phrase_id AS "PhraseId",
p.app AS "Application",
p.category AS "Category",
p.phrase AS "PhraseName",
pt.sprache AS "Language",
pt.text AS "Phrase",
pt.description AS "Description",
pt.orgeinheit_kurzbz AS "OrganisationUnit",
pt.orgform_kurzbz AS "OrganizationalForm"
FROM system.tbl_phrase p
JOIN system.tbl_phrasentext pt USING(phrase_id)
ORDER BY p.app, p.category, p.phrase, pt.sprache
',
'requiredPermissions' => 'admin',
'datasetRepresentation' => 'tablesorter',
'columnsAliases' => array(
'Phrase id',
'Application',
'Category',
'Phrase name',
'Language',
'Phrase',
'Description',
'Organisation unit',
'Organizational form'
),
'formatRow' => function($datasetRaw) {
if (isEmptyString($datasetRaw->Description)) $datasetRaw->Description = 'NA';
if (isEmptyString($datasetRaw->OrganisationUnit)) $datasetRaw->OrganisationUnit = 'NA';
if (isEmptyString($datasetRaw->OrganizationalForm)) $datasetRaw->OrganizationalForm = 'NA';
return $datasetRaw;
}
);
$filterWidgetArray['app'] = 'core';
$filterWidgetArray['datasetName'] = 'phrases';
$filterWidgetArray['filter_id'] = $this->input->get('filter_id');
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
?>
@@ -1,54 +0,0 @@
<?php
$this->load->view('templates/header', array('title' => 'PhrasenInhaltList', 'tablesort' => true, 'tableid' => 't1', 'headers' => '5:{sorter:false}'));
?>
<div class="row">
<div class="span4">
<h2>Phrase Inhalt - <?php echo $phrase; ?></h2>
<form method="post" action="../newText" target="PhrasesBottom">
<input type="hidden" name="phrase_id" value="<?php echo $phrase_id; ?>"/>
<button type="submit">Neu</button>
</form>
<table id="t1" class="tablesorter">
<thead>
<tr><th class='table-sortable:default'>ID</th>
<th class='table-sortable:default'>Sprache</th>
<th class='table-sortable:default'>OrgEinheit</th>
<th class='table-sortable:default'>OrgForm</th>
<th class='table-sortable:default'>Text</th>
<th>Beschreibung</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($phrase_inhalt as $v): ?>
<tr><td><a href="../editText/<?php echo $v->phrasentext_id; ?>" target="PhrasesBottom"><?php echo $v->phrasentext_id; ?></a></td>
<td><?php echo $v->sprache; ?></td>
<td><?php echo $v->orgeinheit_kurzbz; ?></td>
<td><?php echo $v->orgform_kurzbz; ?></td>
<td><?php echo $v->text; ?></td>
<td><?php echo $v->description; ?></td>
<td><a href="../editText/<?php echo $v->phrasentext_id; ?>" target="PhrasesBottom">edit</a></td>
<td>
<a href="javascript:void(0);" onclick="delPhrasentext(<?php echo $v->phrasentext_id; ?>, <?php echo $phrase_id; ?>)">delete</a>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
</div>
<script>
function delPhrasentext(id,pid)
{
var c = confirm("Wirklich löschen?");
if (c == true)
window.location.href = "../deltext/"+id+"/"+pid;
}
</script>
<?php
$this->load->view('templates/footer');
?>