opening event modal on load
This commit is contained in:
@@ -6,7 +6,7 @@ require_once("participoLib/participo.php");
|
|||||||
require_once("participoLib/planer.php");
|
require_once("participoLib/planer.php");
|
||||||
|
|
||||||
require_once("config/participo.php");
|
require_once("config/participo.php");
|
||||||
|
|
||||||
require_once("./local/dbConf.php");
|
require_once("./local/dbConf.php");
|
||||||
require_once("./local/cwsvJudo.php");
|
require_once("./local/cwsvJudo.php");
|
||||||
|
|
||||||
@@ -16,15 +16,15 @@ require_once("config/participo.php");
|
|||||||
require_once($config['basePath']."/config/cwsvJudo.config.php");
|
require_once($config['basePath']."/config/cwsvJudo.config.php");
|
||||||
|
|
||||||
dbConnector::connect(
|
dbConnector::connect(
|
||||||
$cwsvJudoConfig["db"]["host"],
|
$cwsvJudoConfig["db"]["host"],
|
||||||
$cwsvJudoConfig["db"]["name"],
|
$cwsvJudoConfig["db"]["name"],
|
||||||
$cwsvJudoConfig["db"]["user"],
|
$cwsvJudoConfig["db"]["user"],
|
||||||
$cwsvJudoConfig["db"]["password"]
|
$cwsvJudoConfig["db"]["password"]
|
||||||
);
|
);
|
||||||
eventPlaner::setDbConnection(dbConnector::getDbConnection());
|
eventPlaner::setDbConnection(dbConnector::getDbConnection());
|
||||||
|
|
||||||
participo::authentificate();
|
participo::authentificate();
|
||||||
|
|
||||||
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||||
|
|
||||||
$meta = array(
|
$meta = array(
|
||||||
|
|||||||
@@ -13,30 +13,45 @@ include_once("events.inc.php");
|
|||||||
|
|
||||||
<!-- inits for the materializeCss -->
|
<!-- inits for the materializeCss -->
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
function initSidenav() {
|
||||||
var elems = document.querySelectorAll('.sidenav');
|
var sidenavElements = document.querySelectorAll('.sidenav');
|
||||||
var instances = M.Sidenav.init(elems, {
|
var sidenavInstances = M.Sidenav.init(sidenavElements, {
|
||||||
// specify options here
|
|
||||||
});
|
});
|
||||||
});
|
};
|
||||||
// document.addEventListener('DOMContentLoaded', function() {
|
function initModals() {
|
||||||
// var elems = document.querySelectorAll('.modal');
|
var modalElements = document.querySelectorAll('.modal');
|
||||||
// var instances = M.Modal.init(elems, {
|
var modalInstances = M.Modal.init(modalElements, {
|
||||||
// // specify options here
|
});
|
||||||
// });
|
};
|
||||||
// });
|
function openEventModal(eventId){
|
||||||
|
openModal(`#event-modal-${eventId}`);
|
||||||
|
}
|
||||||
|
function openModal(modalId){
|
||||||
|
var modalElement = document.querySelector(modalId);
|
||||||
|
if( modalElement === null ){
|
||||||
|
console.log(`No modalElement by name ${modalId} found. Won't open!`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var modalInstance = M.Modal.getInstance(modalElement);
|
||||||
|
console.log("before opening: ", modalInstance);
|
||||||
|
modalInstance.open();
|
||||||
|
console.log("after opening: ", modalInstance);
|
||||||
|
}
|
||||||
|
|
||||||
// Open the given modal
|
// What to do when the document is loaded.
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
// So far we assume the first given fragment (the stuff behind the #) is the modalId
|
// init materialize elements
|
||||||
var eventId = window.location.hash.substr(1);
|
initModals();
|
||||||
var Modalelem = document.querySelector('#event-modal-'+eventId);
|
initSidenav();
|
||||||
var instance = M.Modal.init(Modalelem);
|
|
||||||
instance.open();
|
// opening event modal if given
|
||||||
|
var eventId = parseInt( window.location.hash.substr(1) );
|
||||||
|
if( !isNaN(eventId) ){
|
||||||
|
openEventModal(eventId);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<title><?php echo($meta['title']);?></title>
|
<title><?php echo($meta['title']);?></title>
|
||||||
<meta name="description" content="<?php echo($meta['description']);?>" />
|
<meta name="description" content="<?php echo($meta['description']);?>" />
|
||||||
|
|
||||||
@@ -47,37 +62,8 @@ include_once("events.inc.php");
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<!-- cwsvJudoApps SideNav -->
|
<!-- The sidenav -->
|
||||||
<div>
|
<?php require("./events.sidenav.inc.php");?>
|
||||||
<nav class="indigo darken-4">
|
|
||||||
<div class="nav-wrapper">
|
|
||||||
<div class="col s12">
|
|
||||||
<a href="http://cwsvjudo.bplaced.net/" class="breadcrumb">cwsvJudo-Apps</a>
|
|
||||||
<a href="http://cwsvjudo.bplaced.net/participo/events" class="breadcrumb"><?php echo($meta['title']);?></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a class="right top-nav sidenav-trigger waves-effect waves-light hide-on-large-only" href="#" data-target="nav-mobile">
|
|
||||||
<i class="material-icons">menu</i>
|
|
||||||
</a>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<ul class="sidenav sidenav-fixed sidenav-close" id="nav-mobile">
|
|
||||||
<li class="logo">
|
|
||||||
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
|
||||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<?php require_once("sidenav/loginStatus.php");?><!-- brings its own li -->
|
|
||||||
<li class="bold">
|
|
||||||
<a class="waves-effect waves-teal right-align" href="#eventList">Liste anstehender Events<i class="material-icons">format_list_bulleted</i></a>
|
|
||||||
</li>
|
|
||||||
<li class="bold">
|
|
||||||
<a class="waves-effect waves-teal right-align" href="#detailedEventList">Details anstehender Events<i class="material-icons">view_list</i></a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<?php if($_SESSION['login']){ ?>
|
<?php if($_SESSION['login']){ ?>
|
||||||
|
|||||||
31
homepage/participo/events.sidenav.inc.php
Normal file
31
homepage/participo/events.sidenav.inc.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<!-- cwsvJudoApps SideNav -->
|
||||||
|
<div>
|
||||||
|
<nav class="indigo darken-4">
|
||||||
|
<div class="nav-wrapper">
|
||||||
|
<div class="col s12">
|
||||||
|
<a href="http://cwsvjudo.bplaced.net/" class="breadcrumb">cwsvJudo-Apps</a>
|
||||||
|
<a href="http://cwsvjudo.bplaced.net/participo/events" class="breadcrumb"><?php echo($meta['title']);?></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a class="right top-nav sidenav-trigger waves-effect waves-light hide-on-large-only" href="#" data-target="nav-mobile">
|
||||||
|
<i class="material-icons">menu</i>
|
||||||
|
</a>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<ul class="sidenav sidenav-fixed sidenav-close" id="nav-mobile">
|
||||||
|
<li class="logo">
|
||||||
|
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
||||||
|
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php require_once("sidenav/loginStatus.php");?><!-- brings its own li -->
|
||||||
|
<li class="bold">
|
||||||
|
<a class="waves-effect waves-teal right-align" href="#eventList">Liste anstehender Events<i class="material-icons">format_list_bulleted</i></a>
|
||||||
|
</li>
|
||||||
|
<li class="bold">
|
||||||
|
<a class="waves-effect waves-teal right-align" href="#detailedEventList">Details anstehender Events<i class="material-icons">view_list</i></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div><!-- cwsvJudoApps SideNav -->
|
||||||
@@ -223,18 +223,7 @@ class eventPlaner
|
|||||||
|
|
||||||
public static function getHtmlEventTable($eventList)
|
public static function getHtmlEventTable($eventList)
|
||||||
{
|
{
|
||||||
$ret = '';
|
$ret = '<table>';
|
||||||
|
|
||||||
// initialize the modals
|
|
||||||
$ret .= '<script>';
|
|
||||||
$ret .= "document.addEventListener('DOMContentLoaded', function() {";
|
|
||||||
$ret .= "var elems = document.querySelectorAll('.modal');";
|
|
||||||
$ret .= 'var instances = M.Modal.init(elems, {';
|
|
||||||
$ret .= '});';
|
|
||||||
$ret .= '});';
|
|
||||||
$ret .= '</script>';
|
|
||||||
|
|
||||||
$ret .= '<table>';
|
|
||||||
foreach ($eventList as $event) {
|
foreach ($eventList as $event) {
|
||||||
$ret .= $event->htmlTableRow();
|
$ret .= $event->htmlTableRow();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<!-- MaterializeCss -->
|
<!-- MaterializeCss -->
|
||||||
|
|
||||||
<!-- - Compiled and minified CSS -->
|
<!-- - Compiled and minified CSS -->
|
||||||
<link rel="stylesheet" href="/ressourcen/materializeCss/css/materialize.min.css">
|
<link rel="stylesheet" href="/ressourcen/materializeCss/css/materialize.min.css">
|
||||||
<!-- Compiled and minified JavaScript -->
|
<!-- Compiled and minified JavaScript -->
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ if ($_SESSION['login']) {
|
|||||||
if ($_GET['changePasswordSuccess'] == 'true') {
|
if ($_GET['changePasswordSuccess'] == 'true') {
|
||||||
echo('<div>Password geändert</div>');
|
echo('<div>Password geändert</div>');
|
||||||
} else {
|
} else {
|
||||||
echo('<div>Fehler während setzens des Passwortes.</div>');
|
echo('<div>Fehler während des Setzens des Passwortes.</div>');
|
||||||
}
|
}
|
||||||
} ?>
|
} ?>
|
||||||
</p>
|
</p>
|
||||||
@@ -172,7 +172,7 @@ if ($_SESSION['login']) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="card-title">Passwort</span>
|
<span class="card-title">Passwort</span>
|
||||||
<p>Im folgenden Formular kann das Passwort des Kindes gesetzt werden. Das eigene Passwort muss dabei noch einmal zur Kontrolle eingegeben werden. Das neue Passwort muss zweimal blind eingegeben.</p>
|
<p>Im folgenden Formular kann das Passwort des Kindes gesetzt werden. Damit kann das Kind sich auch in das System einloggen - um z.B. die Wissens-Apps zu benutzen - kann sich aber nicht bei Wettkämpfen anmelden. Das eigene Passwort muss dabei noch einmal zur Kontrolle eingegeben werden. Das neue Passwort muss zweimal blind eingegeben.</p>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
if (($kid['pwHash'] == '') || ($kid['pwHash']) == null) {
|
if (($kid['pwHash'] == '') || ($kid['pwHash']) == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user