Exemple #1
0
 function tinymce_is_writable($path)
 {
     if ($path[strlen($path) - 1] == '/') {
         // recursively return a temporary file path
         return tinymce_is_writable($path . uniqid(mt_rand()) . '.tmp');
     } else {
         if (is_dir($path)) {
             return tinymce_is_writable($path . '/' . uniqid(mt_rand()) . '.tmp');
         }
     }
     // check tmp file for read/write capabilities
     $rm = file_exists($path);
     $f = @fopen($path, 'a');
     if ($f === false) {
         return false;
     }
     fclose($f);
     if (!$rm) {
         unlink($path);
     }
     return true;
 }
Exemple #2
0
    $REX['ADDON']['tinymce']['frontend'] = $active_fe;
    $REX['ADDON']['tinymce']['excludecats'] = $excludecats;
    $REX['ADDON']['tinymce']['excludeids'] = $excludeids;
    $content = '
$REX[\'ADDON\'][\'tinymce\'][\'backend\'] = \'' . $active_be . '\';
$REX[\'ADDON\'][\'tinymce\'][\'frontend\'] = \'' . $active_fe . '\';
$REX[\'ADDON\'][\'tinymce\'][\'excludecats\'] = \'' . $excludecats . '\';
$REX[\'ADDON\'][\'tinymce\'][\'excludeids\'] = \'' . $excludeids . '\';
';
    if (rex_replace_dynamic_contents($config_file, $content) !== false) {
        echo rex_info($I18N->msg('tinymce_config_saved'));
    } else {
        echo rex_warning($I18N->msg('tinymce_config_not_saved'));
    }
}
if (!tinymce_is_writable($config_file)) {
    echo rex_warning($I18N->msg('tinymce_error_notwriteable', $config_file));
}
$active_be_check = '';
if ($REX['ADDON']['tinymce']['backend'] == '1') {
    $active_be_check = 'checked="checked"';
}
$active_fe_check = '';
if ($REX['ADDON']['tinymce']['frontend'] == '1') {
    $active_fe_check = 'checked="checked"';
}
?>

<div class="rex-addon-output">
<div class="rex-form">
  <h2 class="rex-hl2"><?php