feat(deployed): add mod_articles_news_adv 1.5.5 (no-source, vetted live)
mod_articles_news_adv module (mislabeled Joomla! Project); unmapped clone -> deployed files. Signed-off-by: LÁZÁR Imre <imre@illusion.hu> Assisted-by: claude-code@claude-opus-4-8
This commit is contained in:
parent
4a208fb3bd
commit
bf4b0b1b3d
@ -0,0 +1,203 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_articles_news_adv
|
||||
*
|
||||
* @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_SITE.'/components/com_content/helpers/route.php';
|
||||
|
||||
JModelLegacy::addIncludePath(JPATH_SITE.'/components/com_content/models', 'ContentModel');
|
||||
|
||||
/**
|
||||
* Helper for mod_articles_news_adv
|
||||
*
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_articles_news_adv
|
||||
*/
|
||||
abstract class ModArticlesNewsAdvHelper
|
||||
{
|
||||
public static function getList(&$params)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
// Get an instance of the generic articles model
|
||||
$model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
|
||||
|
||||
// Set application parameters in model
|
||||
$appParams = JFactory::getApplication()->getParams();
|
||||
$model->setState('params', $appParams);
|
||||
|
||||
// Set the filters based on the module params
|
||||
$model->setState('list.start', 0);
|
||||
$model->setState('list.limit', (int) $params->get('count', 5));
|
||||
|
||||
$model->setState('filter.published', 1);
|
||||
|
||||
$model->setState('list.select', 'a.fulltext, a.id, a.title, a.alias, a.introtext, a.state, a.catid, a.created, a.created_by, a.created_by_alias,' .
|
||||
' a.modified, a.modified_by, a.publish_up, a.publish_down, a.images, a.urls, a.attribs, a.metadata, a.metakey, a.metadesc, a.access,' .
|
||||
' a.hits, a.featured' );
|
||||
|
||||
// Access filter
|
||||
$access = !JComponentHelper::getParams('com_content')->get('show_noauth');
|
||||
$authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id'));
|
||||
$model->setState('filter.access', $access);
|
||||
|
||||
// Category filter
|
||||
$model->setState('filter.category_id', $params->get('catid', array()));
|
||||
|
||||
// Filter by language
|
||||
$model->setState('filter.language', $app->getLanguageFilter());
|
||||
|
||||
$catids = $params->get('catid');
|
||||
|
||||
if ($params->get('show_child_category_articles', 0) && (int) $params->get('levels', 0) > 0)
|
||||
{
|
||||
// Get an instance of the generic categories model
|
||||
$categories = JModelLegacy::getInstance('Categories', 'ContentModel', array('ignore_request' => true));
|
||||
$categories->setState('params', $appParams);
|
||||
$levels = $params->get('levels', 1) ? $params->get('levels', 1) : 9999;
|
||||
$categories->setState('filter.get_children', $levels);
|
||||
$categories->setState('filter.published', 1);
|
||||
$categories->setState('filter.access', $access);
|
||||
$additional_catids = array();
|
||||
|
||||
foreach ($catids as $catid)
|
||||
{
|
||||
$categories->setState('filter.parentId', $catid);
|
||||
$recursive = true;
|
||||
$items = $categories->getItems($recursive);
|
||||
|
||||
if ($items)
|
||||
{
|
||||
foreach ($items as $category)
|
||||
{
|
||||
$condition = (($category->level - $categories->getParent()->level) <= $levels);
|
||||
if ($condition)
|
||||
{
|
||||
$additional_catids[] = $category->id;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$catids = array_unique(array_merge($catids, $additional_catids));
|
||||
}
|
||||
|
||||
$model->setState('filter.category_id', $catids);
|
||||
|
||||
// Set ordering
|
||||
$ordering = $params->get('ordering', 'a.publish_up');
|
||||
$model->setState('list.ordering', $ordering);
|
||||
if (trim($ordering) == 'rand()')
|
||||
{
|
||||
$model->setState('list.direction', '');
|
||||
}
|
||||
else
|
||||
{
|
||||
$model->setState('list.direction', $params->get('article_ordering_direction', 'DESC'));
|
||||
}
|
||||
|
||||
// Retrieve Content
|
||||
$items = $model->getItems();
|
||||
|
||||
$show_introtext = $params->get('show_introtext', 1);
|
||||
$introtext_limit = $params->get('introtext_limit', 0);
|
||||
|
||||
foreach ($items as &$item)
|
||||
{
|
||||
$item->readmore = strlen(trim($item->fulltext));
|
||||
$item->slug = $item->id.':'.$item->alias;
|
||||
$item->catslug = $item->catid.':'.$item->category_alias;
|
||||
|
||||
if ($access || in_array($item->access, $authorised))
|
||||
{
|
||||
// We know that user has the privilege to view the article
|
||||
$item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid));
|
||||
$item->linkText = JText::_('MOD_ARTICLES_NEWS_READMORE');
|
||||
}
|
||||
else {
|
||||
$item->link = JRoute::_('index.php?option=com_users&view=login');
|
||||
$item->linkText = JText::_('MOD_ARTICLES_NEWS_READMORE_REGISTER');
|
||||
}
|
||||
|
||||
if ($show_introtext)
|
||||
{
|
||||
$item->introtext = JHtml::_('content.prepare', $item->introtext, '', 'mod_articles_news.content');
|
||||
$item->introtext = $introtext_limit ? self::_cleanIntrotext(self::truncate($item->introtext, $introtext_limit)) : $item->introtext;
|
||||
}
|
||||
|
||||
//new
|
||||
if (!$params->get('image'))
|
||||
{
|
||||
$item->introtext = preg_replace('/<img[^>]*>/', '', $item->introtext);
|
||||
}
|
||||
|
||||
$results = $app->triggerEvent('onContentAfterDisplay', array('com_content.article', &$item, &$params, 1));
|
||||
$item->afterDisplayTitle = trim(implode("\n", $results));
|
||||
|
||||
$results = $app->triggerEvent('onContentBeforeDisplay', array('com_content.article', &$item, &$params, 1));
|
||||
$item->beforeDisplayContent = trim(implode("\n", $results));
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
public static function _cleanIntrotext($introtext)
|
||||
{
|
||||
$introtext = str_replace('<p>', ' ', $introtext);
|
||||
$introtext = str_replace('</p>', ' ', $introtext);
|
||||
$introtext = strip_tags($introtext, '<a><em><strong>');
|
||||
|
||||
$introtext = trim($introtext);
|
||||
|
||||
return $introtext;
|
||||
}
|
||||
/**
|
||||
* Method to truncate introtext
|
||||
*
|
||||
* The goal is to get the proper length plain text string with as much of
|
||||
* the html intact as possible with all tags properly closed.
|
||||
*
|
||||
* @param string $html The content of the introtext to be truncated
|
||||
* @param integer $maxLength The maximum number of charactes to render
|
||||
*
|
||||
* @return string The truncated string
|
||||
*/
|
||||
public static function truncate($html, $maxLength = 0)
|
||||
{
|
||||
$baseLength = strlen($html);
|
||||
|
||||
// First get the plain text string. This is the rendered text we want to end up with.
|
||||
$ptString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = false);
|
||||
|
||||
for ($maxLength; $maxLength < $baseLength;)
|
||||
{
|
||||
// Now get the string if we allow html.
|
||||
$htmlString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = true);
|
||||
|
||||
// Now get the plain text from the html string.
|
||||
$htmlStringToPtString = JHtml::_('string.truncate', $htmlString, $maxLength, $noSplit = true, $allowHtml = false);
|
||||
|
||||
// If the new plain text string matches the original plain text string we are done.
|
||||
if ($ptString == $htmlStringToPtString)
|
||||
{
|
||||
return $htmlString;
|
||||
}
|
||||
// Get the number of html tag characters in the first $maxlength characters
|
||||
$diffLength = strlen($ptString) - strlen($htmlStringToPtString);
|
||||
|
||||
// Set new $maxlength that adjusts for the html tags
|
||||
$maxLength += $diffLength;
|
||||
if ($baseLength <= $maxLength || $diffLength <= 0)
|
||||
{
|
||||
return $htmlString;
|
||||
}
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
9
deployed/mod_articles_news_adv/modules/mod_articles_news_adv/js/masonry.pkgd.min.js
vendored
Normal file
9
deployed/mod_articles_news_adv/modules/mod_articles_news_adv/js/masonry.pkgd.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Articles Newsflash Advanced
|
||||
*
|
||||
* @author TemplateMonster http://www.templatemonster.com
|
||||
* @copyright Copyright (C) 2012 - 2013 Jetimpex, Inc.
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2
|
||||
* Parts of this software are based on Articles Newsflash standard module
|
||||
*
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// Include the syndicate functions only once
|
||||
require_once __DIR__ . '/helper.php';
|
||||
|
||||
$menu = JMenu::getInstance('site');
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$doc = JFactory::getDocument();
|
||||
$document =& $doc;
|
||||
$layout = $app->input->getCmd('layout', '');
|
||||
|
||||
$list = modArticlesNewsAdvHelper::getList($params);
|
||||
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
|
||||
$columns = (int)$params->get('columns');
|
||||
|
||||
require JModuleHelper::getLayoutPath('mod_articles_news_adv', $params->get('layout', 'default'));
|
||||
@ -0,0 +1,398 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension
|
||||
type="module"
|
||||
version="3.1.0"
|
||||
client="site"
|
||||
method="upgrade">
|
||||
<name>mod_articles_news_adv</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>April 2013</creationDate>
|
||||
<copyright>Copyright (c) 2012-2014 by TemplateMonster - www.templatemonster.com</copyright>
|
||||
<license>Licensed under the GNU/GPLv2: http://www.opensource.org/licenses/mit-license.php</license>
|
||||
<authorEmail></authorEmail>
|
||||
<authorUrl>www.templatemonster.com</authorUrl>
|
||||
<version>1.5.5</version>
|
||||
<description>MOD_ARTICLES_NEWS_ADV_XML_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename module="mod_articles_news_adv">mod_articles_news_adv.php</filename>
|
||||
<folder>js</folder>
|
||||
<folder>tmpl</folder>
|
||||
<filename>helper.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<filename>mod_articles_news_adv.xml</filename>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/en-GB.mod_articles_news_adv.ini</language>
|
||||
<language tag="en-GB">language/en-GB/en-GB.mod_articles_news_adv.sys.ini</language>
|
||||
</languages>
|
||||
<updateservers>
|
||||
<server type="extension" priority="1" name="Articles Newsflash (Advanced) module Updates"><![CDATA[http://joomlacode.org/gf/project/tm_art_news_adv/scmsvn/?action=browse&path=%2F%2Acheckout%2A%2Ftrunk%2Fextension.xml]]></server>
|
||||
</updateservers>
|
||||
<help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_NEWSFLASH" />
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic">
|
||||
<field
|
||||
name="catid"
|
||||
type="category"
|
||||
extension="com_content"
|
||||
multiple="true"
|
||||
default=""
|
||||
size="10"
|
||||
label="JCATEGORY"
|
||||
description="MOD_ARTICLES_NEWS_FIELD_CATEGORY_DESC" >
|
||||
<option value="">JOPTION_ALL_CATEGORIES</option>
|
||||
</field>
|
||||
|
||||
<field name="show_child_category_articles" type="list"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_SHOWCHILDCATEGORYARTICLES_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_SHOWCHILDCATEGORYARTICLES_DESC"
|
||||
>
|
||||
<option value="1">MOD_ARTICLES_NEWS_ADV_OPTION_INCLUDE_VALUE
|
||||
</option>
|
||||
<option value="0">MOD_ARTICLES_NEWS_ADV_OPTION_EXCLUDE_VALUE
|
||||
</option>
|
||||
</field>
|
||||
|
||||
<field name="levels" type="text" default="1"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_CATDEPTH_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_CATDEPTH_DESC" />
|
||||
|
||||
<!-- <field
|
||||
name="showLastSeparator"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="1"
|
||||
label="MOD_ARTICLES_NEWS_FIELD_SEPARATOR_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_FIELD_SEPARATOR_DESC">
|
||||
<option
|
||||
value="1">JYES</option>
|
||||
<option
|
||||
value="0">JNO</option>
|
||||
</field> -->
|
||||
|
||||
<field
|
||||
name="count"
|
||||
type="text"
|
||||
default="5"
|
||||
label="MOD_ARTICLES_NEWS_FIELD_ITEMS_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_FIELD_ITEMS_DESC" />
|
||||
|
||||
<field
|
||||
name="columns"
|
||||
type="list"
|
||||
default="1"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_COLUMNS_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_COLUMNS_DESC">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="ordering"
|
||||
type="list"
|
||||
default="a.publish_up"
|
||||
label="MOD_ARTICLES_NEWS_FIELD_ORDERING_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_FIELD_ORDERING_DESC">
|
||||
<option
|
||||
value="a.publish_up">MOD_ARTICLES_NEWS_FIELD_ORDERING_PUBLISHED_DATE</option>
|
||||
<option
|
||||
value="a.created">MOD_ARTICLES_NEWS_FIELD_ORDERING_CREATED_DATE</option>
|
||||
<option
|
||||
value="a.ordering">MOD_ARTICLES_NEWS_FIELD_ORDERING_ORDERING</option>
|
||||
<option
|
||||
value="rand()">MOD_ARTICLES_NEWS_FIELD_ORDERING_RANDOM</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="article_ordering_direction"
|
||||
type="list"
|
||||
default="DESC"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_ARTICLEORDERINGDIR_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_ARTICLEORDERINGDIR_DESC">
|
||||
<option
|
||||
value="DESC">MOD_ARTICLES_NEWS_ADV_OPTION_DESCENDING_VALUE</option>
|
||||
<option
|
||||
value="ASC">MOD_ARTICLES_NEWS_ADV_OPTION_ASCENDING_VALUE</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="mod_button"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_NEWS_FIELD_CUSTOM_LINK_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_FIELD_CUSTOM_LINK_DESC">
|
||||
<option
|
||||
value="0">JHIDE</option>
|
||||
<option
|
||||
value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
type="text"
|
||||
name="custom_link_title"
|
||||
default=""
|
||||
label="MOD_ARTICLES_NEWS_FIELD_CUSTOM_LINK_TITLE_LABEL"
|
||||
>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="custom_link_route"
|
||||
type="list"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_CUSTOM_LINK_ROUTE_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_CUSTOM_LINK_ROUTE_DESC">
|
||||
<option value="0">URL</option>
|
||||
<option value="1">Menu item</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
type="text"
|
||||
name="custom_link_url"
|
||||
default="http://"
|
||||
label="MOD_ARTICLES_NEWS_FIELD_CUSTOM_LINK_URL_LABEL"
|
||||
>
|
||||
</field>
|
||||
|
||||
<field
|
||||
type="menuitem"
|
||||
name="custom_link_menu"
|
||||
label="MOD_ARTICLES_NEWS_FIELD_CUSTOM_LINK_MENU_LABEL">
|
||||
</field>
|
||||
|
||||
<field
|
||||
type="textarea"
|
||||
name="pretext"
|
||||
rows="5"
|
||||
cols="5"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_PRETEXT_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_PRETEXT_DESC">
|
||||
</field>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="ITEM_SETTINGS">
|
||||
|
||||
<field
|
||||
name="item_title"
|
||||
class="btn-group"
|
||||
type="radio"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_NEWS_FIELD_TITLE_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_FIELD_TITLE_DESC">
|
||||
<option
|
||||
value="0">JHIDE</option>
|
||||
<option
|
||||
value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="link_titles"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="MOD_ARTICLES_NEWS_FIELD_LINKTITLE_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_FIELD_LINKTITLE_DESC">
|
||||
<option
|
||||
value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option
|
||||
value="0">JNO</option>
|
||||
<option
|
||||
value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="item_heading"
|
||||
type="list"
|
||||
default="h4"
|
||||
label="MOD_ARTICLES_ADV_NEWS_TITLE_HEADING"
|
||||
description="MOD_ARTICLES_NEWS_TITLE_HEADING_DESCRIPTION">
|
||||
<option
|
||||
value="h1">JH1</option>
|
||||
<option
|
||||
value="h2">JH2</option>
|
||||
<option
|
||||
value="h3">JH3</option>
|
||||
<option
|
||||
value="h4">JH4</option>
|
||||
<option
|
||||
value="h5">JH5</option>
|
||||
<option
|
||||
value="h6">JH6</option>
|
||||
</field>
|
||||
|
||||
<field name="show_introtext" type="radio" default="1"
|
||||
class="btn-group"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_SHOWINTROTEXT_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_SHOWINTROTEXT_DESC"
|
||||
>
|
||||
<option value="0">JHIDE
|
||||
</option>
|
||||
<option value="1">JSHOW
|
||||
</option>
|
||||
</field>
|
||||
|
||||
<field name="introtext_limit" type="text" default="0"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_INTROTEXTLIMIT_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_INTROTEXTLIMIT_DESC" />
|
||||
|
||||
<field name="show_tags" type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_SHOW_TAGS_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_SHOW_TAGS_DESC"
|
||||
labelclass="control-label"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="published"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_PUBLISHED_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_PUBLISHED_DESC">
|
||||
<option
|
||||
value="0">JHIDE</option>
|
||||
<option
|
||||
value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="createdby"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_CREATEDBY_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_CREATEDBY_DESC">
|
||||
<option
|
||||
value="0">JHIDE</option>
|
||||
<option
|
||||
value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
|
||||
<field
|
||||
name="intro_image"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_INTRO_IMAGES_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_INTRO_IMAGES_DESC">
|
||||
<option
|
||||
value="0">JHIDE</option>
|
||||
<option
|
||||
value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="intro_image_align"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="none"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_INTRO_IMAGES_ALIGN_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_FIELD_INTRO_IMAGES_ALIGN_DESC">
|
||||
<option
|
||||
value="none">None</option>
|
||||
<option
|
||||
value="left">left</option>
|
||||
<option
|
||||
value="right">right</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="image"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_NEWS_ADV_FIELD_IMAGES_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_FIELD_IMAGES_DESC">
|
||||
<option
|
||||
value="0">JHIDE</option>
|
||||
<option
|
||||
value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="readmore"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_NEWS_FIELD_READMORE_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_FIELD_READMORE_DESC">
|
||||
<option
|
||||
value="0">JHIDE</option>
|
||||
<option
|
||||
value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset
|
||||
name="advanced">
|
||||
|
||||
<field
|
||||
name="layout"
|
||||
type="modulelayout"
|
||||
label="JFIELD_ALT_LAYOUT_LABEL"
|
||||
description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
|
||||
|
||||
<field
|
||||
name="masonry"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_NEWS_ADV_MASONRY_LABEL"
|
||||
description="MOD_ARTICLES_NEWS_ADV_MASONRY_DESC">
|
||||
<option
|
||||
value="0">JDISABLED</option>
|
||||
<option
|
||||
value="1">JENABLED</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="moduleclass_sfx"
|
||||
type="text"
|
||||
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" />
|
||||
|
||||
<field
|
||||
name="cachemode"
|
||||
type="hidden"
|
||||
default="itemid">
|
||||
<option
|
||||
value="itemid"></option>
|
||||
</field>
|
||||
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
||||
@ -0,0 +1,169 @@
|
||||
<?php
|
||||
/**
|
||||
* Articles Newsflash Advanced
|
||||
*
|
||||
* @author TemplateMonster http://www.templatemonster.com
|
||||
* @copyright Copyright (C) 2012 - 2013 Jetimpex, Inc.
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2
|
||||
* Parts of this software are based on Articles Newsflash standard module
|
||||
*
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
$item_heading = $params->get('item_heading', 'h4');
|
||||
$item_images = json_decode($item->images);
|
||||
$urls = json_decode($item->urls);
|
||||
if($layout!='edit'){
|
||||
$canEdit = $item->params->get('access-edit');
|
||||
JHtml::addIncludePath(JPATH_BASE.'/components/com_content/helpers');
|
||||
}
|
||||
|
||||
if($layout!='edit') :
|
||||
if ($canEdit) : ?>
|
||||
<!-- Icons -->
|
||||
<div class="item_icons btn-group pull-right">
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-cog"></i> <span class="caret"></span> </a>
|
||||
<ul class="dropdown-menu">
|
||||
<?php if ($canEdit) : ?>
|
||||
<li class="edit-icon"> <?php echo JHtml::_('icon.edit', $item, $params); ?> </li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif;
|
||||
endif;
|
||||
|
||||
if ($params->get('intro_image')):
|
||||
if (isset($item_images->image_intro) and !empty($item_images->image_intro)) :
|
||||
$imgfloat = (empty($item_images->float_intro)) ? $params->get('float_intro') : $item_images->float_intro; ?>
|
||||
<!-- Intro Image -->
|
||||
<figure class="item_img img-intro img-intro__<?php echo htmlspecialchars($params->get('intro_image_align')); ?>">
|
||||
<?php if ((($params->get('item_title') && $params->get('link_titles')) || $params->get('readmore')) && $item->readmore) : ?>
|
||||
<a href="<?php echo $item->link;?>">
|
||||
<?php endif; ?>
|
||||
<img src="<?php echo JURI::base(). htmlspecialchars($item_images->image_intro); ?>" alt="<?php echo htmlspecialchars($item_images->image_intro_alt); ?>">
|
||||
<?php if ($item_images->image_intro_caption): ?>
|
||||
<figcaption><?php echo htmlspecialchars($item_images->image_intro_caption); ?></figcaption>
|
||||
<?php endif;
|
||||
if ((($params->get('item_title') && $params->get('link_titles')) || $params->get('readmore')) && $item->readmore) : ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
<?php elseif ($item_images->image_intro_caption) : ?>
|
||||
<i class="<?php echo $item_images->image_intro_caption; ?>"></i>
|
||||
<?php endif;
|
||||
endif; ?>
|
||||
<div class="item_content">
|
||||
<!-- Item title -->
|
||||
<?php if ($params->get('item_title')) : ?>
|
||||
<<?php echo $item_heading; ?> class="item_title item_title__<?php echo $params->get('moduleclass_sfx'); ?>">
|
||||
<?php if ($params->get('link_titles') && $item->link != '') : ?>
|
||||
<a href="<?php echo $item->link;?>"><?php echo $item->title;?></a>
|
||||
<?php else :
|
||||
echo wrap_with_span($item->title);
|
||||
endif; ?>
|
||||
</<?php echo $item_heading; ?>>
|
||||
<?php endif;
|
||||
|
||||
if (!$params->get('intro_only')) :
|
||||
echo $item->afterDisplayTitle;
|
||||
endif;
|
||||
|
||||
if ($params->get('show_tags', 1) && !empty($item->tags)) :
|
||||
$item->tagLayout = new JLayoutFile('joomla.content.tags');
|
||||
|
||||
echo $item->tagLayout->render($item->tags->itemTags);
|
||||
endif;
|
||||
|
||||
if ($params->get('published')) : ?>
|
||||
<time datetime="<?php echo JHtml::_('date', $item->publish_up, 'Y-m-d H:i'); ?>" class="item_published">
|
||||
<?php echo JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC1')); ?>
|
||||
</time>
|
||||
<?php endif;
|
||||
|
||||
if ($params->get('createdby')) : ?>
|
||||
<div class="item_createdby">
|
||||
<?php $author = $item->author;
|
||||
$author = ($item->created_by_alias ? $item->created_by_alias : $author);
|
||||
echo JText::sprintf('MOD_ARTICLES_NEWS_ADV_BY', $author); ?>
|
||||
</div>
|
||||
<?php endif;
|
||||
|
||||
echo $item->beforeDisplayContent;
|
||||
|
||||
if ($params->get('show_introtext')) : ?>
|
||||
<!-- Introtext -->
|
||||
<div class="item_introtext">
|
||||
<?php echo $item->introtext; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($urls) && (!empty($urls->urla) || !empty($urls->urlb) || !empty($urls->urlc))) :
|
||||
$urlarray = array(
|
||||
array($urls->urla, $urls->urlatext, $urls->targeta, 'a'),
|
||||
array($urls->urlb, $urls->urlbtext, $urls->targetb, 'b'),
|
||||
array($urls->urlc, $urls->urlctext, $urls->targetc, 'c')
|
||||
); ?>
|
||||
<div class="content-links">
|
||||
<ul>
|
||||
<?php foreach ($urlarray as $url) :
|
||||
$link = $url[0];
|
||||
$label = $url[1];
|
||||
$target = $url[2];
|
||||
$id = $url[3];
|
||||
|
||||
if ( ! $link) :
|
||||
continue;
|
||||
endif;
|
||||
|
||||
// If no label is present, take the link
|
||||
$label = ($label) ? $label : $link;
|
||||
|
||||
// If no target is present, use the default
|
||||
$target = $target ? $target : $params->get('target'.$id); ?>
|
||||
<li class="content-links-<?php echo $id; ?>">
|
||||
<?php
|
||||
// Compute the correct link
|
||||
|
||||
switch ($target)
|
||||
{
|
||||
case 1:
|
||||
// open in a new window
|
||||
echo '<a href="'. htmlspecialchars($link) .'" target="_blank" rel="nofollow">'.
|
||||
htmlspecialchars($label) .'</a>';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// open in a popup window
|
||||
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600';
|
||||
echo "<a href=\"" . htmlspecialchars($link) . "\" onclick=\"window.open(this.href, 'targetWindow', '".$attribs."'); return false;\">".
|
||||
htmlspecialchars($label).'</a>';
|
||||
break;
|
||||
case 3:
|
||||
// open in a modal window
|
||||
JHtml::_('behavior.modal', 'a.modal');
|
||||
echo '<a class="modal" href="'.htmlspecialchars($link).'" rel="{handler: \'iframe\', size: {x:600, y:600}}">'.
|
||||
htmlspecialchars($label) . ' </a>';
|
||||
break;
|
||||
|
||||
default:
|
||||
// open in parent window
|
||||
echo '<a href="'. htmlspecialchars($link) . '" rel="nofollow">'.
|
||||
htmlspecialchars($label) . ' </a>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Read More link -->
|
||||
<?php if (isset($item->link) && $item->readmore != 0 && $params->get('readmore')) :
|
||||
$readMoreText = JText::_('MOD_ARTICLES_NEWS_READMORE');
|
||||
if ($item->alternative_readmore){
|
||||
$readMoreText = $item->alternative_readmore;
|
||||
}
|
||||
echo '<a class="btn btn-info readmore" href="'.$item->link.'"><span>'. $readMoreText .'</span></a>';
|
||||
endif; ?>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
@ -0,0 +1,139 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_articles_news
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers');
|
||||
|
||||
$n = count($list);
|
||||
|
||||
if($n<$columns){
|
||||
$columns = $n;
|
||||
}
|
||||
|
||||
$spanClass = 'span'.floor($params->get('bootstrap_size')/$columns);
|
||||
$rows = ceil($n/$columns);
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$doc = JFactory::getDocument();
|
||||
$document =& $doc;
|
||||
$template = $app->getTemplate();
|
||||
|
||||
if($params->get('masonry')){
|
||||
$document->addScript(JURI::base() . 'modules/mod_articles_news_adv/js/masonry.pkgd.min.js');
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="mod-newsflash-adv mod-newsflash-adv__<?php echo $moduleclass_sfx; ?> cols-<?php echo $columns; ?>" id="module_<?php echo $module->id; ?>">
|
||||
<?php if ($params->get('pretext')): ?>
|
||||
<div class="pretext">
|
||||
<?php echo $params->get('pretext') ?>
|
||||
</div>
|
||||
<?php endif;
|
||||
if($params->get('masonry')) : ?>
|
||||
<div class="masonry row-fluid" id="mod-newsflash-adv__masonry<?php echo $module->id; ?>">
|
||||
<?php else: ?>
|
||||
<div class="row-fluid">
|
||||
<?php endif;
|
||||
for ($i = 0, $n; $i < $n; $i ++) :
|
||||
$item = $list[$i];
|
||||
|
||||
$class="";
|
||||
if($item->featured){
|
||||
$class .= "featured";
|
||||
}
|
||||
|
||||
if($i == $n-1){
|
||||
$class="lastItem";
|
||||
}
|
||||
|
||||
if($rows > 1 && $i !== 0 && $i % $columns == 0 && !$params->get('masonry')){
|
||||
echo '</div><div class="row-fluid">';
|
||||
}
|
||||
?>
|
||||
<article class="<?php echo $spanClass; ?> item item_num<?php echo $i; ?> item__module <?php echo $class; ?>" id="item_<?php echo $item->id; ?>">
|
||||
<?php require JModuleHelper::getLayoutPath('mod_articles_news_adv', '_item'); ?>
|
||||
</article>
|
||||
<?php endfor; ?>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php if($params->get('mod_button') == 1): ?>
|
||||
<div class="mod-newsflash-adv_custom-link">
|
||||
<?php
|
||||
$menuLink = $menu->getItem($params->get('custom_link_menu'));
|
||||
|
||||
switch ($params->get('custom_link_route'))
|
||||
{
|
||||
case 0:
|
||||
$link_url = $params->get('custom_link_url');
|
||||
break;
|
||||
case 1:
|
||||
$link_url = JRoute::_($menuLink->link.'&Itemid='.$menuLink->id);
|
||||
break;
|
||||
default:
|
||||
$link_url = "#";
|
||||
break;
|
||||
}
|
||||
echo '<a class="btn btn-info" href="'. $link_url .'">'. $params->get('custom_link_title') .'</a>';
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if($params->get('masonry')) : ?>
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
(function($){
|
||||
$(window).load(function(){
|
||||
var $container = $('#mod-newsflash-adv__masonry<?php echo $module->id; ?>');
|
||||
$container.masonry({
|
||||
//columnWidth: $container.width()/<?php echo $columns; ?>,
|
||||
itemSelector: '.item'
|
||||
});
|
||||
/*
|
||||
var $cols = <?php echo $columns; ?>;
|
||||
$container = $('#mod-newsflash-adv__masonry');
|
||||
$item = $('.isotope-item')
|
||||
$item.outerWidth(Math.floor($container.width() / $cols));
|
||||
$container.isotope({
|
||||
resizable: true
|
||||
});
|
||||
if($container.width() <= '480'){
|
||||
$item.outerWidth($container.width());
|
||||
$item.addClass('straightDown');
|
||||
$container.isotope({
|
||||
layoutMode: 'straightDown'
|
||||
});
|
||||
} else {
|
||||
$item.removeClass('straightDown');
|
||||
$container.isotope({
|
||||
layoutMode: 'masonry'
|
||||
});
|
||||
}
|
||||
$(window).resize(function(){
|
||||
$item.outerWidth(Math.floor($container.width() / $cols));
|
||||
if($container.width() <= '480'){
|
||||
$item.outerWidth($container.width());
|
||||
$item.addClass('straightDown');
|
||||
$container.isotope({
|
||||
layoutMode: 'straightDown'
|
||||
});
|
||||
} else {
|
||||
$item.outerWidth(Math.floor($container.width() / $cols));
|
||||
$item.removeClass('straightDown');
|
||||
$container.isotope({
|
||||
layoutMode: 'masonry'
|
||||
});
|
||||
}
|
||||
});*/
|
||||
});
|
||||
})(jQuery);
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
Loading…
Reference in New Issue
Block a user