summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-08-12 18:00:11 +0000
committerDries Buytaert <dries@buytaert.net>2004-08-12 18:00:11 +0000
commit0f088b79ca2fefb4aa92b91cee1d32e162a3dfaf (patch)
treeb96ef3d826688f6669eb9d23b12db48947339f3c
parentc1ca7c326f574d83085fb052ea1f2d6249d3832e (diff)
downloadbrdo-0f088b79ca2fefb4aa92b91cee1d32e162a3dfaf.tar.gz
brdo-0f088b79ca2fefb4aa92b91cee1d32e162a3dfaf.tar.bz2
- Patch #9983 by Stefan: various code style improvements.
-rw-r--r--cron.php6
-rw-r--r--database/updates.inc4
-rw-r--r--includes/locale.inc58
-rw-r--r--includes/menu.inc2
-rw-r--r--index.php4
-rw-r--r--modules/aggregator.module4
-rw-r--r--modules/aggregator/aggregator.module4
-rw-r--r--modules/blog.module4
-rw-r--r--modules/blog/blog.module4
-rw-r--r--modules/filter.module4
-rw-r--r--modules/filter/filter.module4
-rw-r--r--modules/help.module2
-rw-r--r--modules/help/help.module2
-rw-r--r--modules/locale.module38
-rw-r--r--modules/locale/locale.module38
-rw-r--r--modules/system.module226
-rw-r--r--modules/system/system.module226
-rw-r--r--modules/user.module16
-rw-r--r--modules/user/user.module16
-rw-r--r--xmlrpc.php8
20 files changed, 449 insertions, 221 deletions
diff --git a/cron.php b/cron.php
index e6ecba6f1..31790bca8 100644
--- a/cron.php
+++ b/cron.php
@@ -1,11 +1,11 @@
<?php
// $Id$
-include_once "includes/bootstrap.inc";
-include_once "includes/common.inc";
+include_once 'includes/bootstrap.inc';
+include_once 'includes/common.inc' ;
// If not in 'safe mode', increase the maximum execution time:
-if (!ini_get("safe_mode")) {
+if (!ini_get('safe_mode')) {
set_time_limit(240);
}
diff --git a/database/updates.inc b/database/updates.inc
index 6576f9ca8..6bc5a5741 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -1507,7 +1507,7 @@ function update_101() {
// but not the fixed fields
unset($fields['lid'], $fields['location'], $fields['string']);
-
+
// insert locales
$list = _locale_get_iso639_list();
foreach ($fields as $key => $value) {
@@ -1524,7 +1524,7 @@ function update_101() {
}
}
}
-
+
// get all strings
$result = db_query('SELECT * FROM {locales}');
while($entry = db_fetch_object($result)) {
diff --git a/includes/locale.inc b/includes/locale.inc
index 5d6ceb18c..a572bc504 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -19,7 +19,7 @@ function _locale_add_language($code, $name, $onlylanguage = TRUE) {
while ($string = db_fetch_object($result)) {
db_query("INSERT INTO {locales_target} (lid, locale) VALUES (%d,'%s')", $string->lid, $code);
}
-
+
// If only the language was added, and not a PO file import triggered
// the language addition, we need to inform the user on how to start
// a translation
@@ -29,7 +29,7 @@ function _locale_add_language($code, $name, $onlylanguage = TRUE) {
else {
$message = t("'%locale' language added.", array('%locale' => t($name)));
}
-
+
drupal_set_message($message);
watchdog('locale', t("'%locale' language added.", array('%locale' => $code)));
}
@@ -46,20 +46,20 @@ function _locale_admin_manage_screen() {
foreach ($languages['name'] as $key => $lang) {
$status = db_fetch_object(db_query("SELECT isdefault, enabled FROM {locales_meta} WHERE locale = '%s'", $key));
-
+
if ($key == 'en') {
$rows[] = array('en', $lang, form_checkbox('', 'enabled][en', 1, $status->enabled), form_radio('', 'sitedefault', $key, $status->isdefault), message_na(), '');
}
else {
$original = db_fetch_object(db_query("SELECT COUNT(*) AS strings FROM {locales_source}"));
$translation = db_fetch_object(db_query("SELECT COUNT(*) AS translation FROM {locales_target} WHERE locale = '%s' AND translation != ''", $key));
-
+
$ratio = ($original->strings > 0 && $translation->translation > 0) ? round(($translation->translation/$original->strings)*100., 2) : 0;
-
+
$rows[] = array($key, ($key != 'en' ? form_textfield('', 'name]['. $key, $lang, 15, 64) : $lang), form_checkbox('', 'enabled]['. $key, 1, $status->enabled), form_radio('', 'sitedefault', $key, $status->isdefault), "$translation->translation/$original->strings ($ratio%)", ($key != 'en' ? l(t('delete locale'), 'admin/locale/language/delete/'. urlencode($key)) : ''));
}
}
-
+
return form(theme('table', $header, $rows) . form_submit(t('Save configuration')), 'POST', url('admin/locale'));
}
@@ -67,14 +67,14 @@ function _locale_admin_manage_screen() {
* User interface for the language addition screen
*/
function _locale_admin_manage_add_screen() {
-
+
$isocodes = _locale_prepare_iso_list();
-
+
$output = '<h2>'. t('From language list') .'</h2>';
$form = form_select(t('Language name'), 'langcode', key($isocodes), $isocodes, t('Select your language here, or add it below, if you are unable to find it.'));
$form .= form_submit(t('Add language'));
$output .= form($form);
-
+
$edit = &$_POST['edit'];
$output .= '<h2>'. t('Custom language') .'</h2>';
$form = form_textfield(t('Language code'), 'langcode', $edit['langcode'], 70, 12, t("Commonly this is an <a href=\"%iso-codes\">ISO 639 language code</a> with an optional country code for regional variants. Examples include 'en', 'en-US' and 'zh-cn'.", array("%iso-codes" => "http://www.w3.org/WAI/ER/IG/ert/iso639.htm")));
@@ -93,7 +93,7 @@ function _locale_admin_import_screen() {
$languages = locale_supported_languages(FALSE, TRUE);
$languages = array_map("t", $languages['name']);
unset($languages['en']);
-
+
if (!count($languages)) {
drupal_set_message(t('You need to have at least one language set up to import translations.'), 'error');
}
@@ -102,7 +102,7 @@ function _locale_admin_import_screen() {
t('Already added languages') => $languages,
t('Languages not yet added') => _locale_prepare_iso_list()
);
-
+
$form = form_file(t('Language file'), 'file', 50, t('A gettext Portable Object (.po) file.'));
$form .= form_select(t('Import into'), 'langcode', '', $languages, t('Choose the language you want to add strings into. If you choose a language which is not yet set up, then it will be added.'));
$form .= form_radios(t('Mode'), 'mode', 'overwrite', array("overwrite" => t('Strings in the uploaded file replace existing ones, new ones are added'), "keep" => t('Existing strings are kept, only new strings are added')));
@@ -117,7 +117,7 @@ function _locale_admin_import_screen() {
*
* @param $file Name of local file to be imported
* @param $edit Language code
- * @param $mode should existing translations be replaced?
+ * @param $mode should existing translations be replaced?
*/
function _locale_import_po($file, $lang, $mode) {
// Check if we have the language already in the database
@@ -125,21 +125,21 @@ function _locale_import_po($file, $lang, $mode) {
drupal_set_message(t("Unsupported language selected for import."), 'error');
return FALSE;
}
-
+
// Check if we can get the strings from the file
if (!($strings = _locale_import_read_po($file))) {
drupal_set_message(t("Translation file broken: Couldn't be read."), 'error');
return FALSE;
}
-
+
// Strip out header from the string pairs
$header = $strings[""]["msgstr"];
unset($strings[""]);
-
+
// Get information from the header into the database
if ($header) {
$hdr = _locale_import_parse_header($header);
-
+
// Get the plural formula
if ($hdr["Plural-Forms"] && $p = _locale_import_parse_plural_forms($hdr["Plural-Forms"])) {
list($nplurals, $plural) = $p;
@@ -157,7 +157,7 @@ function _locale_import_po($file, $lang, $mode) {
$fullstr = 0;
foreach ($strings as $value) {
$comments = _locale_import_shorten_comments($value['#']);
-
+
// Handle a translation for some plural string
if (strpos($value['msgid'], "\0")) {
$english = explode("\0", $value['msgid'], 2);
@@ -192,7 +192,7 @@ function _locale_import_po($file, $lang, $mode) {
}
}
}
-
+
// A simple translation
else {
$english = $value['msgid'];
@@ -218,7 +218,7 @@ function _locale_import_po($file, $lang, $mode) {
}
}
}
-
+
// Successfull import
cache_clear_all("locale:$lang");
drupal_set_message(t("Translation successfully imported. %num translated strings added to language.", array('%num' => $fullstr)));
@@ -284,7 +284,7 @@ function _locale_import_read_po($path) {
return FALSE;
}
$current["msgid"] = $current["msgid"] ."\0". $quoted;
- $context = "MSGID_PLURAL";
+ $context = "MSGID_PLURAL";
}
elseif (!strncmp("msgid", $line, 5)) {
if ($context == "MSGSTR") { // End current entry, start a new one
@@ -605,7 +605,7 @@ function _locale_import_tokenize_formula($formula) {
* @param $key Index of the array element
*/
function _locale_import_append_plural($entry, $key) {
- // No modifications for 0, 1
+ // No modifications for 0, 1
if ($key == 0 || $key == 1) {
return $entry;
}
@@ -674,7 +674,7 @@ function _locale_admin_export_screen() {
$form = t('<p>Generate a gettext Portable Object Template (.pot) file with all the interface strings from the Drupal locale database.</p>');
$form .= form_submit(t('Export'));
$output .= form($form);
-
+
return $output;
}
@@ -685,7 +685,7 @@ function _locale_admin_export_screen() {
*/
function _locale_export_po($language) {
global $user;
-
+
// Get language specific strings, or all strings
if ($language) {
$meta = db_fetch_object(db_query("SELECT * FROM {locales_meta} WHERE locale = '%s'", $language));
@@ -694,7 +694,7 @@ function _locale_export_po($language) {
else {
$result = db_query("SELECT s.lid, s.source, s.location, t.plid, t.plural FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid GROUP BY s.lid ORDER BY t.plid, t.plural");
}
-
+
// Build array out of the database results
$parent = array();
while ($child = db_fetch_object($result)) {
@@ -709,7 +709,7 @@ function _locale_export_po($language) {
$parent[$child->lid]['translation'] = $child->translation;
}
}
-
+
// Generating Portable Object file for a language
if ($language) {
$filename = $language .'.po';
@@ -732,7 +732,7 @@ function _locale_export_po($language) {
$header .= "\n";
watchdog('locale', strtr("PO file for locale '%loc' downloaded.", array('%loc' => $meta->name)));
}
-
+
// Generating Portable Object Template
else {
$filename = variable_get('site_name', 'drupal') .'.pot';
@@ -899,7 +899,7 @@ function _locale_string_save($lid) {
function _locale_string_edit($lid) {
$languages = locale_supported_languages(FALSE, TRUE);
unset($languages['name']['en']);
-
+
$result = db_query("SELECT DISTINCT s.source, t.translation, t.locale FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid WHERE s.lid = %d", $lid);
$form = '';
while ($translation = db_fetch_object($result)) {
@@ -927,7 +927,7 @@ function _locale_string_language_list($translation) {
foreach ($languages['name'] as $key => $value) {
if (isset($translation[$key])) {
$output .= ($translation[$key] != '') ? $key .' ' : "<strike>$key</strike> ";
- }
+ }
}
return $output;
@@ -996,7 +996,7 @@ function _locale_string_seek() {
break;
// Some different language
default:
- $sql = "$join $where AND t.locale = '". check_query($query->language) ."' $orderby";
+ $sql = "$join $where AND t.locale = '". check_query($query->language) ."' $orderby";
}
$result = pager_query($sql, 50);
diff --git a/includes/menu.inc b/includes/menu.inc
index 53f1d2085..c8c8d6e8b 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -425,7 +425,7 @@ function menu_get_active_help() {
if ($temp = module_invoke($name, 'help', $path)) {
$output .= $temp . "\n";
}
- if (substr($path, 0, 6) == "admin/") {
+ if (substr($path, 0, 6) == "admin/") {
if (module_invoke($name, 'help', 'admin/help#' . substr($path, 6))) {
$output .= theme("more_help_link", url('admin/help/' . substr($path, 6)));
}
diff --git a/index.php b/index.php
index 5356050f6..c7e2e297b 100644
--- a/index.php
+++ b/index.php
@@ -1,9 +1,9 @@
<?php
// $Id$
-include_once "includes/bootstrap.inc";
+include_once 'includes/bootstrap.inc';
drupal_page_header();
-include_once "includes/common.inc";
+include_once 'includes/common.inc';
fix_gpc_magic();
diff --git a/modules/aggregator.module b/modules/aggregator.module
index 7d68ddccb..dd83cda22 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -31,7 +31,7 @@ function aggregator_help($section) {
<p>News items can be filed into categories. To create a category, start at the <a href="%admin-news">aggregation page</a>.</p>
<p>Once there, select <a href="%new-category">new category</a> from the menu. Drupal will then ask for the following:</p>
<ul>
- <li><strong>Title</strong> -- The title will be used in the <i>news by topics</i> listing in your news aggregator and for the block created for the bundle.</li>
+ <li><strong>Title</strong> -- The title will be used in the <em>news by topics</em> listing in your news aggregator and for the block created for the bundle.</li>
<li><strong>Description</strong> -- A short description of the category to tell users more details about what news items they might find in the category.</li>
<li><strong>Latest items block</strong> -- The number of items selected here will determine how many of the latest items from the category will appear in a block which may be enabled and placed in the <a href="%block">blocks</a> administration page.</li>
</ul>
@@ -61,7 +61,7 @@ function aggregator_help($section) {
case 'admin/aggregator/add/feed':
return t('Add a site that has an RSS/RDF feed. The URL is the full path to the RSS feed file. For the feed to update automatically you must run "cron.php" on a regular basis. If you already have a feed with the URL you are planning to use, the system will not accept another feed with the same URL.');
case 'admin/aggregator/add/category':
- return t('Categories provide a way to group items from different news feeds together. Each news category has its own feed page and block. For example, you could tag various sport-related feeds as belonging to a category called <i>Sports</i>. News items can be added to a category automatically by setting a feed to automatically place its item into that category, or by using the categorize items link in any listing of news items.');
+ return t('Categories provide a way to group items from different news feeds together. Each news category has its own feed page and block. For example, you could tag various sport-related feeds as belonging to a category called <em>Sports</em>. News items can be added to a category automatically by setting a feed to automatically place its item into that category, or by using the categorize items link in any listing of news items.');
case 'admin/aggregator/configure':
return t('These settings control the display of aggregated content.');
}
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 7d68ddccb..dd83cda22 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -31,7 +31,7 @@ function aggregator_help($section) {
<p>News items can be filed into categories. To create a category, start at the <a href="%admin-news">aggregation page</a>.</p>
<p>Once there, select <a href="%new-category">new category</a> from the menu. Drupal will then ask for the following:</p>
<ul>
- <li><strong>Title</strong> -- The title will be used in the <i>news by topics</i> listing in your news aggregator and for the block created for the bundle.</li>
+ <li><strong>Title</strong> -- The title will be used in the <em>news by topics</em> listing in your news aggregator and for the block created for the bundle.</li>
<li><strong>Description</strong> -- A short description of the category to tell users more details about what news items they might find in the category.</li>
<li><strong>Latest items block</strong> -- The number of items selected here will determine how many of the latest items from the category will appear in a block which may be enabled and placed in the <a href="%block">blocks</a> administration page.</li>
</ul>
@@ -61,7 +61,7 @@ function aggregator_help($section) {
case 'admin/aggregator/add/feed':
return t('Add a site that has an RSS/RDF feed. The URL is the full path to the RSS feed file. For the feed to update automatically you must run "cron.php" on a regular basis. If you already have a feed with the URL you are planning to use, the system will not accept another feed with the same URL.');
case 'admin/aggregator/add/category':
- return t('Categories provide a way to group items from different news feeds together. Each news category has its own feed page and block. For example, you could tag various sport-related feeds as belonging to a category called <i>Sports</i>. News items can be added to a category automatically by setting a feed to automatically place its item into that category, or by using the categorize items link in any listing of news items.');
+ return t('Categories provide a way to group items from different news feeds together. Each news category has its own feed page and block. For example, you could tag various sport-related feeds as belonging to a category called <em>Sports</em>. News items can be added to a category automatically by setting a feed to automatically place its item into that category, or by using the categorize items link in any listing of news items.');
case 'admin/aggregator/configure':
return t('These settings control the display of aggregated content.');
}
diff --git a/modules/blog.module b/modules/blog.module
index a9343c7fc..cbbf70edb 100644
--- a/modules/blog.module
+++ b/modules/blog.module
@@ -192,12 +192,12 @@ function blog_form(&$node) {
*/
if ($nid && $blog = node_load(array('nid' => $nid))) {
- $node->body = '<i>'. $blog->body .'</i> ['. l($blog->name, "node/$nid") .']';
+ $node->body = '<em>'. $blog->body .'</em> ['. l($blog->name, "node/$nid") .']';
}
if ($iid && $item = db_fetch_object(db_query('SELECT i.*, f.title as ftitle, f.link as flink FROM {aggregator_item} i, {aggregator_feed} f WHERE i.iid = %d AND i.fid = f.fid', $iid))) {
$node->title = $item->title;
- $node->body = "<a href=\"$item->link\">$item->title</a> - <i>". $item->description ."</i> [<a href=\"$item->flink\">$item->ftitle</a>]\n";
+ $node->body = "<a href=\"$item->link\">$item->title</a> - <em>". $item->description ."</em> [<a href=\"$item->flink\">$item->ftitle</a>]\n";
}
}
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index a9343c7fc..cbbf70edb 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -192,12 +192,12 @@ function blog_form(&$node) {
*/
if ($nid && $blog = node_load(array('nid' => $nid))) {
- $node->body = '<i>'. $blog->body .'</i> ['. l($blog->name, "node/$nid") .']';
+ $node->body = '<em>'. $blog->body .'</em> ['. l($blog->name, "node/$nid") .']';
}
if ($iid && $item = db_fetch_object(db_query('SELECT i.*, f.title as ftitle, f.link as flink FROM {aggregator_item} i, {aggregator_feed} f WHERE i.iid = %d AND i.fid = f.fid', $iid))) {
$node->title = $item->title;
- $node->body = "<a href=\"$item->link\">$item->title</a> - <i>". $item->description ."</i> [<a href=\"$item->flink\">$item->ftitle</a>]\n";
+ $node->body = "<a href=\"$item->link\">$item->title</a> - <em>". $item->description ."</em> [<a href=\"$item->flink\">$item->ftitle</a>]\n";
}
}
diff --git a/modules/filter.module b/modules/filter.module
index 97c0a9694..558b6672b 100644
--- a/modules/filter.module
+++ b/modules/filter.module
@@ -22,13 +22,13 @@ function filter_help($section) {
case 'admin/filters':
return t('
-<p><i>Input formats</i> define a way of processing user-supplied text in Drupal. Every input format has its own settings of which <i>filters</i> to apply. Possible filters include stripping out malicious HTML and making URLs clickable.</p>
+<p><em>Input formats</em> define a way of processing user-supplied text in Drupal. Every input format has its own settings of which <em>filters</em> to apply. Possible filters include stripping out malicious HTML and making URLs clickable.</p>
<p>Users can choose between the available input formats when submitting content.</p>
<p>Below you can configure which input formats are available to which roles, as well as choose a default input format (used for imported content, for example).</p>');
case 'admin/filters/#':
return t('
-<p>Every <i>filter</i> performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this input format.</p>
+<p>Every <em>filter</em> performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this input format.</p>
<p>If you notice some filters are causing conflicts in the output, you can <a href="%order">rearrange them</a>.', array('%configure' => url('admin/filters/'. arg(2) .'/configure'), '%order' => url('admin/filters/'. arg(2) .'/order')));
case 'admin/filters/#/configure':
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 97c0a9694..558b6672b 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -22,13 +22,13 @@ function filter_help($section) {
case 'admin/filters':
return t('
-<p><i>Input formats</i> define a way of processing user-supplied text in Drupal. Every input format has its own settings of which <i>filters</i> to apply. Possible filters include stripping out malicious HTML and making URLs clickable.</p>
+<p><em>Input formats</em> define a way of processing user-supplied text in Drupal. Every input format has its own settings of which <em>filters</em> to apply. Possible filters include stripping out malicious HTML and making URLs clickable.</p>
<p>Users can choose between the available input formats when submitting content.</p>
<p>Below you can configure which input formats are available to which roles, as well as choose a default input format (used for imported content, for example).</p>');
case 'admin/filters/#':
return t('
-<p>Every <i>filter</i> performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this input format.</p>
+<p>Every <em>filter</em> performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this input format.</p>
<p>If you notice some filters are causing conflicts in the output, you can <a href="%order">rearrange them</a>.', array('%configure' => url('admin/filters/'. arg(2) .'/configure'), '%order' => url('admin/filters/'. arg(2) .'/order')));
case 'admin/filters/#/configure':
diff --git a/modules/help.module b/modules/help.module
index 200bea791..d223d006a 100644
--- a/modules/help.module
+++ b/modules/help.module
@@ -10,7 +10,7 @@ function help_menu() {
'callback' => 'help_main',
'access' => user_access('access administration pages'),
'weight' => 9);
-
+
foreach (module_list() as $name) {
if (module_hook($name, 'help')) {
if (module_invoke($name, 'help', "admin/help#$name")) {
diff --git a/modules/help/help.module b/modules/help/help.module
index 200bea791..d223d006a 100644
--- a/modules/help/help.module
+++ b/modules/help/help.module
@@ -10,7 +10,7 @@ function help_menu() {
'callback' => 'help_main',
'access' => user_access('access administration pages'),
'weight' => 9);
-
+
foreach (module_list() as $name) {
if (module_hook($name, 'help')) {
if (module_invoke($name, 'help', "admin/help#$name")) {
diff --git a/modules/locale.module b/modules/locale.module
index 7b13b5f8d..ae6c407bd 100644
--- a/modules/locale.module
+++ b/modules/locale.module
@@ -13,7 +13,7 @@
// ---------------------------------------------------------------------------------
// Hook implementations (needed on all page loads)
-
+
/**
* Implementation of hook_help().
*/
@@ -27,12 +27,12 @@ function locale_help($section = "admin/help#locale") {
case 'admin/locale/language/add':
return t("<p>You need to add all languages you would like to provide the site interface in. If you can't find the desired language in the quick add dropdown, then need to provide the proper language code yourself. The language code might be used to negotiate with browsers and present flags, so it is important to pick one that is standardised for the desired language. You can also add languages by <a href=\"%import\">importing translations</a> directly into a language not yet set up.</p>", array("%import" => url("admin/locale/language/import")));
case 'admin/locale/language/import':
- return t("<p>This page allows you to import a translation provided in the gettext Portable Object (.po) format. The easiest way to get your site translated is to grab an existing Drupal translation and to import it. You can obtain translations from the <a href=\"%url\">Drupal localization page</a>.</p>", array('%url' => 'http://drupal.org/localization'));
+ return t("<p>This page allows you to import a translation provided in the gettext Portable Object (.po) format. The easiest way to get your site translated is to grab an existing Drupal translation and to import it. You can obtain translations from the <a href=\"%url\">Drupal localization page</a>.</p>", array('%url' => 'http://drupal.org/localization'));
case 'admin/locale/language/export':
return t("<p>This page allows you to export Drupal strings. The first option is to export a translation so it can be shared. The second option is to generate a translation template, which contains all Drupal strings, but without their translations. You can use this template to start a new translation using a specialized desktop application.</p>");
case 'admin/locale/string/search':
return t("<p>It is often more convinient to get the strings of your setup on the <a href=\"%export\">export page</a>, and start with a desktop Gettext translation editor though. Here you can search in the translated and untranslated strings, and the default English texts provided by Drupal.</p>", array("%export" => url("admin/locale/language/export")));
-
+
case 'admin/help#locale':
return t("
<p>Most programs are written and documented in English, and primarily use English to interact with users. This is also true for a great deal of web sites. However, most people are less comfortable with English than with their native language, and would prefer to use their mother tongue as much as possible. Many people love to see their web site showing a lot less English, and far more of their own language. Therefore Drupal provides a framework to setup a multi-lingual web site, or to overwrite the default English texts.</p>
@@ -40,7 +40,7 @@ function locale_help($section = "admin/help#locale") {
<p>Whenever Drupal encounters an interface string which needs to be displayed, it tries to translate it into the currently selected language. If a translation is not available, then the string is remembered, so you can look up untranslated strings easily.</p>
<p>Drupal provides two options to translate these strings. First is the integrated web interface, where you can search for untranslated strings, and specify their translations via simple web forms. An easier, and much less time consuming method is to import translations already done for your language. This is achieved by the use of GNU gettext Portable Object files. These are editable with quite convinient desktop editors specifically architected for supporting your work with GNU Gettext files. The import feature allows you to add strings from such files into the site database. The export functionality enables you to share your translations with others, generating Portable Object files from your site strings.");
break;
-
+
// TODO: integrate a rewritten version of this help into the big help screen above
/*
"<p>To translate strings start at the <a href=\"%search\">search</a> page of the locale section in the administration pages. There you will see a list of the languages you have configured. Choose the appropriate settings and search for the strings you want to translate.</p>
@@ -57,7 +57,7 @@ function locale_help($section = "admin/help#locale") {
<p>Once you got the appropriate PO file, all you have to do is to add the locale and upload it from the <a href=\"%addlocale\">manage locale</a> screen.</p>
<p>Note that uploading and parsing the uploaded file can take quite some time, depending on the connection to the server and the server's power.</p>
", array("%search" => url("admin/locale/string/search"), "%addlocale" => url("admin/locale/languages/add"), "%translations" => 'http://www.Drupal.org/translations/', "%handbook" => 'http://www.Drupal.org/handbook/po-files', "%gettext" => 'http://www.gnu.org/software/gettext/gettext.html'));*/
- }
+ }
}
/**
@@ -71,14 +71,14 @@ function locale_menu() {
// Main admin menu item
$items[] = array('path' => 'admin/locale', 'title' => t('localization'),
'callback' => 'locale_admin_manage', 'access' => $access);
-
+
// Top level tabs
$items[] = array('path' => 'admin/locale/language', 'title' => t('manage languages'),
'access' => $access, 'weight' => -10, 'type' => MENU_DEFAULT_LOCAL_TASK);
$items[] = array('path' => 'admin/locale/string/search', 'title' => t('manage strings'),
'callback' => 'locale_admin_string', 'access' => $access, 'weight' => 10,
'type' => MENU_LOCAL_TASK);
-
+
// Manage languages subtabs
$items[] = array('path' => 'admin/locale/language/overview', 'title' => t('list'),
'callback' => 'locale_admin_manage', 'access' => $access, "weight" => 0,
@@ -92,12 +92,12 @@ function locale_menu() {
$items[] = array('path' => 'admin/locale/language/export', 'title' => t('export'),
'callback' => 'locale_admin_export', 'access' => $access, 'weight' => 20,
'type' => MENU_LOCAL_TASK);
-
+
// Language related callbacks
$items[] = array('path' => 'admin/locale/language/delete', 'title' => t('confirm'),
'callback' => 'locale_admin_manage_delete_screen', 'access' => $access,
'type' => MENU_CALLBACK);
-
+
// String related callbacks
$items[] = array('path' => 'admin/locale/string/edit', 'title' => t('edit'),
'callback' => 'locale_admin_string', 'access' => $access, 'type' => MENU_CALLBACK);
@@ -128,7 +128,7 @@ function locale_user($type, $edit, &$user, $category = NULL) {
// ---------------------------------------------------------------------------------
// Locale core functionality (needed on all page loads)
-
+
/**
* Provides interface translation services
*
@@ -154,7 +154,7 @@ function locale($string) {
if (isset($locale_t[$string])) {
$string = ($locale_t[$string] === TRUE ? $string : $locale_t[$string]);
}
-
+
// We don't have this translation cached, so get it from the DB
else {
$result = db_query("SELECT s.lid, t.translation FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid WHERE s.source = '%s' AND t.locale = '%s'", $string, $locale);
@@ -165,7 +165,7 @@ function locale($string) {
$string = $trans->translation;
}
}
-
+
// Either we have no such source string, or no translation
else {
$result = db_query("SELECT lid, source FROM {locales_source} WHERE source = '%s'", $string);
@@ -228,7 +228,7 @@ function locale_supported_languages($reset = FALSE, $getall = FALSE) {
$result = db_query('SELECT locale, name, formula, enabled FROM {locales_meta} ORDER BY isdefault DESC, enabled DESC, name ASC');
while ($row = db_fetch_object($result)) {
$all['name'][$row->locale] = $row->name;
- $all['formula'][$row->locale] = $row->formula;
+ $all['formula'][$row->locale] = $row->formula;
if ($row->enabled) {
$enabled['name'][$row->locale] = $row->name;
$enabled['formula'][$row->locale] = $row->formula;
@@ -292,7 +292,7 @@ function locale_admin_manage() {
}
}
break;
-
+
// Remove existing language
case t('Delete'):
$languages = locale_supported_languages(FALSE, TRUE);
@@ -313,13 +313,13 @@ function locale_admin_manage() {
function locale_admin_manage_delete_screen() {
include_once 'includes/locale.inc';
$langcode = arg(4);
-
+
// Do not allow deletion of English locale
if ($langcode == 'en') {
drupal_goto('admin/locale/language/overview');
return;
}
-
+
// For other locales, warn user that data loss is ahead
$form = form_hidden('langcode', $langcode);
$form .= form_submit(t('Delete'));
@@ -340,7 +340,7 @@ function locale_admin_manage_add() {
// Try to add new language
case t('Add language'):
// Check for duplicates
- if (db_num_rows(db_query("SELECT locale FROM {locales_meta} WHERE locale = '%s'", $edit['langcode'])) == 0) {
+ if (db_num_rows(db_query("SELECT locale FROM {locales_meta} WHERE locale = '%s'", $edit['langcode'])) == 0) {
// Set language name from the available list if needed
if ($edit['langcode'] && !$edit['langname'] && isset($isocodes[$edit['langcode']])) {
@@ -376,14 +376,14 @@ function locale_admin_import() {
$edit = &$_POST['edit'];
switch ($_POST['op']) {
case t('Import'):
-
+
// Add language, if not yet supported
$languages = locale_supported_languages(TRUE, TRUE);
if (!isset($languages['name'][$edit['langcode']])) {
$isocodes = _locale_get_iso639_list();
_locale_add_language($edit['langcode'], $isocodes[$edit['langcode']][0], FALSE);
}
-
+
// Now import strings into the language
$file = file_check_upload('file');
if ($ret = _locale_import_po($file->path, $edit['langcode'], $edit['mode']) == FALSE) {
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 7b13b5f8d..ae6c407bd 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -13,7 +13,7 @@
// ---------------------------------------------------------------------------------
// Hook implementations (needed on all page loads)
-
+
/**
* Implementation of hook_help().
*/
@@ -27,12 +27,12 @@ function locale_help($section = "admin/help#locale") {
case 'admin/locale/language/add':
return t("<p>You need to add all languages you would like to provide the site interface in. If you can't find the desired language in the quick add dropdown, then need to provide the proper language code yourself. The language code might be used to negotiate with browsers and present flags, so it is important to pick one that is standardised for the desired language. You can also add languages by <a href=\"%import\">importing translations</a> directly into a language not yet set up.</p>", array("%import" => url("admin/locale/language/import")));
case 'admin/locale/language/import':
- return t("<p>This page allows you to import a translation provided in the gettext Portable Object (.po) format. The easiest way to get your site translated is to grab an existing Drupal translation and to import it. You can obtain translations from the <a href=\"%url\">Drupal localization page</a>.</p>", array('%url' => 'http://drupal.org/localization'));
+ return t("<p>This page allows you to import a translation provided in the gettext Portable Object (.po) format. The easiest way to get your site translated is to grab an existing Drupal translation and to import it. You can obtain translations from the <a href=\"%url\">Drupal localization page</a>.</p>", array('%url' => 'http://drupal.org/localization'));
case 'admin/locale/language/export':
return t("<p>This page allows you to export Drupal strings. The first option is to export a translation so it can be shared. The second option is to generate a translation template, which contains all Drupal strings, but without their translations. You can use this template to start a new translation using a specialized desktop application.</p>");
case 'admin/locale/string/search':
return t("<p>It is often more convinient to get the strings of your setup on the <a href=\"%export\">export page</a>, and start with a desktop Gettext translation editor though. Here you can search in the translated and untranslated strings, and the default English texts provided by Drupal.</p>", array("%export" => url("admin/locale/language/export")));
-
+
case 'admin/help#locale':
return t("
<p>Most programs are written and documented in English, and primarily use English to interact with users. This is also true for a great deal of web sites. However, most people are less comfortable with English than with their native language, and would prefer to use their mother tongue as much as possible. Many people love to see their web site showing a lot less English, and far more of their own language. Therefore Drupal provides a framework to setup a multi-lingual web site, or to overwrite the default English texts.</p>
@@ -40,7 +40,7 @@ function locale_help($section = "admin/help#locale") {
<p>Whenever Drupal encounters an interface string which needs to be displayed, it tries to translate it into the currently selected language. If a translation is not available, then the string is remembered, so you can look up untranslated strings easily.</p>
<p>Drupal provides two options to translate these strings. First is the integrated web interface, where you can search for untranslated strings, and specify their translations via simple web forms. An easier, and much less time consuming method is to import translations already done for your language. This is achieved by the use of GNU gettext Portable Object files. These are editable with quite convinient desktop editors specifically architected for supporting your work with GNU Gettext files. The import feature allows you to add strings from such files into the site database. The export functionality enables you to share your translations with others, generating Portable Object files from your site strings.");
break;
-
+
// TODO: integrate a rewritten version of this help into the big help screen above
/*
"<p>To translate strings start at the <a href=\"%search\">search</a> page of the locale section in the administration pages. There you will see a list of the languages you have configured. Choose the appropriate settings and search for the strings you want to translate.</p>
@@ -57,7 +57,7 @@ function locale_help($section = "admin/help#locale") {
<p>Once you got the appropriate PO file, all you have to do is to add the locale and upload it from the <a href=\"%addlocale\">manage locale</a> screen.</p>
<p>Note that uploading and parsing the uploaded file can take quite some time, depending on the connection to the server and the server's power.</p>
", array("%search" => url("admin/locale/string/search"), "%addlocale" => url("admin/locale/languages/add"), "%translations" => 'http://www.Drupal.org/translations/', "%handbook" => 'http://www.Drupal.org/handbook/po-files', "%gettext" => 'http://www.gnu.org/software/gettext/gettext.html'));*/
- }
+ }
}
/**
@@ -71,14 +71,14 @@ function locale_menu() {
// Main admin menu item
$items[] = array('path' => 'admin/locale', 'title' => t('localization'),
'callback' => 'locale_admin_manage', 'access' => $access);
-
+
// Top level tabs
$items[] = array('path' => 'admin/locale/language', 'title' => t('manage languages'),
'access' => $access, 'weight' => -10, 'type' => MENU_DEFAULT_LOCAL_TASK);
$items[] = array('path' => 'admin/locale/string/search', 'title' => t('manage strings'),
'callback' => 'locale_admin_string', 'access' => $access, 'weight' => 10,
'type' => MENU_LOCAL_TASK);
-
+
// Manage languages subtabs
$items[] = array('path' => 'admin/locale/language/overview', 'title' => t('list'),
'callback' => 'locale_admin_manage', 'access' => $access, "weight" => 0,
@@ -92,12 +92,12 @@ function locale_menu() {
$items[] = array('path' => 'admin/locale/language/export', 'title' => t('export'),
'callback' => 'locale_admin_export', 'access' => $access, 'weight' => 20,
'type' => MENU_LOCAL_TASK);
-
+
// Language related callbacks
$items[] = array('path' => 'admin/locale/language/delete', 'title' => t('confirm'),
'callback' => 'locale_admin_manage_delete_screen', 'access' => $access,
'type' => MENU_CALLBACK);
-
+
// String related callbacks
$items[] = array('path' => 'admin/locale/string/edit', 'title' => t('edit'),
'callback' => 'locale_admin_string', 'access' => $access, 'type' => MENU_CALLBACK);
@@ -128,7 +128,7 @@ function locale_user($type, $edit, &$user, $category = NULL) {
// ---------------------------------------------------------------------------------
// Locale core functionality (needed on all page loads)
-
+
/**
* Provides interface translation services
*
@@ -154,7 +154,7 @@ function locale($string) {
if (isset($locale_t[$string])) {
$string = ($locale_t[$string] === TRUE ? $string : $locale_t[$string]);
}
-
+
// We don't have this translation cached, so get it from the DB
else {
$result = db_query("SELECT s.lid, t.translation FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid WHERE s.source = '%s' AND t.locale = '%s'", $string, $locale);
@@ -165,7 +165,7 @@ function locale($string) {
$string = $trans->translation;
}
}
-
+
// Either we have no such source string, or no translation
else {
$result = db_query("SELECT lid, source FROM {locales_source} WHERE source = '%s'", $string);
@@ -228,7 +228,7 @@ function locale_supported_languages($reset = FALSE, $getall = FALSE) {
$result = db_query('SELECT locale, name, formula, enabled FROM {locales_meta} ORDER BY isdefault DESC, enabled DESC, name ASC');
while ($row = db_fetch_object($result)) {
$all['name'][$row->locale] = $row->name;
- $all['formula'][$row->locale] = $row->formula;
+ $all['formula'][$row->locale] = $row->formula;
if ($row->enabled) {
$enabled['name'][$row->locale] = $row->name;
$enabled['formula'][$row->locale] = $row->formula;
@@ -292,7 +292,7 @@ function locale_admin_manage() {
}
}
break;
-
+
// Remove existing language
case t('Delete'):
$languages = locale_supported_languages(FALSE, TRUE);
@@ -313,13 +313,13 @@ function locale_admin_manage() {
function locale_admin_manage_delete_screen() {
include_once 'includes/locale.inc';
$langcode = arg(4);
-
+
// Do not allow deletion of English locale
if ($langcode == 'en') {
drupal_goto('admin/locale/language/overview');
return;
}
-
+
// For other locales, warn user that data loss is ahead
$form = form_hidden('langcode', $langcode);
$form .= form_submit(t('Delete'));
@@ -340,7 +340,7 @@ function locale_admin_manage_add() {
// Try to add new language
case t('Add language'):
// Check for duplicates
- if (db_num_rows(db_query("SELECT locale FROM {locales_meta} WHERE locale = '%s'", $edit['langcode'])) == 0) {
+ if (db_num_rows(db_query("SELECT locale FROM {locales_meta} WHERE locale = '%s'", $edit['langcode'])) == 0) {
// Set language name from the available list if needed
if ($edit['langcode'] && !$edit['langname'] && isset($isocodes[$edit['langcode']])) {
@@ -376,14 +376,14 @@ function locale_admin_import() {
$edit = &$_POST['edit'];
switch ($_POST['op']) {
case t('Import'):
-
+
// Add language, if not yet supported
$languages = locale_supported_languages(TRUE, TRUE);
if (!isset($languages['name'][$edit['langcode']])) {
$isocodes = _locale_get_iso639_list();
_locale_add_language($edit['langcode'], $isocodes[$edit['langcode']][0], FALSE);
}
-
+
// Now import strings into the language
$file = file_check_upload('file');
if ($ret = _locale_import_po($file->path, $edit['langcode'], $edit['mode']) == FALSE) {
diff --git a/modules/system.module b/modules/system.module
index fc88e79da..528f3e9be 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -11,7 +11,13 @@ function system_help($section) {
case 'admin/settings':
return t('General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.');
case 'admin/themes':
- return t('Select which themes are available to your users and specify the default theme.');
+ case 'admin/themes/select':
+ return t('Choose a look and feel for your site.');
+ case 'admin/themes/settings':
+ return t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.');
+ case 'admin/themes/settings/' . arg(3) . '/' . arg(4):
+ return t('These options control the display settings for the <code>%template/%style</code> theme. When your site is displayed using this as your theme, these settings will be used. By reverting to defaults you can choose to use the settings defined in the site wide display configuration screen.', array('%template' => arg(3), '%style' => arg(4)));
+
case 'admin/modules':
return t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. Click on the name of the module in the navigation menu for their individual configuration pages. Once a module is enabled, new <a href=\"%permissions\">permissions</a> might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by checking throttle. The auto-throttle functionality must be enabled on the <a href=\"%throttle\">throttle configuration page</a> after having enabled the throttle module.", array('%permissions' => url('admin/user/configure/permission'), '%throttle' => url('admin/settings/throttle')));
case 'admin/help#system':
@@ -57,24 +63,29 @@ function system_menu() {
'type' => MENU_CALLBACK);
$access = user_access('administer site configuration');
- // Themes:
+
+ // Templates:
$items[] = array('path' => 'admin/themes', 'title' => t('themes'),
'callback' => 'system_themes', 'access' => $access);
- foreach (list_themes() as $theme) {
- // TODO: reenable 'forced refresh' once we move the menu_build() later
- // in the request. It added overhead with no benefit.
- // NOTE: refresh the list because some themes might have been enabled/disabled.
- include_once $theme->filename;
- $function = $theme->name .'_settings';
- if (function_exists($function)) {
- $items[] = array('path' => 'admin/themes/'. $theme->name, 'title' => $theme->name,
- 'callback' => 'system_configure_theme', 'access' => $access);
- }
+
+ $items[] = array('path' => 'admin/themes/select', 'title' => t('select'),
+ 'callback' => 'system_themes', 'access' => $access,
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -1);
+
+ $items[] = array('path' => 'admin/themes/settings', 'title' => t('configure'),
+ 'callback' => 'system_theme_settings', 'access' => $access,
+ 'type' => MENU_LOCAL_TASK);
+
+ foreach (list_themes() as $style) {
+ $items[] = array('path' => 'admin/themes/settings/'. $style->name, 'title' => t($style->description), 'callback' => 'system_theme_settings', 'type' => MENU_CALLBACK);
}
// Modules:
$items[] = array('path' => 'admin/settings', 'title' => t('settings'),
'callback' => 'system_site_settings', 'access' => $access);
+
+
+
foreach (module_list() as $name) {
// TODO: reenable 'forced refresh' once we move the menu_build() later
// in the request. It added overhead with no benefit.
@@ -99,7 +110,7 @@ function system_user($type, $edit, &$user, $category = NULL) {
$options = '<option value="">'. t('Default theme') ."</option>\n";
if (count($themes = list_themes()) > 1) {
foreach ($themes as $key => $value) {
- $options .= "<option value=\"$key\"". (($edit['theme'] == $key) ? ' selected="selected"' : '') .">$key - $value->description</option>\n";
+ $options .= "<option value=\"$key\"". (($edit['theme'] == $key) ? ' selected="selected"' : '') .">$key</option>\n";
}
$data[] = array('title' => t('Theme settings'), 'data' => form_item(t('Theme'), "<select name=\"edit[theme]\">$options</select>", t('Selecting a different theme will change the look and feel of the site.')), 'weight' => 2);
}
@@ -203,19 +214,9 @@ function system_view_general() {
return $output;
}
-function system_listing($type) {
- // Pick appropriate directory and filetype
- switch ($type) {
- case 'modules':
- $directory = 'modules';
- $type = 'module';
- break;
- case 'themes':
- default:
- $directory = 'themes';
- $type = 'theme';
- break;
- }
+function system_module_listing() {
+ $directory = 'modules';
+ $type = 'module';
// Find files in the directory.
$files = file_scan_directory($directory, "\.$type$");
@@ -276,12 +277,7 @@ function system_listing($type) {
db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $info->name, $info->description, $type, $filename, $file->status, $file->throttle, $bootstrap);
$row = array($info->name, $info->description, array('data' => (in_array($filename, $required) ? form_hidden("status][$filename", 1) . t('required') : form_checkbox('', "status][$filename", 1, $file->status)), 'align' => 'center'));
- if ($type == 'module') {
- $row[] = array('data' => (in_array($filename, $throttle_required) ? form_hidden("throttle][$filename", 0) . t('required') : form_checkbox(NULL, "throttle][$filename", 1, $file->throttle, NULL, module_exist('throttle') ? NULL : array('disabled' => 'disabled'))), 'align' => 'center');
- }
- else if ($type == 'theme') {
- $row[] = array('data' => form_radio('', 'theme_default', $info->name, (variable_get('theme_default', 0) == $info->name) ? 1 : 0), 'align' => 'center');
- }
+ $row[] = array('data' => (in_array($filename, $throttle_required) ? form_hidden("throttle][$filename", 0) . t('required') : form_checkbox(NULL, "throttle][$filename", 1, $file->throttle, NULL, module_exist('throttle') ? NULL : array('disabled' => 'disabled'))), 'align' => 'center');
$rows[] = $row;
}
@@ -291,6 +287,145 @@ function system_listing($type) {
return $output;
}
+
+/**
+ * Generate a list of all the available template/style combinations, aswell as update the system list
+ */
+function system_theme_listing() {
+ $templates = file_scan_directory('templates', 'template.php$');
+
+ // Extract current files from database.
+ $result = db_query("SELECT filename, type, status, throttle FROM {system} WHERE type = 'style'");
+ while ($file = db_fetch_object($result)) {
+ foreach ($file as $key => $value) {
+ $files[$file->filename]->$key = $value;
+ }
+ }
+
+ foreach (array_keys($templates) as $template) {
+ $styles = file_scan_directory(dirname($template), 'style.css$');
+ foreach ($styles as $style) {
+ $info = parse_theme_path($style->filename);
+
+ // Force default to be enabled
+ if (variable_get('theme_default', 'chameleon/default') == $info['key']) {
+ $info["status"] = 1;
+ }
+ else {
+ $info['status'] = $files[$info['style_file']]->status;
+ }
+ $themes[$info["key"]] = $info;
+ // Update the contents of the system table:
+
+ db_query("DELETE FROM {system} WHERE filename = '%s' AND type = 'style'", $info['style_file']);
+ db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', 'style', '%s', %d, 0, 0)", $info['key'], $info['name'], $info['style_file'], $info['status']);
+ }
+ }
+ ksort($themes);
+
+ foreach ($themes as $key => $info) {
+ $row = array();
+
+ /**
+ * Screenshot column.
+ */
+ $row[] = file_exists($info['screenshot']) ? theme('image', $info['screenshot'], 'Screenshot for ' . $info['name'] . ' theme') : t('no screenshot');
+
+ /**
+ * Information field.
+ */
+ $fields = array();
+ $fields[] = '<h2>' . ucfirst($info['name']) . '</h2>';
+ $fields[] = $info['key'];
+ $row[] = implode('<br />', $fields);
+
+
+ $row[] = array('data' => form_checkbox('', "status][" . $info['style_file'], 1, $info['status']), 'align' => 'center') ;
+ $row[] = array('data' => form_radio('', 'theme_default', $key, (variable_get('theme_default', 'chameleon/default') == $key) ? 1 : 0), 'align' => 'center');
+ $row[] = array('data' => l('configure', "admin/themes/settings/$key"), 'align' => 'center');
+ $rows[] = $row;
+ }
+
+ $header = array('screenshot', 'information', 'enabled', 'default', 'operations');
+ $output = form_hidden("type", "theme");
+ $output .= theme('table', $header, $rows);
+ return $output;
+}
+
+/**
+ * Display configuration for the entire site, and individual themes.
+ */
+function system_theme_settings() {
+ system_settings_save();
+ /**
+ * Default settings are defined in _theme_settings() in includes/theme.inc
+ */
+ $key = (arg(3) && arg(4)) ? arg(3) . "/" . arg(4) : null;
+ if ($key) {
+ $info = _theme_info($key);
+ $var = 'theme_' . arg(3) . '_' . arg(4) . '_settings';
+ }
+ else {
+ $info['settings'] = _theme_settings();
+ $var = 'theme_settings';
+ }
+
+ /**
+ * Logo settings
+ */
+ $group = form_checkbox('Use the default logo', "$var][default_logo", 1, $info['settings']['default_logo'], t('Check here if you want the theme to use the logo supplied with it.'));
+ $group .= form_textfield('Path to custom logo', "$var][logo_path", $info['settings']['logo_path'], 50, 60, t('The path to the file you would like to use as your logo file instead of the default logo.'));
+ $form .= form_group('Logo image settings', $group);
+
+ /**
+ * System wide only settings.
+ */
+ if (!$key) {
+ /**
+ * Menu settings
+ */
+ $group = form_textarea(t('Primary links'), "$var][primary_links", $info['settings']['primary_links'], 70, 8, t('The HTML code for the primary links. If this field is empty, Drupal will automatically generate a set of links based on which modules are enabled.'));
+ $group .= form_textarea(t('Secondary links'), "$var][secondary_links", $info['settings']['secondary_links'], 70, 8, t('The HTML code for the secondary links.'));
+ $form .= form_group('Menu Settings', $group, 'Customize the menus that are displayed at the top and/or bottom of the page. This configuration screen is only available in the site wide display configuration.');
+
+ /**
+ * Toggle node display.
+ */
+ $group = '';
+ foreach (node_list() as $type) {
+ $group .= form_checkbox($type, "$var][toggle_node_info_$type", 1, $info['settings']['toggle_node_info_$type']);
+ }
+ $form .= form_group('Display post information on', $group, 'Enable or disable the "submitted by Username on date" text when displaying posts of the above type');
+
+ }
+ /**
+ * Toggle settings
+ */
+ $group = form_checkbox('Logo image', "$var][toggle_logo", 1, $info['settings']['toggle_logo']);
+ $group .= form_checkbox('Site name', "$var][toggle_name", 1, $info['settings']['toggle_name']);
+ $group .= form_checkbox('Search box', "$var][toggle_search", 1, $info['settings']['toggle_search']);
+ $group .= form_checkbox('Site slogan', "$var][toggle_slogan", 1, $info['settings']['toggle_slogan']);
+ $group .= form_checkbox('Site mission', "$var][toggle_mission", 1, $info['settings']['toggle_mission']);
+ $group .= form_checkbox('Primary links', "$var][toggle_primary_links", 1, $info['settings']['toggle_primary_links']);
+ $group .= form_checkbox('Secondary links', "$var][toggle_secondary_links", 1, $info['settings']['toggle_secondary_links']);
+ $group .= form_checkbox('User pictures in nodes', "$var][toggle_node_user_picture", 1, $info['settings']['toggle_node_user_picture']);
+ $group .= form_checkbox('User pictures in comments', "$var][toggle_comment_user_picture", 1, $info['settings']['toggle_comment_user_picture']);
+ $form .= form_group('Toggle display', $group, 'Enable or disable the display of certain page elements.');
+
+ /**
+ * Template specific settings
+ */
+ if ($key && file_exists($info['template_dir'] . '/settings.php')) {
+ include_once($info['template_dir'] . '/settings.php');
+ if (function_exists('template_settings')) {
+ $group = template_settings($var);
+ $form .= form_group('Template specific settings', $group, t('These settings only exist for the %template template, and all the styles based on it.', array('%template' => $info['template'])));
+ }
+ }
+
+ print theme('page', system_settings_form($form));
+}
+
function system_listing_save($edit = array()) {
$op = $_POST['op'];
$edit = $_POST['edit'];
@@ -342,12 +477,13 @@ function system_settings_save() {
drupal_goto($_GET['q']);
}
+
/**
* Menu callback; displays a listing of all themes.
*/
function system_themes() {
system_listing_save();
- $form = system_listing('themes');
+ $form = system_theme_listing();
$form .= form_submit(t('Save configuration'));
print theme('page', form($form));
}
@@ -357,34 +493,12 @@ function system_themes() {
*/
function system_modules() {
system_listing_save();
- $form = system_listing('modules');
+ $form = system_module_listing();
$form .= form_submit(t('Save configuration'));
print theme('page', form($form));
}
/**
- * Menu callback; displays a theme's settings page.
- */
-function system_configure_theme() {
- system_settings_save();
-
- $name = arg(2);
- $themes = list_themes();
- $theme = $themes[$name];
-
- if ($theme) {
- include_once "$theme->filename";
-
- $function = $theme->name .'_settings';
- if (function_exists($function)) {
- $form .= $function();
- }
- }
-
- print theme('page', system_settings_form($form));
-}
-
-/**
* Menu callback; displays a module's settings page.
*/
function system_site_settings($module = NULL) {
diff --git a/modules/system/system.module b/modules/system/system.module
index fc88e79da..528f3e9be 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -11,7 +11,13 @@ function system_help($section) {
case 'admin/settings':
return t('General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.');
case 'admin/themes':
- return t('Select which themes are available to your users and specify the default theme.');
+ case 'admin/themes/select':
+ return t('Choose a look and feel for your site.');
+ case 'admin/themes/settings':
+ return t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.');
+ case 'admin/themes/settings/' . arg(3) . '/' . arg(4):
+ return t('These options control the display settings for the <code>%template/%style</code> theme. When your site is displayed using this as your theme, these settings will be used. By reverting to defaults you can choose to use the settings defined in the site wide display configuration screen.', array('%template' => arg(3), '%style' => arg(4)));
+
case 'admin/modules':
return t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. Click on the name of the module in the navigation menu for their individual configuration pages. Once a module is enabled, new <a href=\"%permissions\">permissions</a> might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by checking throttle. The auto-throttle functionality must be enabled on the <a href=\"%throttle\">throttle configuration page</a> after having enabled the throttle module.", array('%permissions' => url('admin/user/configure/permission'), '%throttle' => url('admin/settings/throttle')));
case 'admin/help#system':
@@ -57,24 +63,29 @@ function system_menu() {
'type' => MENU_CALLBACK);
$access = user_access('administer site configuration');
- // Themes:
+
+ // Templates:
$items[] = array('path' => 'admin/themes', 'title' => t('themes'),
'callback' => 'system_themes', 'access' => $access);
- foreach (list_themes() as $theme) {
- // TODO: reenable 'forced refresh' once we move the menu_build() later
- // in the request. It added overhead with no benefit.
- // NOTE: refresh the list because some themes might have been enabled/disabled.
- include_once $theme->filename;
- $function = $theme->name .'_settings';
- if (function_exists($function)) {
- $items[] = array('path' => 'admin/themes/'. $theme->name, 'title' => $theme->name,
- 'callback' => 'system_configure_theme', 'access' => $access);
- }
+
+ $items[] = array('path' => 'admin/themes/select', 'title' => t('select'),
+ 'callback' => 'system_themes', 'access' => $access,
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -1);
+
+ $items[] = array('path' => 'admin/themes/settings', 'title' => t('configure'),
+ 'callback' => 'system_theme_settings', 'access' => $access,
+ 'type' => MENU_LOCAL_TASK);
+
+ foreach (list_themes() as $style) {
+ $items[] = array('path' => 'admin/themes/settings/'. $style->name, 'title' => t($style->description), 'callback' => 'system_theme_settings', 'type' => MENU_CALLBACK);
}
// Modules:
$items[] = array('path' => 'admin/settings', 'title' => t('settings'),
'callback' => 'system_site_settings', 'access' => $access);
+
+
+
foreach (module_list() as $name) {
// TODO: reenable 'forced refresh' once we move the menu_build() later
// in the request. It added overhead with no benefit.
@@ -99,7 +110,7 @@ function system_user($type, $edit, &$user, $category = NULL) {
$options = '<option value="">'. t('Default theme') ."</option>\n";
if (count($themes = list_themes()) > 1) {
foreach ($themes as $key => $value) {
- $options .= "<option value=\"$key\"". (($edit['theme'] == $key) ? ' selected="selected"' : '') .">$key - $value->description</option>\n";
+ $options .= "<option value=\"$key\"". (($edit['theme'] == $key) ? ' selected="selected"' : '') .">$key</option>\n";
}
$data[] = array('title' => t('Theme settings'), 'data' => form_item(t('Theme'), "<select name=\"edit[theme]\">$options</select>", t('Selecting a different theme will change the look and feel of the site.')), 'weight' => 2);
}
@@ -203,19 +214,9 @@ function system_view_general() {
return $output;
}
-function system_listing($type) {
- // Pick appropriate directory and filetype
- switch ($type) {
- case 'modules':
- $directory = 'modules';
- $type = 'module';
- break;
- case 'themes':
- default:
- $directory = 'themes';
- $type = 'theme';
- break;
- }
+function system_module_listing() {
+ $directory = 'modules';
+ $type = 'module';
// Find files in the directory.
$files = file_scan_directory($directory, "\.$type$");
@@ -276,12 +277,7 @@ function system_listing($type) {
db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $info->name, $info->description, $type, $filename, $file->status, $file->throttle, $bootstrap);
$row = array($info->name, $info->description, array('data' => (in_array($filename, $required) ? form_hidden("status][$filename", 1) . t('required') : form_checkbox('', "status][$filename", 1, $file->status)), 'align' => 'center'));
- if ($type == 'module') {
- $row[] = array('data' => (in_array($filename, $throttle_required) ? form_hidden("throttle][$filename", 0) . t('required') : form_checkbox(NULL, "throttle][$filename", 1, $file->throttle, NULL, module_exist('throttle') ? NULL : array('disabled' => 'disabled'))), 'align' => 'center');
- }
- else if ($type == 'theme') {
- $row[] = array('data' => form_radio('', 'theme_default', $info->name, (variable_get('theme_default', 0) == $info->name) ? 1 : 0), 'align' => 'center');
- }
+ $row[] = array('data' => (in_array($filename, $throttle_required) ? form_hidden("throttle][$filename", 0) . t('required') : form_checkbox(NULL, "throttle][$filename", 1, $file->throttle, NULL, module_exist('throttle') ? NULL : array('disabled' => 'disabled'))), 'align' => 'center');
$rows[] = $row;
}
@@ -291,6 +287,145 @@ function system_listing($type) {
return $output;
}
+
+/**
+ * Generate a list of all the available template/style combinations, aswell as update the system list
+ */
+function system_theme_listing() {
+ $templates = file_scan_directory('templates', 'template.php$');
+
+ // Extract current files from database.
+ $result = db_query("SELECT filename, type, status, throttle FROM {system} WHERE type = 'style'");
+ while ($file = db_fetch_object($result)) {
+ foreach ($file as $key => $value) {
+ $files[$file->filename]->$key = $value;
+ }
+ }
+
+ foreach (array_keys($templates) as $template) {
+ $styles = file_scan_directory(dirname($template), 'style.css$');
+ foreach ($styles as $style) {
+ $info = parse_theme_path($style->filename);
+
+ // Force default to be enabled
+ if (variable_get('theme_default', 'chameleon/default') == $info['key']) {
+ $info["status"] = 1;
+ }
+ else {
+ $info['status'] = $files[$info['style_file']]->status;
+ }
+ $themes[$info["key"]] = $info;
+ // Update the contents of the system table:
+
+ db_query("DELETE FROM {system} WHERE filename = '%s' AND type = 'style'", $info['style_file']);
+ db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', 'style', '%s', %d, 0, 0)", $info['key'], $info['name'], $info['style_file'], $info['status']);
+ }
+ }
+ ksort($themes);
+
+ foreach ($themes as $key => $info) {
+ $row = array();
+
+ /**
+ * Screenshot column.
+ */
+ $row[] = file_exists($info['screenshot']) ? theme('image', $info['screenshot'], 'Screenshot for ' . $info['name'] . ' theme') : t('no screenshot');
+
+ /**
+ * Information field.
+ */
+ $fields = array();
+ $fields[] = '<h2>' . ucfirst($info['name']) . '</h2>';
+ $fields[] = $info['key'];
+ $row[] = implode('<br />', $fields);
+
+
+ $row[] = array('data' => form_checkbox('', "status][" . $info['style_file'], 1, $info['status']), 'align' => 'center') ;
+ $row[] = array('data' => form_radio('', 'theme_default', $key, (variable_get('theme_default', 'chameleon/default') == $key) ? 1 : 0), 'align' => 'center');
+ $row[] = array('data' => l('configure', "admin/themes/settings/$key"), 'align' => 'center');
+ $rows[] = $row;
+ }
+
+ $header = array('screenshot', 'information', 'enabled', 'default', 'operations');
+ $output = form_hidden("type", "theme");
+ $output .= theme('table', $header, $rows);
+ return $output;
+}
+
+/**
+ * Display configuration for the entire site, and individual themes.
+ */
+function system_theme_settings() {
+ system_settings_save();
+ /**
+ * Default settings are defined in _theme_settings() in includes/theme.inc
+ */
+ $key = (arg(3) && arg(4)) ? arg(3) . "/" . arg(4) : null;
+ if ($key) {
+ $info = _theme_info($key);
+ $var = 'theme_' . arg(3) . '_' . arg(4) . '_settings';
+ }
+ else {
+ $info['settings'] = _theme_settings();
+ $var = 'theme_settings';
+ }
+
+ /**
+ * Logo settings
+ */
+ $group = form_checkbox('Use the default logo', "$var][default_logo", 1, $info['settings']['default_logo'], t('Check here if you want the theme to use the logo supplied with it.'));
+ $group .= form_textfield('Path to custom logo', "$var][logo_path", $info['settings']['logo_path'], 50, 60, t('The path to the file you would like to use as your logo file instead of the default logo.'));
+ $form .= form_group('Logo image settings', $group);
+
+ /**
+ * System wide only settings.
+ */
+ if (!$key) {
+ /**
+ * Menu settings
+ */
+ $group = form_textarea(t('Primary links'), "$var][primary_links", $info['settings']['primary_links'], 70, 8, t('The HTML code for the primary links. If this field is empty, Drupal will automatically generate a set of links based on which modules are enabled.'));
+ $group .= form_textarea(t('Secondary links'), "$var][secondary_links", $info['settings']['secondary_links'], 70, 8, t('The HTML code for the secondary links.'));
+ $form .= form_group('Menu Settings', $group, 'Customize the menus that are displayed at the top and/or bottom of the page. This configuration screen is only available in the site wide display configuration.');
+
+ /**
+ * Toggle node display.
+ */
+ $group = '';
+ foreach (node_list() as $type) {
+ $group .= form_checkbox($type, "$var][toggle_node_info_$type", 1, $info['settings']['toggle_node_info_$type']);
+ }
+ $form .= form_group('Display post information on', $group, 'Enable or disable the "submitted by Username on date" text when displaying posts of the above type');
+
+ }
+ /**
+ * Toggle settings
+ */
+ $group = form_checkbox('Logo image', "$var][toggle_logo", 1, $info['settings']['toggle_logo']);
+ $group .= form_checkbox('Site name', "$var][toggle_name", 1, $info['settings']['toggle_name']);
+ $group .= form_checkbox('Search box', "$var][toggle_search", 1, $info['settings']['toggle_search']);
+ $group .= form_checkbox('Site slogan', "$var][toggle_slogan", 1, $info['settings']['toggle_slogan']);
+ $group .= form_checkbox('Site mission', "$var][toggle_mission", 1, $info['settings']['toggle_mission']);
+ $group .= form_checkbox('Primary links', "$var][toggle_primary_links", 1, $info['settings']['toggle_primary_links']);
+ $group .= form_checkbox('Secondary links', "$var][toggle_secondary_links", 1, $info['settings']['toggle_secondary_links']);
+ $group .= form_checkbox('User pictures in nodes', "$var][toggle_node_user_picture", 1, $info['settings']['toggle_node_user_picture']);
+ $group .= form_checkbox('User pictures in comments', "$var][toggle_comment_user_picture", 1, $info['settings']['toggle_comment_user_picture']);
+ $form .= form_group('Toggle display', $group, 'Enable or disable the display of certain page elements.');
+
+ /**
+ * Template specific settings
+ */
+ if ($key && file_exists($info['template_dir'] . '/settings.php')) {
+ include_once($info['template_dir'] . '/settings.php');
+ if (function_exists('template_settings')) {
+ $group = template_settings($var);
+ $form .= form_group('Template specific settings', $group, t('These settings only exist for the %template template, and all the styles based on it.', array('%template' => $info['template'])));
+ }
+ }
+
+ print theme('page', system_settings_form($form));
+}
+
function system_listing_save($edit = array()) {
$op = $_POST['op'];
$edit = $_POST['edit'];
@@ -342,12 +477,13 @@ function system_settings_save() {
drupal_goto($_GET['q']);
}
+
/**
* Menu callback; displays a listing of all themes.
*/
function system_themes() {
system_listing_save();
- $form = system_listing('themes');
+ $form = system_theme_listing();
$form .= form_submit(t('Save configuration'));
print theme('page', form($form));
}
@@ -357,34 +493,12 @@ function system_themes() {
*/
function system_modules() {
system_listing_save();
- $form = system_listing('modules');
+ $form = system_module_listing();
$form .= form_submit(t('Save configuration'));
print theme('page', form($form));
}
/**
- * Menu callback; displays a theme's settings page.
- */
-function system_configure_theme() {
- system_settings_save();
-
- $name = arg(2);
- $themes = list_themes();
- $theme = $themes[$name];
-
- if ($theme) {
- include_once "$theme->filename";
-
- $function = $theme->name .'_settings';
- if (function_exists($function)) {
- $form .= $function();
- }
- }
-
- print theme('page', system_settings_form($form));
-}
-
-/**
* Menu callback; displays a module's settings page.
*/
function system_site_settings($module = NULL) {
diff --git a/modules/user.module b/modules/user.module
index cc17e5b23..9ffed462f 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -207,7 +207,7 @@ function user_validate_authmap($account, $authname, $module) {
$result = db_query("SELECT COUNT(*) from {authmap} WHERE uid != %d AND authname = '%s'", $account->uid, $authname);
if (db_result($result) > 0) {
$name = module_invoke($module, 'info', 'name');
- return t('The %u ID %s is already taken.', array('%u' => $name, '%s' => "<i>$authname</i>"));
+ return t('The %u ID %s is already taken.', array('%u' => $name, '%s' => "<em>$authname</em>"));
}
}
@@ -770,7 +770,7 @@ function user_login($edit = array(), $msg = '') {
watchdog('user', t('external load by %user using module "%module".', array('%user' => $name .'@'. $server, '%module' => key($result))));
}
else {
- $error = t('Invalid password for %s.', array('%s' => "<i>$name@$server</i>"));
+ $error = t('Invalid password for %s.', array('%s' => "<em>$name@$server</em>"));
}
}
@@ -879,11 +879,11 @@ function user_pass($edit = array()) {
if ($edit['name']) {
$account = user_load(array('name' => $edit['name'], 'status' => 1));
- if (!$account) form_set_error('name', t('Sorry. The username "<i>%s</i>" is not recognized.', array('%s' => $edit['name'])));
+ if (!$account) form_set_error('name', t('Sorry. The username "<em>%s</em>" is not recognized.', array('%s' => $edit['name'])));
}
else if ($edit['mail']) {
$account = user_load(array('mail' => $edit['mail'], 'status' => 1));
- if (!$account) form_set_error('name', t('Sorry. The e-mail address "<i>%s</i>" is not recognized.', array('%s' => $edit['mail'])));
+ if (!$account) form_set_error('name', t('Sorry. The e-mail address "<em>%s</em>" is not recognized.', array('%s' => $edit['mail'])));
}
if ($account) {
@@ -1304,10 +1304,10 @@ function user_admin_access($edit = array()) {
}
else if ($op == t('Check')) {
if (user_deny($type, $edit['test'])) {
- drupal_set_message(t('<i>%test</i> is not allowed.', array('%test' => $edit['test'])));
+ drupal_set_message(t('<em>%test</em> is not allowed.', array('%test' => $edit['test'])));
}
else {
- drupal_set_message(t('<i>%test</i> is allowed.', array('%test' => $edit['test'])));
+ drupal_set_message(t('<em>%test</em> is allowed.', array('%test' => $edit['test'])));
}
}
else if ($id) {
@@ -1595,8 +1595,8 @@ function user_help($section) {
$output = t("
<h3>Distributed authentication<a id=\"da\"></a></h3>
- <p>One of the more tedious moments in visiting a new website is filling out the registration form. Here at %site, you do not have to fill out a registration form if you are already a member of %help-links. This capability is called <i>distributed authentication</i>, and is unique to <a href=\"%drupal\">Drupal</a>, the software which powers %site.</p>
- <p>Distributed authentication enables a new user to input a username and password into the login box, and immediately be recognized, even if that user never registered at %site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that new user 'Joe' is already a registered member of <a href=\"%delphi-forums\">Delphi Forums</a>. Drupal informs Joe on registration and login screens that he may login with his Delphi ID instead of registering with %site. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then contacts the <i>remote.delphiforums.com</i> server behind the scenes (usually using <a href=\"%xml\">XML-RPC</a>, <a href=\"%http-post\">HTTP POST</a>, or <a href=\"%soap\">SOAP</a>) and asks: \"Is the password for user Joe correct?\". If Delphi replies yes, then we create a new %site account for Joe and log him into it. Joe may keep on logging into %site in the same manner, and he will always be logged into the same account.</p>", array('%help-links' => (implode(', ', user_auth_help_links())), '%site' => "<i>$site</i>", '%drupal' => 'http://www.drupal.org', '%delphi-forums' => 'http://www.delphiforums.com', '%xml' => 'http://www.xmlrpc.com', '%http-post' => 'http://www.w3.org/Protocols/', '%soap' => 'http://www.soapware.org'));
+ <p>One of the more tedious moments in visiting a new website is filling out the registration form. Here at %site, you do not have to fill out a registration form if you are already a member of %help-links. This capability is called <em>distributed authentication</em>, and is unique to <a href=\"%drupal\">Drupal</a>, the software which powers %site.</p>
+ <p>Distributed authentication enables a new user to input a username and password into the login box, and immediately be recognized, even if that user never registered at %site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that new user 'Joe' is already a registered member of <a href=\"%delphi-forums\">Delphi Forums</a>. Drupal informs Joe on registration and login screens that he may login with his Delphi ID instead of registering with %site. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then contacts the <em>remote.delphiforums.com</em> server behind the scenes (usually using <a href=\"%xml\">XML-RPC</a>, <a href=\"%http-post\">HTTP POST</a>, or <a href=\"%soap\">SOAP</a>) and asks: \"Is the password for user Joe correct?\". If Delphi replies yes, then we create a new %site account for Joe and log him into it. Joe may keep on logging into %site in the same manner, and he will always be logged into the same account.</p>", array('%help-links' => (implode(', ', user_auth_help_links())), '%site' => "<em>$site</em>", '%drupal' => 'http://www.drupal.org', '%delphi-forums' => 'http://www.delphiforums.com', '%xml' => 'http://www.xmlrpc.com', '%http-post' => 'http://www.w3.org/Protocols/', '%soap' => 'http://www.soapware.org'));
foreach (module_list() as $module) {
if (module_hook($module, 'auth')) {
diff --git a/modules/user/user.module b/modules/user/user.module
index cc17e5b23..9ffed462f 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -207,7 +207,7 @@ function user_validate_authmap($account, $authname, $module) {
$result = db_query("SELECT COUNT(*) from {authmap} WHERE uid != %d AND authname = '%s'", $account->uid, $authname);
if (db_result($result) > 0) {
$name = module_invoke($module, 'info', 'name');
- return t('The %u ID %s is already taken.', array('%u' => $name, '%s' => "<i>$authname</i>"));
+ return t('The %u ID %s is already taken.', array('%u' => $name, '%s' => "<em>$authname</em>"));
}
}
@@ -770,7 +770,7 @@ function user_login($edit = array(), $msg = '') {
watchdog('user', t('external load by %user using module "%module".', array('%user' => $name .'@'. $server, '%module' => key($result))));
}
else {
- $error = t('Invalid password for %s.', array('%s' => "<i>$name@$server</i>"));
+ $error = t('Invalid password for %s.', array('%s' => "<em>$name@$server</em>"));
}
}
@@ -879,11 +879,11 @@ function user_pass($edit = array()) {
if ($edit['name']) {
$account = user_load(array('name' => $edit['name'], 'status' => 1));
- if (!$account) form_set_error('name', t('Sorry. The username "<i>%s</i>" is not recognized.', array('%s' => $edit['name'])));
+ if (!$account) form_set_error('name', t('Sorry. The username "<em>%s</em>" is not recognized.', array('%s' => $edit['name'])));
}
else if ($edit['mail']) {
$account = user_load(array('mail' => $edit['mail'], 'status' => 1));
- if (!$account) form_set_error('name', t('Sorry. The e-mail address "<i>%s</i>" is not recognized.', array('%s' => $edit['mail'])));
+ if (!$account) form_set_error('name', t('Sorry. The e-mail address "<em>%s</em>" is not recognized.', array('%s' => $edit['mail'])));
}
if ($account) {
@@ -1304,10 +1304,10 @@ function user_admin_access($edit = array()) {
}
else if ($op == t('Check')) {
if (user_deny($type, $edit['test'])) {
- drupal_set_message(t('<i>%test</i> is not allowed.', array('%test' => $edit['test'])));
+ drupal_set_message(t('<em>%test</em> is not allowed.', array('%test' => $edit['test'])));
}
else {
- drupal_set_message(t('<i>%test</i> is allowed.', array('%test' => $edit['test'])));
+ drupal_set_message(t('<em>%test</em> is allowed.', array('%test' => $edit['test'])));
}
}
else if ($id) {
@@ -1595,8 +1595,8 @@ function user_help($section) {
$output = t("
<h3>Distributed authentication<a id=\"da\"></a></h3>
- <p>One of the more tedious moments in visiting a new website is filling out the registration form. Here at %site, you do not have to fill out a registration form if you are already a member of %help-links. This capability is called <i>distributed authentication</i>, and is unique to <a href=\"%drupal\">Drupal</a>, the software which powers %site.</p>
- <p>Distributed authentication enables a new user to input a username and password into the login box, and immediately be recognized, even if that user never registered at %site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that new user 'Joe' is already a registered member of <a href=\"%delphi-forums\">Delphi Forums</a>. Drupal informs Joe on registration and login screens that he may login with his Delphi ID instead of registering with %site. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then contacts the <i>remote.delphiforums.com</i> server behind the scenes (usually using <a href=\"%xml\">XML-RPC</a>, <a href=\"%http-post\">HTTP POST</a>, or <a href=\"%soap\">SOAP</a>) and asks: \"Is the password for user Joe correct?\". If Delphi replies yes, then we create a new %site account for Joe and log him into it. Joe may keep on logging into %site in the same manner, and he will always be logged into the same account.</p>", array('%help-links' => (implode(', ', user_auth_help_links())), '%site' => "<i>$site</i>", '%drupal' => 'http://www.drupal.org', '%delphi-forums' => 'http://www.delphiforums.com', '%xml' => 'http://www.xmlrpc.com', '%http-post' => 'http://www.w3.org/Protocols/', '%soap' => 'http://www.soapware.org'));
+ <p>One of the more tedious moments in visiting a new website is filling out the registration form. Here at %site, you do not have to fill out a registration form if you are already a member of %help-links. This capability is called <em>distributed authentication</em>, and is unique to <a href=\"%drupal\">Drupal</a>, the software which powers %site.</p>
+ <p>Distributed authentication enables a new user to input a username and password into the login box, and immediately be recognized, even if that user never registered at %site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that new user 'Joe' is already a registered member of <a href=\"%delphi-forums\">Delphi Forums</a>. Drupal informs Joe on registration and login screens that he may login with his Delphi ID instead of registering with %site. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then contacts the <em>remote.delphiforums.com</em> server behind the scenes (usually using <a href=\"%xml\">XML-RPC</a>, <a href=\"%http-post\">HTTP POST</a>, or <a href=\"%soap\">SOAP</a>) and asks: \"Is the password for user Joe correct?\". If Delphi replies yes, then we create a new %site account for Joe and log him into it. Joe may keep on logging into %site in the same manner, and he will always be logged into the same account.</p>", array('%help-links' => (implode(', ', user_auth_help_links())), '%site' => "<em>$site</em>", '%drupal' => 'http://www.drupal.org', '%delphi-forums' => 'http://www.delphiforums.com', '%xml' => 'http://www.xmlrpc.com', '%http-post' => 'http://www.w3.org/Protocols/', '%soap' => 'http://www.soapware.org'));
foreach (module_list() as $module) {
if (module_hook($module, 'auth')) {
diff --git a/xmlrpc.php b/xmlrpc.php
index a9fd0c9d7..7b52d5166 100644
--- a/xmlrpc.php
+++ b/xmlrpc.php
@@ -1,12 +1,12 @@
<?php
// $Id$
-include_once "includes/bootstrap.inc";
-include_once "includes/common.inc";
+include_once 'includes/bootstrap.inc';
+include_once 'includes/common.inc';
include_once 'includes/xmlrpc.inc';
-include_once "includes/xmlrpcs.inc";
+include_once 'includes/xmlrpcs.inc';
-$functions = module_invoke_all("xmlrpc");
+$functions = module_invoke_all('xmlrpc');
$server = new xmlrpc_server($functions);