Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
"MDL-13766, ->pixpath doesn't work in web service, use ->httpswwwroot…
… instead"
  • Loading branch information
dongsheng committed Jun 4, 2009
1 parent 684796f commit 1c05907
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions repository/alfresco/repository.class.php
Expand Up @@ -113,11 +113,11 @@ public function get_listing($uuid = '', $path = '') {
{
$ret['list'][] = array('title'=>$child->child->cm_name,
'path'=>$child->child->id,
'thumbnail'=>$CFG->pixpath.'/f/folder.gif',
'thumbnail'=>$CFG->httpswwwroot.'/pix/f/folder.gif',
'children'=>array());
} elseif ($child->child->type == $file_filter) {
$ret['list'][] = array('title'=>$child->child->cm_name,
'thumbnail' => $CFG->pixpath .'/f/'. mimeinfo('icon32', $child->child->cm_name),
'thumbnail' => $CFG->httpswwwroot .'/pix/f/'. mimeinfo('icon32', $child->child->cm_name),
'source'=>$child->child->id);
}
}
Expand Down
10 changes: 9 additions & 1 deletion repository/boxnet/repository.class.php
Expand Up @@ -154,7 +154,7 @@ public function search($search_text) {
'date'=>$filedates[$n],
'source'=>'http://box.net/api/1.0/download/'
.$this->options['auth_token'].'/'.$fileids[$n],
'thumbnail'=>$CFG->pixpath.'/f/'.mimeinfo('icon32', $v));
'thumbnail'=>$CFG->httpswwwroot.'/pix/f/'.mimeinfo('icon32', $v));
}
}
}
Expand Down Expand Up @@ -208,6 +208,14 @@ public function print_login(){
$ret = array();
$ret['login'] = array($ticket_field, $user_field, $passwd_field);
return $ret;
} else {
echo '<table>';
echo '<tr><td><label>'.get_string('username', 'repository_boxnet').'</label></td>';
echo '<td><input type="text" name="boxusername" /></td></tr>';
echo '<tr><td><label>'.get_string('password', 'repository_boxnet').'</label></td>';
echo '<td><input type="password" name="boxpassword" /></td></tr>';
echo '<input type="hidden" name="ticket" value="'.$t['ticket'].'" />';
echo '</table>';
}
}

Expand Down
4 changes: 2 additions & 2 deletions repository/filesystem/repository.class.php
Expand Up @@ -97,7 +97,7 @@ public function get_listing($path = '', $page = '') {
'source' => $path.'/'.$file,
'size' => filesize($this->root_path.$file),
'date' => time(),
'thumbnail' => $CFG->pixpath .'/f/'. mimeinfo('icon32', $this->root_path.$file)
'thumbnail' => $CFG->httpswwwroot .'/pix/f/'. mimeinfo('icon32', $this->root_path.$file)
);
} else {
if (!empty($path)) {
Expand All @@ -108,7 +108,7 @@ public function get_listing($path = '', $page = '') {
$list['list'][] = array(
'title' => $file,
'children' => array(),
'thumbnail' => $CFG->pixpath .'/f/folder-32.png',
'thumbnail' => $CFG->httpswwwroot .'/pix/f/folder-32.png',
'path' => $current_path
);
}
Expand Down
6 changes: 3 additions & 3 deletions repository/lib.php
Expand Up @@ -770,7 +770,7 @@ public static function move_to_filepool($path, $name, $itemid, $filearea = 'user
return array('url'=>$ret->get_url(),
'id'=>$file->get_itemid(),
'file'=>$file->get_filename(),
'icon'=>$CFG->pixpath.'/f/'.mimeinfo('icon32', $path)
'icon'=>$CFG->httpswwwroot.'/pix/f/'.mimeinfo('icon32', $path)
);
} else {
return null;
Expand Down Expand Up @@ -923,7 +923,7 @@ public static function build_tree($fileinfo, $search, $dynamicmode, &$list) {
'size' => 0,
'date' => $filedate,
'path' => array_reverse($path),
'thumbnail' => $CFG->pixpath .'/f/folder-32.png'
'thumbnail' => $CFG->httpswwwroot .'/pix/f/folder-32.png'
);

//if ($dynamicmode && $child->is_writable()) {
Expand Down Expand Up @@ -961,7 +961,7 @@ public static function build_tree($fileinfo, $search, $dynamicmode, &$list) {
'date' => $filedate,
//'source' => $child->get_url(),
'source' => base64_encode($source),
'thumbnail' => $CFG->pixpath .'/f/'. mimeinfo('icon32', $filename)
'thumbnail' => $CFG->httpswwwroot .'/pix/f/'. mimeinfo('icon32', $filename)
);
$filecount++;
}
Expand Down
4 changes: 2 additions & 2 deletions repository/mahara/repository.class.php
Expand Up @@ -206,15 +206,15 @@ public function get_listing($path = null, $page = 1, $search = '') {
$list = array();
if (!empty($filesandfolders['folders'])) {
foreach ($filesandfolders['folders'] as $folder) {
$list[] = array('path'=>$folder['id'], 'title'=>$folder['title'], 'date'=>$folder['mtime'], 'size'=>'0', 'children'=>array(), 'thumbnail' => $CFG->pixpath .'/f/folder.gif');
$list[] = array('path'=>$folder['id'], 'title'=>$folder['title'], 'date'=>$folder['mtime'], 'size'=>'0', 'children'=>array(), 'thumbnail' => $CFG->httpswwwroot .'/pix/f/folder.gif');
}
}
if (!empty($filesandfolders['files'])) {
foreach ($filesandfolders['files'] as $file) {
if ($file['artefacttype'] == 'image') {
$thumbnail = $host->wwwroot."/artefact/file/download.php?file=".$file['id']."&size=70x55";
} else {
$thumbnail = $CFG->pixpath .'/f/'. mimeinfo('icon32', $file['title']);
$thumbnail = $CFG->httpswwwroot .'/pix/f/'. mimeinfo('icon32', $file['title']);
}
$list[] = array( 'title'=>$file['title'], 'date'=>$file['mtime'], 'source'=>$file['id'], 'thumbnail' => $thumbnail);
}
Expand Down
4 changes: 2 additions & 2 deletions repository/s3/repository.class.php
Expand Up @@ -31,7 +31,7 @@ public function get_listing($path = '', $page = '') {
$folder = array(
'title' => $bucket,
'children' => array(),
'thumbnail'=>$CFG->pixpath.'/f/folder-32.png',
'thumbnail'=>$CFG->httpswwwroot.'/pix/f/folder-32.png',
'path'=>$bucket
);
$tree[] = $folder;
Expand All @@ -45,7 +45,7 @@ public function get_listing($path = '', $page = '') {
'size'=>$file['size'],
'date'=>userdate($file['time']),
'source'=>$path.'/'.$file['name'],
'thumbnail'=>$CFG->pixpath.'/f/'.mimeinfo('icon32', $file['name'])
'thumbnail'=>$CFG->httpswwwroot.'/pix/f/'.mimeinfo('icon32', $file['name'])
);
}
}
Expand Down

0 comments on commit 1c05907

Please sign in to comment.