Code Duplication    Length = 15-16 lines in 2 locations

src/Chamilo/CoreBundle/Framework/PageController.php 1 location

@@ 313-328 (lines=16) @@
310
     * an empty string
311
     * @return string HTML <div> block showing the search form, or an empty string if search not enabled
312
     */
313
    public function return_search_block()
314
    {
315
        $html = '';
316
        if (api_get_setting('search.search_enabled') == 'true') {
317
            $html .= '<div class="searchbox">';
318
            $search_btn     = get_lang('Search');
319
            $search_content = '<br />
320
                <form action="main/search/" method="post">
321
                <input type="text" id="query" class="span2" name="query" value="" />
322
                <button class="save" type="submit" name="submit" value="'.$search_btn.'" />'.$search_btn.' </button>
323
                </form></div>';
324
            $html .= $this->show_right_block(get_lang('Search'), $search_content, 'search_block');
325
        }
326
327
        return $html;
328
    }
329
330
    /**
331
     * Returns a list of announcements

main/inc/lib/userportal.lib.php 1 location

@@ 820-834 (lines=15) @@
817
     * @todo use FormValidator
818
     * @return string
819
     */
820
    public function return_search_block()
821
    {
822
        $html = '';
823
        if (api_get_setting('search_enabled') == 'true') {
824
            $search_btn = get_lang('Search');
825
            $search_content = '<form action="main/search/" method="post">
826
                <div class="form-group">
827
                <input type="text" id="query" class="form-control" name="query" value="" />
828
                <button class="btn btn-default" type="submit" name="submit" value="'.$search_btn.'" />'.$search_btn.' </button>
829
                </div></form>';
830
            $html .= self::show_right_block(get_lang('Search'), $search_content, 'search_block');
831
        }
832
833
        return $html;
834
    }
835
836
    /**
837
     * @return string