Skip to content

Commit

Permalink
MDL-15488, paging for flickr plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsheng committed Jul 9, 2008
1 parent b2d8bce commit 5bce597
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions repository/ws.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php
require_once('../config.php');
require_once('lib.php');
$CFG->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;
Expand All @@ -20,7 +23,14 @@
}

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());
}
Expand Down

0 comments on commit 5bce597

Please sign in to comment.