summaryrefslogtreecommitdiff
path: root/plugins/Adsense
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Adsense')
-rw-r--r--plugins/Adsense/AdsensePlugin.php24
-rw-r--r--plugins/Adsense/adsenseadminpanel.php43
-rw-r--r--plugins/Adsense/locale/Adsense.pot96
3 files changed, 125 insertions, 38 deletions
diff --git a/plugins/Adsense/AdsensePlugin.php b/plugins/Adsense/AdsensePlugin.php
index cd6fc3503..3d733e150 100644
--- a/plugins/Adsense/AdsensePlugin.php
+++ b/plugins/Adsense/AdsensePlugin.php
@@ -77,7 +77,6 @@ if (!defined('STATUSNET')) {
*
* @seeAlso UAPPlugin
*/
-
class AdsensePlugin extends UAPPlugin
{
public $adScript = 'http://pagead2.googlesyndication.com/pagead/show_ads.js';
@@ -89,7 +88,6 @@ class AdsensePlugin extends UAPPlugin
// A little bit of chicanery so we avoid overwriting values that
// are passed in with the constructor
-
foreach (array('mediumRectangle', 'rectangle', 'leaderboard', 'wideSkyscraper', 'adScript', 'client') as $setting) {
$value = common_config('adsense', strtolower($setting));
if (!empty($value)) { // not found
@@ -105,7 +103,6 @@ class AdsensePlugin extends UAPPlugin
*
* @return void
*/
-
protected function showMediumRectangle($action)
{
$this->showAdsenseCode($action, 300, 250, $this->mediumRectangle);
@@ -118,7 +115,6 @@ class AdsensePlugin extends UAPPlugin
*
* @return void
*/
-
protected function showRectangle($action)
{
$this->showAdsenseCode($action, 180, 150, $this->rectangle);
@@ -131,7 +127,6 @@ class AdsensePlugin extends UAPPlugin
*
* @return void
*/
-
protected function showWideSkyscraper($action)
{
$this->showAdsenseCode($action, 160, 600, $this->wideSkyscraper);
@@ -144,7 +139,6 @@ class AdsensePlugin extends UAPPlugin
*
* @return void
*/
-
protected function showLeaderboard($action)
{
$this->showAdsenseCode($action, 728, 90, $this->leaderboard);
@@ -160,7 +154,6 @@ class AdsensePlugin extends UAPPlugin
*
* @return void
*/
-
protected function showAdsenseCode($action, $width, $height, $slot)
{
$code = 'google_ad_client = "'.$this->client.'"; ';
@@ -198,11 +191,22 @@ class AdsensePlugin extends UAPPlugin
function onEndAdminPanelNav($menu) {
if (AdminPanelAction::canAdmin('adsense')) {
// TRANS: Menu item title/tooltip
- $menu_title = _('Adsense configuration');
+ $menu_title = _m('AdSense configuration');
// TRANS: Menu item for site administration
- $menu->out->menuItem(common_local_url('adsenseadminpanel'), _('Adsense'),
+ $menu->out->menuItem(common_local_url('adsenseadminpanel'), _m('AdSense'),
$menu_title, $action_name == 'adsenseadminpanel', 'nav_adsense_admin_panel');
}
return true;
}
-} \ No newline at end of file
+
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => 'BlankAdPlugin',
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Evan Prodromou',
+ 'homepage' => 'http://status.net/wiki/Plugin:Adsense',
+ 'rawdescription' =>
+ _m('Plugin to add Google Adsense to StatusNet sites.'));
+ return true;
+ }
+}
diff --git a/plugins/Adsense/adsenseadminpanel.php b/plugins/Adsense/adsenseadminpanel.php
index 7b99cf805..110cc9e2b 100644
--- a/plugins/Adsense/adsenseadminpanel.php
+++ b/plugins/Adsense/adsenseadminpanel.php
@@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class AdsenseadminpanelAction extends AdminPanelAction
{
/**
@@ -48,10 +47,9 @@ class AdsenseadminpanelAction extends AdminPanelAction
*
* @return string page title
*/
-
function title()
{
- return _('Adsense');
+ return _m('TITLE', 'AdSense');
}
/**
@@ -59,10 +57,9 @@ class AdsenseadminpanelAction extends AdminPanelAction
*
* @return string instructions
*/
-
function getInstructions()
{
- return _('Adsense settings for this StatusNet site');
+ return _m('AdSense settings for this StatusNet site');
}
/**
@@ -70,7 +67,6 @@ class AdsenseadminpanelAction extends AdminPanelAction
*
* @return void
*/
-
function showForm()
{
$form = new AdsenseAdminPanelForm($this);
@@ -83,7 +79,6 @@ class AdsenseadminpanelAction extends AdminPanelAction
*
* @return void
*/
-
function saveSettings()
{
static $settings = array('adsense' => array('adScript', 'client', 'mediumRectangle', 'rectangle', 'leaderboard', 'wideSkyscraper'));
@@ -97,11 +92,9 @@ class AdsenseadminpanelAction extends AdminPanelAction
}
// This throws an exception on validation errors
-
$this->validate($values);
// assert(all values are valid);
-
$config = new Config();
$config->query('BEGIN');
@@ -125,7 +118,6 @@ class AdsenseadminpanelAction extends AdminPanelAction
/**
* Form for the adsense admin panel
*/
-
class AdsenseAdminPanelForm extends AdminForm
{
/**
@@ -133,7 +125,6 @@ class AdsenseAdminPanelForm extends AdminForm
*
* @return int ID of the form
*/
-
function id()
{
return 'form_adsense_admin_panel';
@@ -144,7 +135,6 @@ class AdsenseAdminPanelForm extends AdminForm
*
* @return string class of the form
*/
-
function formClass()
{
return 'form_adsense';
@@ -155,7 +145,6 @@ class AdsenseAdminPanelForm extends AdminForm
*
* @return string URL of the action
*/
-
function action()
{
return common_local_url('adsenseadminpanel');
@@ -166,45 +155,44 @@ class AdsenseAdminPanelForm extends AdminForm
*
* @return void
*/
-
function formData()
{
$this->out->elementStart('fieldset', array('id' => 'adsense_admin'));
$this->out->elementStart('ul', 'form_data');
$this->li();
$this->input('client',
- _('Client ID'),
- _('Google client ID'),
+ _m('Client ID'),
+ _m('Google client ID'),
'adsense');
$this->unli();
$this->li();
$this->input('adScript',
- _('Ad Script URL'),
- _('Script URL (advanced)'),
+ _m('Ad script URL'),
+ _m('Script URL (advanced)'),
'adsense');
$this->unli();
$this->li();
$this->input('mediumRectangle',
- _('Medium rectangle'),
- _('Medium rectangle slot code'),
+ _m('Medium rectangle'),
+ _m('Medium rectangle slot code'),
'adsense');
$this->unli();
$this->li();
$this->input('rectangle',
- _('Rectangle'),
- _('Rectangle slot code'),
+ _m('Rectangle'),
+ _m('Rectangle slot code'),
'adsense');
$this->unli();
$this->li();
$this->input('leaderboard',
- _('Leaderboard'),
- _('Leaderboard slot code'),
+ _m('Leaderboard'),
+ _m('Leaderboard slot code'),
'adsense');
$this->unli();
$this->li();
$this->input('wideSkyscraper',
- _('Skyscraper'),
- _('Wide skyscraper slot code'),
+ _m('Skyscraper'),
+ _m('Wide skyscraper slot code'),
'adsense');
$this->unli();
$this->out->elementEnd('ul');
@@ -215,9 +203,8 @@ class AdsenseAdminPanelForm extends AdminForm
*
* @return void
*/
-
function formActions()
{
- $this->out->submit('submit', _('Save'), 'submit', null, _('Save AdSense settings'));
+ $this->out->submit('submit', _m('Save'), 'submit', null, _m('Save AdSense settings'));
}
}
diff --git a/plugins/Adsense/locale/Adsense.pot b/plugins/Adsense/locale/Adsense.pot
new file mode 100644
index 000000000..687167792
--- /dev/null
+++ b/plugins/Adsense/locale/Adsense.pot
@@ -0,0 +1,96 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-09-22 22:34+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. TRANS: Menu item title/tooltip
+#: AdsensePlugin.php:194
+msgid "AdSense configuration"
+msgstr ""
+
+#. TRANS: Menu item for site administration
+#: AdsensePlugin.php:196
+msgid "AdSense"
+msgstr ""
+
+#: AdsensePlugin.php:209
+msgid "Plugin to add Google Adsense to StatusNet sites."
+msgstr ""
+
+#: adsenseadminpanel.php:52
+msgctxt "TITLE"
+msgid "AdSense"
+msgstr ""
+
+#: adsenseadminpanel.php:62
+msgid "AdSense settings for this StatusNet site"
+msgstr ""
+
+#: adsenseadminpanel.php:164
+msgid "Client ID"
+msgstr ""
+
+#: adsenseadminpanel.php:165
+msgid "Google client ID"
+msgstr ""
+
+#: adsenseadminpanel.php:170
+msgid "Ad script URL"
+msgstr ""
+
+#: adsenseadminpanel.php:171
+msgid "Script URL (advanced)"
+msgstr ""
+
+#: adsenseadminpanel.php:176
+msgid "Medium rectangle"
+msgstr ""
+
+#: adsenseadminpanel.php:177
+msgid "Medium rectangle slot code"
+msgstr ""
+
+#: adsenseadminpanel.php:182
+msgid "Rectangle"
+msgstr ""
+
+#: adsenseadminpanel.php:183
+msgid "Rectangle slot code"
+msgstr ""
+
+#: adsenseadminpanel.php:188
+msgid "Leaderboard"
+msgstr ""
+
+#: adsenseadminpanel.php:189
+msgid "Leaderboard slot code"
+msgstr ""
+
+#: adsenseadminpanel.php:194
+msgid "Skyscraper"
+msgstr ""
+
+#: adsenseadminpanel.php:195
+msgid "Wide skyscraper slot code"
+msgstr ""
+
+#: adsenseadminpanel.php:208
+msgid "Save"
+msgstr ""
+
+#: adsenseadminpanel.php:208
+msgid "Save AdSense settings"
+msgstr ""