From 7c3997001c8eff8caaabd858d3100b485fa30ee7 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 13 Mar 2008 20:30:43 +0000 Subject: [PATCH] fix a bug where keys don't show after creating a new folder --- tantan/wordpress-s3/class-plugin.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tantan/wordpress-s3/class-plugin.php b/tantan/wordpress-s3/class-plugin.php index 0186e4a..f298577 100644 --- a/tantan/wordpress-s3/class-plugin.php +++ b/tantan/wordpress-s3/class-plugin.php @@ -268,10 +268,15 @@ class TanTanWordPressS3Plugin { printf($context, $out); } function media_upload_content() { - if (!$this->options) $this->options = get_option('tantan_wordpress_s3'); - require_once(dirname(__FILE__).'/lib.s3.php'); - $this->s3 = new TanTanS3($this->options['key'], $this->options['secret']); $this->upload_files_tantan_amazons3(); // process any uploaded files or new folders + + if (!$this->options) $this->options = get_option('tantan_wordpress_s3'); + //if (!is_object($this->s3)) { + require_once(dirname(__FILE__).'/lib.s3.php'); + $this->s3 = new TanTanS3($this->options['key'], $this->options['secret']); + $this->s3->setOptions($this->options); + //} + add_action('admin_print_scripts', array(&$this, 'upload_tabs_scripts')); wp_iframe(array(&$this, 'tab')); }