-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added the Video Gallery portal mode * Updated polish language file
- Loading branch information
Showing
9 changed files
with
931 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'> | ||
|
@@ -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> | ||
|
@@ -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"> | ||
|
9 changes: 9 additions & 0 deletions
9
mod_news_pro_gk5/portal_modes/videogallery/configuration.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
215
mod_news_pro_gk5/portal_modes/videogallery/controller.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', '…'); | ||
$text = NSP_GK5_Utils::cutText(strip_tags($this->parent->content[$i]['text']), $this->parent->config, 'portal_mode_video_gallery_text_limit', '…'); | ||
// 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('&', '&', $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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<html><body bgcolor="#FFFFFF"></body></html> |
Oops, something went wrong.