Quick_Search_Block::setup()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
/**
4
 * @package SimplePortal
5
 *
6
 * @author SimplePortal Team
7
 * @copyright 2015-2021 SimplePortal Team
8
 * @license BSD 3-clause
9
 * @version 1.0.0
10
 */
11
12
13
/**
14
 * Quick Search Block, Displays a quick search box
15
 *
16
 * @param mixed[] $parameters not used in this block
17
 * @param int $id - not used in this block
18
 * @param boolean $return_parameters if true returns the configuration options for the block
19
 */
20
class Quick_Search_Block extends SP_Abstract_Block
21
{
22
	/**
23
	 * Initializes a block for use.
24
	 *
25
	 * - Called from portal.subs as part of the sportal_load_blocks process
26
	 *
27
	 * @param mixed[] $parameters
28
	 * @param int $id
29
	 */
30
	public function setup($parameters, $id)
31
	{
32
		// @todo isn't the search subject to verification?
33
		$this->setTemplate('template_sp_quickSearch');
34
	}
35
}
36
37
/**
38
 * Main template for this block
39
 */
40
function template_sp_quickSearch()
41
{
42
	global $txt, $scripturl;
43
44
	echo '
45
		<form action="', $scripturl, '?action=search;sa=results" method="post" accept-charset="UTF-8">
46
			<div class="centertext">
47
				<input type="text" name="search" value="" class="sp_search" placeholder="', $txt['search'], '" /><br />
48
				<input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
49
				<input type="hidden" name="advanced" value="0" />
50
			</div>
51
		</form>';
52
}
53