From 4026d7248777d30a84519e4e2f99f620ef222b35 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Fri, 21 Nov 2008 07:07:04 +0000 Subject: [PATCH] "REPOSITORY/MDL-15488, send 'search_result' flag to file picker" --- repository/flickr_public/repository.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/repository/flickr_public/repository.class.php b/repository/flickr_public/repository.class.php index 4b2d062ec0..1f8bdb8024 100644 --- a/repository/flickr_public/repository.class.php +++ b/repository/flickr_public/repository.class.php @@ -75,8 +75,6 @@ class repository_flickr_public extends repository { $this->flickr = new phpFlickr($this->api_key); $this->flickr_account = $this->get_option('email_address'); - // when flickr account hasn't been set by admin, user can - // submit a flickr account here. $account = optional_param('flickr_account', '', PARAM_RAW); $fulltext = optional_param('flickr_fulltext', '', PARAM_RAW); $tag = optional_param('flickr_tag', '', PARAM_RAW); @@ -87,7 +85,9 @@ class repository_flickr_public extends repository { $SESSION->{$this->sess_account} = $account; $SESSION->{$this->sess_tag} = $tag; $SESSION->{$this->sess_text} = $fulltext; - echo json_encode($this->search($fulltext)); + $response = $this->search($fulltext); + $response['search_result'] = true; + echo json_encode($response); exit; } } @@ -169,12 +169,13 @@ class repository_flickr_public extends repository { if (!empty($SESSION->{$this->sess_tag}) or !empty($SESSION->{$this->sess_text}) or !empty($SESSION->{$this->sess_account}) or !empty($this->nsid)) { + $photos = $this->flickr->photos_search(array( 'tags'=>$SESSION->{$this->sess_tag}, 'page'=>$page, 'per_page'=>25, 'user_id'=>$this->nsid, - 'text'=>$search_text)); + 'text'=>$SESSION->{$this->sess_text})); } $ret = array(); return $this->build_list($photos, $page, $ret); -- 2.39.5