From 93d5c805f9a3f4549f4fcaf9d4a01398874935bc Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 7 May 2005 20:41:54 +0000 Subject: [PATCH] r92: Added option to export phrase to a PHP format. --- docs/phrasetools.php | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/docs/phrasetools.php b/docs/phrasetools.php index 03b87b5..57d90a0 100644 --- a/docs/phrasetools.php +++ b/docs/phrasetools.php @@ -50,7 +50,7 @@ function sanitize_name($name) // ################################################################### echo <<Search +

Search | Export

Varname:
@@ -192,6 +192,39 @@ if ($_REQUEST['do'] == 'search') } } +// ################################################################### + +if ($_REQUEST['do'] == 'export') +{ + $output = "// Language configuration variables +\$cfg = array( + 'title' => 'English (US)', + 'languagecode' => 'en', + 'charset' => 'ISO-8859-1', + 'direction' => 'ltr' +); + +// Phrase text +\$language = array("; + + $phrases = $db->query("SELECT * FROM " . TABLE_PREFIX . "phrase ORDER BY varname"); + while ($phrase = $db->fetch_array($phrases)) + { + $phrasebits[] = "\n\t'$phrase[varname]' => '$phrase[phrasetext]'"; + } + + $output .= implode(',', $phrasebits); + + $output .= " +);"; + + $output = $bugsys->sanitize($output); + + echo <<$output +HTML; +} + ?> -- 2.43.5