| Current Path : /var/www/modules/mod_yendifvideoshare_videos/ |
| Current File : /var/www/modules/mod_yendifvideoshare_videos/mod_yendifvideoshare_videos.php |
<?php
/**
* @version 1.2.9
* @package Com_YendifVideoShare
* @author PluginsWare Interactive Pvt. Ltd <admin@yendifplayer.com>
* @copyright Copyright (c) 2012 - 2021 PluginsWare Interactive Pvt. Ltd. All Rights Reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Prevent direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
if ( ! defined( 'DS' ) ) {
define( 'DS', DIRECTORY_SEPARATOR );
}
require_once dirname(__FILE__) . DS . 'helper.php';
require_once JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_yendifvideoshare' . DS . 'libraries' . DS . 'utils.php';
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$config = YendifVideoShareUtils::getConfig();
$canDo = isset( $config->access ) ? 1 : 0;
$cols = (int) $params->get( 'no_of_cols', $config->no_of_cols );
$rows = (int) $params->get( 'no_of_rows', $config->no_of_rows );
$itemId = $params->get( 'itemid', 0 );
$column = 0;
$show_excerpt = $params->get( 'show_excerpt', $config->show_excerpt );
if ( $show_excerpt == 'global' ) {
$show_excerpt = $config->show_excerpt;
}
$excerpt_length = $config->playlist_desc_limit;
$show_views = $params->get( 'show_views', $config->show_views );
if ( $show_views == 'global' ) {
$show_views = $config->show_views;
}
if ( $canDo ) {
$show_rating = $params->get( 'show_rating', $config->show_rating );
if ( $show_rating == 'global' ) {
$show_rating = $config->show_rating;
}
} else {
$show_rating = 0;
}
if ( $canDo ) {
$enable_popup = $params->get( 'enable_popup', $config->enable_popup );
if ( $enable_popup == 'global' ) {
$enable_popup = $config->enable_popup;
}
} else {
$enable_popup = 0;
}
$ratio = $params->get( 'ratio', $config->ratio );
$items = YendifVideoShareVideosHelper::getItems( $params, $config->schedule_video_publishing, $rows * $cols );
$limit = count( $items );
$has_more_btn = $params->get( 'show_more_btn', 0 );
if ( $has_more_btn && $limit > 0 ) {
$more_link = $params->get( 'more_btn_link', '' );
if ( '' == trim( $more_link ) ) {
if ( $params->get( 'catid', 0 ) > 0 ) {
$category = YendifVideoShareVideosHelper::getCategory( $items[0]->catid );
$more_link = YendifVideoShareUtils::buildRoute( $category, 'category' );
} else {
$more_link = YendifVideoShareUtils::buildRoute();
}
}
} else {
$has_more_btn = 0;
}
JHtml::_('jquery.framework');
if ( $config->bootstrap_version == 3 ) {
$document->addStyleSheet( YendifVideoShareUtils::prepareURL( 'media/yendifvideoshare/assets/site/css/bootstrap.css', 'text/css', 'screen' ) );
}
$document->addStyleSheet( YendifVideoShareUtils::prepareURL( 'media/yendifvideoshare/assets/site/css/yendifvideoshare.css', 'text/css', 'screen' ) );
if ( ! empty( $config->responsive_css ) ) {
$document->addStyleDeclaration( $config->responsive_css );
}
if ( $enable_popup ) {
$document->addStyleSheet( YendifVideoShareUtils::prepareURL( 'media/yendifvideoshare/assets/site/css/magnific-popup.css', 'text/css', 'screen' ) );
$document->addScript( YendifVideoShareUtils::prepareURL( 'media/yendifvideoshare/assets/site/js/jquery.magnific-popup.min.js' ) );
}
$document->addScript( YendifVideoShareUtils::prepareURL( 'media/yendifvideoshare/assets/site/js/yendifvideoshare.js' ) );
$moduleclass_sfx = htmlspecialchars( $params->get( 'moduleclass_sfx' ) );
require JModuleHelper::getLayoutPath( 'mod_yendifvideoshare_videos' );