]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15402: add some help texts to filckr/boxnet plugins
authorjerome <jerome>
Wed, 17 Sep 2008 06:09:10 +0000 (06:09 +0000)
committerjerome <jerome>
Wed, 17 Sep 2008 06:09:10 +0000 (06:09 +0000)
lang/en_utf8/repository_boxnet.php
lang/en_utf8/repository_flickr.php
lang/en_utf8/repository_flickr_public.php
repository/boxnet/repository.class.php
repository/flickr/repository.class.php
repository/flickr_public/repository.class.php

index a8d1eece89abc4b95ba3132de697012dbfb26752..b947fde097259777a768dae523128e355c1007f8 100644 (file)
@@ -1,14 +1,13 @@
 <?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';
index 5420e6921b57d9018929b9bf8c63fdd4c6fcfd5f..3245373ab4209d5c2215c742eaaee21ce2385ecc 100644 (file)
@@ -1,7 +1,8 @@
 <?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';
index be97c779d79b3e3678b5e69cc7d594ba1aabe4ba..ee393afb6217c6b395269768b716d413675557c3 100644 (file)
@@ -3,6 +3,7 @@ $string['apikey'] = 'API Key';
 $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';
index 9c029fde000050e6d3a9b50755404067af5d3146..0fe94685802b23a9ff928f1ff12ea45ffbae15a8 100755 (executable)
@@ -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) {
index cdb51acf4cdb3839eafb3922d4358bfdfa635f48..7c934fe5018f53c70660c1a8c7ec18745a9ac74d 100755 (executable)
@@ -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', '<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&amp;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');
index beab04675e289a61d1c906e107d3522f8e284798..512f128993a8f885e139ec77d8c3806ca2332383 100644 (file)
@@ -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 ();
-         * */
     }
 
 }