Browse Source

! Some more code documentation cleanup and standardization.
! Refactoring admin center.
+ Added ManageLanguages.php and ManageLanguages.template.php files, to handle the languages area in admin.
! Moved download_language, add_language and modify_language_entries sub-templates from Admin to ManageLanguages template.
! Moved the functions handing languages administration from Admin to ManageLanguages file.

Spuds 13 năm trước cách đây
mục cha
commit
73fb6ace32

+ 1 - 1
Sources/Admin.php

@@ -124,7 +124,7 @@ function AdminMain()
 				),
 				'languages' => array(
 					'label' => $txt['language_configuration'],
-					'file' => 'ManageServer.php',
+					'file' => 'ManageLanguages.php',
 					'function' => 'ManageLanguages',
 					'icon' => 'languages.gif',
 					'subsections' => array(

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 104 - 1434
Sources/ManageServer.php


+ 94 - 101
Sources/PersonalMessage.php

@@ -1,6 +1,10 @@
 <?php
 
 /**
+ * This file is mainly meant for controlling the actions related to personal
+ * messages. It allows viewing, sending, deleting, and marking personal
+ * messages. For compatibility reasons, they are often called "instant messages".
+ *
  * Simple Machines Forum (SMF)
  *
  * @package SMF
@@ -14,89 +18,10 @@
 if (!defined('SMF'))
 	die('Hacking attempt...');
 
-/*	This file is mainly meant for viewing personal messages.  It also sends,
-	deletes, and marks personal messages.  For compatibility reasons, they are
-	often called "instant messages".  The following functions are used:
-
-	void MessageMain()
-		// !!! ?action=pm
-
-	void messageIndexBar(string area)
-		// !!!
-
-	void MessageFolder()
-		// !!! ?action=pm;sa=folder
-
-	void prepareMessageContext(type reset = 'subject', bool reset = false)
-		// !!!
-
-	void MessageSearch()
-		// !!!
-
-	void MessageSearch2()
-		// !!!
-
-	void MessagePost()
-		// !!! ?action=pm;sa=post
-
-	void messagePostError(array error_types, array named_recipients, array recipient_ids)
-		// !!!
-
-	void MessagePost2()
-		// !!! ?action=pm;sa=post2
-
-	void WirelessAddBuddy()
-		// !!!
-
-	void MessageActionsApply()
-		// !!! ?action=pm;sa=pmactions
-
-	void MessageKillAllQuery()
-		// !!! ?action=pm;sa=killall
-
-	void MessageKillAll()
-		// !!! ?action=pm;sa=killall2
-
-	void MessagePrune()
-		// !!! ?action=pm;sa=prune
-
-	void deleteMessages(array personal_messages, string folder,
-			int owner = user)
-		// !!!
-
-	void markMessages(array personal_messages = all, int label = all,
-			int owner = user)
-		- marks the specified personal_messages read.
-		- if label is set, only marks messages with that label.
-		- if owner is set, marks messages owned by that member id.
-
-	void ManageLabels()
-		// !!!
-
-	void MessageSettings()
-		// !!!
-
-	void ReportMessage()
-		- allows the user to report a personal message to an administrator.
-		- in the first instance requires that the ID of the message to report
-		  is passed through $_GET.
-		- allows the user to report to either a particular administrator - or
-		  the whole admin team.
-		- will forward on a copy of the original message without allowing the
-		  reporter to make changes.
-		- uses the report_message sub-template.
-
-	void ManageRules()
-		// !!!
-
-	void LoadRules()
-		// !!!
-
-	void ApplyRules()
-		// !!!
-*/
-
-// This helps organize things...
+/**
+ * This helps organize things...
+ * @todo this should be a simple dispatcher....
+ */
 function MessageMain()
 {
 	global $txt, $scripturl, $sourcedir, $context, $user_info, $user_settings, $smcFunc, $modSettings;
@@ -283,7 +208,11 @@ function MessageMain()
 	}
 }
 
-// A sidebar to easily access different areas of the section
+/**
+ * A sidebar to easily access different areas of the section
+ *
+ * @param string $area
+ */
 function messageIndexBar($area)
 {
 	global $txt, $context, $scripturl, $sourcedir, $sc, $modSettings, $settings, $user_info, $options;
@@ -422,7 +351,9 @@ function messageIndexBar($area)
 		$context['template_layers'][] = 'pm';
 }
 
-// A folder, ie. inbox/sent etc.
+/**
+ * A folder, ie. inbox/sent etc.
+ */
 function MessageFolder()
 {
 	global $txt, $scripturl, $modSettings, $context, $subjects_request;
@@ -915,7 +846,12 @@ function MessageFolder()
 	}
 }
 
-// Get a personal message for the theme.  (used to save memory.)
+/**
+ * Get a personal message for the theme.  (used to save memory.)
+ *
+ * @param $type
+ * @param $reset
+ */
 function prepareMessageContext($type = 'subject', $reset = false)
 {
 	global $txt, $scripturl, $modSettings, $context, $messages_request, $memberContext, $recipients, $smcFunc;
@@ -1038,6 +974,9 @@ function prepareMessageContext($type = 'subject', $reset = false)
 	return $output;
 }
 
+/**
+ * Allows to search through personal messages.
+ */
 function MessageSearch()
 {
 	global $context, $txt, $scripturl, $modSettings, $smcFunc;
@@ -1110,6 +1049,9 @@ function MessageSearch()
 	);
 }
 
+/**
+ * Actually do the search of personal messages.
+ */
 function MessageSearch2()
 {
 	global $scripturl, $modSettings, $user_info, $context, $txt;
@@ -1565,7 +1507,9 @@ function MessageSearch2()
 	);
 }
 
-// Send a new message?
+/**
+ * Send a new message?
+ */
 function MessagePost()
 {
 	global $txt, $sourcedir, $scripturl, $modSettings;
@@ -1843,7 +1787,13 @@ function MessagePost()
 	checkSubmitOnce('register');
 }
 
-// An error in the message...
+/**
+ * An error in the message...
+ *
+ * @param $error_types
+ * @param $named_recipients
+ * @param $recipient_ids
+ */
 function messagePostError($error_types, $named_recipients, $recipient_ids = array())
 {
 	global $txt, $context, $scripturl, $modSettings;
@@ -1998,7 +1948,9 @@ function messagePostError($error_types, $named_recipients, $recipient_ids = arra
 	checkSubmitOnce('register');
 }
 
-// Send it!
+/**
+ * Send it!
+ */
 function MessagePost2()
 {
 	global $txt, $context, $sourcedir;
@@ -2280,7 +2232,9 @@ function MessagePost2()
 	redirectexit($context['current_label_redirect']);
 }
 
-// This function lists all buddies for wireless protocols.
+/**
+ * This function lists all buddies for wireless protocols.
+ */
 function WirelessAddBuddy()
 {
 	global $scripturl, $txt, $user_info, $context, $smcFunc;
@@ -2319,7 +2273,9 @@ function WirelessAddBuddy()
 	}
 }
 
-// This function performs all additional stuff...
+/**
+ * This function performs all additional stuff...
+ */
 function MessageActionsApply()
 {
 	global $txt, $context, $user_info, $options, $smcFunc;
@@ -2475,7 +2431,9 @@ function MessageActionsApply()
 	redirectexit($context['current_label_redirect'] . (count($to_label) == 1 ? '#msg' . $_SESSION['pm_selected'][0] : ''), count($to_label) == 1 && $context['browser']['is_ie']);
 }
 
-// Are you sure you want to PERMANENTLY (mostly) delete ALL your messages?
+/**
+ * Are you sure you want to PERMANENTLY (mostly) delete ALL your messages?
+ */
 function MessageKillAllQuery()
 {
 	global $txt, $context;
@@ -2489,7 +2447,9 @@ function MessageKillAllQuery()
 	$txt['delete_all'] = str_replace('PMBOX', $context['folder'] != 'sent' ? $txt['inbox'] : $txt['sent_items'], $txt['delete_all']);
 }
 
-// Delete ALL the messages!
+/**
+ * Delete ALL the messages!
+ */
 function MessageKillAll()
 {
 	global $context;
@@ -2507,7 +2467,9 @@ function MessageKillAll()
 	redirectexit($context['current_label_redirect']);
 }
 
-// This function allows the user to delete all messages older than so many days.
+/**
+ * This function allows the user to delete all messages older than so many days.
+ */
 function MessagePrune()
 {
 	global $txt, $context, $user_info, $scripturl, $smcFunc;
@@ -2575,7 +2537,9 @@ function MessagePrune()
 	$context['page_title'] = $txt['pm_prune'];
 }
 
-// Delete the specified personal messages.
+/**
+ * Delete the specified personal messages.
+ */
 function deleteMessages($personal_messages, $folder = null, $owner = null)
 {
 	global $user_info, $smcFunc;
@@ -2774,7 +2738,9 @@ function markMessages($personal_messages = null, $label = null, $owner = null)
 	}
 }
 
-// This function handles adding, deleting and editing labels on messages.
+/**
+ * This function handles adding, deleting and editing labels on messages.
+ */
 function ManageLabels()
 {
 	global $txt, $context, $user_info, $scripturl, $smcFunc;
@@ -2982,7 +2948,14 @@ function ManageLabels()
 	}
 }
 
-// Edit Personal Message Settings
+/**
+ * Allows to edit Personal Message Settings.
+ *
+ * @uses Profile.php
+ * @uses Profile-Modify.php
+ * @uses Profile template.
+ * @uses Profile language file.
+ */
 function MessageSettings()
 {
 	global $txt, $user_settings, $user_info, $context, $sourcedir, $smcFunc;
@@ -3035,7 +3008,17 @@ function MessageSettings()
 	pmprefs($user_info['id']);
 }
 
-// Allows a user to report a personal message they receive to the administrator.
+/**
+ * Allows the user to report a personal message to an administrator.
+ * In the first instance requires that the ID of the message to report
+ * is passed through $_GET.
+ * It allows the user to report to either a particular administrator - or
+ * the whole admin team.
+ * It will forward on a copy of the original message without allowing the
+ * reporter to make changes.
+ *
+ * @uses report_message sub-template.
+ */
 function ReportMessage()
 {
 	global $txt, $context, $scripturl, $sourcedir;
@@ -3202,7 +3185,9 @@ function ReportMessage()
 	}
 }
 
-// List all rules, and allow adding/entering etc....
+/**
+ * List all rules, and allow adding/entering etc...
+ */
 function ManageRules()
 {
 	global $txt, $context, $user_info, $scripturl, $smcFunc;
@@ -3427,7 +3412,11 @@ function ManageRules()
 	}
 }
 
-// This will apply rules to all unread messages. If all_messages is set will, clearly, do it to all!
+/**
+ * This will apply rules to all unread messages. If all_messages is set will, clearly, do it to all!
+ *
+ * @param bool $all_messages = false
+ */
 function ApplyRules($all_messages = false)
 {
 	global $user_info, $smcFunc, $context, $options;
@@ -3530,7 +3519,11 @@ function ApplyRules($all_messages = false)
 	}
 }
 
-// Load up all the rules for the current user.
+/**
+ * Load up all the rules for the current user.
+ *
+ * @param bool $reload = false
+ */
 function LoadRules($reload = false)
 {
 	global $user_info, $context, $smcFunc;

+ 5 - 2
Sources/Subs.php

@@ -2671,7 +2671,10 @@ function writeLog($force = false)
 	}
 }
 
-// Make sure the browser doesn't come back and repost the form data.  Should be used whenever anything is posted.
+/**
+ * Make sure the browser doesn't come back and repost the form data.
+ * Should be used whenever anything is posted.
+ */
 function redirectexit($setLocation = '', $refresh = false)
 {
 	global $scripturl, $context, $modSettings, $db_show_debug, $db_cache;
@@ -2816,7 +2819,7 @@ function obExit($header = null, $do_footer = null, $from_index = false, $from_fa
 	if (strpos($_SERVER['REQUEST_URL'], 'action=dlattach') === false && strpos($_SERVER['REQUEST_URL'], 'action=viewsmfile') === false)
 		$_SESSION['old_url'] = $_SERVER['REQUEST_URL'];
 
-	// For session check verfication.... don't switch browsers...
+	// For session check verification.... don't switch browsers...
 	$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];
 
 	if (!empty($settings['strict_doctype']))

+ 0 - 476
Themes/default/Admin.template.php

@@ -1434,482 +1434,6 @@ function template_core_features()
 	// ]]></script>';
 }
 
-// Add a new language
-function template_add_language()
-{
-	global $context, $settings, $options, $txt, $scripturl;
-
-	echo '
-	<div id="admincenter">
-		<form action="', $scripturl, '?action=admin;area=languages;sa=add;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
-			<div class="cat_bar">
-				<h3 class="catbg">
-					', $txt['add_language'], '
-				</h3>
-			</div>
-			<div class="windowbg">
-				<span class="topslice"><span></span></span>
-				<div class="content">
-					<fieldset>
-						<legend>', $txt['add_language_smf'], '</legend>
-						<label class="smalltext">', $txt['add_language_smf_browse'], '</label>
-						<input type="text" name="smf_add" size="40" value="', !empty($context['smf_search_term']) ? $context['smf_search_term'] : '', '" class="input_text" />';
-
-	if (!empty($context['smf_error']))
-		echo '
-						<div class="smalltext error">', $txt['add_language_error_' . $context['smf_error']], '</div>';
-
-	echo '
-
-					</fieldset>
-					<div class="righttext">
-						', $context['browser']['is_ie'] ? '<input type="text" name="ie_fix" style="display: none;" class="input_text" /> ' : '', '
-						<input type="submit" name="smf_add_sub" value="', $txt['search'], '" class="button_submit" />
-					</div>
-				</div>
-				<span class="botslice"><span></span></span>
-			</div>
-		';
-
-	// Had some results?
-	if (!empty($context['smf_languages']))
-	{
-		echo '
-			<div class="information">', $txt['add_language_smf_found'], '</div>
-
-				<table class="table_grid" cellspacing="0" width="100%">
-					<thead>
-						<tr class="catbg">
-							<th class="first_th" scope="col">', $txt['name'], '</th>
-							<th scope="col">', $txt['add_language_smf_desc'], '</th>
-							<th scope="col">', $txt['add_language_smf_version'], '</th>
-							<th scope="col">', $txt['add_language_smf_utf8'], '</th>
-							<th class="last_th" scope="col">', $txt['add_language_smf_install'], '</th>
-						</tr>
-					</thead>
-					<tbody>';
-
-		foreach ($context['smf_languages'] as $language)
-			echo '
-						<tr class="windowbg2">
-							<td align="left">', $language['name'], '</td>
-							<td align="left">', $language['description'], '</td>
-							<td align="left">', $language['version'], '</td>
-							<td align="center">', $language['utf8'] ? $txt['yes'] : $txt['no'], '</td>
-							<td align="left"><a href="', $language['link'], '">', $txt['add_language_smf_install'], '</a></td>
-						</tr>';
-
-		echo '
-					</tbody>
-					</table>';
-	}
-
-	echo '
-		</form>
-	</div>
-	<br class="clear" />';
-}
-
-// Download a new language file?
-function template_download_language()
-{
-	global $context, $settings, $options, $txt, $scripturl, $modSettings;
-
-	// Actually finished?
-	if (!empty($context['install_complete']))
-	{
-		echo '
-	<div id="admincenter">
-		<div class="cat_bar">
-			<h3 class="catbg">
-				', $txt['languages_download_complete'], '
-			</h3>
-		</div>
-		<div class="windowbg">
-			<span class="topslice"><span></span></span>
-			<div class="content">
-				', $context['install_complete'], '
-			</div>
-			<span class="botslice"><span></span></span>
-		</div>
-	</div>
-	<br class="clear" />';
-		return;
-	}
-
-	// An error?
-	if (!empty($context['error_message']))
-		echo '
-	<div id="errorbox">
-		<p>', $context['error_message'], '</p>
-	</div>';
-
-	// Provide something of an introduction...
-	echo '
-	<div id="admincenter">
-		<form action="', $scripturl, '?action=admin;area=languages;sa=downloadlang;did=', $context['download_id'], ';', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
-			<div class="cat_bar">
-				<h3 class="catbg">
-					', $txt['languages_download'], '
-				</h3>
-			</div>
-			<div class="windowbg">
-				<span class="topslice"><span></span></span>
-				<div class="content">
-					<p>
-						', $txt['languages_download_note'], '
-					</p>
-					<div class="smalltext">
-						', $txt['languages_download_info'], '
-					</div>
-				</div>
-				<span class="botslice"><span></span></span>
-			</div>';
-
-	// Show the main files.
-	template_show_list('lang_main_files_list');
-
-	// Now, all the images and the likes, hidden via javascript 'cause there are so fecking many.
-	echo '
-			<br />
-			<div class="title_bar">
-				<h3 class="titlebg">
-					', $txt['languages_download_theme_files'], '
-				</h3>
-			</div>
-			<table class="table_grid" cellspacing="0" width="100%">
-				<thead>
-					<tr class="catbg">
-						<th class="first_th" scope="col">
-							', $txt['languages_download_filename'], '
-						</th>
-						<th scope="col" width="100">
-							', $txt['languages_download_writable'], '
-						</th>
-						<th scope="col" width="100">
-							', $txt['languages_download_exists'], '
-						</th>
-						<th class="last_th" scope="col" width="50">
-							', $txt['languages_download_copy'], '
-						</th>
-					</tr>
-				</thead>
-				<tbody>';
-
-	foreach ($context['files']['images'] as $theme => $group)
-	{
-		$count = 0;
-		echo '
-				<tr class="titlebg">
-					<td colspan="4">
-						<img src="', $settings['images_url'], '/sort_down.gif" id="toggle_image_', $theme, '" alt="*" />&nbsp;', isset($context['theme_names'][$theme]) ? $context['theme_names'][$theme] : $theme, '
-					</td>
-				</tr>';
-
-		$alternate = false;
-		foreach ($group as $file)
-		{
-			echo '
-				<tr class="windowbg', $alternate ? '2' : '', '" id="', $theme, '-', $count++, '">
-					<td>
-						<strong>', $file['name'], '</strong><br />
-						<span class="smalltext">', $txt['languages_download_dest'], ': ', $file['destination'], '</span>
-					</td>
-					<td>
-						<span style="color: ', ($file['writable'] ? 'green' : 'red'), ';">', ($file['writable'] ? $txt['yes'] : $txt['no']), '</span>
-					</td>
-					<td>
-						', $file['exists'] ? ($file['exists'] == 'same' ? $txt['languages_download_exists_same'] : $txt['languages_download_exists_different']) : $txt['no'], '
-					</td>
-					<td>
-						<input type="checkbox" name="copy_file[]" value="', $file['generaldest'], '"', ($file['default_copy'] ? ' checked="checked"' : ''), ' class="input_check" />
-					</td>
-				</tr>';
-			$alternate = !$alternate;
-		}
-	}
-
-	echo '
-			</tbody>
-			</table>';
-
-	// Do we want some FTP baby?
-	if (!empty($context['still_not_writable']))
-	{
-		if (!empty($context['package_ftp']['error']))
-			echo '
-			<div id="errorbox">
-				<tt>', $context['package_ftp']['error'], '</tt>
-			</div>';
-
-		echo '
-			<div class="cat_bar">
-				<h3 class="catbg">
-					', $txt['package_ftp_necessary'], '
-				</h3>
-			</div>
-			<div class="windowbg">
-				<span class="topslice"><span></span></span>
-				<div class="content">
-					<p>', $txt['package_ftp_why'],'</p>
-					<dl class="settings">
-						<dt
-							<label for="ftp_server">', $txt['package_ftp_server'], ':</label>
-						</dt>
-						<dd>
-							<div class="floatright" style="margin-right: 1px;"><label for="ftp_port" style="padding-top: 2px; padding-right: 2ex;">', $txt['package_ftp_port'], ':&nbsp;</label> <input type="text" size="3" name="ftp_port" id="ftp_port" value="', isset($context['package_ftp']['port']) ? $context['package_ftp']['port'] : (isset($modSettings['package_port']) ? $modSettings['package_port'] : '21'), '" class="input_text" /></div>
-							<input type="text" size="30" name="ftp_server" id="ftp_server" value="', isset($context['package_ftp']['server']) ? $context['package_ftp']['server'] : (isset($modSettings['package_server']) ? $modSettings['package_server'] : 'localhost'), '" style="width: 70%;" class="input_text" />
-						</dd>
-
-						<dt>
-							<label for="ftp_username">', $txt['package_ftp_username'], ':</label>
-						</dt>
-						<dd>
-							<input type="text" size="50" name="ftp_username" id="ftp_username" value="', isset($context['package_ftp']['username']) ? $context['package_ftp']['username'] : (isset($modSettings['package_username']) ? $modSettings['package_username'] : ''), '" style="width: 99%;" class="input_text" />
-						</dd>
-
-						<dt>
-							<label for="ftp_password">', $txt['package_ftp_password'], ':</label>
-						</dt>
-						<dd>
-							<input type="password" size="50" name="ftp_password" id="ftp_password" style="width: 99%;" class="input_text" />
-						</dd>
-
-						<dt>
-							<label for="ftp_path">', $txt['package_ftp_path'], ':</label>
-						</dt>
-						<dd>
-							<input type="text" size="50" name="ftp_path" id="ftp_path" value="', $context['package_ftp']['path'], '" style="width: 99%;" class="input_text" />
-						</dd>
-					</dl>
-				</div>
-				<span class="botslice"><span></span></span>
-			</div>';
-	}
-
-	// Install?
-	echo '
-			<div class="righttext padding">
-				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
-				<input type="submit" name="do_install" value="', $txt['add_language_smf_install'], '" class="button_submit" />
-			</div>
-		</form>
-	</div>
-	<br class="clear" />';
-
-	// The javascript for expand and collapse of sections.
-	echo '
-	<script type="text/javascript"><!-- // --><![CDATA[';
-
-	// Each theme gets its own handler.
-	foreach ($context['files']['images'] as $theme => $group)
-	{
-		$count = 0;
-		echo '
-			var oTogglePanel_', $theme, ' = new smc_Toggle({
-				bToggleEnabled: true,
-				bCurrentlyCollapsed: true,
-				aSwappableContainers: [';
-		foreach ($group as $file)
-			echo '
-					', JavaScriptEscape($theme . '-' . $count++), ',';
-		echo '
-					null
-				],
-				aSwapImages: [
-					{
-						sId: \'toggle_image_', $theme, '\',
-						srcExpanded: smf_images_url + \'/sort_down.gif\',
-						altExpanded: \'*\',
-						srcCollapsed: smf_images_url + \'/selected.gif\',
-						altCollapsed: \'*\'
-					}
-				]
-			});';
-	}
-
-	echo '
-	// ]]></script>';
-}
-
-// Edit some language entries?
-function template_modify_language_entries()
-{
-	global $context, $settings, $options, $txt, $scripturl;
-
-	echo '
-	<div id="admincenter">
-		<form action="', $scripturl, '?action=admin;area=languages;sa=editlang;lid=', $context['lang_id'], '" method="post" accept-charset="', $context['character_set'], '">
-			<div class="cat_bar">
-				<h3 class="catbg">
-					', $txt['edit_languages'], '
-				</h3>
-			</div>';
-
-	// Not writable?
-	if ($context['lang_file_not_writable_message'])
-		echo '
-			<div id="errorbox">
-				<p class="alert">', $context['lang_file_not_writable_message'], '</p>
-			</div>';
-
-	echo '
-			<div class="information">
-				', $txt['edit_language_entries_primary'], '
-			</div>
-			<div class="windowbg">
-				<span class="topslice"><span></span></span>
-				<div class="content">
-					<fieldset>
-						<legend>', $context['primary_settings']['name'], '</legend>
-					<dl class="settings">
-						<dt>
-							', $txt['languages_character_set'], ':
-						</dt>
-						<dd>
-							<input type="text" name="character_set" size="20" value="', $context['primary_settings']['character_set'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
-						</dd>
-						<dt>
-							', $txt['languages_locale'], ':
-						</dt>
-						<dd>
-							<input type="text" name="locale" size="20" value="', $context['primary_settings']['locale'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
-						</dd>
-						<dt>
-							', $txt['languages_dictionary'], ':
-						</dt>
-						<dd>
-							<input type="text" name="dictionary" size="20" value="', $context['primary_settings']['dictionary'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
-						</dd>
-						<dt>
-							', $txt['languages_spelling'], ':
-						</dt>
-						<dd>
-							<input type="text" name="spelling" size="20" value="', $context['primary_settings']['spelling'], '"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' class="input_text" />
-						</dd>
-						<dt>
-							', $txt['languages_rtl'], ':
-						</dt>
-						<dd>
-							<input type="checkbox" name="rtl"', $context['primary_settings']['rtl'] ? ' checked="checked"' : '', ' class="input_check"', (empty($context['file_entries']) ? '' : ' disabled="disabled"'), ' />
-						</dd>
-					</dl>
-					</fieldset>
-					<div class="righttext">
-						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
-						<input type="submit" name="save_main" value="', $txt['save'], '"', $context['lang_file_not_writable_message'] || !empty($context['file_entries']) ? ' disabled="disabled"' : '', ' class="button_submit" />';
-
-	// English can't be deleted.
-	if ($context['lang_id'] != 'english')
-		echo '
-						<input type="submit" name="delete_main" value="', $txt['delete'], '"', $context['lang_file_not_writable_message'] || !empty($context['file_entries']) ? ' disabled="disabled"' : '', ' onclick="confirm(\'', $txt['languages_delete_confirm'], '\');" class="button_submit" />';
-
-	echo '
-					</div>
-				</div>
-				<span class="botslice"><span></span></span>
-			</div>
-		</form>
-
-		<form action="', $scripturl, '?action=admin;area=languages;sa=editlang;lid=', $context['lang_id'], ';entries" id="entry_form" method="post" accept-charset="', $context['character_set'], '">
-			<div class="title_bar">
-				<h3 class="titlebg">
-					', $txt['edit_language_entries'], '
-				</h3>
-			</div>
-			<div id="taskpad" class="floatright">
-				', $txt['edit_language_entries_file'], ':
-					<select name="tfid" onchange="if (this.value != -1) document.forms.entry_form.submit();">';
-	foreach ($context['possible_files'] as $id_theme => $theme)
-	{
-		echo '
-						<option value="-1">', $theme['name'], '</option>';
-
-		foreach ($theme['files'] as $file)
-			echo '
-						<option value="', $id_theme, '+', $file['id'], '"', $file['selected'] ? ' selected="selected"' : '', '> =&gt; ', $file['name'], '</option>';
-	}
-
-	echo '
-					</select>
-					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
-					<input type="submit" value="', $txt['go'], '" class="button_submit" />
-			</div>';
-
-		// Is it not writable?
-	if (!empty($context['entries_not_writable_message']))
-		echo '
-			<div id="errorbox">
-				<span class="alert">', $context['entries_not_writable_message'], '</span>
-			</div>';
-
-	// Already have some?
-	if (!empty($context['file_entries']))
-	{
-		echo '
-			<div class="windowbg2">
-				<span class="topslice"><span></span></span>
-				<div class="content">
-					<dl class="settings">';
-
-		$cached = array();
-		foreach ($context['file_entries'] as $entry)
-		{
-			// Do it in two's!
-			if (empty($cached))
-			{
-				$cached = $entry;
-				continue;
-			}
-
-			echo '
-						<dt>
-							<span class="smalltext">', $cached['key'], '</span>
-						</dt>
-						<dd>
-							<span class="smalltext">', $entry['key'], '</span>
-						</dd>
-						<dt>
-							<input type="hidden" name="comp[', $cached['key'], ']" value="', $cached['value'], '" />
-							<textarea name="entry[', $cached['key'], ']" cols="40" rows="', $cached['rows'] < 2 ? 2 : $cached['rows'], '" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $cached['value'], '</textarea>
-						</dt>
-						<dd>
-							<input type="hidden" name="comp[', $entry['key'], ']" value="', $entry['value'], '" />
-							<textarea name="entry[', $entry['key'], ']" cols="40" rows="', $entry['rows'] < 2 ? 2 : $entry['rows'], '" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $entry['value'], '</textarea>
-						</dd>';
-			$cached = array();
-		}
-
-		// Odd number?
-		if (!empty($cached))
-			echo '
-
-						<dt>
-							<span class="smalltext">', $cached['key'], '</span>
-						</dt>
-						<dd>
-						</dd>
-						<dt>
-							<input type="hidden" name="comp[', $cached['key'], ']" value="', $cached['value'], '" />
-							<textarea name="entry[', $cached['key'], ']" cols="40" rows="2" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 96%; min-width: 96%' : 'width: 96%') . ';">', $cached['value'], '</textarea>
-						</dt>
-						<dd>
-						</dd>';
-
-		echo '
-					</dl>
-					<input type="submit" name="save_entries" value="', $txt['save'], '"', !empty($context['entries_not_writable_message']) ? ' disabled="disabled"' : '', ' class="button_submit" />';
-
-		echo '
-				</div>
-				<span class="botslice"><span></span></span>
-			</div>';
-	}
-	echo '
-		</form>
-	</div>
-	<br class="clear" />';
-}
 
 // This little beauty shows questions and answer from the captcha type feature.
 function template_callback_question_answer_list()

+ 3 - 1
Themes/default/MoveTopic.template.php

@@ -10,7 +10,9 @@
  * @version 2.0
  */
 
-// Show an interface for selecting which board to move a post to.
+/**
+ * Show an interface for selecting which board to move a post to.
+ */
 function template_main()
 {
 	global $context, $settings, $options, $txt, $scripturl;

+ 1 - 1
index.php

@@ -63,7 +63,7 @@ if (!empty($maintenance) && $maintenance == 2)
 // Create a variable to store some SMF specific functions in.
 $smcFunc = array();
 
-// Initate the database connection and define some database functions to use.
+// Initiate the database connection and define some database functions to use.
 loadDatabase();
 
 // Load the settings from the settings table, and perform operations like optimizing.

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác