From 4bb745adfa9c8252e436253b031d8458b6c7ef1a Mon Sep 17 00:00:00 2001
From: Dan Poltawski <dan.poltawski@luns.net.uk>
Date: Wed, 26 Oct 2011 16:14:42 +0100
Subject: [PATCH 1/1] Remove unused code

---
 repository/repository_ajax.php |   30 ------------------------------
 1 files changed, 0 insertions(+), 30 deletions(-)

diff --git a/repository/repository_ajax.php b/repository/repository_ajax.php
index 6fe4456..f3bc095 100644
--- a/repository/repository_ajax.php
+++ b/repository/repository_ajax.php
@@ -92,36 +92,6 @@ if ($maxbytes == 0 || $maxbytes>=$moodle_maxbytes) {
 /// 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(get_context_instance_by_id($contextid), get_system_context());
-        $params['currentcontext'] = get_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;
-}
-
 if (file_exists($CFG->dirroot.'/repository/'.$type.'/lib.php')) {
     require_once($CFG->dirroot.'/repository/'.$type.'/lib.php');
     $classname = 'repository_' . $type;
-- 
1.7.5.4

