<?php
$string['apikey'] = 'API Key';
-$string['repositoryname'] = 'Box.net';
-$string['repositorydesc'] = 'Repository on Box.net';
$string['configplugin'] = 'Box.net configuration';
-$string['username'] = 'Username for Box.net';
-$string['password'] = 'Password';
-$string['saved'] = 'Box.net data saved';
+$string['information'] = '<div style=\"font-size:0.8em\">Get <a href=\"http://enabled.box.net/\">Box.net API Key</a> for your Moodle site. </div>';
$string['invalidpassword'] = 'Invalid password';
$stirng['invalidtoken'] = 'Invalid authentication token';
$string['nullfilelist'] = 'There are no files in this repository';
-$string['username'] = 'Box.net account';
-$string['password'] = 'Box.net password';
+$string['password'] = 'Password';
+$string['repositorydesc'] = 'Repository on Box.net';
+$string['repositoryname'] = 'Box.net';
+$string['saved'] = 'Box.net data saved';
$string['shareurl'] = 'Share URL';
+$string['username'] = 'Username for Box.net';
<?php
$string['apikey'] = 'API Key';
$string['callbackurl'] = 'Callback URL';
-$string['callbackwarning'] = 'You will need to copy the callback URL into Flickr. This callback URL will be generated once you save this information. Please click on Save button, then on Settings in order to check the generated callback URL';
+$string['callbackurltext'] = '<div style=\"font-size:0.8em\">1. Get <a href=\"http://www.flickr.com/services/api/keys/\">Flickr API Key and Secret</a> for your Moodle site.<br/>2. Your callback URL is <strong>$a</strong><br/>3. Edit your <a href=\"http://www.flickr.com/services/api/keys/\">Flickr</a> key details and set the callback URL. </div>';
+$string['callbackwarning'] = '<div style=\"font-size:0.8em\">1. Get <a href=\"http://www.flickr.com/services/api/keys/\">Flickr API Key and Secret</a> for your Moodle site.<br/>2. Your callback URL <strong>will be</strong> generated <strong>once</strong> you save these above information. Please click on Save button, then on <strong>Settings</strong> in order to check the generated callback URL.<br/>3. Edit your <a href=\"http://www.flickr.com/services/api/keys/\">Flickr</a> key details and set the callback URL.</div> ';
$string['configplugin'] = 'Flickr configuration';
$string['emailaddress'] = 'Email address';
$string['invalidemail'] = 'Invalid email address for flickr';
$string['callbackurl'] = 'Callback URL';
$string['configplugin'] = 'Flickr Public configuration';
$string['emailaddress'] = 'Email address';
+$string['information'] = '<div style=\"font-size:0.8em\">Get <a href=\"http://www.flickr.com/services/api/keys/\">Flickr API Key</a> for your Moodle site. </div>';
$string['invalidemail'] = 'Invalid email address for flickr';
$string['notitle'] = 'notitle';
$string['nullphotolist'] = 'There are no photos in this account';
$strrequired = get_string('required');
$mform->addElement('text', 'api_key', get_string('apikey', 'repository_boxnet'), array('value'=>$api_key,'size' => '40'));
$mform->addRule('api_key', $strrequired, 'required', null, 'client');
+ $mform->addElement('static', null, '', get_string('information','repository_boxnet'));
}
public function instance_config_form(&$mform) {
$api_key = get_config('flickr', 'api_key');
$secret = get_config('flickr', 'secret');
- //retrieve the flickr instances
- $instances = repository_get_instances(array(),null,false,"flickr");
- if (empty($instances)) {
- $callbackurl = get_string("callbackwarning","repository_flickr");
- }
- else {
- $callbackurl = $CFG->wwwroot.'/repository/ws.php?callback=yes&repo_id='.$instances[0]->id;
- }
+
if (empty($api_key)) {
$api_key = '';
if (empty($secret)) {
$secret = '';
}
+/*
+ $noticetext = get_string('notice', 'repository_flickr');
+ //$noticetext = 'a[';
+ //var_dump($noticetext);
+ if (strpos($noticetext, '[')==0) {
+ $mform->addElement('static', 'notice', '<strong>'.get_string('notice', 'repository').'</strong>', '<i>'.$noticetext.'</i>');
+ }
+ * */
+
+
$strrequired = get_string('required');
$mform->addElement('text', 'api_key', get_string('apikey', 'repository_flickr'), array('value'=>$api_key,'size' => '40'));
$mform->addElement('text', 'secret', get_string('secret', 'repository_flickr'), array('value'=>$secret,'size' => '40'));
- $mform->addElement('static', 'callbackurl', get_string('callbackurl', 'repository_flickr'), $callbackurl);
+
+ //retrieve the flickr instances
+ $instances = repository_get_instances(array(),null,false,"flickr");
+ if (empty($instances)) {
+ $callbackurl = get_string("callbackwarning","repository_flickr");
+ $mform->addElement('static', null, '', $callbackurl);
+ }
+ else {
+ $callbackurl = $CFG->wwwroot.'/repository/ws.php?callback=yes&repo_id='.$instances[0]->id;
+ $mform->addElement('static', 'callbackurl', '', get_string('callbackurltext', 'repository_flickr', $callbackurl));
+ }
+
$mform->addRule('api_key', $strrequired, 'required', null, 'client');
$mform->addRule('secret', $strrequired, 'required', null, 'client');
$strrequired = get_string('required');
$mform->addElement('text', 'api_key', get_string('apikey', 'repository_flickr_public'), array('value'=>$api_key,'size' => '40'));
$mform->addRule('api_key', $strrequired, 'required', null, 'client');
+ $mform->addElement('static', null, '', get_string('information','repository_flickr_public'));
}
public static function get_admin_option_names() {
public static function plugin_init() {
- //here we create a default instances for this type
+ //here we create a default instance for this type
repository_static_function('flickr_public','create', 'flickr_public', 0, get_system_context(), array('name' => 'default instance','email_address' => null),1);
- //create(0, get_system_context(), array('name' => 'default instance'),1);
- /*
- $success = repository_static_function($plugin, 'create', $plugin, 0, get_context_instance_by_id($contextid), $fromform);
- $defaultinstance = new repository ();
- * */
}
}