2013-12-21 01:32:39 -08:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* e107 website system
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
* e107 Bootstrap Theme Shortcodes.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
class theme_shortcodes extends e_shortcode
|
|
|
|
{
|
2013-12-21 06:23:22 -08:00
|
|
|
function __construct()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2015-03-29 20:25:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
function sc_bootstrap_branding()
|
2013-12-21 01:32:39 -08:00
|
|
|
{
|
2015-11-05 12:25:16 -08:00
|
|
|
$pref = e107::pref('theme', 'branding');
|
2015-03-29 20:25:33 -07:00
|
|
|
|
|
|
|
switch($pref)
|
|
|
|
{
|
|
|
|
case 'logo':
|
|
|
|
|
|
|
|
return e107::getParser()->parseTemplate('{SITELOGO: h=30}',true);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'sitenamelogo':
|
|
|
|
|
|
|
|
return "<span class='pull-left'>".e107::getParser()->parseTemplate('{SITELOGO: h=30}',true)."</span>".SITENAME;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'sitename':
|
|
|
|
default:
|
|
|
|
|
|
|
|
return SITENAME;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function sc_bootstrap_nav_align()
|
|
|
|
{
|
|
|
|
$pref = e107::pref('theme', 'nav_alignment');
|
|
|
|
|
|
|
|
if($pref == 'right')
|
|
|
|
{
|
|
|
|
return "navbar-right";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function sc_bootstrap_usernav($parm='')
|
|
|
|
{
|
|
|
|
|
|
|
|
$placement = e107::pref('theme', 'usernav_placement', 'top');
|
|
|
|
|
|
|
|
if($parm['placement'] != $placement)
|
|
|
|
{
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
2013-12-21 01:32:39 -08:00
|
|
|
include_lan(e_PLUGIN."login_menu/languages/".e_LANGUAGE.".php");
|
|
|
|
|
|
|
|
$tp = e107::getParser();
|
2015-04-08 14:47:15 -07:00
|
|
|
require(e_PLUGIN."login_menu/login_menu_shortcodes.php"); // don't use 'require_once'.
|
2015-03-29 20:25:33 -07:00
|
|
|
|
|
|
|
$direction = vartrue($parm['dir']) == 'up' ? ' dropup' : '';
|
2015-02-05 16:24:54 -08:00
|
|
|
|
|
|
|
$userReg = defset('USER_REGISTRATION');
|
2013-12-21 06:23:22 -08:00
|
|
|
|
2013-12-21 01:32:39 -08:00
|
|
|
if(!USERID) // Logged Out.
|
|
|
|
{
|
|
|
|
$text = '
|
2015-04-09 01:39:37 -07:00
|
|
|
<ul class="nav navbar-nav navbar-right'.$direction.'">';
|
2016-03-30 19:10:00 -07:00
|
|
|
|
2015-02-05 16:24:54 -08:00
|
|
|
if($userReg==1)
|
2013-12-21 01:32:39 -08:00
|
|
|
{
|
|
|
|
$text .= '
|
2015-06-11 09:40:56 -07:00
|
|
|
<li><a href="'.e_SIGNUP.'">'.LAN_LOGINMENU_3.'</a></li>
|
2015-01-26 09:57:14 -08:00
|
|
|
'; // Signup
|
2013-12-21 01:32:39 -08:00
|
|
|
}
|
2015-03-30 17:13:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
$socialActive = e107::pref('core', 'social_login_active');
|
|
|
|
|
|
|
|
if(!empty($userReg) || !empty($socialActive)) // e107 or social login is active.
|
|
|
|
{
|
|
|
|
$text .= '
|
|
|
|
<li class="divider-vertical"></li>
|
|
|
|
<li class="dropdown">
|
2015-02-05 16:24:54 -08:00
|
|
|
|
2015-06-11 09:40:56 -07:00
|
|
|
<a class="dropdown-toggle" href="#" data-toggle="dropdown">'.LAN_LOGINMENU_51.' <strong class="caret"></strong></a>
|
2014-01-03 02:43:16 -08:00
|
|
|
<div class="dropdown-menu col-sm-12" style="min-width:250px; padding: 15px; padding-bottom: 0px;">
|
2015-02-05 16:24:54 -08:00
|
|
|
|
2016-03-13 17:57:51 -07:00
|
|
|
{SOCIAL_LOGIN: size=2x&label=1}
|
2015-04-21 11:46:43 +02:00
|
|
|
'; // Sign In
|
2015-03-30 17:13:41 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return '';
|
|
|
|
}
|
2015-02-05 16:24:54 -08:00
|
|
|
|
|
|
|
|
|
|
|
if(!empty($userReg)) // value of 1 or 2 = login okay.
|
|
|
|
{
|
2015-04-10 12:36:35 -07:00
|
|
|
|
2015-04-24 15:03:42 -07:00
|
|
|
// global $sc_style; // never use global - will impact signup/usersettings pages.
|
|
|
|
// $sc_style = array(); // remove any wrappers.
|
2015-04-10 12:36:35 -07:00
|
|
|
|
2015-02-05 16:24:54 -08:00
|
|
|
$text .='
|
|
|
|
|
2013-12-21 01:32:39 -08:00
|
|
|
<form method="post" onsubmit="hashLoginPassword(this);return true" action="'.e_REQUEST_HTTP.'" accept-charset="UTF-8">
|
2015-04-10 12:36:35 -07:00
|
|
|
<p>{LM_USERNAME_INPUT}</p>
|
|
|
|
<p>{LM_PASSWORD_INPUT}</p>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-group"></div>
|
2013-12-21 06:23:22 -08:00
|
|
|
{LM_IMAGECODE_NUMBER}
|
|
|
|
{LM_IMAGECODE_BOX}
|
|
|
|
|
2013-12-21 01:32:39 -08:00
|
|
|
<div class="checkbox">
|
2015-01-26 09:57:14 -08:00
|
|
|
|
|
|
|
<label class="string optional" for="autologin"><input style="margin-right: 10px;" type="checkbox" name="autologin" id="autologin" value="1">
|
2015-06-11 09:40:56 -07:00
|
|
|
'.LAN_LOGINMENU_6.'</label>
|
2013-12-21 01:32:39 -08:00
|
|
|
</div>
|
2015-06-11 09:40:56 -07:00
|
|
|
<input class="btn btn-primary btn-block" type="submit" name="userlogin" id="userlogin" value="'.LAN_LOGINMENU_51.'">
|
2015-02-05 16:24:54 -08:00
|
|
|
';
|
|
|
|
|
|
|
|
$text .= '
|
|
|
|
|
2015-06-11 09:40:56 -07:00
|
|
|
<a href="{LM_FPW_LINK=href}" class="btn btn-default btn-sm btn-block">'.LAN_LOGINMENU_4.'</a>
|
|
|
|
<a href="{LM_RESEND_LINK=href}" class="btn btn-default btn-sm btn-block">'.LAN_LOGINMENU_40.'</a>
|
2015-02-05 16:24:54 -08:00
|
|
|
';
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
$text .= '
|
|
|
|
<label style="text-align:center;margin-top:5px">or</label>
|
|
|
|
<input class="btn btn-primary btn-block" type="button" id="sign-in-google" value="Sign In with Google">
|
|
|
|
<input class="btn btn-primary btn-block" type="button" id="sign-in-twitter" value="Sign In with Twitter">
|
|
|
|
';
|
|
|
|
*/
|
|
|
|
|
|
|
|
$text .= "<p></p>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
";
|
2013-12-21 01:32:39 -08:00
|
|
|
|
2015-02-05 16:24:54 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
$text .= "
|
2013-12-21 01:32:39 -08:00
|
|
|
|
|
|
|
|
|
|
|
</ul>";
|
|
|
|
|
|
|
|
|
2013-12-24 03:49:21 -08:00
|
|
|
|
2015-02-05 16:24:54 -08:00
|
|
|
return $tp->parseTemplate($text, true, $login_menu_shortcodes);
|
2013-12-21 01:32:39 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Logged in.
|
2013-12-21 06:23:22 -08:00
|
|
|
//TODO Generic LANS. (not theme LANs)
|
2013-12-21 01:32:39 -08:00
|
|
|
|
|
|
|
$text = '
|
|
|
|
|
2015-03-29 20:45:44 -07:00
|
|
|
<ul class="nav navbar-nav navbar-right'.$direction.'">
|
2016-03-30 19:10:00 -07:00
|
|
|
<li class="dropdown">{PM_NAV}</li>
|
2016-03-08 17:51:29 -08:00
|
|
|
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">{SETIMAGE: w=20} {USER_AVATAR: shape=circle} '. USERNAME.' <b class="caret"></b></a>
|
2013-12-21 01:32:39 -08:00
|
|
|
<ul class="dropdown-menu">
|
2013-12-24 03:49:21 -08:00
|
|
|
<li>
|
2015-06-16 20:33:20 +02:00
|
|
|
<a href="{LM_USERSETTINGS_HREF}"><span class="glyphicon glyphicon-cog"></span> '.LAN_SETTINGS.'</a>
|
2013-12-24 03:49:21 -08:00
|
|
|
</li>
|
|
|
|
<li>
|
2015-06-16 20:33:20 +02:00
|
|
|
<a class="dropdown-toggle no-block" role="button" href="{LM_PROFILE_HREF}"><span class="glyphicon glyphicon-user"></span> '.LAN_LOGINMENU_13.'</a>
|
2013-12-24 03:49:21 -08:00
|
|
|
</li>
|
2013-12-21 01:32:39 -08:00
|
|
|
<li class="divider"></li>';
|
|
|
|
|
|
|
|
if(ADMIN)
|
|
|
|
{
|
2015-06-16 20:33:20 +02:00
|
|
|
$text .= '<li><a href="'.e_ADMIN_ABS.'"><span class="fa fa-cogs"></span> '.LAN_LOGINMENU_11.'</a></li>';
|
2013-12-21 01:32:39 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
$text .= '
|
2015-06-16 20:33:20 +02:00
|
|
|
<li><a href="'.e_HTTP.'index.php?logout"><span class="glyphicon glyphicon-off"></span> '.LAN_LOGOUT.'</a></li>
|
2013-12-21 01:32:39 -08:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
';
|
|
|
|
|
2015-04-10 12:36:35 -07:00
|
|
|
|
2013-12-24 03:49:21 -08:00
|
|
|
return $tp->parseTemplate($text,true,$login_menu_shortcodes);
|
2013-12-21 01:32:39 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-21 11:46:43 +02:00
|
|
|
?>
|