<?php
  
REQUIRE (ROOT.'/modules/search/plugins/style.php');
  
//Пути до поиска по определенным модулям
IF (GET('type') == 'blogs'){
  
  REQUIRE (ROOT.'/modules/search/plugins/blogs.php');
  
}ELSEIF (GET('type') == 'photos'){
  
  REQUIRE (ROOT.'/modules/search/plugins/photos.php');
  
}ELSEIF (GET('type') == 'videos'){
  
  REQUIRE (ROOT.'/modules/search/plugins/videos.php');
  
}ELSEIF (GET('type') == 'forum'){
  
  REQUIRE (ROOT.'/modules/search/plugins/forum.php');
  
}ELSEIF (GET('type') == 'users'){
  
  REQUIRE (ROOT.'/modules/search/plugins/users.php');
  
}ELSEIF (GET('type') == 'music'){
  
  REQUIRE (ROOT.'/modules/search/plugins/music.php');
  
}ELSEIF (GET('type') == 'communities'){
  
  REQUIRE (ROOT.'/modules/search/plugins/communities.php');
  
}
  
//Навигация
ECHO "<div class='navigation'>";
ECHO "<a href='/'>".ICONS('home', 25, 'fa-fw')."</a>";
ECHO "".ICONS('angle-right', 20, 'fa-fw')."";
ECHO "".LG('Поиск по сайту')."</a>";
ECHO "</div>";

IF (POST('ok')){
  
  $_SESSION['search'] = ADSL(POST('search'));
  
}

IF (ISSET($_SESSION['search'])){
  
  $search = STRIPSLASHES(HTMLSPECIALCHARS($_SESSION['search']));
  
}ELSE{
  
  $search = NULL;
  
}

ECHO "<div class='list'>";

ECHO "<form method='post' action='/modules/?path=search' class='panel-bottom-comments-js' style='position: relative;'>";

ECHO "<input type='text' name='search' class='form-control-100' placeholder='".LG('Что ищем?')."' value='".$search."'>";

ECHO "<button type='submit' id='ajax-comments-button' class='search-button' value='go'>".ICONS('search', 16, 'fa-fw')."</button>";

IF (CONFIG('CSRF') == 1){
  
  ECHO '<input type="hidden" name="'.$token_id.'" value="'.$token_value.'">';

}

ECHO '<input type="hidden" value="go" name="ok">';

ECHO "</form>";

ECHO "</div>";

IF (ISSET($_SESSION['search']) && STR($_SESSION['search']) > 0){
  
  ECHO "<div class='list-body'>";
  
  ECHO "<div class='list-menu'>";
  ECHO "<b>".LG('Результаты поиска').":</b>";
  ECHO "</div>";
  
  DIRECT::COMPONENTS(ROOT.'/modules/search/components/');
  
  ECHO "</div>";
  
}ELSE{
  
  HTML::EMPTY();
  
}

//Навигация
ECHO "<div class='navigation'>";
ECHO "<a href='/'>".ICONS('home', 25, 'fa-fw')."</a>";
ECHO "".ICONS('angle-right', 20, 'fa-fw')."";
ECHO "".LG('Поиск по сайту')."</a>";
ECHO "</div>";
  
?>