/
index.php
41 lines (33 loc) · 1.29 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
// $Header$
// Copyright (c) 2004 bitweaver Sample
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Initialization
require_once( '../kernel/includes/setup_inc.php' );
require_once META_PKG_INCLUDE_PATH.'meta_lib.php';
// Is package installed and enabled
$gBitSystem->verifyPackage( 'meta' );
// Now check permissions to access this page
$gBitSystem->verifyPermission( 'p_browse_meta' );
$gBitSmarty->assign( 'metaAttributes', meta_get_possible_values( null, false ) );
if( isset( $_REQUEST['metatt'] ) ) {
foreach( $_REQUEST['metatt'] as $key => $value ) {
if( !empty( $value ) ) {
$listHash['search'][$key] = $value;
}
}
$searchResults = meta_search( $listHash );
foreach( array_keys( $searchResults ) as $key ) {
$groupKey = implode( $searchResults[$key]['meta'], ',' );
$groupedResults[$groupKey][$key] = $searchResults[$key];
}
ksort( $groupedResults );
$gBitSmarty->assign_by_ref( 'searchData', $groupedResults );
$gBitSmarty->assign( 'tab', 2 );
} else {
$gBitSmarty->assign( 'tab', 0 );
}
// Display the template
$gBitSystem->display( 'bitpackage:meta/display_search.tpl', tra( 'Meta Search' ) , array( 'display_mode' => 'display' ));
?>