source: branches/2.2/plugins/LocalFilesEditor/include/lang.inc.php @ 10349

Last change on this file since 10349 was 10349, checked in by patdenice, 13 years ago

merge r10348 from trunk to branch 2.2
Clean code

File size: 1.3 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5$edited_file = isset($_POST['edited_file']) ? $_POST['edited_file'] : '';
6$content_file = '';
7
8if ((isset($_POST['edit'])) and !is_numeric($_POST['file_to_edit']))
9{
10  $edited_file = $_POST['file_to_edit'];
11  if (file_exists($edited_file))
12  {
13    $content_file = file_get_contents($edited_file);
14  }
15  else
16  {
17    $content_file = "<?php\n\n/* ".l10n('locfiledit_newfile')." */\n\n\n\n\n?>";
18  }
19}
20
21$selected = 0; 
22$options[] = l10n('locfiledit_choose_file');
23$options[] = '----------------------';
24foreach (get_languages() as $language_code => $language_name)
25{
26  $value = PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'language/'.$language_code.'.lang.php';
27  if ($edited_file == $value)
28  {
29    $selected = $value;
30    $template->assign('show_default', array(
31      array(
32        'URL' => LOCALEDIT_PATH.'show_default.php?file=language/'.$language_code.'/common.lang.php',
33        'FILE' => 'common.lang.php'
34        ),
35      array(
36        'URL' => LOCALEDIT_PATH.'show_default.php?file=language/'.$language_code.'/admin.lang.php',
37        'FILE' => 'admin.lang.php'
38        )
39      )
40    );
41  }
42  $options[$value] = $language_name;
43}
44
45$template->assign('css_lang_tpl', array(
46    'OPTIONS' => $options,
47    'SELECTED' => $selected
48    )
49  );
50
51$codemirror_mode = 'application/x-httpd-php';
52
53?>
Note: See TracBrowser for help on using the repository browser.