From: dongsheng Date: Wed, 9 Jul 2008 07:48:33 +0000 (+0000) Subject: MDL-15488, paging for flickr plugin X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5bce597214c8fd447ed7a2c5f257b33e1da5724f;p=moodle.git MDL-15488, paging for flickr plugin --- diff --git a/repository/ws.php b/repository/ws.php index a2d3121462..8853c6592e 100644 --- a/repository/ws.php +++ b/repository/ws.php @@ -1,9 +1,12 @@ repository_cache_expire = 120; +$CFG->repository_cache_expire = 12000; $id = optional_param('id', PARAM_INT); $action = optional_param('action', '', PARAM_RAW); +$p = optional_param('p', '', PARAM_RAW); +$search = optional_param('search', '', PARAM_RAW); + if(!$repository = $DB->get_record('repository', array('id'=>$id))) { echo json_encode('wrong'); die; @@ -20,7 +23,14 @@ if(is_file($CFG->dirroot.'/repository/'.$repository->repositorytype.'/repository } if($action == 'list') { - echo json_encode($repo->get_listing()); + if(!empty($p)) { + echo json_encode($repo->get_listing($p)); + } else if(!empty($search)) { + echo json_encode($repo->get_listing('', $search)); + } else { + echo json_encode($repo->get_listing()); + } + } else { echo json_encode($repo->print_login()); }