From 7892948d1f6ee00979a5330b01565b9ebf87aafe Mon Sep 17 00:00:00 2001 From: jerome Date: Mon, 15 Sep 2008 08:42:56 +0000 Subject: [PATCH] MDL-15402: minor changes for flickr admin settings --- lang/en_utf8/repository_flickr.php | 1 + repository/flickr/repository.class.php | 19 +++++++++++++------ repository/lib.php | 25 +++++++++++++++++++------ 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/lang/en_utf8/repository_flickr.php b/lang/en_utf8/repository_flickr.php index 643640e10db..5420e6921b5 100644 --- a/lang/en_utf8/repository_flickr.php +++ b/lang/en_utf8/repository_flickr.php @@ -1,6 +1,7 @@ wwwroot.'/repository/ws.php?callback=yes&repo_id='.$instances[0]->id; + } + if (empty($api_key)) { $api_key = ''; } if (empty($secret)) { $secret = ''; } - if (empty($callbackurl)) { - $callbackurl = $CFG->wwwroot.'/repository/ws.php?callback=yes&repo_id='; - } + $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')); diff --git a/repository/lib.php b/repository/lib.php index aa5621faeec..6d6db042e7b 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -872,6 +872,20 @@ abstract class repository { return true; } + /** + * function which is run when a type is created + * This should be a function from a type, but as I plugin wrtie, only write + * a class extended from repository class, the init() for type has been placed + * into the repository. + */ + public static function type_init(){ + + } + + public static function add_unremovable_instances(){ + + } + /** * Return true if the plugin type has at least one general option field * By default: false @@ -1005,8 +1019,8 @@ function repository_get_instances($contexts=array(), $userid = null, $onlyvisibl $params[] = $context->id; } - if ($firstcontext) { - $sql .=')'; + if (!empty($firstcontext)) { + $sql .=')'; } if ($onlyvisible == true) { @@ -1274,7 +1288,7 @@ function repository_get_client($context) { .fp-grid .label{height:48px} .fp-grid span{background: #EEF9EB;color:gray} - EOD; +EOD; $js = << @@ -1288,7 +1302,7 @@ function repository_get_client($context) { - EOD; +EOD; $CFG->repo_yui_loaded = true; } else { $js = ''; @@ -2314,8 +2328,7 @@ function repository_display_instances_list($context, $typename = null) { $addable = 1; $instancehtml .= "

-
"; - } + "; } if ($addable) {