1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-20 04:32:01 +02:00

Fixes database upgrade routines for v2.0+. Fixes #1231 (tablet navigation). Adds extra DB fields for future use.

This commit is contained in:
Cameron 2015-11-18 20:22:18 -08:00
parent cbfc73176b
commit e5ea9d689d
6 changed files with 138 additions and 28 deletions

View File

@ -130,8 +130,15 @@ if (!$dont_check_update)
// set 'master' to true to prevent other upgrades from running before it is complete.
$LAN_UPDATE_4 = deftrue('LAN_UPDATE_4',"Update from [x] to [y]"); // in case language-pack hasn't been upgraded.
$LAN_UPDATE_5 = deftrue('LAN_UPDATE_5', "Core database structure");
$dbupdate['706_to_800'] = array('master'=>true, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('1.x','2.0')), 'message'=> LAN_UPDATE_29);
$dbupdate['706_to_800'] = array('master'=>true, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('1.x','2.0')), 'message'=> LAN_UPDATE_29, 'hide_when_complete'=>false);
// always run these last.
$dbupdate['core_database'] = array('master'=>false, 'title'=> $LAN_UPDATE_5);
$dbupdate['core_prefs'] = array('master'=>true, 'title'=> LAN_UPDATE_13); // Prefs check
// $dbupdate['70x_to_706'] = LAN_UPDATE_8.' .70x '.LAN_UPDATE_9.' .706';
} // End if (!$dont_check_update)
@ -265,18 +272,23 @@ class e107Update
foreach($this->core as $func => $data)
{
$text2 = '';
if(function_exists("update_".$func))
{
$text .= "<tr><td>".$data['title']."</td>";
if(call_user_func("update_".$func))
{
$text .= "<td>".ADMIN_TRUE_ICON."</td>";
if(empty($data['hide_when_complete']))
{
$text2 .= "<td>".$data['title']."</td>";
$text2 .= "<td>".ADMIN_TRUE_ICON."</td>";
}
}
else
{
$text2 .= "<td>".$data['title']."</td>";
if(vartrue($data['message']))
{
$mes->addInfo($data['message']);
@ -284,13 +296,19 @@ class e107Update
$this->updates ++;
$text .= "<td>".$frm->admin_button('update_core['.$func.']', LAN_UPDATE, 'warning', '', "id=e-{$func}&disabled=".$this->disabled)."</td>";
$text2 .= "<td>".$frm->admin_button('update_core['.$func.']', LAN_UPDATE, 'warning', '', "id=e-{$func}&disabled=".$this->disabled)."</td>";
if($data['master'] == true)
{
$this->disabled = 1;
}
}
$text .= "</tr>\n";
if(!empty($text2))
{
$text .= "<tr>".$text2."</tr>\n";
}
}
}
@ -306,7 +324,7 @@ class e107Update
$caption = LAN_UPDATE;
$text = "
<form method='post' action='".e_SELF."'>
<form method='post' action='".e_ADMIN."e107_update.php'>
<fieldset id='core-e107-update'>
<legend>{$caption}</legend>
<table class='table adminlist'>
@ -484,6 +502,46 @@ if (defined('TEST_UPDATE'))
}
} // End of test routine
// generic database structure update.
function update_core_database($type = '')
{
$just_check = ($type == 'do') ? FALSE : TRUE;
require_once(e_HANDLER."db_verify_class.php");
$dbv = new db_verify;
$log = e107::getAdminLog();
if($plugUpgradeReq = e107::getPlugin()->updateRequired())
{
$exclude = array_keys($plugUpgradeReq); // search xxxxx_setup.php and check for 'upgrade_required()' == true.
asort($exclude);
}
else
{
$exclude = false;
}
$dbv->compareAll($exclude); // core & plugins, but not plugins calling for an update with xxxxx_setup.php
if(count($dbv->errors))
{
if ($just_check)
{
$mes = e107::getMessage();
// $mes->addDebug(print_a($dbv->errors,true));
$log->addDebug(print_a($dbv->errors,true));
$tables = implode(", ", array_keys($dbv->errors));
return update_needed("Database Tables require updating: <b>".$tables."</b>");
}
$dbv->compileResults();
$dbv->runFix(); // Fix entire core database structure and plugins too.
}
return $just_check;
}
@ -1032,11 +1090,13 @@ function update_706_to_800($type='')
$mes = e107::getMessage();
// $mes->addDebug(print_a($dbv->errors,true));
$log->addDebug(print_a($dbv->errors,true));
return update_needed("Database Tables require updating.");
// return update_needed("Database Tables require updating."); //
}
else
{
$dbv->compileResults();
$dbv->runFix(); // Fix entire core database structure and plugins too.
}
$dbv->compileResults();
$dbv->runFix(); // Fix entire core database structure and plugins too.
}
// print_a($dbv->results);

View File

@ -723,7 +723,7 @@ class admin_shortcodes
$outboxUrl = e_PLUGIN.'pm/admin_config.php?mode=outbox&amp;action=list&amp;iframe=1';
$composeUrl = e_PLUGIN.'pm/admin_config.php?mode=outbox&amp;action=create&amp;iframe=1';
$text = '<ul class="nav navbar-nav nav-pills">
$text = '<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" title="Messages" role="button" data-toggle="dropdown" href="#" >
'.$tp->toGlyph('fa-envelope').$countDisp.'<b class="caret"></b>
@ -1384,8 +1384,12 @@ Inverse 10 <span class="badge badge-inverse">10</span>
if($parm == 'home' || $parm == 'logout' || $parm == 'language' || $parm == 'pm')
{
$template = $$tmpl;
$template['start'] = $template['start_other'];
$menu_vars = $this->getOtherNav($parm);
return e107::getNav()->admin('', '', $menu_vars, $$tmpl, FALSE, FALSE);
return e107::getNav()->admin('', '', $menu_vars, $template, FALSE, FALSE);
}

View File

@ -361,6 +361,7 @@ CREATE TABLE online (
online_pagecount tinyint(3) unsigned NOT NULL default '0',
online_active int(10) unsigned NOT NULL default '0',
online_agent varchar(255) NOT NULL default '',
online_language varchar(45) NOT NULL default '',
KEY online_ip (online_ip)
) ENGINE=InnoDB;
# --------------------------------------------------------
@ -567,6 +568,7 @@ CREATE TABLE userclass_classes (
userclass_visibility smallint(5) signed NOT NULL default '0',
userclass_type tinyint(1) unsigned NOT NULL default '0',
userclass_icon varchar(250) NOT NULL default '',
userclass_perms text NOT NULL,
PRIMARY KEY (userclass_id)
) ENGINE=MyISAM;
# --------------------------------------------------------

View File

@ -13,9 +13,10 @@
define("LAN_UPDATE_2", "Action");
define("LAN_UPDATE_3", "Not Needed");
define("LAN_UPDATE_4", "Update from [x] to [y]");
define("LAN_UPDATE_5", "Update core database structure");
define("LAN_UPDATE_7", "Executed [x]");
define("LAN_UPDATE_12", "One of your tables contains duplicate entries.");
define("LAN_UPDATE_13", "Add additional/missing core settings");
define("LAN_UPDATE_13", "Add new or missing core settings");
define("LAN_UPDATE_14", "Start version: ");
// Messages as part of 0.7 to 0.8 update process

View File

@ -1215,3 +1215,47 @@ footer {
color: rgb(119, 119, 119);
}
*/
@media (max-width: 1100px) {
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
margin: 7.5px -15px;
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}
.navbar-text {
float: none;
margin: 15px 0;
}
/* since 3.1.0 */
.navbar-collapse.collapse.in {
display: block!important;
}
.collapsing {
overflow: hidden!important;
}
.navbar-fixed-bottom .navbar-collapse, .navbar-fixed-top .navbar-collapse, .pre-scrollable {
max-height: 480px;
}
}

View File

@ -24,7 +24,9 @@ if (!defined('e107_INIT')) { exit(); }
$E_ADMIN_NAVIGATION['start'] = '<ul class="nav navbar-nav">';
$E_ADMIN_NAVIGATION['start'] = '<ul class="nav navbar-nav navbar-left">';
$E_ADMIN_NAVIGATION['start_other'] = '<ul class="nav navbar-nav navbar-right">';
$E_ADMIN_NAVIGATION['button'] = '
<li class="dropdown">
@ -226,7 +228,7 @@ $ADMIN_MODAL = '<div id="uiModal" class="modal hide fade" tabindex="-1" role="d
// <li>{ADMIN_COREUPDATE=icon}</li>
$ADMIN_HEADER = $ADMIN_MODAL. '
@ -242,18 +244,15 @@ $ADMIN_MODAL = '<div id="uiModal" class="modal hide fade" tabindex="-1" role="d
<a class="brand navbar-brand" href="'.e_ADMIN_ABS.'admin.php" title="Return to Front Panel"><img class="admin-logo" src="'.e_THEME_ABS.'bootstrap3/images/e107_adminlogo.png" alt="e107" /></a>
</div>
<div class="navbar-collapse collapse">
<div class="dropdown nav navbar-nav">
{ADMIN_NAVIGATION=no-main}
</div>
<div class="dropdown nav navbar-nav nav-right navbar-right ">
<li>{ADMIN_COREUPDATE=icon}</li>
{ADMIN_PM}
{ADMIN_NAVIGATION=home}
{ADMIN_NAVIGATION=language}
<div>
{ADMIN_NAVIGATION=logout}
</div>
{ADMIN_NAVIGATION=language}
{ADMIN_NAVIGATION=home}
{ADMIN_PM}
</div>