mirror of
https://github.com/Mowie/Mowie
synced 2024-06-03 01:19:39 +00:00
Added Stream-SQL-Data during installation
This commit is contained in:
parent
11eb5627ef
commit
f8850c4b24
|
@ -325,6 +325,7 @@ hr{
|
|||
a.del i {
|
||||
font-size: 20px;
|
||||
vertical-align: sub;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a.del {
|
||||
|
@ -438,7 +439,7 @@ a.del:hover {
|
|||
}
|
||||
}
|
||||
|
||||
/*Tabelle*/
|
||||
/*Table*/
|
||||
table {
|
||||
box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, .14);
|
||||
border: 1px solid #E0E0E0;
|
||||
|
|
|
@ -461,6 +461,14 @@ else
|
|||
}, 300);
|
||||
}
|
||||
|
||||
window.onclick = function(event) {
|
||||
if(event.target.parentElement != null) {
|
||||
if (event.target.parentElement.id == 'extra') {
|
||||
closeW();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function uploadFileBtn() {
|
||||
$("#upbutton").click();
|
||||
}
|
||||
|
|
106
apps/Navigation/action.php
Normal file
106
apps/Navigation/action.php
Normal file
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
require_once '../../inc/autoload.php';
|
||||
|
||||
$success = false;
|
||||
|
||||
if(is_loggedin())
|
||||
{
|
||||
//Save items
|
||||
if(isset($_GET['save']))
|
||||
{
|
||||
if(hasPerm('edit_nav'))
|
||||
{
|
||||
$db->setCol('nav_nav');
|
||||
foreach ($_POST['navID'] as $order => $id)
|
||||
{
|
||||
$db->data['nav_order'] = $order;
|
||||
$success = $db->update(['id' => $id]);
|
||||
//echo 'order: '.$order.' | ID: '.$id."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Delete Items
|
||||
if(isset($_GET['del']))
|
||||
{
|
||||
if(hasPerm('edit_nav'))
|
||||
{
|
||||
if (isset($_POST['id']) && is_numeric(intval($_POST['id'])))
|
||||
{
|
||||
$db->setCol('nav_nav');
|
||||
$db->data['id'] = $_POST['id'];
|
||||
$success = $db->delete();
|
||||
|
||||
//Find all childs
|
||||
$childs = [];
|
||||
function findChilds($parent)
|
||||
{
|
||||
global $db, $childs;
|
||||
foreach ($parent as $site)
|
||||
{
|
||||
$childs[] = $site['id'];
|
||||
$db->setCol('nav_nav');
|
||||
$db->data['parent'] = $site['id'];
|
||||
$db->get();
|
||||
$navd = $db->data;
|
||||
if (!empty($navd))
|
||||
{
|
||||
findChilds($navd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$db->setCol('nav_nav');
|
||||
$db->data['parent'] = $_POST['id'];
|
||||
$db->get();
|
||||
findChilds($db->data);
|
||||
|
||||
//print_r($childs);
|
||||
$db->setCol('nav_nav');
|
||||
foreach ($childs as $child)
|
||||
{
|
||||
$db->data['id'] = $child;
|
||||
$success = $db->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Create Items
|
||||
if(isset($_GET['create']))
|
||||
{
|
||||
if(hasPerm('edit_nav'))
|
||||
{
|
||||
if (isset($_POST['title'], $_POST['page'], $_POST['parent']))
|
||||
{
|
||||
if (is_numeric(intval($_POST['page'])) && is_numeric(intval($_POST['parent'])) && is_string(strval($_POST['title'])))
|
||||
{
|
||||
$db->setCol('nav_nav');
|
||||
$db->data['title'] = $_POST['title'];
|
||||
$db->data['page'] = $_POST['page'];
|
||||
$db->data['parent'] = $_POST['parent'];
|
||||
$success = $db->insert();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Update Parents
|
||||
if(isset($_GET['update']))
|
||||
{
|
||||
if(isset($_POST['id'], $_POST['parent']))
|
||||
{
|
||||
if (is_numeric(intval($_POST['id'])) && is_numeric(intval($_POST['parent'])))
|
||||
{
|
||||
$db->setCol('nav_nav');
|
||||
$db->data['parent'] = $_POST['parent'];
|
||||
$success = $db->update(['id' => $_POST['id']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($success)
|
||||
{
|
||||
echo 'success';
|
||||
}
|
15
apps/Navigation/config.php
Normal file
15
apps/Navigation/config.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
//langstrings
|
||||
$GLOBALS['lang']->set('Navigation', 'nav_title', 'de');
|
||||
$GLOBALS['lang']->set('Navigation', 'nav_title', 'en');
|
||||
|
||||
$_CONF['app_name'] = 'Navigation';
|
||||
$_CONF['app_build'] = 1;
|
||||
$_CONF['app_version'] = 'v0.9 Beta';
|
||||
$_CONF['base_file'] = 'nav.php';
|
||||
$_CONF['type'] = 'static';
|
||||
|
||||
$_CONF['menu_top'] = '<i class="fa fa-bars"></i> '.$GLOBALS['lang']->get('nav_title');
|
||||
$_CONF['menu'] = ['menu_top' => 'index.php'];
|
||||
|
||||
$_CONF['css'] = ['css/nav.css'];
|
123
apps/Navigation/css/nav.css
Normal file
123
apps/Navigation/css/nav.css
Normal file
|
@ -0,0 +1,123 @@
|
|||
.pseudo-table{
|
||||
display: table;
|
||||
|
||||
box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, .14);
|
||||
border: 1px solid #E0E0E0;
|
||||
border-collapse: collapse;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
margin: 15px 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.pseudo-table .row{
|
||||
display: table-row;
|
||||
|
||||
padding: 0 5px;
|
||||
cursor: hand;
|
||||
}
|
||||
|
||||
.pseudo-table .row{
|
||||
border-bottom: 1px solid #E0E0E0;
|
||||
padding: 0 5px 0 0;
|
||||
transition: 0.1s ease;
|
||||
-webkit-transition: 0.1s ease;
|
||||
|
||||
margin: 0 -15px 0 0 !important;
|
||||
}
|
||||
|
||||
.pseudo-table .row:hover{
|
||||
background: #EEEEEE;
|
||||
}
|
||||
|
||||
.pseudo-table .row:last-child{
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.pseudo-table .top{
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
background: rgb(246, 246, 246);
|
||||
}
|
||||
|
||||
.pseudo-table .col{
|
||||
display: table-cell;
|
||||
|
||||
padding: 10px 5px 10px 10px;
|
||||
}
|
||||
|
||||
.sortable-placeholder{
|
||||
width: 100%;
|
||||
height: 41px;
|
||||
}
|
||||
|
||||
.row{
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.col i{
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
/*Window*/
|
||||
.overlay {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.window {
|
||||
width: 100%;
|
||||
max-width: 984px;
|
||||
left: calc((50vw - 366px));
|
||||
top: 40px;
|
||||
background: #fff;
|
||||
padding: 10px 10px 20px;
|
||||
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
|
||||
z-index: 1;
|
||||
border-radius: 2px;
|
||||
position: fixed;
|
||||
overflow: auto;
|
||||
max-height: calc(100vh - 80px);
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.window .head {
|
||||
margin: -10px -10px 20px;
|
||||
padding: 10px 10px;
|
||||
background: #eaeaea;
|
||||
border-radius: 2px 2px 0 0;
|
||||
-moz-user-select: -moz-none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: default;
|
||||
position: fixed;
|
||||
width: 984px;
|
||||
}
|
||||
|
||||
.window .head .closeMsg {
|
||||
color: #212121;
|
||||
}
|
||||
|
||||
.window .head .closeMsg:hover {
|
||||
color: #5d5d5d;
|
||||
}
|
||||
|
||||
.window #content {
|
||||
margin-top: 60px;
|
||||
}
|
||||
|
||||
.window-confirm, .window-confirm .head {
|
||||
width: 350px;
|
||||
text-align: center;
|
||||
left: calc(50vw - 175px);
|
||||
}
|
||||
|
||||
.window-confirm .head {
|
||||
margin: -10px -10px 10px 0;
|
||||
text-align: left;
|
||||
}
|
157
apps/Navigation/index.php
Normal file
157
apps/Navigation/index.php
Normal file
|
@ -0,0 +1,157 @@
|
|||
<?php
|
||||
require_once '../../inc/autoload.php';
|
||||
printHeader($lang->get('nav_title'));
|
||||
|
||||
//Get all pages and build a dropdown list
|
||||
$pages = '';
|
||||
$db->setCol('simplePages_pages');
|
||||
$db->get();
|
||||
foreach ($db->data as $page)
|
||||
{
|
||||
$pages .= '<option value="'.$page['id'].'">'.$page['title'].'</option>';
|
||||
}
|
||||
|
||||
//Get all parents and build a dropdown list
|
||||
$parents = '<option value="0">--</option>';
|
||||
$db->setCol('nav_nav');
|
||||
$db->get();
|
||||
$parentdata = $db->data;
|
||||
foreach ($parentdata as $parent)
|
||||
{
|
||||
//If we don't have a parent from the Nav itself, take the page's title
|
||||
if($parent['title'] === '')
|
||||
{
|
||||
$db->setCol('simplePages_pages');
|
||||
$db->data['id'] = $parent['page'];
|
||||
$db->get();
|
||||
if(isset($db->data[0]))
|
||||
{
|
||||
$parents .= '<option value="' . $parent['id'] . '">' . $db->data[0]['title'] . '</option>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$parents .= '<option value="' . $parent['id'] . '">' . $parent['title'] . '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
//Show
|
||||
function buildNav($nav, $lvl = 0)
|
||||
{
|
||||
global $db;
|
||||
foreach ($nav as $site)
|
||||
{
|
||||
//Reset level
|
||||
if ($site['parent'] == 0)
|
||||
{
|
||||
$lvl = 0;
|
||||
}
|
||||
|
||||
echo '<div class="row" id="navID_' . $site['id'] . '">';
|
||||
$pageUrl = '#';
|
||||
$db->setCol('simplePages_pages');
|
||||
$db->data['id'] = $site['page'];
|
||||
$db->get();
|
||||
|
||||
$title = $site['title'];
|
||||
if ($title == '') $title = $db->data[0]['title'];
|
||||
|
||||
echo '<div class="col"><i class="fa fa-bars" aria-hidden="true" style="color: #ccc;"></i> ';
|
||||
for ($i = 1; $i <= $lvl; $i++)
|
||||
{
|
||||
echo ' ';
|
||||
}
|
||||
|
||||
$title = $site['title'];
|
||||
if ($title == '') $title = $db->data[0]['title'];
|
||||
|
||||
echo $title . '</div><div class="col"><a href="../SimplePages/backend/edit.php?id=' . $site['page'] . '"><i class="fa fa-pencil" aria-hidden="true"></i> ' . $db->data[0]['title'] . '</a></div>
|
||||
<div class="col"><select id="parentChange_'.$site['id'].'" data-nav-id="'.$site['id'].'" onchange="update(\''.$site['id'].'\')">' . str_replace('value="'.$site['parent'].'"', 'value="'.$site['parent'].'" selected', $GLOBALS['parents']) . '</select></div>
|
||||
<div class="col"><a onclick="del(' . $site['id'] . ');" class="del" title="' . $GLOBALS['lang']->get('nav_delete') . '"><i class="fa fa-trash-o" aria-hidden="true"></i></a></div>';
|
||||
|
||||
echo "</div>\n";
|
||||
|
||||
//Look for childs
|
||||
$db->setCol('nav_nav');
|
||||
$db->data['parent'] = $site['id'];
|
||||
$db->get(null, null, 'nav_order');
|
||||
$navd = $db->data;
|
||||
if (!empty($navd))
|
||||
{
|
||||
$lvl++;
|
||||
buildNav($navd, $lvl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* * mglkt zum "neuzuweisen" der Parents -> Dropdown
|
||||
*/
|
||||
|
||||
if ($apps->appExists('SimplePages'))
|
||||
{
|
||||
if (hasPerm('edit_nav'))
|
||||
{
|
||||
?>
|
||||
<div class="main">
|
||||
<p><i class="fa fa-info-circle"></i> <?php echo $lang->get('nav_drag') ?></p>
|
||||
<p><a onclick="createItem();" class="button"><i class="fa fa-plus" aria-hidden="true"></i> <?php echo $lang->get('nav_create');?></a></p>
|
||||
<div id="sortable" class="pseudo-table">
|
||||
<div class="row top" id="top">
|
||||
<div class="col"><?php echo $lang->get('nav_pageTitle') ?></div>
|
||||
<div class="col"><?php echo $lang->get('nav_page') ?></div>
|
||||
<div class="col"><?php echo $lang->get('nav_parent') ?></div>
|
||||
<div class="col"><?php echo $lang->get('nav_action') ?></div>
|
||||
</div>
|
||||
<?php
|
||||
$db->setCol('nav_nav');
|
||||
$db->data['parent'] = 0;
|
||||
$db->get(null, null, 'nav_order');
|
||||
buildNav($db->data);
|
||||
?>
|
||||
</div>
|
||||
<div id="extra"></div>
|
||||
</div>
|
||||
|
||||
<script src="js/jquery-ui.js"></script>
|
||||
<script src="js/nav.js"></script>
|
||||
<script>
|
||||
//Create Dropdowns
|
||||
var parents = '<?php echo $parents;?>';
|
||||
var pages = '<?php echo $pages;?>';
|
||||
var lang = {
|
||||
nav_saved_success: '<?php echo $lang->get('nav_saved_success') ?>',
|
||||
nav_saved_fail: '<?php echo $lang->get('nav_saved_fail') ?>',
|
||||
nav_delete: '<?php echo $lang->get('nav_delete') ?>',
|
||||
nav_delete_confirm: '<?php echo $lang->get('nav_delete_confirm') ?>',
|
||||
nav_delete_confirm_yes: '<?php echo $lang->get('nav_delete_confirm_yes') ?>',
|
||||
nav_delete_confirm_abort: '<?php echo $lang->get('nav_delete_confirm_abort') ?>',
|
||||
nav_deleted_success: '<?php echo $lang->get('nav_deleted_success') ?>',
|
||||
nav_deleted_fail: '<?php echo $lang->get('nav_deleted_fail') ?>',
|
||||
nav_create: '<?php echo $lang->get('nav_create') ?>',
|
||||
nav_create_title: '<?php echo $lang->get('nav_create_title') ?>',
|
||||
nav_create_page: '<?php echo $lang->get('nav_create_page') ?>',
|
||||
nav_create_parents: '<?php echo $lang->get('nav_create_parents') ?>',
|
||||
nav_create_create: '<?php echo $lang->get('nav_create_create') ?>',
|
||||
nav_create_abort: '<?php echo $lang->get('nav_create_abort') ?>',
|
||||
nav_create_success: '<?php echo $lang->get('nav_create_success') ?>',
|
||||
nav_create_fail: '<?php echo $lang->get('nav_create_fail') ?>',
|
||||
nav_update_success: '<?php echo $lang->get('nav_update_success') ?>',
|
||||
nav_update_fail: '<?php echo $lang->get('nav_update_fail') ?>',
|
||||
not_found: '<?php echo $lang->get('404_not_found') ?>',
|
||||
nav_saved_success: '<?php echo $lang->get('nav_saved_success') ?>',
|
||||
nav_saved_success: '<?php echo $lang->get('nav_saved_success') ?>',
|
||||
|
||||
};
|
||||
</script>
|
||||
<?php
|
||||
} else
|
||||
{
|
||||
echo msg('info', 'missing_permission');
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo msg('info', $lang->get('nav_needs_SimplePages'));
|
||||
}
|
||||
require_once '../../inc/footer.php';
|
18706
apps/Navigation/js/jquery-ui.js
vendored
Normal file
18706
apps/Navigation/js/jquery-ui.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
169
apps/Navigation/js/nav.js
Normal file
169
apps/Navigation/js/nav.js
Normal file
|
@ -0,0 +1,169 @@
|
|||
//Create the Spinner
|
||||
$('#title').append('<div class="spinner-container" style="display:inline-block;vertical-align: middle;padding: 0px 10px;"><svg class="spinner" style="width: 25px;" viewBox="0 0 44 44"><circle class="path" cx="22" cy="22" r="20" fill="none" stroke-width="4"></circle></svg></div>');
|
||||
//Hide it
|
||||
$('.spinner-container').hide();
|
||||
|
||||
$(function () {
|
||||
$("#sortable").sortable({
|
||||
axis: "y",
|
||||
cursor: "move",
|
||||
placeholder: "sortable-placeholder",
|
||||
over: function (event, ui) {
|
||||
console.log(event, ui)
|
||||
},
|
||||
stop: function (event, ui) {// When finished sorting, send all data to the server to process
|
||||
$('.spinner-container').show(); //Show loader
|
||||
$.ajax({
|
||||
url: 'action.php?save',
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
data: $("#sortable").sortable("serialize"), //Get the newly sorted array
|
||||
success: function (result) { // On success, display a message..
|
||||
if (result == 'success') {
|
||||
showMsg(lang.nav_saved_success);
|
||||
} else {
|
||||
showMsg(lang.nav_saved_fail);
|
||||
}
|
||||
|
||||
//And reload the content. We do this to display everything including their childs
|
||||
reloadNav();
|
||||
|
||||
$('.spinner-container').hide(); //Hide the Loader
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.log(status, error);
|
||||
showMsg(lang.nav_saved_fail);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$("#sortable").disableSelection();
|
||||
});
|
||||
|
||||
//Delete
|
||||
function del(id) {
|
||||
|
||||
$('#extra').html('<div class="overlay" style="display:none;"><div class="window window-confirm"><div class="head">' + lang.nav_delete + '<a onclick="closeW();" class="closeMsg"><i class="fa fa-close"></i></a></div><div id="content"><p>' + lang.nav_delete_confirm + '</p><p><a class="button btn_del" id="deleteConfirm"><i class="fa fa-trash-o"></i> ' + lang.nav_delete_confirm_yes + '</a><a onclick="closeW();" class="button">' + lang.nav_delete_confirm_abort + '</a></p></div></div></div>');
|
||||
//uuund einbelnden
|
||||
$(".overlay").fadeIn(250);
|
||||
|
||||
$('#deleteConfirm').click(function () {
|
||||
closeW();
|
||||
$.ajax({
|
||||
url: 'action.php?del',
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
data: 'id=' + id,
|
||||
success: function (result) { // On success, display a message...
|
||||
console.log(result);
|
||||
if (result == 'success') {
|
||||
showMsg(lang.nav_deleted_success);
|
||||
} else {
|
||||
showMsg(lang.nav_deleted_fail);
|
||||
}
|
||||
|
||||
//...and reload the content. We do this to display everything including their childs
|
||||
reloadNav();
|
||||
|
||||
$('.spinner-container').hide(); //Hide the Loader
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.log(status, error);
|
||||
showMsg(lang.nav_deleted_fail);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//Create menuitem
|
||||
function createItem() {
|
||||
$('#extra').html('<div class="overlay" style="display:none;"><div class="window window-confirm"><div class="head">' + lang.nav_create + '<a onclick="closeW();" class="closeMsg"><i class="fa fa-close"></i></a></div><div id="content"><p><input type="text" name="nav_title" id="nav_title" placeholder="' + lang.nav_create_title + '"/></p><p>' + lang.nav_create_page + ': <select name="nav_page" id="nav_page">' + pages + '</select></p><p>' + lang.nav_create_parents + ': <select name="nav_parent" id="nav_parent">' + parents + '</select></p><p><a class="button" id="createConfirm"><i class="fa fa-plus"></i> ' + lang.nav_create_create + '</a><a onclick="closeW();" class="button btn_del">' + lang.nav_create_abort + '</a></p></div></div></div>');
|
||||
$(".overlay").fadeIn(250);
|
||||
|
||||
$('#createConfirm').click(function () {
|
||||
closeW();
|
||||
$.ajax({
|
||||
url: 'action.php?create',
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
data: 'title=' + $('#nav_title').val() + '&page=' + $('#nav_page').val() + '&parent=' + $('#nav_parent').val(),
|
||||
success: function (result) { // On success, display a message...
|
||||
if (result == 'success') {
|
||||
showMsg(lang.nav_create_success);
|
||||
} else {
|
||||
showMsg(lang.nav_create_fail);
|
||||
}
|
||||
|
||||
//...and reload the content. We do this to display everything including their childs
|
||||
reloadNav();
|
||||
|
||||
$('.spinner-container').hide(); //Hide the Loader
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
showMsg(lang.nav_create_fail);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//Update
|
||||
/*$('#parentChange').on('change', function() {
|
||||
console.log('faa');
|
||||
console.log(this.dataset);
|
||||
});*/
|
||||
|
||||
function update(id) {
|
||||
var newParent = $('#parentChange_' + id).val();
|
||||
|
||||
$.ajax({
|
||||
url: 'action.php?update',
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
data: 'id=' + id + '&parent=' + newParent,
|
||||
success: function (result) { // On success, display a message...
|
||||
if (result == 'success') {
|
||||
showMsg(lang.nav_update_success);
|
||||
} else {
|
||||
showMsg(lang.nav_update_fail);
|
||||
}
|
||||
|
||||
//...and reload the content. We do this to display everything including their childs
|
||||
reloadNav();
|
||||
|
||||
$('.spinner-container').hide(); //Hide the Loader
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
showMsg(lang.nav_update_fail);
|
||||
$('.spinner-container').hide(); //Hide the Loader
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Reload
|
||||
function reloadNav() {
|
||||
$.get('index.php?direct', function (data) {
|
||||
$("#loader").html(data);
|
||||
}).fail(function (e) {
|
||||
if (e.status == 404) {
|
||||
showMsg(lang.not_found + ' (' + e.statusText + ')');
|
||||
} else {
|
||||
showMsg('Error.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Close Window
|
||||
function closeW() {
|
||||
$(".overlay").fadeOut(200);
|
||||
setTimeout(function () {
|
||||
$('#extra').html('');
|
||||
}, 300);
|
||||
}
|
||||
|
||||
window.onclick = function(event) {
|
||||
if(event.target.parentElement != null) {
|
||||
if (event.target.parentElement.id == 'extra') {
|
||||
closeW();
|
||||
}
|
||||
}
|
||||
}
|
38
apps/Navigation/lang/lang.de.php
Normal file
38
apps/Navigation/lang/lang.de.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/*
|
||||
* Mowie Language Class
|
||||
*
|
||||
* -----------------
|
||||
* LANGUAGE: German
|
||||
* -----------------
|
||||
*/
|
||||
$lang = [];
|
||||
$lang['__Lang__'] = 'German (Deutsch)';
|
||||
$lang['__LangCode__'] = 'de';
|
||||
$lang['__Countrycode__'] = 'de_DE';
|
||||
|
||||
$lang['nav_needs_SimplePages'] = 'Diese App braucht SimplePages, um zu funktionieren.';
|
||||
$lang['nav_id'] = 'ID';
|
||||
$lang['nav_pageTitle'] = 'Titel';
|
||||
$lang['nav_page'] = 'Seite';
|
||||
$lang['nav_parent'] = 'Übergeordnet';
|
||||
$lang['nav_drag'] = 'Ziehen Sie Menüpunkte herum, um sie anzuordnen.';
|
||||
$lang['nav_saved_success'] = 'Die neue Reihenfolge wurde erfolgreich gespeichert.';
|
||||
$lang['nav_saved_fail'] = 'Beim Speichern der neuen Reihenfolge trat ein Fehler auf.';
|
||||
$lang['nav_action'] = 'Aktionen ausführen';
|
||||
$lang['nav_delete'] = 'Menüeintrag löschen';
|
||||
$lang['nav_deleted_success'] = 'Der Menüeintrag wurde erfolgreich gelöscht.';
|
||||
$lang['nav_deleted_fail'] = 'Beim Löschen des Menüeintrags trat ein Fehler auf.';
|
||||
$lang['nav_delete_confirm'] = 'Möchten Sie diesen Menüeintrag wirklich löschen?';
|
||||
$lang['nav_delete_confirm_yes'] = 'Löschen!';
|
||||
$lang['nav_delete_confirm_abort'] = 'Abbrechen';
|
||||
$lang['nav_create'] = 'Neuen Menüeintrag erstellen';
|
||||
$lang['nav_create_title'] = 'Titel (Optional)';
|
||||
$lang['nav_create_create'] = 'Erstellen';
|
||||
$lang['nav_create_abort'] = 'Abbrechen';
|
||||
$lang['nav_create_parents'] = 'Übergeordnet';
|
||||
$lang['nav_create_page'] = 'Seite';
|
||||
$lang['nav_create_success'] = 'Der neue Menüeintrag wurde erfolgreich angelegt.';
|
||||
$lang['nav_create_fail'] = 'Beim Anlegen des neuen Menüeintrags trat ein Fehler auf.';
|
||||
$lang['nav_update_success'] = 'Der Menüeintrag wurde erfolgreich geändert.';
|
||||
$lang['nav_update_fail'] = 'Beim Ändern des Menüeintrags trat ein Fehler auf.';
|
38
apps/Navigation/lang/lang.en.php
Normal file
38
apps/Navigation/lang/lang.en.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/*
|
||||
* Mowie Language Class
|
||||
*
|
||||
* -----------------
|
||||
* LANGUAGE: German
|
||||
* -----------------
|
||||
*/
|
||||
$lang = [];
|
||||
$lang['__Lang__'] = 'English (English)';
|
||||
$lang['__LangCode__'] = 'en';
|
||||
$lang['__Countrycode__'] = 'en';
|
||||
|
||||
$lang['nav_needs_SimplePages'] = 'This App needs SimplePages to work.';
|
||||
$lang['nav_id'] = 'ID';
|
||||
$lang['nav_pageTitle'] = 'Title';
|
||||
$lang['nav_page'] = 'Page';
|
||||
$lang['nav_parent'] = 'Child of';
|
||||
$lang['nav_drag'] = 'Drag & Drop entries to arrange them.';
|
||||
$lang['nav_saved_success'] = 'The new order was successfully saved.';
|
||||
$lang['nav_saved_fail'] = 'An error occured while saving the new order.';
|
||||
$lang['nav_action'] = 'Action';
|
||||
$lang['nav_delete'] = 'Delete';
|
||||
$lang['nav_deleted_success'] = 'The item was successfully deleted.';
|
||||
$lang['nav_deleted_fail'] = 'An error occured while deleting this item.';
|
||||
$lang['nav_delete_confirm'] = 'Are you sure you want to delete this item?';
|
||||
$lang['nav_delete_confirm_yes'] = 'Delete!';
|
||||
$lang['nav_delete_confirm_abort'] = 'Cancel';
|
||||
$lang['nav_create'] = 'Create a new item';
|
||||
$lang['nav_create_title'] = 'Title (Optional)';
|
||||
$lang['nav_create_create'] = 'Create';
|
||||
$lang['nav_create_abort'] = 'Cancel';
|
||||
$lang['nav_create_parents'] = 'Child of';
|
||||
$lang['nav_create_page'] = 'Page';
|
||||
$lang['nav_create_success'] = 'The new item was successfully created.';
|
||||
$lang['nav_create_fail'] = 'An error occured while saving the new item.';
|
||||
$lang['nav_update_success'] = 'The item was successfully updated.';
|
||||
$lang['nav_update_fail'] = 'An error occured while updating the item.';
|
44
apps/Navigation/nav.php
Normal file
44
apps/Navigation/nav.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
$navTree = '';
|
||||
//Show
|
||||
function buildNav($nav)
|
||||
{
|
||||
global $navTree, $db;
|
||||
$navTree .= '<ul>';
|
||||
foreach ($nav as $site)
|
||||
{
|
||||
//Get the Page URL
|
||||
$pageUrl = '#';
|
||||
$db->setCol('simplePages_pages');
|
||||
$db->data['id'] = $site['page'];
|
||||
$db->get();
|
||||
if(!empty($db->data)) $pageUrl = $db->data[0]['alias'];
|
||||
|
||||
//Get the page title
|
||||
$title = $site['title'];
|
||||
if($title == '') $title = $db->data[0]['title'];
|
||||
|
||||
$navTree .= '<li><a href="'.$GLOBALS['MCONF']['web_uri'].$pageUrl.'">'.$title.'</a>';
|
||||
|
||||
//Look for childs
|
||||
$db->setCol('nav_nav');
|
||||
$db->data['parent'] = $site['id'];
|
||||
$db->get(null, null, 'nav_order');
|
||||
$navd = $db->data;
|
||||
//If this site has any childs, build the navtree for them
|
||||
if (!empty($navd))
|
||||
{
|
||||
buildNav($navd);
|
||||
}
|
||||
$navTree .= '</li>';
|
||||
}
|
||||
$navTree .= '</ul>';
|
||||
}
|
||||
|
||||
//Create the Navigation, start with all top-level pages
|
||||
$db->setCol('nav_nav');
|
||||
$db->data['parent'] = 0;
|
||||
$db->get(null, null, 'nav_order');
|
||||
buildNav($db->data);
|
||||
|
||||
$page->assign('navTree', $navTree);
|
10
apps/Navigation/permissions.json
Normal file
10
apps/Navigation/permissions.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"permissions": [
|
||||
{
|
||||
"key": "edit_nav",
|
||||
"name": "Edit the Navigation",
|
||||
"description": "",
|
||||
"critical": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,7 +11,6 @@ $GLOBALS['lang']->set('Manage Permissions', 'sp_manage_permissions', 'en');
|
|||
$GLOBALS['lang']->set('Create New Page', 'sp_create_new', 'en');
|
||||
|
||||
$_CONF['app_name'] = 'SimplePages';
|
||||
$_CONF['app_desc'] = 'Wird benutzt, um Einfache statische Seitn zu erzeugen und zu verwalten.';
|
||||
$_CONF['app_build'] = 2;
|
||||
$_CONF['app_version'] = 'v0.9 Beta';
|
||||
$_CONF['base_url'] = '/'; //Basisurl des moduls, wenn es über das Frontend aufgerufen wird
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<div class="container">
|
||||
{$menu}
|
||||
<div class="seite">
|
||||
{$navTree}
|
||||
{$sidebar}
|
||||
{$content}
|
||||
{$test}
|
||||
|
|
|
@ -326,7 +326,7 @@ echo '
|
|||
<label for="options_menu">
|
||||
<p><span class="usr_info">';
|
||||
//<img src="http://www.gravatar.com/avatar/' . md5(strtolower(trim($_SESSION['mail']))) . '?s=40&d=mm" alt=""/>
|
||||
echo '<img src="http://www.gravatar.com/avatar/' . md5(strtolower(trim($_SESSION['mail']))) . '?s=40&d=mm" alt=""/> '.$_SESSION['user'] . '</span> <span class="fa fa-chevron-down"></span></p>
|
||||
echo '<img src="http://www.gravatar.com/avatar/' . md5(strtolower(trim($_SESSION['mail']))) . '?s=40&d=mm" alt=""/> '.$_SESSION['user'] . '</span> <span class="fa fa-chevron-down"></span></p>
|
||||
<ul>
|
||||
<li><a href="' . $GLOBALS['MCONF']['web_uri'] . 'admin/user_settings.php"><span class="fa fa-gear"></span> ' . $GLOBALS['lang']->get('settings') . '</a></li>
|
||||
<li><a href="' . $GLOBALS['MCONF']['web_uri'] . 'admin/logout.php" rel="external"><span class="fa fa-sign-out"></span> ' . $GLOBALS['lang']->get('logout') . '</a></li>
|
||||
|
|
Loading…
Reference in New Issue
Block a user