diff options
author | Brion Vibber <brion@pobox.com> | 2010-10-07 13:05:51 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-10-07 13:05:51 -0700 |
commit | cad480551675c05452df109e5c4d43018139d6a1 (patch) | |
tree | cae0307fc9402fea2b9fe44e8b03b8f9c3017705 /plugins/BitlyUrl/bitlyadminpanelaction.php | |
parent | 80f0b9421f63be2f4b8ebd7b722b138da220dc45 (diff) |
Clean up bit.ly admin panel behavior, and hide it from the shorteners list if it's not fully configured.
Diffstat (limited to 'plugins/BitlyUrl/bitlyadminpanelaction.php')
-rw-r--r-- | plugins/BitlyUrl/bitlyadminpanelaction.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/BitlyUrl/bitlyadminpanelaction.php b/plugins/BitlyUrl/bitlyadminpanelaction.php index 56f78e164..805b56b85 100644 --- a/plugins/BitlyUrl/bitlyadminpanelaction.php +++ b/plugins/BitlyUrl/bitlyadminpanelaction.php @@ -206,11 +206,18 @@ class BitlyAdminPanelForm extends AdminForm array('id' => 'settings_bitly') ); $this->out->element('legend', null, _m('Default credentials')); - $this->out->element('p', 'form_guide', - _m('When users select the bit.ly shortening service, by default ' . - 'these credentials will be used. If you leave these empty, ' . - 'users will need to set up their own credentials in order to ' . - 'use bit.ly.')); + + // Do we have global defaults to fall back on? + $login = $apiKey = false; + Event::handle('BitlyDefaultCredentials', array(&$login, &$apiKey)); + $haveGlobalDefaults = ($login && $apiKey); + if ($login && $apiKey) { + $this->out->element('p', 'form_guide', + _m('Leave these empty to use the default credentials.')); + } else { + $this->out->element('p', 'form_guide', + _m('If you leave these empty, bit.ly will be unavailable to users.')); + } $this->out->elementStart('ul', 'form_data'); $this->li(); |