Beispiel #1
0
<?php

admin_gatekeeper();
$query = get_input('q');
$category = get_input('category', '');
$sort = get_input('sort', 'created');
$order = get_input('order');
$limit = get_input('limit', 10);
$offset = get_input('offset', 0);
$noStats = get_input('no_stats', false);
$mt = microtime(true);
$batch = srokap_plugin::getPluginsSearchBatch(array('q' => $query, 'category' => $category, 'sort' => $sort, 'order' => $order, 'limit' => $limit, 'offset' => $offset));
$cnt = 0;
$results = array();
foreach ($batch as $plugin) {
    $results[] = $plugin;
    $cnt++;
    if ($cnt >= $limit) {
        break;
    }
}
$options = array('limit' => 0, 'full_view' => false, 'list_type_toggle' => false, 'pagination' => false);
$list = elgg_view_entity_list($results, $options);
$time = microtime(true) - $mt;
if (!$noStats) {
    echo '<p class="stats">';
    if ($query) {
        echo elgg_echo('srokap_plugin_installer:search:stats:query', array($query)) . '<br/>';
    }
    if ($category) {
        $categories = srokap_plugin::getCategories();