示例#1
0
    // register subpages of plugins
    rex_register_extension('ADDONS_INCLUDED', create_function('', '
        global $REX;
        if(!empty($REX[\'ADDON\'][\'rexsearch_plugins\'][\'' . $mypage . '\']))
        {
          foreach($REX[\'ADDON\'][\'rexsearch_plugins\'][\'' . $mypage . '\'] as $plugin => $pluginsettings)
            if(!empty($pluginsettings[\'subpages\']))
              $REX[\'ADDON\'][\'' . $mypage . '\'][\'SUBPAGES\'] = array_merge($REX[\'ADDON\'][\'' . $mypage . '\'][\'SUBPAGES\'], $pluginsettings[\'subpages\']);
        }
      '));
}
require $REX['ADDON']['dir'][$mypage] . '/classes/class.rexsearch.inc.php';
require $REX['ADDON']['dir'][$mypage] . '/functions/functions.inc.php';
require $REX['ADDON']['dir'][$mypage] . '/functions/functions.mb.inc.php';
if (!file_exists($settingFile = dirname(__FILE__) . '/settings.conf')) {
    a587_saveSettings(array('logicalmode' => 'and', 'textmode' => 'plain', 'searchmode' => 'like', 'similarwordsmode' => 7, 'indexmode' => 1, 'automaticindex' => 1, 'surroundtags' => array('<strong>', '</strong>'), 'limit' => array(0, 20), 'maxteaserchars' => '200', 'maxhighlightchars' => '50', 'highlight' => 'surroundtextsingle', 'fileextensions' => array('pdf'), 'indexmediapool' => '1', 'dirdepth' => 3));
}
$REX['ADDON']['settings'][$mypage] = a587_config_unserialize(rex_get_file_contents($settingFile));
// automatic indexing
if ($REX['REDAXO'] and $REX['ADDON']['settings'][$mypage]['automaticindex'] == '1') {
    $extensionPoints = array('ART_DELETED', 'ART_META_UPDATED', 'ART_STATUS', 'ART_ADDED', 'ART_UPDATED', 'CAT_DELETED', 'CAT_STATUS', 'CAT_ADDED', 'CAT_UPDATED', 'MEDIA_ADDED', 'MEDIA_UPDATED', 'MEDIA_DELETED', 'SLICE_UPDATED');
    a587_register_extensionpoints($extensionPoints);
}
// Including CSS-File for Backend
if ($REX['REDAXO'] and rex_request('page', 'string') == $mypage) {
    function a587_add_css($params)
    {
        $mypage = 'rexsearch';
        if (function_exists('str_ireplace')) {
            return str_ireplace('</head>', "\t" . '<link rel="stylesheet" type="text/css" href="../files/addons/' . $mypage . '/' . $mypage . '.css" />' . "\n" . '</head>', $params['subject']);
        }
示例#2
0
        $returnArray = array();
        foreach (explode(',', $_POST['a587_rexsearch']['fileextensions']) as $fileext) {
            $returnArray[] = trim($fileext);
        }
        $_POST['a587_rexsearch']['fileextensions'] = $returnArray;
    } else {
        unset($_POST['a587_rexsearch']['fileextensions']);
    }
    $suggestnewindex = '';
    foreach (array_keys(array_merge(array_diff_assoc($_POST['a587_rexsearch'], $REX['ADDON']['settings']['rexsearch']), array_diff_assoc($REX['ADDON']['settings']['rexsearch'], $_POST['a587_rexsearch']))) as $changed) {
        if (in_array($changed, array('indexmode', 'indexoffline', 'automaticindex', 'blacklist', 'exclude_article_ids', 'exclude_category_ids', 'include', 'fileextensions', 'indexmediapool', 'dirdepth', 'indexfolders', 'ep_outputfilter'))) {
            $suggestnewindex = '&suggestnewindex=1';
        }
    }
    echo '</pre>';
    a587_saveSettings($_POST['a587_rexsearch']);
    /*$rexsearch = new rexsearch();
      $rexsearch->deleteCache();*/
    header('Location: http://' . $_SERVER['HTTP_HOST'] . substr($_SERVER["PHP_SELF"], 0, -9) . 'index.php?page=rexsearch&subpage=settings&save=1' . $suggestnewindex);
}
if (!empty($_GET['save'])) {
    echo rex_info($I18N->Msg('a587_settings_saved'));
}
if (!empty($_GET['suggestnewindex'])) {
    echo rex_warning($I18N->Msg('a587_settings_saved_warning'));
}
?>

<div class="rex-addon-output" id="a587-form">
<h2 class="rex-hl2">Einstellungen</h2>