original_string: private function build_list($photos, $page = 1, &$ret) {
          if (!empty($this->nsid)) {
              $photos_url = $this->flickr->urls_getUserPhotos($this->nsid);
              $ret['manage'] = $photos_url;
          }
          $ret['list']  = array();
          $ret['nosearch'] = true;
          $ret['norefresh'] = true;
          $ret['logouttext'] = get_string('backtosearch', 'repository_flickr_public');
          $ret['pages'] = $photos['pages'];
          if (is_int($page) && $page <= $ret['pages']) {
              $ret['page'] = $page;
          } else {
              $ret['page'] = 1;
          }
          if (!empty($photos['photo'])) {
              foreach ($photos['photo'] as $p) {
                  if(empty($p['title'])) {
                      $p['title'] = get_string('notitle', 'repository_flickr');
                  }
                  if (isset($p['originalformat'])) {
                      $format = $p['originalformat'];
                  } else {
                      $format = 'jpg';
                  }
                  $format = '.'.$format;
                  if (substr($p['title'], strlen($p['title'])-strlen($format)) != $format) {
                      // append author id
                      // $p['title'] .= '-'.$p['owner'];
                      // append file extension
                      $p['title'] .= $format;
                  }
                  $ret['list'][] = array(
                      'title'=>$p['title'],
                      'source'=>$p['id'],
                      'id'=>$p['id'],
                      'thumbnail'=>$this->flickr->buildPhotoURL($p, 'Square'),
                      'date'=>'',
                      'size'=>'unknown',
                      'url'=>'http://www.flickr.com/photos/'.$p['owner'].'/'.$p['id'],
                      'haslicense'=>true,
                      'hasauthor'=>true
                  );
              }
          }
          return $ret;
      }
code: private function build_list($photos, $page = 1, &$ret) {
          if (!empty($this->nsid)) {
              $photos_url = $this->flickr->urls_getUserPhotos($this->nsid);
              $ret['manage'] = $photos_url;
          }
          $ret['list']  = array();
          $ret['nosearch'] = true;
          $ret['norefresh'] = true;
          $ret['logouttext'] = get_string('backtosearch', 'repository_flickr_public');
          $ret['pages'] = $photos['pages'];
          if (is_int($page) && $page <= $ret['pages']) {
              $ret['page'] = $page;
          } else {
              $ret['page'] = 1;
          }
          if (!empty($photos['photo'])) {
              foreach ($photos['photo'] as $p) {
                  if(empty($p['title'])) {
                      $p['title'] = get_string('notitle', 'repository_flickr');
                  }
                  if (isset($p['originalformat'])) {
                      $format = $p['originalformat'];
                  } else {
                      $format = 'jpg';
                  }
                  $format = '.'.$format;
                  if (substr($p['title'], strlen($p['title'])-strlen($format)) != $format) {
                      // append author id
                      // $p['title'] .= '-'.$p['owner'];
                      // append file extension
                      $p['title'] .= $format;
                  }
                  $ret['list'][] = array(
                      'title'=>$p['title'],
                      'source'=>$p['id'],
                      'id'=>$p['id'],
                      'thumbnail'=>$this->flickr->buildPhotoURL($p, 'Square'),
                      'date'=>'',
                      'size'=>'unknown',
                      'url'=>'http://www.flickr.com/photos/'.$p['owner'].'/'.$p['id'],
                      'haslicense'=>true,
                      'hasauthor'=>true
                  );
              }
          }
          return $ret;
      }
code_tokens: private function build_list ( $ photos , $ page = 1 , & $ ret ) { if ( ! empty ( $ this -> nsid ) ) { $ photos_url = $ this -> flickr -> urls_getUserPhotos ( $ this -> nsid ) ; $ ret [ 'manage' ] = $ photos_url ; } $ ret [ 'list' ] = array ( ) ; $ ret [ 'nosearch' ] = true ; $ ret [ 'norefresh' ] = true ; $ ret [ 'logouttext' ] = get_string ( 'backtosearch' , 'repository_flickr_public' ) ; $ ret [ 'pages' ] = $ photos [ 'pages' ] ; if ( is_int ( $ page ) && $ page <= $ ret [ 'pages' ] ) { $ ret [ 'page' ] = $ page ; } else { $ ret [ 'page' ] = 1 ; } if ( ! empty ( $ photos [ 'photo' ] ) ) { foreach ( $ photos [ 'photo' ] as $ p ) { if ( empty ( $ p [ 'title' ] ) ) { $ p [ 'title' ] = get_string ( 'notitle' , 'repository_flickr' ) ; } if ( isset ( $ p [ 'originalformat' ] ) ) { $ format = $ p [ 'originalformat' ] ; } else { $ format = 'jpg' ; } $ format = '.' . $ format ; if ( substr ( $ p [ 'title' ] , strlen ( $ p [ 'title' ] ) - strlen ( $ format ) ) != $ format ) { // append author id // $p['title'] .= '-'.$p['owner']; // append file extension $ p [ 'title' ] .= $ format ; } $ ret [ 'list' ] [ ] = array ( 'title' => $ p [ 'title' ] , 'source' => $ p [ 'id' ] , 'id' => $ p [ 'id' ] , 'thumbnail' => $ this -> flickr -> buildPhotoURL ( $ p , 'Square' ) , 'date' => '' , 'size' => 'unknown' , 'url' => 'http://www.flickr.com/photos/' . $ p [ 'owner' ] . '/' . $ p [ 'id' ] , 'haslicense' => true , 'hasauthor' => true ) ; } } return $ ret ; }
docstring: build an image list
  
  @param array $photos
  @param int $page
  @return array
docstring_tokens: build an image list