<commit_before><?php
/**
* Tatoeba Project, free collaborative creation of multilingual corpuses project
* Copyright (C) 2009  <NAME> <<EMAIL>>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5
*
* @category PHP
* @package  Tatoeba
* @author   <NAME> <<EMAIL>>
* @license  Affero General Public License
* @link     http://tatoeba.org
*/
?>

<div class="topContent">
    <div class="container">
        <div class="description">
            <strong>
                <?php
                __("Tatoeba is a collection of sentences and translations.");
                ?>
            </strong>
            <div>
                <?php
                __("It's collaborative, open, free and even addictive.");
                ?>
            </div>
        </div>

        <!-- Search -->
        <?php
        if (isset($this->params['lang'])) {
            Configure::write('Config.language', $this->params['lang']);
        }
        ?>

        <div class="search-bar">
            <?php
            echo $form->create(
                'Sentence',
                array(
                    "action" => "search",
                    "type" => "get",
                    "id" => "new-search-bar"
                )
            );

            if ($selectedLanguageFrom == null) {
                $selectedLanguageFrom = 'und';
            }

            if ($selectedLanguageTo == null) {
                $selectedLanguageTo = 'und';
            }

            ?>
            <fieldset class="input text languages">
                <?php
                $langFrom = $this->Search->selectLang(
                    'from',
                    $selectedLanguageFrom,
                    array(
                        'div' => false,
                        'label' => '',
                    )
                );

                $langTo = $this->Search->selectLang(
                    'to',
                    $selectedLanguageTo,
                    array(
                        'div' => false,
                        'label' => '',
                    )
                );
                echo format(
                    __('Search sentences in {langFrom} '.
                        'translated into {langTo} containing:', true),
                    array('langFrom' => $langFrom, 'langTo' => $langTo)
                );
                ?>
            </fieldset>

            <fieldset class="input text search-input">
                <?php
                $clearButton = $this->Html->tag('button', '✖', array(
                    'id' => 'clearSearch',
                    'type' => 'button',
                    'title' => __('Clear search', true),
                ));
                echo $form->input(
                    'query',
                    array(
                        'id' => 'SentenceQuery',
                        'label' => '',
                        'accesskey' => 4,
                        'lang' => '',
                        'dir' => 'auto',
                        'after' => $clearButton,
                        'placeholder' => __('Enter a word or a phrase', true)
                    )
                );
                ?>
            </fieldset>

            <fieldset class="submit">
                <?php
                echo $form->button(
                    $images->svgIcon('search'),
                    array('class' => 'search-submit-button')
                );
                ?>
            </fieldset>


            <div class="extra-links">
                <div class="advanced-search">
                    <?php
                    echo $html->link(
                        __p('title', 'Advanced search', true),
                        array(
                            'controller' => 'sentences',
                            'action' => 'advanced_search'
                        )
                    );
                    ?>
                </div>

                <div class="tip">
                    <?php
                    __(
                        "Tip: <em>=word</em> will search for ".
                        "an exact match on <em>word</em>"
                    );
                    echo "<br/>";
                    echo $html->link(
                        __('More', true),
                        'http://en.wiki.tatoeba.org/articles/show/text-search',
                        array(
                            'target' => '_blank'
                        )
                    );
                    ?>
                </div>
            </div>

            <?php
            echo $form->end();
            ?>
        </div>


    </div>
</div><commit_msg>#947 Fix undefined variables<commit_after><?php
/**
* Tatoeba Project, free collaborative creation of multilingual corpuses project
* Copyright (C) 2009  <NAME> <<EMAIL>>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
* PHP version 5
*
* @category PHP
* @package  Tatoeba
* @author   <NAME> <<EMAIL>>
* @license  Affero General Public License
* @link     http://tatoeba.org
*/
?>

<div class="topContent">
    <div class="container">
        <div class="description">
            <strong>
                <?php
                __("Tatoeba is a collection of sentences and translations.");
                ?>
            </strong>
            <div>
                <?php
                __("It's collaborative, open, free and even addictive.");
                ?>
            </div>
        </div>

        <!-- Search -->
        <?php
        if (isset($this->params['lang'])) {
            Configure::write('Config.language', $this->params['lang']);
        }
        ?>

        <div class="search-bar">
            <?php
            echo $form->create(
                'Sentence',
                array(
                    "action" => "search",
                    "type" => "get",
                    "id" => "new-search-bar"
                )
            );

            if (!isset($selectedLanguageFrom)) {
                $selectedLanguageFrom = 'und';
            }

            if (!isset($selectedLanguageTo)) {
                $selectedLanguageTo = 'und';
            }

            ?>
            <fieldset class="input text languages">
                <?php
                $langFrom = $this->Search->selectLang(
                    'from',
                    $selectedLanguageFrom,
                    array(
                        'div' => false,
                        'label' => '',
                    )
                );

                $langTo = $this->Search->selectLang(
                    'to',
                    $selectedLanguageTo,
                    array(
                        'div' => false,
                        'label' => '',
                    )
                );
                echo format(
                    __('Search sentences in {langFrom} '.
                        'translated into {langTo} containing:', true),
                    array('langFrom' => $langFrom, 'langTo' => $langTo)
                );
                ?>
            </fieldset>

            <fieldset class="input text search-input">
                <?php
                $clearButton = $this->Html->tag('button', '✖', array(
                    'id' => 'clearSearch',
                    'type' => 'button',
                    'title' => __('Clear search', true),
                ));
                echo $form->input(
                    'query',
                    array(
                        'id' => 'SentenceQuery',
                        'label' => '',
                        'accesskey' => 4,
                        'lang' => '',
                        'dir' => 'auto',
                        'after' => $clearButton,
                        'placeholder' => __('Enter a word or a phrase', true)
                    )
                );
                ?>
            </fieldset>

            <fieldset class="submit">
                <?php
                echo $form->button(
                    $images->svgIcon('search'),
                    array('class' => 'search-submit-button')
                );
                ?>
            </fieldset>


            <div class="extra-links">
                <div class="advanced-search">
                    <?php
                    echo $html->link(
                        __p('title', 'Advanced search', true),
                        array(
                            'controller' => 'sentences',
                            'action' => 'advanced_search'
                        )
                    );
                    ?>
                </div>

                <div class="tip">
                    <?php
                    __(
                        "Tip: <em>=word</em> will search for ".
                        "an exact match on <em>word</em>"
                    );
                    echo "<br/>";
                    echo $html->link(
                        __('More', true),
                        'http://en.wiki.tatoeba.org/articles/show/text-search',
                        array(
                            'target' => '_blank'
                        )
                    );
                    ?>
                </div>
            </div>

            <?php
            echo $form->end();
            ?>
        </div>


    </div>
</div>
{'fraction_non_alphanumeric': 0.12043276074784094, 'fraction_numerical': 0.0016133624371263168, 'mean_word_length': 0.9928139183055976, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 175, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3856289', 'n_tokens_mistral': 2606, 'n_tokens_neox': 2358, 'n_words': 650}