aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LocalFilesEditor/include/lang.inc.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2011-04-13 10:38:45 +0000
committerpatdenice <patdenice@piwigo.org>2011-04-13 10:38:45 +0000
commit7211eee1caba1b1d798449b6df6def86c50552ef (patch)
treee56f5030267867ab82aa4328eb9f5cc42d3429b5 /plugins/LocalFilesEditor/include/lang.inc.php
parentacd200d6472f4e141c45c51c2d15dea8667d71d5 (diff)
merge r10348 from trunk to branch 2.2
Clean code git-svn-id: http://piwigo.org/svn/branches/2.2@10349 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'plugins/LocalFilesEditor/include/lang.inc.php')
-rw-r--r--plugins/LocalFilesEditor/include/lang.inc.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/plugins/LocalFilesEditor/include/lang.inc.php b/plugins/LocalFilesEditor/include/lang.inc.php
new file mode 100644
index 000000000..fe5a4f85c
--- /dev/null
+++ b/plugins/LocalFilesEditor/include/lang.inc.php
@@ -0,0 +1,53 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+$edited_file = isset($_POST['edited_file']) ? $_POST['edited_file'] : '';
+$content_file = '';
+
+if ((isset($_POST['edit'])) and !is_numeric($_POST['file_to_edit']))
+{
+ $edited_file = $_POST['file_to_edit'];
+ if (file_exists($edited_file))
+ {
+ $content_file = file_get_contents($edited_file);
+ }
+ else
+ {
+ $content_file = "<?php\n\n/* ".l10n('locfiledit_newfile')." */\n\n\n\n\n?>";
+ }
+}
+
+$selected = 0;
+$options[] = l10n('locfiledit_choose_file');
+$options[] = '----------------------';
+foreach (get_languages() as $language_code => $language_name)
+{
+ $value = PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'language/'.$language_code.'.lang.php';
+ if ($edited_file == $value)
+ {
+ $selected = $value;
+ $template->assign('show_default', array(
+ array(
+ 'URL' => LOCALEDIT_PATH.'show_default.php?file=language/'.$language_code.'/common.lang.php',
+ 'FILE' => 'common.lang.php'
+ ),
+ array(
+ 'URL' => LOCALEDIT_PATH.'show_default.php?file=language/'.$language_code.'/admin.lang.php',
+ 'FILE' => 'admin.lang.php'
+ )
+ )
+ );
+ }
+ $options[$value] = $language_name;
+}
+
+$template->assign('css_lang_tpl', array(
+ 'OPTIONS' => $options,
+ 'SELECTED' => $selected
+ )
+ );
+
+$codemirror_mode = 'application/x-httpd-php';
+
+?> \ No newline at end of file