source: trunk/plugins/LocalFilesEditor/include/css.inc.php @ 10348

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

Clean code

File size: 1.1 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 = "/* " . l10n('locfiledit_newfile') . " */\n\n";
18  }
19}
20
21$selected = 0; 
22$options[] = l10n('locfiledit_choose_file');
23$options[] = '----------------------';
24$value = PHPWG_ROOT_PATH.PWG_LOCAL_DIR . "css/rules.css";
25$options[$value] = 'local / css / rules.css';
26if ($edited_file == $value) $selected = $value;
27$options[] = '----------------------';
28
29foreach (get_dirs($conf['themes_dir']) as $theme_id)
30{
31  $value = PHPWG_ROOT_PATH.PWG_LOCAL_DIR . 'css/'.$theme_id.'-rules.css';
32  $options[$value] = 'local / css / '.$theme_id.'-rules.css';
33  if ($edited_file == $value)
34    $selected = $value;
35}
36
37$template->assign('css_lang_tpl', array(
38  'OPTIONS' => $options,
39  'SELECTED' => $selected
40  )
41);
42
43$codemirror_mode = 'text/css';
44
45?>
Note: See TracBrowser for help on using the repository browser.