public static function handleAjaxCall($page, $func, $table, $idField, $useLike)
 {
     global $REX;
     if (isset($REX['USER']) && rex_request('page') == $page) {
         self::$ajaxFunctionName = $func;
         if (rex_request('func') == self::$ajaxFunctionName) {
             // update prio in db
             self::updatePrio(rex_request('order'), $table, $idField, $useLike);
             // update init file to reflect changes
             rex_website_manager::updateInitFile();
             // stop executing rest of redaxo stuff
             exit;
         }
     }
 }
    rex_website_manager::updateInitFile();
    return true;
});
// delete website (after form submit)
rex_register_extension('REX_FORM_DELETED', function ($params) {
    global $REX;
    // get values from submitted form
    $websiteId = $params['form']->params['website_id'];
    // destroy website
    rex_website_manager::destroyWebsite($websiteId);
    // delete clang file for clang fix
    if (!$REX['WEBSITE_MANAGER_SETTINGS']['identical_clangs']) {
        rex_website_manager::deleteClangFile($websiteId);
    }
    // update init file to reflect changes
    rex_website_manager::updateInitFile();
    return true;
});
// output
echo '<div class="rex-addon-output-v2">';
if ($REX['WEBSITE_MANAGER']->getCurrentWebsiteId() > 1) {
    // user can only edit websites if selected website is master website
    echo rex_info($I18N->msg('website_manager_website_master_msg'));
} elseif ($func == '') {
    // show website list
    $query = 'SELECT * FROM rex_website ORDER BY priority';
    $list = rex_list::factory($query, 10000);
    $list->setNoRowsMessage($I18N->msg('website_manager_website_no_websites_available'));
    $list->setCaption($I18N->msg('website_manager_website_list'));
    $list->addTableAttribute('summary', $I18N->msg('website_manager_website_list'));
    $list->addTableColumnGroup(array(40, 40, '*', 280, 80, 80));