You've already forked joomla_test
first commit
This commit is contained in:
43
modules/mod_banners/helper.php
Normal file
43
modules/mod_banners/helper.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_banners
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Helper for mod_banners
|
||||
*
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_banners
|
||||
* @since 1.5
|
||||
*/
|
||||
class ModBannersHelper
|
||||
{
|
||||
public static function &getList(&$params)
|
||||
{
|
||||
JModelLegacy::addIncludePath(JPATH_ROOT.'/components/com_banners/models', 'BannersModel');
|
||||
$document = JFactory::getDocument();
|
||||
$app = JFactory::getApplication();
|
||||
$keywords = explode(',', $document->getMetaData('keywords'));
|
||||
|
||||
$model = JModelLegacy::getInstance('Banners', 'BannersModel', array('ignore_request' => true));
|
||||
$model->setState('filter.client_id', (int) $params->get('cid'));
|
||||
$model->setState('filter.category_id', $params->get('catid', array()));
|
||||
$model->setState('list.limit', (int) $params->get('count', 1));
|
||||
$model->setState('list.start', 0);
|
||||
$model->setState('filter.ordering', $params->get('ordering'));
|
||||
$model->setState('filter.tag_search', $params->get('tag_search'));
|
||||
$model->setState('filter.keywords', $keywords);
|
||||
$model->setState('filter.language', $app->getLanguageFilter());
|
||||
|
||||
$banners = $model->getItems();
|
||||
$model->impress();
|
||||
|
||||
return $banners;
|
||||
}
|
||||
}
|
1
modules/mod_banners/index.html
Normal file
1
modules/mod_banners/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
23
modules/mod_banners/mod_banners.php
Normal file
23
modules/mod_banners/mod_banners.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_banners
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// Include the syndicate functions only once
|
||||
require_once __DIR__ . '/helper.php';
|
||||
|
||||
$headerText = trim($params->get('header_text'));
|
||||
$footerText = trim($params->get('footer_text'));
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php';
|
||||
BannersHelper::updateReset();
|
||||
$list = &ModBannersHelper::getList($params);
|
||||
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
|
||||
|
||||
require JModuleHelper::getLayoutPath('mod_banners', $params->get('layout', 'default'));
|
149
modules/mod_banners/mod_banners.xml
Normal file
149
modules/mod_banners/mod_banners.xml
Normal file
@ -0,0 +1,149 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension
|
||||
type="module"
|
||||
version="3.1"
|
||||
client="site"
|
||||
method="upgrade">
|
||||
<name>mod_banners</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>July 2006</creationDate>
|
||||
<copyright>Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.</copyright>
|
||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<authorEmail>admin@joomla.org</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>3.0.0</version>
|
||||
<description>MOD_BANNERS_XML_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename module="mod_banners">mod_banners.php</filename>
|
||||
<folder>tmpl</folder>
|
||||
<filename>helper.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<filename>mod_banners.xml</filename>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">en-GB.mod_banners.ini</language>
|
||||
<language tag="en-GB">en-GB.mod_banners.sys.ini</language>
|
||||
</languages>
|
||||
<help key="JHELP_EXTENSIONS_MODULE_MANAGER_BANNERS" />
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic"
|
||||
addfieldpath="/administrator/components/com_banners/models/fields">
|
||||
<field
|
||||
name="target"
|
||||
type="list"
|
||||
default="1"
|
||||
label="MOD_BANNERS_FIELD_TARGET_LABEL"
|
||||
description="MOD_BANNERS_FIELD_TARGET_DESC">
|
||||
<option
|
||||
value="0">JBROWSERTARGET_PARENT</option>
|
||||
<option
|
||||
value="1">JBROWSERTARGET_NEW</option>
|
||||
<option
|
||||
value="2">JBROWSERTARGET_POPUP</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="count"
|
||||
type="integer"
|
||||
first="1"
|
||||
last="10"
|
||||
step="1"
|
||||
default="5"
|
||||
label="MOD_BANNERS_FIELD_COUNT_LABEL"
|
||||
description="MOD_BANNERS_FIELD_COUNT_DESC" />
|
||||
<field
|
||||
name="cid"
|
||||
type="bannerclient"
|
||||
label="MOD_BANNERS_FIELD_BANNERCLIENT_LABEL"
|
||||
description="MOD_BANNERS_FIELD_BANNERCLIENT_DESC" />
|
||||
|
||||
<field
|
||||
name="catid"
|
||||
type="category"
|
||||
extension="com_banners"
|
||||
label="JCATEGORY"
|
||||
multiple="true" size="5"
|
||||
default=""
|
||||
description="MOD_BANNERS_FIELD_CATEGORY_DESC" >
|
||||
<option value="">JOPTION_ALL_CATEGORIES</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="tag_search"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_BANNERS_FIELD_TAG_LABEL"
|
||||
description="MOD_BANNERS_FIELD_TAG_DESC">
|
||||
<option
|
||||
value="0">JNO</option>
|
||||
<option
|
||||
value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="ordering"
|
||||
type="list"
|
||||
default="0"
|
||||
label="MOD_BANNERS_FIELD_RANDOMISE_LABEL"
|
||||
description="MOD_BANNERS_FIELD_RANDOMISE_DESC">
|
||||
<option
|
||||
value="0">MOD_BANNERS_VALUE_STICKYORDERING</option>
|
||||
<option
|
||||
value="random">MOD_BANNERS_VALUE_STICKYRANDOMISE</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="header_text"
|
||||
type="textarea"
|
||||
filter="safehtml"
|
||||
rows="3"
|
||||
cols="40"
|
||||
label="MOD_BANNERS_FIELD_HEADER_LABEL"
|
||||
description="MOD_BANNERS_FIELD_HEADER_DESC" />
|
||||
|
||||
<field
|
||||
name="footer_text"
|
||||
type="textarea"
|
||||
filter="safehtml"
|
||||
rows="3"
|
||||
cols="40"
|
||||
label="MOD_BANNERS_FIELD_FOOTER_LABEL"
|
||||
description="MOD_BANNERS_FIELD_FOOTER_DESC" />
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="advanced">
|
||||
<field
|
||||
name="layout"
|
||||
type="modulelayout"
|
||||
label="JFIELD_ALT_LAYOUT_LABEL"
|
||||
description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
|
||||
|
||||
<field
|
||||
name="moduleclass_sfx"
|
||||
type="textarea" rows="3"
|
||||
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
|
||||
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
|
||||
|
||||
<field
|
||||
name="cache"
|
||||
type="list"
|
||||
default="1"
|
||||
label="COM_MODULES_FIELD_CACHING_LABEL"
|
||||
description="COM_MODULES_FIELD_CACHING_DESC">
|
||||
<option
|
||||
value="1">JGLOBAL_USE_GLOBAL</option>
|
||||
<option
|
||||
value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="cache_time"
|
||||
type="text"
|
||||
default="900"
|
||||
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
|
||||
description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
114
modules/mod_banners/tmpl/default.php
Normal file
114
modules/mod_banners/tmpl/default.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_banners
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
require_once JPATH_ROOT . '/components/com_banners/helpers/banner.php';
|
||||
$baseurl = JUri::base();
|
||||
?>
|
||||
<div class="bannergroup<?php echo $moduleclass_sfx ?>">
|
||||
<?php if ($headerText) : ?>
|
||||
<?php echo $headerText; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($list as $item) : ?>
|
||||
<div class="banneritem">
|
||||
<?php $link = JRoute::_('index.php?option=com_banners&task=click&id='. $item->id);?>
|
||||
<?php if ($item->type == 1) :?>
|
||||
<?php // Text based banners ?>
|
||||
<?php echo str_replace(array('{CLICKURL}', '{NAME}'), array($link, $item->name), $item->custombannercode);?>
|
||||
<?php else:?>
|
||||
<?php $imageurl = $item->params->get('imageurl');?>
|
||||
<?php $width = $item->params->get('width');?>
|
||||
<?php $height = $item->params->get('height');?>
|
||||
<?php if (BannerHelper::isImage($imageurl)) :?>
|
||||
<?php // Image based banner ?>
|
||||
<?php $alt = $item->params->get('alt');?>
|
||||
<?php $alt = $alt ? $alt : $item->name; ?>
|
||||
<?php $alt = $alt ? $alt : JText::_('MOD_BANNERS_BANNER'); ?>
|
||||
<?php if ($item->clickurl) :?>
|
||||
<?php // Wrap the banner in a link?>
|
||||
<?php $target = $params->get('target', 1);?>
|
||||
<?php if ($target == 1) :?>
|
||||
<?php // Open in a new window?>
|
||||
<a
|
||||
href="<?php echo $link; ?>" target="_blank"
|
||||
title="<?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8');?>">
|
||||
<img
|
||||
src="<?php echo $baseurl . $imageurl;?>"
|
||||
alt="<?php echo $alt;?>"
|
||||
<?php if (!empty($width)) echo 'width ="'. $width.'"';?>
|
||||
<?php if (!empty($height)) echo 'height ="'. $height.'"';?>
|
||||
/>
|
||||
</a>
|
||||
<?php elseif ($target == 2):?>
|
||||
<?php // open in a popup window?>
|
||||
<a
|
||||
href="<?php echo $link;?>" onclick="window.open(this.href, '',
|
||||
'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550');
|
||||
return false"
|
||||
title="<?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8');?>">
|
||||
<img
|
||||
src="<?php echo $baseurl . $imageurl;?>"
|
||||
alt="<?php echo $alt;?>"
|
||||
<?php if (!empty($width)) echo 'width ="'. $width.'"';?>
|
||||
<?php if (!empty($height)) echo 'height ="'. $height.'"';?>
|
||||
/>
|
||||
</a>
|
||||
<?php else :?>
|
||||
<?php // open in parent window?>
|
||||
<a
|
||||
href="<?php echo $link;?>"
|
||||
title="<?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8');?>">
|
||||
<img
|
||||
src="<?php echo $baseurl . $imageurl;?>"
|
||||
alt="<?php echo $alt;?>"
|
||||
<?php if (!empty($width)) echo 'width ="'. $width.'"';?>
|
||||
<?php if (!empty($height)) echo 'height ="'. $height.'"';?>
|
||||
/>
|
||||
</a>
|
||||
<?php endif;?>
|
||||
<?php else :?>
|
||||
<?php // Just display the image if no link specified?>
|
||||
<img
|
||||
src="<?php echo $baseurl . $imageurl;?>"
|
||||
alt="<?php echo $alt;?>"
|
||||
<?php if (!empty($width)) echo 'width ="'. $width.'"';?>
|
||||
<?php if (!empty($height)) echo 'height ="'. $height.'"';?>
|
||||
/>
|
||||
<?php endif;?>
|
||||
<?php elseif (BannerHelper::isFlash($imageurl)) :?>
|
||||
<object
|
||||
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
|
||||
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
|
||||
<?php if (!empty($width)) echo 'width ="'. $width.'"';?>
|
||||
<?php if (!empty($height)) echo 'height ="'. $height.'"';?>
|
||||
>
|
||||
<param name="movie" value="<?php echo $imageurl;?>" />
|
||||
<embed
|
||||
src="<?php echo $imageurl;?>"
|
||||
loop="false"
|
||||
pluginspage="http://www.macromedia.com/go/get/flashplayer"
|
||||
type="application/x-shockwave-flash"
|
||||
<?php if (!empty($width)) echo 'width ="'. $width.'"';?>
|
||||
<?php if (!empty($height)) echo 'height ="'. $height.'"';?>
|
||||
/>
|
||||
</object>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if ($footerText) : ?>
|
||||
<div class="bannerfooter">
|
||||
<?php echo $footerText; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
1
modules/mod_banners/tmpl/index.html
Normal file
1
modules/mod_banners/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
Reference in New Issue
Block a user