From: jerome Date: Wed, 17 Sep 2008 06:09:10 +0000 (+0000) Subject: MDL-15402: add some help texts to filckr/boxnet plugins X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e49eaacbc9cdb73059195805842b02a1395b05d7;p=moodle.git MDL-15402: add some help texts to filckr/boxnet plugins --- diff --git a/lang/en_utf8/repository_boxnet.php b/lang/en_utf8/repository_boxnet.php index a8d1eece89..b947fde097 100644 --- a/lang/en_utf8/repository_boxnet.php +++ b/lang/en_utf8/repository_boxnet.php @@ -1,14 +1,13 @@ Get Box.net API Key for your Moodle site. '; $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'; diff --git a/lang/en_utf8/repository_flickr.php b/lang/en_utf8/repository_flickr.php index 5420e6921b..3245373ab4 100644 --- a/lang/en_utf8/repository_flickr.php +++ b/lang/en_utf8/repository_flickr.php @@ -1,7 +1,8 @@ 1. Get Flickr API Key and Secret for your Moodle site.
2. Your callback URL is $a
3. Edit your Flickr key details and set the callback URL. '; +$string['callbackwarning'] = '
1. Get Flickr API Key and Secret for your Moodle site.
2. Your callback URL will be generated once you save these above information. Please click on Save button, then on Settings in order to check the generated callback URL.
3. Edit your Flickr key details and set the callback URL.
'; $string['configplugin'] = 'Flickr configuration'; $string['emailaddress'] = 'Email address'; $string['invalidemail'] = 'Invalid email address for flickr'; diff --git a/lang/en_utf8/repository_flickr_public.php b/lang/en_utf8/repository_flickr_public.php index be97c779d7..ee393afb62 100644 --- a/lang/en_utf8/repository_flickr_public.php +++ b/lang/en_utf8/repository_flickr_public.php @@ -3,6 +3,7 @@ $string['apikey'] = 'API Key'; $string['callbackurl'] = 'Callback URL'; $string['configplugin'] = 'Flickr Public configuration'; $string['emailaddress'] = 'Email address'; +$string['information'] = '
Get Flickr API Key for your Moodle site.
'; $string['invalidemail'] = 'Invalid email address for flickr'; $string['notitle'] = 'notitle'; $string['nullphotolist'] = 'There are no photos in this account'; diff --git a/repository/boxnet/repository.class.php b/repository/boxnet/repository.class.php index 9c029fde00..0fe9468580 100755 --- a/repository/boxnet/repository.class.php +++ b/repository/boxnet/repository.class.php @@ -186,6 +186,7 @@ class repository_boxnet extends repository { $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) { diff --git a/repository/flickr/repository.class.php b/repository/flickr/repository.class.php index cdb51acf4c..7c934fe501 100755 --- a/repository/flickr/repository.class.php +++ b/repository/flickr/repository.class.php @@ -200,14 +200,7 @@ class repository_flickr extends repository { $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 = ''; @@ -215,11 +208,32 @@ class repository_flickr extends repository { if (empty($secret)) { $secret = ''; } +/* + $noticetext = get_string('notice', 'repository_flickr'); + //$noticetext = 'a['; + //var_dump($noticetext); + if (strpos($noticetext, '[')==0) { + $mform->addElement('static', 'notice', ''.get_string('notice', 'repository').'', ''.$noticetext.''); + } + * */ + + $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'); diff --git a/repository/flickr_public/repository.class.php b/repository/flickr_public/repository.class.php index beab04675e..512f128993 100644 --- a/repository/flickr_public/repository.class.php +++ b/repository/flickr_public/repository.class.php @@ -197,6 +197,7 @@ class repository_flickr_public extends repository { $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() { @@ -205,13 +206,8 @@ class repository_flickr_public extends repository { 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 (); - * */ } }