| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /inetpub/wwwroot/Topogeo/ojs/plugins/generic/openAds/ |
Upload File : |
<?php
/**
* @file OpenAdsBlockPlugin.inc.php
*
* Copyright (c) 2003-2009 Siavash Miri and Alec Smecher
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class OpenAdsBlockPlugin
* @ingroup plugins_generic_openAds
*
* @brief OpenAds plugin class, block component
*/
// $Id$
import('lib.pkp.classes.plugins.BlockPlugin');
class OpenAdsBlockPlugin extends BlockPlugin {
/** @var $parentPluginName string Name of parent plugin */
var $parentPluginName;
function OpenAdsBlockPlugin($parentPluginName) {
$this->parentPluginName = $parentPluginName;
parent::BlockPlugin();
}
/**
* Hide this plugin from the management interface (it's subsidiary)
*/
function getHideManagement() {
return true;
}
/**
* Get the symbolic name of this plugin
* @return string
*/
function getName() {
return 'OpenAdsBlockPlugin';
}
/**
* Get the display name of this plugin
* @return string
*/
function getDisplayName() {
return __('plugins.generic.openads');
}
/**
* Get the description of this plugin
* @return string
*/
function getDescription() {
return __('plugins.generic.openads.description');
}
/**
* Override the builtin to get the correct plugin path.
* @return string
*/
function getPluginPath() {
$plugin =& $this->getOpenAdsPlugin();
return $plugin->getPluginPath();
}
/**
* Override the builtin to get the correct template path.
* @return string
*/
function getTemplatePath() {
$plugin =& $this->getOpenAdsPlugin();
return $plugin->getTemplatePath();
}
/**
* Get the contents of the CMS plugin TOC.
* @param $templateMgr object
* @return string
*/
function getContents(&$templateMgr) {
$journal =& Request::getJournal();
if (!$journal) return '';
// Get the ad settings.
$plugin =& $this->getOpenAdsPlugin();
$this->import('OpenAdsConnection');
$openAdsConnection = new OpenAdsConnection($plugin, $plugin->getInstallationPath());
$sidebarAdHtml = $openAdsConnection->getAdHtml($plugin->getSetting($journal->getId(), 'sidebarAdId'));
return '<div class="block">' . $sidebarAdHtml . '</div>';
}
/**
* Get the actual CMS plugin
* @return object
*/
function &getOpenAdsPlugin() {
$plugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);
return $plugin;
}
/**
* Determine whether or not this plugin is enabled.
* @return boolean
*/
function getEnabled() {
$plugin =& $this->getOpenAdsPlugin();
return $plugin->getEnabled();
}
}
?>