Ignore:
Timestamp:
Apr 12, 2011, 1:12:51 PM (13 years ago)
Author:
patdenice
Message:

feature:2262
Replace editarea by Codemirror:
http://codemirror.net

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/LocalFilesEditor/admin.php

    r9359 r10307  
    7575$newfile_page = isset($_GET['newfile']) ? true : false;
    7676
    77 // Editarea options
    78 $editarea_options = array(
    79   'language' => substr($user['language'], 0, 2),
    80   'start_highlight' => true,
    81   'allow_toggle' => false,
    82   'toolbar' => 'search,fullscreen, |,select_font, |, undo, redo, change_smooth_selection, highlight, reset_highlight, |, help');
    83 
    8477// Edit selected file for CSS, template and language
    8578if ((isset($_POST['edit'])) and !is_numeric($_POST['file_to_edit']))
     
    139132                . 'show_default.php?file=include/config_default.inc.php',
    140133              'FILE' => 'config_default.inc.php')));
    141     $editarea_options['syntax'] = 'php';
     134    $codemirror_mode = 'application/x-httpd-php';
    142135    break;
    143136
     
    160153        'OPTIONS' => $options,
    161154        'SELECTED' => $selected));
    162     $editarea_options['syntax'] = 'css';
     155    $codemirror_mode = 'text/css';
    163156    break;
    164157
     
    239232      'NEW_FILE_CLASS' => empty($edited_file) ? '' : 'top_right'));
    240233
    241     $editarea_options['syntax'] = 'html';
     234    $codemirror_mode = 'text/html';
    242235    break;
    243236
     
    267260        'OPTIONS' => $options,
    268261        'SELECTED' => $selected));
    269     $editarea_options['syntax'] = 'php';
     262    $codemirror_mode = 'application/x-httpd-php';
    270263    break;
    271264   
     
    274267    $content_file = file_exists($edited_file) ?
    275268      file_get_contents($edited_file) : $new_file['plug'];
    276     $editarea_options['syntax'] = 'php';
     269    $codemirror_mode = 'application/x-httpd-php';
    277270    break;
    278271}
     
    368361  'F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=plugin-LocalFilesEditor-'.$page['tab'],
    369362  'LOCALEDIT_PATH' => LOCALEDIT_PATH,
    370   'LOAD_EDITAREA' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'off',
    371   'EDITAREA_OPTIONS' => $editarea_options));
     363  'LOAD_CODEMIRROR' => isset($conf['LocalFilesEditor']) ? $conf['LocalFilesEditor'] : 'off',
     364  'CODEMIRROR_MODE' => @$codemirror_mode
     365  )
     366);
    372367
    373368$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
Note: See TracChangeset for help on using the changeset viewer.