diff --git a/repository/boxnet/repository.class.php b/repository/boxnet/repository.class.php index f1afae2806c..71c79d43ee7 100755 --- a/repository/boxnet/repository.class.php +++ b/repository/boxnet/repository.class.php @@ -83,7 +83,7 @@ class repository_boxnet extends repository{ public function get_login(){ global $DB; - if ($entry = $DB->get_record('repository', array('id'=>$this->id))) { + if ($entry = $DB->get_record('repository_instances', array('id'=>$this->id))) { $ret->username = $entry->username; $ret->password = $entry->password; } else { diff --git a/repository/flickr/repository.class.php b/repository/flickr/repository.class.php index d7b3d0fd567..d14f145f654 100755 --- a/repository/flickr/repository.class.php +++ b/repository/flickr/repository.class.php @@ -154,7 +154,7 @@ EOD; $format = 'jpg'; } $ret->list[] = - array('title'=>$p['title'].'.'.$format,'source'=>$p['id'],'id'=>$p['id'],'thumbnail'=>$this->flickr->buildPhotoURL($p, 'Square'), 'date'=>'', 'size'=>'unknown'); + array('title'=>$p['title'].'.'.$format,'source'=>$p['id'],'id'=>$p['id'],'thumbnail'=>$this->flickr->buildPhotoURL($p, 'Square'), 'date'=>'', 'size'=>'unknown', 'url'=>$photos_url.$p['id']); } if(empty($ret)) { throw new repository_exception('nullphotolist', 'repository_flickr'); @@ -233,8 +233,12 @@ EOD; return true; } public function admin_config_form(&$mform) { + $api_key = get_config('flickr', 'api_key'); + if (empty($api_key)) { + $api_key = ''; + } $strrequired = get_string('required'); - $mform->addElement('text', 'api_key', get_string('apikey', 'repository_boxnet')); + $mform->addElement('text', 'api_key', get_string('apikey', 'repository_boxnet'), array('value'=>$api_key)); $mform->addRule('api_key', $strrequired, 'required', null, 'client'); } public static function get_option_names(){ diff --git a/repository/lib.php b/repository/lib.php index 1fe8638e0c7..fa472afb137 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -368,7 +368,8 @@ abstract class repository { * 'date' => (string) file last modification time, usually userdate(...), * 'size' => (int) file size, * 'thumbnail' => (string) url to thumbnail for the file, - * 'source' => plugin-dependent unique path to the file (id, url, path, etc.) + * 'source' => plugin-dependent unique path to the file (id, url, path, etc.), + * 'url'=> the accessible url of file * ), * array( // folder - same as file, but no 'source'. * 'title' => (string) folder name, @@ -567,7 +568,7 @@ function move_to_filepool($path, $name, $itemid) { function get_repository_client($context){ global $CFG, $USER; $suffix = uniqid(); - $filename = get_string('filename', 'repository'); + $strsaveas = get_string('saveas', 'repository').': '; $stradd = get_string('add', 'repository'); $strback = get_string('back', 'repository'); $strclose = get_string('close', 'repository'); @@ -604,6 +605,8 @@ function get_repository_client($context){ #paging-$suffix a{padding: 4px;border: 1px solid #CCC} #path-$suffix a{padding: 4px;background: gray} #panel-$suffix{padding:0;margin:0; text-align:left;} +#rename-form{text-align:center} +#rename-form p{margin: 1em;} p.upload{text-align:right;margin: 5px} p.upload a{font-size: 14px;background: #ccc;color:black;padding: 3px} p.upload a:hover {background: grey;color:white} @@ -611,7 +614,8 @@ p.upload a:hover {background: grey;color:white} .file_date{color:blue} .file_size{color:gray} .grid{width:80px; float:left;text-align:center;} -.grid div{width: 80px; height: 36px; overflow: hidden} +.grid div{width: 80px; overflow: hidden} +.grid .label{height: 36px} .repo-opt{font-size: 10px;}