MDL-15666 adding data mod tables to list of tables to clean up
[moodle.git] / portfolio / type / flickr / lib.php
CommitLineData
7e95408b 1<?php
2require_once($CFG->libdir.'/filelib.php');
3require_once($CFG->dirroot.'/repository/flickr/phpFlickr.php');
4
5class portfolio_plugin_flickr extends portfolio_plugin_push_base {
6
7 private $flickr;
8
ea0de12f 9 public static function supported_formats() {
10 return array(PORTFOLIO_FORMAT_IMAGE);
11 }
12
0f71f48b 13 public static function get_name() {
14 return get_string('pluginname', 'portfolio_flickr');
15 }
16
7e95408b 17 public function prepare_package() {
18 $this->flickr = new phpFlickr($this->get_config('apikey'), $this->get_config('sharedsecret'));
19 return true; // don't do anything else for this plugin, we want to send all files as they are.
20 }
21
22 public function send_package() {
23
24 }
25
26 public function get_continue_url() {
27 return 'http://www.flickr.com/files#0:f:' . $this->get_export_config('folder');
28 }
29
30 public function expected_time($callertime) {
31 return $callertime;
32 }
33
34 public static function get_allowed_config() {
35 return array('apikey', 'sharedsecret');
36 }
37
38 public static function has_admin_config() {
39 return true;
40 }
41
42 public function admin_config_form(&$mform) {
43 $strrequired = get_string('required');
44 $mform->addElement('text', 'apikey', get_string('apikey', 'portfolio_flickr'));
45 $mform->addRule('apikey', $strrequired, 'required', null, 'client');
46 $mform->addElement('text', 'sharedsecret', get_string('sharedsecret', 'portfolio_flickr'));
47 $mform->addRule('sharedsecret', $strrequired, 'required', null, 'client');
48 }
49
50}