You've already forked joomla_test
first commit
This commit is contained in:
35
modules/mod_syndicate/helper.php
Normal file
35
modules/mod_syndicate/helper.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_syndicate
|
||||
*
|
||||
* @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_syndicate
|
||||
*
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_syndicate
|
||||
* @since 1.5
|
||||
*/
|
||||
class ModSyndicateHelper
|
||||
{
|
||||
public static function getLink(&$params)
|
||||
{
|
||||
$document = JFactory::getDocument();
|
||||
|
||||
foreach ($document->_links as $link => $value)
|
||||
{
|
||||
$value = JArrayHelper::toString($value);
|
||||
if (strpos($value, 'application/'.$params->get('format').'+xml'))
|
||||
{
|
||||
return $link;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
1
modules/mod_syndicate/index.html
Normal file
1
modules/mod_syndicate/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
28
modules/mod_syndicate/mod_syndicate.php
Normal file
28
modules/mod_syndicate/mod_syndicate.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_syndicate
|
||||
*
|
||||
* @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';
|
||||
|
||||
$params->def('format', 'rss');
|
||||
|
||||
$link = ModSyndicateHelper::getLink($params);
|
||||
|
||||
if (is_null($link))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
|
||||
|
||||
$text = htmlspecialchars($params->get('text'));
|
||||
|
||||
require JModuleHelper::getLayoutPath('mod_syndicate', $params->get('layout', 'default'));
|
84
modules/mod_syndicate/mod_syndicate.xml
Normal file
84
modules/mod_syndicate/mod_syndicate.xml
Normal file
@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension
|
||||
type="module"
|
||||
version="3.1"
|
||||
client="site"
|
||||
method="upgrade">
|
||||
<name>mod_syndicate</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>May 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_SYNDICATE_XML_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename module="mod_syndicate">mod_syndicate.php</filename>
|
||||
<folder>tmpl</folder>
|
||||
<filename>helper.php</filename>
|
||||
<filename>index.html</filename> <filename>mod_syndicate.xml</filename>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">en-GB.mod_syndicate.ini</language>
|
||||
<language tag="en-GB">en-GB.mod_syndicate.sys.ini</language>
|
||||
</languages>
|
||||
<help key="JHELP_EXTENSIONS_MODULE_MANAGER_SYNDICATION_FEEDS" />
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic">
|
||||
<field
|
||||
name="display_text"
|
||||
type="radio"
|
||||
default="1"
|
||||
class="btn-group"
|
||||
label="MOD_SYNDICATE_FIELD_DISPLAYTEXT_LABEL"
|
||||
description="MOD_SYNDICATE_FIELD_DISPLAYTEXT_DESC"
|
||||
filter="integer">
|
||||
<option
|
||||
value="1">JYES</option>
|
||||
<option
|
||||
value="0">JNO</option>
|
||||
</field>
|
||||
<field
|
||||
name="text"
|
||||
type="text"
|
||||
label="MOD_SYNDICATE_FIELD_TEXT_LABEL"
|
||||
description="MOD_SYNDICATE_FIELD_TEXT_DESC" />
|
||||
<field
|
||||
name="format"
|
||||
type="list"
|
||||
default="rss"
|
||||
label="MOD_SYNDICATE_FIELD_FORMAT_LABEL"
|
||||
description="MOD_SYNDICATE_FIELD_FORMAT_DESC">
|
||||
<option
|
||||
value="rss">MOD_SYNDICATE_FIELD_VALUE_RSS</option>
|
||||
<option
|
||||
value="atom">MOD_SYNDICATE_FIELD_VALUE_ATOM</option>
|
||||
</field>
|
||||
</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="0"
|
||||
label="COM_MODULES_FIELD_CACHING_LABEL"
|
||||
description="COM_MODULES_FIELD_CACHING_DESC">
|
||||
<option
|
||||
value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
24
modules/mod_syndicate/tmpl/default.php
Normal file
24
modules/mod_syndicate/tmpl/default.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_syndicate
|
||||
*
|
||||
* @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;
|
||||
|
||||
?>
|
||||
<a href="<?php echo $link ?>" class="syndicate-module<?php echo $moduleclass_sfx ?>">
|
||||
<?php echo JHtml::_('image', 'system/livemarks.png', 'feed-image', null, true); ?>
|
||||
<?php if ($params->get('display_text', 1)) : ?>
|
||||
<span>
|
||||
<?php if (str_replace(' ', '', $text) != '') : ?>
|
||||
<?php echo $text; ?>
|
||||
<?php else : ?>
|
||||
<?php echo JText::_('MOD_SYNDICATE_DEFAULT_FEED_ENTRIES'); ?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</a>
|
1
modules/mod_syndicate/tmpl/index.html
Normal file
1
modules/mod_syndicate/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
Reference in New Issue
Block a user