SeekquarrySeekquarry - Yioop Repo - Seekquarry

/ src / views / PausedSearchView.php⤓
<?php
/**
 * SeekQuarry/Yioop --
 * Open Source Pure PHP Search Engine, Crawler, and Indexer
 *
 * Copyright (C) 2009 - 2026  Chris Pollett chris@pollett.org
 *
 * LICENSE:
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * END LICENSE
 *
 * @author Chris Pollett chris@pollett.org
 * @license https://www.gnu.org/licenses/ GPL3
 * @link https://www.seekquarry.com/
 * @copyright 2009 - 2026
 * @filesource
 */
namespace seekquarry\yioop\views;

/**
 * PausedSearchView draws the page that refuses a search from a visitor
 * without a session cookie, while such searches are paused because the
 * site is getting more of them than it can answer. refuseHotTarget in
 * index.php draws it, before any controller runs, and caches the page
 * for each locale.
 *
 * @author Chris Pollett
 */
class PausedSearchView extends View
{
    /**
     * The page is a whole HTML document of its own, so it is drawn on the
     * base layout, which adds nothing around it.
     * @var string
     */
    public $layout = "";
    /**
     * renderView draws the paused-search page: a title, why searches are
     * paused, and how to search again from the home page.
     *
     * @param array $data HOME_URL is the address of the site's home page
     */
    public function renderView($data)
    {
        $title = tl('pausedsearch_view_title');
        $home_link = "<a href=\"" . $data['HOME_URL'] . "\">" .
            tl('pausedsearch_view_home_page') . "</a>";
        ?><!DOCTYPE html><html><head><meta charset="utf-8"><title><?=
        $title ?></title></head><body><h1><?= $title ?></h1><p><?=
        tl('pausedsearch_view_reason') ?></p><p><?=
        tl('pausedsearch_view_how', $home_link) ?></p></body></html><?php
    }
}