X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FAdsense%2FAdsensePlugin.php;h=80d90facaadb5d1691073d9e3eefddf1febb7237;hb=9ca8df301dfe944e90f48cd1abeed0bad8585301;hp=cd6fc3503cf355175a7ff28cd6dcf0a3c344bd72;hpb=640e7e7c43fa8e9b1a8516b486e560df84bd9887;p=quix0rs-gnu-social.git diff --git a/plugins/Adsense/AdsensePlugin.php b/plugins/Adsense/AdsensePlugin.php index cd6fc3503c..80d90facaa 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.'"; '; @@ -173,36 +166,34 @@ class AdsensePlugin extends UAPPlugin $action->script($this->adScript); } - function onRouterInitialized($m) + function onRouterInitialized(URLMapper $m) { - $m->connect('admin/adsense', + $m->connect('panel/adsense', array('action' => 'adsenseadminpanel')); return true; } - function onAutoload($cls) - { - $dir = dirname(__FILE__); - - switch ($cls) - { - case 'AdsenseadminpanelAction': - require_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - default: - return true; - } - } - - function onEndAdminPanelNav($menu) { + function onEndAdminPanelNav(Menu $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('MENU','AdSense'), $menu_title, $action_name == 'adsenseadminpanel', 'nav_adsense_admin_panel'); } return true; } -} \ No newline at end of file + + function onPluginVersion(array &$versions) + { + $versions[] = array('name' => 'BlankAdPlugin', + 'version' => GNUSOCIAL_VERSION, + 'author' => 'Evan Prodromou', + 'homepage' => 'http://status.net/wiki/Plugin:Adsense', + 'rawdescription' => + // TRANS: Plugin description. + _m('Plugin to add Google AdSense to StatusNet sites.')); + return true; + } +}