Skip to content

Commit 422672f

Browse files
committed
Add support for export_dir path setting
Signed-off-by: Bugo <[email protected]>
1 parent c4d2b83 commit 422672f

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

repair_settings.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
$txt['sourcedir'] = 'Sources Directory';
9797
$txt['tasksdir'] = 'Tasks Directory';
9898
$txt['packagesdir'] = 'Packages Directory';
99+
$txt['export_dir'] = 'Exports Directory';
99100
$txt['attachmentUploadDir'] = 'Attachment Directory';
100101
$txt['avatar_url'] = 'Avatar URL';
101102
$txt['avatar_directory'] = 'Avatar Directory';
@@ -125,15 +126,15 @@
125126
$smflogo = "Themes/default/images/smflogo.svg";
126127
elseif (file_exists(dirname(__FILE__) . "/Themes/default/images/smflogo.png"))
127128
$smflogo = "Themes/default/images/smflogo.png";
128-
else
129+
else
129130
$smflogo = "Themes/default/images/smflogo.gif";
130131

131132
// Note that we're using the default URLs because we aren't even going to try to use Settings.php's settings.
132133
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
133134
<html xmlns="http://www.w3.org/1999/xhtml">
134135
<head>
135136
<meta name="robots" content="noindex" />
136-
<title>', isset($context['smfVersion']) ? sprintf($txt['smf_repair_settings'], $context['smfVersion']) :
137+
<title>', isset($context['smfVersion']) ? sprintf($txt['smf_repair_settings'], $context['smfVersion']) :
137138
$txt['smf11_repair_settings'], '</title>
138139
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
139140
<script type="text/javascript" src="Themes/default/scripts/script.js"></script>
@@ -243,7 +244,7 @@
243244
<body>
244245
<div id="header">
245246
<a href="http://www.simplemachines.org/" target="_blank"><img src="' . $smflogo . '" style="width: 250px; float: right;" alt="Simple Machines" border="0" /></a>
246-
<div>', isset($context['smfVersion']) ? sprintf($txt['smf_repair_settings'], $context['smfVersion']) :
247+
<div>', isset($context['smfVersion']) ? sprintf($txt['smf_repair_settings'], $context['smfVersion']) :
247248
$txt['smf11_repair_settings'], '</div>
248249
</div>
249250
<div id="content">';
@@ -317,7 +318,7 @@ function initialize_inputs()
317318
{
318319
if (!defined('SMF'))
319320
define('SMF', 1);
320-
321+
321322
if (!defined('POSTGRE_TITLE'))
322323
define('POSTGRE_TITLE', 'PostgreSQL');
323324

@@ -413,7 +414,7 @@ function initialize_inputs()
413414
// 2.0 supports sqlite.
414415
if (file_exists($sourcedir . '/Subs-Db-sqlite.php') && (empty($context['smfVersion']) || $context['smfVersion'] == '2.0'))
415416
{
416-
$db_type_options['options']['sqlite'] = 'SQLite';
417+
$db_type_options['options']['sqlite'] = 'SQLite';
417418

418419
if ($db_type == 'sqlite')
419420
$db_type_options['default'] = $db_type;
@@ -530,6 +531,7 @@ function show_settings()
530531
'sourcedir' => array('flat', 'string'),
531532
'tasksdir' => array('flat', 'string'),
532533
'packagesdir' => array('flat', 'string'),
534+
'export_dir' => array('db', 'string'),
533535
'attachmentUploadDir' => array('db', 'array_string'),
534536
'avatar_url' => array('db', 'string'),
535537
'avatar_directory' => array('db', 'string'),
@@ -553,7 +555,7 @@ function show_settings()
553555

554556
// These settings didn't exist in 2.0 or 1.1
555557
if ($context['smfVersion'] == '2.0' || $context['smfVersion'] == '1.1')
556-
unset($known_settings['cache_settings']['cache_accelerator'], $known_settings['cache_settings']['cache_enable'], $known_settings['cache_settings']['cache_memcached'], $known_settings['path_url_settings']['tasksdir'], $known_settings['path_url_settings']['packagesdir']);
558+
unset($known_settings['cache_settings']['cache_accelerator'], $known_settings['cache_settings']['cache_enable'], $known_settings['cache_settings']['cache_memcached'], $known_settings['path_url_settings']['tasksdir'], $known_settings['path_url_settings']['export_dir'], $known_settings['path_url_settings']['packagesdir']);
557559

558560
// Let's assume we don't want to change the current theme
559561
$settings['theme_default'] = 0;
@@ -571,6 +573,9 @@ function show_settings()
571573
if ($context['smfVersion'] == '2.1' && file_exists(dirname(__FILE__) . '/Sources/tasks'))
572574
$known_settings['path_url_settings']['tasksdir'][2] = realpath(dirname(__FILE__) . '/Sources/tasks');
573575

576+
if ($context['smfVersion'] == '2.1' && file_exists(dirname(__FILE__) . '/exports'))
577+
$known_settings['path_url_settings']['export_dir'][2] = realpath(dirname(__FILE__) . '/exports');
578+
574579
if (file_exists(dirname(__FILE__) . '/cache') && isset($known_settings['cache_settings']['cachedir']))
575580
$known_settings['cache_settings']['cachedir'][2] = realpath(dirname(__FILE__) . '/cache');
576581

@@ -806,7 +811,7 @@ function restoreAll()
806811
foreach ($info[3] as $infoId => $infoTitle)
807812
echo '
808813
<option value="', $infoId, '"', isset($settings[$setting]) && $settings[$setting] == $infoId ? ' selected="selected"' : '', '>', $infoTitle, '</option>';
809-
814+
810815
echo '
811816
</select>';
812817

@@ -1484,7 +1489,7 @@ function findSources()
14841489
{
14851490
if (in_array($line, array('.', '..', 'blank.gif', 'index', '.htaccess')))
14861491
continue;
1487-
if (is_dir($line))
1492+
if (is_dir($line))
14881493
$dirs[] = $line;
14891494
else
14901495
$files[] = $line;

0 commit comments

Comments
 (0)