lets try that again
This commit is contained in:
parent
567379bdb3
commit
8b8709eb46
2 changed files with 18 additions and 7 deletions
|
@ -48,9 +48,10 @@ Main::init($sakuraConf);
|
||||||
// Set base page rendering data
|
// Set base page rendering data
|
||||||
$renderData = array(
|
$renderData = array(
|
||||||
'sakura' => [
|
'sakura' => [
|
||||||
'version' => SAKURA_VERSION,
|
'version' => SAKURA_VERSION,
|
||||||
'urls' => Configuration::getLocalConfig('urls'),
|
'urls' => Configuration::getLocalConfig('urls'),
|
||||||
'charset' => Configuration::getConfig('charset')
|
'charset' => Configuration::getConfig('charset'),
|
||||||
|
'currentpage' => $_SERVER['PHP_SELF']
|
||||||
],
|
],
|
||||||
'user' => [
|
'user' => [
|
||||||
'loggedin' => Users::loggedIn()
|
'loggedin' => Users::loggedIn()
|
||||||
|
|
|
@ -15,13 +15,23 @@
|
||||||
<script type="text/javascript" src="//{{ sakura.urls.content }}/js/yuuno.js"></script>
|
<script type="text/javascript" src="//{{ sakura.urls.content }}/js/yuuno.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
{% if user.loggedin != true %}
|
{% if user.loggedin != true %}
|
||||||
document.getElementById('headerLoginBtn').setAtrribute('href', 'javascript:;');
|
// Setting the shit so clicking the login link doesn't redirect to /login
|
||||||
document.getElementById('headerLoginBtn').setAtrribute('onclick', 'toggleLoginForm();');
|
function initLoginForm() {
|
||||||
|
|
||||||
|
var headerLoginLink = document.getElementById('headerLoginLink');
|
||||||
|
|
||||||
|
headerLoginLink.setAtrribute('href', 'javascript:;');
|
||||||
|
headerLoginLink.setAtrribute('onclick', 'toggleLoginForm();');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Toggling the dynamic login form
|
||||||
function toggleLoginForm() {
|
function toggleLoginForm() {
|
||||||
|
|
||||||
var headerLoginForm = document.getElementById('headerLoginForm');
|
var headerLoginForm = document.getElementById('headerLoginForm');
|
||||||
|
|
||||||
headerLoginForm.className = (headerLoginForm.className == 'hidden' ? '' : 'hidden');
|
headerLoginForm.className = (headerLoginForm.className == 'hidden' ? '' : 'hidden');
|
||||||
|
|
||||||
}
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
|
@ -39,7 +49,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-ucp" id="navMenuUser">
|
<div class="menu-ucp" id="navMenuUser">
|
||||||
<!-- User menu, displayed on right side of the bar. -->
|
<!-- User menu, displayed on right side of the bar. -->
|
||||||
<a class="menu-item" id="headerLoginBtn" href="http://{{ sakura.urls.main }}/login" title="Login to Flashii">Login</a>
|
<a class="menu-item" id="headerLoginLink" onload="initLoginForm();" href="http://{{ sakura.urls.main }}/login" title="Login to Flashii">Login</a>
|
||||||
<a class="menu-item" href="http://{{ sakura.urls.main }}/register" title="Create an account">Register</a>
|
<a class="menu-item" href="http://{{ sakura.urls.main }}/register" title="Create an account">Register</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-mob">
|
<div class="menu-mob">
|
||||||
|
@ -53,4 +63,4 @@
|
||||||
<div class="hidden" id="headerLoginForm">
|
<div class="hidden" id="headerLoginForm">
|
||||||
login form
|
login form
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}{{ sakura.currentpage }}
|
||||||
|
|
Reference in a new issue