Permalink
Browse files

Merge branch 'master' of git://github.com/ckieffer/gallery3-contrib

  • Loading branch information...
2 parents 9e597d7 + 6e605a8 commit c50a8295ebadcf7b8e1e7fafe16114ed7c2d65ee @bharat bharat committed Feb 15, 2011
Showing with 7 additions and 9 deletions.
  1. +3 −9 3.1/modules/twitter/controllers/admin_twitter.php
  2. +4 −0 3.1/modules/twitter/helpers/twitter.php
@@ -19,13 +19,6 @@
*/
class Admin_Twitter_Controller extends Admin_Controller {
- public $default_tweet;
-
- function __construct() {
- parent::__construct();
- $this->default_tweet = t("Check out this %type, '%title': %description %url");
- }
-
/**
* bit.ly module's settings
* @todo Show default tweet value after resetting it!
@@ -39,8 +32,7 @@ public function index() {
$consumer_secret = $form->twitter_oauth->consumer_secret->value;
$reset_tweet = $form->twitter_message->reset_tweet->value;
if ($reset_tweet) {
- $default_tweet = $this->default_tweet;
- $form->twitter_message->default_tweet->value = $this->default_tweet;
+ $default_tweet = twitter::reset_default_tweet();
} else {
$default_tweet = $form->twitter_message->default_tweet->value;
}
@@ -50,7 +42,9 @@ public function index() {
module::set_var("twitter", "consumer_secret", $consumer_secret);
module::set_var("twitter", "default_tweet", $default_tweet);
module::set_var("twitter", "shorten_urls", $shorten_urls);
+
message::success("Twitter settings saved");
+ url::redirect("admin/twitter");
}
}
$is_registered = twitter::is_registered();
@@ -133,4 +133,8 @@ static function is_registered() {
}
}
+ static function reset_default_tweet() {
+ return t("Check out this %type, '%title': %description %url");
+ }
+
}

0 comments on commit c50a829

Please sign in to comment.