1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Bootstrap front-end template. Login page added.

This commit is contained in:
Cameron 2013-03-22 19:56:28 -07:00
parent ba0bc06145
commit 91e3f336f6
8 changed files with 115 additions and 50 deletions

View File

@ -36,13 +36,19 @@ class login_shortcodes extends e_shortcode
function sc_login_table_username($parm='') //FIXME use $frm
{
return "<input class='tbox' type='text' name='username' id='username' size='40' maxlength='100' />";
$pref = e107::getPref();
$allowEmailLogin = varset($pref['allowEmailLogin'],0);
$ulabel = array(LAN_LOGIN_1,LAN_LOGIN_28,LAN_LOGIN_29);
$placeholder = $ulabel[$allowEmailLogin];
return "<input class='tbox input-block-level' type='text' name='username' id='username' size='40' maxlength='100' placeholder=\"".$placeholder."\" />";
}
function sc_login_table_password($parm='') //FIXME use $frm
{
$pref = e107::getPref();
$text = "<input class='tbox' type='password' name='userpass' id='userpass' size='40' maxlength='100' />";
$text = "<input class='tbox input-block-level' type='password' name='userpass' id='userpass' size='40' maxlength='100' placeholder=\"".LAN_LOGIN_2."\" />";
if (!USER && e107::getSession()->is('challenge') && varset($pref['password_CHAP'],0))
{
@ -92,7 +98,9 @@ class login_shortcodes extends e_shortcode
function sc_login_table_submit($parm="") //FIXME use $frm
{
return "<input class='btn btn-primary button' type='submit' name='userlogin' value=\"".LAN_LOGIN_9."\" />";
$class = ($parm == 'large') ? "btn-large" : "";
return "<input class='btn btn-primary ".$class." button' type='submit' name='userlogin' value=\"".LAN_LOGIN_9."\" />";
}

View File

@ -54,7 +54,7 @@ if(!isset($LOGIN_TABLE))
</td>\n</tr>\n";
if(LOGIN_CAPTCHA)
if(LOGIN_CAPTCHA) //FIXME - add shortcode for this.
{
$LOGIN_TABLE .= "<tr><td class='forumheader3'>{LOGIN_TABLE_SECIMG_LAN}</td>\n<td class='forumheader3'>{LOGIN_TABLE_SECIMG_HIDDEN} {LOGIN_TABLE_SECIMG_SECIMG} {LOGIN_TABLE_SECIMG_TEXTBOC}</td>\n</tr>\n";
}
@ -82,22 +82,34 @@ if(!isset($LOGIN_TABLE_FOOTER))
// Starter for v2. - Bootstrap
$LOGIN_TEMPLATE['page']['header'] = "
<div>
<div class='center' style='padding:50px; margin-left:auto; margin-right: auto'>
{LOGO=login}
</div>";
$LOGIN_TEMPLATE['xxxxx'] = '
$LOGIN_TEMPLATE['page']['body'] = '
<h2 class="form-signin-heading">Please sign in</h2>
<input type="text" class="input-block-level" placeholder="Email address">
<input type="password" class="input-block-level" placeholder="Password">
<h2 class="form-signin-heading">'.LAN_LOGIN_4.'</h2>
{LOGIN_TABLE_USERNAME}
{LOGIN_TABLE_PASSWORD}
{LOGIN_TABLE_SECIMG_SECIMG} {LOGIN_TABLE_SECIMG_TEXTBOC}
<label class="checkbox">
<input type="checkbox" value="remember-me"> Remember me
{LOGIN_TABLE_AUTOLOGIN} {LOGIN_TABLE_AUTOLOGIN_LAN}
</label>
<button class="btn btn-large btn-primary" type="submit">Sign in</button>
{LOGIN_TABLE_SUBMIT=large}
';
$LOGIN_TEMPLATE['page']['footer'] = "
<div style='margin-bottom:100px; width:70%;margin-right:auto;margin-left:auto'>
<div style='text-align:center'><br />
{LOGIN_TABLE_FOOTER_USERREG}
</div>
</div>
</div>";

View File

@ -12,7 +12,7 @@
define('LAN_LOGIN_1', 'User name');
define('LAN_LOGIN_2', 'User password');
define('LAN_LOGIN_3', 'Protected server');
define('LAN_LOGIN_4', 'Please enter your details to gain access.');
define('LAN_LOGIN_4', 'Please sign in'); // XXX Modified
define('LAN_LOGIN_5', 'Click here to Sign-Up');
define('LAN_LOGIN_6', 'Not accepting new members at this time');
define('LAN_LOGIN_7', 'Enter visible code');

View File

@ -9,7 +9,7 @@
<field name="gen_user_id">1</field>
<field name="gen_ip">Hello World!</field>
<field name="gen_intdata">0</field>
<field name="gen_chardata"><![CDATA[This is a template for a simple marketing or informational website. The text you are reading is the &#039;Welcome Message&#039; and the items below are &quot;News Items&quot;. ]]></field>
<field name="gen_chardata"><![CDATA[This is a twitter bootstrap template for a simple marketing or informational website. The only difference is that e107 is managing the content. ie. The text you are reading is the &#039;Welcome Message&#039; and the items below are &quot;News Items&quot;. Visit the admin-area to modify. ]]></field>
</item>
</dbTable>
<dbTable name="news">
@ -170,7 +170,7 @@
<field name="menu_class">0</field>
<field name="menu_pages"></field>
<field name="menu_path">news/</field>
<field name="menu_layout"></field>
<field name="menu_layout">default-home</field>
<field name="menu_parms"></field>
</item>
<item>
@ -181,7 +181,7 @@
<field name="menu_class">0</field>
<field name="menu_pages"></field>
<field name="menu_path">news/</field>
<field name="menu_layout"></field>
<field name="menu_layout">default-home</field>
<field name="menu_parms"></field>
</item>
</dbTable>

View File

@ -1,6 +1,7 @@
/* */
body { padding-top: 75px; padding-bottom: 40px; }
.well { padding:10px; }
footer { padding:60px }
/*******************************************************************************************************************/
@ -83,3 +84,36 @@ div.featurebox-nav a.featurebox-nav-prev,
div.featurebox-nav a.featurebox-nav-prev:hover { text-decoration: none; font-size: 16px }
.form-signin {
max-width: 300px;
padding: 19px 29px 29px;
margin: 0 auto 20px;
background-color: #fff;
border: 1px solid #e5e5e5;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin input[type="text"],
.form-signin input[type="password"] {
font-size: 16px;
height: auto;
margin-bottom: 15px;
padding: 7px 9px;
}

View File

@ -16,29 +16,6 @@ e107::css('core','bootstrap/css/jquery-ui.custom.css');
//define("STANDARDS_MODE",TRUE);
function theme_head()
{
return;
/*
$theme_pref = e107::getThemePref();
$ret = '';
if(THEME_LAYOUT == "alternate") // as matched by $HEADER['alternate'];
{
$ret .= "<!-- Include Something --> ";
}
if($theme_pref['_blank_example'] == 3) // Pref from admin -> thememanager.
{
$ret .= "<!-- Include Something Else --> ";
}
return $ret;
*/
}
$OTHERNEWS_STYLE = '<div class="span4">
@ -92,7 +69,10 @@ function tablestyle($caption, $text, $mode='')
return;
}
if($mode == 'login_page')
{
$type = 'no_caption';
}
switch($type)
{
@ -119,6 +99,10 @@ function tablestyle($caption, $text, $mode='')
</div>
';
break;
case 'no_caption':
echo $text;
break;
default: // Main Content Style.
echo '
@ -148,7 +132,7 @@ $HEADER['default'] = '
<a class="brand" href="'.SITEURL.'">{SITENAME}</a>
<div class="nav-collapse collapse">
<p class="navbar-text pull-right">
Logged in as <a href="#" class="navbar-link">'.USERNAME.'</a>
'.(!USERID ? '<a class="navbar-link" href="'.e_LOGIN.'">Sign in</a>': 'Logged in as <a href="#" class="navbar-link">'.USERNAME.'</a>').'
</p>
{NAVIGATION=main}
</div><!--/.nav-collapse -->
@ -169,8 +153,29 @@ $HEADER['default'] = '
{SETSTYLE=default}
';
$FOOTER['default'] = '
{SETSTYLE=span4}
</div><!--/span-->
</div><!--/row-->
<hr>
<footer class="center">
Copyright &copy; 2008-2013 e107 Inc (e107.org)<br />
</footer>
</div><!--/.fluid-container-->';
$HEADER['default-home'] = $HEADER['default'];
$FOOTER['default-home'] = '
{WMESSAGE}
{SETSTYLE=span4}
<div class="row-fluid">
{MENU=2}
@ -199,12 +204,6 @@ $FOOTER['default'] = '
// HERO http://twitter.github.com/bootstrap/examples/hero.html
//FIXME insert shortcodes while maintaining only bootstrap classes.

View File

@ -14,6 +14,9 @@
</screenshots>
<layouts>
<layout name='default' title='Default' default='true' />
<layout name='default-home' title='Default Home'>
<custompages>FRONTPAGE</custompages>
</layout>
<layout name='hero' title='Hero'>
<custompages>usersettings.php</custompages>
</layout>

View File

@ -20,7 +20,7 @@
require_once("class2.php");
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
if ((USER || e_LOGIN != e_SELF) && !getperms('0')) // Disable page if user logged in, or some custom e_LOGIN value is used.
if ((USER || e_LOGIN != e_SELF) && e_QUERY !== 'preview') // Disable page if user logged in, or some custom e_LOGIN value is used.
{
header('location:'.e_BASE.'index.php');
exit();
@ -92,6 +92,15 @@ if (!USER || getperms('0'))
}
$sc = e107::getScBatch('login');
if((e_BOOTSTRAP === true) && isset($LOGIN_TEMPLATE['page']))
{
$LOGIN_TABLE_HEADER = $LOGIN_TEMPLATE['page']['header'];
$LOGIN_TABLE = "<form class='form-signin' method='post' action='".e_SELF."' onsubmit='hashLoginPassword(this)' >".$LOGIN_TEMPLATE['page']['body']."</form>";
$LOGIN_TABLE_FOOTER = $LOGIN_TEMPLATE['page']['footer'];
}
$text = $tp->parseTemplate($LOGIN_TABLE,true);
@ -105,7 +114,7 @@ if (!USER || getperms('0'))
// echo preg_replace("/\{(.*?)\}/e", 'varset($\1,"\1")', $LOGIN_TABLE_HEADER);
$login_message = SITENAME; // $login_message = LAN_LOGIN_3." | ".SITENAME;
echo LOGINMESSAGE;
echo $tp->parseTemplate($LOGIN_TABLE_HEADER);
$ns->tablerender($login_message, $text, 'login_page');
echo $tp->parseTemplate($LOGIN_TABLE_FOOTER);