feat: Add YouTube video support and update admin templates
- Introduced a new YouTube tech integration in `youtube.min.js` for enhanced video playback. - Created new admin template files for managing video settings, including `index.php` and `steasyvideo-pro.tpl`. - Updated hook templates (`device_mode.tpl`, `forquickview.tpl`, `header.tpl`, `miniature.tpl`, `miniature_tb.tpl`, and predefined templates) to include video functionality. - Implemented caching headers in several PHP files to improve performance. - Ensured all new templates include proper licensing information and copyright notices.
This commit is contained in:
12
modules/steasyvideo/.htaccess
Normal file
12
modules/steasyvideo/.htaccess
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<IfModule !mod_rewrite.c>
|
||||||
|
# Apache 2.2
|
||||||
|
<IfModule !mod_authz_core.c>
|
||||||
|
Order deny,allow
|
||||||
|
Deny from all
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# Apache 2.4
|
||||||
|
<IfModule mod_authz_core.c>
|
||||||
|
Require all denied
|
||||||
|
</IfModule>
|
||||||
|
</IfModule>
|
||||||
357
modules/steasyvideo/classes/EasyVideoBase.php
Normal file
357
modules/steasyvideo/classes/EasyVideoBase.php
Normal file
@@ -0,0 +1,357 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
class EasyVideoBase
|
||||||
|
{
|
||||||
|
public static $device = ['desktop' => 'DESKTOP', 'mobile' => 'MOBILE', 'quickview' => 'QUICKVIEW'];
|
||||||
|
|
||||||
|
public static $selectors = array(
|
||||||
|
'miniature_video_selector_desktop' => array(
|
||||||
|
'classic' => '.product-thumbnail',
|
||||||
|
'st' => '.pro_first_box',
|
||||||
|
'warehouse' => '.thumbnail-container',
|
||||||
|
),
|
||||||
|
'miniature_button_selector_desktop' => array(
|
||||||
|
'classic' => '.thumbnail-top',
|
||||||
|
'st' => '.pro_first_box',
|
||||||
|
'warehouse' => '.thumbnail-container',
|
||||||
|
),
|
||||||
|
'miniature_video_selector_mobile' => array(
|
||||||
|
'classic' => '.product-thumbnail',
|
||||||
|
'st' => '.pro_first_box',
|
||||||
|
'warehouse' => '.thumbnail-container',
|
||||||
|
),
|
||||||
|
'miniature_button_selector_mobile' => array(
|
||||||
|
'classic' => '.thumbnail-top',
|
||||||
|
'st' => '.pro_first_box',
|
||||||
|
'warehouse' => '.thumbnail-container',
|
||||||
|
),
|
||||||
|
'gallery_video_selector_desktop' => array(
|
||||||
|
'classic' => '.page-product:not(.modal-open) .images-container .product-cover',
|
||||||
|
'st' => '.page-product:not(.modal-open) .pro_gallery_top_inner',
|
||||||
|
'warehouse' => '.page-product:not(.modal-open) .images-container .product-cover',
|
||||||
|
),
|
||||||
|
'gallery_button_selector_desktop' => array(
|
||||||
|
'classic' => '.page-product:not(.modal-open) .images-container .product-cover',
|
||||||
|
'st' => '.page-product:not(.modal-open) .pro_gallery_top_inner',
|
||||||
|
'warehouse' => '.page-product:not(.modal-open) .images-container .product-cover',
|
||||||
|
),
|
||||||
|
'gallery_type_desktop' => array(
|
||||||
|
'st' => 1,
|
||||||
|
'warehouse' => 1,
|
||||||
|
),
|
||||||
|
'gallery_thumbnail_type_desktop' => array(
|
||||||
|
'classic' => 5,
|
||||||
|
'st' => 1,
|
||||||
|
'warehouse' => 1,
|
||||||
|
),
|
||||||
|
'gallery_slider_selector_desktop' => array(
|
||||||
|
'st' => '.page-product:not(.modal-open) .pro_gallery_top',
|
||||||
|
'warehouse' => '.page-product:not(.modal-open) #product-images-large',
|
||||||
|
),
|
||||||
|
'gallery_thumbnail_selector_desktop' => array(
|
||||||
|
'st' => '.page-product:not(.modal-open) .pro_gallery_thumbs',
|
||||||
|
'warehouse' => '.page-product:not(.modal-open) #product-images-thumbs',
|
||||||
|
),
|
||||||
|
'gallery_thumbnail_item_selector_desktop' => array(
|
||||||
|
'classic' => '.images-container .thumb-container',
|
||||||
|
'st' => '.pro_gallery_thumbs_container .swiper-slide',
|
||||||
|
'warehouse' => '#product-images-thumbs .slick-slide',
|
||||||
|
),
|
||||||
|
'gallery_video_template_desktop' => array(
|
||||||
|
'st' => 2,
|
||||||
|
'warehouse' => 3,
|
||||||
|
),
|
||||||
|
'gallery_video_image_type_desktop' => array(
|
||||||
|
'classic' => 'large_default',
|
||||||
|
'st' => 'medium_default',
|
||||||
|
'warehouse' => 'large_default',
|
||||||
|
),
|
||||||
|
'gallery_button_template_desktop' => array(
|
||||||
|
'st' => 1,
|
||||||
|
'warehouse' => 1,
|
||||||
|
),
|
||||||
|
'gallery_button_image_type_desktop' => array(
|
||||||
|
'classic' => 'small_default',
|
||||||
|
'st' => 'cart_default',
|
||||||
|
'warehouse' => 'medium_default',
|
||||||
|
),
|
||||||
|
|
||||||
|
|
||||||
|
'gallery_video_selector_mobile' => array(
|
||||||
|
'classic' => '.page-product:not(.modal-open) .images-container .product-cover',
|
||||||
|
'st' => '.page-product:not(.modal-open) .pro_gallery_top_inner',
|
||||||
|
'warehouse' => '.page-product:not(.modal-open) .images-container .product-cover',
|
||||||
|
),
|
||||||
|
'gallery_button_selector_mobile' => array(
|
||||||
|
'classic' => '.page-product:not(.modal-open) .images-container .product-cover',
|
||||||
|
'st' => '.page-product:not(.modal-open) .pro_gallery_top_inner',
|
||||||
|
'warehouse' => '.page-product:not(.modal-open) .images-container .product-cover',
|
||||||
|
),
|
||||||
|
'gallery_type_mobile' => array(
|
||||||
|
'st' => 1,
|
||||||
|
'warehouse' => 1,
|
||||||
|
),
|
||||||
|
'gallery_thumbnail_type_mobile' => array(
|
||||||
|
'classic' => 5,
|
||||||
|
'st' => 1,
|
||||||
|
'warehouse' => 1,
|
||||||
|
),
|
||||||
|
'gallery_slider_selector_mobile' => array(
|
||||||
|
'st' => '.page-product:not(.modal-open) .pro_gallery_top',
|
||||||
|
'warehouse' => '.page-product:not(.modal-open) #product-images-large',
|
||||||
|
),
|
||||||
|
'gallery_thumbnail_selector_mobile' => array(
|
||||||
|
'st' => '.page-product:not(.modal-open) .pro_gallery_thumbs',
|
||||||
|
'warehouse' => '.page-product:not(.modal-open) #product-images-thumbs',
|
||||||
|
),
|
||||||
|
'gallery_thumbnail_item_selector_mobile' => array(
|
||||||
|
'classic' => '.images-container .thumb-container',
|
||||||
|
'st' => '.pro_gallery_thumbs_container .swiper-slide',
|
||||||
|
'warehouse' => '#product-images-thumbs .slick-slide',
|
||||||
|
),
|
||||||
|
'gallery_video_template_mobile' => array(
|
||||||
|
'st' => 2,
|
||||||
|
'warehouse' => 3,
|
||||||
|
),
|
||||||
|
'gallery_video_image_type_mobile' => array(
|
||||||
|
'classic' => 'large_default',
|
||||||
|
'st' => 'medium_default',
|
||||||
|
'warehouse' => 'large_default',
|
||||||
|
),
|
||||||
|
'gallery_button_template_mobile' => array(
|
||||||
|
'st' => 1,
|
||||||
|
'warehouse' => 1,
|
||||||
|
),
|
||||||
|
'gallery_button_image_type_mobile' => array(
|
||||||
|
'classic' => 'small_default',
|
||||||
|
'st' => 'cart_default',
|
||||||
|
'warehouse' => 'medium_default',
|
||||||
|
),
|
||||||
|
|
||||||
|
|
||||||
|
'gallery_video_selector_quickview' => array(
|
||||||
|
'classic' => '.modal.quickview .images-container .product-cover',
|
||||||
|
'st' => '.modal.quickview .pro_gallery_top_inner',
|
||||||
|
'warehouse' => '.modal.quickview .images-container .product-cover',
|
||||||
|
),
|
||||||
|
'gallery_button_selector_quickview' => array(
|
||||||
|
'classic' => '.modal.quickview .images-container .product-cover',
|
||||||
|
'st' => '.modal.quickview .pro_gallery_top_inner',
|
||||||
|
'warehouse' => '.modal.quickview .images-container .product-cover',
|
||||||
|
),
|
||||||
|
'gallery_type_quickview' => array(
|
||||||
|
'st' => 1,
|
||||||
|
'warehouse' => 1,
|
||||||
|
),
|
||||||
|
'gallery_thumbnail_type_quickview' => array(
|
||||||
|
'classic' => 5,
|
||||||
|
'st' => 1,
|
||||||
|
'warehouse' => 1,
|
||||||
|
),
|
||||||
|
'gallery_slider_selector_quickview' => array(
|
||||||
|
'st' => '.modal.quickview .pro_gallery_top',
|
||||||
|
'warehouse' => '.modal.quickview #product-images-large',
|
||||||
|
),
|
||||||
|
'gallery_thumbnail_selector_quickview' => array(
|
||||||
|
'st' => '.modal.quickview .pro_gallery_thumbs',
|
||||||
|
'warehouse' => '.modal.quickview #product-images-thumbs',
|
||||||
|
),
|
||||||
|
'gallery_thumbnail_item_selector_quickview' => array(
|
||||||
|
'classic' => '.images-container .thumb-container',
|
||||||
|
'st' => '.pro_gallery_thumbs_container .swiper-slide',
|
||||||
|
'warehouse' => '#product-images-thumbs .slick-slide',
|
||||||
|
),
|
||||||
|
'gallery_video_template_quickview' => array(
|
||||||
|
'st' => 2,
|
||||||
|
'warehouse' => 3,
|
||||||
|
),
|
||||||
|
'gallery_video_image_type_quickview' => array(
|
||||||
|
'classic' => 'large_default',
|
||||||
|
'st' => 'medium_default',
|
||||||
|
'warehouse' => 'large_default',
|
||||||
|
),
|
||||||
|
'gallery_button_template_quickview' => array(
|
||||||
|
'st' => 1,
|
||||||
|
'warehouse' => 1,
|
||||||
|
),
|
||||||
|
'gallery_button_image_type_quickview' => array(
|
||||||
|
'classic' => 'small_default',
|
||||||
|
'st' => 'cart_default',
|
||||||
|
'warehouse' => 'medium_default',
|
||||||
|
),
|
||||||
|
|
||||||
|
'gallery_video_zindex' => array(
|
||||||
|
'classic' => 9,
|
||||||
|
'st' => 9,
|
||||||
|
'warehouse' => 23,
|
||||||
|
),
|
||||||
|
'miniature_video_zindex' => array(
|
||||||
|
'classic' => 1,
|
||||||
|
'st' => 1,
|
||||||
|
'warehouse' => 1,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
public static $_theme_name;
|
||||||
|
|
||||||
|
public static function getThemeName(){
|
||||||
|
if(!self::$_theme_name){
|
||||||
|
self::$_theme_name = Configuration::get('ST_EASY_VIDEO_THEME_NAME');
|
||||||
|
if (!self::$_theme_name) {
|
||||||
|
self::$_theme_name = Tools::strtolower(Context::getContext()->shop->theme->getName());
|
||||||
|
$parent_theme_name = Tools::strtolower(Context::getContext()->shop->theme->get("parent", ""));
|
||||||
|
if ($parent_theme_name == 'panda') {
|
||||||
|
self::$_theme_name = 'panda';
|
||||||
|
} elseif ($parent_theme_name == 'transformer') {
|
||||||
|
self::$_theme_name = 'transformer';
|
||||||
|
} elseif ($parent_theme_name == 'warehouse') {
|
||||||
|
self::$_theme_name = 'warehouse';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return self::$_theme_name;
|
||||||
|
}
|
||||||
|
public static function getSelector($key, $device = '', $default = '')
|
||||||
|
{
|
||||||
|
$theme_name = self::getThemeName();
|
||||||
|
$theme_name = $theme_name == 'panda' || $theme_name == 'transformer' ? 'st' : $theme_name;
|
||||||
|
$key = $device ? $key.'_'.$device : $key;
|
||||||
|
return isset(self::$selectors[$key]) && array_key_exists($theme_name, self::$selectors[$key]) ? self::$selectors[$key][$theme_name] : (isset(self::$selectors[$key]['classic']) ? self::$selectors[$key]['classic'] : $default);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function fetchMediaServer(&$video)
|
||||||
|
{
|
||||||
|
if($video){
|
||||||
|
$image = _PS_IMG_DIR_ . 'steasyvideo/' . $video['id_st_easy_video'] . '.jpg';
|
||||||
|
if (file_exists($image)) {
|
||||||
|
$image_url = _PS_IMG_ . 'steasyvideo/' . $video['id_st_easy_video'] . '.jpg';
|
||||||
|
$video['thumbnail'] = Context::getContext()->link->protocol_content.Tools::getMediaServer($image_url).$image_url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static function getVideosByProduct($id_product, $locations=[], $limit=0, $link_rewrite='', $video_templates=[], $button_templates=[])
|
||||||
|
{
|
||||||
|
if(!$id_product)
|
||||||
|
return false;
|
||||||
|
$cover = Product::getCover($id_product);
|
||||||
|
$gallery_video_template = $gallery_button_template = $miniature_video_template = $miniature_button_template = $gallery_video_image_type = $gallery_button_image_type = $gallery_video_placeholder_url = $gallery_button_placeholder_url = $miniature_video_image_type = $miniature_button_image_type = $miniature_video_placeholder_url = $miniature_button_placeholder_url = [];
|
||||||
|
foreach (self::$device as $kl => $ku) {
|
||||||
|
$gallery_video_template[$kl] = Configuration::get('ST_EASY_VIDEO_GALLERY_VIDEO_TEMPLATE_'.$ku);
|
||||||
|
if(!$gallery_video_template[$kl] && ($id = self::getSelector('gallery_video_template', $kl)) && !empty($video_templates[$id]))
|
||||||
|
$gallery_video_template[$kl] = $video_templates[$id];
|
||||||
|
$gallery_button_template[$kl] = Configuration::get('ST_EASY_VIDEO_GALLERY_BUTTON_TEMPLATE_'.$ku);
|
||||||
|
if(!$gallery_button_template[$kl] && ($id = self::getSelector('gallery_button_template', $kl)) && !empty($button_templates[$id]))
|
||||||
|
$gallery_button_template[$kl] = $button_templates[$id];
|
||||||
|
$miniature_video_template[$kl] = Configuration::get('ST_EASY_VIDEO_MINIATURE_VIDEO_TEMPLATE_'.$ku);
|
||||||
|
$miniature_button_template[$kl] = Configuration::get('ST_EASY_VIDEO_MINIATURE_BUTTON_TEMPLATE_'.$ku);
|
||||||
|
|
||||||
|
$gallery_video_image_type[$kl] = Configuration::get('ST_EASY_VIDEO_GALLERY_VIDEO_IMAGE_TYPE_'.$ku);
|
||||||
|
$gallery_video_image_type[$kl] = $gallery_video_image_type[$kl] ?: self::getSelector('gallery_video_image_type', $kl);
|
||||||
|
$gallery_button_image_type[$kl] = Configuration::get('ST_EASY_VIDEO_GALLERY_BUTTON_IMAGE_TYPE_'.$ku);
|
||||||
|
$gallery_button_image_type[$kl] = $gallery_button_image_type[$kl] ?: self::getSelector('gallery_button_image_type', $kl);
|
||||||
|
$miniature_video_image_type[$kl] = Configuration::get('ST_EASY_VIDEO_MINIATURE_VIDEO_IMAGE_TYPE_'.$ku);
|
||||||
|
$miniature_video_image_type[$kl] = $miniature_video_image_type[$kl] ?: self::getSelector('miniature_video_image_type', $kl);
|
||||||
|
$miniature_button_image_type[$kl] = Configuration::get('ST_EASY_VIDEO_MINIATURE_BUTTON_IMAGE_TYPE_'.$ku);
|
||||||
|
$miniature_button_image_type[$kl] = $miniature_button_image_type[$kl] ?: self::getSelector('miniature_button_image_type', $kl);
|
||||||
|
|
||||||
|
if ($cover) {
|
||||||
|
$gallery_video_placeholder_url[$kl] = Context::getContext()->link->getImageLink($link_rewrite, $cover['id_image'], $gallery_video_image_type[$kl]);
|
||||||
|
$gallery_button_placeholder_url[$kl] = Context::getContext()->link->getImageLink($link_rewrite, $cover['id_image'], $gallery_button_image_type[$kl]);
|
||||||
|
$miniature_video_placeholder_url[$kl] = Context::getContext()->link->getImageLink($link_rewrite, $cover['id_image'], $miniature_video_image_type[$kl]);
|
||||||
|
$miniature_button_placeholder_url[$kl] = Context::getContext()->link->getImageLink($link_rewrite, $cover['id_image'], $miniature_button_image_type[$kl]);
|
||||||
|
} else {
|
||||||
|
$gallery_video_placeholder_url[$kl] = Tools::getCurrentUrlProtocolPrefix().Tools::getMediaServer(_THEME_PROD_DIR_)._THEME_PROD_DIR_.Context::getContext()->language->iso_code.'-default-'.$gallery_video_image_type[$kl].'.jpg';
|
||||||
|
$gallery_button_placeholder_url[$kl] = Tools::getCurrentUrlProtocolPrefix().Tools::getMediaServer(_THEME_PROD_DIR_)._THEME_PROD_DIR_.Context::getContext()->language->iso_code.'-default-'.$gallery_button_image_type[$kl].'.jpg';
|
||||||
|
$miniature_video_placeholder_url[$kl] = Tools::getCurrentUrlProtocolPrefix().Tools::getMediaServer(_THEME_PROD_DIR_)._THEME_PROD_DIR_.Context::getContext()->language->iso_code.'-default-'.$miniature_video_image_type[$kl].'.jpg';
|
||||||
|
$miniature_button_placeholder_url[$kl] = Tools::getCurrentUrlProtocolPrefix().Tools::getMediaServer(_THEME_PROD_DIR_)._THEME_PROD_DIR_.Context::getContext()->language->iso_code.'-default-'.$miniature_button_image_type[$kl].'.jpg';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$videos_for_template = [];
|
||||||
|
if ($videos = StEasyVideoClass::getVideos($id_product, $locations, Context::getContext()->language->id, $limit)) {
|
||||||
|
foreach ($videos as $index => $video) {
|
||||||
|
self::fetchMediaServer($video);
|
||||||
|
if (preg_match("/youtu(\.be|be\.com)/", $video['url'])) {
|
||||||
|
$video['url'] = preg_replace("(^https?)", "", $video['url']);
|
||||||
|
if (!$video['thumbnail'] && $video['online_thumbnail'] && ($youtube_id = self::getYoutubeId($video['url']))) {
|
||||||
|
$video['thumbnail'] = "//img.youtube.com/vi/".$youtube_id."/default.jpg";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (self::$device as $kl => $ku) {
|
||||||
|
if (!empty($gallery_video_template[$kl])) {
|
||||||
|
$video['gallery_video_template_'.$kl] = self::prepareTemplate($gallery_video_template[$kl], $video, $gallery_video_placeholder_url[$kl], $gallery_video_image_type[$kl]);
|
||||||
|
}
|
||||||
|
if (!empty($gallery_button_template[$kl])) {
|
||||||
|
$video['gallery_button_template_'.$kl] = self::prepareTemplate($gallery_button_template[$kl], $video, $gallery_button_placeholder_url[$kl], $gallery_button_image_type[$kl]);
|
||||||
|
}
|
||||||
|
if (!empty($miniature_video_template[$kl])) {
|
||||||
|
$video['miniature_video_template_'.$kl] = self::prepareTemplate($miniature_video_template[$kl], $video, $miniature_video_placeholder_url[$kl], $miniature_video_image_type[$kl]);
|
||||||
|
}
|
||||||
|
if (!empty($miniature_button_template[$kl])) {
|
||||||
|
$video['miniature_button_template_'.$kl] = self::prepareTemplate($miniature_button_template[$kl], $video, $miniature_button_placeholder_url[$kl], $miniature_button_image_type[$kl]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$video['autoplay'] = (int)$video['autoplay'];
|
||||||
|
$video['loop'] = (int)$video['loop'];
|
||||||
|
$video['muted'] = (int)$video['muted'];
|
||||||
|
$video['desktop_ran'] = false;
|
||||||
|
$video['mobile_ran'] = false;
|
||||||
|
$video['quickview_ran'] = false;
|
||||||
|
$videos_for_template['product_'.$id_product.'_'.$index] = $video;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $videos_for_template;
|
||||||
|
}
|
||||||
|
public static function prepareTemplate($template, $video, $placehoder_url, $image_type)
|
||||||
|
{
|
||||||
|
$image_size = Image::getSize($image_type);
|
||||||
|
$template = str_replace('@thumbnail_url@', ($video['thumbnail'] ?: $placehoder_url), $template);
|
||||||
|
$template = str_replace('@placeholder_url@', $placehoder_url, $template);
|
||||||
|
if ($image_size) {
|
||||||
|
$template = str_replace('@placeholder_width@', $image_size['width'], $template);
|
||||||
|
$template = str_replace('@placeholder_height@', $image_size['height'], $template);
|
||||||
|
} else {
|
||||||
|
$template = str_replace('@placeholder_width@', '', $template);
|
||||||
|
$template = str_replace('@placeholder_height@', '', $template);
|
||||||
|
}
|
||||||
|
return $template;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getYoutubeId($url)
|
||||||
|
{
|
||||||
|
preg_match("/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|shorts\/)([^#\&\?]*).*/", $url, $match);
|
||||||
|
return ($match && Tools::strlen($match[1]) == 11) ? $match[1] : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
167
modules/steasyvideo/classes/StEasyVideoClass.php
Normal file
167
modules/steasyvideo/classes/StEasyVideoClass.php
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
class StEasyVideoClass extends ObjectModel
|
||||||
|
{
|
||||||
|
public $id;
|
||||||
|
public $id_st_easy_video;
|
||||||
|
public $position;
|
||||||
|
public $active;
|
||||||
|
public $url;
|
||||||
|
public $thumbnail;
|
||||||
|
public $online_thumbnail;
|
||||||
|
public $name;
|
||||||
|
public $loop;
|
||||||
|
public $muted;
|
||||||
|
public $autoplay;
|
||||||
|
public $sub_category;
|
||||||
|
public $id_product;
|
||||||
|
public $id_category;
|
||||||
|
public $id_manufacturer;
|
||||||
|
public $ratio;
|
||||||
|
public $location;
|
||||||
|
/**
|
||||||
|
* @see ObjectModel::$definition
|
||||||
|
*/
|
||||||
|
public static $definition = array(
|
||||||
|
'table' => 'st_easy_video',
|
||||||
|
'primary' => 'id_st_easy_video',
|
||||||
|
'multilang' => false,
|
||||||
|
'fields' => array(
|
||||||
|
'position' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt'),
|
||||||
|
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||||
|
'url' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 255, 'required'=>true),
|
||||||
|
'thumbnail' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 255),
|
||||||
|
'online_thumbnail' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt'),
|
||||||
|
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255),
|
||||||
|
'loop' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt'),
|
||||||
|
'muted' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt'),
|
||||||
|
'autoplay' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt'),
|
||||||
|
'sub_category' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt'),
|
||||||
|
'id_product' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything'),
|
||||||
|
'id_category' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt'),
|
||||||
|
'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt'),
|
||||||
|
'location' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt'),
|
||||||
|
'ratio' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 255),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
public function __construct($id = null, $id_lang = null, $id_shop = null)
|
||||||
|
{
|
||||||
|
Shop::addTableAssociation(self::$definition['table'], array('type' => 'shop'));
|
||||||
|
parent::__construct($id, $id_lang, $id_shop);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$image = _PS_IMG_DIR_ . 'steasyvideo/' . $this->id . '.jpg';
|
||||||
|
if (file_exists($image))
|
||||||
|
@unlink($image);
|
||||||
|
|
||||||
|
return parent::delete();
|
||||||
|
}
|
||||||
|
public static function getOneVideo($id_product, $location=0)
|
||||||
|
{
|
||||||
|
Shop::addTableAssociation('st_easy_video', array('type' => 'shop'));
|
||||||
|
$sql = 'SELECT *
|
||||||
|
FROM `'._DB_PREFIX_.'st_easy_video` spv
|
||||||
|
'.Shop::addSqlAssociation('st_easy_video', 'spv').'
|
||||||
|
WHERE spv.`active`=1 AND ('.self::getProductWhereConds($id_product).') '.($location ? ' AND spv.`location` IN (0, 2, 3) ' : ' AND spv.`location` IN (0, 3) ').'
|
||||||
|
ORDER BY spv.`position` desc';
|
||||||
|
|
||||||
|
return Db::getInstance()->getRow($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getVideos($id_product, $locations=[], $lang=0, $limit=0)
|
||||||
|
{
|
||||||
|
Shop::addTableAssociation('st_easy_video', array('type' => 'shop'));
|
||||||
|
$sql = 'SELECT *
|
||||||
|
FROM `'._DB_PREFIX_.'st_easy_video` spv
|
||||||
|
INNER JOIN `'._DB_PREFIX_.'st_easy_video_yuyan` yy ON yy.id_st_easy_video = spv.id_st_easy_video
|
||||||
|
'.Shop::addSqlAssociation('st_easy_video', 'spv').'
|
||||||
|
WHERE spv.`active`=1 AND ('.self::getProductWhereConds($id_product).') '.(count($locations) ? ' AND spv.`location` IN ('.implode(',', $locations).') ' : '').($lang ? ' AND ( yy.`id_lang` = 0 OR yy.`id_lang` = '.(int)$lang.')' : '').'
|
||||||
|
ORDER BY spv.`position` desc'.($limit ? ' LIMIT '.(int)$limit : '');
|
||||||
|
|
||||||
|
return Db::getInstance()->executeS($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get_lang_obj_data($id)
|
||||||
|
{
|
||||||
|
$data=Db::getInstance()->executeS((new DbQuery())->from(self::$definition['table'].'_yuyan')->where('id_st_easy_video='.(int)$id));
|
||||||
|
$new_data=[];
|
||||||
|
if($data && !empty($data)){
|
||||||
|
$new_data=array_column($data,'id_lang');
|
||||||
|
}
|
||||||
|
return $new_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getProductWhereConds($id)
|
||||||
|
{
|
||||||
|
$where = '0';
|
||||||
|
$product = new Product($id);
|
||||||
|
if ($product->id_manufacturer) {
|
||||||
|
$where .= ' OR (spv.`id_manufacturer` > 0 AND spv.`id_manufacturer`='.(int)$product->id_manufacturer.')';
|
||||||
|
}
|
||||||
|
$id_category = $product->id_category_default;
|
||||||
|
if ($cates = $product->getCategories()) {
|
||||||
|
$categories = array();
|
||||||
|
$parents = array();
|
||||||
|
foreach ($cates as $id_cate) {
|
||||||
|
$category = new Category($id_cate);
|
||||||
|
if (!$category->active || !$category->id) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($category->id) {
|
||||||
|
// For all product categories instead of deafult category.
|
||||||
|
$categories[] = (int)$category->id;
|
||||||
|
|
||||||
|
$id_array = array();
|
||||||
|
$category_parents = $category->getParentsCategories();
|
||||||
|
if (is_array($category_parents) && count($category_parents)) {
|
||||||
|
foreach ($category_parents as $v) {
|
||||||
|
$id_array[] = $v['id_category'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (in_array($id_category, $id_array)) {
|
||||||
|
$parents = array_merge($parents, $id_array);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$where .= ' OR (spv.`id_category` > 0 AND spv.`id_category` IN('.implode(',', array_unique(array_merge($categories, $parents))).') AND spv.`sub_category`=1) OR (spv.`id_category` > 0 AND spv.`id_category` IN('.implode(',', $categories).') AND spv.`sub_category`=0)';
|
||||||
|
}
|
||||||
|
if ($product->id) {
|
||||||
|
$where .= ' OR ( find_in_set(\''.(int)$product->id.'\', spv.`id_product`))';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $where;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
62
modules/steasyvideo/classes/StEasyVideoYuyanClass.php
Normal file
62
modules/steasyvideo/classes/StEasyVideoYuyanClass.php
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* 2007-2016 PrestaShop
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.txt.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* http://opensource.org/licenses/afl-3.0.php
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to http://www.prestashop.com for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA <contact@prestashop.com>
|
||||||
|
* @copyright 2007-2016 PrestaShop SA
|
||||||
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||||
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
class StEasyVideoYuyanClass
|
||||||
|
{
|
||||||
|
public static function deleteByVideo($id_st_easy_video)
|
||||||
|
{
|
||||||
|
if (!$id_st_easy_video) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'st_easy_video_yuyan WHERE `id_st_easy_video`='.(int)$id_st_easy_video);
|
||||||
|
}
|
||||||
|
public static function getByVideo($id_st_easy_video)
|
||||||
|
{
|
||||||
|
if (!$id_st_easy_video) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'st_easy_video_yuyan WHERE `id_st_easy_video`='.(int)$id_st_easy_video);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function changeVideoYuyan($id_st_easy_video, $yuyans)
|
||||||
|
{
|
||||||
|
if (!$id_st_easy_video) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$res = true;
|
||||||
|
foreach ($yuyans as $id_lang) {
|
||||||
|
$res &= Db::getInstance()->insert('st_easy_video_yuyan', array(
|
||||||
|
'id_st_easy_video' => (int)$id_st_easy_video,
|
||||||
|
'id_lang' => $id_lang
|
||||||
|
));
|
||||||
|
}
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
}
|
||||||
34
modules/steasyvideo/classes/index.php
Normal file
34
modules/steasyvideo/classes/index.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
34
modules/steasyvideo/composer.json
Normal file
34
modules/steasyvideo/composer.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"name": "prestashop/steasyvideo",
|
||||||
|
"description": "PrestaShop module steasyvideo",
|
||||||
|
"homepage": "https://www.sunnytoo.com",
|
||||||
|
"license": "",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "ST-THEMES",
|
||||||
|
"email": "helloleemj@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.6.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"preferred-install": "dist",
|
||||||
|
"classmap-authoritative": true,
|
||||||
|
"optimize-autoloader": true,
|
||||||
|
"prepend-autoloader": false,
|
||||||
|
"platform": {
|
||||||
|
"php": "5.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"PrestaShop\\Module\\StEasyVideo\\": "src/"
|
||||||
|
},
|
||||||
|
"classmap": ["steasyvideo.php"],
|
||||||
|
"exclude-from-classmap": []
|
||||||
|
},
|
||||||
|
"type": "prestashop-module"
|
||||||
|
}
|
||||||
23
modules/steasyvideo/composer.lock
generated
Normal file
23
modules/steasyvideo/composer.lock
generated
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"_readme": [
|
||||||
|
"This file locks the dependencies of your project to a known state",
|
||||||
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
|
"This file is @generated automatically"
|
||||||
|
],
|
||||||
|
"content-hash": "a373d9efff58dd240072b733ce534f28",
|
||||||
|
"packages": [],
|
||||||
|
"packages-dev": [],
|
||||||
|
"aliases": [],
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"stability-flags": [],
|
||||||
|
"prefer-stable": false,
|
||||||
|
"prefer-lowest": false,
|
||||||
|
"platform": {
|
||||||
|
"php": ">=5.6.0"
|
||||||
|
},
|
||||||
|
"platform-dev": [],
|
||||||
|
"platform-overrides": {
|
||||||
|
"php": "5.6"
|
||||||
|
},
|
||||||
|
"plugin-api-version": "2.1.0"
|
||||||
|
}
|
||||||
11
modules/steasyvideo/config.xml
Normal file
11
modules/steasyvideo/config.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<module>
|
||||||
|
<name>steasyvideo</name>
|
||||||
|
<displayName><![CDATA[Easy product video module]]></displayName>
|
||||||
|
<version><![CDATA[1.2.3]]></version>
|
||||||
|
<description><![CDATA[Using a fancy way to display self-hosted videos or youtube videos for products.]]></description>
|
||||||
|
<author><![CDATA[ST THEMES]]></author>
|
||||||
|
<tab><![CDATA[front_office_features]]></tab>
|
||||||
|
<is_configurable>1</is_configurable>
|
||||||
|
<need_instance>0</need_instance>
|
||||||
|
</module>
|
||||||
8
modules/steasyvideo/config/common.yml
Normal file
8
modules/steasyvideo/config/common.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
services:
|
||||||
|
_defaults:
|
||||||
|
public: true
|
||||||
|
|
||||||
|
st_steasyvideo_repository:
|
||||||
|
class: PrestaShop\Module\StEasyVideo\Repository\VideoRepository
|
||||||
|
arguments:
|
||||||
|
- '@prestashop.adapter.legacy.context' #used for product presenter
|
||||||
34
modules/steasyvideo/config/front/index.php
Normal file
34
modules/steasyvideo/config/front/index.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
2
modules/steasyvideo/config/front/services.yml
Normal file
2
modules/steasyvideo/config/front/services.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
imports:
|
||||||
|
- { resource: ../common.yml }
|
||||||
34
modules/steasyvideo/config/index.php
Normal file
34
modules/steasyvideo/config/index.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
require_once dirname(__FILE__) . '/AdminStEasyVideoListController.php';
|
||||||
|
class AdminStEasyVideoCategoryController extends AdminStEasyVideoListController
|
||||||
|
{
|
||||||
|
protected $contr = 'category';
|
||||||
|
public function addWhere($where = '')
|
||||||
|
{
|
||||||
|
return $where.' AND id_product=\'\' AND id_category!=0 AND id_manufacturer=0 ';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function filterFormFields(&$fileds, $obj)
|
||||||
|
{
|
||||||
|
array_splice($fileds['input'], 1, 0, array(
|
||||||
|
array(
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => $this->l('Select a category:'),
|
||||||
|
'required' => true,
|
||||||
|
'name' => 'id_category',
|
||||||
|
'class' => 'fixed-width-xxl',
|
||||||
|
'options' => array(
|
||||||
|
'query' => $this->getApplyCategory(),
|
||||||
|
'id' => 'id',
|
||||||
|
'name' => 'name',
|
||||||
|
'default' => array(
|
||||||
|
'value' => '',
|
||||||
|
'label' => $this->l('Please select')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'switch',
|
||||||
|
'label' => $this->l('Apply to subcategories:'),
|
||||||
|
'name' => 'sub_category',
|
||||||
|
'is_bool' => true,
|
||||||
|
'default_value' => 0,
|
||||||
|
'values' => array(
|
||||||
|
array(
|
||||||
|
'id' => 'sub_category_on',
|
||||||
|
'value' => 1,
|
||||||
|
'label' => $this->l('Enabled')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'sub_category_off',
|
||||||
|
'value' => 0,
|
||||||
|
'label' => $this->l('Disabled')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
public function getApplyCategory()
|
||||||
|
{
|
||||||
|
$category_arr = array();
|
||||||
|
$this->getCategoryOption($category_arr, Category::getRootCategory()->id, (int)$this->context->language->id, (int)Shop::getContextShopID(), true);
|
||||||
|
return $category_arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCategoryOption(&$category_arr, $id_category = 1, $id_lang = false, $id_shop = false, $recursive = true)
|
||||||
|
{
|
||||||
|
$id_lang = $id_lang ? (int)$id_lang : (int)Context::getContext()->language->id;
|
||||||
|
$category = new Category((int)$id_category, (int)$id_lang, (int)$id_shop);
|
||||||
|
|
||||||
|
if (is_null($category->id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($recursive) {
|
||||||
|
$children = Category::getChildren((int)$id_category, (int)$id_lang, true, (int)$id_shop);
|
||||||
|
$spacer = str_repeat(' ', $this->spacer_size * (int)$category->level_depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
$shop = (object) Shop::getShop((int)$category->getShopID());
|
||||||
|
$category_arr[] = array('id' => (int)$category->id,'name' => (isset($spacer) ? $spacer : '').$category->name.' ('.$shop->name.')');
|
||||||
|
|
||||||
|
if (isset($children) && is_array($children) && count($children)) {
|
||||||
|
foreach ($children as $child) {
|
||||||
|
$this->getCategoryOption($category_arr, (int)$child['id_category'], (int)$id_lang, (int)$child['id_shop'], $recursive);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
class AdminStEasyVideoController extends ModuleAdminController
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
Tools::redirectAdmin($this->context->link->getAdminLink('AdminStEasyVideoList'));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,421 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
class AdminStEasyVideoGalleryController extends ModuleAdminController
|
||||||
|
{
|
||||||
|
protected $contr = '';
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->bootstrap = true;
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$image_types_arr = array(
|
||||||
|
array('id' => '','name' => $this->l('Use the predefined value.'),)
|
||||||
|
);
|
||||||
|
$imagesTypes = ImageType::getImagesTypes('products');
|
||||||
|
foreach ($imagesTypes as $k => $imageType) {
|
||||||
|
if (Tools::substr($imageType['name'], -3) == '_2x') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$image_types_arr[] = array('id' => $imageType['name'], 'name' => $imageType['name'].'('.$imageType['width'].'x'.$imageType['height'].')');
|
||||||
|
}
|
||||||
|
$selector_desc = $this->contr == 'QUICKVIEW' ? $this->l('In most cases, selectors in quickview should start with .modal.quickview') : ($this->contr == 'DESKTOP' ? $this->l('In most cases, selectors start with .page-product:not(.modal-open) to avoid conflict with selectors in quickview window.') : '');
|
||||||
|
|
||||||
|
$play_icon_fields = $this->module->getButtonFiledsOptions('PLAY_ICON');
|
||||||
|
unset($play_icon_fields[$this->module->_prefix_st.'PLAY_ICON_BTN_HOVER_COLOR_'.$this->contr], $play_icon_fields[$this->module->_prefix_st.'PLAY_ICON_BTN_HOVER_BG_'.$this->contr]);
|
||||||
|
|
||||||
|
$this->fields_options = array(
|
||||||
|
'general' => array(
|
||||||
|
'title' => $this->l('General Settings'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'GALLERY_DISPLAY_'.$this->contr => array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'title' => $this->l('How to display vidoes'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('No'),
|
||||||
|
1 => $this->l('Buttons'),
|
||||||
|
2 => $this->l('Videos'),
|
||||||
|
3 => $this->l('Add videos to a slider'),
|
||||||
|
4 => $this->l('Add buttons to a thumbnail slider, videos show out when the buttons are clicked'),
|
||||||
|
5 => $this->l('Add videos to a slider, add buttons to a synchronized thumbnail slider'),
|
||||||
|
6 => $this->l('Videos, add buttons to a thumbnail slider.'),// panda transformer gallery image scrolling
|
||||||
|
7 => $this->l('A button on the first image, and a video icon on the first item of thumbnail slider'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_VIDEO_SELECTOR_'.$this->contr => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => $this->l('Video selector'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'desc' => $selector_desc,
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_VIDEO_APPEND_'.$this->contr => [
|
||||||
|
'title' => $this->l('How to add'),
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'select',
|
||||||
|
'identifier' => 'id',
|
||||||
|
'list' => $this->module::$_appends,
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_VIDEO_POSITION_'.$this->contr => [
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('How to video player'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Display on an element (Position: absolute)'),
|
||||||
|
1 => $this->l('Normal document flow (Position: static)'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_BUTTON_SELECTOR_'.$this->contr => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => $this->l('Button selector'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'desc' => $selector_desc,
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_BUTTON_APPEND_'.$this->contr => [
|
||||||
|
'title' => $this->l('How to add'),
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'select',
|
||||||
|
'identifier' => 'id',
|
||||||
|
'list' => $this->module::$_appends,
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_BUTTON_POSITION_'.$this->contr => [
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('How to display buttons'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Display on an element (Position: absolute)'),
|
||||||
|
1 => $this->l('Normal document flow (Position: static)'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_BUTTON_LAYOUT_'.$this->contr => array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('Play button layout'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Icon'),
|
||||||
|
1 => $this->l('Text'),
|
||||||
|
2 => $this->l('Icon + text horizontally'),
|
||||||
|
3 => $this->l('Icon + text vertically'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_BUTTON_HIDE_'.$this->contr => array(
|
||||||
|
'title' => $this->l('Hide the play button when videos start play'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
),
|
||||||
|
|
||||||
|
$this->module->_prefix_st.'GALLERY_TYPE_'.$this->contr => array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'title' => $this->l('Slider'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Use the predefined value.'),
|
||||||
|
1 => $this->l('Swiper'),
|
||||||
|
2 => $this->l('Slick slider'),
|
||||||
|
3 => $this->l('Owl carrousel 2'),
|
||||||
|
4 => $this->l('Owl carrousel 1'),
|
||||||
|
// 5 => $this->l('PrestaShop classic theme - Scrollbox'),
|
||||||
|
),
|
||||||
|
'desc' => $this->l('Select the first option if you are using one of these themes: Classic theme, Panda theme, Transformer theme and Warehouse theme.'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_SLIDER_APPEND_'.$this->contr => [
|
||||||
|
'title' => $this->l('How to add'),
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'select',
|
||||||
|
'identifier' => 'id',
|
||||||
|
'list' => array(
|
||||||
|
0 => array(
|
||||||
|
'id' => 0,
|
||||||
|
'name' => '1',
|
||||||
|
),
|
||||||
|
1 => array(
|
||||||
|
'id' => 1,
|
||||||
|
'name' => '2',
|
||||||
|
),
|
||||||
|
2 => array(
|
||||||
|
'id' => 2,
|
||||||
|
'name' => '3',
|
||||||
|
),
|
||||||
|
100 => array(
|
||||||
|
'id' => 100,
|
||||||
|
'name' => 'End',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_SLIDER_SELECTOR_'.$this->contr => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => $this->l('Gallery selector'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'desc' => $this->l('Leave it empty to use the predefined value.').$selector_desc,
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_THUMBNAIL_TYPE_'.$this->contr => array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'title' => $this->l('Thumbnail slider'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Use the predefined value.'),
|
||||||
|
1 => $this->l('Swiper'),
|
||||||
|
2 => $this->l('Slick slider'),
|
||||||
|
3 => $this->l('Owl carrousel 2'),
|
||||||
|
4 => $this->l('Owl carrousel 1'),
|
||||||
|
5 => $this->l('PrestaShop classic theme - Scrollbox'),
|
||||||
|
),
|
||||||
|
'desc' => $this->l('Select the first option if you are using one of these themes: Classic theme, Panda theme, Transformer theme and Warehouse theme.'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_THUMBNAIL_APPEND_'.$this->contr => [
|
||||||
|
'title' => $this->l('How to add'),
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'select',
|
||||||
|
'identifier' => 'id',
|
||||||
|
'list' => array(
|
||||||
|
0 => array(
|
||||||
|
'id' => 0,
|
||||||
|
'name' => '1',
|
||||||
|
),
|
||||||
|
1 => array(
|
||||||
|
'id' => 1,
|
||||||
|
'name' => '2',
|
||||||
|
),
|
||||||
|
2 => array(
|
||||||
|
'id' => 2,
|
||||||
|
'name' => '3',
|
||||||
|
),
|
||||||
|
100 => array(
|
||||||
|
'id' => 100,
|
||||||
|
'name' => 'End',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_THUMBNAIL_SELECTOR_'.$this->contr => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => $this->l('Thumbnail selector'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'desc' => $this->l('Leave it empty to use the predefined value.').$selector_desc,
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_THUMBNAIL_ITEM_SELECTOR_'.$this->contr => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => $this->l('Thumbnail item selector'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'desc' => $this->l('Leave it empty to use the predefined value.').$selector_desc,
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_CLOSE_VIDEO_'.$this->contr => array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('Close video'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Default'),
|
||||||
|
1 => $this->l('When a thumbnail item is clicked.'),
|
||||||
|
2 => $this->l('When a thumbnail item is on hover.'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_VIDEO_TEMPLATE_'.$this->contr => [
|
||||||
|
'title' => $this->l('Video template'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'type' => 'textarea',
|
||||||
|
'cols' => 30,
|
||||||
|
'rows' => 5,
|
||||||
|
'desc' => array(
|
||||||
|
$this->l('They are four variables you can use: @placeholder_url@, @placeholder_width@, @placeholder_height@, and @thumbnail_url@.'),
|
||||||
|
$this->l('Disable the "Use HTMLPurifier Library" setting on the "BO>Preferences>General" page, otherwise the value won\'t be saved.'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_VIDEO_IMAGE_TYPE_'.$this->contr => [
|
||||||
|
'title' => $this->l('Placeholder image for videos'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'required' => false,
|
||||||
|
'type' => 'select',
|
||||||
|
'list' => $image_types_arr,
|
||||||
|
'identifier' => 'id',
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_BUTTON_TEMPLATE_'.$this->contr => [
|
||||||
|
'title' => $this->l('Button template'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'type' => 'textarea',
|
||||||
|
'cols' => 30,
|
||||||
|
'rows' => 5,
|
||||||
|
'desc' => array(
|
||||||
|
$this->l('They are four variables you can use: @placeholder_url@, @placeholder_width@, @placeholder_height@, and @thumbnail_url@.'),
|
||||||
|
$this->l('Disable the "Use HTMLPurifier Library" setting on the "BO>Preferences>General" page, otherwise the value won\'t be saved.'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_BUTTON_IMAGE_TYPE_'.$this->contr => [
|
||||||
|
'title' => $this->l('Placeholder image for buttons'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'required' => false,
|
||||||
|
'type' => 'select',
|
||||||
|
'list' => $image_types_arr,
|
||||||
|
'identifier' => 'id',
|
||||||
|
],
|
||||||
|
),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'player' => array(
|
||||||
|
'title' => $this->l('Player'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'GALLERY_AUTOPLAY_'.$this->contr => array(
|
||||||
|
'title' => $this->l('Autoplay'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
'desc' => $this->l('When videos are displayed in video palyers'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_MUTED_'.$this->contr => array(
|
||||||
|
'title' => $this->l('Muted'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
'desc' => $this->l('Only muted videos can be autoplay'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_LOOP_'.$this->contr => array(
|
||||||
|
'title' => $this->l('Loop'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'GALLERY_CONTROLS_'.$this->contr => array(
|
||||||
|
'title' => $this->l('Show controls'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'player_style' => array(
|
||||||
|
'title' => $this->l('Player style'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'GALLERY_PLAYER_BG_'.$this->contr => [
|
||||||
|
'title' => $this->l('Color'),
|
||||||
|
'validation' => 'isColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'size' => 5,
|
||||||
|
'name' => $this->module->_prefix_st.'GALLERY_PLAYER_BG_'.$this->contr,
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_VIDEO_ZINDEX_'.$this->contr => [
|
||||||
|
'title' => $this->l('Z-index'),
|
||||||
|
'validation' => 'isUnsignedId',
|
||||||
|
'required' => false,
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'button_style' => array(
|
||||||
|
'title' => $this->l('Play button style'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'GALLERY_PLAY_BTN_POSITION_'.$this->contr => [
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('Position'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Center'),
|
||||||
|
1 => $this->l('Top left'),
|
||||||
|
2 => $this->l('Top right'),
|
||||||
|
3 => $this->l('Bottom right'),
|
||||||
|
4 => $this->l('Bottom left'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_PLAY_BTN_OFFSET_X_'.$this->contr => [
|
||||||
|
'title' => $this->l('Offset x'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
'suffix' => $this->l('pixels'),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_PLAY_BTN_OFFSET_Y_'.$this->contr => [
|
||||||
|
'title' => $this->l('Offset y'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
'suffix' => $this->l('pixels'),
|
||||||
|
],
|
||||||
|
) + $this->module->getButtonFiledsOptions('GALLERY_PLAY', '_'.$this->contr) + array(
|
||||||
|
$this->module->_prefix_st.'GALLERY_PLAY_TEXT_COLOR_'.$this->contr => [
|
||||||
|
'title' => $this->l('Play" text color'),
|
||||||
|
'validation' => 'isColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'size' => 5,
|
||||||
|
'name' => $this->module->_prefix_st.'GALLERY_PLAY_TEXT_COLOR_'.$this->contr,
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_PLAY_TEXT_BG_'.$this->contr => [
|
||||||
|
'title' => $this->l('Play" text background'),
|
||||||
|
'validation' => 'isColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'size' => 5,
|
||||||
|
'name' => $this->module->_prefix_st.'GALLERY_PLAY_TEXT_BG_'.$this->contr,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'close_style' => array(
|
||||||
|
'title' => $this->l('Close button style'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'GALLERY_CLOSE_BTN_POSITION_'.$this->contr => [
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('Position'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Center'),
|
||||||
|
1 => $this->l('Top left'),
|
||||||
|
2 => $this->l('Top right'),
|
||||||
|
3 => $this->l('Bottom right'),
|
||||||
|
4 => $this->l('Bottom left'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_CLOSE_BTN_OFFSET_X_'.$this->contr => [
|
||||||
|
'title' => $this->l('Offset x'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
'suffix' => $this->l('pixels'),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'GALLERY_CLOSE_BTN_OFFSET_Y_'.$this->contr => [
|
||||||
|
'title' => $this->l('Offset y'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
'suffix' => $this->l('pixels'),
|
||||||
|
],
|
||||||
|
) + $this->module->getButtonFiledsOptions('GALLERY_CLOSE', '_'.$this->contr),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'play_icon_style' => array(
|
||||||
|
'title' => $this->l('Play icon style'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => $play_icon_fields,
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function postProcess()
|
||||||
|
{
|
||||||
|
parent::postProcess();
|
||||||
|
}
|
||||||
|
public function setMedia($isNewTheme = false)
|
||||||
|
{
|
||||||
|
parent::setMedia($isNewTheme);
|
||||||
|
$this->addCss(_MODULE_DIR_.$this->module->name.'/views/css/admin.css');
|
||||||
|
$this->addJs(_MODULE_DIR_.$this->module->name.'/views/js/admin.js?108');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,576 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
class AdminStEasyVideoListController extends ModuleAdminController
|
||||||
|
{
|
||||||
|
protected $spacer_size = '5';
|
||||||
|
protected $contr = '';
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->bootstrap = true;
|
||||||
|
$this->table = 'st_easy_video';
|
||||||
|
$this->className = 'StEasyVideoClass';
|
||||||
|
$this->lang = false;
|
||||||
|
$this->addRowAction('edit');
|
||||||
|
$this->addRowAction('delete');
|
||||||
|
|
||||||
|
if (Shop::isFeatureActive()) {
|
||||||
|
Shop::addTableAssociation($this->table, array('type' => 'shop'));
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$this->bulk_actions = array(
|
||||||
|
'delete' => array(
|
||||||
|
'text' => $this->trans('Delete selected', array(), 'Modules.StEasyVideo.Admin'),
|
||||||
|
'icon' => 'icon-trash',
|
||||||
|
'confirm' => $this->trans('Delete selected items?', array(), 'Modules.StEasyVideo.Admin'),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!file_exists(_PS_IMG_DIR_.'/steasyvideo')) {
|
||||||
|
@mkdir(_PS_IMG_DIR_.'/steasyvideo', 0775, true)
|
||||||
|
|| @chmod(_PS_IMG_DIR_.'/steasyvideo', 0775);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->fieldImageSettings = [
|
||||||
|
'name' => 'thumbnail',
|
||||||
|
'dir' => 'steasyvideo',
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->fields_list = array(
|
||||||
|
'id_st_easy_video' => array(
|
||||||
|
'title' => $this->trans('ID', array(), 'Modules.StEasyVideo.Admin'),
|
||||||
|
'class' => 'fixed-width-xs'
|
||||||
|
),
|
||||||
|
'url' => array(
|
||||||
|
'title' => $this->l('Url'),
|
||||||
|
'type' => 'text',
|
||||||
|
'search' => false,
|
||||||
|
'orderby' => false,
|
||||||
|
'class' => 'fixed-width-xl',
|
||||||
|
),
|
||||||
|
'name' => array(
|
||||||
|
'title' => $this->l('Name'),
|
||||||
|
'width' => 140,
|
||||||
|
'type' => 'text',
|
||||||
|
'search' => false,
|
||||||
|
'orderby' => false,
|
||||||
|
),
|
||||||
|
'id_product' => array(
|
||||||
|
'title' => $this->l('Add to'),
|
||||||
|
'width' => 140,
|
||||||
|
'type' => 'text',
|
||||||
|
'callback' => 'displayAddTo',
|
||||||
|
'search' => false,
|
||||||
|
'orderby' => false,
|
||||||
|
'class' => 'fixed-width-xl',
|
||||||
|
),
|
||||||
|
'id_category' => array(
|
||||||
|
'title' => $this->l('Language'),
|
||||||
|
'width' => 140,
|
||||||
|
'type' => 'text',
|
||||||
|
'callback' => 'displayYuyan',
|
||||||
|
'search' => false,
|
||||||
|
'orderby' => false,
|
||||||
|
'class' => 'fixed-width-xs',
|
||||||
|
),
|
||||||
|
'autoplay' => array(
|
||||||
|
'title' => $this->trans('Autoplay', array(), 'Modules.StEasyVideo.Admin'),
|
||||||
|
'type' => 'text',
|
||||||
|
'callback' => 'displayState',
|
||||||
|
'orderby' => false,
|
||||||
|
'class' => 'fixed-width-md',
|
||||||
|
),
|
||||||
|
'muted' => array(
|
||||||
|
'title' => $this->trans('Muted', array(), 'Modules.StEasyVideo.Admin'),
|
||||||
|
'type' => 'text',
|
||||||
|
'callback' => 'displayState',
|
||||||
|
'orderby' => false,
|
||||||
|
'class' => 'fixed-width-md',
|
||||||
|
),
|
||||||
|
'loop' => array(
|
||||||
|
'title' => $this->trans('Loop', array(), 'Modules.StEasyVideo.Admin'),
|
||||||
|
'type' => 'text',
|
||||||
|
'callback' => 'displayState',
|
||||||
|
'orderby' => false,
|
||||||
|
'class' => 'fixed-width-md',
|
||||||
|
),
|
||||||
|
'active' => array(
|
||||||
|
'title' => $this->trans('Status', array(), 'Modules.StEasyVideo.Admin'),
|
||||||
|
'active' => 'status',
|
||||||
|
'type' => 'bool',
|
||||||
|
'orderby' => false,
|
||||||
|
'class' => 'fixed-width-md',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->_where = $this->addWhere();
|
||||||
|
$this->_orderBy = 'id_st_easy_video';
|
||||||
|
$this->_orderWay = 'DESC';
|
||||||
|
|
||||||
|
|
||||||
|
if (Tools::isSubmit('ajax_product_list')) {
|
||||||
|
$this->getAjaxProductsList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Media::addJsDefL('stsb_comfirmation_msg', $this->trans('Are you sure?', array(), 'Modules.StEasyVideo.Admin'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function postProcess()
|
||||||
|
{
|
||||||
|
if (Tools::getValue('deletethumbnail')) {
|
||||||
|
if (file_exists(_PS_IMG_DIR_.'/steasyvideo/'.(int)Tools::getValue('id_st_easy_video').'.jpg')
|
||||||
|
&& !unlink(_PS_IMG_DIR_.'/steasyvideo/'.(int)Tools::getValue('id_st_easy_video').'.jpg')) {
|
||||||
|
$this->context->controller->errors[] = $this->trans('Error while delete', array(), 'Admin.Notifications.Error');
|
||||||
|
}
|
||||||
|
Tools::redirectAdmin(self::$currentIndex.'&conf=7&' . $this->identifier . '='.(int)Tools::getValue('id_st_easy_video').'&update' . $this->table . '&token=' . $this->token);
|
||||||
|
}
|
||||||
|
return parent::postProcess();
|
||||||
|
}
|
||||||
|
public function setMedia($isNewTheme = false)
|
||||||
|
{
|
||||||
|
parent::setMedia($isNewTheme);
|
||||||
|
$this->addJqueryPlugin(array('autocomplete'));
|
||||||
|
$this->addJs(_MODULE_DIR_.$this->module->name.'/views/js/admin.js?108');
|
||||||
|
}
|
||||||
|
public function displayState($value, $tr)
|
||||||
|
{
|
||||||
|
$arr = array(
|
||||||
|
'0' => $this->l('No'),
|
||||||
|
'1' => $this->l('Yes'),
|
||||||
|
'2' => $this->l('Default'),
|
||||||
|
);
|
||||||
|
return array_key_exists($value, $arr) ? $arr[$value] : '';
|
||||||
|
}
|
||||||
|
public function displayYuyan($value, $tr)
|
||||||
|
{
|
||||||
|
$res = '';
|
||||||
|
$yuyuan = StEasyVideoYuyanClass::getByVideo($tr['id_st_easy_video']);
|
||||||
|
if ($yuyuan && is_array($yuyuan)) {
|
||||||
|
$all_languages = Language::getLanguages(false);
|
||||||
|
foreach ($yuyuan as $y) {
|
||||||
|
foreach ($all_languages as $language) {
|
||||||
|
if ($y['id_lang'] == $language['id_lang']) {
|
||||||
|
$res .= $language['name'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$res = $this->l('All');
|
||||||
|
}
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
public function displayAddTo($value, $tr)
|
||||||
|
{
|
||||||
|
$name = '';
|
||||||
|
if ($tr['id_category'] > 0) {
|
||||||
|
$category = new Category($tr['id_category'], Context::getContext()->language->id);
|
||||||
|
if (Validate::isLoadedObject($category)) {
|
||||||
|
$name .= $category->name;
|
||||||
|
}
|
||||||
|
} elseif ($tr['id_product'] != '') {
|
||||||
|
$products = Db::getInstance()->executeS('SELECT id_product,name from `'._DB_PREFIX_.'product_lang` WHERE id_product IN ('.trim($tr['id_product'], ',').') AND id_lang='.Context::getContext()->language->id.' AND id_shop='.Context::getContext()->shop->id);
|
||||||
|
if ($products && is_array($products)) {
|
||||||
|
foreach ($products as $key => $val) {
|
||||||
|
if ($key == 0) {
|
||||||
|
$name .= ''.$val['name'];
|
||||||
|
} else {
|
||||||
|
$name .= '<br>'.$val['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} elseif ($tr['id_manufacturer'] > 0) {
|
||||||
|
$manufacturer = new Manufacturer($tr['id_manufacturer'], Context::getContext()->language->id);
|
||||||
|
if (Validate::isLoadedObject($manufacturer)) {
|
||||||
|
$name .= $manufacturer->name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $name;
|
||||||
|
}
|
||||||
|
public function renderForm()
|
||||||
|
{
|
||||||
|
if (!($obj = $this->loadObject(true))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$image = _PS_IMG_DIR_ . $this->fieldImageSettings['dir'] . '/' . $obj->id . '.jpg';
|
||||||
|
$image_size = false;
|
||||||
|
$image_tag = '';
|
||||||
|
if (file_exists($image)) {
|
||||||
|
$image_size = filesize($image) / 1000;
|
||||||
|
$image_url = _PS_IMG_ . $this->fieldImageSettings['dir'] . '/' . $obj->id . '.jpg';
|
||||||
|
$image_tag = '<img src="' . Context::getContext()->link->protocol_content.Tools::getMediaServer($image_url).$image_url . '" alt="" class="imgm img-thumbnail" />';
|
||||||
|
}
|
||||||
|
|
||||||
|
Media::addJsDef(array(
|
||||||
|
'_currentIndex' => $this->context->link->getAdminLink('AdminModules'),
|
||||||
|
'_token' => Tools::getAdminTokenLite('AdminModules')
|
||||||
|
));
|
||||||
|
|
||||||
|
$this->fields_form = array(
|
||||||
|
'tinymce' => true,
|
||||||
|
'legend' => array(
|
||||||
|
'title' => $this->l('Add a video'),
|
||||||
|
'icon' => 'icon-tags',
|
||||||
|
),
|
||||||
|
'input' => array(
|
||||||
|
array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Video url:'),
|
||||||
|
'name' => 'url',
|
||||||
|
'default_value' => '',
|
||||||
|
'class' => 'fixed-width-xxl',
|
||||||
|
'required' => true,
|
||||||
|
'desc' => array(
|
||||||
|
$this->l('Url of a .mp4 file or a youtube url or a vimeo url.'),
|
||||||
|
$this->l('You can upload mp4 files to your site via FTP, another way is using the text editor at the bottom of this page to upload videos to your site to get urls.'),
|
||||||
|
'<div id="youtube_thumbnail"></div>'
|
||||||
|
),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'textarea',
|
||||||
|
'label' => $this->l('For uploading videos:'),
|
||||||
|
'name' => 'for_uploading_videos',
|
||||||
|
'desc' => $this->l('You can use the video button in the text editor to upload videos to your site to get their urls.'),
|
||||||
|
'autoload_rte' => 'rte',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'label' => $this->l('Display on:'),
|
||||||
|
'name' => 'location',
|
||||||
|
'is_bool' => false,
|
||||||
|
'default_value' => 0,
|
||||||
|
'values' => array(
|
||||||
|
array(
|
||||||
|
'id' => 'location_0',
|
||||||
|
'value' => 0,
|
||||||
|
'label' => $this->l('All'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'location_1',
|
||||||
|
'value' => 1,
|
||||||
|
'label' => $this->l('Main gallery on the product page'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'location_2',
|
||||||
|
'value' => 2,
|
||||||
|
'label' => $this->l('Product miniature on the product listing pages'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'location_3',
|
||||||
|
'value' => 3,
|
||||||
|
'label' => $this->l('Product miniatures'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Name:'),
|
||||||
|
'name' => 'name',
|
||||||
|
'size' => 64,
|
||||||
|
'desc' => $this->l('As a reminder, show on backoffice only.'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'switch',
|
||||||
|
'label' => $this->l('Use youtube thumbnail if it is a youtube video.'),
|
||||||
|
'name' => 'online_thumbnail',
|
||||||
|
'is_bool' => true,
|
||||||
|
'default_value' => 1,
|
||||||
|
'values' => array(
|
||||||
|
array(
|
||||||
|
'id' => 'online_thumbnail_on',
|
||||||
|
'value' => 1,
|
||||||
|
'label' => $this->l('Enabled')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'online_thumbnail_off',
|
||||||
|
'value' => 0,
|
||||||
|
'label' => $this->l('Disabled')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'thumbnail' => array(
|
||||||
|
'type' => 'file',
|
||||||
|
'label' => $this->l('Custom thumbnail:'),
|
||||||
|
'name' => 'thumbnail',
|
||||||
|
'display_image' => true,
|
||||||
|
'image' => $image_tag ? $image_tag : false,
|
||||||
|
'size' => $image_size,
|
||||||
|
'delete_url' => self::$currentIndex.'&deletethumbnail=1&' . $this->identifier . '='.(int)$obj->id.'&update' . $this->table . '&token=' . $this->token,
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'label' => $this->l('Autoplay:'),
|
||||||
|
'name' => 'autoplay',
|
||||||
|
'is_bool' => false,
|
||||||
|
'default_value' => 2,
|
||||||
|
'values' => array(
|
||||||
|
array(
|
||||||
|
'id' => 'autoplay_on',
|
||||||
|
'value' => 1,
|
||||||
|
'label' => $this->l('Yes'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'autoplay_off',
|
||||||
|
'value' => 0,
|
||||||
|
'label' => $this->l('No'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'autoplay_default',
|
||||||
|
'value' => 2,
|
||||||
|
'label' => $this->l('Use default'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'desc' => array(
|
||||||
|
$this->l('This option is NOT a guarantee that your video will autoplay.'),
|
||||||
|
$this->l('This option would not take effect if videos are put to the end of thumbnail gallery.'),
|
||||||
|
$this->l('Check the description of this module on sunnytoo.com for more info.'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'label' => $this->l('Loop:'),
|
||||||
|
'name' => 'loop',
|
||||||
|
'default_value' => 2,
|
||||||
|
'values' => array(
|
||||||
|
array(
|
||||||
|
'id' => 'loop_on',
|
||||||
|
'value' => 1,
|
||||||
|
'label' => $this->l('Yes'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'loop_off',
|
||||||
|
'value' => 0,
|
||||||
|
'label' => $this->l('No'),
|
||||||
|
),
|
||||||
|
/*array(
|
||||||
|
'id' => 'loop_no',
|
||||||
|
'value' => 3,
|
||||||
|
'label' => $this->l('No, close player after a video ends'),
|
||||||
|
),*/
|
||||||
|
array(
|
||||||
|
'id' => 'loop_default',
|
||||||
|
'value' => 2,
|
||||||
|
'label' => $this->l('Use default'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'label' => $this->l('Muted:'),
|
||||||
|
'name' => 'muted',
|
||||||
|
'is_bool' => true,
|
||||||
|
'default_value' => 2,
|
||||||
|
'values' => array(
|
||||||
|
array(
|
||||||
|
'id' => 'muted_on',
|
||||||
|
'value' => 1,
|
||||||
|
'label' => $this->l('Yes'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'muted_off',
|
||||||
|
'value' => 0,
|
||||||
|
'label' => $this->l('No'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'muted_default',
|
||||||
|
'value' => 2,
|
||||||
|
'label' => $this->l('Use default'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Aspect ratio:'),
|
||||||
|
'name' => 'ratio',
|
||||||
|
'size' => 64,
|
||||||
|
'desc' => $this->l('Generally, the video ratio should be the same as the product images. But if the vidoe ratio is different, then you can force the video to display at a specific ratio, use one of the values 16:9, 4:3, 9:16, 1:1.'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'switch',
|
||||||
|
'label' => $this->l('Status:'),
|
||||||
|
'name' => 'active',
|
||||||
|
'is_bool' => true,
|
||||||
|
'default_value' => 1,
|
||||||
|
'values' => array(
|
||||||
|
array(
|
||||||
|
'id' => 'active_on',
|
||||||
|
'value' => 1,
|
||||||
|
'label' => $this->l('Enabled')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'active_off',
|
||||||
|
'value' => 0,
|
||||||
|
'label' => $this->l('Disabled')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'label' => $this->l('Language:'),
|
||||||
|
'name' => 'id_lang',
|
||||||
|
'values' => array(
|
||||||
|
'query' => $this->getAllLanguages(),
|
||||||
|
'id' => 'id',
|
||||||
|
'name' => 'name',
|
||||||
|
),
|
||||||
|
'desc' => $this->l('It will show out on all languages if you don\'t select any.'),
|
||||||
|
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Position:'),
|
||||||
|
'name' => 'position',
|
||||||
|
'default_value' => 0,
|
||||||
|
'class' => 'fixed-width-sm'
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'buttons' => array(
|
||||||
|
array(
|
||||||
|
'title' => $this->l('Save all'),
|
||||||
|
'class' => 'btn btn-default pull-right',
|
||||||
|
'icon' => 'process-icon-save',
|
||||||
|
'type' => 'submit'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'submit' => array(
|
||||||
|
'title' => $this->l('Save and stay'),
|
||||||
|
'stay' => true
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
if (Shop::isFeatureActive()) {
|
||||||
|
$this->fields_form['input'][] = array(
|
||||||
|
'type' => 'shop',
|
||||||
|
'label' => $this->l('Shop association:'),
|
||||||
|
'name' => 'checkBoxShopAsso',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method_exists($this, 'filterFormFields')) {
|
||||||
|
$this->filterFormFields($this->fields_form, $obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::renderForm();
|
||||||
|
}
|
||||||
|
public function getFieldsValue($obj)
|
||||||
|
{
|
||||||
|
foreach ($this->fields_form as $fieldset) {
|
||||||
|
if (isset($fieldset['form']['input'])) {
|
||||||
|
foreach ($fieldset['form']['input'] as $input) {
|
||||||
|
if (!isset($this->fields_value[$input['name']])) {
|
||||||
|
if (isset($input['type']) && $input['type'] == 'shop') {
|
||||||
|
if ($obj->id) {
|
||||||
|
$result = Shop::getShopById((int) $obj->id, $this->identifier, $this->table);
|
||||||
|
foreach ($result as $row) {
|
||||||
|
$this->fields_value['shop'][$row['id_' . $input['type']]][] = $row['id_shop'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif (isset($input['name']) && $input['name']=='id_lang') {
|
||||||
|
$lang_obj_data= StEasyVideoClass::get_lang_obj_data($obj->id);
|
||||||
|
foreach ($this->getAllLanguages() as $language) {
|
||||||
|
if(in_array($language['id'],$lang_obj_data)){
|
||||||
|
$this->fields_value['id_lang_'.$language['id']]=$language['id'];
|
||||||
|
} elseif (count($lang_obj_data) == 1 && $lang_obj_data[0] == 0) {
|
||||||
|
$this->fields_value['id_lang_'.$language['id']]=$language['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$field_value = $this->getFieldValue($obj, $input['name']);
|
||||||
|
if ($field_value === false && isset($input['default_value'])) {
|
||||||
|
$field_value = $input['default_value'];
|
||||||
|
}
|
||||||
|
$this->fields_value[$input['name']] = $field_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->fields_value;
|
||||||
|
}
|
||||||
|
protected function copyFromPost(&$object, $table)
|
||||||
|
{
|
||||||
|
parent::copyFromPost($object, $table);
|
||||||
|
if ($this->contr == 'product') {
|
||||||
|
if ($ids = Tools::getValue('st_id_product')) {
|
||||||
|
$object->id_product = ','.implode(',', $ids).',';
|
||||||
|
} else {
|
||||||
|
$this->errors[] = $this->l('Please select products.');
|
||||||
|
}
|
||||||
|
$object->id_category = 0;
|
||||||
|
$object->id_manufacturer = 0;
|
||||||
|
} elseif ($this->contr == 'category') {
|
||||||
|
$object->id_product = '';
|
||||||
|
$object->id_manufacturer = 0;
|
||||||
|
if (!$object->id_category) {
|
||||||
|
$this->errors[] = $this->l('Please select a category.');
|
||||||
|
}
|
||||||
|
} elseif ($this->contr == 'manufacturer') {
|
||||||
|
$object->id_category = 0;
|
||||||
|
$object->id_product = '';
|
||||||
|
if (!$object->id_manufacturer) {
|
||||||
|
$this->errors[] = $this->l('Please select a manufacturer.');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->errors[] = $this->l('Where do you want to add the video.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function afterAdd($object)
|
||||||
|
{
|
||||||
|
return $this->updateAssoLang($object->id);
|
||||||
|
}
|
||||||
|
public function afterUpdate($object)
|
||||||
|
{
|
||||||
|
return $this->updateAssoLang($object->id);
|
||||||
|
}
|
||||||
|
public function updateAssoLang($id, $lang = [])
|
||||||
|
{
|
||||||
|
StEasyVideoYuyanClass::deleteByVideo($id);
|
||||||
|
$lang_arr = array();
|
||||||
|
$all_languages = Language::getLanguages(false);
|
||||||
|
foreach ($all_languages as $lang) {
|
||||||
|
if (Tools::getValue('id_lang_'.$lang['id_lang'])) {
|
||||||
|
$lang_arr[] = $lang['id_lang'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$res = true;
|
||||||
|
if (count($lang_arr) && count($lang_arr) < count($all_languages)) {
|
||||||
|
$res = StEasyVideoYuyanClass::changeVideoYuyan($id, $lang_arr);
|
||||||
|
}else{
|
||||||
|
$res = StEasyVideoYuyanClass::changeVideoYuyan($id, [0]);
|
||||||
|
}
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
public function getAllLanguages()
|
||||||
|
{
|
||||||
|
$lang_list = Language::getLanguages(false);
|
||||||
|
$new = [];
|
||||||
|
foreach ($lang_list as $val) {
|
||||||
|
$new[] = [
|
||||||
|
'id' => $val['id_lang'],
|
||||||
|
'name' => $val['name']
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return $new;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
require_once dirname(__FILE__) . '/AdminStEasyVideoListController.php';
|
||||||
|
class AdminStEasyVideoManufacturerController extends AdminStEasyVideoListController
|
||||||
|
{
|
||||||
|
protected $contr = 'manufacturer';
|
||||||
|
public function addWhere($where = '')
|
||||||
|
{
|
||||||
|
return $where.' AND id_product=\'\' AND id_category=0 AND id_manufacturer!=0 ';
|
||||||
|
}
|
||||||
|
public function filterFormFields(&$fileds, $obj)
|
||||||
|
{
|
||||||
|
array_splice($fileds['input'], 1, 0, array(
|
||||||
|
array(
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => $this->l('Select a manufacture:'),
|
||||||
|
'required' => true,
|
||||||
|
'name' => 'id_manufacturer',
|
||||||
|
'class' => 'fixed-width-xxl',
|
||||||
|
'options' => array(
|
||||||
|
'query' => $this->getApplyManufacture(),
|
||||||
|
'id' => 'id',
|
||||||
|
'name' => 'name',
|
||||||
|
'default' => array(
|
||||||
|
'value' => '',
|
||||||
|
'label' => $this->l('Please select')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
public function getApplyManufacture()
|
||||||
|
{
|
||||||
|
$manufacturer_arr = array();
|
||||||
|
$manufacturers = Manufacturer::getManufacturers(false, $this->context->language->id);
|
||||||
|
foreach ($manufacturers as $manufacturer) {
|
||||||
|
$manufacturer_arr[] = array('id' => $manufacturer['id_manufacturer'],'name' => $manufacturer['name']);
|
||||||
|
}
|
||||||
|
return $manufacturer_arr;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,317 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
class AdminStEasyVideoMiniatureBaseController extends ModuleAdminController
|
||||||
|
{
|
||||||
|
protected $contr = '';
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->bootstrap = true;
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$image_types_arr = array(
|
||||||
|
array('id' => '','name' => $this->l('Use the predefined value.'),)
|
||||||
|
);
|
||||||
|
$imagesTypes = ImageType::getImagesTypes('products');
|
||||||
|
foreach ($imagesTypes as $k => $imageType) {
|
||||||
|
if (Tools::substr($imageType['name'], -3) == '_2x') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$image_types_arr[] = array('id' => $imageType['name'], 'name' => $imageType['name'].'('.$imageType['width'].'x'.$imageType['height'].')');
|
||||||
|
}
|
||||||
|
$display_options = array(
|
||||||
|
0 => $this->l('No'),
|
||||||
|
1 => $this->l('Buttons'),
|
||||||
|
2 => $this->l('Video players'),
|
||||||
|
3 => $this->l('Play on hover'),
|
||||||
|
4 => $this->l('Show buttons, play on hover'),
|
||||||
|
);
|
||||||
|
if($this->contr=='MOBILE')
|
||||||
|
unset($display_options[3], $display_options[4]);
|
||||||
|
$this->fields_options = array(
|
||||||
|
'general' => array(
|
||||||
|
'title' => $this->l('General Settings'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'MINIATURE_DISPLAY_'.$this->contr => array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('How to display videos'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => $display_options,
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'MINIATURE_VIDEO_SELECTOR_'.$this->contr => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => $this->l('Video selector'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'desc' => $this->l('A slector inside the miniature.'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'MINIATURE_VIDEO_APPEND_'.$this->contr => [
|
||||||
|
'title' => $this->l('How to add videos'),
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'select',
|
||||||
|
'identifier' => 'id',
|
||||||
|
'list' => $this->module::$_appends,
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_VIDEO_POSITION_'.$this->contr => [
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('How to display players'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Display on an element (Position: absolute)'),
|
||||||
|
1 => $this->l('Normal document flow (Position: static)'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_BUTTON_SELECTOR_'.$this->contr => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => $this->l('Button selector'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'desc' => $this->l('A slector inside the miniature.'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'MINIATURE_BUTTON_APPEND_'.$this->contr => [
|
||||||
|
'title' => $this->l('How to add buttons'),
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'select',
|
||||||
|
'identifier' => 'id',
|
||||||
|
'list' => $this->module::$_appends,
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_BUTTON_POSITION_'.$this->contr => [
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('How to display buttons'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Display on an element (Position: absolute)'),
|
||||||
|
1 => $this->l('Normal document flow (Position: static)'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_BUTTON_LAYOUT_'.$this->contr => array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('Play button layout'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Icon'),
|
||||||
|
1 => $this->l('Text'),
|
||||||
|
2 => $this->l('Icon + text horizontally'),
|
||||||
|
3 => $this->l('Icon + text vertically'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'MINIATURE_BUTTON_HIDE_'.$this->contr => array(
|
||||||
|
'title' => $this->l('Hide the play button when videos start play'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'MINIATURE_SELECTOR_'.$this->contr => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => $this->l('Miniature selector'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'desc' => $this->l('The default value .js-product-miniature works for amolst all sites'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'MINIATURE_VIDEO_TEMPLATE_'.$this->contr => [
|
||||||
|
'title' => $this->l('Video template'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'type' => 'textarea',
|
||||||
|
'cols' => 30,
|
||||||
|
'rows' => 5,
|
||||||
|
'desc' => array(
|
||||||
|
$this->l('They are four variables you can use: @placeholder_url@, @placeholder_width@, @placeholder_height@, and @thumbnail_url@.'),
|
||||||
|
$this->l('Disable the "Use HTMLPurifier Library" setting on the "BO>Preferences>General" page, otherwise the value won\'t be saved.'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_VIDEO_IMAGE_TYPE_'.$this->contr => [
|
||||||
|
'title' => $this->l('Placeholder image for videos'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'required' => false,
|
||||||
|
'type' => 'select',
|
||||||
|
'list' => $image_types_arr,
|
||||||
|
'identifier' => 'id',
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_BUTTON_TEMPLATE_'.$this->contr => [
|
||||||
|
'title' => $this->l('Button template'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'type' => 'textarea',
|
||||||
|
'cols' => 30,
|
||||||
|
'rows' => 5,
|
||||||
|
'desc' => array(
|
||||||
|
$this->l('They are four variables you can use: @placeholder_url@, @placeholder_width@, @placeholder_height@, and @thumbnail_url@.'),
|
||||||
|
$this->l('Disable the "Use HTMLPurifier Library" setting on the "BO>Preferences>General" page, otherwise the value won\'t be saved.'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_BUTTON_IMAGE_TYPE_'.$this->contr => [
|
||||||
|
'title' => $this->l('Placeholder image for buttons'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'required' => false,
|
||||||
|
'type' => 'select',
|
||||||
|
'list' => $image_types_arr,
|
||||||
|
'identifier' => 'id',
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_VIDEO_ZINDEX_'.$this->contr => [
|
||||||
|
'title' => $this->l('Z-index:'),
|
||||||
|
'validation' => 'isUnsignedId',
|
||||||
|
'required' => false,
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_POINTER_EVENTS_NONE_'.$this->contr => array(
|
||||||
|
'title' => $this->l('Link to the product page'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
'desc' => $this->l('In most cases, clicking on the video goes to the product page without enabling this setting. But if that\'s not your case, then enable this setting may help.'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'player' => array(
|
||||||
|
'title' => $this->l('Player'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'MINIATURE_AUTOPLAY_'.$this->contr => array(
|
||||||
|
'title' => $this->l('Autoplay'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
'desc' => $this->l('When videos are displayed in video palyers'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'MINIATURE_MUTED_'.$this->contr => array(
|
||||||
|
'title' => $this->l('Muted'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
'desc' => $this->l('Only muted videos can be autoplay'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'MINIATURE_LOOP_'.$this->contr => array(
|
||||||
|
'title' => $this->l('Loop'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'MINIATURE_CONTROLS_'.$this->contr => array(
|
||||||
|
'title' => $this->l('Show controls'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'player_style' => array(
|
||||||
|
'title' => $this->l('Player style'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'MINIATURE_PLAYER_BG_'.$this->contr => [
|
||||||
|
'title' => $this->l('Color'),
|
||||||
|
'validation' => 'isColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'size' => 5,
|
||||||
|
'name' => $this->module->_prefix_st.'MINIATURE_PLAYER_BG_'.$this->contr,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'button_style' => array(
|
||||||
|
'title' => $this->l('Play button style'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'MINIATURE_PLAY_BTN_POSITION_'.$this->contr => [
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('Position'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Center'),
|
||||||
|
1 => $this->l('Top left'),
|
||||||
|
2 => $this->l('Top right'),
|
||||||
|
3 => $this->l('Bottom right'),
|
||||||
|
4 => $this->l('Bottom left'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_PLAY_BTN_OFFSET_X_'.$this->contr => [
|
||||||
|
'title' => $this->l('Offset x'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
'suffix' => $this->l('pixels'),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_PLAY_BTN_OFFSET_Y_'.$this->contr => [
|
||||||
|
'title' => $this->l('Offset y'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
'suffix' => $this->l('pixels'),
|
||||||
|
],
|
||||||
|
) + $this->module->getButtonFiledsOptions('MINIATURE_PLAY', '_'.$this->contr) + array(
|
||||||
|
$this->module->_prefix_st.'MINIATURE_PLAY_TEXT_COLOR_'.$this->contr => [
|
||||||
|
'title' => $this->l('"Play" text color'),
|
||||||
|
'validation' => 'isColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'size' => 5,
|
||||||
|
'name' => $this->module->_prefix_st.'MINIATURE_PLAY_TEXT_COLOR_'.$this->contr,
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_PLAY_TEXT_BG_'.$this->contr => [
|
||||||
|
'title' => $this->l('"Play" text background'),
|
||||||
|
'validation' => 'isColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'size' => 5,
|
||||||
|
'name' => $this->module->_prefix_st.'MINIATURE_PLAY_TEXT_BG_'.$this->contr,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'close_style' => array(
|
||||||
|
'title' => $this->l('Close button style'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'MINIATURE_CLOSE_BTN_POSITION_'.$this->contr => [
|
||||||
|
'type' => 'radio',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'title' => $this->l('Position'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'choices' => array(
|
||||||
|
0 => $this->l('Center'),
|
||||||
|
1 => $this->l('Top left'),
|
||||||
|
2 => $this->l('Top right'),
|
||||||
|
3 => $this->l('Bottom right'),
|
||||||
|
4 => $this->l('Bottom left'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_CLOSE_BTN_OFFSET_X_'.$this->contr => [
|
||||||
|
'title' => $this->l('Offset x'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
'suffix' => $this->l('pixels'),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'MINIATURE_CLOSE_BTN_OFFSET_Y_'.$this->contr => [
|
||||||
|
'title' => $this->l('Offset y'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
'suffix' => $this->l('pixels'),
|
||||||
|
],
|
||||||
|
) + $this->module->getButtonFiledsOptions('MINIATURE_CLOSE', '_'.$this->contr),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function postProcess()
|
||||||
|
{
|
||||||
|
parent::postProcess();
|
||||||
|
}
|
||||||
|
public function setMedia($isNewTheme = false)
|
||||||
|
{
|
||||||
|
parent::setMedia($isNewTheme);
|
||||||
|
$this->addJs(_MODULE_DIR_.$this->module->name.'/views/js/admin.js?108');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
require_once dirname(__FILE__) . '/AdminStEasyVideoMiniatureBaseController.php';
|
||||||
|
class AdminStEasyVideoMiniatureController extends AdminStEasyVideoMiniatureBaseController
|
||||||
|
{
|
||||||
|
protected $contr = 'DESKTOP';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$this->fields_options['general']['fields'] = $this->fields_options['general']['fields'] + array(
|
||||||
|
$this->module->_prefix_st.'MINIATURE_HOVER_ELEMENT' => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => $this->l('Play the video when this selector is on hover'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateOptionStEasyVideoMiniatureVideoTemplateDesktop($val)
|
||||||
|
{
|
||||||
|
Configuration::updateValue($this->module->_prefix_st.'MINIATURE_VIDEO_TEMPLATE_DESKTOP', $val, true);
|
||||||
|
}
|
||||||
|
public function updateOptionStEasyVideoMiniatureButtonTemplateDesktop($val)
|
||||||
|
{
|
||||||
|
Configuration::updateValue($this->module->_prefix_st.'MINIATURE_BUTTON_TEMPLATE_DESKTOP', $val, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
require_once dirname(__FILE__) . '/AdminStEasyVideoMiniatureBaseController.php';
|
||||||
|
class AdminStEasyVideoMiniatureMobileController extends AdminStEasyVideoMiniatureBaseController
|
||||||
|
{
|
||||||
|
protected $contr = 'MOBILE';
|
||||||
|
public function updateOptionStEasyVideoMiniatureVideoTemplateMobile($val)
|
||||||
|
{
|
||||||
|
Configuration::updateValue($this->module->_prefix_st.'MINIATURE_VIDEO_TEMPLATE_MOBILE', $val, true);
|
||||||
|
}
|
||||||
|
public function updateOptionStEasyVideoMiniatureButtonTemplateMobile($val)
|
||||||
|
{
|
||||||
|
Configuration::updateValue($this->module->_prefix_st.'MINIATURE_BUTTON_TEMPLATE_MOBILE', $val, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
require_once dirname(__FILE__) . '/AdminStEasyVideoListController.php';
|
||||||
|
class AdminStEasyVideoProductController extends AdminStEasyVideoListController
|
||||||
|
{
|
||||||
|
protected $contr = 'product';
|
||||||
|
public function addWhere($where = '')
|
||||||
|
{
|
||||||
|
return $where.' AND id_product!=\'\' AND id_category=0 AND id_manufacturer=0 ';
|
||||||
|
}
|
||||||
|
public function filterFormFields(&$fileds, $obj)
|
||||||
|
{
|
||||||
|
$products_html = '';
|
||||||
|
if (($id_product = (int)Tools::getValue('id_product')) && Tools::getValue('ref') == 'product') {
|
||||||
|
$obj->id_product = (int)$id_product;
|
||||||
|
}
|
||||||
|
foreach (explode(',', trim($obj->id_product, ',')) as $id_product) {
|
||||||
|
if (!(int)$id_product) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$product = new Product((int)$id_product, false, $this->context->language->id);
|
||||||
|
$products_html .= '<li>'.$product->name.'['.$product->reference.']
|
||||||
|
<a href="javascript:;" class="stsb_ac_del_product"><img src="../img/admin/delete.gif" /></a>
|
||||||
|
<input type="hidden" name="st_id_product[]" value="'.$id_product.'" /></li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
array_splice($fileds['input'], 1, 0, array(
|
||||||
|
'products' => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'label' => $this->l('Products:'),
|
||||||
|
'name' => 'ac_products',
|
||||||
|
'autocomplete' => false,
|
||||||
|
'required' => true,
|
||||||
|
'class' => 'fixed-width-xxl ac_products',
|
||||||
|
'desc' => $this->l('Enter product names here:').'<br/>'.$this->l('Selected products')
|
||||||
|
.': <ul class="curr_products">'.$products_html.'</ul>',
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
public function getAjaxProductsList()
|
||||||
|
{
|
||||||
|
$query = Tools::getValue('q', false);
|
||||||
|
if (!$query || $query == '' || strlen($query) < 1) {
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
if ($pos = strpos($query, ' (ref:')) {
|
||||||
|
$query = substr($query, 0, $pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
$excludeIds = Tools::getValue('excludeIds', false);
|
||||||
|
if ($excludeIds && $excludeIds != 'NaN') {
|
||||||
|
$excludeIds = implode(',', array_map('intval', explode(',', $excludeIds)));
|
||||||
|
} else {
|
||||||
|
$excludeIds = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Excluding downloadable products from packs because download from pack is not supported
|
||||||
|
$forceJson = Tools::getValue('forceJson', false);
|
||||||
|
$disableCombination = Tools::getValue('disableCombination', false);
|
||||||
|
$excludeVirtuals = (bool)Tools::getValue('excludeVirtuals', true);
|
||||||
|
$exclude_packs = (bool)Tools::getValue('exclude_packs', false);
|
||||||
|
|
||||||
|
$context = Context::getContext();
|
||||||
|
|
||||||
|
$sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, p.`cache_default_attribute`
|
||||||
|
FROM `'._DB_PREFIX_.'product` p
|
||||||
|
'.Shop::addSqlAssociation('product', 'p').'
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product AND pl.id_lang = '.(int)$context->language->id.Shop::addSqlRestrictionOnLang('pl').')
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop
|
||||||
|
ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.')
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$context->language->id.')
|
||||||
|
WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\')'.
|
||||||
|
(!empty($excludeIds) ? ' AND p.id_product NOT IN ('.$excludeIds.') ' : ' ').
|
||||||
|
($excludeVirtuals ? 'AND NOT EXISTS (SELECT 1 FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : '').
|
||||||
|
($exclude_packs ? 'AND (p.cache_is_pack IS NULL OR p.cache_is_pack = 0)' : '').
|
||||||
|
' GROUP BY p.id_product';
|
||||||
|
|
||||||
|
$items = Db::getInstance()->executeS($sql);
|
||||||
|
|
||||||
|
if ($items && ($disableCombination || $excludeIds)) {
|
||||||
|
$results = [];
|
||||||
|
foreach ($items as $item) {
|
||||||
|
if (!$forceJson) {
|
||||||
|
$item['name'] = str_replace('|', '|', $item['name']);
|
||||||
|
$results[] = trim($item['name']).(!empty($item['reference']) ? ' (ref: '.$item['reference'].')' : '').'|'.(int)($item['id_product']);
|
||||||
|
} else {
|
||||||
|
$results[] = array(
|
||||||
|
'id' => $item['id_product'],
|
||||||
|
'name' => $item['name'].(!empty($item['reference']) ? ' (ref: '.$item['reference'].')' : ''),
|
||||||
|
'ref' => (!empty($item['reference']) ? $item['reference'] : ''),
|
||||||
|
'image' => str_replace('http://', Tools::getShopProtocol(), $context->link->getImageLink($item['link_rewrite'], $item['id_image'], 'home'.'_'.'default')),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$forceJson) {
|
||||||
|
echo implode("\n", $results);
|
||||||
|
} else {
|
||||||
|
echo json_encode($results);
|
||||||
|
}
|
||||||
|
} elseif ($items) {
|
||||||
|
// packs
|
||||||
|
$results = array();
|
||||||
|
foreach ($items as $item) {
|
||||||
|
// check if product have combination
|
||||||
|
if (Combination::isFeatureActive() && $item['cache_default_attribute']) {
|
||||||
|
$sql = 'SELECT pa.`id_product_attribute`, pa.`reference`, ag.`id_attribute_group`, pai.`id_image`, agl.`name` AS group_name, al.`name` AS attribute_name,
|
||||||
|
a.`id_attribute`
|
||||||
|
FROM `'._DB_PREFIX_.'product_attribute` pa
|
||||||
|
'.Shop::addSqlAssociation('product_attribute', 'pa').'
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_attribute`
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute`
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group`
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$context->language->id.')
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$context->language->id.')
|
||||||
|
LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` pai ON pai.`id_product_attribute` = pa.`id_product_attribute`
|
||||||
|
WHERE pa.`id_product` = '.(int)$item['id_product'].'
|
||||||
|
GROUP BY pa.`id_product_attribute`, ag.`id_attribute_group`
|
||||||
|
ORDER BY pa.`id_product_attribute`';
|
||||||
|
|
||||||
|
$combinations = Db::getInstance()->executeS($sql);
|
||||||
|
if (!empty($combinations)) {
|
||||||
|
foreach ($combinations as $k => $combination) {
|
||||||
|
$results[$combination['id_product_attribute']]['id'] = $item['id_product'];
|
||||||
|
$results[$combination['id_product_attribute']]['id_product_attribute'] = $combination['id_product_attribute'];
|
||||||
|
!empty($results[$combination['id_product_attribute']]['name']) ? $results[$combination['id_product_attribute']]['name'] .= ' '.$combination['group_name'].'-'.$combination['attribute_name']
|
||||||
|
: $results[$combination['id_product_attribute']]['name'] = $item['name'].' '.$combination['group_name'].'-'.$combination['attribute_name'];
|
||||||
|
if (!empty($combination['reference'])) {
|
||||||
|
$results[$combination['id_product_attribute']]['ref'] = $combination['reference'];
|
||||||
|
} else {
|
||||||
|
$results[$combination['id_product_attribute']]['ref'] = !empty($item['reference']) ? $item['reference'] : '';
|
||||||
|
}
|
||||||
|
if (empty($results[$combination['id_product_attribute']]['image'])) {
|
||||||
|
$results[$combination['id_product_attribute']]['image'] = str_replace('http://', Tools::getShopProtocol(), $context->link->getImageLink($item['link_rewrite'], $combination['id_image'], 'home'.'_'.'default'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$results[] = array(
|
||||||
|
'id' => $item['id_product'],
|
||||||
|
'name' => $item['name'],
|
||||||
|
'ref' => (!empty($item['reference']) ? $item['reference'] : ''),
|
||||||
|
'image' => str_replace('http://', Tools::getShopProtocol(), $context->link->getImageLink($item['link_rewrite'], $item['id_image'], 'home'.'_'.'default')),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$results[] = array(
|
||||||
|
'id' => $item['id_product'],
|
||||||
|
'name' => $item['name'],
|
||||||
|
'ref' => (!empty($item['reference']) ? $item['reference'] : ''),
|
||||||
|
'image' => str_replace('http://', Tools::getShopProtocol(), $context->link->getImageLink($item['link_rewrite'], $item['id_image'], 'home'.'_'.'default')),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo json_encode(array_values($results));
|
||||||
|
} else {
|
||||||
|
echo json_encode([]);
|
||||||
|
}
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
require_once dirname(__FILE__) . '/AdminStEasyVideoGalleryController.php';
|
||||||
|
class AdminStEasyVideoProductMobileSettingController extends AdminStEasyVideoGalleryController
|
||||||
|
{
|
||||||
|
protected $contr = 'MOBILE';
|
||||||
|
|
||||||
|
public function updateOptionStEasyVideoGalleryVideoTemplateMobile($val)
|
||||||
|
{
|
||||||
|
Configuration::updateValue($this->module->_prefix_st.'GALLERY_VIDEO_TEMPLATE_MOBILE', $val, true);
|
||||||
|
}
|
||||||
|
public function updateOptionStEasyVideoGalleryButtonTemplateMobile($val)
|
||||||
|
{
|
||||||
|
Configuration::updateValue($this->module->_prefix_st.'GALLERY_BUTTON_TEMPLATE_MOBILE', $val, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
require_once dirname(__FILE__) . '/AdminStEasyVideoGalleryController.php';
|
||||||
|
class AdminStEasyVideoProductSettingController extends AdminStEasyVideoGalleryController
|
||||||
|
{
|
||||||
|
protected $contr = 'DESKTOP';
|
||||||
|
|
||||||
|
public function updateOptionStEasyVideoGalleryVideoTemplateDesktop($val)
|
||||||
|
{
|
||||||
|
Configuration::updateValue($this->module->_prefix_st.'GALLERY_VIDEO_TEMPLATE_DESKTOP', $val, true);
|
||||||
|
}
|
||||||
|
public function updateOptionStEasyVideoGalleryButtonTemplateDesktop($val)
|
||||||
|
{
|
||||||
|
Configuration::updateValue($this->module->_prefix_st.'GALLERY_BUTTON_TEMPLATE_DESKTOP', $val, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
require_once dirname(__FILE__) . '/AdminStEasyVideoGalleryController.php';
|
||||||
|
class AdminStEasyVideoQuickViewSettingController extends AdminStEasyVideoGalleryController
|
||||||
|
{
|
||||||
|
protected $contr = 'QUICKVIEW';
|
||||||
|
public function updateOptionStEasyVideoGalleryVideoTemplateQuickView($val)
|
||||||
|
{
|
||||||
|
Configuration::updateValue($this->module->_prefix_st.'GALLERY_VIDEO_TEMPLATE_QUICKVIEW', $val, true);
|
||||||
|
}
|
||||||
|
public function updateOptionStEasyVideoGalleryButtonTemplateQuickView($val)
|
||||||
|
{
|
||||||
|
Configuration::updateValue($this->module->_prefix_st.'GALLERY_BUTTON_TEMPLATE_QUICKVIEW', $val, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
class AdminStEasyVideoSettingController extends ModuleAdminController
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->bootstrap = true;
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$this->fields_options = array(
|
||||||
|
'general' => array(
|
||||||
|
'title' => $this->l('General Settings'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'THEME_NAME' => array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'title' => $this->l('Theme name:'),
|
||||||
|
'validation' => 'isGenericName',
|
||||||
|
'choices' => array(
|
||||||
|
'' => $this->l('Auto detect'),
|
||||||
|
'classic' => $this->l('PrestaShop 1.7 classic'),
|
||||||
|
'panda' => $this->l('Panda theme v2'),
|
||||||
|
'transformer' => $this->l('Transformer theme v4'),
|
||||||
|
'warehouse' => $this->l('Warehouse for 1.7'),
|
||||||
|
),
|
||||||
|
'desc' => $this->l('Select a theme to use its predefined settings.'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'MAXIMUM_TRIES' => [
|
||||||
|
'title' => $this->l('Maximum times of detecting if the gallery slider is initialized on the product page.'),
|
||||||
|
'validation' => 'isUnsignedId',
|
||||||
|
'required' => false,
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'PLAY_VIDEO_TEXT' => [
|
||||||
|
'title' => $this->l('"Play video" text'),
|
||||||
|
'size' => 6,
|
||||||
|
'type' => 'textLang',
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'YOUTUBE_API' => array(
|
||||||
|
'title' => $this->l('Stop loading YouTube api'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
'desc' => $this->l('If you aren\'t going to use any youtube videos, stop loading the YouTube api for better performace.'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'VIMEO_API' => array(
|
||||||
|
'title' => $this->l('Stop loading Vimeo api'),
|
||||||
|
'validation' => 'isBool',
|
||||||
|
'type' => 'bool',
|
||||||
|
'is_bool' => true,
|
||||||
|
'desc' => $this->l('If you aren\'t going to use any vimeo videos, stop loading the vimeo api for better performace.'),
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'BREAKPOINT' => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => $this->l('Mobile device breakpoint'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'desc' => $this->l('If the gallery displays in different ways on mobile, then set the breakpoint here to use different settings on mobile.'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'player' => array(
|
||||||
|
'title' => $this->l('Player'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'PLAYER_SKIN' => array(
|
||||||
|
'title' => $this->l('Skin'),
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'select',
|
||||||
|
'identifier' => 'id',
|
||||||
|
'list' => array(
|
||||||
|
0 => array(
|
||||||
|
'id' => 0,
|
||||||
|
'name' => 'Sublime',
|
||||||
|
),
|
||||||
|
1 => array(
|
||||||
|
'id' => 1,
|
||||||
|
'name' => 'OGZ',
|
||||||
|
),
|
||||||
|
2 => array(
|
||||||
|
'id' => 2,
|
||||||
|
'name' => 'Youtube',
|
||||||
|
),
|
||||||
|
3 => array(
|
||||||
|
'id' => 3,
|
||||||
|
'name' => 'Facebook',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
$this->module->_prefix_st.'BG_COLOR' => array(
|
||||||
|
'title' => $this->l('Control bar background'),
|
||||||
|
'validation' => 'isColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'size' => 5,
|
||||||
|
'name' => $this->module->_prefix_st.'BG_COLOR',
|
||||||
|
),
|
||||||
|
|
||||||
|
$this->module->_prefix_st.'BG_OPACITY' => [
|
||||||
|
'title' => $this->l('Control bar background opacity'),
|
||||||
|
'validation' => 'isFloat',
|
||||||
|
'cast' => 'floatval',
|
||||||
|
'type' => 'text',
|
||||||
|
'desc' => $this->l('From 0.0 (fully transparent) to 1.0 (fully opaque).'),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'CONTROL_COLOR' => array(
|
||||||
|
'title' => $this->l('Buttons color'),
|
||||||
|
'validation' => 'isColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'size' => 5,
|
||||||
|
'name' => $this->module->_prefix_st.'CONTROL_COLOR',
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'CONTROL_SIZE' => [
|
||||||
|
'title' => $this->l('Buttons size'),
|
||||||
|
'validation' => 'isUnsignedInt',
|
||||||
|
'cast' => 'intval',
|
||||||
|
'type' => 'text',
|
||||||
|
'suffix' => $this->l('pixels'),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'PROGRESS_BAR_COLOR' => array(
|
||||||
|
'title' => $this->l('Progress bar color'),
|
||||||
|
'validation' => 'isColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'size' => 5,
|
||||||
|
'name' => $this->module->_prefix_st.'PROGRESS_BAR_COLOR',
|
||||||
|
),
|
||||||
|
$this->module->_prefix_st.'PROGRESS_BAR_OPACITY' => [
|
||||||
|
'title' => $this->l('Progress bar opacity'),
|
||||||
|
'validation' => 'isFloat',
|
||||||
|
'cast' => 'floatval',
|
||||||
|
'type' => 'text',
|
||||||
|
'desc' => $this->l('From 0.0 (fully transparent) to 1.0 (fully opaque).'),
|
||||||
|
],
|
||||||
|
$this->module->_prefix_st.'PROGRESS_BAR_HIGHLIGHT_COLOR' => array(
|
||||||
|
'title' => $this->l('Progress bar highlighted color'),
|
||||||
|
'validation' => 'isColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'size' => 5,
|
||||||
|
'name' => $this->module->_prefix_st.'PROGRESS_BAR_HIGHLIGHT_COLOR',
|
||||||
|
),
|
||||||
|
|
||||||
|
),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'player_play_button' => array(
|
||||||
|
'title' => $this->l('Player\'s play button'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => $this->module->getButtonFiledsOptions('PLAYER_PLAY'),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'player_close_button' => array(
|
||||||
|
'title' => $this->l('Player\'s close button'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => $this->module->getButtonFiledsOptions('PLAYER_CLOSE'),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
'style' => array(
|
||||||
|
'title' => $this->l('Style'),
|
||||||
|
'icon' => 'icon-cogs',
|
||||||
|
'fields' => array(
|
||||||
|
$this->module->_prefix_st.'CUSTOM_CSS' => [
|
||||||
|
'title' => $this->l('Custom CSS Code'),
|
||||||
|
'validation' => 'isAnything',
|
||||||
|
'type' => 'textarea',
|
||||||
|
'cols' => 30,
|
||||||
|
'rows' => 5,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
'submit' => array('title' => $this->l('Save all')),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
public function updateOptionStEasyVideoCustomCss($val)
|
||||||
|
{
|
||||||
|
Configuration::updateValue($this->module->_prefix_st.'CUSTOM_CSS', $val, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
34
modules/steasyvideo/controllers/admin/index.php
Normal file
34
modules/steasyvideo/controllers/admin/index.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
22
modules/steasyvideo/controllers/front/ajax.php
Normal file
22
modules/steasyvideo/controllers/front/ajax.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
class StEasyVideoAjaxModuleFrontController extends ModuleFrontController
|
||||||
|
{
|
||||||
|
public function initContent()
|
||||||
|
{
|
||||||
|
$id_product = (int)Tools::getValue('id_product');
|
||||||
|
$product = new Product($id_product, false, Configuration::get('PS_LANG_DEFAULT'), $this->context->shop->id);
|
||||||
|
$video_data = $this->module->getVideosByProduct($product);
|
||||||
|
ob_end_clean();
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
die(json_encode($video_data));
|
||||||
|
}
|
||||||
|
}
|
||||||
34
modules/steasyvideo/controllers/front/index.php
Normal file
34
modules/steasyvideo/controllers/front/index.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
34
modules/steasyvideo/controllers/index.php
Normal file
34
modules/steasyvideo/controllers/index.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
35
modules/steasyvideo/index.php
Normal file
35
modules/steasyvideo/index.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
BIN
modules/steasyvideo/logo.png
Normal file
BIN
modules/steasyvideo/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
39
modules/steasyvideo/src/Repository/VideoRepository.php
Normal file
39
modules/steasyvideo/src/Repository/VideoRepository.php
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace PrestaShop\Module\StEasyVideo\Repository;
|
||||||
|
|
||||||
|
if (!defined('_PS_VERSION_')) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
use PrestaShop\PrestaShop\Adapter\LegacyContext;
|
||||||
|
use Db;
|
||||||
|
use Context;
|
||||||
|
use Tools;
|
||||||
|
use Shop;
|
||||||
|
use ProductListingFrontController;
|
||||||
|
|
||||||
|
require_once _PS_MODULE_DIR_ . '/steasyvideo/classes/StEasyVideoClass.php';
|
||||||
|
require_once _PS_MODULE_DIR_ . '/steasyvideo/classes/EasyVideoBase.php';
|
||||||
|
|
||||||
|
class VideoRepository
|
||||||
|
{
|
||||||
|
private $context;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
LegacyContext $context
|
||||||
|
) {
|
||||||
|
$this->context = $context->getContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getListingVideo($product)
|
||||||
|
{
|
||||||
|
$videos = \EasyVideoBase::getVideosByProduct($product['id_product'], $this->context->controller instanceof ProductListingFrontController ? [0,2,3] : [0,3], 1, $product['link_rewrite']);
|
||||||
|
return $videos && count($videos) ? array_pop($videos) : false;
|
||||||
|
}
|
||||||
|
}
|
||||||
34
modules/steasyvideo/src/Repository/index.php
Normal file
34
modules/steasyvideo/src/Repository/index.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
34
modules/steasyvideo/src/index.php
Normal file
34
modules/steasyvideo/src/index.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/AFL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||||
|
*/
|
||||||
|
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||||
|
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||||
|
|
||||||
|
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||||
|
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||||
|
header('Pragma: no-cache');
|
||||||
|
|
||||||
|
header('Location: ../');
|
||||||
|
exit;
|
||||||
1021
modules/steasyvideo/steasyvideo.php
Normal file
1021
modules/steasyvideo/steasyvideo.php
Normal file
File diff suppressed because it is too large
Load Diff
35
modules/steasyvideo/translations/index.php
Normal file
35
modules/steasyvideo/translations/index.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
35
modules/steasyvideo/upgrade/index.php
Normal file
35
modules/steasyvideo/upgrade/index.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
42
modules/steasyvideo/upgrade/install-1.0.5.php
Normal file
42
modules/steasyvideo/upgrade/install-1.0.5.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
use Elementor\Core\Breakpoints\Manager as Breakpoints_Manager;
|
||||||
|
if (!defined('_PS_VERSION_'))
|
||||||
|
exit;
|
||||||
|
|
||||||
|
function upgrade_module_1_0_5($object)
|
||||||
|
{
|
||||||
|
$result = true;
|
||||||
|
|
||||||
|
$field = Db::getInstance()->executeS('Describe `'._DB_PREFIX_.'st_easy_video` `location`');
|
||||||
|
if(!is_array($field) || !count($field)) {
|
||||||
|
$result &= (bool)Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'st_easy_video ADD `location` tinyint(1) unsigned NOT NULL DEFAULT 0');
|
||||||
|
}
|
||||||
|
|
||||||
|
$result &= Configuration::updateValue($object->_prefix_st.'VIMEO_API', 1);
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
83
modules/steasyvideo/upgrade/install-1.2.0.php
Normal file
83
modules/steasyvideo/upgrade/install-1.2.0.php
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
use Elementor\Core\Breakpoints\Manager as Breakpoints_Manager;
|
||||||
|
if (!defined('_PS_VERSION_'))
|
||||||
|
exit;
|
||||||
|
|
||||||
|
function upgrade_module_1_2_0($object)
|
||||||
|
{
|
||||||
|
$result = true;
|
||||||
|
|
||||||
|
// Add new tab
|
||||||
|
$classes = [
|
||||||
|
['cls' => 'AdminStEasyVideoMiniatureMobile', 'name' => 'Miniature on Mobile'],
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach($classes as $class) {
|
||||||
|
if (!Tab::getIdFromClassName($class['cls'])) {
|
||||||
|
$tab = new Tab();
|
||||||
|
$tab->active = 1;
|
||||||
|
$tab->class_name = $class['cls'];
|
||||||
|
$tab->name = array();
|
||||||
|
foreach (Language::getLanguages(true) as $lang) {
|
||||||
|
$tab->name[$lang['id_lang']] = $class['name'];
|
||||||
|
}
|
||||||
|
$tab->id_parent = (int)Tab::getIdFromClassName('AdminStEasyVideoPeiZhi');
|
||||||
|
$tab->module = $object->name;
|
||||||
|
$result &= $tab->add();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!Configuration::updateValue($object->_prefix_st.'MINIATURE_DISPLAY_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_DISPLAY'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_SELECTOR_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_SELECTOR'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_HOVER_ELEMENT_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_HOVER_ELEMENT'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_VIDEO_SELECTOR_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_VIDEO_SELECTOR'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_VIDEO_APPEND_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_VIDEO_APPEND'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_VIDEO_POSITION_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_VIDEO_POSITION'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_BUTTON_SELECTOR_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_BUTTON_SELECTOR'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_BUTTON_APPEND_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_BUTTON_APPEND'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_BUTTON_POSITION_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_BUTTON_POSITION'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_BUTTON_LAYOUT_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_BUTTON_LAYOUT'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_BUTTON_HIDE_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_BUTTON_HIDE'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_AUTOPLAY_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_AUTOPLAY'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_MUTED_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_MUTED'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_LOOP_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_LOOP'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_CONTROLS_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_CONTROLS'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_VIDEO_TEMPLATE_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_VIDEO_TEMPLATE'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_VIDEO_ZINDEX_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_VIDEO_ZINDEX'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_PLAY_BTN_POSITION_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_PLAY_BTN_POSITION'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_PLAY_BTN_OFFSET_X_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_PLAY_BTN_OFFSET'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_PLAY_BTN_OFFSET_Y_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_PLAY_BTN_OFFSET'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_PLAY_TEXT_COLOR_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_PLAY_TEXT_COLOR'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_PLAY_TEXT_BG_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_PLAY_TEXT_BG'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_CLOSE_BTN_POSITION_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_CLOSE_BTN_POSITION'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_CLOSE_BTN_OFFSET_X_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_CLOSE_BTN_OFFSET'))
|
||||||
|
|| !Configuration::updateValue($object->_prefix_st.'MINIATURE_CLOSE_BTN_OFFSET_Y_DESKTOP', Configuration::get($object->_prefix_st.'MINIATURE_CLOSE_BTN_OFFSET'))
|
||||||
|
)
|
||||||
|
$result &= false;
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
44
modules/steasyvideo/upgrade/install-1.2.3.php
Normal file
44
modules/steasyvideo/upgrade/install-1.2.3.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
use Elementor\Core\Breakpoints\Manager as Breakpoints_Manager;
|
||||||
|
if (!defined('_PS_VERSION_'))
|
||||||
|
exit;
|
||||||
|
|
||||||
|
function upgrade_module_1_2_3($object)
|
||||||
|
{
|
||||||
|
$result = true;
|
||||||
|
Db::getInstance()->execute('TRUNCATE TABLE ' . _DB_PREFIX_ . 'st_easy_video_yuyan');
|
||||||
|
$videos = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'st_easy_video`');
|
||||||
|
if($videos){
|
||||||
|
$data = [];
|
||||||
|
foreach ($videos as $v) {
|
||||||
|
$data[] = ['id_st_easy_video' => (int)$v['id_st_easy_video'], 'id_lang' => 0];
|
||||||
|
}
|
||||||
|
$result &= Db::getInstance()->insert('st_easy_video_yuyan', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
10
modules/steasyvideo/vendor/.htaccess
vendored
Normal file
10
modules/steasyvideo/vendor/.htaccess
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Apache 2.2
|
||||||
|
<IfModule !mod_authz_core.c>
|
||||||
|
Order deny,allow
|
||||||
|
Deny from all
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# Apache 2.4
|
||||||
|
<IfModule mod_authz_core.c>
|
||||||
|
Require all denied
|
||||||
|
</IfModule>
|
||||||
7
modules/steasyvideo/vendor/autoload.php
vendored
Normal file
7
modules/steasyvideo/vendor/autoload.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload.php @generated by Composer
|
||||||
|
|
||||||
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
|
return ComposerAutoloaderInit409bb44f31d5474bbf9ab50b7b661a82::getLoader();
|
||||||
572
modules/steasyvideo/vendor/composer/ClassLoader.php
vendored
Normal file
572
modules/steasyvideo/vendor/composer/ClassLoader.php
vendored
Normal file
@@ -0,0 +1,572 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Composer.
|
||||||
|
*
|
||||||
|
* (c) Nils Adermann <naderman@naderman.de>
|
||||||
|
* Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||||
|
*
|
||||||
|
* $loader = new \Composer\Autoload\ClassLoader();
|
||||||
|
*
|
||||||
|
* // register classes with namespaces
|
||||||
|
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||||
|
* $loader->add('Symfony', __DIR__.'/framework');
|
||||||
|
*
|
||||||
|
* // activate the autoloader
|
||||||
|
* $loader->register();
|
||||||
|
*
|
||||||
|
* // to enable searching the include path (eg. for PEAR packages)
|
||||||
|
* $loader->setUseIncludePath(true);
|
||||||
|
*
|
||||||
|
* In this example, if you try to use a class in the Symfony\Component
|
||||||
|
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||||
|
* the autoloader will first look for the class under the component/
|
||||||
|
* directory, and it will then fallback to the framework/ directory if not
|
||||||
|
* found before giving up.
|
||||||
|
*
|
||||||
|
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||||
|
*
|
||||||
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
* @see https://www.php-fig.org/psr/psr-0/
|
||||||
|
* @see https://www.php-fig.org/psr/psr-4/
|
||||||
|
*/
|
||||||
|
class ClassLoader
|
||||||
|
{
|
||||||
|
/** @var ?string */
|
||||||
|
private $vendorDir;
|
||||||
|
|
||||||
|
// PSR-4
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, array<string, int>>
|
||||||
|
*/
|
||||||
|
private $prefixLengthsPsr4 = array();
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, array<int, string>>
|
||||||
|
*/
|
||||||
|
private $prefixDirsPsr4 = array();
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, string>
|
||||||
|
*/
|
||||||
|
private $fallbackDirsPsr4 = array();
|
||||||
|
|
||||||
|
// PSR-0
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, array<string, string[]>>
|
||||||
|
*/
|
||||||
|
private $prefixesPsr0 = array();
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, string>
|
||||||
|
*/
|
||||||
|
private $fallbackDirsPsr0 = array();
|
||||||
|
|
||||||
|
/** @var bool */
|
||||||
|
private $useIncludePath = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string[]
|
||||||
|
* @psalm-var array<string, string>
|
||||||
|
*/
|
||||||
|
private $classMap = array();
|
||||||
|
|
||||||
|
/** @var bool */
|
||||||
|
private $classMapAuthoritative = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool[]
|
||||||
|
* @psalm-var array<string, bool>
|
||||||
|
*/
|
||||||
|
private $missingClasses = array();
|
||||||
|
|
||||||
|
/** @var ?string */
|
||||||
|
private $apcuPrefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var self[]
|
||||||
|
*/
|
||||||
|
private static $registeredLoaders = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ?string $vendorDir
|
||||||
|
*/
|
||||||
|
public function __construct($vendorDir = null)
|
||||||
|
{
|
||||||
|
$this->vendorDir = $vendorDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
public function getPrefixes()
|
||||||
|
{
|
||||||
|
if (!empty($this->prefixesPsr0)) {
|
||||||
|
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||||
|
}
|
||||||
|
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return array<string, array<int, string>>
|
||||||
|
*/
|
||||||
|
public function getPrefixesPsr4()
|
||||||
|
{
|
||||||
|
return $this->prefixDirsPsr4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return array<string, string>
|
||||||
|
*/
|
||||||
|
public function getFallbackDirs()
|
||||||
|
{
|
||||||
|
return $this->fallbackDirsPsr0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return array<string, string>
|
||||||
|
*/
|
||||||
|
public function getFallbackDirsPsr4()
|
||||||
|
{
|
||||||
|
return $this->fallbackDirsPsr4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string[] Array of classname => path
|
||||||
|
* @psalm-var array<string, string>
|
||||||
|
*/
|
||||||
|
public function getClassMap()
|
||||||
|
{
|
||||||
|
return $this->classMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string[] $classMap Class to filename map
|
||||||
|
* @psalm-param array<string, string> $classMap
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function addClassMap(array $classMap)
|
||||||
|
{
|
||||||
|
if ($this->classMap) {
|
||||||
|
$this->classMap = array_merge($this->classMap, $classMap);
|
||||||
|
} else {
|
||||||
|
$this->classMap = $classMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-0 directories for a given prefix, either
|
||||||
|
* appending or prepending to the ones previously set for this prefix.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix
|
||||||
|
* @param string[]|string $paths The PSR-0 root directories
|
||||||
|
* @param bool $prepend Whether to prepend the directories
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function add($prefix, $paths, $prepend = false)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
if ($prepend) {
|
||||||
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->fallbackDirsPsr0
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
|
$this->fallbackDirsPsr0,
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$first = $prefix[0];
|
||||||
|
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||||
|
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($prepend) {
|
||||||
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->prefixesPsr0[$first][$prefix]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
|
$this->prefixesPsr0[$first][$prefix],
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-4 directories for a given namespace, either
|
||||||
|
* appending or prepending to the ones previously set for this namespace.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
|
* @param string[]|string $paths The PSR-4 base directories
|
||||||
|
* @param bool $prepend Whether to prepend the directories
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function addPsr4($prefix, $paths, $prepend = false)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
// Register directories for the root namespace.
|
||||||
|
if ($prepend) {
|
||||||
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->fallbackDirsPsr4
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
|
$this->fallbackDirsPsr4,
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||||
|
// Register directories for a new namespace.
|
||||||
|
$length = strlen($prefix);
|
||||||
|
if ('\\' !== $prefix[$length - 1]) {
|
||||||
|
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||||
|
}
|
||||||
|
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||||
|
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||||
|
} elseif ($prepend) {
|
||||||
|
// Prepend directories for an already registered namespace.
|
||||||
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
|
(array) $paths,
|
||||||
|
$this->prefixDirsPsr4[$prefix]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// Append directories for an already registered namespace.
|
||||||
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
|
$this->prefixDirsPsr4[$prefix],
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-0 directories for a given prefix,
|
||||||
|
* replacing any others previously set for this prefix.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix
|
||||||
|
* @param string[]|string $paths The PSR-0 base directories
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function set($prefix, $paths)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
$this->fallbackDirsPsr0 = (array) $paths;
|
||||||
|
} else {
|
||||||
|
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a set of PSR-4 directories for a given namespace,
|
||||||
|
* replacing any others previously set for this namespace.
|
||||||
|
*
|
||||||
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
|
* @param string[]|string $paths The PSR-4 base directories
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setPsr4($prefix, $paths)
|
||||||
|
{
|
||||||
|
if (!$prefix) {
|
||||||
|
$this->fallbackDirsPsr4 = (array) $paths;
|
||||||
|
} else {
|
||||||
|
$length = strlen($prefix);
|
||||||
|
if ('\\' !== $prefix[$length - 1]) {
|
||||||
|
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||||
|
}
|
||||||
|
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||||
|
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turns on searching the include path for class files.
|
||||||
|
*
|
||||||
|
* @param bool $useIncludePath
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setUseIncludePath($useIncludePath)
|
||||||
|
{
|
||||||
|
$this->useIncludePath = $useIncludePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can be used to check if the autoloader uses the include path to check
|
||||||
|
* for classes.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function getUseIncludePath()
|
||||||
|
{
|
||||||
|
return $this->useIncludePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turns off searching the prefix and fallback directories for classes
|
||||||
|
* that have not been registered with the class map.
|
||||||
|
*
|
||||||
|
* @param bool $classMapAuthoritative
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||||
|
{
|
||||||
|
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should class lookup fail if not found in the current class map?
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isClassMapAuthoritative()
|
||||||
|
{
|
||||||
|
return $this->classMapAuthoritative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||||
|
*
|
||||||
|
* @param string|null $apcuPrefix
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setApcuPrefix($apcuPrefix)
|
||||||
|
{
|
||||||
|
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getApcuPrefix()
|
||||||
|
{
|
||||||
|
return $this->apcuPrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers this instance as an autoloader.
|
||||||
|
*
|
||||||
|
* @param bool $prepend Whether to prepend the autoloader or not
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function register($prepend = false)
|
||||||
|
{
|
||||||
|
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||||
|
|
||||||
|
if (null === $this->vendorDir) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($prepend) {
|
||||||
|
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||||
|
} else {
|
||||||
|
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||||
|
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unregisters this instance as an autoloader.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function unregister()
|
||||||
|
{
|
||||||
|
spl_autoload_unregister(array($this, 'loadClass'));
|
||||||
|
|
||||||
|
if (null !== $this->vendorDir) {
|
||||||
|
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads the given class or interface.
|
||||||
|
*
|
||||||
|
* @param string $class The name of the class
|
||||||
|
* @return true|null True if loaded, null otherwise
|
||||||
|
*/
|
||||||
|
public function loadClass($class)
|
||||||
|
{
|
||||||
|
if ($file = $this->findFile($class)) {
|
||||||
|
includeFile($file);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the path to the file where the class is defined.
|
||||||
|
*
|
||||||
|
* @param string $class The name of the class
|
||||||
|
*
|
||||||
|
* @return string|false The path if found, false otherwise
|
||||||
|
*/
|
||||||
|
public function findFile($class)
|
||||||
|
{
|
||||||
|
// class map lookup
|
||||||
|
if (isset($this->classMap[$class])) {
|
||||||
|
return $this->classMap[$class];
|
||||||
|
}
|
||||||
|
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (null !== $this->apcuPrefix) {
|
||||||
|
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||||
|
if ($hit) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$file = $this->findFileWithExtension($class, '.php');
|
||||||
|
|
||||||
|
// Search for Hack files if we are running on HHVM
|
||||||
|
if (false === $file && defined('HHVM_VERSION')) {
|
||||||
|
$file = $this->findFileWithExtension($class, '.hh');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $this->apcuPrefix) {
|
||||||
|
apcu_add($this->apcuPrefix.$class, $file);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (false === $file) {
|
||||||
|
// Remember that this class does not exist.
|
||||||
|
$this->missingClasses[$class] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
||||||
|
*
|
||||||
|
* @return self[]
|
||||||
|
*/
|
||||||
|
public static function getRegisteredLoaders()
|
||||||
|
{
|
||||||
|
return self::$registeredLoaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $class
|
||||||
|
* @param string $ext
|
||||||
|
* @return string|false
|
||||||
|
*/
|
||||||
|
private function findFileWithExtension($class, $ext)
|
||||||
|
{
|
||||||
|
// PSR-4 lookup
|
||||||
|
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||||
|
|
||||||
|
$first = $class[0];
|
||||||
|
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||||
|
$subPath = $class;
|
||||||
|
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||||
|
$subPath = substr($subPath, 0, $lastPos);
|
||||||
|
$search = $subPath . '\\';
|
||||||
|
if (isset($this->prefixDirsPsr4[$search])) {
|
||||||
|
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||||
|
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||||
|
if (file_exists($file = $dir . $pathEnd)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-4 fallback dirs
|
||||||
|
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||||
|
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-0 lookup
|
||||||
|
if (false !== $pos = strrpos($class, '\\')) {
|
||||||
|
// namespaced class name
|
||||||
|
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||||
|
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||||
|
} else {
|
||||||
|
// PEAR-like class name
|
||||||
|
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($this->prefixesPsr0[$first])) {
|
||||||
|
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||||
|
if (0 === strpos($class, $prefix)) {
|
||||||
|
foreach ($dirs as $dir) {
|
||||||
|
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-0 fallback dirs
|
||||||
|
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||||
|
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSR-0 include paths.
|
||||||
|
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope isolated include.
|
||||||
|
*
|
||||||
|
* Prevents access to $this/self from included files.
|
||||||
|
*
|
||||||
|
* @param string $file
|
||||||
|
* @return void
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
function includeFile($file)
|
||||||
|
{
|
||||||
|
include $file;
|
||||||
|
}
|
||||||
350
modules/steasyvideo/vendor/composer/InstalledVersions.php
vendored
Normal file
350
modules/steasyvideo/vendor/composer/InstalledVersions.php
vendored
Normal file
@@ -0,0 +1,350 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Composer.
|
||||||
|
*
|
||||||
|
* (c) Nils Adermann <naderman@naderman.de>
|
||||||
|
* Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Composer;
|
||||||
|
|
||||||
|
use Composer\Autoload\ClassLoader;
|
||||||
|
use Composer\Semver\VersionParser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is copied in every Composer installed project and available to all
|
||||||
|
*
|
||||||
|
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||||
|
*
|
||||||
|
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||||
|
*/
|
||||||
|
class InstalledVersions
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var mixed[]|null
|
||||||
|
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
|
||||||
|
*/
|
||||||
|
private static $installed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool|null
|
||||||
|
*/
|
||||||
|
private static $canGetVendors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array[]
|
||||||
|
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||||
|
*/
|
||||||
|
private static $installedByVendor = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||||
|
*
|
||||||
|
* @return string[]
|
||||||
|
* @psalm-return list<string>
|
||||||
|
*/
|
||||||
|
public static function getInstalledPackages()
|
||||||
|
{
|
||||||
|
$packages = array();
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
$packages[] = array_keys($installed['versions']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (1 === \count($packages)) {
|
||||||
|
return $packages[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of all package names with a specific type e.g. 'library'
|
||||||
|
*
|
||||||
|
* @param string $type
|
||||||
|
* @return string[]
|
||||||
|
* @psalm-return list<string>
|
||||||
|
*/
|
||||||
|
public static function getInstalledPackagesByType($type)
|
||||||
|
{
|
||||||
|
$packagesByType = array();
|
||||||
|
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
foreach ($installed['versions'] as $name => $package) {
|
||||||
|
if (isset($package['type']) && $package['type'] === $type) {
|
||||||
|
$packagesByType[] = $name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $packagesByType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the given package is installed
|
||||||
|
*
|
||||||
|
* This also returns true if the package name is provided or replaced by another package
|
||||||
|
*
|
||||||
|
* @param string $packageName
|
||||||
|
* @param bool $includeDevRequirements
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (isset($installed['versions'][$packageName])) {
|
||||||
|
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the given package satisfies a version constraint
|
||||||
|
*
|
||||||
|
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||||
|
*
|
||||||
|
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||||
|
*
|
||||||
|
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||||
|
* @param string $packageName
|
||||||
|
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||||
|
{
|
||||||
|
$constraint = $parser->parseConstraints($constraint);
|
||||||
|
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||||
|
|
||||||
|
return $provided->matches($constraint);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||||
|
*
|
||||||
|
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||||
|
* whether a given version of a package is installed, and not just whether it exists
|
||||||
|
*
|
||||||
|
* @param string $packageName
|
||||||
|
* @return string Version constraint usable with composer/semver
|
||||||
|
*/
|
||||||
|
public static function getVersionRanges($packageName)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (!isset($installed['versions'][$packageName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ranges = array();
|
||||||
|
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||||
|
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||||
|
}
|
||||||
|
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||||
|
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||||
|
}
|
||||||
|
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||||
|
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||||
|
}
|
||||||
|
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||||
|
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return implode(' || ', $ranges);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $packageName
|
||||||
|
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||||
|
*/
|
||||||
|
public static function getVersion($packageName)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (!isset($installed['versions'][$packageName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $installed['versions'][$packageName]['version'];
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $packageName
|
||||||
|
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||||
|
*/
|
||||||
|
public static function getPrettyVersion($packageName)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (!isset($installed['versions'][$packageName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $installed['versions'][$packageName]['pretty_version'];
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $packageName
|
||||||
|
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||||
|
*/
|
||||||
|
public static function getReference($packageName)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (!isset($installed['versions'][$packageName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $installed['versions'][$packageName]['reference'];
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $packageName
|
||||||
|
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||||
|
*/
|
||||||
|
public static function getInstallPath($packageName)
|
||||||
|
{
|
||||||
|
foreach (self::getInstalled() as $installed) {
|
||||||
|
if (!isset($installed['versions'][$packageName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
|
||||||
|
*/
|
||||||
|
public static function getRootPackage()
|
||||||
|
{
|
||||||
|
$installed = self::getInstalled();
|
||||||
|
|
||||||
|
return $installed[0]['root'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the raw installed.php data for custom implementations
|
||||||
|
*
|
||||||
|
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
|
||||||
|
*/
|
||||||
|
public static function getRawData()
|
||||||
|
{
|
||||||
|
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
|
if (null === self::$installed) {
|
||||||
|
// only require the installed.php file if this file is loaded from its dumped location,
|
||||||
|
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||||
|
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||||
|
self::$installed = include __DIR__ . '/installed.php';
|
||||||
|
} else {
|
||||||
|
self::$installed = array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::$installed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||||
|
*
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||||
|
*/
|
||||||
|
public static function getAllRawData()
|
||||||
|
{
|
||||||
|
return self::getInstalled();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lets you reload the static array from another file
|
||||||
|
*
|
||||||
|
* This is only useful for complex integrations in which a project needs to use
|
||||||
|
* this class but then also needs to execute another project's autoloader in process,
|
||||||
|
* and wants to ensure both projects have access to their version of installed.php.
|
||||||
|
*
|
||||||
|
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||||
|
* the data it needs from this class, then call reload() with
|
||||||
|
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||||
|
* the project in which it runs can then also use this class safely, without
|
||||||
|
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||||
|
*
|
||||||
|
* @param array[] $data A vendor/composer/installed.php data set
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
|
||||||
|
*/
|
||||||
|
public static function reload($data)
|
||||||
|
{
|
||||||
|
self::$installed = $data;
|
||||||
|
self::$installedByVendor = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array[]
|
||||||
|
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||||
|
*/
|
||||||
|
private static function getInstalled()
|
||||||
|
{
|
||||||
|
if (null === self::$canGetVendors) {
|
||||||
|
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||||
|
}
|
||||||
|
|
||||||
|
$installed = array();
|
||||||
|
|
||||||
|
if (self::$canGetVendors) {
|
||||||
|
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||||
|
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||||
|
$installed[] = self::$installedByVendor[$vendorDir];
|
||||||
|
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||||
|
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||||
|
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||||
|
self::$installed = $installed[count($installed) - 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === self::$installed) {
|
||||||
|
// only require the installed.php file if this file is loaded from its dumped location,
|
||||||
|
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||||
|
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||||
|
self::$installed = require __DIR__ . '/installed.php';
|
||||||
|
} else {
|
||||||
|
self::$installed = array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$installed[] = self::$installed;
|
||||||
|
|
||||||
|
return $installed;
|
||||||
|
}
|
||||||
|
}
|
||||||
21
modules/steasyvideo/vendor/composer/LICENSE
vendored
Normal file
21
modules/steasyvideo/vendor/composer/LICENSE
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is furnished
|
||||||
|
to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
12
modules/steasyvideo/vendor/composer/autoload_classmap.php
vendored
Normal file
12
modules/steasyvideo/vendor/composer/autoload_classmap.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_classmap.php @generated by Composer
|
||||||
|
|
||||||
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||||
|
'PrestaShop\\Module\\StEasyVideo\\Repository\\VideoRepository' => $baseDir . '/src/Repository/VideoRepository.php',
|
||||||
|
'StEasyVideo' => $baseDir . '/steasyvideo.php',
|
||||||
|
);
|
||||||
9
modules/steasyvideo/vendor/composer/autoload_namespaces.php
vendored
Normal file
9
modules/steasyvideo/vendor/composer/autoload_namespaces.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_namespaces.php @generated by Composer
|
||||||
|
|
||||||
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
|
return array(
|
||||||
|
);
|
||||||
10
modules/steasyvideo/vendor/composer/autoload_psr4.php
vendored
Normal file
10
modules/steasyvideo/vendor/composer/autoload_psr4.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_psr4.php @generated by Composer
|
||||||
|
|
||||||
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'PrestaShop\\Module\\StEasyVideo\\' => array($baseDir . '/src'),
|
||||||
|
);
|
||||||
48
modules/steasyvideo/vendor/composer/autoload_real.php
vendored
Normal file
48
modules/steasyvideo/vendor/composer/autoload_real.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
|
class ComposerAutoloaderInit409bb44f31d5474bbf9ab50b7b661a82
|
||||||
|
{
|
||||||
|
private static $loader;
|
||||||
|
|
||||||
|
public static function loadClassLoader($class)
|
||||||
|
{
|
||||||
|
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||||
|
require __DIR__ . '/ClassLoader.php';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Composer\Autoload\ClassLoader
|
||||||
|
*/
|
||||||
|
public static function getLoader()
|
||||||
|
{
|
||||||
|
if (null !== self::$loader) {
|
||||||
|
return self::$loader;
|
||||||
|
}
|
||||||
|
|
||||||
|
require __DIR__ . '/platform_check.php';
|
||||||
|
|
||||||
|
spl_autoload_register(array('ComposerAutoloaderInit409bb44f31d5474bbf9ab50b7b661a82', 'loadClassLoader'), true, false);
|
||||||
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||||
|
spl_autoload_unregister(array('ComposerAutoloaderInit409bb44f31d5474bbf9ab50b7b661a82', 'loadClassLoader'));
|
||||||
|
|
||||||
|
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||||
|
if ($useStaticLoader) {
|
||||||
|
require __DIR__ . '/autoload_static.php';
|
||||||
|
|
||||||
|
call_user_func(\Composer\Autoload\ComposerStaticInit409bb44f31d5474bbf9ab50b7b661a82::getInitializer($loader));
|
||||||
|
} else {
|
||||||
|
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||||
|
if ($classMap) {
|
||||||
|
$loader->addClassMap($classMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$loader->setClassMapAuthoritative(true);
|
||||||
|
$loader->register(false);
|
||||||
|
|
||||||
|
return $loader;
|
||||||
|
}
|
||||||
|
}
|
||||||
38
modules/steasyvideo/vendor/composer/autoload_static.php
vendored
Normal file
38
modules/steasyvideo/vendor/composer/autoload_static.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// autoload_static.php @generated by Composer
|
||||||
|
|
||||||
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
|
class ComposerStaticInit409bb44f31d5474bbf9ab50b7b661a82
|
||||||
|
{
|
||||||
|
public static $prefixLengthsPsr4 = array (
|
||||||
|
'P' =>
|
||||||
|
array (
|
||||||
|
'PrestaShop\\Module\\StEasyVideo\\' => 30,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
public static $prefixDirsPsr4 = array (
|
||||||
|
'PrestaShop\\Module\\StEasyVideo\\' =>
|
||||||
|
array (
|
||||||
|
0 => __DIR__ . '/../..' . '/src',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
public static $classMap = array (
|
||||||
|
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||||
|
'PrestaShop\\Module\\StEasyVideo\\Repository\\VideoRepository' => __DIR__ . '/../..' . '/src/Repository/VideoRepository.php',
|
||||||
|
'StEasyVideo' => __DIR__ . '/../..' . '/steasyvideo.php',
|
||||||
|
);
|
||||||
|
|
||||||
|
public static function getInitializer(ClassLoader $loader)
|
||||||
|
{
|
||||||
|
return \Closure::bind(function () use ($loader) {
|
||||||
|
$loader->prefixLengthsPsr4 = ComposerStaticInit409bb44f31d5474bbf9ab50b7b661a82::$prefixLengthsPsr4;
|
||||||
|
$loader->prefixDirsPsr4 = ComposerStaticInit409bb44f31d5474bbf9ab50b7b661a82::$prefixDirsPsr4;
|
||||||
|
$loader->classMap = ComposerStaticInit409bb44f31d5474bbf9ab50b7b661a82::$classMap;
|
||||||
|
|
||||||
|
}, null, ClassLoader::class);
|
||||||
|
}
|
||||||
|
}
|
||||||
5
modules/steasyvideo/vendor/composer/installed.json
vendored
Normal file
5
modules/steasyvideo/vendor/composer/installed.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"packages": [],
|
||||||
|
"dev": true,
|
||||||
|
"dev-package-names": []
|
||||||
|
}
|
||||||
23
modules/steasyvideo/vendor/composer/installed.php
vendored
Normal file
23
modules/steasyvideo/vendor/composer/installed.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php return array(
|
||||||
|
'root' => array(
|
||||||
|
'pretty_version' => '1.0.0+no-version-set',
|
||||||
|
'version' => '1.0.0.0',
|
||||||
|
'type' => 'prestashop-module',
|
||||||
|
'install_path' => __DIR__ . '/../../',
|
||||||
|
'aliases' => array(),
|
||||||
|
'reference' => NULL,
|
||||||
|
'name' => 'prestashop/steasyvideo',
|
||||||
|
'dev' => true,
|
||||||
|
),
|
||||||
|
'versions' => array(
|
||||||
|
'prestashop/steasyvideo' => array(
|
||||||
|
'pretty_version' => '1.0.0+no-version-set',
|
||||||
|
'version' => '1.0.0.0',
|
||||||
|
'type' => 'prestashop-module',
|
||||||
|
'install_path' => __DIR__ . '/../../',
|
||||||
|
'aliases' => array(),
|
||||||
|
'reference' => NULL,
|
||||||
|
'dev_requirement' => false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
26
modules/steasyvideo/vendor/composer/platform_check.php
vendored
Normal file
26
modules/steasyvideo/vendor/composer/platform_check.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// platform_check.php @generated by Composer
|
||||||
|
|
||||||
|
$issues = array();
|
||||||
|
|
||||||
|
if (!(PHP_VERSION_ID >= 50600)) {
|
||||||
|
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($issues) {
|
||||||
|
if (!headers_sent()) {
|
||||||
|
header('HTTP/1.1 500 Internal Server Error');
|
||||||
|
}
|
||||||
|
if (!ini_get('display_errors')) {
|
||||||
|
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||||
|
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
||||||
|
} elseif (!headers_sent()) {
|
||||||
|
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
trigger_error(
|
||||||
|
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
||||||
|
E_USER_ERROR
|
||||||
|
);
|
||||||
|
}
|
||||||
22
modules/steasyvideo/views/css/admin.css
Normal file
22
modules/steasyvideo/views/css/admin.css
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_VIDEO_SELECTOR_DESKTOP,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_BUTTON_SELECTOR_DESKTOP,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_TYPE_DESKTOP,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_THUMBNAIL_TYPE_DESKTOP,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_THUMBNAIL_SELECTOR_DESKTOP,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_VIDEO_TEMPLATE_DESKTOP,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_VIDEO_SELECTOR_MOBILE,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_BUTTON_SELECTOR_MOBILE,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_TYPE_MOBILE,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_THUMBNAIL_TYPE_MOBILE,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_THUMBNAIL_SELECTOR_MOBILE,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_VIDEO_TEMPLATE_MOBILE,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_VIDEO_SELECTOR_QUICKVIEW,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_BUTTON_SELECTOR_QUICKVIEW,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_TYPE_QUICKVIEW,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_THUMBNAIL_TYPE_QUICKVIEW,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_THUMBNAIL_SELECTOR_QUICKVIEW,
|
||||||
|
#conf_id_ST_EASY_VIDEO_GALLERY_VIDEO_TEMPLATE_QUICKVIEW
|
||||||
|
{
|
||||||
|
border-top: 1px solid #BBCDD2;
|
||||||
|
padding-top: 19px;
|
||||||
|
}
|
||||||
150
modules/steasyvideo/views/css/front.css
Normal file
150
modules/steasyvideo/views/css/front.css
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
.st_easy_video_box{
|
||||||
|
position: relative;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
.st_easy_video_box.st_easy_video_box_absolute{
|
||||||
|
position: absolute;
|
||||||
|
z-index: 9;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
.pro_gallery_top .st_easy_video_box{
|
||||||
|
}
|
||||||
|
@media (min-width: 1200px){
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 991px) and (min-width: 768px){
|
||||||
|
}
|
||||||
|
@media (max-width: 767px){
|
||||||
|
}
|
||||||
|
|
||||||
|
.pro_video_cover_invisible .pro_gallery_thumb, .hightlight_curr_thumbs .pro_video_cover_invisible.clicked_thumb .pro_gallery_thumb, .st_easy_video_placeholder, .st_easy_video_thumb_invisiable .thumb,.st_easy_video_no_image_thumb{
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.pro_video_cover_invisible .pro_gallery_thumb_box{
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.st_easy_video_btn:focus,.video-js button:focus{
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
.st_easy_video.video-js{position: static;}
|
||||||
|
.st_easy_video_btn{
|
||||||
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 10;
|
||||||
|
outline: none;
|
||||||
|
border:none;
|
||||||
|
background: transparent;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.st_easy_video_btn.st_easy_video_btn_absolute{
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
.st_easy_video_btn .vjs-icon-placeholder{
|
||||||
|
display: block;
|
||||||
|
width:36px;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
background: rgba(0,0,0,0.5);
|
||||||
|
color: #fff;
|
||||||
|
font-size: 22px;
|
||||||
|
border-radius: 100%;
|
||||||
|
padding: 0;
|
||||||
|
border:none;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 0;
|
||||||
|
font-size: 30px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.st_play_video_text{display: block;}
|
||||||
|
.st_easy_video_btn.st_easy_video_close{
|
||||||
|
right: 10px; top: 10px;left:auto;bottom: auto;
|
||||||
|
}
|
||||||
|
.st_easy_video_play_icon{pointer-events:none;}
|
||||||
|
.pro_gallery_thumbs_container .st_easy_video_play,
|
||||||
|
.st_easy_video_play_icon{
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
margin-left: -18px;
|
||||||
|
margin-top: -18px;
|
||||||
|
bottom: auto;
|
||||||
|
}
|
||||||
|
.st_easy_video_btn .vjs-icon-placeholder:before{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-family: VideoJS;
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
content: "\f101";
|
||||||
|
}
|
||||||
|
.st_easy_video_btn.st_easy_video_close .vjs-icon-placeholder:before{
|
||||||
|
content: "\f119";
|
||||||
|
}
|
||||||
|
|
||||||
|
.st_easy_video_play{z-index: 10;}
|
||||||
|
.st_easy_video_flex{display:-webkit-box;display:-moz-box;display:box;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;box-align:center;-moz-align-items:center;-ms-align-items:center;-o-align-items:center;align-items:center;-ms-flex-align:center}
|
||||||
|
.st_easy_video_invisible, .st_easy_video_btn.st_easy_video_invisible{display: none;}
|
||||||
|
.pro_popup_trigger.layer_icon_wrap.st_active.st_easy_video_invisible{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-images>li.thumb-container{position: relative;}
|
||||||
|
.st_easy_video_relative{
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.st_easy_video_absolute{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
.st_easy_video_layer{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
.vjs-youtube-mobile .vjs-big-play-button { display: none!important; }
|
||||||
|
.vjs-youtube-mobile .vjs-resize-manager { display: none!important; }
|
||||||
|
.st_easy_video_controls_youtubev .js-youtube .vjs-poster{display: none;}/*when youtube control is on, youtube de poster hui ba bo fang qi dang zhu*/
|
||||||
|
.st_easy_video_miaoshu{margin-bottom: 30px;}
|
||||||
|
.st_easy_video_miaoshu .st_easy_video_invisible{display: block;}
|
||||||
|
.st_easy_video_miaoshu .st_easy_video_box{position: relative;}
|
||||||
|
#product-images-large .slick-slide{position:relative;} /*for warehouse theme*/
|
||||||
|
|
||||||
|
|
||||||
|
.st_easy_video_play_layout_0 .st_play_video_text{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.st_easy_video_play_layout_1 .vjs-icon-placeholder{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.st_easy_video_play_layout_2{
|
||||||
|
}
|
||||||
|
.st_easy_video_play_layout_3{
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.st_easy_video_screen_only
|
||||||
|
{
|
||||||
|
position: absolute;
|
||||||
|
top: -10000em; //for safari browser compatibility
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0,0,0,0);
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#st_easy_video_device_mode:after {content: 'desktop';}
|
||||||
|
/*@media (max-width: 767px){#st_easy_video_device_mode:after {content: 'mobile';}}*/
|
||||||
34
modules/steasyvideo/views/css/index.php
Normal file
34
modules/steasyvideo/views/css/index.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
72
modules/steasyvideo/views/css/skin-0.css
Normal file
72
modules/steasyvideo/views/css/skin-0.css
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
Player Skin Designer for Video.js
|
||||||
|
http://videojs.com
|
||||||
|
|
||||||
|
To customize the player skin edit
|
||||||
|
the CSS below. Click "details"
|
||||||
|
below to add comments or questions.
|
||||||
|
This file uses some SCSS. Learn more
|
||||||
|
at http://sass-lang.com/guide)
|
||||||
|
|
||||||
|
This designer can be linked to at:
|
||||||
|
https://codepen.io/heff/pen/EarCt/left/?editors=010
|
||||||
|
*/
|
||||||
|
.video-js {
|
||||||
|
/* The base font size controls the size of everything, not just text.
|
||||||
|
All dimensions use em-based sizes so that the scale along with the font size.
|
||||||
|
Try increasing it to 15px and see what happens. */
|
||||||
|
font-size: 10px;
|
||||||
|
/* The main font color changes the ICON COLORS as well as the text */
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The "Big Play Button" is the play button that shows before the video plays.
|
||||||
|
To center it set the align values to center and middle. The typical location
|
||||||
|
of the button is the center, but there is trend towards moving it to a corner
|
||||||
|
where it gets out of the way of valuable content in the poster image.*/
|
||||||
|
.video-js.vjs-big-play-centered .vjs-big-play-button {
|
||||||
|
/* The font size is what makes the big play button...big.
|
||||||
|
All width/height values use ems, which are a multiple of the font size.
|
||||||
|
If the .video-js font-size is 10px, then 3em equals 30px.*/
|
||||||
|
font-size: 50px;
|
||||||
|
/* We're using SCSS vars here because the values are used in multiple places.
|
||||||
|
Now that font size is set, the following em values will be a multiple of the
|
||||||
|
new font size. If the font-size is 3em (30px), then setting any of
|
||||||
|
the following values to 3em would equal 30px. 3 * font-size. */
|
||||||
|
/* 1.5em = 45px default */
|
||||||
|
line-height: 50px;
|
||||||
|
height: 50px;
|
||||||
|
width: 50px;
|
||||||
|
/* 0.06666em = 2px default */
|
||||||
|
border: 0;
|
||||||
|
/* 0.3em = 9px default */
|
||||||
|
border-radius: 0.3em;
|
||||||
|
/* Align center */
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
margin-left: -25px;
|
||||||
|
margin-top: -25px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The default color of control backgrounds is mostly black but with a little
|
||||||
|
bit of blue so it can still be seen on all-black video frames, which are common. */
|
||||||
|
.video-js .vjs-control-bar,
|
||||||
|
.video-js .vjs-big-play-button,
|
||||||
|
.video-js .vjs-menu-button .vjs-menu-content {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Slider - used for Volume bar and Progress bar */
|
||||||
|
.video-js .vjs-slider, .video-js .vjs-load-progress {
|
||||||
|
background-color: rgba(255,255,255,0.3);
|
||||||
|
}
|
||||||
|
.video-js .vjs-load-progress div{ background-color: rgba(115, 133, 159, 0.75);}
|
||||||
|
|
||||||
|
/* The slider bar color is used for the progress bar and the volume bar
|
||||||
|
(the first two can be removed after a fix that's coming) */
|
||||||
|
.video-js .vjs-volume-level,
|
||||||
|
.video-js .vjs-play-progress,
|
||||||
|
.video-js .vjs-slider-bar {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
78
modules/steasyvideo/views/css/skin-1.css
Normal file
78
modules/steasyvideo/views/css/skin-1.css
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
Player Skin Designer for Video.js
|
||||||
|
http://videojs.com
|
||||||
|
|
||||||
|
To customize the player skin edit
|
||||||
|
the CSS below. Click "details"
|
||||||
|
below to add comments or questions.
|
||||||
|
This file uses some SCSS. Learn more
|
||||||
|
at http://sass-lang.com/guide)
|
||||||
|
|
||||||
|
This designer can be linked to at:
|
||||||
|
https://codepen.io/heff/pen/EarCt/left/?editors=010
|
||||||
|
*/
|
||||||
|
.video-js {
|
||||||
|
/* The base font size controls the size of everything, not just text.
|
||||||
|
All dimensions use em-based sizes so that the scale along with the font size.
|
||||||
|
Try increasing it to 15px and see what happens. */
|
||||||
|
font-size: 10px;
|
||||||
|
/* The main font color changes the ICON COLORS as well as the text */
|
||||||
|
color: #465324;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The "Big Play Button" is the play button that shows before the video plays.
|
||||||
|
To center it set the align values to center and middle. The typical location
|
||||||
|
of the button is the center, but there is trend towards moving it to a corner
|
||||||
|
where it gets out of the way of valuable content in the poster image.*/
|
||||||
|
.video-js.vjs-big-play-centered .vjs-big-play-button {
|
||||||
|
/* The font size is what makes the big play button...big.
|
||||||
|
All width/height values use ems, which are a multiple of the font size.
|
||||||
|
If the .video-js font-size is 10px, then 3em equals 30px.*/
|
||||||
|
font-size: 2.5em;
|
||||||
|
/* We're using SCSS vars here because the values are used in multiple places.
|
||||||
|
Now that font size is set, the following em values will be a multiple of the
|
||||||
|
new font size. If the font-size is 3em (30px), then setting any of
|
||||||
|
the following values to 3em would equal 30px. 3 * font-size. */
|
||||||
|
/* 1.5em = 45px default */
|
||||||
|
line-height: 1.5em;
|
||||||
|
height: 1.5em;
|
||||||
|
width: 2em;
|
||||||
|
/* 0.06666em = 2px default */
|
||||||
|
border: 0.06666em solid #465324;
|
||||||
|
/* 0.3em = 9px default */
|
||||||
|
border-radius: 0.2em;
|
||||||
|
/* Align center */
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
margin-left: -1em;
|
||||||
|
margin-top: -0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The default color of control backgrounds is mostly black but with a little
|
||||||
|
bit of blue so it can still be seen on all-black video frames, which are common. */
|
||||||
|
.video-js .vjs-control-bar,
|
||||||
|
.video-js .vjs-big-play-button,
|
||||||
|
.video-js .vjs-menu-button .vjs-menu-content {
|
||||||
|
background-color: rgba(0, 0, 0, 0.9);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Slider - used for Volume bar and Progress bar */
|
||||||
|
.video-js .vjs-slider, .video-js .vjs-load-progress {
|
||||||
|
background-color: rgba(230, 230, 230, 0.9);
|
||||||
|
}
|
||||||
|
.video-js .vjs-load-progress div{ background-color: rgba(230, 230, 230, 0.9);}
|
||||||
|
|
||||||
|
/* The slider bar color is used for the progress bar and the volume bar
|
||||||
|
(the first two can be removed after a fix that's coming) */
|
||||||
|
.video-js .vjs-volume-level,
|
||||||
|
.video-js .vjs-play-progress,
|
||||||
|
.video-js .vjs-slider-bar {
|
||||||
|
background: #465324;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.video-js:hover .vjs-big-play-button,
|
||||||
|
.video-js .vjs-big-play-button:focus {
|
||||||
|
background-color: rgba(0, 0, 0, 0.95);
|
||||||
|
border-color: #647733;
|
||||||
|
}
|
||||||
77
modules/steasyvideo/views/css/skin-2.css
Normal file
77
modules/steasyvideo/views/css/skin-2.css
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
Player Skin Designer for Video.js
|
||||||
|
http://videojs.com
|
||||||
|
|
||||||
|
To customize the player skin edit
|
||||||
|
the CSS below. Click "details"
|
||||||
|
below to add comments or questions.
|
||||||
|
This file uses some SCSS. Learn more
|
||||||
|
at http://sass-lang.com/guide)
|
||||||
|
|
||||||
|
This designer can be linked to at:
|
||||||
|
https://codepen.io/heff/pen/EarCt/left/?editors=010
|
||||||
|
*/
|
||||||
|
.video-js {
|
||||||
|
/* The base font size controls the size of everything, not just text.
|
||||||
|
All dimensions use em-based sizes so that the scale along with the font size.
|
||||||
|
Try increasing it to 15px and see what happens. */
|
||||||
|
font-size: 10px;
|
||||||
|
/* The main font color changes the ICON COLORS as well as the text */
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The "Big Play Button" is the play button that shows before the video plays.
|
||||||
|
To center it set the align values to center and middle. The typical location
|
||||||
|
of the button is the center, but there is trend towards moving it to a corner
|
||||||
|
where it gets out of the way of valuable content in the poster image.*/
|
||||||
|
.video-js.vjs-big-play-centered .vjs-big-play-button {
|
||||||
|
/* The font size is what makes the big play button...big.
|
||||||
|
All width/height values use ems, which are a multiple of the font size.
|
||||||
|
If the .video-js font-size is 10px, then 3em equals 30px.*/
|
||||||
|
font-size: 2.5em;
|
||||||
|
/* We're using SCSS vars here because the values are used in multiple places.
|
||||||
|
Now that font size is set, the following em values will be a multiple of the
|
||||||
|
new font size. If the font-size is 3em (30px), then setting any of
|
||||||
|
the following values to 3em would equal 30px. 3 * font-size. */
|
||||||
|
/* 1.5em = 45px default */
|
||||||
|
line-height: 1.5em;
|
||||||
|
height: 1.5em;
|
||||||
|
width: 2em;
|
||||||
|
/* 0.06666em = 2px default */
|
||||||
|
border: none;
|
||||||
|
/* 0.3em = 9px default */
|
||||||
|
border-radius: 10px;
|
||||||
|
/* Align center */
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
margin-left: -1em;
|
||||||
|
margin-top: -0.75em;
|
||||||
|
background: rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The default color of control backgrounds is mostly black but with a little
|
||||||
|
bit of blue so it can still be seen on all-black video frames, which are common. */
|
||||||
|
.video-js .vjs-control-bar,
|
||||||
|
.video-js .vjs-big-play-button,
|
||||||
|
.video-js .vjs-menu-button .vjs-menu-content {
|
||||||
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Slider - used for Volume bar and Progress bar */
|
||||||
|
.video-js .vjs-slider, .video-js .vjs-load-progress {
|
||||||
|
background-color: rgba(115,133,159,0.5);
|
||||||
|
}
|
||||||
|
.video-js .vjs-load-progress div{ background-color: rgba(255,255,255,0.5);}
|
||||||
|
/* The slider bar color is used for the progress bar and the volume bar
|
||||||
|
(the first two can be removed after a fix that's coming) */
|
||||||
|
.video-js .vjs-volume-level,
|
||||||
|
.video-js .vjs-play-progress,
|
||||||
|
.video-js .vjs-slider-bar {
|
||||||
|
background: #cc181e;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.video-js:hover .vjs-big-play-button,
|
||||||
|
.video-js .vjs-big-play-button:focus {
|
||||||
|
background-color: #cc181e;
|
||||||
|
}
|
||||||
71
modules/steasyvideo/views/css/skin-3.css
Normal file
71
modules/steasyvideo/views/css/skin-3.css
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
Player Skin Designer for Video.js
|
||||||
|
http://videojs.com
|
||||||
|
|
||||||
|
To customize the player skin edit
|
||||||
|
the CSS below. Click "details"
|
||||||
|
below to add comments or questions.
|
||||||
|
This file uses some SCSS. Learn more
|
||||||
|
at http://sass-lang.com/guide)
|
||||||
|
|
||||||
|
This designer can be linked to at:
|
||||||
|
https://codepen.io/heff/pen/EarCt/left/?editors=010
|
||||||
|
*/
|
||||||
|
.video-js {
|
||||||
|
/* The base font size controls the size of everything, not just text.
|
||||||
|
All dimensions use em-based sizes so that the scale along with the font size.
|
||||||
|
Try increasing it to 15px and see what happens. */
|
||||||
|
font-size: 10px;
|
||||||
|
/* The main font color changes the ICON COLORS as well as the text */
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The "Big Play Button" is the play button that shows before the video plays.
|
||||||
|
To center it set the align values to center and middle. The typical location
|
||||||
|
of the button is the center, but there is trend towards moving it to a corner
|
||||||
|
where it gets out of the way of valuable content in the poster image.*/
|
||||||
|
.video-js.vjs-big-play-centered .vjs-big-play-button {
|
||||||
|
/* The font size is what makes the big play button...big.
|
||||||
|
All width/height values use ems, which are a multiple of the font size.
|
||||||
|
If the .video-js font-size is 10px, then 3em equals 30px.*/
|
||||||
|
font-size: 3em;
|
||||||
|
/* We're using SCSS vars here because the values are used in multiple places.
|
||||||
|
Now that font size is set, the following em values will be a multiple of the
|
||||||
|
new font size. If the font-size is 3em (30px), then setting any of
|
||||||
|
the following values to 3em would equal 30px. 3 * font-size. */
|
||||||
|
/* 1.5em = 45px default */
|
||||||
|
line-height: 1.9em;
|
||||||
|
height: 2em;
|
||||||
|
width: 2em;
|
||||||
|
/* 0.06666em = 2px default */
|
||||||
|
border: 3px solid #ffffff;
|
||||||
|
/* 0.3em = 9px default */
|
||||||
|
border-radius: 2em;
|
||||||
|
/* Align center */
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
margin-left: -1em;
|
||||||
|
margin-top: -1em;
|
||||||
|
background: rgba(0,0,0,0.35);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The default color of control backgrounds is mostly black but with a little
|
||||||
|
bit of blue so it can still be seen on all-black video frames, which are common. */
|
||||||
|
.video-js .vjs-control-bar,
|
||||||
|
.video-js .vjs-big-play-button,
|
||||||
|
.video-js .vjs-menu-button .vjs-menu-content {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Slider - used for Volume bar and Progress bar */
|
||||||
|
.video-js .vjs-slider, .video-js .vjs-load-progress {
|
||||||
|
background-color: rgba(115,133,159,0.5);
|
||||||
|
}
|
||||||
|
.video-js .vjs-load-progress div{ background-color: rgba(255,255,255,0.5);}
|
||||||
|
/* The slider bar color is used for the progress bar and the volume bar
|
||||||
|
(the first two can be removed after a fix that's coming) */
|
||||||
|
.video-js .vjs-volume-level,
|
||||||
|
.video-js .vjs-play-progress,
|
||||||
|
.video-js .vjs-slider-bar {
|
||||||
|
background: #2483d5;
|
||||||
|
}
|
||||||
2011
modules/steasyvideo/views/css/video-js.css
Normal file
2011
modules/steasyvideo/views/css/video-js.css
Normal file
File diff suppressed because one or more lines are too long
1
modules/steasyvideo/views/css/video-js.min.css
vendored
Normal file
1
modules/steasyvideo/views/css/video-js.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
35
modules/steasyvideo/views/index.php
Normal file
35
modules/steasyvideo/views/index.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
215
modules/steasyvideo/views/js/admin.js
Normal file
215
modules/steasyvideo/views/js/admin.js
Normal file
@@ -0,0 +1,215 @@
|
|||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
jQuery(function($){
|
||||||
|
|
||||||
|
$('.st_delete_image').click(function(){
|
||||||
|
var self = $(this);
|
||||||
|
var id = self.data('id');
|
||||||
|
$.getJSON(currentIndex+'&token='+token+'&configure=steasyvideo&id_st_easy_video='+id+'&act=delete_image&ts='+new Date().getTime(),
|
||||||
|
function(json){
|
||||||
|
if(json.r) {
|
||||||
|
self.closest('.form-group').remove();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
alert('Error');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$(document).on('change', '#st_easy_video_form #url', function(){
|
||||||
|
var regExp = /.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/;
|
||||||
|
var match = $(this).val().match(regExp);
|
||||||
|
if (match && match[1].length == 11)
|
||||||
|
$('#youtube_thumbnail').html('<img src="//img.youtube.com/vi/'+match[1]+'/default.jpg">');
|
||||||
|
else
|
||||||
|
$('#youtube_thumbnail').empty();
|
||||||
|
});
|
||||||
|
if($('#st_easy_video_form #url').val())
|
||||||
|
$('#st_easy_video_form #url').trigger('change');
|
||||||
|
|
||||||
|
/*handle_contr($('[name="contr"]').val());
|
||||||
|
$(document).on('change', '[name="contr"]', function(){
|
||||||
|
handle_contr($(this).val());
|
||||||
|
});*/
|
||||||
|
|
||||||
|
$(document).on('click', '.st_ac_del_product', function(){
|
||||||
|
$(this).closest('li').remove();
|
||||||
|
var $ac = $(this).closest('.form-group').find('.ac_products');
|
||||||
|
if(!$ac.hasClass('ac_input'))
|
||||||
|
steasyvideoo_admin.ac($ac);
|
||||||
|
$ac.setOptions({
|
||||||
|
extraParams: {
|
||||||
|
excludeIds : getProductExcIds($(this).closest('.form-group').find('.curr_products'))
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$(document).on('focus', '.ac_products', function(){
|
||||||
|
if(!$(this).hasClass('ac_input'))
|
||||||
|
steasyvideoo_admin.ac($(this));
|
||||||
|
});
|
||||||
|
$(document).on('click', '.stsb_ac_del_product', function(){
|
||||||
|
$(this).closest('li').remove();
|
||||||
|
var $ac = $(this).closest('.form-group').find('.ac_products');
|
||||||
|
if(!$ac.hasClass('ac_input'))
|
||||||
|
steasyvideoo_admin.ac($ac, 'product');
|
||||||
|
$ac.setOptions({
|
||||||
|
extraParams: {
|
||||||
|
excludeIds : getProductExcIds($(this).closest('.form-group').find('.curr_product'))
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('change', 'input[name="ST_EASY_VIDEO_MINIATURE_DISPLAY_DESKTOP"], input[name="ST_EASY_VIDEO_MINIATURE_DISPLAY_MOBILE"]', function(){
|
||||||
|
steasyvideoo_admin.miniature_form();
|
||||||
|
});
|
||||||
|
steasyvideoo_admin.miniature_form();
|
||||||
|
|
||||||
|
$(document).on('change', 'input[name="ST_EASY_VIDEO_GALLERY_DISPLAY_DESKTOP"], input[name="ST_EASY_VIDEO_GALLERY_DISPLAY_MOBILE"], input[name="ST_EASY_VIDEO_GALLERY_DISPLAY_QUICKVIEW"]', function(){
|
||||||
|
steasyvideoo_admin.gallery_form();
|
||||||
|
});
|
||||||
|
steasyvideoo_admin.gallery_form();
|
||||||
|
|
||||||
|
$(document).on('change', 'input[name="ST_EASY_VIDEO_MINIATURE_PLAY_BTN_POSITION"]', function(){
|
||||||
|
steasyvideoo_admin.btn_position('MINIATURE');
|
||||||
|
});
|
||||||
|
$(document).on('change', 'input[name="ST_EASY_VIDEO_GALLERY_PLAY_BTN_POSITION"]', function(){
|
||||||
|
steasyvideoo_admin.btn_position('GALLERY');
|
||||||
|
});
|
||||||
|
steasyvideoo_admin.btn_position('MINIATURE');
|
||||||
|
steasyvideoo_admin.btn_position('GALLERY');
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
var steasyvideoo_admin = {
|
||||||
|
'ac': function($that) {
|
||||||
|
var $cp = $that.closest('.form-group').find('.curr_products');
|
||||||
|
$that.autocomplete(currentIndex+'&token='+token+'&ajax_product_list&disableCombination=true', {
|
||||||
|
minChars: 1,
|
||||||
|
autoFill: true,
|
||||||
|
max:200,
|
||||||
|
matchContains: true,
|
||||||
|
mustMatch:true,
|
||||||
|
scroll:true,
|
||||||
|
cacheLength:0,
|
||||||
|
extraParams:{ excludeIds:getProductExcIds($cp)},
|
||||||
|
formatItem: function(item) {
|
||||||
|
if (item.length == 2) {
|
||||||
|
return item[1]+' - '+item[0];
|
||||||
|
} else {
|
||||||
|
return '--';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).result(function(event, data, formatted) {
|
||||||
|
if (data == null || data.length != 2)
|
||||||
|
return false;
|
||||||
|
var id = data[1];
|
||||||
|
var name = data[0];
|
||||||
|
$cp.append('<li>'+name+'<a href="javascript:;" class="stsb_ac_del_product"><img src="../img/admin/delete.gif" /></a><input type="hidden" name="st_id_product[]" value="'+id+'" /></li>');
|
||||||
|
|
||||||
|
$that.setOptions({
|
||||||
|
extraParams: {
|
||||||
|
excludeIds : getProductExcIds($cp)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
'miniature_form': function(){
|
||||||
|
var value = 0, device=0;
|
||||||
|
if($('input[name="ST_EASY_VIDEO_MINIATURE_DISPLAY_DESKTOP"]:checked').length){
|
||||||
|
value = $('input[name="ST_EASY_VIDEO_MINIATURE_DISPLAY_DESKTOP"]:checked').val();
|
||||||
|
device = 'DESKTOP';
|
||||||
|
}else if($('input[name="ST_EASY_VIDEO_MINIATURE_DISPLAY_MOBILE"]:checked').length){
|
||||||
|
value = $('input[name="ST_EASY_VIDEO_MINIATURE_DISPLAY_MOBILE"]:checked').val();
|
||||||
|
device = 'MOBILE';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('input[name="ST_EASY_VIDEO_MINIATURE_VIDEO_SELECTOR_'+device+'"], select[name="ST_EASY_VIDEO_MINIATURE_VIDEO_APPEND_'+device+'"], input[name="ST_EASY_VIDEO_MINIATURE_VIDEO_POSITION_'+device+'"]').parents('.form-group').toggle(value=='2' || value=='1' || value=='3' || value=='4');
|
||||||
|
$('input[name="ST_EASY_VIDEO_MINIATURE_BUTTON_SELECTOR_'+device+'"], select[name="ST_EASY_VIDEO_MINIATURE_BUTTON_APPEND_'+device+'"], input[name="ST_EASY_VIDEO_MINIATURE_BUTTON_POSITION_'+device+'"], input[name="ST_EASY_VIDEO_MINIATURE_BUTTON_LAYOUT_'+device+'"], input[name="ST_EASY_VIDEO_MINIATURE_BUTTON_HIDE_'+device+'"]').parents('.form-group').toggle(value=='1' || value=='4');
|
||||||
|
if(device=='DESKTOP')
|
||||||
|
$('input[name="ST_EASY_VIDEO_MINIATURE_HOVER_ELEMENT"]').parents('.form-group').toggle(value=='3' || value=='4');
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
'btn_position': function(type){
|
||||||
|
$('input[name="ST_EASY_VIDEO_'+type+'_PLAY_BTN_OFFSET"]').parents('.form-group').toggle($('input[name="ST_EASY_VIDEO_'+type+'_PLAY_BTN_POSITION"]:checked').val()!='0');
|
||||||
|
},
|
||||||
|
'gallery_form': function(){
|
||||||
|
var groups = [];
|
||||||
|
var display = 0, device=0;
|
||||||
|
if($('input[name="ST_EASY_VIDEO_GALLERY_DISPLAY_DESKTOP"]:checked').length){
|
||||||
|
display = $('input[name="ST_EASY_VIDEO_GALLERY_DISPLAY_DESKTOP"]:checked').val();
|
||||||
|
device = 'DESKTOP';
|
||||||
|
}else if($('input[name="ST_EASY_VIDEO_GALLERY_DISPLAY_MOBILE"]:checked').length){
|
||||||
|
display = $('input[name="ST_EASY_VIDEO_GALLERY_DISPLAY_MOBILE"]:checked').val();
|
||||||
|
device = 'MOBILE';
|
||||||
|
}else if($('input[name="ST_EASY_VIDEO_GALLERY_DISPLAY_QUICKVIEW"]:checked').length){
|
||||||
|
display = $('input[name="ST_EASY_VIDEO_GALLERY_DISPLAY_QUICKVIEW"]:checked').val();
|
||||||
|
device = 'QUICKVIEW';
|
||||||
|
}
|
||||||
|
if(display==1)
|
||||||
|
groups.push('button', 'video', 'thumbnail', 'close');
|
||||||
|
else if(display==2)
|
||||||
|
groups.push('video');
|
||||||
|
else if(display==3)
|
||||||
|
groups.push('gallery');
|
||||||
|
else if(display==4)
|
||||||
|
groups.push('video', 'thumbnail', 'close');
|
||||||
|
else if(display==5)
|
||||||
|
groups.push('gallery', 'thumbnail');
|
||||||
|
else if(display==6)
|
||||||
|
groups.push('video', 'thumbnail');
|
||||||
|
else if(display==7)
|
||||||
|
groups.push('button', 'video', 'gallery', 'thumbnail');
|
||||||
|
|
||||||
|
$('input[name="ST_EASY_VIDEO_GALLERY_VIDEO_SELECTOR_'+device+'"], select[name="ST_EASY_VIDEO_GALLERY_VIDEO_APPEND_'+device+'"],input[name="ST_EASY_VIDEO_GALLERY_VIDEO_POSITION_'+device+'"]').parents('.form-group').toggle(groups.includes('video'));
|
||||||
|
$('input[name="ST_EASY_VIDEO_GALLERY_BUTTON_SELECTOR_'+device+'"], select[name="ST_EASY_VIDEO_GALLERY_BUTTON_APPEND_'+device+'"], input[name="ST_EASY_VIDEO_GALLERY_BUTTON_POSITION_'+device+'"], input[name="ST_EASY_VIDEO_GALLERY_BUTTON_LAYOUT_'+device+'"], input[name="ST_EASY_VIDEO_GALLERY_BUTTON_HIDE_'+device+'"]').parents('.form-group').toggle(groups.includes('button'));
|
||||||
|
|
||||||
|
$('input[name="ST_EASY_VIDEO_GALLERY_TYPE_'+device+'"],input[name="ST_EASY_VIDEO_GALLERY_SLIDER_SELECTOR_'+device+'"],input[name="ST_EASY_VIDEO_GALLERY_SLIDE_SELECTOR_'+device+'"],select[name="ST_EASY_VIDEO_GALLERY_SLIDER_APPEND_'+device+'"]').parents('.form-group').toggle(groups.includes('gallery'));
|
||||||
|
$('input[name="ST_EASY_VIDEO_GALLERY_THUMBNAIL_TYPE_'+device+'"], input[name="ST_EASY_VIDEO_GALLERY_THUMBNAIL_ITEM_SELECTOR_'+device+'"], input[name="ST_EASY_VIDEO_GALLERY_THUMBNAIL_SELECTOR_'+device+'"],input[name="ST_EASY_VIDEO_GALLERY_THUMBNAIL_SLIDE_SELECTOR_'+device+'"],select[name="ST_EASY_VIDEO_GALLERY_THUMBNAIL_APPEND_'+device+'"]').parents('.form-group').toggle(groups.includes('thumbnail'));
|
||||||
|
|
||||||
|
$('input[name="ST_EASY_VIDEO_GALLERY_CLOSE_VIDEO_'+device+'"]').parents('.form-group').toggle(groups.includes('close'));
|
||||||
|
|
||||||
|
$('textarea[name="ST_EASY_VIDEO_GALLERY_BUTTON_TEMPLATE_'+device+'"],select[name="ST_EASY_VIDEO_GALLERY_BUTTON_IMAGE_TYPE_'+device+'"]').parents('.form-group').toggle(groups.includes('button') || groups.includes('thumbnail'));
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
'buyaosanchu': 1
|
||||||
|
};
|
||||||
|
var getProductExcIds = function(dom)
|
||||||
|
{
|
||||||
|
var excludeIds = [];
|
||||||
|
$(dom).find(':hidden[name="st_id_product[]"]').each(function(){
|
||||||
|
excludeIds.push($(this).val());
|
||||||
|
});
|
||||||
|
return excludeIds.join( ',' );
|
||||||
|
};
|
||||||
|
function handle_contr(val)
|
||||||
|
{
|
||||||
|
var fm = {'category': 'id_category', 'product': 'ac_products', 'manufacturer': 'id_manufacturer'};
|
||||||
|
$.each(fm, function(k,v){
|
||||||
|
$('#'+v).closest('.form-group').toggle(k == val);
|
||||||
|
$('#sub_category_on').closest('.form-group').toggle(k == val && k=='category');
|
||||||
|
});
|
||||||
|
}
|
||||||
1052
modules/steasyvideo/views/js/front.js
Normal file
1052
modules/steasyvideo/views/js/front.js
Normal file
File diff suppressed because it is too large
Load Diff
35
modules/steasyvideo/views/js/index.php
Normal file
35
modules/steasyvideo/views/js/index.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
53
modules/steasyvideo/views/js/video.min.js
vendored
Normal file
53
modules/steasyvideo/views/js/video.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2417
modules/steasyvideo/views/js/videojs-vimeo.umd.js
Normal file
2417
modules/steasyvideo/views/js/videojs-vimeo.umd.js
Normal file
File diff suppressed because it is too large
Load Diff
12
modules/steasyvideo/views/js/youtube.min.js
vendored
Normal file
12
modules/steasyvideo/views/js/youtube.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
35
modules/steasyvideo/views/templates/admin/index.php
Normal file
35
modules/steasyvideo/views/templates/admin/index.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{**
|
||||||
|
*
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*}
|
||||||
|
<h3>{l s='Easy product video' mod='steasyvideo'}</h3>
|
||||||
|
<a href="{$tiaozhuan_url|escape:'htmlall':'UTF-8'}" target="_blank"><i class="material-icons">open_in_new</i>{l s='Click here to go to the "Easy product video" module to manage videso for this item.' mod='steasyvideo'}</a>
|
||||||
26
modules/steasyvideo/views/templates/hook/device_mode.tpl
Normal file
26
modules/steasyvideo/views/templates/hook/device_mode.tpl
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{**
|
||||||
|
*
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*}
|
||||||
|
<span id="st_easy_video_device_mode" class="st_easy_video_screen_only"></span>
|
||||||
34
modules/steasyvideo/views/templates/hook/forquickview.tpl
Normal file
34
modules/steasyvideo/views/templates/hook/forquickview.tpl
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{**
|
||||||
|
*
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*}
|
||||||
|
<script>
|
||||||
|
{if isset($video_data)}
|
||||||
|
{literal}
|
||||||
|
if(typeof(easyVideoObj)!='undefined'){
|
||||||
|
easyVideoObj.quickView({/literal}{$video_data|json_encode nofilter}, {$id_product|escape:'htmlall':'UTF-8'}, {$id_product_attribute|escape:'htmlall':'UTF-8'}{literal});
|
||||||
|
}
|
||||||
|
{/literal}
|
||||||
|
{/if}
|
||||||
|
</script>
|
||||||
30
modules/steasyvideo/views/templates/hook/header.tpl
Normal file
30
modules/steasyvideo/views/templates/hook/header.tpl
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{**
|
||||||
|
*
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*}
|
||||||
|
{if isset($st_easy_video_css)}
|
||||||
|
<style>
|
||||||
|
{$st_easy_video_css nofilter}
|
||||||
|
</style>
|
||||||
|
{/if}
|
||||||
35
modules/steasyvideo/views/templates/hook/index.php
Normal file
35
modules/steasyvideo/views/templates/hook/index.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
41
modules/steasyvideo/views/templates/hook/miniature.tpl
Normal file
41
modules/steasyvideo/views/templates/hook/miniature.tpl
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{**
|
||||||
|
*
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*}
|
||||||
|
{$ps_container = Context::getContext()->controller->getContainer()}
|
||||||
|
{if $ps_container->has( 'st_steasyvideo_repository' )}
|
||||||
|
{$st_steasyvideo_repository = $ps_container->get( 'st_steasyvideo_repository' )}
|
||||||
|
{$video = $st_steasyvideo_repository->getListingVideo($easy_video_product)}
|
||||||
|
{if $video}
|
||||||
|
{$video_unique_id = dechex( rand() )}
|
||||||
|
<div id="{$video_unique_id|escape:'htmlall':'UTF-8'}"></div>
|
||||||
|
<script>
|
||||||
|
{literal}
|
||||||
|
if(typeof(easy_video_arr) ==='undefined')
|
||||||
|
var easy_video_arr = {};
|
||||||
|
easy_video_arr['{/literal}{$video_unique_id|escape:'htmlall':'UTF-8'}{literal}'] = {/literal}{$video|@json_encode nofilter}{literal};
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
37
modules/steasyvideo/views/templates/hook/miniature_tb.tpl
Normal file
37
modules/steasyvideo/views/templates/hook/miniature_tb.tpl
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{**
|
||||||
|
*
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*}
|
||||||
|
{$video = StEasyVideoClass::getOneVideo($easy_video_product['id_product'], 2)}
|
||||||
|
{if $video}
|
||||||
|
{$video_unique_id = dechex( rand() )}
|
||||||
|
<div id="{$video_unique_id|escape:'htmlall':'UTF-8'}"></div>
|
||||||
|
<script>
|
||||||
|
{literal}
|
||||||
|
if(typeof(easy_video_arr) ==='undefined')
|
||||||
|
var easy_video_arr = {};
|
||||||
|
easy_video_arr['{/literal}{$video_unique_id|escape:'htmlall':'UTF-8'}{literal}'] = {/literal}{$video|@json_encode nofilter}{literal};
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
{/if}
|
||||||
26
modules/steasyvideo/views/templates/hook/predefined/1.tpl
Normal file
26
modules/steasyvideo/views/templates/hook/predefined/1.tpl
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{**
|
||||||
|
*
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*}
|
||||||
|
<div class="swiper-slide"><img src="@placeholder_url@" width="@placeholder_width@" height="@placeholder_height@"></div>
|
||||||
26
modules/steasyvideo/views/templates/hook/predefined/2.tpl
Normal file
26
modules/steasyvideo/views/templates/hook/predefined/2.tpl
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{**
|
||||||
|
*
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*}
|
||||||
|
<div class="swiper-slide"></div>
|
||||||
26
modules/steasyvideo/views/templates/hook/predefined/3.tpl
Normal file
26
modules/steasyvideo/views/templates/hook/predefined/3.tpl
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{**
|
||||||
|
*
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*}
|
||||||
|
<div class="product-lmage-large swiper-slide"></div>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
35
modules/steasyvideo/views/templates/index.php
Normal file
35
modules/steasyvideo/views/templates/index.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright since 2007 PrestaShop SA and Contributors
|
||||||
|
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.md.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* https://opensource.org/licenses/OSL-3.0
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||||
|
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||||
|
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||||
|
*/
|
||||||
|
|
||||||
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||||
|
|
||||||
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
|
header("Location: ../");
|
||||||
|
exit;
|
||||||
@@ -41,10 +41,10 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{/block}
|
{/block}
|
||||||
{if $product.cover}
|
{if $product.cover}
|
||||||
<img id="zoom_product" data-type-zoom="" class="js-qv-product-cover img-fluid" src="{$product.cover.bySize.large_default.url}" alt="{$product.cover.legend}" title="{$product.cover.legend}" itemprop="image">
|
<img id="zoom_product1" data-type-zoom="" class="js-qv-product-cover img-fluid" src="{$product.cover.bySize.large_default.url}" alt="{$product.cover.legend}" title="{$product.cover.legend}" itemprop="image">
|
||||||
<div class="layer hidden-sm-down" data-toggle="modal" data-target="#product-modal">
|
{* <div class="layer hidden-sm-down" data-toggle="modal" data-target="#product-modal">
|
||||||
<i class="material-icons zoom-in"></i>
|
<i class="material-icons zoom-in"></i>
|
||||||
</div>
|
</div> *}
|
||||||
{else}
|
{else}
|
||||||
<img id="zoom_product" data-type-zoom="" class="js-qv-product-cover img-fluid" src="{$urls.no_picture_image.bySize.large_default.url}" alt="{$product.name}" title="{$product.name}" itemprop="image">
|
<img id="zoom_product" data-type-zoom="" class="js-qv-product-cover img-fluid" src="{$urls.no_picture_image.bySize.large_default.url}" alt="{$product.name}" title="{$product.name}" itemprop="image">
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user