diff --git a/repository/lib.php b/repository/lib.php index 7973c6e33d6..276c0e9edb0 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -3219,14 +3219,3 @@ function initialise_filepicker($args) { } return $return; } - -/** - * Small function to walk an array to attach repository ID - * - * @param array $value - * @param string $key - * @param int $id - */ -function repository_attach_id(&$value, $key, $id){ - $value['repo_id'] = $id; -} diff --git a/repository/repository_ajax.php b/repository/repository_ajax.php index 162bbe3bfea..21ebc1aea57 100644 --- a/repository/repository_ajax.php +++ b/repository/repository_ajax.php @@ -89,36 +89,6 @@ $maxbytes = get_user_max_upload_file_size($context, $CFG->maxbytes, $coursemaxby // Wait as long as it takes for this script to finish set_time_limit(0); -// Early actions which need to be done before repository instances initialised -switch ($action) { - // global search - case 'gsearch': - $params = array(); - $params['context'] = array(context::instance_by_id($contextid), context_system::instance()); - $params['currentcontext'] = context::instance_by_id($contextid); - $repos = repository::get_instances($params); - $list = array(); - foreach($repos as $repo){ - if ($repo->global_search()) { - $ret = $repo->search($search_text); - array_walk($ret['list'], 'repository_attach_id', $repo->id); // See function below - $tmp = array_merge($list, $ret['list']); - $list = $tmp; - } - } - $listing = array('list'=>$list); - $listing['gsearch'] = true; - die(json_encode($listing)); - break; - - // remove the cache files & logout - case 'ccache': - $cache = new curl_cache; - $cache->refresh(); - $action = 'list'; - break; -} - // These actions all occur on the currently active repository instance switch ($action) { case 'sign': diff --git a/repository/upgrade.txt b/repository/upgrade.txt index fdaed9f9f2f..bd724428512 100644 --- a/repository/upgrade.txt +++ b/repository/upgrade.txt @@ -7,6 +7,7 @@ http://docs.moodle.org/dev/Repository_API * get_option() now always return null when the first parameter ($config) is not empty, and no value was found for this $config. Previously this could sometimes return an empty array(). +* The function repository_attach_id() was removed, it was never used and was not useful. === 2.5 ===