Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 576-590 (lines=15) @@
573
     * @todo use FormValidator
574
     * @return string
575
     */
576
    public function return_search_block()
577
    {
578
        $html = '';
579
        if (api_get_setting('search_enabled') == 'true') {
580
            $search_btn = get_lang('Search');
581
            $search_content = '<form action="main/search/" method="post">
582
                <div class="form-group">
583
                <input type="text" id="query" class="form-control" name="query" value="" />
584
                <button class="btn btn-default" type="submit" name="submit" value="'.$search_btn.'" />'.$search_btn.' </button>
585
                </div></form>';
586
            $html .= self::show_right_block(get_lang('Search'), $search_content, 'search_block');
587
        }
588
589
        return $html;
590
    }
591
592
    /**
593
     * @return string

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

@@ 137-152 (lines=16) @@
134
     * an empty string
135
     * @return string HTML <div> block showing the search form, or an empty string if search not enabled
136
     */
137
    public function return_search_block()
138
    {
139
        $html = '';
140
        if (api_get_setting('search.search_enabled') == 'true') {
141
            $html .= '<div class="searchbox">';
142
            $search_btn     = get_lang('Search');
143
            $search_content = '<br />
144
                <form action="main/search/" method="post">
145
                <input type="text" id="query" class="span2" name="query" value="" />
146
                <button class="save" type="submit" name="submit" value="'.$search_btn.'" />'.$search_btn.' </button>
147
                </form></div>';
148
            $html .= $this->show_right_block(get_lang('Search'), $search_content, 'search_block');
149
        }
150
151
        return $html;
152
    }
153
154
    /**
155
     * Returns a list of announcements