Exemple #1
0
$result = modmgr_utils::get_installed_modules();
if (!$result[0]) {
    $this->_DisplayErrorPage($id, $params, $returnid, $result[1]);
    return;
}
$instmodules = $result[1];
if (isset($params['submit'])) {
    $url = $this->GetPreference('module_repository');
    $error = 0;
    $term = trim($params['term']);
    if (strlen($term) < 3) {
        echo $this->ShowErrors($this->Lang('error_searchterm'));
        return;
    }
    $advanced = (int) $params['advanced'];
    $res = modulerep_client::search($term, $advanced);
    if (!is_array($res) || $res[0] == FALSE) {
        echo $this->ShowErrors($this->Lang('error_search') . ' ' . $res[1]);
        return;
    }
    if (!is_array($res[1])) {
        echo $this->ShowMessage($this->Lang('search_noresults'));
        return;
    }
    $res = $res[1];
    $data = array();
    if (count($res)) {
        $res = modmgr_utils::build_module_data($res, $instmodules);
    }
    $search_data = array();
    for ($i = 0; $i < count($res); $i++) {