diff --git a/e107_admin/db.php b/e107_admin/db.php
index e145646cc..5a928a793 100644
--- a/e107_admin/db.php
+++ b/e107_admin/db.php
@@ -71,7 +71,7 @@ if(isset($_POST['exportXmlFile']))
if(exportXmlFile($_POST['xml_prefs'],$_POST['xml_tables'],$_POST['xml_plugprefs'], $_POST['package_images'], false))
{
$mes = e107::getMessage();
- $mes->add(LAN_SUCCESS, E_MESSAGE_SUCCESS);
+ $mes->add(LAN_CREATED, E_MESSAGE_SUCCESS);
}
}
@@ -505,7 +505,12 @@ class system_tools
}
-
+
+ /**
+ * @param object $sql
+ * @param $prefix
+ * @return bool
+ */
private function multiSiteCreateTables($sql, $prefix)
{
$mes = e107::getMessage();
@@ -519,7 +524,8 @@ class system_tools
}
preg_match_all("/create(.*?)(?:myisam|innodb);/si", $sql_data, $result );
-
+
+
$sql->gen('SET NAMES `utf8`');
foreach ($result[0] as $sql_table)
@@ -949,7 +955,7 @@ class system_tools
/**
* Delete selected preferences.
- * @return none
+ * @return null
*/
private function del_pref_val($mode='core')
{
@@ -1427,7 +1433,7 @@ class system_tools
/**
* Preferences Editor
- * @return none
+ * @return null
*/
private function scan_override()
{
@@ -1436,7 +1442,6 @@ class system_tools
$f = e107::getFile();
$config = e107::getConfig();
- $scList = '';
$fList = $f->get_files(e_CORE.'override/shortcodes/single', '\.php$');
$scList = array();
@@ -1478,7 +1483,7 @@ class system_tools
/**
* Plugin Folder Scanner
- * @return none
+ * @return null
*/
private function plugin_viewscan($mode = 'update')
{
@@ -1590,79 +1595,7 @@ class system_tools
}
-/*
- $sql->select("plugin", "*", "plugin_id !='' order by plugin_path ASC"); // Must order by path to pick up duplicates. (plugin names may change).
- $previous = '';
- while($row = $sql->fetch())
- {
- e107::loadLanFiles($row['plugin_path'],'admin');
- e107::plugLan($row['plugin_path'],'global',true);
-
- $text .= "
-
- ".$tp->toHTML($row['plugin_name'], FALSE, "defs,emotes_off")." |
- ".$row['plugin_path']." |
- ";
-
- if(trim($row['plugin_addons']))
- {
- //XXX - $nl_code = ''; - OLD VAR?
- foreach(explode(',', $row['plugin_addons']) as $this_addon)
- {
- $ret_code = 3; // Default to 'not checked
- if((strpos($this_addon, 'e_') === 0) || (substr($this_addon, - 4, 4) == '_sql'))
- {
- $ret_code = $ep->checkAddon($row['plugin_path'], $this_addon); // See whether spaces before opening tag or after closing tag
- }
- elseif(strpos($this_addon, 'sc_') === 0)
- {
- $this_addon = substr($this_addon, 3). ' (sc)';
- }
-
- if(!is_numeric($ret_code))
- {
- $errorMessage = $ret_code['msg'];
- $ret_code = $error_type[$ret_code['type']];
- }
- else
- {
- $errorMessage = $error_messages[$ret_code];
- }
-
- $text .= "";
- $text .= $error_glyph[$ret_code]." ";
-
- // $text .= " ";
- $text .= trim($this_addon); // $ret_code - 0=OK, 1=content error, 2=access error
- $text .= " ";
- }
- }
-
- $text .= "
- |
-
- ";
-
- if($previous == $row['plugin_path'])
- {
- $delid = $row['plugin_id'];
- $delname = $row['plugin_name'];
- //Admin delete button
- $text .= $frm->admin_button("delplug[{$delid}]", DBLAN_52, 'delete', '', array('title' => LAN_CONFIRMDEL." ID:{$delid} [$delname]"));
- //Or maybe image submit? -
- //$text .= $frm->submit_image("delplug[{$delid}]", DBLAN_52, 'delete', LAN_CONFIRMDEL." ID:{$delid} [$delname]");
- }
- else
- {
- $text .= ($row['plugin_installflag'] == 1) ? "".DBLAN_27."" : " "; // "Installed and not installed";
- }
- $text .= "
- |
-
- ";
- $previous = $row['plugin_path'];
- }*/
$text .= "
@@ -1672,6 +1605,8 @@ class system_tools
";
e107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_22, $mes->render().$text);
+
+ return null;
}
@@ -1685,6 +1620,7 @@ function db_adminmenu() //FIXME - has problems when navigation is on the LEFT in
{
global $st;
+ $var = array();
foreach($st->_options as $key=>$val)
{
@@ -1692,8 +1628,8 @@ function db_adminmenu() //FIXME - has problems when navigation is on the LEFT in
$var[$key]['link'] = e_SELF."?mode=".$key;
}
- $icon = e107::getParser()->toIcon('e-database-24');
- $caption = $icon."".DBLAN_10."";
+ $icon = e107::getParser()->toIcon('e-database-24');
+ $caption = $icon."".DBLAN_10."";
e107::getNav()->admin($caption, $_GET['mode'], $var);
}
@@ -1704,7 +1640,7 @@ function db_adminmenu() //FIXME - has problems when navigation is on the LEFT in
* @param object $prefs
* @param object $tables
* @param object $debug [optional]
- * @return none
+ * @return bool|null
*/
function exportXmlFile($prefs,$tables=array(),$plugPrefs, $package=FALSE,$debug=FALSE)
{
@@ -1777,7 +1713,7 @@ function table_list()
$exclude[] = "online";
$exclude[] = "upload";
$exclude[] = "user_extended_country";
- $exclude[] = "plugin";
+// $exclude[] = "plugin";
$coreTables = e107::getDb()->tables('nolan');
@@ -1800,433 +1736,5 @@ function table_list()
-/* Still needed?
-function backup_core()
-{
- global $pref, $sql;
- $tmp = base64_encode((serialize($pref)));
- if(!$sql->db_Insert("core", "'pref_backup', '{$tmp}' "))
- {
- $sql->db_Update("core", "e107_value='{$tmp}' WHERE e107_name='pref_backup'");
- }
-}
-
-*/
-
-/*
-function verify_sql_record() // deprecated by db_verify.php ( i think).
-{
- global $e107;
-
- $sql = e107::getDb();
- $sql2 = e107::getDb('sql2');
- $sql3 = e107::getDb('sql3');
- $frm = e107::getForm();
- $tp = e107::getParser();
- $mes = e107::getMessage();
-
- $tables = array();
- $tables[] = 'rate';
- $tables[] = 'comments';
-
- if(isset($_POST['delete_verify_sql_record']))
- {
-
- if(!varset($_POST['del_dbrec']))
- {
- $mes->add('Nothing to delete', E_MESSAGE_DEBUG);
- }
- else
- {
- $msg = "ok, so you want to delete some records? not a problem at all!
";
- $msg .= "but, since this is still an experimental procedure, i won't actually delete anything
";
- $msg .= "instead, i will show you the queries that would be performed
";
- $text .= "
";
- $mes->add($msg, E_MESSAGE_DEBUG);
-
- foreach($_POST['del_dbrec'] as $k => $v)
- {
-
- if($k == 'rate')
- {
-
- $keys = implode(", ", array_keys($v));
- $qry .= "DELETE * FROM rate WHERE rate_id IN (".$keys.")
";
-
- }
- elseif($k == 'comments')
- {
-
- $keys = implode(", ", array_keys($v));
- $qry .= "DELETE * FROM comments WHERE comment_id IN (".$keys.")
";
-
- }
-
- }
-
- $mes->add($qry, E_MESSAGE_DEBUG);
- $mes->add("".LAN_BACK."", E_MESSAGE_DEBUG);
- }
- }
-
- //Nothing selected
- if(isset($_POST['check_verify_sql_record']) && (!isset($_POST['table_rate']) && !isset($_POST['table_comments'])))
- {
- $_POST['check_verify_sql_record'] = '';
- unset($_POST['check_verify_sql_record']);
- $mes->add(DBLAN_53, E_MESSAGE_WARNING);
- }
-
- if(!isset($_POST['check_verify_sql_record']))
- {
- //select table to verify
- $text = "
-
- ";
-
- $ns->tablerender(DBLAN_10.SEP.DBLAN_39, $mes->render().$text);
- }
- else
- {
-
- //function to sort the results
- function verify_sql_record_cmp($a, $b)
- {
-
- $orderby = array('type' => 'asc', 'itemid' => 'asc');
-
- $result = 0;
- foreach($orderby as $key => $value)
- {
- if($a[$key] == $b[$key])
- continue;
- $result = ($a[$key] < $b[$key]) ? - 1 : 1;
- if($value == 'desc')
- $result = - $result;
- break;
- }
- return $result;
- }
-
- //function to display the results
- //$err holds the error data
- //$ctype holds the tablename
- function verify_sql_record_displayresult($err, $ctype)
- {
- global $frm;
-
- usort($err, 'verify_sql_record_cmp');
-
- $text = "
-
-
- ";
-
- return $text;
- }
-
- function verify_sql_record_gettables()
- {
-
- $sql2 = e107::getDb('sql2');
-
- //array which will hold all db tables
- $dbtables = array();
-
- //get all tables in the db
- $sql2->gen("SHOW TABLES");
- while($row2 = $sql2->fetch())
- {
- $dbtables[] = $row2[0];
- }
- return $dbtables;
- }
-
- $text = "
- ";
-
- $ns->tablerender(DBLAN_10.SEP.DBLAN_50, $mes->render().$text);
- }
-}
-*/
-
-?>
+?>
\ No newline at end of file