/**
 * Schreibt Spracheigenschaften in die Datei include/clang.inc.php
 *
 * @return TRUE bei Erfolg, sonst eine Fehlermeldung
 */
function rex_generateClang()
{
    global $REX;
    $lg = rex_sql::factory();
    $lg->setQuery('select * from ' . $REX['TABLE_PREFIX'] . 'clang order by id');
    $REX['CLANG'] = array();
    while ($lg->hasNext()) {
        $REX['CLANG'][$lg->getValue('id')] = $lg->getValue('name');
        $lg->next();
    }
    $file = $REX['INCLUDE_PATH'] . '/clang.inc.php';
    if (rex_replace_dynamic_contents($file, "\$REX['CLANG'] = " . var_export($REX['CLANG'], true) . ";\n") === false) {
        return 'Datei "' . $file . '" hat keine Schreibrechte';
    }
    return true;
}
 function saveNextTime($nexttime = null)
 {
     global $REX;
     if ($nexttime === null) {
         $sql_manager = rex_cronjob_manager_sql::factory($this);
         $nexttime = $sql_manager->getMinNextTime();
     }
     if ($nexttime === null) {
         $nexttime = 0;
     } else {
         $nexttime = max(1, $nexttime);
     }
     if ($nexttime != $REX['ADDON']['nexttime']['cronjob']) {
         $content = '$REX[\'ADDON\'][\'nexttime\'][\'cronjob\'] = "' . addslashes($nexttime) . '";';
         $file = $REX['INCLUDE_PATH'] . '/addons/cronjob/config.inc.php';
         if (rex_replace_dynamic_contents($file, $content)) {
             $REX['ADDON']['nexttime']['cronjob'] = $nexttime;
             return true;
         }
     }
     return false;
 }
예제 #3
0
    if ($jpg_quality > 100) {
        $jpg_quality = 100;
    } else {
        if ($jpg_quality < 0) {
            $jpg_quality = 0;
        }
    }
    $REX['ADDON']['image_manager']['max_resizekb'] = $max_resizekb;
    $REX['ADDON']['image_manager']['max_resizepixel'] = $max_resizepixel;
    $REX['ADDON']['image_manager']['jpg_quality'] = $jpg_quality;
    $content = '
$REX[\'ADDON\'][\'image_manager\'][\'max_resizekb\'] = ' . $max_resizekb . ';
$REX[\'ADDON\'][\'image_manager\'][\'max_resizepixel\'] = ' . $max_resizepixel . ';
$REX[\'ADDON\'][\'image_manager\'][\'jpg_quality\'] = ' . $jpg_quality . ';
';
    if (rex_replace_dynamic_contents($config_file, $content) !== false) {
        echo rex_info($I18N->msg('imanager_config_saved'));
    } else {
        echo rex_warning($I18N->msg('imanager_config_not_saved'));
    }
}
if (!is_writable($config_file)) {
    echo rex_warning($I18N->msg('imanager_config_not_writable', $config_file));
}
echo '

<div class="rex-addon-output">



  <div class="rex-form">
/**
 * Schreibt Spracheigenschaften in die Datei include/clang.inc.php
 * 
 * @return TRUE bei Erfolg, sonst eine Fehlermeldung
 */
function rex_generateClang()
{
    global $REX;
    $lg = rex_sql::factory();
    $lg->setQuery("select * from " . $REX['TABLE_PREFIX'] . "clang order by id");
    $REX['CLANG'] = array();
    while ($lg->hasNext()) {
        $REX['CLANG'][$lg->getValue("id")] = $lg->getValue("name");
        $lg->next();
    }
    $file = $REX['INCLUDE_PATH'] . "/clang.inc.php";
    if (rex_replace_dynamic_contents($file, "\$REX['CLANG'] = " . var_export($REX['CLANG'], TRUE) . ";\n") === FALSE) {
        return 'Datei "' . $file . '" hat keine Schreibrechte';
    }
    return TRUE;
}
예제 #5
0
            $jpg_quality = 0;
        }
    }
    $REX['ADDON']['image_resize']['max_cachefiles'] = $max_cachefiles;
    $REX['ADDON']['image_resize']['max_filters'] = $max_filters;
    $REX['ADDON']['image_resize']['max_resizekb'] = $max_resizekb;
    $REX['ADDON']['image_resize']['max_resizepixel'] = $max_resizepixel;
    $REX['ADDON']['image_resize']['jpg_quality'] = $jpg_quality;
    $content = '$REX[\'ADDON\'][\'image_resize\'][\'max_cachefiles\'] = ' . $max_cachefiles . ';
$REX[\'ADDON\'][\'image_resize\'][\'max_filters\'] = ' . $max_filters . ';
$REX[\'ADDON\'][\'image_resize\'][\'max_resizekb\'] = ' . $max_resizekb . ';
$REX[\'ADDON\'][\'image_resize\'][\'max_resizepixel\'] = ' . $max_resizepixel . ';
$REX[\'ADDON\'][\'image_resize\'][\'jpg_quality\'] = ' . $jpg_quality . ';
';
    $file = $REX['INCLUDE_PATH'] . "/addons/image_resize/config.inc.php";
    rex_replace_dynamic_contents($file, $content);
    echo rex_warning('Konfiguration wurde aktualisiert');
}
echo '

<div class="rex-addon-output">
  <h2>Konfiguration</h2>
  <div class="rex-addon-content">

  <form action="index.php" method="post">
    <input type="hidden" name="page" value="image_resize" />
    <input type="hidden" name="subpage" value="settings" />
    <input type="hidden" name="func" value="update" />

        <fieldset>
          <p>
예제 #6
0
        if ($jpg_quality < 0) {
            $jpg_quality = 0;
        }
    }
    $REX['ADDON']['image_resize']['max_cachefiles'] = $max_cachefiles;
    $REX['ADDON']['image_resize']['max_filters'] = $max_filters;
    $REX['ADDON']['image_resize']['max_resizekb'] = $max_resizekb;
    $REX['ADDON']['image_resize']['max_resizepixel'] = $max_resizepixel;
    $REX['ADDON']['image_resize']['jpg_quality'] = $jpg_quality;
    $content = '$REX[\'ADDON\'][\'image_resize\'][\'max_cachefiles\'] = ' . $max_cachefiles . ';
$REX[\'ADDON\'][\'image_resize\'][\'max_filters\'] = ' . $max_filters . ';
$REX[\'ADDON\'][\'image_resize\'][\'max_resizekb\'] = ' . $max_resizekb . ';
$REX[\'ADDON\'][\'image_resize\'][\'max_resizepixel\'] = ' . $max_resizepixel . ';
$REX[\'ADDON\'][\'image_resize\'][\'jpg_quality\'] = ' . $jpg_quality . ';
';
    if (rex_replace_dynamic_contents($config_file, $content)) {
        echo rex_info($I18N_IMG_RES->msg('config_saved'));
    } else {
        echo rex_warning($I18N_IMG_RES->msg('config_not_saved'));
    }
}
if (!is_writable($config_file)) {
    echo rex_warning($I18N_IMG_RES->msg('config_not_writable', $config_file));
}
echo '

<div class="rex-addon-output">
  <h2>Konfiguration</h2>
  <div class="rex-addon-content">

  <form action="index.php" method="post">
/**
* Schreibt Addoneigenschaften in die Datei include/addons.inc.php
* @param array Array mit den Namen der Addons aus dem Verzeichnis addons/
*/
function rex_generateAddons($ADDONS, $debug = false)
{
    global $REX;
    natsort($ADDONS);
    $content = "";
    foreach ($ADDONS as $cur) {
        if (!OOAddon::isInstalled($cur)) {
            $REX['ADDON']['install'][$cur] = 0;
        }
        if (!OOAddon::isActivated($cur)) {
            $REX['ADDON']['status'][$cur] = 0;
        }
        $content .= "\$REX['ADDON']['install']['{$cur}'] = " . $REX['ADDON']['install'][$cur] . ";\n" . "\$REX['ADDON']['status']['{$cur}'] = " . $REX['ADDON']['status'][$cur] . ";\n\n";
    }
    // Da dieser Funktion öfter pro request aufgerufen werden kann,
    // hier die caches löschen
    clearstatcache();
    $file = $REX['INCLUDE_PATH'] . "/addons.inc.php";
    if (!rex_replace_dynamic_contents($file, $content)) {
        return 'Datei "' . $file . '" hat keine Schreibrechte';
    }
    return true;
}
 function a720_saveConf($myCONF)
 {
     global $REX, $mypage;
     // SAVE SETTINGS
     $DYN = '$REX["ADDON"]["' . $mypage . '"]["settings"] = ' . stripslashes(var_export($myCONF, true)) . ';';
     $config = $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/config.inc.php';
     if (rex_replace_dynamic_contents($config, $DYN)) {
         // UPDATE REX
         $REX['ADDON'][$mypage]['settings'] = $myCONF;
         return true;
     } else {
         return false;
     }
 }
예제 #9
0
    $rxa_tinymce['config_content'] = '
$REX[\'ADDON\'][$rxa_tinymce[\'name\']][\'active\'] = \'' . $rxa_tinymce['get_active'] . '\';
$REX[\'ADDON\'][$rxa_tinymce[\'name\']][\'lang\'] = \'' . $rxa_tinymce['get_lang'] . '\';
$REX[\'ADDON\'][$rxa_tinymce[\'name\']][\'pages\'] = \'' . $rxa_tinymce['get_pages'] . '\';
$REX[\'ADDON\'][$rxa_tinymce[\'name\']][\'foreground\'] = \'' . $rxa_tinymce['get_foreground'] . '\';
$REX[\'ADDON\'][$rxa_tinymce[\'name\']][\'background\'] = \'' . $rxa_tinymce['get_background'] . '\';
$REX[\'ADDON\'][$rxa_tinymce[\'name\']][\'validxhtml\'] = \'' . $rxa_tinymce['get_validxhtml'] . '\';
$REX[\'ADDON\'][$rxa_tinymce[\'name\']][\'theme\'] = \'' . $rxa_tinymce['get_theme'] . '\';
$REX[\'ADDON\'][$rxa_tinymce[\'name\']][\'skin\'] = \'' . $rxa_tinymce['get_skin'] . '\';
$REX[\'ADDON\'][$rxa_tinymce[\'name\']][\'emoticons\'] = \'' . $rxa_tinymce['get_emoticons'] . '\';
$REX[\'ADDON\'][$rxa_tinymce[\'name\']][\'media\'] = \'' . $rxa_tinymce['get_media'] . '\';
$REX[\'ADDON\'][$rxa_tinymce[\'name\']][\'highlight\'] = \'' . $rxa_tinymce['get_highlight'] . '\';
		';
    //$filename = dirname( __FILE__) . '/../config.inc.php';
    $filename = $REX['INCLUDE_PATH'] . '/addons/' . $rxa_tinymce['name'] . '/config.inc.php';
    rex_replace_dynamic_contents($filename, $rxa_tinymce['config_content']);
    echo rex_info($I18N_A52->msg('msg_settings_saved'));
}
$rxa_tinymce['tinymce_langs'] = str_replace('.js', '', implode(',', a52_readFolderFiles($rxa_tinymce['fe_path'] . '/tiny_mce/langs')));
// Tabelle bei REDAXO 3.2.x ausgeben
if ($rxa_tinymce['rexversion'] == '32') {
    echo '<table border="0" cellpadding="5" cellspacing="1" width="770">';
    echo '<tr>';
    echo '<td class="grey">';
}
?>

<div class="rex-addon-output">

<h2 class="rex-hl2"><?php 
echo $I18N_A52->msg('title_config');
        $REX['ADDON']['be_style']['plugin_customizer']['textarea'] = 1;
    }
    $REX['ADDON']['be_style']['plugin_customizer']['liquid'] = 0;
    if (rex_request('customizer-liquid') == 1) {
        $REX['ADDON']['be_style']['plugin_customizer']['liquid'] = 1;
    }
    $content = '
$REX[\'ADDON\'][\'be_style\'][\'plugin_customizer\'][\'labelcolor\'] = "' . $REX['ADDON']['be_style']['plugin_customizer']['labelcolor'] . '";
$REX[\'ADDON\'][\'be_style\'][\'plugin_customizer\'][\'codemirror_theme\'] = "' . $REX['ADDON']['be_style']['plugin_customizer']['codemirror_theme'] . '";
$REX[\'ADDON\'][\'be_style\'][\'plugin_customizer\'][\'codemirror\'] = ' . $REX['ADDON']['be_style']['plugin_customizer']['codemirror'] . ';
$REX[\'ADDON\'][\'be_style\'][\'plugin_customizer\'][\'showlink\'] = ' . $REX['ADDON']['be_style']['plugin_customizer']['showlink'] . ';
$REX[\'ADDON\'][\'be_style\'][\'plugin_customizer\'][\'textarea\'] = ' . $REX['ADDON']['be_style']['plugin_customizer']['textarea'] . ';
$REX[\'ADDON\'][\'be_style\'][\'plugin_customizer\'][\'liquid\'] = ' . $REX['ADDON']['be_style']['plugin_customizer']['liquid'] . ';
    ';
    $config_file = $REX['INCLUDE_PATH'] . '/addons/be_style/plugins/customizer/config.inc.php';
    if ($warning == '' && rex_replace_dynamic_contents($config_file, $content) !== false) {
        echo rex_info($I18N->msg('customizer_config_updated'));
    } else {
        echo rex_warning($I18N->msg('customizer_config_update_failed', $config_file));
    }
}
$tselect->setSelected($REX['ADDON']['be_style']['plugin_customizer']['codemirror_theme']);
if ($warning != '') {
    echo rex_warning($warning);
}
echo '
    <div class="rex-form" id="rex-form-system-setup">
        <form action="index.php" method="post">
            <input type="hidden" name="page" value="specials" />
            <input type="hidden" name="subpage" value="customizer" />
            <input type="hidden" name="func" value="update" />
function rex_generatePlugins($plugins)
{
    global $REX;
    natsort($plugins);
    $content = "";
    foreach ($plugins as $cur) {
        if (!OOPlugin::isInstalled($cur)) {
            OOPlugin::setProperty($cur, 'install', 0);
        }
        if (!OOPlugin::isActivated($cur)) {
            OOPlugin::setProperty($cur, 'status', 0);
        }
        $content .= sprintf("%s = %d;\n%s = %d;\n\n", OOPlugin::getAsPropertyString($cur, 'install'), OOPlugin::getProperty($cur, 'install'), OOPlugin::getAsPropertyString($cur, 'status'), OOPlugin::getProperty($cur, 'status'));
    }
    $content .= sprintf("\$REX['ADDON']['pluginlist']['community'] = \"%s\";", implode(',', OOPlugin::getRegisteredPlugins()));
    // Da dieser Funktion öfter pro request aufgerufen werden kann,
    // hier die caches löschen
    clearstatcache();
    $file = rex_plugins_file();
    if (!rex_replace_dynamic_contents($file, $content)) {
        return 'Datei "' . $file . '" hat keine Schreibrechte';
    }
    return true;
}
 public static function createClangFile($websiteId)
 {
     global $REX;
     $clangFile = WEBSITE_MANAGER_GENERATED_DIR . rex_website::constructClangFile($websiteId);
     if (!file_exists($clangFile)) {
         rex_website_manager_utils::createDynFile($clangFile);
     }
     rex_replace_dynamic_contents($clangFile, "\$REX['CLANG'] = array (0 => 'deutsch');");
 }