* onPluginVersion added.
* i18n fix: use _m() in plugins, don't use _() * some translator documentation added. * superfluous whitespace removed.
This commit is contained in:
parent
0b6cc7c33d
commit
3329685beb
@ -75,7 +75,6 @@ if (!defined('STATUSNET')) {
|
|||||||
*
|
*
|
||||||
* @seeAlso UAPPlugin
|
* @seeAlso UAPPlugin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class OpenXPlugin extends UAPPlugin
|
class OpenXPlugin extends UAPPlugin
|
||||||
{
|
{
|
||||||
public $adScript = null;
|
public $adScript = null;
|
||||||
@ -103,7 +102,6 @@ class OpenXPlugin extends UAPPlugin
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function showMediumRectangle($action)
|
protected function showMediumRectangle($action)
|
||||||
{
|
{
|
||||||
$this->showAd($action, $this->mediumRectangle);
|
$this->showAd($action, $this->mediumRectangle);
|
||||||
@ -116,7 +114,6 @@ class OpenXPlugin extends UAPPlugin
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function showRectangle($action)
|
protected function showRectangle($action)
|
||||||
{
|
{
|
||||||
$this->showAd($action, $this->rectangle);
|
$this->showAd($action, $this->rectangle);
|
||||||
@ -129,7 +126,6 @@ class OpenXPlugin extends UAPPlugin
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function showWideSkyscraper($action)
|
protected function showWideSkyscraper($action)
|
||||||
{
|
{
|
||||||
$this->showAd($action, $this->wideSkyscraper);
|
$this->showAd($action, $this->wideSkyscraper);
|
||||||
@ -142,7 +138,6 @@ class OpenXPlugin extends UAPPlugin
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function showLeaderboard($action)
|
protected function showLeaderboard($action)
|
||||||
{
|
{
|
||||||
$this->showAd($action, $this->leaderboard);
|
$this->showAd($action, $this->leaderboard);
|
||||||
@ -156,7 +151,6 @@ class OpenXPlugin extends UAPPlugin
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function showAd($action, $zone)
|
protected function showAd($action, $zone)
|
||||||
{
|
{
|
||||||
$scr = <<<ENDOFSCRIPT
|
$scr = <<<ENDOFSCRIPT
|
||||||
@ -211,4 +205,23 @@ ENDOFSCRIPT;
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add our version information to output
|
||||||
|
*
|
||||||
|
* @param array &$versions Array of version-data arrays
|
||||||
|
*
|
||||||
|
* @return boolean hook value
|
||||||
|
*/
|
||||||
|
function onPluginVersion(&$versions)
|
||||||
|
{
|
||||||
|
$versions[] = array('name' => 'OpenX',
|
||||||
|
'version' => STATUSNET_VERSION,
|
||||||
|
'author' => 'Evan Prodromou',
|
||||||
|
'homepage' => 'http://status.net/wiki/Plugin:OpenX',
|
||||||
|
'rawdescription' =>
|
||||||
|
// TRANS: Plugin description.
|
||||||
|
_m('Plugin for <a href="http://www.openx.org/">OpenX Ad Server</a>.'));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,7 @@ class OpenXadminpanelAction extends AdminPanelAction
|
|||||||
*/
|
*/
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
|
// TRANS: Page title for OpenX admin panel.
|
||||||
return _m('TITLE', 'OpenX');
|
return _m('TITLE', 'OpenX');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +60,7 @@ class OpenXadminpanelAction extends AdminPanelAction
|
|||||||
*/
|
*/
|
||||||
function getInstructions()
|
function getInstructions()
|
||||||
{
|
{
|
||||||
|
// TRANS: Instructions for OpenX admin panel.
|
||||||
return _m('OpenX settings for this StatusNet site');
|
return _m('OpenX settings for this StatusNet site');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,31 +163,41 @@ class OpenXAdminPanelForm extends AdminForm
|
|||||||
$this->out->elementStart('ul', 'form_data');
|
$this->out->elementStart('ul', 'form_data');
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->input('adScript',
|
$this->input('adScript',
|
||||||
|
// TRANS: Form label in OpenX admin panel.
|
||||||
_m('Ad script URL'),
|
_m('Ad script URL'),
|
||||||
|
// TRANS: Tooltip for form label in OpenX admin panel.
|
||||||
_m('Script URL'),
|
_m('Script URL'),
|
||||||
'openx');
|
'openx');
|
||||||
$this->unli();
|
$this->unli();
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->input('mediumRectangle',
|
$this->input('mediumRectangle',
|
||||||
|
// TRANS: Form label in OpenX admin panel. Refers to advertisement format.
|
||||||
_m('Medium rectangle'),
|
_m('Medium rectangle'),
|
||||||
|
// TRANS: Tooltip for form label in OpenX admin panel. Refers to advertisement format.
|
||||||
_m('Medium rectangle zone'),
|
_m('Medium rectangle zone'),
|
||||||
'openx');
|
'openx');
|
||||||
$this->unli();
|
$this->unli();
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->input('rectangle',
|
$this->input('rectangle',
|
||||||
|
// TRANS: Form label in OpenX admin panel. Refers to advertisement format.
|
||||||
_m('Rectangle'),
|
_m('Rectangle'),
|
||||||
|
// TRANS: Tooltip for form label in OpenX admin panel. Refers to advertisement format.
|
||||||
_m('Rectangle zone'),
|
_m('Rectangle zone'),
|
||||||
'openx');
|
'openx');
|
||||||
$this->unli();
|
$this->unli();
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->input('leaderboard',
|
$this->input('leaderboard',
|
||||||
|
// TRANS: Form label in OpenX admin panel. Refers to advertisement format.
|
||||||
_m('Leaderboard'),
|
_m('Leaderboard'),
|
||||||
|
// TRANS: Tooltip for form label in OpenX admin panel. Refers to advertisement format.
|
||||||
_m('Leaderboard zone'),
|
_m('Leaderboard zone'),
|
||||||
'openx');
|
'openx');
|
||||||
$this->unli();
|
$this->unli();
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->input('wideSkyscraper',
|
$this->input('wideSkyscraper',
|
||||||
|
// TRANS: Form label in OpenX admin panel. Refers to advertisement format.
|
||||||
_m('Skyscraper'),
|
_m('Skyscraper'),
|
||||||
|
// TRANS: Tooltip for form label in OpenX admin panel. Refers to advertisement format.
|
||||||
_m('Wide skyscraper zone'),
|
_m('Wide skyscraper zone'),
|
||||||
'openx');
|
'openx');
|
||||||
$this->unli();
|
$this->unli();
|
||||||
@ -199,6 +211,12 @@ class OpenXAdminPanelForm extends AdminForm
|
|||||||
*/
|
*/
|
||||||
function formActions()
|
function formActions()
|
||||||
{
|
{
|
||||||
$this->out->submit('submit', _m('Save'), 'submit', null, _m('Save OpenX settings'));
|
$this->out->submit('submit',
|
||||||
|
// TRANS: Submit button text in OpenX admin panel.
|
||||||
|
_m('BUTTON','Save'),
|
||||||
|
'submit',
|
||||||
|
null,
|
||||||
|
// TRANS: Submit button title in OpenX admin panel.
|
||||||
|
_m('Save OpenX settings'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ class RegisterThrottlePlugin extends Plugin
|
|||||||
foreach ($ids as $id) {
|
foreach ($ids as $id) {
|
||||||
$profile = Profile::staticGet('id', $id);
|
$profile = Profile::staticGet('id', $id);
|
||||||
if ($profile && $profile->isSilenced()) {
|
if ($profile && $profile->isSilenced()) {
|
||||||
throw new Exception(_("A banned user has registered from this address."));
|
throw new Exception(_m("A banned user has registered from this address."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user