Skip to content

Commit

Permalink
[v.1.3.5] Ready to release
Browse files Browse the repository at this point in the history
* Added the Video Gallery portal mode
* Updated polish language file
  • Loading branch information
dziudek committed Jan 5, 2014
1 parent 8b10109 commit a530b18
Show file tree
Hide file tree
Showing 9 changed files with 931 additions and 6 deletions.
4 changes: 4 additions & 0 deletions mod_news_pro_gk5/language/en-GB.mod_news_pro_gk5.ini
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,10 @@ NSP_PORTAL_MODE_HIGHLIGHTS_TITLE_LIMIT_TYPE="Type of title limit"

COM_MODULES_NSP_PORTAL_MODE_VIDEOGALLERY_FIELDSET_LABEL="Video Gallery - Portal Mode Settings"
MOD_NEWS_PRO_GK5_VIDEOGALLERY="Video Gallery"
MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP="Video popup"
MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP_DESC="You can disable the video popup which is displayed when article contains a video in K2 component."
MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP_X="Popup width"
MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP_Y="Popup height"
NSP_PORTAL_MODE_VIDEO_GALLERY_PAGES="Amount of pages"
NSP_PORTAL_MODE_VIDEO_GALLERY_PAGES_DESC="Amount of pages with articles. When bigger than 1 - then the auto-animation will be automatically enabled."
NSP_PORTAL_MODE_VIDEO_GALLERY_PER_PAGE="Articles per page"
Expand Down
35 changes: 34 additions & 1 deletion mod_news_pro_gk5/language/pl-PL.mod_news_pro_gk5.ini
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ MOD_NEWS_PRO_GK5_TITLE="Według tytułów"
MOD_NEWS_PRO_GK5_ORDER="Według kolejności"
MOD_NEWS_PRO_GK5_RANDOM="Losowo"
MOD_NEWS_PRO_GK5_HITS="Według wyświetleń"
MOD_NEWS_PRO_GK5_RATING="Według ocen"
MOD_NEWS_PRO_GK5_NEWS_SORT_ORDER="Kierunek sortowania"
MOD_NEWS_PRO_GK5_NEWS_SORT_ORDER_DESC="Kierunek sortowania artykułów"
MOD_NEWS_PRO_GK5_ASC="Rosnąco"
Expand Down Expand Up @@ -597,7 +598,7 @@ MOD_NEWS_PRO_GK5_PORTAL_MODE_CENTERED_TITLE_OVERLAY_TEXT_BG_DESC="Opcja ta pozwa

; - Tytuły nad zdjęciami - siatka

COM_MODULES_NSP_PORTAL_MODE_GRID_TITLE_OVERLAY_FIELDSET_LABEL="Tytuły nad zdjęciami - siatka - Portal Mode Settings"
COM_MODULES_NSP_PORTAL_MODE_GRID_TITLE_OVERLAY_FIELDSET_LABEL="Tytuły nad zdjęciami - siatka - Ustawienia trybu portalowego"
MOD_NEWS_PRO_GK5_GRID_TITLE_OVERLAY="Tytuły nad zdjęciami - siatka"
MOD_NEWS_PRO_GK5_PORTAL_MODE_GRID_TITLE_OVERLAY_TEXT_POS="Pozycja bloku z tekstem"
MOD_NEWS_PRO_GK5_PORTAL_MODE_GRID_TITLE_OVERLAY_TEXT_POS_DESC="Opcja ta pozwala określić pozycję bloku z tekstem"
Expand All @@ -610,3 +611,35 @@ MOD_NEWS_PRO_GK5_PORTAL_MODE_GRID_TITLE_OVERLAY_TEXT_COLOR="Kolor tekstu"
MOD_NEWS_PRO_GK5_PORTAL_MODE_GRID_TITLE_OVERLAY_TEXT_COLOR_DESC="Opcja ta pozwala określić kolor tekstu tak samo jak określa się właściwość color w CSS."
MOD_NEWS_PRO_GK5_PORTAL_MODE_GRID_TITLE_OVERLAY_DARK="Ciemny"
MOD_NEWS_PRO_GK5_PORTAL_MODE_GRID_TITLE_OVERLAY_LIGHT="Jasny"

; - Najważniejsze wpisy

COM_MODULES_NSP_PORTAL_MODE_HIGHLIGHTS_FIELDSET_LABEL="Najważniejsze wpisy - Ustawienia trybu portalowego"
MOD_NEWS_PRO_GK5_HIGHLIGHTS="Najważniejsze wpisy"
MOD_NEWS_PRO_GK5_PORTAL_MODE_HIGHLIGHTS_READMORE="Link 'Więcej'"
MOD_NEWS_PRO_GK5_PORTAL_MODE_HIGHLIGHTS_READMORE_DESC="Wartość linka 'Więcej' - pozostaw to pole pustym aby ukryć link"
MOD_NEWS_PRO_GK5_PORTAL_MODE_HIGHLIGHTS_READMORE_VALUE="Więcej…"
MOD_NEWS_PRO_GK5_PORTAL_MODE_HIGHLIGHTS_AMOUNT="Liczba wpisów"
MOD_NEWS_PRO_GK5_PORTAL_MODE_HIGHLIGHTS_AMOUNT_DESC="Wyświetlana liczba wpisów"
MOD_NEWS_PRO_GK5_PORTAL_MODE_HIGHLIGHTS_DATE_FORMAT="Format daty"
MOD_NEWS_PRO_GK5_PORTAL_MODE_HIGHLIGHTS_DATE_FORMAT_DESC="To pole działa dokładnie tak samo jak pole formatu daty w bloku informacji. Pozostaw to pole pustym aby ukryć blok daty."
NSP_PORTAL_MODE_HIGHLIGHTS_TITLE_LIMIT="Długość tytułu"
NSP_PORTAL_MODE_HIGHLIGHTS_TITLE_LIMIT_TYPE="Rodzaj limitu dla tytułu"

; - Video Gallery

COM_MODULES_NSP_PORTAL_MODE_VIDEOGALLERY_FIELDSET_LABEL="Galeria Wideo - Ustawienia trybu portalowego"
MOD_NEWS_PRO_GK5_VIDEOGALLERY="Galeria Wideo"
MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP="Popup Wideo"
MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP_DESC="Pozwala wyłączyć popup wideo który jest wyświetlany dla artykułów z komponentu K2, które posiadają zdefiniowane wideo."
MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP_X="Szerokość popupu"
MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP_Y="Wysokość popupu"
NSP_PORTAL_MODE_VIDEO_GALLERY_PAGES="Liczba stron"
NSP_PORTAL_MODE_VIDEO_GALLERY_PAGES_DESC="Liczba stron z artykułami. Gdy jest większa od 1 - automatycznie zostanie uruchomiona automatyczna animacja stron z wpisami."
NSP_PORTAL_MODE_VIDEO_GALLERY_PER_PAGE="Liczba artykułów na stronę"
NSP_PORTAL_MODE_VIDEO_GALLERY_PER_PAGE_DESC="Liczba artykułów wyświetlanych na jednej stronie"
NSP_PORTAL_MODE_VIDEO_GALLERY_TITLE_LIMIT_TYPE="Rodzaj limitu dla tytułu"
NSP_PORTAL_MODE_VIDEO_GALLERY_TEXT_LIMIT_TYPE="Rodzaj limitu dla tekstu"
NSP_PORTAL_MODE_VIDEO_GALLERY_TITLE_LIMIT="Długość tytułu"
NSP_PORTAL_MODE_VIDEO_GALLERY_TEXT_LIMIT="Długość tekstu"
NSP_PORTAL_MODE_VIDEO_GALLERY_AUTOANIMATION="Interwał czasowy dla autoanimacji"
42 changes: 37 additions & 5 deletions mod_news_pro_gk5/mod_news_pro_gk5.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="2.5.0" client="site" method="upgrade">
<name>News Show Pro GK5</name>
<creationDate>07/12/2013</creationDate>
<creationDate>05/01/2014</creationDate>
<author>Gavick.com</author>
<copyright>(C) 2009-2013 Gavick.com</copyright>
<copyright>(C) 2009-2014 Gavick.com</copyright>
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.gavick.com</authorUrl>
<version>1.3.4</version>
<version>1.3.5</version>
<description>
<![CDATA[
<style type='text/css'>
Expand All @@ -19,7 +19,7 @@
span.readonly p.license { border-top: 1px solid #eee; font-size: 11px; margin: 30px 26px 0; padding: 6px 0; }
</style>
<span class='readonly'>
<h1>News Show Pro GK5 <small>ver. 1.3.4</small></h1>
<h1>News Show Pro GK5 <small>ver. 1.3.5</small></h1>
<p>GK5 is new generation of our extensions dedicated to Joomla 2.5+.</p>
<p>Basing on experiences gathered, we created probably the best tool to present articles for Joomla! Huge amount of options and possibilities of formatting causes News Show Pro GK5 is a complex tool in making www pages content attractive. News Show Pro is appropriate while preparing simple structures with an individual article, the same as, complex arrangements including few articles and a list of links.</p>
<p class='homepage'><a href='http://www.gavick.com/news-show-pro-gk5.html' target='_blank'>Learn more at the NSP GK5 project website.</a></p>
Expand Down Expand Up @@ -433,7 +433,39 @@

<field type="text" name="portal_mode_highlights_title_limit" class="short text-limit" default="40" label="NSP_PORTAL_MODE_HIGHLIGHTS_TITLE_LIMIT" description="" />
</fieldset>


<fieldset name="NSP_PORTAL_MODE_VIDEOGALLERY">
<field name="portal_mode_video_gallery_popup" type="list" class="gk_switch" default="1" label="MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP" description="MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP_DESC">
<option value="0">MOD_NEWS_PRO_GK5_DISABLED</option>
<option value="1">MOD_NEWS_PRO_GK5_ENABLED</option>
</field>

<field type="text" name="portal_mode_video_gallery_popup_x" default="640" label="MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP_X" description="" />

<field type="text" name="portal_mode_video_gallery_popup_y" default="480" label="MOD_NEWS_PRO_GK5_PORTAL_MODE_VIDEO_GALLERY_POPUP_Y" description="" />

<field type="text" name="portal_mode_video_gallery_pages" default="2" label="NSP_PORTAL_MODE_VIDEO_GALLERY_PAGES" description="NSP_PORTAL_MODE_VIDEO_GALLERY_PAGES_DESC" />

<field type="text" name="portal_mode_video_gallery_per_page" default="3" label="NSP_PORTAL_MODE_VIDEO_GALLERY_PER_PAGE" description="NSP_PORTAL_MODE_VIDEO_GALLERY_PER_PAGE_DESC" />


<field name="portal_mode_video_gallery_title_limit_type" class="short" type="radio" default="chars" label="NSP_PORTAL_MODE_VIDEO_GALLERY_TITLE_LIMIT_TYPE" description="">
<option value="words">MOD_NEWS_PRO_GK5_WORDS</option>
<option value="chars">MOD_NEWS_PRO_GK5_CHARS</option>
</field>

<field type="text" name="portal_mode_video_gallery_title_limit" class="short text-limit" default="40" label="NSP_PORTAL_MODE_VIDEO_GALLERY_TITLE_LIMIT" description="" />

<field name="portal_mode_video_gallery_text_limit_type" class="short" type="radio" default="chars" label="NSP_PORTAL_MODE_VIDEO_GALLERY_TEXT_LIMIT_TYPE" description="">
<option value="words">MOD_NEWS_PRO_GK5_WORDS</option>
<option value="chars">MOD_NEWS_PRO_GK5_CHARS</option>
</field>

<field type="text" name="portal_mode_video_gallery_text_limit" class="short text-limit" default="60" label="NSP_PORTAL_MODE_VIDEO_GALLERY_TEXT_LIMIT" description="" />

<field type="text" name="portal_mode_video_gallery_autoanimation" default="5000" class="input-ms" label="NSP_PORTAL_MODE_VIDEO_GALLERY_AUTOANIMATION" description="" />
</fieldset>

<!-- Portal Modes fieldsets END -->

<fieldset name="NSP_ARTICLE_LAYOUT">
Expand Down
9 changes: 9 additions & 0 deletions mod_news_pro_gk5/portal_modes/videogallery/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "VideoGallery",
"full_name": "VIDEOGALLERY",
"support": [
"com_content",
"com_k2"
],
"thumbnails": true
}
215 changes: 215 additions & 0 deletions mod_news_pro_gk5/portal_modes/videogallery/controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
<?php

/**
* Grid Title Overlay
* @package News Show Pro GK5
* @Copyright (C) 2009-2013 Gavick.com
* @ All rights reserved
* @ Joomla! is Free Software
* @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @version $Revision: GK5 1.3.3 $
**/

// access restriction
defined('_JEXEC') or die('Restricted access');

class NSP_GK5_VideoGallery {
// necessary class fields
private $parent;
private $mode;
private $videos;
// constructor
function __construct($parent) {
$this->parent = $parent;
// detect the supported Data Sources
if(stripos($this->parent->config['data_source'], 'com_content_') !== FALSE) {
$this->mode = 'com_content';
} else if(stripos($this->parent->config['data_source'], 'k2_') !== FALSE) {
$this->mode = 'com_k2';
} else {
$this->mode = false;
}
// get videos
$this->videos = $this->get_videos();
}
// static function which returns amount of articles to render - VERY IMPORTANT!!
static function amount_of_articles($parent) {
return $parent->config['portal_mode_video_gallery_pages'] * $parent->config['portal_mode_video_gallery_per_page'];
}
// output generator
function output() {
// check if any article to display exists
if(count($this->parent->content)) {
// output the HTML code
echo '<div class="gkNspPM gkNspPM-VideoGallery" data-autoanim="'.$this->parent->config['portal_mode_video_gallery_autoanimation'].'">';
// render blocks
for($i = 0; $i < count($this->parent->content); $i++) {
$title = NSP_GK5_Utils::cutText(strip_tags($this->parent->content[$i]['title']), $this->parent->config, 'portal_mode_video_gallery_title_limit', '&hellip;');
$text = NSP_GK5_Utils::cutText(strip_tags($this->parent->content[$i]['text']), $this->parent->config, 'portal_mode_video_gallery_text_limit', '&hellip;');
// generating big block content on the first slide
if($i == 0) {
echo '<div class="gkBigBlock active">';
echo '<img class="gkIsHelperImage" src="data:image/png;base64,'. $this->generateBlankImage($this->parent->config['img_width'], $this->parent->config['img_height']) .'" alt="" />';
echo '<figure class="gkItem'.($this->get_video($i) != '#' ? ' video' : '').'">';
echo '<span class="gkImageWrap"><img src="'.$this->get_image($i).'" alt="'.htmlspecialchars(strip_tags($this->parent->content[$i]['title'])).'" data-url="'.$this->get_video($i).'" data-x="'.$this->parent->config['portal_mode_video_gallery_popup_x'].'" data-y="'.$this->parent->config['portal_mode_video_gallery_popup_y'].'" /></span>';
echo '<figcaption>';
echo '<strong>' . $this->parent->content[$i]['catname'] . '</strong>';
echo '<h3><a href="'.$this->get_link($i).'" title="'.htmlspecialchars(strip_tags($this->parent->content[$i]['title'])).'">'.$title.'</a></h3>';
echo '<p>'.$text.'</p>';
echo '<small>' . $this->parent->content[$i]['hits'] . '</small>';
echo '</figcaption>';
echo '</figure>';

echo '</div><div class="gkSmallBlock">';
}
//
if($i == 0) {
echo '<div class="gkItemsPage active">';
}
//
echo '<figure class="gkItem'.($this->get_video($i) != '#' ? ' video' : '').'" data-num="'.$i.'">';
echo '<span class="gkImageWrap"><img src="'.$this->get_image($i).'" alt="'.htmlspecialchars(strip_tags($this->parent->content[$i]['title'])).'" data-url="'.$this->get_video($i).'" data-x="'.$this->parent->config['portal_mode_video_gallery_popup_x'].'" data-y="'.$this->parent->config['portal_mode_video_gallery_popup_y'].'" /></span>';

echo '<figcaption>';
echo '<strong>' . $this->parent->content[$i]['catname'] . '</strong>';
echo '<h3><a href="'.$this->get_link($i).'" title="'.htmlspecialchars(strip_tags($this->parent->content[$i]['title'])).'">'.$title.'</a></h3>';
echo '<p>'.$text.'</p>';
echo '<small>' . $this->parent->content[$i]['hits'] . '</small>';
echo '</figcaption>';
echo '</figure>';

if(($i > 0 && (($i+1) % $this->parent->config['portal_mode_video_gallery_per_page'] == 0) && $i != count($this->parent->content) - 1) || ($this->parent->config['portal_mode_video_gallery_per_page'] == 1 && $i != count($this->parent->content) - 1)) {
echo '</div>';
echo '<div class="gkItemsPage">';
} elseif($i == count($this->parent->content) - 1) {
echo '</div>';
}
}
echo '</div>';
echo '</div>';
} else {
echo '<strong>Error:</strong> No articles to display';
}
}
// function used to retrieve all items videos
function get_videos() {
if($this->mode == 'com_k2') {
// prepare the array with IDs
$IDs = array();

for($i = 0; $i < count($this->parent->content); $i++) {
array_push($IDs, $this->parent->content[$i]['id']);
}

$IDs = implode(',', $IDs);
// use the array in the query
$db = JFactory::getDBO();
$query_videos = '
SELECT
c.id AS id,
c.video AS video
FROM
#__k2_items AS c
WHERE
c.id IN ('.$IDs.')
';
// Executing SQL Query
$db->setQuery($query_videos);

// check if some categories was detected
$results = array();
if($videos = $db->loadObjectList()) {
// prepare the results
foreach($videos as $v) {
$vid = $v->video;
if(trim($vid) != '') {
$vid_matches = array();
preg_match('@src="(.*?)"@mi', $vid, $vid_matches);
if(count($vid_matches) >= 1) {
$vid = $vid_matches[1];
} else {
$vid = '#';
}
} else {
$vid = '#';
}
$results[$v->id] = $vid;
}
}
// return the results
return $results;
} else {
return false;
}
}
// function used to retrieve the item video
function get_video($num) {
if($this->mode == 'com_k2' && $this->parent->config['portal_mode_video_gallery_popup'] == 1) {
return str_replace('&', '&amp;', $this->videos[$this->parent->content[$num]['id']]);
} else {
return '#';
}
}
// function used to retrieve the item URL
function get_link($num) {
if($this->mode == 'com_content') {
return ($this->parent->content[$num]['id'] != 0) ? JRoute::_(ContentHelperRoute::getArticleRoute($this->parent->content[$num]['id'], $this->parent->content[$num]['cid'])) : JRoute::_('index.php?option=com_users&view=login');
} else if($this->mode == 'com_k2') {
//
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
//
return urldecode(JRoute::_(K2HelperRoute::getItemRoute($this->parent->content[$num]['id'].':'.urlencode($this->parent->content[$num]['alias']), $this->parent->content[$num]['cid'].':'.urlencode($this->parent->content[$num]['cat_alias']))));
} else {
return false;
}
}
// image generator
function get_image($num) {
// used variables
$url = false;
$output = '';
// select the proper image function
if($this->mode == 'com_content') {
// load necessary com_content View class
if(!class_exists('NSP_GK5_com_content_View')) {
require_once(JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_content/view'));
}
// generate the com_content image URL only
$url = NSP_GK5_com_content_View::image($this->parent->config, $this->parent->content[$num], true, true);
} else if($this->mode == 'com_k2') {
// load necessary k2 View class
if(!class_exists('NSP_GK5_com_k2_View')) {
require_once(JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_k2/view'));
}
// generate the K2 image URL only
$url = NSP_GK5_com_k2_View::image($this->parent->config, $this->parent->content[$num], true, true);
}
// check if the URL exists
if($url === FALSE) {
return false;
} else {
// if URL isn't blank - return it!
if($url != '') {
return $url;
} else {
return false;
}
}
}
// function to generate blank transparent PNG images
public function generateBlankImage($width, $height){
$image = imagecreatetruecolor($width, $height);
imagesavealpha($image, true);
$transparent = imagecolorallocatealpha($image, 0, 0, 0, 127);
imagefill($image, 0, 0, $transparent);
// cache the output
ob_start();
imagepng($image);
$img = ob_get_contents();
ob_end_clean();
// return the string
return base64_encode($img);
}
}

// EOF
1 change: 1 addition & 0 deletions mod_news_pro_gk5/portal_modes/videogallery/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
Loading

0 comments on commit a530b18

Please sign in to comment.