예제 #1
0
파일: lib.php 프로젝트: vuchannguyen/web
 public function search($search_text)
 {
     $client = new wikimedia();
     $search_result = array();
     $search_result['list'] = $client->search_images($search_text);
     return $search_result;
 }
예제 #2
0
 public function get_listing($path = '', $page = '')
 {
     global $OUTPUT;
     $client = new wikimedia();
     $result = $client->search_images($this->keyword);
     $list = array();
     $list['list'] = array();
     foreach ($result as $title => $url) {
         $list['list'][] = array('title' => substr($title, 5), 'thumbnail' => $OUTPUT->old_icon_url(file_extension_icon('xx.jpg', 32)), 'source' => $url, 'url' => $url);
     }
     return $list;
 }
 public function get_listing($path = '', $page = '')
 {
     global $CFG;
     $client = new wikimedia();
     $result = $client->search_images($this->keyword);
     $list = array();
     $list['list'] = array();
     foreach ($result as $title => $url) {
         $list['list'][] = array('title' => substr($title, 5), 'thumbnail' => $CFG->pixpath . '/f/' . mimeinfo('icon32', 'xx.jpg'), 'source' => $url, 'url' => $url);
     }
     return $list;
 }