first
This commit is contained in:
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout;
|
||||
|
||||
|
||||
use Nextend\Framework\Platform\Platform;
|
||||
use Nextend\Framework\Request\Request;
|
||||
use Nextend\Framework\View\AbstractLayout;
|
||||
use Nextend\Framework\View\Html;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\NavBar\BlockNavBar;
|
||||
use Nextend\SmartSlider3\Application\Admin\TraitAdminUrl;
|
||||
use Nextend\SmartSlider3\SmartSlider3Info;
|
||||
|
||||
abstract class AbstractLayoutMenu extends AbstractLayout {
|
||||
|
||||
use TraitAdminUrl;
|
||||
|
||||
/** @var BlockNavBar */
|
||||
protected $header;
|
||||
|
||||
protected $classes = array();
|
||||
|
||||
public function __construct($view) {
|
||||
|
||||
$this->header = new BlockNavBar($this);
|
||||
|
||||
parent::__construct($view);
|
||||
|
||||
$this->header->setLogo($this->getApplicationType()
|
||||
->getLogo());
|
||||
$this->header->setSidebarLink($this->getUrlDashboard());
|
||||
|
||||
$cmd = Request::$REQUEST->getVar("nextendcontroller", "sliders");
|
||||
$this->header->addMenuItem(Html::link(n2_('Go Pro'), SmartSlider3Info::getProUrlPricing(array(
|
||||
'utm_source' => 'go-pro-button-top-menu',
|
||||
'utm_medium' => 'smartslider-' . Platform::getName() . '-' . SmartSlider3Info::$plan,
|
||||
'utm_campaign' => SmartSlider3Info::$campaign
|
||||
)), array(
|
||||
'target' => '_blank'
|
||||
)));
|
||||
$this->header->addMenuItem(Html::link(n2_('Settings'), $this->getUrlSettingsDefault()), $cmd == "settings");
|
||||
|
||||
|
||||
$this->header->addMenuItem(Html::link(n2_('Help'), $this->getUrlHelp()), $cmd == "help");
|
||||
|
||||
}
|
||||
|
||||
public function addHeaderMenuItem($item) {
|
||||
$this->header->addMenuItem($item);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $label
|
||||
* @param $icon
|
||||
* @param string $url
|
||||
*
|
||||
* @return Helper\Breadcrumb
|
||||
*/
|
||||
public function addBreadcrumb($label, $icon = '', $url = '#') {
|
||||
|
||||
return $this->header->addBreadcrumb($label, $icon, $url);
|
||||
}
|
||||
|
||||
public function getHeader() {
|
||||
|
||||
return $this->header->toHTML();
|
||||
}
|
||||
|
||||
public function getClasses() {
|
||||
|
||||
return $this->classes;
|
||||
}
|
||||
|
||||
public function addClass($class) {
|
||||
|
||||
$this->classes[] = $class;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\Admin;
|
||||
|
||||
use Nextend\Framework\Notification\Notification;
|
||||
use Nextend\Framework\Plugin;
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\SmartSlider3\Settings;
|
||||
use Nextend\SmartSlider3\SmartSlider3Info;
|
||||
|
||||
/**
|
||||
* @var $this BlockAdmin
|
||||
*/
|
||||
?>
|
||||
|
||||
<div <?php $this->renderAttributes(); ?>>
|
||||
<div class="n2_admin__header">
|
||||
<?php echo wp_kses($this->getHeader(), Sanitize::$adminTemplateTags); ?>
|
||||
</div>
|
||||
<div class="n2_admin__content">
|
||||
<?php echo wp_kses($this->getSubNavigation(), Sanitize::$adminTemplateTags); ?>
|
||||
<?php $this->displayTopBar(); ?>
|
||||
|
||||
<?php $this->displayContent(); ?>
|
||||
</div>
|
||||
<?php
|
||||
Plugin::doAction('afterApplicationContent');
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
Notification::show();
|
@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\Admin;
|
||||
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\Framework\View\AbstractLayout;
|
||||
use Nextend\Framework\View\Html;
|
||||
|
||||
class BlockAdmin extends AbstractBlock {
|
||||
|
||||
/**
|
||||
* @var AbstractLayout
|
||||
*/
|
||||
protected $layout;
|
||||
|
||||
protected $id = 'n2-admin';
|
||||
|
||||
protected $classes = array(
|
||||
'n2',
|
||||
'n2_admin',
|
||||
'n2_admin_ui',
|
||||
'fitvidsignore'
|
||||
);
|
||||
|
||||
protected $attributes = array();
|
||||
|
||||
protected $header = '';
|
||||
|
||||
protected $subNavigation = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $topBar = '';
|
||||
|
||||
/**
|
||||
* @param AbstractLayout $layout
|
||||
*/
|
||||
public function setLayout($layout) {
|
||||
$this->layout = $layout;
|
||||
}
|
||||
|
||||
public function displayContent() {
|
||||
$this->layout->displayContent();
|
||||
}
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('Admin');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getClass() {
|
||||
|
||||
$this->classes = array_unique($this->classes);
|
||||
|
||||
return implode(' ', $this->classes);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classes
|
||||
*/
|
||||
public function addClasses($classes) {
|
||||
$this->classes += $classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getHeader() {
|
||||
return $this->header;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $header
|
||||
*/
|
||||
public function setHeader($header) {
|
||||
$this->header = $header;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSubNavigation() {
|
||||
return $this->subNavigation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $subNavigation
|
||||
*/
|
||||
public function setSubNavigation($subNavigation) {
|
||||
$this->subNavigation = $subNavigation;
|
||||
}
|
||||
|
||||
public function displayTopBar() {
|
||||
echo wp_kses($this->topBar, Sanitize::$adminTemplateTags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $topBar
|
||||
*/
|
||||
public function setTopBar($topBar) {
|
||||
$this->topBar = $topBar;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $content
|
||||
*/
|
||||
public function setContent($content) {
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
public function setAttribute($name, $value) {
|
||||
$this->attributes[$name] = $value;
|
||||
}
|
||||
|
||||
public function renderAttributes() {
|
||||
|
||||
echo wp_kses(Html::renderAttributes($this->attributes + array(
|
||||
'id' => $this->id,
|
||||
'class' => implode(' ', $this->classes)
|
||||
)), Sanitize::$adminTemplateTags);
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\AdminEditor;
|
||||
|
||||
use Nextend\Framework\Notification\Notification;
|
||||
use Nextend\Framework\Plugin;
|
||||
use Nextend\SmartSlider3\Settings;
|
||||
use Nextend\SmartSlider3\SmartSlider3Info;
|
||||
|
||||
/**
|
||||
* @var $this BlockAdminEditor
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<div <?php $this->renderAttributes(); ?>>
|
||||
|
||||
<?php $this->displayEditorOverlay(); ?>
|
||||
|
||||
<div class="n2_admin_editor__content">
|
||||
<div class="n2_admin_editor__content_inner" dir="ltr">
|
||||
|
||||
<?php $this->displayContent(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
Plugin::doAction('afterApplicationContent');
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
Notification::show();
|
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\AdminEditor;
|
||||
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\Framework\View\Html;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\EditorOverlay\BlockEditorOverlay;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\LayoutEditor;
|
||||
|
||||
class BlockAdminEditor extends AbstractBlock {
|
||||
|
||||
/**
|
||||
* @var LayoutEditor
|
||||
*/
|
||||
protected $layout;
|
||||
|
||||
|
||||
protected $id = 'n2-admin';
|
||||
|
||||
protected $classes = array(
|
||||
'n2',
|
||||
'n2_admin',
|
||||
'n2_admin_ui',
|
||||
'n2_admin_editor',
|
||||
'fitvidsignore'
|
||||
);
|
||||
|
||||
protected $attributes = array();
|
||||
|
||||
/**
|
||||
* @var BlockEditorOverlay
|
||||
*/
|
||||
protected $editorOverlay;
|
||||
|
||||
/**
|
||||
* @param LayoutEditor $layout
|
||||
*/
|
||||
public function setLayout($layout) {
|
||||
$this->layout = $layout;
|
||||
}
|
||||
|
||||
public function displayContent() {
|
||||
$this->layout->displayContent();
|
||||
}
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('AdminEditor');
|
||||
}
|
||||
|
||||
public function setAttribute($name, $value) {
|
||||
$this->attributes[$name] = $value;
|
||||
}
|
||||
|
||||
public function renderAttributes() {
|
||||
|
||||
echo wp_kses(Html::renderAttributes($this->attributes + array(
|
||||
'id' => $this->id,
|
||||
'class' => implode(' ', $this->classes)
|
||||
)), Sanitize::$adminTemplateTags);
|
||||
}
|
||||
|
||||
public function displayEditorOverlay() {
|
||||
$this->editorOverlay->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BlockEditorOverlay $editorOverlay
|
||||
*/
|
||||
public function setEditorOverlay($editorOverlay) {
|
||||
$this->editorOverlay = $editorOverlay;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\AdminEmpty;
|
||||
|
||||
use Nextend\SmartSlider3\Settings;
|
||||
|
||||
/**
|
||||
* @var $this BlockAdminEmpty
|
||||
*/
|
||||
?>
|
||||
<div <?php $this->renderAttributes(); ?>>
|
||||
<?php $this->displayContent(); ?>
|
||||
</div>
|
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\AdminEmpty;
|
||||
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\Framework\View\AbstractLayout;
|
||||
use Nextend\Framework\View\Html;
|
||||
|
||||
class BlockAdminEmpty extends AbstractBlock {
|
||||
|
||||
/**
|
||||
* @var AbstractLayout
|
||||
*/
|
||||
protected $layout;
|
||||
|
||||
protected $id = 'n2-admin';
|
||||
|
||||
protected $classes = array(
|
||||
'n2',
|
||||
'n2_admin',
|
||||
'n2_admin_ui',
|
||||
'n2_admin--empty',
|
||||
'fitvidsignore'
|
||||
);
|
||||
|
||||
protected $attributes = array();
|
||||
|
||||
/**
|
||||
* @param AbstractLayout $layout
|
||||
*/
|
||||
public function setLayout($layout) {
|
||||
$this->layout = $layout;
|
||||
}
|
||||
|
||||
public function displayContent() {
|
||||
$this->layout->displayContent();
|
||||
}
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('AdminEmpty');
|
||||
}
|
||||
|
||||
public function renderAttributes() {
|
||||
|
||||
echo wp_kses(Html::renderAttributes($this->attributes + array(
|
||||
'id' => $this->id,
|
||||
'class' => implode(' ', $this->classes)
|
||||
)), Sanitize::$adminTemplateTags);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\AdminError;
|
||||
|
||||
/**
|
||||
* @var $this BlockAdminError
|
||||
*/
|
||||
?>
|
||||
<div style="margin: 20px;width: 500px;border: 2px solid #1D81F9;background-color: #FFFFFF;border-radius: 5px;padding: 40px 50px;">
|
||||
<div style="font-size: 18px;line-height: 28px;font-weight: bold;color: #283F4D;">
|
||||
<?php
|
||||
echo esc_html($this->getTitle());
|
||||
?>
|
||||
</div>
|
||||
<div style="font-size: 14px;line-height: 24px;color: #325C77;">
|
||||
<?php
|
||||
echo esc_html($this->getContent());
|
||||
?>
|
||||
</div>
|
||||
<?php if ($this->hasUrl()): ?>
|
||||
<div style="margin-top: 10px;">
|
||||
<a href="<?php echo esc_url($this->getUrl()); ?>" target="_blank" style="font-size: 14px;line-height: 24px;color: #1375E9;text-decoration: none;text-transform: capitalize"><?php n2_e('Read more'); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\AdminError;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\Framework\View\AbstractLayout;
|
||||
|
||||
class BlockAdminError extends AbstractBlock {
|
||||
|
||||
/**
|
||||
* @var AbstractLayout
|
||||
*/
|
||||
protected $layout;
|
||||
|
||||
protected $title, $content, $url = '';
|
||||
|
||||
|
||||
/**
|
||||
* @param AbstractLayout $layout
|
||||
*/
|
||||
public function setLayout($layout) {
|
||||
$this->layout = $layout;
|
||||
}
|
||||
|
||||
public function setError($title, $content, $url = '') {
|
||||
$this->title = $title;
|
||||
$this->content = $content;
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
public function displayContent() {
|
||||
$this->layout->displayContent();
|
||||
}
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('AdminError');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle() {
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getContent() {
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasUrl() {
|
||||
return !empty($this->url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl() {
|
||||
return $this->url;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\AdminIframe;
|
||||
|
||||
|
||||
use Nextend\SmartSlider3\Settings;
|
||||
|
||||
/**
|
||||
* @var $this BlockAdminIframe
|
||||
*/
|
||||
?>
|
||||
<div <?php $this->renderAttributes(); ?>>
|
||||
<div class="n2_iframe_application__nav_bar">
|
||||
<div class="n2_iframe_application__nav_bar_label">
|
||||
<?php echo esc_html($this->getLabel()); ?>
|
||||
</div>
|
||||
<div class="n2_iframe_application__nav_bar_actions">
|
||||
<?php
|
||||
foreach ($this->getActions() as $action) {
|
||||
$action->display();
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="n2_iframe_application__content">
|
||||
<?php $this->displayContent(); ?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\AdminIframe;
|
||||
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\Framework\View\AbstractLayout;
|
||||
use Nextend\Framework\View\Html;
|
||||
|
||||
class BlockAdminIframe extends AbstractBlock {
|
||||
|
||||
/**
|
||||
* @var AbstractLayout
|
||||
*/
|
||||
protected $layout;
|
||||
|
||||
protected $id = 'n2-admin';
|
||||
|
||||
protected $classes = array(
|
||||
'n2',
|
||||
'n2_admin',
|
||||
'n2_admin_ui',
|
||||
'n2_iframe_application',
|
||||
'fitvidsignore'
|
||||
);
|
||||
|
||||
protected $attributes = array();
|
||||
|
||||
protected $label = '';
|
||||
|
||||
/**
|
||||
* @var AbstractBlock[]
|
||||
*/
|
||||
protected $actions = array();
|
||||
|
||||
/**
|
||||
* @param AbstractLayout $layout
|
||||
*/
|
||||
public function setLayout($layout) {
|
||||
$this->layout = $layout;
|
||||
}
|
||||
|
||||
public function displayContent() {
|
||||
$this->layout->displayContent();
|
||||
}
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('AdminIframe');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLabel() {
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $label
|
||||
*/
|
||||
public function setLabel($label) {
|
||||
$this->label = $label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AbstractBlock[]
|
||||
*/
|
||||
public function getActions() {
|
||||
return $this->actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AbstractBlock[] $actions
|
||||
*/
|
||||
public function setActions($actions) {
|
||||
$this->actions = $actions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getClass() {
|
||||
|
||||
$this->classes = array_unique($this->classes);
|
||||
|
||||
return implode(' ', $this->classes);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classes
|
||||
*/
|
||||
public function addClasses($classes) {
|
||||
$this->classes += $classes;
|
||||
}
|
||||
|
||||
public function setAttribute($name, $value) {
|
||||
$this->attributes[$name] = $value;
|
||||
}
|
||||
|
||||
public function renderAttributes() {
|
||||
|
||||
echo wp_kses(Html::renderAttributes($this->attributes + array(
|
||||
'id' => $this->id,
|
||||
'class' => implode(' ', $this->classes)
|
||||
)), Sanitize::$adminTemplateTags);
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\Banner;
|
||||
|
||||
/**
|
||||
* @var $this BlockBanner
|
||||
*/
|
||||
|
||||
$closeUrl = $this->getCloseUrl();
|
||||
?>
|
||||
|
||||
<div id="<?php echo esc_attr($this->getID()); ?>" class="n2_admin__banner">
|
||||
<div class="n2_admin__banner_inner">
|
||||
<img src="<?php echo esc_url($this->getImage()); ?>" alt="">
|
||||
<div class="n2_admin__banner_inner_title"><?php echo esc_attr($this->getTitle()); ?></div>
|
||||
<div class="n2_admin__banner_inner_description"><?php echo esc_attr($this->getDescription()); ?></div>
|
||||
<a class="n2_admin__banner_inner_button n2_button n2_button--big n2_button--green"
|
||||
href="<?php echo esc_url($this->getButtonHref()); ?>"
|
||||
onclick="<?php echo esc_js($this->getButtonOnclick()); ?>"
|
||||
target="_blank">
|
||||
<?php echo esc_html($this->getButtonTitle()); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php if (!empty($closeUrl)): ?>
|
||||
<div class="n2_admin__banner_close">
|
||||
<i class="ssi_16 ssi_16--remove"></i>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
_N2.r(['$', 'documentReady'], function () {
|
||||
var $ = _N2.$;
|
||||
var $banner = $('#<?php echo esc_html($this->getID()); ?>');
|
||||
|
||||
$banner.find('.n2_admin__banner_close').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
_N2.AjaxHelper.ajax({url: <?php echo json_encode(esc_url($closeUrl)); ?>});
|
||||
$banner.remove();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
</div>
|
@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\Banner;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockBanner extends AbstractBlock {
|
||||
|
||||
protected $id = '';
|
||||
|
||||
protected $image = 'ssi_64 ssi_64--dummy';
|
||||
|
||||
protected $title = '';
|
||||
|
||||
protected $description = '';
|
||||
|
||||
protected $buttonTitle = '';
|
||||
|
||||
protected $buttonHref = '#';
|
||||
|
||||
protected $buttonOnclick = '';
|
||||
|
||||
protected $closeUrl = '';
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('Banner');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getID() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
*/
|
||||
public function setID($id) {
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getImage() {
|
||||
return $this->image;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $image
|
||||
*/
|
||||
public function setImage($image) {
|
||||
$this->image = $image;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle() {
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $title
|
||||
*/
|
||||
public function setTitle($title) {
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription() {
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $description
|
||||
*/
|
||||
public function setDescription($description) {
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCloseUrl() {
|
||||
return $this->closeUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $closeUrl
|
||||
*/
|
||||
public function setCloseUrl($closeUrl) {
|
||||
$this->closeUrl = $closeUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getButtonTitle() {
|
||||
return $this->buttonTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getButtonHref() {
|
||||
return $this->buttonHref;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getButtonOnclick() {
|
||||
return $this->buttonOnclick;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $button
|
||||
*/
|
||||
public function setButton($button) {
|
||||
$this->buttonTitle = $button['title'];
|
||||
if (isset($button['href'])) {
|
||||
$this->buttonHref = $button['href'];
|
||||
}
|
||||
if (isset($button['onclick'])) {
|
||||
$this->buttonOnclick = $button['onclick'];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\Banner;
|
||||
|
||||
|
||||
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
|
||||
|
||||
class BlockBannerActivate extends BlockBanner {
|
||||
|
||||
protected function init() {
|
||||
$this->setID('n2-ss-activate-license-banner');
|
||||
$this->setImage(ResourceTranslator::toUrl('$ss3-admin$/images/activate.svg'));
|
||||
$this->setTitle(n2_('Activate Smart Slider 3 Pro'));
|
||||
$this->setDescription(n2_('Activation is required to unlock all features!') . ' ' . n2_('Register Smart Slider 3 Pro on this domain to enable auto update, slider templates and slide library.'));
|
||||
$this->setButton(array(
|
||||
'title' => n2_('Activate'),
|
||||
'onclick' => '_N2.License.get().startActivation();return false;'
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\BlockBreadCrumb;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Helper\Breadcrumb;
|
||||
|
||||
class BlockBreadCrumb extends AbstractBlock {
|
||||
|
||||
/**
|
||||
* @var Breadcrumb[]
|
||||
*/
|
||||
protected $breadCrumbs = array();
|
||||
|
||||
public function display() {
|
||||
$this->renderTemplatePart('BreadCrumb');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Breadcrumb[]
|
||||
*/
|
||||
public function getBreadCrumbs() {
|
||||
|
||||
/**
|
||||
* If there is no activate item in the menu or in the breadcrumb, mark the last breadcrumb as active.
|
||||
*/
|
||||
if (!$this->hasActiveItem()) {
|
||||
$this->breadCrumbs[count($this->breadCrumbs) - 1]->setIsActive(true);
|
||||
}
|
||||
|
||||
return $this->breadCrumbs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $label
|
||||
* @param $icon
|
||||
* @param string $url
|
||||
*
|
||||
* @return Breadcrumb
|
||||
*/
|
||||
public function addBreadcrumb($label, $icon, $url = '#') {
|
||||
|
||||
$breadCrumb = new Breadcrumb($label, $icon, $url);
|
||||
$this->breadCrumbs[] = $breadCrumb;
|
||||
|
||||
return $breadCrumb;
|
||||
}
|
||||
|
||||
private function hasActiveItem() {
|
||||
|
||||
foreach ($this->breadCrumbs as $breadCrumb) {
|
||||
if ($breadCrumb->isActive()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\BlockBreadCrumb;
|
||||
|
||||
/**
|
||||
* @var $this BlockBreadCrumb
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="n2_breadcrumbs">
|
||||
<?php
|
||||
$breadcrumbs = $this->getBreadCrumbs();
|
||||
$length = count($breadcrumbs);
|
||||
foreach ($breadcrumbs as $i => $breadcrumb):
|
||||
?>
|
||||
<div class="n2_breadcrumbs__breadcrumb<?php echo $breadcrumb->isActive() ? ' n2_breadcrumbs__breadcrumb--active' : ''; ?>"><?php $breadcrumb->display(); ?></div>
|
||||
<?php
|
||||
if ($i < $length - 1):
|
||||
?>
|
||||
<div class="n2_breadcrumbs__arrow"><i class="ssi_16 ssi_16--breadcrumb"></i></div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\ContentSidebar;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockContentSidebar extends AbstractBlock {
|
||||
|
||||
protected $sidebar = '';
|
||||
|
||||
protected $content = '';
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('ContentSidebar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSidebar() {
|
||||
return $this->sidebar;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sidebar
|
||||
*/
|
||||
public function setSidebar($sidebar) {
|
||||
$this->sidebar = $sidebar;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getContent() {
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $content
|
||||
*/
|
||||
public function setContent($content) {
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\ContentSidebar;
|
||||
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
|
||||
/**
|
||||
* @var $this BlockContentSidebar
|
||||
*/
|
||||
?>
|
||||
<div class="n2-admin-content-with-sidebar">
|
||||
<div class="n2-admin-content-with-sidebar__sidebar">
|
||||
<?php
|
||||
echo wp_kses($this->getSidebar(), Sanitize::$adminTemplateTags);
|
||||
?>
|
||||
</div>
|
||||
<div class="n2-admin-content-with-sidebar__content">
|
||||
<?php
|
||||
echo wp_kses($this->getContent(), Sanitize::$adminTemplateTags);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\FreeNeedMore;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockFreeNeedMore extends AbstractBlock {
|
||||
|
||||
protected $source;
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('FreeNeedMore');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSource() {
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $source
|
||||
*/
|
||||
public function setSource($source) {
|
||||
$this->source = $source;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\FreeNeedMore;
|
||||
|
||||
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
|
||||
use Nextend\SmartSlider3\SmartSlider3Info;
|
||||
|
||||
/**
|
||||
* @var $this BlockFreeNeedMore
|
||||
*/
|
||||
?>
|
||||
<div class="n2_free_need_more">
|
||||
<div class="n2_free_need_more__logo">
|
||||
<img src="<?php echo esc_url(ResourceTranslator::toUrl('$ss3-admin$/images/logo-filled.svg')); ?>" alt="logo">
|
||||
</div>
|
||||
<div class="n2_free_need_more__title">
|
||||
<?php n2_e('Need more?'); ?>
|
||||
</div>
|
||||
<div class="n2_free_need_more__paragraph">
|
||||
<?php n2_e('Unlock all the pro features by upgrading to Smart Slider 3 Pro.'); ?>
|
||||
</div>
|
||||
<a href="<?php echo esc_url(SmartSlider3Info::decorateExternalUrl('https://smartslider3.com/pricing/', array('utm_source' => $this->getSource()))); ?>" target="_blank" class="n2_free_need_more__button">
|
||||
<?php n2_e('Go Pro'); ?>
|
||||
</a>
|
||||
</div>
|
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\Header;
|
||||
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockHeader extends AbstractBlock {
|
||||
|
||||
protected $heading = '';
|
||||
|
||||
protected $headingAfter = '';
|
||||
|
||||
protected $actions = array();
|
||||
|
||||
/**
|
||||
* @var MenuItem[]
|
||||
*/
|
||||
protected $menuItems = array();
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('Header');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getHeading() {
|
||||
return $this->heading;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $heading
|
||||
*/
|
||||
public function setHeading($heading) {
|
||||
$this->heading = Sanitize::esc_html($heading);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getHeadingAfter() {
|
||||
return $this->headingAfter;
|
||||
}
|
||||
|
||||
public function hasHeadingAfter() {
|
||||
return !empty($this->headingAfter);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $headingAfter
|
||||
*/
|
||||
public function setHeadingAfter($headingAfter) {
|
||||
$this->headingAfter = $headingAfter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getActions() {
|
||||
return $this->actions;
|
||||
}
|
||||
|
||||
public function hasActions() {
|
||||
return !empty($this->actions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $action
|
||||
*/
|
||||
public function addAction($action) {
|
||||
$this->actions[] = $action;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return MenuItem[]
|
||||
*/
|
||||
public function getMenuItems() {
|
||||
return $this->menuItems;
|
||||
}
|
||||
|
||||
public function hasMenuItems() {
|
||||
return !empty($this->menuItems);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param MenuItem $menuItem
|
||||
*/
|
||||
public function addMenuItem($menuItem) {
|
||||
$this->menuItems[] = $menuItem;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\Header;
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
|
||||
/**
|
||||
* @var $this BlockHeader
|
||||
*/
|
||||
?>
|
||||
<div class="n2_header<?php echo $this->hasMenuItems() ? ' n2_header--has-menu-items' : ''; ?>">
|
||||
<div class="n2_header__content">
|
||||
<div class="n2_header__heading_container">
|
||||
<div class="n2_header__heading">
|
||||
<div class="n2_header__heading_primary">
|
||||
<?php
|
||||
echo esc_html($this->getHeading());
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if ($this->hasHeadingAfter()):
|
||||
?>
|
||||
<div class="n2_header__heading_after">
|
||||
<?php
|
||||
echo esc_html($this->getHeadingAfter());
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if ($this->hasActions()):
|
||||
?>
|
||||
<div class="n2_header__actions">
|
||||
<?php
|
||||
echo wp_kses(implode('', $this->getActions()), Sanitize::$adminTemplateTags);
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if ($this->hasMenuItems()):
|
||||
?>
|
||||
<div class="n2_header__menu">
|
||||
<?php
|
||||
foreach ($this->getMenuItems() as $menuItem) {
|
||||
$menuItem->display();
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\Header;
|
||||
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\Framework\View\Html;
|
||||
|
||||
class MenuItem {
|
||||
|
||||
protected $isActive = false;
|
||||
|
||||
protected $label = '';
|
||||
|
||||
protected $url = '#';
|
||||
|
||||
protected $classes = array(
|
||||
'n2_header__menu_item'
|
||||
);
|
||||
|
||||
protected $attributes = array();
|
||||
|
||||
public function __construct($label) {
|
||||
$this->label = $label;
|
||||
}
|
||||
|
||||
public function getHtml() {
|
||||
$attributes = $this->attributes;
|
||||
|
||||
if ($this->isActive) {
|
||||
$this->classes[] = 'n2_header__menu_item--active';
|
||||
}
|
||||
|
||||
if (!empty($this->classes)) {
|
||||
$attributes['class'] = implode(' ', array_unique($this->classes));
|
||||
}
|
||||
|
||||
return Html::link($this->label, $this->url, $attributes);
|
||||
}
|
||||
|
||||
public function display() {
|
||||
echo wp_kses($this->getHtml(), Sanitize::$adminTemplateTags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isActive() {
|
||||
return $this->isActive;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $isActive
|
||||
*/
|
||||
public function setActive($isActive) {
|
||||
$this->isActive = $isActive;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLabel() {
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $label
|
||||
*/
|
||||
public function setLabel($label) {
|
||||
$this->label = $label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl() {
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
public function addClass($className) {
|
||||
$this->classes[] = $className;
|
||||
}
|
||||
|
||||
public function setAttribute($name, $value) {
|
||||
$this->attributes[$name] = $value;
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\NavBar;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\BlockBreadCrumb\BlockBreadCrumb;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Helper\Breadcrumb;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Helper\MenuItem;
|
||||
|
||||
class BlockNavBar extends AbstractBlock {
|
||||
|
||||
protected $sidebarLink = '';
|
||||
|
||||
protected $logo = '';
|
||||
|
||||
/**
|
||||
* @var MenuItem[]
|
||||
*/
|
||||
protected $menuItems = array();
|
||||
|
||||
/**
|
||||
* @var BlockBreadCrumb
|
||||
*/
|
||||
protected $blockBreadCrumb;
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('NavBar');
|
||||
}
|
||||
|
||||
protected function init() {
|
||||
$this->blockBreadCrumb = new BlockBreadCrumb($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSidebarLink() {
|
||||
return $this->sidebarLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sidebarLink
|
||||
*/
|
||||
public function setSidebarLink($sidebarLink) {
|
||||
$this->sidebarLink = $sidebarLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLogo() {
|
||||
return $this->logo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $logo
|
||||
*/
|
||||
public function setLogo($logo) {
|
||||
$this->logo = $logo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return MenuItem[]
|
||||
*/
|
||||
public function getMenuItems() {
|
||||
return $this->menuItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $menuItem
|
||||
* @param bool $isActive
|
||||
*/
|
||||
public function addMenuItem($menuItem, $isActive = false) {
|
||||
$this->menuItems[] = new MenuItem($menuItem, $isActive);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $label
|
||||
* @param $icon
|
||||
* @param string $url
|
||||
*
|
||||
* @return Breadcrumb
|
||||
*/
|
||||
public function addBreadcrumb($label, $icon, $url = '#') {
|
||||
|
||||
return $this->blockBreadCrumb->addBreadcrumb($label, $icon, $url);
|
||||
}
|
||||
|
||||
public function displayBreadCrumbs() {
|
||||
$this->blockBreadCrumb->display();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\NavBar;
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
|
||||
/**
|
||||
* @var $this BlockNavBar
|
||||
*/
|
||||
?>
|
||||
<div class="n2_nav_bar">
|
||||
|
||||
<?php $this->displayBreadCrumbs(); ?>
|
||||
|
||||
<div class="n2_nav_bar__logo">
|
||||
<a href="<?php echo esc_url($this->getSidebarLink()); ?>" tabindex="-1">
|
||||
<?php echo wp_kses($this->getLogo(), Sanitize::$adminTemplateTags); ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="n2_nav_bar__menu">
|
||||
<?php
|
||||
foreach ($this->getMenuItems() as $menuItem):
|
||||
?>
|
||||
<div class="n2_nav_bar__menuitem<?php echo $menuItem->isActive() ? ' n2_nav_bar__menuitem--active' : ''; ?>"><?php $menuItem->display(); ?></div>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\TopBarGroup;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockTopBarGroup extends AbstractBlock {
|
||||
|
||||
/**
|
||||
* @var AbstractBlock[]
|
||||
*/
|
||||
protected $blocks = array();
|
||||
|
||||
protected $classes = array('n2_top_bar_group');
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('TopBarGroup');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AbstractBlock $block
|
||||
*/
|
||||
public function addBlock($block) {
|
||||
$this->blocks[] = $block;
|
||||
}
|
||||
|
||||
public function displayBlocks() {
|
||||
|
||||
foreach ($this->blocks as $block) {
|
||||
$block->display();
|
||||
}
|
||||
}
|
||||
|
||||
public function setNarrow() {
|
||||
$this->classes[] = 'n2_top_bar_group--narrow';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getClasses() {
|
||||
return $this->classes;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\TopBarGroup;
|
||||
|
||||
/**
|
||||
* @var $this BlockTopBarGroup
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_html(implode(' ', $this->getClasses())); ?>">
|
||||
<div class="n2_top_bar_group__inner">
|
||||
<?php
|
||||
$this->displayBlocks();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\TopBarMain;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockTopBarMain extends AbstractBlock {
|
||||
|
||||
private static $idCounter = 1;
|
||||
|
||||
protected $id = 0;
|
||||
|
||||
/**
|
||||
* @var AbstractBlock[]
|
||||
*/
|
||||
protected $primaryBlocks = array();
|
||||
|
||||
/**
|
||||
* @var AbstractBlock[]
|
||||
*/
|
||||
protected $secondaryBlocks = array();
|
||||
|
||||
protected $content = '';
|
||||
|
||||
protected function init() {
|
||||
$this->id = self::$idCounter++;
|
||||
parent::init();
|
||||
}
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('TopBarMain');
|
||||
}
|
||||
|
||||
public function addPrimaryBlock($block) {
|
||||
$this->primaryBlocks[] = $block;
|
||||
}
|
||||
|
||||
public function displayPrimary() {
|
||||
|
||||
foreach ($this->primaryBlocks as $block) {
|
||||
$block->display();
|
||||
}
|
||||
}
|
||||
|
||||
public function addSecondaryBlock($block) {
|
||||
$this->secondaryBlocks[] = $block;
|
||||
}
|
||||
|
||||
public function displaySecondary() {
|
||||
|
||||
foreach ($this->secondaryBlocks as $block) {
|
||||
$block->display();
|
||||
}
|
||||
}
|
||||
|
||||
public function getID() {
|
||||
return 'n2_top_bar_main_' . $this->id;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\TopBarMain;
|
||||
|
||||
/**
|
||||
* @var $this BlockTopBarMain
|
||||
*/
|
||||
?>
|
||||
<script>
|
||||
_N2.r(['$', 'documentReady'], function () {
|
||||
var $ = _N2.$;
|
||||
$('#<?php echo esc_html($this->getID()); ?>').css('top', _N2.Window.getTopOffset() + 'px');
|
||||
});
|
||||
</script>
|
||||
<div id="<?php echo esc_html($this->getID()); ?>" class="n2_admin__top_bar n2_top_bar_main">
|
||||
<div class="n2_top_bar_main__primary">
|
||||
<?php
|
||||
$this->displayPrimary();
|
||||
?>
|
||||
</div>
|
||||
<div class="n2_top_bar_main__secondary">
|
||||
<?php
|
||||
$this->displaySecondary();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\TopBarMain\TopBarMainEditor;
|
||||
|
||||
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\TopBarMain\BlockTopBarMain;
|
||||
use Nextend\SmartSlider3\Application\Admin\TraitAdminUrl;
|
||||
|
||||
class BlockTopBarMainEditor extends BlockTopBarMain {
|
||||
|
||||
use TraitAdminUrl;
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('TopBarMainEditor');
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\TopBarMain\TopBarMainEditor;
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
|
||||
/**
|
||||
* @var $this BlockTopBarMainEditor
|
||||
*/
|
||||
?>
|
||||
<div id="<?php echo esc_attr($this->getID()); ?>" class="n2_admin__top_bar n2_top_bar_main n2_admin_editor_overlay__top_bar_main">
|
||||
<div class="n2_top_bar_main__primary">
|
||||
<?php
|
||||
$this->displayPrimary();
|
||||
?>
|
||||
</div>
|
||||
<div class="n2_top_bar_main__logo">
|
||||
<a href="<?php echo esc_url($this->getUrlDashboard()); ?>">
|
||||
<?php echo wp_kses($this->getApplicationType()
|
||||
->getLogo(), Sanitize::$adminTemplateTags); ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="n2_top_bar_main__secondary">
|
||||
<?php
|
||||
$this->displaySecondary();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardInfo;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\TraitAdminUrl;
|
||||
|
||||
class BlockDashboardInfo extends AbstractBlock {
|
||||
|
||||
use TraitAdminUrl;
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('DashboardInfo');
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardInfo;
|
||||
|
||||
use Nextend\Framework\Asset\Js\Js;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonDashboardInfo;
|
||||
use Nextend\SmartSlider3\SmartSlider3Info;
|
||||
|
||||
/**
|
||||
* @var $this BlockDashboardInfo
|
||||
*/
|
||||
|
||||
Js::addInline('new _N2.DashboardInfo();');
|
||||
?>
|
||||
|
||||
<div class="n2_dashboard_info">
|
||||
<?php
|
||||
$info = new BlockButtonDashboardInfo($this);
|
||||
$info->display();
|
||||
?>
|
||||
<div class="n2_dashboard_info__content">
|
||||
|
||||
<div class="n2_dashboard_info__row_icon n2_dashboard_info__row_icon_version">
|
||||
<i class="ssi_24 ssi_24--circularinfo"></i>
|
||||
</div>
|
||||
|
||||
<div class="n2_dashboard_info__row_content n2_dashboard_info__row_content_version">
|
||||
Smart Slider
|
||||
<?php
|
||||
echo esc_html(SmartSlider3Info::$version . '-' . SmartSlider3Info::$plan);
|
||||
?>
|
||||
</div>
|
||||
<div class="n2_dashboard_info__row_action n2_dashboard_info__row_action_version">
|
||||
<a target="_blank" href="https://smartslider.helpscoutdocs.com/article/1746-changelog"><?php n2_e('Changelog') ?></a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$this->getRouter()
|
||||
->setMultiSite();
|
||||
$checkForUpdateUrl = $this->getUrlUpdateDownload();
|
||||
$this->getRouter()
|
||||
->unSetMultiSite();
|
||||
?>
|
||||
<div class="n2_dashboard_info__row_icon n2_dashboard_info__row_icon_check_update">
|
||||
<i class="ssi_24 ssi_24--refresh"></i>
|
||||
</div>
|
||||
|
||||
<div class="n2_dashboard_info__row_content n2_dashboard_info__row_content_check_update">
|
||||
<?php n2_e('Check for update'); ?>
|
||||
</div>
|
||||
<div class="n2_dashboard_info__row_action n2_dashboard_info__row_action_check_update">
|
||||
<a target="_blank" href="<?php echo esc_url($checkForUpdateUrl); ?>"><?php n2_e('Check') ?></a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardManager;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockDashboardManager extends AbstractBlock {
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('DashboardManager');
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardManager\Boxes;
|
||||
|
||||
|
||||
use Nextend\Framework\Model\StorageSectionManager;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockDashboardNewsletter extends AbstractBlock {
|
||||
|
||||
|
||||
public function display() {
|
||||
$storage = StorageSectionManager::getStorage('smartslider');
|
||||
|
||||
if (!$storage->get('free', 'subscribeOnImport') && !$storage->get('free', 'dismissNewsletterDashboard')) {
|
||||
$this->renderTemplatePart('DashboardNewsletter');
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardManager\Boxes;
|
||||
|
||||
|
||||
use Nextend\Framework\Model\StorageSectionManager;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Model\ModelSliders;
|
||||
|
||||
class BlockDashboardReview extends AbstractBlock {
|
||||
|
||||
|
||||
public function display() {
|
||||
if (!StorageSectionManager::getStorage('smartslider')
|
||||
->get('free', 'rated')) {
|
||||
|
||||
$modelSliders = new ModelSliders($this);
|
||||
if ($modelSliders->getSlidersCount() >= 3) {
|
||||
$this->renderTemplatePart('DashboardReview');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardManager\Boxes;
|
||||
|
||||
|
||||
use Nextend\Framework\Model\StorageSectionManager;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockDashboardUpgradePro extends AbstractBlock {
|
||||
|
||||
protected $hasDismiss = false;
|
||||
|
||||
protected $source = 'dashboard-why-upgrade';
|
||||
|
||||
public function display() {
|
||||
if (!StorageSectionManager::getStorage('smartslider')
|
||||
->get('free', 'upgrade-pro')) {
|
||||
$this->renderTemplatePart('DashboardUpgradePro');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasDismiss() {
|
||||
return $this->hasDismiss;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $hasDismiss
|
||||
*/
|
||||
public function setHasDismiss($hasDismiss) {
|
||||
$this->hasDismiss = $hasDismiss;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSource() {
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $source
|
||||
*/
|
||||
public function setSource($source) {
|
||||
$this->source = $source;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardManager\Boxes;
|
||||
|
||||
use Nextend\Framework\Platform\Platform;
|
||||
|
||||
/**
|
||||
* @var BlockDashboardNewsletter $this
|
||||
*/
|
||||
?>
|
||||
<div class="n2_dashboard_manager_newsletter">
|
||||
|
||||
<div class="n2_dashboard_manager_newsletter__logo">
|
||||
<i class="ssi_48 ssi_48--newsletter"></i>
|
||||
</div>
|
||||
|
||||
<div class="n2_dashboard_manager_newsletter__heading">
|
||||
<?php n2_e('Don’t miss any update'); ?>
|
||||
</div>
|
||||
|
||||
<div class="n2_dashboard_newsletter__paragraph">
|
||||
<?php n2_e('Join more than 120,000 subscribers and get access to the latest slider templates, tips, tutorials and other exclusive contents directly to your inbox.'); ?>
|
||||
</div>
|
||||
|
||||
<form class="n2_dashboard_newsletter__form">
|
||||
<input type="hidden" name="<?php echo esc_attr(strtoupper(Platform::getName())); ?>" value="Yes">
|
||||
<input type="hidden" name="SOURCE" value="Smart Slider 3">
|
||||
<input type="email" name="EMAIL" value="<?php echo esc_attr(Platform::getUserEmail()); ?>" placeholder="Email" tabindex="-1">
|
||||
</form>
|
||||
|
||||
<div class="n2_dashboard_manager_newsletter__button">
|
||||
<?php n2_e('Subscribe'); ?>
|
||||
</div>
|
||||
|
||||
<div class="n2_dashboard_manager_newsletter__close">
|
||||
<i class="ssi_16 ssi_16--remove"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
_N2.r(['$', 'documentReady'], function () {
|
||||
var $ = _N2.$;
|
||||
var $box = $('.n2_dashboard_manager_newsletter'),
|
||||
close = function (e, action) {
|
||||
_N2.AjaxHelper
|
||||
.ajax({
|
||||
type: "POST",
|
||||
url: _N2.AjaxHelper.makeAjaxUrl(_N2.AjaxHelper.getAdminUrl('ss3-admin'), {
|
||||
nextendcontroller: 'settings',
|
||||
nextendaction: action || 'dismissNewsletterDashboard'
|
||||
}),
|
||||
dataType: 'json'
|
||||
});
|
||||
|
||||
$box.remove();
|
||||
},
|
||||
$form = $('.n2_dashboard_newsletter__form')
|
||||
.on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
_N2.AjaxHelper
|
||||
.ajax({
|
||||
type: "POST",
|
||||
url: "https://secure.nextendweb.com/mailchimp/subscribe.php",
|
||||
data: $form.serialize(),
|
||||
dataType: 'json'
|
||||
})
|
||||
.done(function () {
|
||||
});
|
||||
|
||||
close(e, 'subscribed');
|
||||
});
|
||||
|
||||
$('.n2_dashboard_manager_newsletter__button')
|
||||
.on('click', function () {
|
||||
$form.trigger("submit");
|
||||
});
|
||||
|
||||
$box.find('.n2_dashboard_manager_newsletter__close')
|
||||
.on('click', close);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardManager\Boxes;
|
||||
|
||||
use Nextend\Framework\Platform\Platform;
|
||||
use Nextend\SmartSlider3\SmartSlider3Info;
|
||||
|
||||
/**
|
||||
* @var BlockDashboardReview $this
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="n2_dashboard_manager_review" data-star="0">
|
||||
|
||||
<div class="n2_dashboard_manager_review__logo">
|
||||
<i class="ssi_48 ssi_48--review0"></i>
|
||||
<i class="ssi_48 ssi_48--review1"></i>
|
||||
<i class="ssi_48 ssi_48--review2"></i>
|
||||
<i class="ssi_48 ssi_48--review3"></i>
|
||||
<i class="ssi_48 ssi_48--review4"></i>
|
||||
<i class="ssi_48 ssi_48--review5"></i>
|
||||
</div>
|
||||
|
||||
<div class="n2_dashboard_manager_review__heading">
|
||||
<?php n2_e('Let us know how we\'re doing'); ?>
|
||||
</div>
|
||||
|
||||
<div class="n2_dashboard_manager_review__paragraph">
|
||||
<?php n2_e('If you are happy with Smart Slider 3 and can take a minute please leave a review. This will help to spread its popularity and to make this plugin a better one.'); ?>
|
||||
</div>
|
||||
|
||||
<div class="n2_dashboard_manager_review__star_selector">
|
||||
|
||||
<div class="n2_dashboard_manager_review__star" data-star="1" data-href="<?php echo esc_url('https://smartslider3.com/suggestion/?utm_campaign=' . SmartSlider3Info::$campaign . '&utm_source=dashboard-review-1&utm_medium=smartslider-' . Platform::getName() . '-' . SmartSlider3Info::$plan); ?>">
|
||||
<i class="ssi_24 ssi_24--star"></i>
|
||||
</div>
|
||||
<div class="n2_dashboard_manager_review__star" data-star="2" data-href="<?php echo esc_url('https://smartslider3.com/suggestion/?utm_campaign=' . SmartSlider3Info::$campaign . '&utm_source=dashboard-review-2&utm_medium=smartslider-' . Platform::getName() . '-' . SmartSlider3Info::$plan); ?>">
|
||||
<i class="ssi_24 ssi_24--star"></i>
|
||||
</div>
|
||||
<div class="n2_dashboard_manager_review__star" data-star="3" data-href="<?php echo esc_url('https://smartslider3.com/satisfied-customer/?utm_campaign=' . SmartSlider3Info::$campaign . '&utm_source=dashboard-review-3&utm_medium=smartslider-' . Platform::getName() . '-' . SmartSlider3Info::$plan); ?>">
|
||||
<i class="ssi_24 ssi_24--star"></i>
|
||||
</div>
|
||||
<div class="n2_dashboard_manager_review__star" data-star="4" data-href="<?php echo esc_url('https://smartslider3.com/satisfied-customer/?utm_campaign=' . SmartSlider3Info::$campaign . '&utm_source=dashboard-review-4&utm_medium=smartslider-' . Platform::getName() . '-' . SmartSlider3Info::$plan); ?>">
|
||||
<i class="ssi_24 ssi_24--star"></i>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$reviewUrl = 'https://smartslider3.com/redirect/wordpress-review.html?utm_campaign=' . SmartSlider3Info::$campaign . '&utm_source=dashboard-review-5&utm_medium=smartslider-' . Platform::getName() . '-' . SmartSlider3Info::$plan;
|
||||
?>
|
||||
<div class="n2_dashboard_manager_review__star" data-star="5" data-href="<?php echo esc_url($reviewUrl); ?>">
|
||||
<i class="ssi_24 ssi_24--star"></i></div>
|
||||
|
||||
</div>
|
||||
<div class="n2_dashboard_manager_review__label" data-star="0"><?php n2_e('Rate your experience'); ?></div>
|
||||
<div class="n2_dashboard_manager_review__label" data-star="1"><?php n2_e('Hated it'); ?></div>
|
||||
<div class="n2_dashboard_manager_review__label" data-star="2"><?php n2_e('Disliked it'); ?></div>
|
||||
<div class="n2_dashboard_manager_review__label" data-star="3"><?php n2_e('It was ok'); ?></div>
|
||||
<div class="n2_dashboard_manager_review__label" data-star="4"><?php n2_e('Liked it'); ?></div>
|
||||
<div class="n2_dashboard_manager_review__label" data-star="5"><?php n2_e('Loved it'); ?></div>
|
||||
|
||||
<div class="n2_dashboard_manager_review__close">
|
||||
<i class="ssi_16 ssi_16--remove"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
_N2.r(['$', 'documentReady'], function () {
|
||||
var $ = _N2.$;
|
||||
var $box = $('.n2_dashboard_manager_review'),
|
||||
close = function () {
|
||||
_N2.AjaxHelper
|
||||
.ajax({
|
||||
type: "POST",
|
||||
url: _N2.AjaxHelper.makeAjaxUrl(_N2.AjaxHelper.getAdminUrl('ss3-admin'), {
|
||||
nextendcontroller: 'settings',
|
||||
nextendaction: 'rated'
|
||||
}),
|
||||
dataType: 'json'
|
||||
});
|
||||
|
||||
$box.remove();
|
||||
};
|
||||
|
||||
$('.n2_dashboard_manager_review__star')
|
||||
.on({
|
||||
mouseenter: function (e) {
|
||||
$box.attr('data-star', $(e.currentTarget).data('star'));
|
||||
},
|
||||
mouseleave: function () {
|
||||
$box.attr('data-star', 0);
|
||||
},
|
||||
click: function (e) {
|
||||
window.open($(e.currentTarget).data('href'), '_blank');
|
||||
close();
|
||||
}
|
||||
});
|
||||
|
||||
$box.find('.n2_dashboard_manager_review__close')
|
||||
.on('click', close);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardManager\Boxes;
|
||||
|
||||
use Nextend\SmartSlider3\SmartSlider3Info;
|
||||
|
||||
/**
|
||||
* @var BlockDashboardUpgradePro $this
|
||||
*/
|
||||
?>
|
||||
<div class="n2_dashboard_manager_upgrade_pro">
|
||||
|
||||
<div class="n2_dashboard_manager_upgrade_pro__logo">
|
||||
<i class="ssi_48 ssi_48--upgrade"></i>
|
||||
</div>
|
||||
|
||||
<div class="n2_dashboard_manager_upgrade_pro__heading">
|
||||
<?php n2_e('Why upgrade to Smart Slider 3 Pro?'); ?>
|
||||
</div>
|
||||
|
||||
<div class="n2_dashboard_manager_upgrade_pro__details">
|
||||
<a target="_blank" href="<?php echo esc_url(SmartSlider3Info::decorateExternalUrl('https://smartslider3.com/sample-sliders/', array('utm_source' => $this->getSource() . '-sample-sliders'))); ?>" class="n2_dashboard_manager_upgrade_pro__details_option">
|
||||
<i class="ssi_16 ssi_16--filledcheck"></i>
|
||||
<div class="n2_dashboard_manager_upgrade_pro__details_option_label"><?php echo sprintf(n2_('%d+ slider templates'), '120'); ?></div>
|
||||
</a>
|
||||
<a target="_blank" href="<?php echo esc_url(SmartSlider3Info::decorateExternalUrl('https://smartslider3.com/slide-library/', array('utm_source' => $this->getSource() . '-slide-library'))); ?>" class="n2_dashboard_manager_upgrade_pro__details_option">
|
||||
<i class="ssi_16 ssi_16--filledcheck"></i>
|
||||
<div class="n2_dashboard_manager_upgrade_pro__details_option_label"><?php n2_e('Full slide library access'); ?></div>
|
||||
</a>
|
||||
<a target="_blank" href="<?php echo esc_url(SmartSlider3Info::decorateExternalUrl('https://smartslider3.com/layers/', array('utm_source' => $this->getSource() . '-layers'))); ?>" class="n2_dashboard_manager_upgrade_pro__details_option">
|
||||
<i class="ssi_16 ssi_16--filledcheck"></i>
|
||||
<div class="n2_dashboard_manager_upgrade_pro__details_option_label"><?php echo sprintf(n2_('%d new layers'), '20'); ?></div>
|
||||
</a>
|
||||
<a target="_blank" href="<?php echo esc_url(SmartSlider3Info::decorateExternalUrl('https://smartslider3.com/features/', array('utm_source' => $this->getSource() . '-free-pro'))); ?>" class="n2_dashboard_manager_upgrade_pro__details_option">
|
||||
<i class="ssi_16 ssi_16--filledcheck"></i>
|
||||
<div class="n2_dashboard_manager_upgrade_pro__details_option_label"><?php n2_e('Extra advanced options'); ?></div>
|
||||
</a>
|
||||
<a target="_blank" href="<?php echo esc_url(SmartSlider3Info::decorateExternalUrl('https://smartslider3.com/animations-and-effects/', array('utm_source' => $this->getSource() . '-animations'))); ?>" class="n2_dashboard_manager_upgrade_pro__details_option">
|
||||
<i class="ssi_16 ssi_16--filledcheck"></i>
|
||||
<div class="n2_dashboard_manager_upgrade_pro__details_option_label"><?php n2_e('New animations & effects'); ?></div>
|
||||
</a>
|
||||
<a target="_blank" href="<?php echo esc_url(SmartSlider3Info::decorateExternalUrl('https://smartslider3.com/help/', array('utm_source' => $this->getSource() . '-support'))); ?>" class="n2_dashboard_manager_upgrade_pro__details_option">
|
||||
<i class="ssi_16 ssi_16--filledcheck"></i>
|
||||
<div class="n2_dashboard_manager_upgrade_pro__details_option_label"><?php n2_e('Lifetime update & support'); ?></div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<a href="<?php echo esc_url(SmartSlider3Info::getWhyProUrl(array('utm_source' => $this->getSource()))); ?>" target="_blank" class="n2_dashboard_manager_upgrade_pro__button">
|
||||
<?php n2_e('Upgrade to Pro'); ?>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if ($this->hasDismiss()):
|
||||
?>
|
||||
<div class="n2_dashboard_manager_upgrade_pro__close">
|
||||
<i class="ssi_16 ssi_16--remove"></i>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ($this->hasDismiss()):
|
||||
?>
|
||||
<script>
|
||||
_N2.r(['$', 'documentReady'], function () {
|
||||
var $ = _N2.$;
|
||||
var $box = $('.n2_dashboard_manager_upgrade_pro'),
|
||||
close = function () {
|
||||
_N2.AjaxHelper
|
||||
.ajax({
|
||||
type: "POST",
|
||||
url: _N2.AjaxHelper.makeAjaxUrl(_N2.AjaxHelper.getAdminUrl('ss3-admin'), {
|
||||
nextendcontroller: 'settings',
|
||||
nextendaction: 'dismissupgradepro'
|
||||
}),
|
||||
dataType: 'json'
|
||||
});
|
||||
|
||||
$box.remove();
|
||||
};
|
||||
|
||||
$box.find('.n2_dashboard_manager_upgrade_pro__close')
|
||||
.on('click', close);
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardManager;
|
||||
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardManager\Boxes\BlockDashboardNewsletter;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardManager\Boxes\BlockDashboardReview;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Dashboard\DashboardManager\Boxes\BlockDashboardUpgradePro;
|
||||
|
||||
/**
|
||||
* @var BlockDashboardManager $this
|
||||
*/
|
||||
?>
|
||||
<div class="n2_dashboard_manager">
|
||||
<div class="n2_dashboard_manager__content">
|
||||
<?php
|
||||
$upgradePro = new BlockDashboardUpgradePro($this);
|
||||
$upgradePro->display();
|
||||
$review = new BlockDashboardReview($this);
|
||||
$review->display();
|
||||
|
||||
|
||||
$newsletter = new BlockDashboardNewsletter($this);
|
||||
$newsletter->display();
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\Framework\View\Html;
|
||||
|
||||
abstract class AbstractButton extends AbstractBlock {
|
||||
|
||||
protected $url = '#';
|
||||
|
||||
protected $attributes = array();
|
||||
|
||||
protected $classes = array();
|
||||
|
||||
protected $baseClass = '';
|
||||
|
||||
protected $size = 'medium';
|
||||
|
||||
protected $tabindex = 0;
|
||||
|
||||
public function display() {
|
||||
|
||||
echo wp_kses(Html::link($this->getContent(), $this->getUrl(), $this->getAttributes()), Sanitize::$adminTemplateTags);
|
||||
}
|
||||
|
||||
abstract protected function getContent();
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl() {
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $className
|
||||
*/
|
||||
public function addClass($className) {
|
||||
$this->classes[] = $className;
|
||||
}
|
||||
|
||||
public function addAttribute($name, $value) {
|
||||
$this->attributes[$name] = $value;
|
||||
}
|
||||
|
||||
public function getAttributes() {
|
||||
|
||||
$classes = array_merge(array($this->baseClass), $this->getClasses());
|
||||
|
||||
return $this->attributes + array('class' => implode(' ', $classes));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $target
|
||||
*/
|
||||
public function setTarget($target) {
|
||||
$this->addAttribute('target', $target);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getClasses() {
|
||||
|
||||
$classes = $this->classes;
|
||||
$classes[] = $this->baseClass . '--' . $this->size;
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
public function setSmall() {
|
||||
$this->size = 'small';
|
||||
}
|
||||
|
||||
public function setMedium() {
|
||||
$this->size = 'medium';
|
||||
}
|
||||
|
||||
public function setBig() {
|
||||
$this->size = 'big';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $tabIndex
|
||||
*/
|
||||
public function setTabIndex($tabIndex) {
|
||||
$this->tabindex = $tabIndex;
|
||||
|
||||
if ($this->tabindex === 0) {
|
||||
unset($this->attributes['tabindex']);
|
||||
} else {
|
||||
$this->attributes['tabindex'] = $this->tabindex;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
class AbstractButtonLabel extends AbstractButton {
|
||||
|
||||
protected $label = '';
|
||||
|
||||
protected $icon = '';
|
||||
|
||||
protected $iconBefore = "";
|
||||
|
||||
protected $iconBeforeClass = "";
|
||||
|
||||
protected function getContent() {
|
||||
$content = '';
|
||||
|
||||
if (!empty($this->iconBefore)) {
|
||||
$content .= '<i class="' . $this->iconBefore . ' ' . $this->iconBeforeClass . '"></i>';
|
||||
}
|
||||
|
||||
$content .= '<span class="' . $this->baseClass . '__label">' . $this->getLabel() . '</span>';
|
||||
|
||||
if (!empty($this->icon)) {
|
||||
$content .= '<i class="' . $this->icon . '"></i>';
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLabel() {
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $label
|
||||
*/
|
||||
public function setLabel($label) {
|
||||
$this->label = $label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $icon
|
||||
*/
|
||||
public function setIcon($icon) {
|
||||
$this->icon = $icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $icon
|
||||
* @param string $extraClass
|
||||
*/
|
||||
public function setIconBefore($icon, $extraClass = "") {
|
||||
$this->iconBefore = $icon;
|
||||
$this->iconBeforeClass = $extraClass;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
class BlockButton extends AbstractButtonLabel {
|
||||
|
||||
protected $baseClass = 'n2_button';
|
||||
|
||||
protected $color = 'blue';
|
||||
|
||||
public function setBlue() {
|
||||
$this->color = 'blue';
|
||||
}
|
||||
|
||||
public function setGreen() {
|
||||
$this->color = 'green';
|
||||
}
|
||||
|
||||
public function setRed() {
|
||||
$this->color = 'red';
|
||||
}
|
||||
|
||||
public function setGrey() {
|
||||
$this->color = 'grey';
|
||||
}
|
||||
|
||||
public function setGreyDark() {
|
||||
$this->color = 'grey-dark';
|
||||
}
|
||||
|
||||
public function getClasses() {
|
||||
|
||||
$classes = parent::getClasses();
|
||||
|
||||
$classes[] = $this->baseClass . '--' . $this->color;
|
||||
|
||||
return $classes;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
class BlockButtonApply extends BlockButton {
|
||||
|
||||
protected function init() {
|
||||
parent::init();
|
||||
|
||||
$this->setLabel(n2_('Apply'));
|
||||
$this->setBig();
|
||||
$this->setGreen();
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
class BlockButtonBack extends BlockButton {
|
||||
|
||||
protected function init() {
|
||||
parent::init();
|
||||
|
||||
$this->setLabel(n2_('Back'));
|
||||
$this->setBig();
|
||||
$this->setGreyDark();
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
class BlockButtonCancel extends BlockButton {
|
||||
|
||||
protected function init() {
|
||||
parent::init();
|
||||
|
||||
$this->setLabel(n2_('Cancel'));
|
||||
$this->setBig();
|
||||
$this->setRed();
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
class BlockButtonDashboardInfo extends BlockButtonPlainIcon {
|
||||
|
||||
protected $baseClass = 'n2_button_plain_icon';
|
||||
|
||||
protected $icon = 'ssi_24 ssi_24--notification';
|
||||
|
||||
protected $size = 'big';
|
||||
|
||||
protected function init() {
|
||||
parent::init();
|
||||
|
||||
$this->setTabIndex(-1);
|
||||
}
|
||||
|
||||
protected function getContent() {
|
||||
|
||||
return '<i class="' . $this->icon . '"></i><div class="n2_dashboard_info__marker"></div>';
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
class BlockButtonIcon extends BlockButtonPlainIcon {
|
||||
|
||||
protected $baseClass = 'n2_button_icon';
|
||||
|
||||
protected $color = 'grey';
|
||||
|
||||
public function setBlue() {
|
||||
$this->color = 'blue';
|
||||
}
|
||||
|
||||
public function setGreen() {
|
||||
$this->color = 'green';
|
||||
}
|
||||
|
||||
public function setRed() {
|
||||
$this->color = 'red';
|
||||
}
|
||||
|
||||
public function setGrey() {
|
||||
$this->color = 'grey';
|
||||
}
|
||||
|
||||
public function setGreyDark() {
|
||||
$this->color = 'grey-dark';
|
||||
}
|
||||
|
||||
public function getClasses() {
|
||||
|
||||
$classes = parent::getClasses();
|
||||
|
||||
$classes[] = $this->baseClass . '--' . $this->color;
|
||||
|
||||
return $classes;
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
class BlockButtonIconCode extends BlockButtonIcon {
|
||||
|
||||
protected function getContent() {
|
||||
|
||||
return $this->icon;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
class BlockButtonImport extends BlockButton {
|
||||
|
||||
protected function init() {
|
||||
parent::init();
|
||||
|
||||
$this->setLabel(n2_('Import'));
|
||||
$this->setBig();
|
||||
$this->setGreen();
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
class BlockButtonPlain extends AbstractButtonLabel {
|
||||
|
||||
protected $baseClass = 'n2_button_plain';
|
||||
|
||||
protected $color = '';
|
||||
|
||||
public function setColorBlue() {
|
||||
$this->color = 'blue';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getClasses() {
|
||||
|
||||
$classes = parent::getClasses();
|
||||
|
||||
if (!empty($this->color)) {
|
||||
$classes[] = $this->baseClass . '--color-' . $this->color;
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
class BlockButtonPlainIcon extends AbstractButton {
|
||||
|
||||
protected $baseClass = 'n2_button_plain_icon';
|
||||
|
||||
protected $icon = '';
|
||||
|
||||
protected function getContent() {
|
||||
|
||||
return '<i class="' . $this->icon . '"></i>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $icon
|
||||
*/
|
||||
public function setIcon($icon) {
|
||||
$this->icon = $icon;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
class BlockButtonSave extends BlockButton {
|
||||
|
||||
protected function init() {
|
||||
parent::init();
|
||||
|
||||
$this->setLabel(n2_('Save'));
|
||||
$this->setBig();
|
||||
$this->setGreen();
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockButtonSpacer extends AbstractBlock {
|
||||
|
||||
protected $isVisible = false;
|
||||
|
||||
public function display() {
|
||||
|
||||
$classes = array('n2_button_spacer');
|
||||
|
||||
if ($this->isVisible) {
|
||||
$classes[] = 'n2_button_spacer--visible';
|
||||
}
|
||||
|
||||
echo '<div class="' . esc_attr(implode(' ', $classes)) . '"></div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $isVisible
|
||||
*/
|
||||
public function setIsVisible($isVisible) {
|
||||
$this->isVisible = $isVisible;
|
||||
}
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu;
|
||||
|
||||
|
||||
use Nextend\Framework\Asset\Js\Js;
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\Framework\View\Html;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\AbstractButton;
|
||||
|
||||
class BlockFloatingMenu extends AbstractBlock {
|
||||
|
||||
/**
|
||||
* @var AbstractButton
|
||||
*/
|
||||
protected $button;
|
||||
|
||||
protected $classes = array(
|
||||
'n2_popover',
|
||||
'n2_floating_menu'
|
||||
);
|
||||
|
||||
protected $attributes = array();
|
||||
|
||||
/**
|
||||
* @var AbstractBlock[]
|
||||
*/
|
||||
protected $menuItems = array();
|
||||
|
||||
protected $contentID;
|
||||
|
||||
public function display() {
|
||||
$this->renderTemplatePart('FloatingMenu');
|
||||
}
|
||||
|
||||
public function displayButton() {
|
||||
$this->button->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AbstractButton $button
|
||||
*/
|
||||
public function setButton($button) {
|
||||
|
||||
$button->setTabIndex(-1);
|
||||
$button->addClass('n2_floating_menu__button n2_popover__trigger');
|
||||
$this->button = $button;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AbstractBlock $item
|
||||
*/
|
||||
public function addMenuItem($item) {
|
||||
$this->menuItems[] = $item;
|
||||
}
|
||||
|
||||
public function addSeparator($classes = array()) {
|
||||
|
||||
$separator = new BlockFloatingMenuItemSeparator($this);
|
||||
$separator->setclasses($classes);
|
||||
$this->menuItems[] = $separator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AbstractBlock[]
|
||||
*/
|
||||
public function getMenuItems() {
|
||||
return $this->menuItems;
|
||||
}
|
||||
|
||||
public function addClass($className) {
|
||||
$this->classes[] = $className;
|
||||
}
|
||||
|
||||
public function getClasses() {
|
||||
|
||||
return $this->classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getContentID() {
|
||||
return $this->contentID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $contentID
|
||||
*/
|
||||
public function setContentID($contentID) {
|
||||
$this->contentID = $contentID;
|
||||
}
|
||||
|
||||
public function renderAttributes() {
|
||||
|
||||
echo wp_kses(Html::renderAttributes($this->attributes + array(
|
||||
'class' => implode(' ', $this->classes)
|
||||
)), Sanitize::$adminTemplateTags);
|
||||
}
|
||||
|
||||
public function setAttribute($name, $value) {
|
||||
$this->attributes[$name] = $value;
|
||||
}
|
||||
|
||||
public function setLeft() {
|
||||
$this->setAttribute('data-horizontal', 'left');
|
||||
}
|
||||
|
||||
public function setRight() {
|
||||
$this->setAttribute('data-horizontal', 'right');
|
||||
}
|
||||
|
||||
public function setAbove() {
|
||||
$this->setAttribute('data-vertical', 'above');
|
||||
}
|
||||
|
||||
public function setBelow() {
|
||||
$this->setAttribute('data-vertical', 'below');
|
||||
}
|
||||
|
||||
public function setRelatedClass($selector) {
|
||||
$this->setAttribute('data-relatedclass', $selector);
|
||||
}
|
||||
}
|
||||
|
||||
Js::addInline('_N2.r(\'$\', function () {_N2.$(".n2_floating_menu").nextendPopover();});');
|
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu;
|
||||
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\Framework\View\Html;
|
||||
|
||||
class BlockFloatingMenuItem extends AbstractBlock {
|
||||
|
||||
protected $label = '';
|
||||
|
||||
protected $url = '#';
|
||||
|
||||
protected $icon = '';
|
||||
|
||||
protected $isActive = false;
|
||||
|
||||
protected $attributes = array();
|
||||
|
||||
protected $classes = array(
|
||||
'n2_floating_menu__item'
|
||||
);
|
||||
|
||||
protected $color = 'grey';
|
||||
|
||||
public function display() {
|
||||
|
||||
$label = '';
|
||||
if (!empty($this->icon)) {
|
||||
$label .= '<i class="' . $this->icon . '"></i>';
|
||||
}
|
||||
$label .= '<div class="n2_floating_menu__item_label">' . $this->label . '</div>';
|
||||
|
||||
echo wp_kses(Html::link($label, $this->url, $this->attributes + array('class' => implode(' ', $this->getClasses()))), Sanitize::$adminTemplateTags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $label
|
||||
*/
|
||||
public function setLabel($label) {
|
||||
$this->label = $label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $icon
|
||||
*/
|
||||
public function setIcon($icon) {
|
||||
$this->icon = $icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $isActive
|
||||
*/
|
||||
public function setIsActive($isActive) {
|
||||
$this->isActive = $isActive;
|
||||
}
|
||||
|
||||
public function addAttribute($name, $value) {
|
||||
$this->attributes[$name] = $value;
|
||||
}
|
||||
|
||||
public function addClass($className) {
|
||||
$this->classes[] = $className;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $target
|
||||
*/
|
||||
public function setTarget($target) {
|
||||
$this->addAttribute('target', $target);
|
||||
}
|
||||
|
||||
public function setRed() {
|
||||
$this->color = 'red';
|
||||
}
|
||||
|
||||
public function setGrey() {
|
||||
$this->color = 'grey';
|
||||
}
|
||||
|
||||
public function getClasses() {
|
||||
|
||||
$classes = $this->classes;
|
||||
|
||||
if ($this->isActive) {
|
||||
$classes[] = 'n2_floating_menu__item--active';
|
||||
}
|
||||
|
||||
$classes[] = 'n2_floating_menu__item--' . $this->color;
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
public function setState($state) {
|
||||
$this->attributes['data-state'] = $state;
|
||||
}
|
||||
|
||||
public function setStayOpen() {
|
||||
$this->addAttribute('data-stay-open', 1);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu;
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockFloatingMenuItemSeparator extends AbstractBlock {
|
||||
|
||||
protected $classes = array();
|
||||
|
||||
public function display() {
|
||||
|
||||
echo '<div class="' . esc_attr(implode(' ', array_merge(array(
|
||||
'n2_floating_menu__item_separator'
|
||||
), $this->classes))) . '"></div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classes
|
||||
*/
|
||||
public function setClasses($classes) {
|
||||
$this->classes = $classes;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu;
|
||||
|
||||
|
||||
/**
|
||||
* @var BlockFloatingMenu $this
|
||||
*/
|
||||
?>
|
||||
<div <?php $this->renderAttributes(); ?>>
|
||||
<?php
|
||||
$this->displayButton();
|
||||
|
||||
$contentID = $this->getContentID();
|
||||
?>
|
||||
<div <?php if (!empty($contentID)): ?>id="<?php echo esc_attr($this->getContentID()); ?>"<?php endif; ?> class="n2_popover_content n2_floating_menu__items_container">
|
||||
<div class="n2_popover_content_exit"></div>
|
||||
<div class="n2_popover_content_inner n2_floating_menu__items">
|
||||
<?php
|
||||
foreach ($this->getMenuItems() as $menuItem) {
|
||||
$menuItem->display();
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Generator\GeneratorBox;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockGeneratorBox extends AbstractBlock {
|
||||
|
||||
|
||||
protected $label = '';
|
||||
|
||||
protected $buttonLink = '';
|
||||
|
||||
protected $buttonLinkTarget = '';
|
||||
|
||||
protected $buttonLabel = '';
|
||||
|
||||
protected $description = '';
|
||||
|
||||
protected $docsLink = '';
|
||||
|
||||
/** @var string */
|
||||
protected $imageUrl;
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('GeneratorBox');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLabel() {
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $label
|
||||
*/
|
||||
public function setLabel($label) {
|
||||
$this->label = $label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription() {
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $description
|
||||
*/
|
||||
public function setDescription($description) {
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string
|
||||
*/
|
||||
public function getDocsLink() {
|
||||
return $this->docsLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $link
|
||||
*/
|
||||
public function setDocsLink($link) {
|
||||
$this->docsLink = $link;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getButtonLink() {
|
||||
return $this->buttonLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $buttonLink
|
||||
*/
|
||||
public function setButtonLink($buttonLink) {
|
||||
$this->buttonLink = $buttonLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getButtonLabel() {
|
||||
return $this->buttonLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $buttonLabel
|
||||
*/
|
||||
public function setButtonLabel($buttonLabel) {
|
||||
$this->buttonLabel = $buttonLabel;
|
||||
}
|
||||
|
||||
public function hasButtonLabel() {
|
||||
return !empty($this->buttonLabel);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getButtonLinkTarget() {
|
||||
return $this->buttonLinkTarget;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $buttonLinkTarget
|
||||
*/
|
||||
public function setButtonLinkTarget($buttonLinkTarget) {
|
||||
$this->buttonLinkTarget = $buttonLinkTarget;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getImageUrl() {
|
||||
return $this->imageUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $imageUrl
|
||||
*/
|
||||
public function setImageUrl($imageUrl) {
|
||||
$this->imageUrl = $imageUrl;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Generator\GeneratorBox;
|
||||
|
||||
/**
|
||||
* @var $this BlockGeneratorBox
|
||||
*/
|
||||
?>
|
||||
<div class="n2_slide_generator_box" style="background-image: url('<?php echo esc_url($this->getImageUrl()); ?>');">
|
||||
<div class="n2_slide_generator_box__title">
|
||||
<div class="n2_slide_generator_box__title_label">
|
||||
<div class="n2_slide_generator_box__title_label_inner">
|
||||
<?php
|
||||
$label = $this->getLabel();
|
||||
echo esc_html($label);
|
||||
?>
|
||||
</div>
|
||||
<i class="ssi_16 ssi_16--info" data-tip-description="<?php echo esc_attr($this->getDescription()); ?>" data-tip-label="<?php echo esc_attr($label); ?>" data-tip-link="<?php echo esc_url($this->getDocsLink()); ?>"></i>
|
||||
</div>
|
||||
<a href="<?php echo esc_url($this->getButtonLink()); ?>" target="<?php echo esc_attr($this->getButtonLinkTarget()); ?>" class="n2_slide_generator_box__title_button">
|
||||
<?php echo esc_html($this->getButtonLabel()); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\AddLayer;
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\Framework\View\Html;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\FreeNeedMore\BlockFreeNeedMore;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonIconCode;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonPlainIcon;
|
||||
|
||||
/**
|
||||
* @var $this BlockAddLayer
|
||||
*/
|
||||
?>
|
||||
<div class="n2_add_layer">
|
||||
<div class="n2_add_layer__bar">
|
||||
|
||||
<div class="n2_add_layer__bar_top">
|
||||
<?php
|
||||
$buttonAddLayer = new BlockButtonIconCode($this);
|
||||
$buttonAddLayer->addClass('n2_add_layer__bar_button');
|
||||
$buttonAddLayer->addClass('n2_add_layer__bar_button_add');
|
||||
$buttonAddLayer->setIcon('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path fill="currentColor" d="M13 3a1 1 0 0 1 1 1v6h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6v6a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-6H4a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h6V4a1 1 0 0 1 1-1h2z"/></svg>');
|
||||
$buttonAddLayer->setGreen();
|
||||
$buttonAddLayer->addAttribute('data-n2tip', n2_('Add Layer'));
|
||||
$buttonAddLayer->display();
|
||||
|
||||
$this->displayAddShortcut('heading', 'ssi_24 ssi_24--heading', n2_('Heading'));
|
||||
$this->displayAddShortcut('text', 'ssi_24 ssi_24--text', n2_('Text'));
|
||||
$this->displayAddShortcut('image', 'ssi_24 ssi_24--image', n2_('Image'));
|
||||
$this->displayAddShortcut('button', 'ssi_24 ssi_24--button', n2_('Button'));
|
||||
$this->displayAddShortcut('structure-2col', 'ssi_24 ssi_24--col2', n2_('Row'));
|
||||
?>
|
||||
</div>
|
||||
<div class="n2_add_layer__bar_bottom">
|
||||
<?php
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="n2_add_layer__more n2_form--dark">
|
||||
<div class="n2_add_layer__more_tab_buttons">
|
||||
<div class="n2_add_layer__more_tab_button" data-related-tab="layers">
|
||||
<div class="n2_add_layer__more_tab_button_icon">
|
||||
<i class="ssi_24 ssi_24--layers"></i>
|
||||
</div>
|
||||
<div class="n2_add_layer__more_tab_button_label">
|
||||
<?php n2_e('Layers'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="n2_add_layer__more_tab_button" data-related-tab="library">
|
||||
<div class="n2_add_layer__more_tab_button_icon">
|
||||
<i class="ssi_24 ssi_24--smart"></i>
|
||||
</div>
|
||||
<div class="n2_add_layer__more_tab_button_label">
|
||||
<?php n2_e('Library'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="n2_add_layer__more_tab" data-tab="layers">
|
||||
<div class="n2_add_layer__more_layers">
|
||||
<?php
|
||||
foreach ($this->getGroups() as $groupLabel => $boxes):
|
||||
?>
|
||||
<div class="n2_add_layer_group">
|
||||
<div class="n2_add_layer_group__label">
|
||||
<?php echo esc_html($groupLabel); ?>
|
||||
</div>
|
||||
<div class="n2_add_layer_group__content">
|
||||
<?php
|
||||
foreach ($boxes as $box):
|
||||
echo wp_kses(Html::openTag('div', array(
|
||||
'class' => 'n2_add_layer_box'
|
||||
) + $box['attributes']), Sanitize::$adminTemplateTags);
|
||||
?>
|
||||
<div class="n2_add_layer_box__icon">
|
||||
<i class="<?php echo esc_attr($box['icon']) ?>"></i>
|
||||
</div>
|
||||
<div class="n2_add_layer_box__label_wrap">
|
||||
<div class="n2_add_layer_box__label">
|
||||
<?php echo esc_html($box['label']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
echo wp_kses(Html::closeTag('div'), Sanitize::$basicTags);
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
<?php
|
||||
$freeNeedMore = new BlockFreeNeedMore($this);
|
||||
$freeNeedMore->setSource('add-layer');
|
||||
$freeNeedMore->display();
|
||||
|
||||
?>
|
||||
</div>
|
||||
<div class="n2_add_layer__more_position n2_add_layer_position" data-position="default">
|
||||
<div class="n2_add_layer_position__label n2_add_layer_position__default_label">
|
||||
<?php n2_e('Default'); ?>
|
||||
</div>
|
||||
<div class="n2_add_layer_position__switch_container">
|
||||
<div class="n2_add_layer_position__switch">
|
||||
<div class="n2_add_layer_position__switch_dot">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=" n2_add_layer_position__label n2_add_layer_position__absolute_label">
|
||||
<?php n2_e('Absolute'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="n2_add_layer__more_tab n2_add_layer_library" data-tab="library">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\AddLayer;
|
||||
|
||||
|
||||
use Nextend\Framework\Asset\Js\Js;
|
||||
use Nextend\Framework\Plugin;
|
||||
use Nextend\Framework\Style\ModelCss;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonPlainIcon;
|
||||
use Nextend\SmartSlider3\Renderable\Item\ItemFactory;
|
||||
use Nextend\SmartSlider3\Slider\SliderType\SliderTypeFactory;
|
||||
|
||||
class BlockAddLayer extends AbstractBlock {
|
||||
|
||||
protected $groups = array();
|
||||
|
||||
protected $sliderType = '';
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->groups[n2_x('Basic', 'Layer group')] = array(
|
||||
array(
|
||||
'label' => n2_('Row'),
|
||||
'icon' => 'ssi_32 ssi_32--col2',
|
||||
'attributes' => array(
|
||||
'data-item' => 'structure-2col'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$cssModel = new ModelCss($this);
|
||||
|
||||
$itemDefaults = SliderTypeFactory::getType($this->sliderType)
|
||||
->getItemDefaults();
|
||||
|
||||
foreach (ItemFactory::getItemGroups() as $groupLabel => $group) {
|
||||
foreach ($group as $type => $item) {
|
||||
if (!$item->isLegacy()) {
|
||||
if (!isset($this->groups[$groupLabel])) {
|
||||
$this->groups[$groupLabel] = array();
|
||||
}
|
||||
$visualKey = 'ss3item' . $type;
|
||||
$visuals = $cssModel->getVisuals($visualKey);
|
||||
Plugin::doAction($visualKey . 'Storage', array(
|
||||
&$visuals
|
||||
));
|
||||
Js::addInline('window["' . $visualKey . '"] = ' . json_encode($visuals) . ';');
|
||||
|
||||
$this->groups[$groupLabel][] = array(
|
||||
'label' => $item->getTitle(),
|
||||
'icon' => $item->getIcon(),
|
||||
'attributes' => array(
|
||||
'data-item' => $type,
|
||||
'data-layerproperties' => json_encode((object)array_merge($item->getLayerProperties(), $itemDefaults))
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->renderTemplatePart('AddLayer');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getGroups() {
|
||||
return $this->groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sliderType
|
||||
*/
|
||||
public function setSliderType($sliderType) {
|
||||
$this->sliderType = $sliderType;
|
||||
}
|
||||
|
||||
public function displayAddShortcut($type, $icon, $label) {
|
||||
$button = new BlockButtonPlainIcon($this);
|
||||
$button->addClass('n2_add_layer__bar_button');
|
||||
$button->setIcon($icon);
|
||||
$button->addAttribute('data-add-layer-shortcut', $type);
|
||||
$button->addAttribute('data-n2tip', $label);
|
||||
$button->display();
|
||||
}
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\EditorOverlay;
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\BlockBreadCrumb\BlockBreadCrumb;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\TopBarMain\TopBarMainEditor\BlockTopBarMainEditor;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\AddLayer\BlockAddLayer;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideManager\BlockSlideManager;
|
||||
|
||||
class BlockEditorOverlay extends AbstractBlock {
|
||||
|
||||
/**
|
||||
* @var BlockTopBarMainEditor
|
||||
*/
|
||||
protected $topBar;
|
||||
|
||||
/**
|
||||
* @var BlockBreadCrumb
|
||||
*/
|
||||
protected $blockBreadCrumb;
|
||||
|
||||
/**
|
||||
* @var BlockSlideManager
|
||||
*/
|
||||
protected $slideManager;
|
||||
|
||||
/**
|
||||
* @var BlockAddLayer
|
||||
*/
|
||||
protected $blockAddLayer;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $contentLayerWindow;
|
||||
|
||||
protected function init() {
|
||||
$this->topBar = new BlockTopBarMainEditor($this);
|
||||
|
||||
$this->blockBreadCrumb = new BlockBreadCrumb($this);
|
||||
$this->topBar->addSecondaryBlock($this->blockBreadCrumb);
|
||||
}
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('EditorOverlay');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BlockSlideManager $slideManager
|
||||
*/
|
||||
public function setSlideManager($slideManager) {
|
||||
$this->slideManager = $slideManager;
|
||||
$slideManager->addClass('n2_admin_editor__ui_slide_manager');
|
||||
}
|
||||
|
||||
public function displaySlideManager() {
|
||||
$this->slideManager->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BlockTopBarMainEditor
|
||||
*/
|
||||
public function getTopBar() {
|
||||
return $this->topBar;
|
||||
}
|
||||
|
||||
public function displayTopBar() {
|
||||
$this->topBar->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BlockBreadCrumb
|
||||
*/
|
||||
public function getBlockBreadCrumb() {
|
||||
return $this->blockBreadCrumb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BlockAddLayer $blockAddLayer
|
||||
*/
|
||||
public function setBlockAddLayer($blockAddLayer) {
|
||||
$this->blockAddLayer = $blockAddLayer;
|
||||
}
|
||||
|
||||
public function displayBlockAddLayer() {
|
||||
$this->blockAddLayer->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $contentLayerWindow
|
||||
*/
|
||||
public function setContentLayerWindow($contentLayerWindow) {
|
||||
$this->contentLayerWindow = $contentLayerWindow;
|
||||
}
|
||||
|
||||
public function displayBlockLayerWindow() {
|
||||
echo wp_kses($this->contentLayerWindow, Sanitize::$adminFormTags);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\EditorOverlay;
|
||||
|
||||
/**
|
||||
* @var $this BlockEditorOverlay
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="n2_admin_editor_overlay">
|
||||
<div class="n2_admin_editor_overlay__top">
|
||||
<?php $this->displayTopBar(); ?>
|
||||
</div>
|
||||
|
||||
<div class="n2_admin_editor_overlay__middle">
|
||||
<?php $this->displayBlockAddLayer(); ?>
|
||||
<div class="n2_admin_editor_overlay__middle_center">
|
||||
<div class="n2_ruler_corner"></div>
|
||||
<div class="n2_ruler n2_ruler--vertical">
|
||||
<div class="n2_ruler__inner">
|
||||
</div>
|
||||
</div>
|
||||
<div class="n2_ruler n2_ruler--horizontal">
|
||||
<div class="n2_ruler__inner">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->displayBlockLayerWindow(); ?>
|
||||
|
||||
<?php $this->displaySlideManager(); ?>
|
||||
|
||||
</div>
|
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings\AbstractLayerWindowSettings;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings\LayerWindowSettingsColumn;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings\LayerWindowSettingsCommon;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings\LayerWindowSettingsContent;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings\LayerWindowSettingsItem;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings\LayerWindowSettingsItemCommon;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings\LayerWindowSettingsRow;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings\LayerWindowSettingsSlide;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Tab\AbstractTab;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Tab\TabAnimation;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Tab\TabContent;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Tab\TabGoPro;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Tab\TabStyle;
|
||||
use Nextend\SmartSlider3\Renderable\Item\ItemFactory;
|
||||
use Nextend\SmartSlider3\Slider\Admin\AdminSlider;
|
||||
|
||||
class BlockLayerWindow extends AbstractBlock {
|
||||
|
||||
/**
|
||||
* @var AdminSlider
|
||||
*/
|
||||
protected $renderableAdminSlider;
|
||||
|
||||
/**
|
||||
* @var AbstractTab[]
|
||||
*/
|
||||
protected $tabs = array();
|
||||
|
||||
/**
|
||||
* @var AbstractLayerWindowSettings[]
|
||||
*/
|
||||
protected $settings = array();
|
||||
|
||||
/**
|
||||
* @param AdminSlider $renderableAdminSlider
|
||||
*/
|
||||
public function setRenderableAdminSlider($renderableAdminSlider) {
|
||||
$this->renderableAdminSlider = $renderableAdminSlider;
|
||||
}
|
||||
|
||||
public function display() {
|
||||
|
||||
|
||||
$this->tabs['content'] = new TabContent($this);
|
||||
$this->tabs['style'] = new TabStyle($this);
|
||||
$this->tabs['animation'] = new TabGoPro($this);
|
||||
|
||||
|
||||
|
||||
$this->settings[] = new LayerWindowSettingsSlide($this, $this->renderableAdminSlider);
|
||||
$this->settings[] = new LayerWindowSettingsContent($this);
|
||||
$this->settings[] = new LayerWindowSettingsRow($this);
|
||||
$this->settings[] = new LayerWindowSettingsColumn($this);
|
||||
|
||||
foreach (ItemFactory::getItems() as $type => $item) {
|
||||
$this->settings[] = new LayerWindowSettingsItem($type, $item, $this, $this->renderableAdminSlider);
|
||||
}
|
||||
|
||||
$this->settings[] = new LayerWindowSettingsItemCommon($this);
|
||||
|
||||
$this->settings[] = new LayerWindowSettingsCommon($this);
|
||||
|
||||
foreach ($this->settings as $setting) {
|
||||
$setting->extendForm($this->tabs['content']->getContainer(), $this->tabs['style']->getContainer());
|
||||
}
|
||||
|
||||
$this->renderTemplatePart('LayerWindow');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AbstractTab[]
|
||||
*/
|
||||
public function getTabs() {
|
||||
|
||||
return $this->tabs;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow;
|
||||
|
||||
/**
|
||||
* @var $this BlockLayerWindow
|
||||
*/
|
||||
?>
|
||||
|
||||
<div id="n2-ss-layer-window" class="n2_ss_layer_window n2_form--dark">
|
||||
<div class="n2_ss_layer_window__crop">
|
||||
<div class="n2_ss_layer_window__title">
|
||||
|
||||
<div class="n2_ss_layer_window__title_nav n2_ss_layer_window__title_nav_left">
|
||||
</div>
|
||||
|
||||
<div class="n2_ss_layer_window__title_inner"></div>
|
||||
|
||||
<div class="n2_ss_layer_window__title_nav n2_ss_layer_window__title_nav_right">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="n2_ss_layer_window__tab_buttons">
|
||||
<?php
|
||||
foreach ($this->getTabs() as $tab):
|
||||
?>
|
||||
<div class="n2_ss_layer_window__tab_button" data-related-tab="<?php echo esc_attr($tab->getName()); ?>">
|
||||
<div class="n2_ss_layer_window__tab_button_icon">
|
||||
<i class="<?php echo esc_attr($tab->getIcon()); ?>"></i>
|
||||
</div>
|
||||
<div class="n2_ss_layer_window__tab_button_label">
|
||||
<?php
|
||||
echo esc_html($tab->getLabel());
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="n2_ss_layer_window__tab_container n2_container_scrollable">
|
||||
<?php
|
||||
foreach ($this->getTabs() as $tab):
|
||||
?>
|
||||
<div class="n2_ss_layer_window__tab" data-tab="<?php echo esc_attr($tab->getName()); ?>">
|
||||
<?php
|
||||
$tab->display();
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
//$this->renderForm();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings;
|
||||
|
||||
|
||||
use Nextend\Framework\Form\Container\LayerWindow\ContainerSettings;
|
||||
use Nextend\Framework\Form\ContainerInterface;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\BlockLayerWindow;
|
||||
|
||||
abstract class AbstractLayerWindowSettings {
|
||||
|
||||
/**
|
||||
* @var BlockLayerWindow
|
||||
*/
|
||||
protected $blockLayerWindow;
|
||||
|
||||
/**
|
||||
* @var ContainerSettings
|
||||
*/
|
||||
protected $contentContainer;
|
||||
|
||||
/**
|
||||
* @var ContainerSettings
|
||||
*/
|
||||
protected $styleContainer;
|
||||
|
||||
/**
|
||||
* AbstractLayerWindowSettings constructor.
|
||||
*
|
||||
* @param BlockLayerWindow $blockLayerWindow
|
||||
*/
|
||||
public function __construct($blockLayerWindow) {
|
||||
|
||||
$this->blockLayerWindow = $blockLayerWindow;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getName();
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $contentContainer
|
||||
* @param ContainerInterface $styleContainer
|
||||
*/
|
||||
public function extendForm($contentContainer, $styleContainer) {
|
||||
$this->createContentContainer($contentContainer);
|
||||
$this->createStyleContainer($styleContainer);
|
||||
|
||||
$this->extendContent();
|
||||
$this->extendStyle();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function createContentContainer($container) {
|
||||
$this->contentContainer = new ContainerSettings($container, $this->getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function createStyleContainer($container) {
|
||||
$this->styleContainer = new ContainerSettings($container, $this->getName());
|
||||
}
|
||||
|
||||
protected function extendContent() {
|
||||
|
||||
}
|
||||
|
||||
protected function extendStyle() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,229 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings;
|
||||
|
||||
|
||||
use Nextend\Framework\Form\ContainerInterface;
|
||||
use Nextend\Framework\Form\Element\Hidden;
|
||||
use Nextend\Framework\Form\Element\LayerWindowFocus;
|
||||
use Nextend\Framework\Form\Element\MarginPadding;
|
||||
use Nextend\Framework\Form\Element\MixedField\BoxShadow;
|
||||
use Nextend\Framework\Form\Element\Select;
|
||||
use Nextend\Framework\Form\Element\Select\Gradient;
|
||||
use Nextend\Framework\Form\Element\Select\LinkTarget;
|
||||
use Nextend\Framework\Form\Element\Text;
|
||||
use Nextend\Framework\Form\Element\Text\Color;
|
||||
use Nextend\Framework\Form\Element\Text\FieldImage;
|
||||
use Nextend\Framework\Form\Element\Text\HiddenText;
|
||||
use Nextend\Framework\Form\Element\Text\Number;
|
||||
use Nextend\Framework\Form\Element\Text\NumberAutoComplete;
|
||||
use Nextend\Framework\Form\Element\Text\Url;
|
||||
use Nextend\Framework\Form\Fieldset\LayerWindow\FieldsetLayerWindowLabelFields;
|
||||
use Nextend\Framework\Form\Fieldset\LayerWindow\FieldsetLayerWindowStyleMode;
|
||||
use Nextend\SmartSlider3\Form\Element\Radio\FlexAlign;
|
||||
use Nextend\SmartSlider3\Form\Element\Radio\InnerAlign;
|
||||
|
||||
class LayerWindowSettingsColumn extends AbstractLayerWindowSettings {
|
||||
|
||||
public function getName() {
|
||||
return 'column';
|
||||
}
|
||||
|
||||
protected function extendContent() {
|
||||
|
||||
$general = new FieldsetLayerWindowLabelFields($this->contentContainer, 'fields-col-general', n2_('General'));
|
||||
|
||||
new Hidden($general, 'col-order', '0');
|
||||
new Hidden($general, 'col-opened', 1);
|
||||
new Hidden($general, 'col-colwidth', '');
|
||||
|
||||
new InnerAlign($general, 'col-inneralign', n2_('Inner align'), 'inherit', array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'tipLabel' => n2_('Inner align'),
|
||||
'tipDescription' => n2_('Positions the layers inside horizontally.')
|
||||
));
|
||||
|
||||
new FlexAlign($general, 'col-verticalalign', n2_('Vertical align'), 'center', array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'tipLabel' => n2_('Vertical align'),
|
||||
'tipDescription' => n2_('Positions the layers inside vertically.')
|
||||
));
|
||||
|
||||
|
||||
$link = new FieldsetLayerWindowLabelFields($this->contentContainer, 'fields-col-link', n2_('Link'));
|
||||
|
||||
new Url($link, 'col-href', n2_('Link'), '', array(
|
||||
'relatedFields' => array(
|
||||
'layercol-href-target',
|
||||
'layercol-aria-label'
|
||||
),
|
||||
'width' => 248
|
||||
));
|
||||
new LinkTarget($link, 'col-href-target', n2_('Target window'));
|
||||
|
||||
new Text($link, 'col-aria-label', n2_('ARIA label'), '', array(
|
||||
'style' => 'width:190px;',
|
||||
'tipLabel' => n2_('ARIA label')
|
||||
));
|
||||
}
|
||||
|
||||
protected function extendStyle() {
|
||||
|
||||
$this->backgroundImage($this->styleContainer);
|
||||
$this->background($this->styleContainer);
|
||||
$this->border($this->styleContainer);
|
||||
$this->size($this->styleContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function backgroundImage($container) {
|
||||
|
||||
$backgroundImage = new FieldsetLayerWindowLabelFields($container, 'fields-col-background-image', n2_('Background image'));
|
||||
$fieldImage = new FieldImage($backgroundImage, 'col-background-image', n2_('Background image'), '', array(
|
||||
'width' => 220,
|
||||
'relatedFields' => array(
|
||||
'layercol-background-focus'
|
||||
)
|
||||
));
|
||||
|
||||
$fieldFocusX = new HiddenText($backgroundImage, 'col-background-focus-x', 50);
|
||||
$fieldFocusY = new HiddenText($backgroundImage, 'col-background-focus-y', 50);
|
||||
|
||||
$focusField = new LayerWindowFocus($backgroundImage, 'col-background-focus', n2_('Focus'), array(
|
||||
'tipLabel' => n2_('Focus'),
|
||||
'tipDescription' => n2_('You can set the starting position of a background image. This makes sure that the selected part will always remain visible, so you should pick the most important part.')
|
||||
));
|
||||
|
||||
$focusField->setFields($fieldImage, $fieldFocusX, $fieldFocusY);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function background($container) {
|
||||
|
||||
$background = new FieldsetLayerWindowStyleMode($container, 'fields-col-background', n2_('Background'), array(
|
||||
'' => 'Normal',
|
||||
'-hover' => 'Hover'
|
||||
));
|
||||
|
||||
new Color($background, 'col-background-color', n2_('Background color'), 'ffffff00', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
new Gradient($background, 'col-background-gradient', n2_('Gradient'), 'off', array(
|
||||
'relatedFields' => array(
|
||||
'layercol-background-color-end'
|
||||
)
|
||||
));
|
||||
|
||||
new Color($background, 'col-background-color-end', n2_('Color end'), 'ffffff00', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
new BoxShadow($background, 'col-boxshadow', n2_('Box shadow'), '0|*|0|*|0|*|0|*|00000080');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function border($container) {
|
||||
|
||||
$border = new FieldsetLayerWindowStyleMode($container, 'fields-col-border', n2_('Border'), array(
|
||||
'' => 'Normal',
|
||||
'-hover' => 'Hover'
|
||||
));
|
||||
|
||||
$borderWidth = new MarginPadding($border, 'col-border-width', n2_('Border'), '0|*|0|*|0|*|0', array(
|
||||
'unit' => 'px',
|
||||
'relatedFields' => array(
|
||||
'layercol-border-style',
|
||||
'layercol-border-color'
|
||||
)
|
||||
));
|
||||
|
||||
for ($i = 1; $i < 5; $i++) {
|
||||
new NumberAutoComplete($borderWidth, 'col-border-width-' . $i, false, '', array(
|
||||
'values' => array(
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
5
|
||||
),
|
||||
'wide' => 3
|
||||
));
|
||||
}
|
||||
|
||||
new Select($border, 'col-border-style', n2_('Style'), 'none', array(
|
||||
'options' => array(
|
||||
'none' => n2_('None'),
|
||||
'solid' => n2_('Solid'),
|
||||
'dashed' => n2_('Dashed'),
|
||||
'dotted' => n2_('Dotted'),
|
||||
)
|
||||
));
|
||||
|
||||
new Color($border, 'col-border-color', n2_('Color'), 'ffffffff', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
new NumberAutoComplete($border, 'col-border-radius', n2_('Border radius'), 0, array(
|
||||
'values' => array(
|
||||
0,
|
||||
3,
|
||||
5,
|
||||
10,
|
||||
99
|
||||
),
|
||||
'wide' => 3,
|
||||
'unit' => 'px'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function size($container) {
|
||||
|
||||
$size = new FieldsetLayerWindowLabelFields($container, 'fields-col-size', n2_('Size'));
|
||||
|
||||
new Number($size, 'col-maxwidth', n2_('Max width'), 0, array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'wide' => 5,
|
||||
'unit' => 'px'
|
||||
));
|
||||
|
||||
|
||||
$padding = new MarginPadding($size, 'col-padding', n2_('Padding'), '5|*|5|*|5|*|5', array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
$padding->setUnit('px');
|
||||
|
||||
for ($i = 1; $i < 5; $i++) {
|
||||
new NumberAutoComplete($padding, 'col-padding-' . $i, false, '', array(
|
||||
'values' => array(
|
||||
0,
|
||||
5,
|
||||
10,
|
||||
20,
|
||||
30
|
||||
),
|
||||
'wide' => 3
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,289 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings;
|
||||
|
||||
|
||||
use Nextend\Framework\Form\ContainerInterface;
|
||||
use Nextend\Framework\Form\Element\Button;
|
||||
use Nextend\Framework\Form\Element\Devices;
|
||||
use Nextend\Framework\Form\Element\Grouping;
|
||||
use Nextend\Framework\Form\Element\Hidden;
|
||||
use Nextend\Framework\Form\Element\MarginPadding;
|
||||
use Nextend\Framework\Form\Element\OnOff;
|
||||
use Nextend\Framework\Form\Element\Select;
|
||||
use Nextend\Framework\Form\Element\Text;
|
||||
use Nextend\Framework\Form\Element\Text\Number;
|
||||
use Nextend\Framework\Form\Element\Text\NumberAutoComplete;
|
||||
use Nextend\Framework\Form\Element\Text\NumberSlider;
|
||||
use Nextend\Framework\Form\Fieldset\LayerWindow\FieldsetLayerWindowLabelFields;
|
||||
use Nextend\SmartSlider3\Form\Element\Radio\HorizontalAlign;
|
||||
use Nextend\SmartSlider3\Form\Element\Radio\VerticalAlign;
|
||||
use Nextend\SmartSlider3Pro\Form\Element\CanvasLayerParentPicker;
|
||||
|
||||
class LayerWindowSettingsCommon extends AbstractLayerWindowSettings {
|
||||
|
||||
public function getName() {
|
||||
return 'common';
|
||||
}
|
||||
|
||||
protected function extendStyle() {
|
||||
|
||||
$this->responsive($this->styleContainer);
|
||||
|
||||
$this->effect($this->styleContainer);
|
||||
|
||||
$this->normalPosition($this->styleContainer);
|
||||
|
||||
$this->normalSize($this->styleContainer);
|
||||
|
||||
$this->absolutePosition($this->styleContainer);
|
||||
|
||||
$this->absoluteSize($this->styleContainer);
|
||||
|
||||
$this->advanced($this->styleContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function normalPosition($container) {
|
||||
|
||||
$position = new FieldsetLayerWindowLabelFields($container, 'fields-common-placement-content-position', n2_('Position'), array(
|
||||
'attributes' => array(
|
||||
'data-placement' => 'normal'
|
||||
)
|
||||
));
|
||||
|
||||
new Select($position, 'position-default', n2_('Position'), 'default', array(
|
||||
'options' => array(
|
||||
'default' => n2_('Default'),
|
||||
'absolute' => n2_('Absolute')
|
||||
),
|
||||
'tipLabel' => n2_('Position'),
|
||||
'tipDescription' => n2_('The editing mode the layer is positioned in.'),
|
||||
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1916-slide-editing-in-smart-slider-3'
|
||||
));
|
||||
|
||||
new HorizontalAlign($position, 'normal-selfalign', n2_('Align'), 'inherit', array(
|
||||
'inherit' => true,
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'tipLabel' => n2_('Align'),
|
||||
'tipDescription' => n2_('Positions the layer horizontally within its parent.')
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function normalSize($container) {
|
||||
|
||||
$size = new FieldsetLayerWindowLabelFields($container, 'fields-common-placement-content-size', n2_('Size'), array(
|
||||
'attributes' => array(
|
||||
'data-placement' => 'normal'
|
||||
)
|
||||
));
|
||||
|
||||
new Number($size, 'normal-maxwidth', n2_('Max width'), 0, array(
|
||||
'wide' => 4,
|
||||
'unit' => 'px',
|
||||
'min' => 0,
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
|
||||
new Number($size, 'normal-height', n2_('Height'), 0, array(
|
||||
'wide' => 4,
|
||||
'unit' => 'px',
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'tipLabel' => n2_('Height'),
|
||||
'tipDescription' => n2_('You can set a fix height for your layer.')
|
||||
));
|
||||
|
||||
$margin = new MarginPadding($size, 'normal-margin', n2_('Margin'), '0|*|0|*|0|*|0', array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'tipLabel' => n2_('Margin'),
|
||||
'tipDescription' => n2_('With margins you can create distance between your layers.')
|
||||
)); // spacing
|
||||
|
||||
$margin->setUnit('px');
|
||||
|
||||
for ($i = 1; $i < 5; $i++) {
|
||||
new NumberAutoComplete($margin, 'normal-margin-' . $i, false, '', array(
|
||||
'values' => array(
|
||||
0,
|
||||
5,
|
||||
10,
|
||||
20,
|
||||
30
|
||||
),
|
||||
'wide' => 3
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function absolutePosition($container) {
|
||||
|
||||
$position = new FieldsetLayerWindowLabelFields($container, 'fields-common-placement-absolute-position', n2_('Position'), array(
|
||||
'attributes' => array(
|
||||
'data-placement' => 'absolute'
|
||||
)
|
||||
));
|
||||
|
||||
new Hidden($position, 'adaptive-font', 1);
|
||||
|
||||
new Select($position, 'position-absolute', n2_('Position'), 'absolute', array(
|
||||
'options' => array(
|
||||
'default' => n2_('Default'),
|
||||
'absolute' => n2_('Absolute')
|
||||
)
|
||||
));
|
||||
|
||||
new HorizontalAlign($position, 'align', n2_('Align'), 'left', array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
|
||||
new VerticalAlign($position, 'valign', n2_('Vertical align'), 'top', array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
|
||||
$row2 = new Grouping($position, 'absolute-position-row2', false);
|
||||
|
||||
new Number($row2, 'left', n2_('Left'), '', array(
|
||||
'unit' => 'px',
|
||||
'wide' => 4,
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
new Number($row2, 'top', n2_('Top'), '', array(
|
||||
'unit' => 'px',
|
||||
'wide' => 4,
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
new OnOff($row2, 'responsive-position', n2_('Responsive'), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function absoluteSize($container) {
|
||||
|
||||
$size = new FieldsetLayerWindowLabelFields($container, 'fields-common-placement-absolute-size', n2_('Size'), array(
|
||||
'attributes' => array(
|
||||
'data-placement' => 'absolute'
|
||||
)
|
||||
));
|
||||
new Text($size, 'width', n2_('Width'), '', array(
|
||||
'unit' => 'px',
|
||||
'style' => 'width:32px;',
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
new Text($size, 'height', n2_('Height'), '', array(
|
||||
'unit' => 'px',
|
||||
'style' => 'width:32px;',
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
new OnOff($size, 'responsive-size', n2_('Responsive'), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function responsive($container) {
|
||||
|
||||
$responsive = new FieldsetLayerWindowLabelFields($container, 'fields-common-responsive', n2_('Responsive'));
|
||||
|
||||
new Text($responsive, 'generator-visible', n2_('Hide when variable empty'), '', array(
|
||||
'rowAttributes' => array(
|
||||
'data-generator-related' => '1'
|
||||
),
|
||||
'style' => 'width:280px;'
|
||||
));
|
||||
|
||||
new Devices($responsive, 'show', n2_('Hide on'));
|
||||
|
||||
new NumberSlider($responsive, 'font-size', n2_('Text scale'), 100, array(
|
||||
'min' => 10,
|
||||
'max' => 200,
|
||||
'step' => 10,
|
||||
'unit' => '%',
|
||||
'wide' => 3,
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
|
||||
new Button($responsive, '-clear-device-specific-changes', n2_('Device specific settings'), n2_('Clear'), array(
|
||||
'tipLabel' => n2_('Clear device specific settings'),
|
||||
'tipDescription' => n2_('Erases all device specific changes you made on the current device.'),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function effect($container) {
|
||||
|
||||
$effect = new FieldsetLayerWindowLabelFields($container, 'fields-common-effect', n2_('Effect'));
|
||||
|
||||
new Select($effect, 'crop', n2_('Crop'), 'visible', array(
|
||||
'options' => array(
|
||||
'visible' => n2_('Off'),
|
||||
'hidden' => n2_('On'),
|
||||
'auto' => n2_('Scroll'),
|
||||
'mask' => n2_('Mask')
|
||||
),
|
||||
'tipLabel' => n2_('Crop'),
|
||||
'tipDescription' => n2_('If your content is larger than the layer, you can crop it to fit.')
|
||||
));
|
||||
|
||||
new Number($effect, 'rotation', n2_('Rotation'), 0, array(
|
||||
'wide' => 3,
|
||||
'unit' => '°'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function advanced($container) {
|
||||
|
||||
$advanced = new FieldsetLayerWindowLabelFields($container, 'fields-common-advanced', n2_('Advanced'));
|
||||
|
||||
new Number($advanced, 'zindex', 'Z Index', 2, array(
|
||||
'wide' => 4
|
||||
));
|
||||
|
||||
new Text($advanced, 'class', n2_('CSS Class'), '', array(
|
||||
'style' => 'width:220px;',
|
||||
'tipLabel' => n2_('CSS Class'),
|
||||
'tipDescription' => n2_('You can add a custom CSS class on the layer container.'),
|
||||
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1812-layer-style#css-class',
|
||||
));
|
||||
|
||||
new Hidden($advanced, 'id');
|
||||
|
||||
new Hidden($advanced, 'uniqueclass');
|
||||
}
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings;
|
||||
|
||||
|
||||
use Nextend\Framework\Form\ContainerInterface;
|
||||
use Nextend\Framework\Form\Element\Hidden;
|
||||
use Nextend\Framework\Form\Element\LayerWindowFocus;
|
||||
use Nextend\Framework\Form\Element\MarginPadding;
|
||||
use Nextend\Framework\Form\Element\Select\Gradient;
|
||||
use Nextend\Framework\Form\Element\Text\Color;
|
||||
use Nextend\Framework\Form\Element\Text\FieldImage;
|
||||
use Nextend\Framework\Form\Element\Text\HiddenText;
|
||||
use Nextend\Framework\Form\Element\Text\Number;
|
||||
use Nextend\Framework\Form\Element\Text\NumberAutoComplete;
|
||||
use Nextend\Framework\Form\Fieldset\LayerWindow\FieldsetLayerWindowLabelFields;
|
||||
use Nextend\Framework\Form\Fieldset\LayerWindow\FieldsetLayerWindowStyleMode;
|
||||
use Nextend\SmartSlider3\Form\Element\Radio\FlexAlign;
|
||||
use Nextend\SmartSlider3\Form\Element\Radio\HorizontalAlign;
|
||||
use Nextend\SmartSlider3\Form\Element\Radio\InnerAlign;
|
||||
|
||||
class LayerWindowSettingsContent extends AbstractLayerWindowSettings {
|
||||
|
||||
public function getName() {
|
||||
return 'content';
|
||||
}
|
||||
|
||||
protected function extendContent() {
|
||||
|
||||
|
||||
$general = new FieldsetLayerWindowLabelFields($this->contentContainer, 'fields-content-general', n2_('General'));
|
||||
|
||||
new Hidden($general, 'content-opened', 1);
|
||||
|
||||
new InnerAlign($general, 'content-inneralign', n2_('Inner align'), 'inherit', array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'tipLabel' => n2_('Inner align'),
|
||||
'tipDescription' => n2_('Positions the layers inside horizontally.')
|
||||
));
|
||||
new FlexAlign($general, 'content-verticalalign', n2_('Vertical align'), 'center', array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'tipLabel' => n2_('Vertical align'),
|
||||
'tipDescription' => n2_('Positions the layers inside vertically.')
|
||||
));
|
||||
}
|
||||
|
||||
protected function extendStyle() {
|
||||
|
||||
$this->backgroundImage($this->styleContainer);
|
||||
$this->background($this->styleContainer);
|
||||
$this->spacing($this->styleContainer);
|
||||
$this->position($this->styleContainer);
|
||||
$this->size($this->styleContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function backgroundImage($container) {
|
||||
|
||||
$backgroundImage = new FieldsetLayerWindowLabelFields($container, 'fields-content-background-image', n2_('Background image'));
|
||||
|
||||
$fieldImage = new FieldImage($backgroundImage, 'content-background-image', n2_('Background image'), '', array(
|
||||
'width' => 220,
|
||||
'relatedFields' => array(
|
||||
'layercontent-background-focus'
|
||||
)
|
||||
));
|
||||
|
||||
$fieldFocusX = new HiddenText($backgroundImage, 'content-background-focus-x', 50);
|
||||
$fieldFocusY = new HiddenText($backgroundImage, 'content-background-focus-y', 50);
|
||||
|
||||
$focusField = new LayerWindowFocus($backgroundImage, 'content-background-focus', n2_('Focus'), array(
|
||||
'tipLabel' => n2_('Focus'),
|
||||
'tipDescription' => n2_('You can set the starting position of a background image. This makes sure that the selected part will always remain visible, so you should pick the most important part.')
|
||||
));
|
||||
|
||||
$focusField->setFields($fieldImage, $fieldFocusX, $fieldFocusY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function background($container) {
|
||||
|
||||
$background = new FieldsetLayerWindowStyleMode($container, 'fields-content-background', n2_('Content background'), array(
|
||||
'' => 'Normal',
|
||||
'-hover' => 'Hover'
|
||||
));
|
||||
|
||||
new Color($background, 'content-background-color', n2_('Background color'), 'ffffff00', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
new Gradient($background, 'content-background-gradient', n2_('Gradient'), 'off', array(
|
||||
'relatedFields' => array(
|
||||
'layercontent-background-color-end'
|
||||
)
|
||||
));
|
||||
|
||||
new Color($background, 'content-background-color-end', n2_('Color end'), 'ffffff00', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function spacing($container) {
|
||||
|
||||
$spacing = new FieldsetLayerWindowLabelFields($container, 'fields-content-spacing', n2_('Spacing'));
|
||||
|
||||
$padding = new MarginPadding($spacing, 'content-padding', n2_('Padding'), '5|*|5|*|5|*|5', array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
$padding->setUnit('px');
|
||||
|
||||
for ($i = 1; $i < 5; $i++) {
|
||||
new NumberAutoComplete($padding, 'content-padding-' . $i, false, '', array(
|
||||
'values' => array(
|
||||
0,
|
||||
5,
|
||||
10,
|
||||
20,
|
||||
30
|
||||
),
|
||||
'wide' => 3
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function position($container) {
|
||||
|
||||
$position = new FieldsetLayerWindowLabelFields($container, 'fields-content-position', n2_('Position'));
|
||||
|
||||
new HorizontalAlign($position, 'content-selfalign', n2_('Align'), 'center', array(
|
||||
'inherit' => true,
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function size($container) {
|
||||
|
||||
$size = new FieldsetLayerWindowLabelFields($container, 'fields-content-size', n2_('Size'));
|
||||
|
||||
new Number($size, 'content-maxwidth', n2_('Max width'), 0, array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'unit' => 'px',
|
||||
'wide' => 5
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings;
|
||||
|
||||
|
||||
use Nextend\Framework\Asset\Js\Js;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\BlockLayerWindow;
|
||||
use Nextend\SmartSlider3\Renderable\Item\AbstractItem;
|
||||
use Nextend\SmartSlider3\Slider\Admin\AdminSlider;
|
||||
|
||||
class LayerWindowSettingsItem extends AbstractLayerWindowSettings {
|
||||
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* @var AbstractItem
|
||||
*/
|
||||
protected $item;
|
||||
|
||||
/**
|
||||
* LayerWindowSettingsItem constructor.
|
||||
*
|
||||
* @param string $type
|
||||
* @param AbstractItem $item
|
||||
* @param BlockLayerWindow $blockLayerWindow
|
||||
* @param AdminSlider $renderableAdminSlider
|
||||
*/
|
||||
public function __construct($type, $item, $blockLayerWindow, $renderableAdminSlider) {
|
||||
|
||||
$this->type = $type;
|
||||
|
||||
$this->item = $item;
|
||||
|
||||
Js::addGlobalInline('window["itemValues/' . $this->type . '"]=' . json_encode($item->getValues()) . ';');
|
||||
|
||||
$item->loadResources($renderableAdminSlider);
|
||||
|
||||
parent::__construct($blockLayerWindow);
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return 'item/' . $this->type;
|
||||
}
|
||||
|
||||
protected function createContentContainer($container) {
|
||||
parent::createContentContainer($container);
|
||||
$this->contentContainer->setControlName('item_' . $this->type);
|
||||
}
|
||||
|
||||
protected function createStyleContainer($container) {
|
||||
parent::createStyleContainer($container);
|
||||
$this->styleContainer->setControlName('item_' . $this->type);
|
||||
}
|
||||
|
||||
protected function extendContent() {
|
||||
|
||||
$this->item->renderFields($this->contentContainer);
|
||||
}
|
||||
|
||||
protected function extendStyle() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,211 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings;
|
||||
|
||||
|
||||
use Nextend\Framework\Form\Container\LayerWindow\ContainerDesign;
|
||||
use Nextend\Framework\Form\Element\Button;
|
||||
use Nextend\Framework\Form\Element\Decoration;
|
||||
use Nextend\Framework\Form\Element\MarginPadding;
|
||||
use Nextend\Framework\Form\Element\MixedField\Border;
|
||||
use Nextend\Framework\Form\Element\MixedField\BoxShadow;
|
||||
use Nextend\Framework\Form\Element\MixedField\FontSize;
|
||||
use Nextend\Framework\Form\Element\MixedField\TextShadow;
|
||||
use Nextend\Framework\Form\Element\Radio\TextAlign;
|
||||
use Nextend\Framework\Form\Element\Select;
|
||||
use Nextend\Framework\Form\Element\Select\FontWeight;
|
||||
use Nextend\Framework\Form\Element\Text\Color;
|
||||
use Nextend\Framework\Form\Element\Text\Family;
|
||||
use Nextend\Framework\Form\Element\Text\NumberAutoComplete;
|
||||
use Nextend\Framework\Form\Element\Text\NumberSlider;
|
||||
use Nextend\Framework\Form\Element\Text\TextAutoComplete;
|
||||
use Nextend\Framework\Form\Element\Textarea;
|
||||
use Nextend\Framework\Form\Element\Unit;
|
||||
use Nextend\Framework\Form\Fieldset\LayerWindow\FieldsetDesign;
|
||||
|
||||
class LayerWindowSettingsItemCommon extends AbstractLayerWindowSettings {
|
||||
|
||||
public function getName() {
|
||||
return 'item';
|
||||
}
|
||||
|
||||
protected function extendStyle() {
|
||||
|
||||
$designContainer = new ContainerDesign($this->styleContainer, 'layer_window_design');
|
||||
|
||||
$this->font($designContainer);
|
||||
$this->style($designContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerDesign $container
|
||||
*/
|
||||
protected function font($container) {
|
||||
|
||||
$font = new FieldsetDesign($container, 'basiccss-font', n2_('Typography'));
|
||||
|
||||
new Family($font, '-font-family', n2_('Family'), 'Arial, Helvetica', array(
|
||||
'style' => 'width:168px;',
|
||||
'tipLabel' => n2_('Family'),
|
||||
'tipDescription' => n2_('You can select a font family from the preset, or type your custom family.'),
|
||||
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1828-using-your-own-fonts',
|
||||
));
|
||||
new Color($font, '-font-color', n2_('Color'), '000000FF', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
new FontSize($font, '-font-size', n2_('Size'), '14|*|px', array(
|
||||
'tipLabel' => n2_('Size'),
|
||||
'tipDescription' => n2_('Need to change the font size device specifically? Use the Text scale option.')
|
||||
));
|
||||
|
||||
new FontWeight($font, '-font-weight', n2_('Font weight'), '');
|
||||
|
||||
new TextAutoComplete($font, '-font-lineheight', n2_('Line height'), '18px', array(
|
||||
'values' => array(
|
||||
'normal',
|
||||
'1',
|
||||
'1.2',
|
||||
'1.5',
|
||||
'1.8',
|
||||
'2'
|
||||
),
|
||||
'style' => 'width:50px;'
|
||||
));
|
||||
|
||||
new TextAlign($font, '-font-textalign', n2_('Text align'), 'inherit');
|
||||
|
||||
new Decoration($font, '-font-decoration', n2_('Decoration'));
|
||||
|
||||
new Button\ButtonMoreLess($font, '-font-more', '', array(
|
||||
'relatedFields' => array(
|
||||
'layer-font-letterspacing',
|
||||
'layer-font-wordspacing',
|
||||
'layer-font-texttransform',
|
||||
'layer-font-tshadow',
|
||||
'layer-font-extracss'
|
||||
)
|
||||
));
|
||||
|
||||
new TextAutoComplete($font, '-font-letterspacing', n2_('Letter spacing'), 'normal', array(
|
||||
'values' => array(
|
||||
'normal',
|
||||
'1px',
|
||||
'2px',
|
||||
'5px',
|
||||
'10px',
|
||||
'15px'
|
||||
),
|
||||
'style' => 'width:73px;'
|
||||
));
|
||||
|
||||
new TextAutoComplete($font, '-font-wordspacing', n2_('Word spacing'), 'normal', array(
|
||||
'values' => array(
|
||||
'normal',
|
||||
'2px',
|
||||
'5px',
|
||||
'10px',
|
||||
'15px'
|
||||
),
|
||||
'style' => 'width:72px;'
|
||||
));
|
||||
|
||||
new Select($font, '-font-texttransform', n2_('Transform'), 'none', array(
|
||||
'options' => array(
|
||||
'none' => n2_('None'),
|
||||
'capitalize' => n2_('Capitalize'),
|
||||
'uppercase' => n2_('Uppercase'),
|
||||
'lowercase' => n2_('Lowercase')
|
||||
)
|
||||
));
|
||||
|
||||
new TextShadow($font, '-font-tshadow', n2_('Text shadow'), '0|*|0|*|1|*|000000FF');
|
||||
|
||||
new Textarea($font, '-font-extracss', 'CSS', '', array(
|
||||
'width' => 314,
|
||||
'height' => 80
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param ContainerDesign $container
|
||||
*/
|
||||
protected function style($container) {
|
||||
|
||||
$backgroundFieldset = new FieldsetDesign($container, 'basiccss-style', n2_('Background'));
|
||||
|
||||
new Color($backgroundFieldset, '-style-backgroundcolor', n2_('Background color'), '000000FF', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
new NumberSlider($backgroundFieldset, '-style-opacity', n2_('Opacity'), '100', array(
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'unit' => '%',
|
||||
'wide' => 3
|
||||
));
|
||||
|
||||
new Button\ButtonMoreLess($backgroundFieldset, '-style-more', '', array(
|
||||
'relatedFields' => array(
|
||||
'layer-style-extracss',
|
||||
'layer-style-boxshadow'
|
||||
)
|
||||
));
|
||||
|
||||
new BoxShadow($backgroundFieldset, '-style-boxshadow', n2_('Box shadow'), '0|*|0|*|0|*|0|*|000000ff');
|
||||
|
||||
new Textarea($backgroundFieldset, '-style-extracss', 'CSS', '', array(
|
||||
'width' => 314,
|
||||
'height' => 80
|
||||
));
|
||||
|
||||
|
||||
$borderFieldset = new FieldsetDesign($container, 'basiccss-style-border', n2_('Border'));
|
||||
$borderFieldset->setParentDesign('fieldset-layer-window-basiccss-style');
|
||||
$borderFieldset->addAttribute('data-singular', 'style-border');
|
||||
|
||||
new Border($borderFieldset, '-style-border', n2_('Border'), '0|*|solid|*|000000ff');
|
||||
|
||||
new NumberAutoComplete($borderFieldset, '-style-borderradius', n2_('Border radius'), '0', array(
|
||||
'min' => 0,
|
||||
'values' => array(
|
||||
0,
|
||||
3,
|
||||
5,
|
||||
10,
|
||||
99
|
||||
),
|
||||
'unit' => 'px',
|
||||
'wide' => 3
|
||||
));
|
||||
|
||||
|
||||
$spacingFieldset = new FieldsetDesign($container, 'basiccss-style-spacing', n2_('Spacing'));
|
||||
$spacingFieldset->setParentDesign('fieldset-layer-window-basiccss-style');
|
||||
$spacingFieldset->addAttribute('data-singular', 'style-spacing');
|
||||
|
||||
$padding = new MarginPadding($spacingFieldset, '-style-padding', n2_('Padding'), '0|*|0|*|0|*|0|*|px');
|
||||
for ($i = 1; $i < 5; $i++) {
|
||||
new NumberAutoComplete($padding, 'padding-' . $i, false, '', array(
|
||||
'values' => array(
|
||||
0,
|
||||
5,
|
||||
10,
|
||||
20,
|
||||
30
|
||||
),
|
||||
'style' => 'width: 22px;'
|
||||
));
|
||||
}
|
||||
|
||||
new Unit($padding, 'padding-5', '', '', array(
|
||||
'units' => array(
|
||||
'px',
|
||||
'em',
|
||||
'%'
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,252 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings;
|
||||
|
||||
|
||||
use Nextend\Framework\Form\ContainerInterface;
|
||||
use Nextend\Framework\Form\Element\Hidden;
|
||||
use Nextend\Framework\Form\Element\LayerWindowFocus;
|
||||
use Nextend\Framework\Form\Element\MarginPadding;
|
||||
use Nextend\Framework\Form\Element\MixedField\BoxShadow;
|
||||
use Nextend\Framework\Form\Element\OnOff;
|
||||
use Nextend\Framework\Form\Element\Select;
|
||||
use Nextend\Framework\Form\Element\Select\Gradient;
|
||||
use Nextend\Framework\Form\Element\Select\LinkTarget;
|
||||
use Nextend\Framework\Form\Element\Text;
|
||||
use Nextend\Framework\Form\Element\Text\Color;
|
||||
use Nextend\Framework\Form\Element\Text\FieldImage;
|
||||
use Nextend\Framework\Form\Element\Text\HiddenText;
|
||||
use Nextend\Framework\Form\Element\Text\NumberAutoComplete;
|
||||
use Nextend\Framework\Form\Element\Text\NumberSlider;
|
||||
use Nextend\Framework\Form\Element\Text\Url;
|
||||
use Nextend\Framework\Form\Fieldset\LayerWindow\FieldsetLayerWindowLabelFields;
|
||||
use Nextend\Framework\Form\Fieldset\LayerWindow\FieldsetLayerWindowStyleMode;
|
||||
use Nextend\SmartSlider3\Form\Element\Columns;
|
||||
use Nextend\SmartSlider3\Form\Element\Radio\InnerAlign;
|
||||
|
||||
class LayerWindowSettingsRow extends AbstractLayerWindowSettings {
|
||||
|
||||
public function getName() {
|
||||
return 'row';
|
||||
}
|
||||
|
||||
protected function extendContent() {
|
||||
|
||||
$structure = new FieldsetLayerWindowLabelFields($this->contentContainer, 'fields-row-structure', n2_('Columns'));
|
||||
|
||||
new Columns($structure, 'row-columns', '1');
|
||||
|
||||
new Hidden($structure, 'row-opened', 1);
|
||||
|
||||
|
||||
$rowGeneral = new FieldsetLayerWindowLabelFields($this->contentContainer, 'fields-row-general', n2_('General'));
|
||||
|
||||
new InnerAlign($rowGeneral, 'row-inneralign', n2_('Inner align'), 'inherit', array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'tipLabel' => n2_('Inner align'),
|
||||
'tipDescription' => n2_('Positions the layers inside horizontally.')
|
||||
));
|
||||
|
||||
new NumberSlider($rowGeneral, 'row-gutter', n2_('Gutter'), '', array(
|
||||
'min' => 0,
|
||||
'max' => 300,
|
||||
'sliderMax' => 160,
|
||||
'unit' => 'px',
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'style' => 'width: 22px;',
|
||||
'tipLabel' => n2_('Gutter'),
|
||||
'tipDescription' => n2_('Creates space between the columns')
|
||||
));
|
||||
|
||||
new NumberSlider($rowGeneral, 'row-wrap-after', n2_('Wrap after'), 0, array(
|
||||
'min' => 0,
|
||||
'max' => 10,
|
||||
'style' => 'width:22px;',
|
||||
'unit' => n2_('Column'),
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
),
|
||||
'tipLabel' => n2_('Wrap after'),
|
||||
'tipDescription' => n2_('Breaks the columns to the given amount of rows.')
|
||||
));
|
||||
|
||||
new OnOff($rowGeneral, 'row-fullwidth', n2_('Full width'), 1, array(
|
||||
'relatedFieldsOn' => array(
|
||||
'layerrow-wrap-after'
|
||||
)
|
||||
));
|
||||
|
||||
new OnOff($rowGeneral, 'row-stretch', n2_('Stretch'), 0, array(
|
||||
'tipLabel' => n2_('Stretch'),
|
||||
'tipDescription' => n2_('Makes the row fill the available vertical space')
|
||||
));
|
||||
|
||||
|
||||
$link = new FieldsetLayerWindowLabelFields($this->contentContainer, 'fields-row-link', n2_('Link'));
|
||||
|
||||
new Url($link, 'row-href', n2_('Link'), '', array(
|
||||
'relatedFields' => array(
|
||||
'layerrow-href-target',
|
||||
'layerrow-aria-label'
|
||||
),
|
||||
'width' => 248
|
||||
));
|
||||
new LinkTarget($link, 'row-href-target', n2_('Target window'));
|
||||
|
||||
new Text($link, 'row-aria-label', n2_('ARIA label'), '', array(
|
||||
'style' => 'width:190px;',
|
||||
'tipLabel' => n2_('ARIA label')
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
protected function extendStyle() {
|
||||
|
||||
$this->backgroundImage($this->styleContainer);
|
||||
$this->background($this->styleContainer);
|
||||
$this->border($this->styleContainer);
|
||||
$this->spacing($this->styleContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function backgroundImage($container) {
|
||||
|
||||
$backgroundImage = new FieldsetLayerWindowLabelFields($container, 'fields-row-background-image', n2_('Background image'));
|
||||
$fieldImage = new FieldImage($backgroundImage, 'row-background-image', n2_('Background image'), '', array(
|
||||
'width' => 220,
|
||||
'relatedFields' => array(
|
||||
'layerrow-background-focus'
|
||||
)
|
||||
));
|
||||
|
||||
$fieldFocusX = new HiddenText($backgroundImage, 'row-background-focus-x', 50);
|
||||
$fieldFocusY = new HiddenText($backgroundImage, 'row-background-focus-y', 50);
|
||||
|
||||
$focusField = new LayerWindowFocus($backgroundImage, 'row-background-focus', n2_('Focus'), array(
|
||||
'tipLabel' => n2_('Focus'),
|
||||
'tipDescription' => n2_('You can set the starting position of a background image. This makes sure that the selected part will always remain visible, so you should pick the most important part.')
|
||||
));
|
||||
|
||||
$focusField->setFields($fieldImage, $fieldFocusX, $fieldFocusY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function background($container) {
|
||||
|
||||
$background = new FieldsetLayerWindowStyleMode($container, 'fields-row-background', n2_('Background'), array(
|
||||
'' => 'Normal',
|
||||
'-hover' => 'Hover'
|
||||
));
|
||||
|
||||
new Color($background, 'row-background-color', n2_('Background color'), 'ffffff00', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
new Gradient($background, 'row-background-gradient', n2_('Gradient'), 'off', array(
|
||||
'relatedFields' => array(
|
||||
'layerrow-background-color-end'
|
||||
)
|
||||
));
|
||||
|
||||
new Color($background, 'row-background-color-end', n2_('Color end'), 'ffffff00', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
new BoxShadow($background, 'row-boxshadow', n2_('Box shadow'), '0|*|0|*|0|*|0|*|00000080');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function border($container) {
|
||||
|
||||
$border = new FieldsetLayerWindowStyleMode($container, 'fields-row-border', n2_('Border'), array(
|
||||
'' => 'Normal',
|
||||
'-hover' => 'Hover'
|
||||
));
|
||||
|
||||
|
||||
$borderWidth = new MarginPadding($border, 'row-border-width', n2_('Border'), '0|*|0|*|0|*|0', array(
|
||||
'unit' => 'px',
|
||||
'relatedFields' => array(
|
||||
'layerrow-border-style',
|
||||
'layerrow-border-color'
|
||||
)
|
||||
));
|
||||
|
||||
for ($i = 1; $i < 5; $i++) {
|
||||
new NumberAutoComplete($borderWidth, 'row-border-width-' . $i, false, '', array(
|
||||
'values' => array(
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
5
|
||||
),
|
||||
'wide' => 3
|
||||
));
|
||||
}
|
||||
|
||||
new Select($border, 'row-border-style', n2_('Style'), 'none', array(
|
||||
'options' => array(
|
||||
'none' => n2_('None'),
|
||||
'solid' => n2_('Solid'),
|
||||
'dashed' => n2_('Dashed'),
|
||||
'dotted' => n2_('Dotted'),
|
||||
)
|
||||
));
|
||||
|
||||
new Color($border, 'row-border-color', n2_('Color'), 'ffffffff', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
new NumberAutoComplete($border, 'row-border-radius', n2_('Border radius'), 0, array(
|
||||
'values' => array(
|
||||
0,
|
||||
3,
|
||||
5,
|
||||
10,
|
||||
99
|
||||
),
|
||||
'style' => 'width: 22px;',
|
||||
'unit' => 'px'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*/
|
||||
protected function spacing($container) {
|
||||
|
||||
$spacing = new FieldsetLayerWindowLabelFields($container, 'fields-row-spacing', n2_('Spacing'));
|
||||
|
||||
$padding = new MarginPadding($spacing, 'row-padding', n2_('Padding'), '10|*|10|*|10|*|10', array(
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
$padding->setUnit('px');
|
||||
|
||||
for ($i = 1; $i < 5; $i++) {
|
||||
new NumberAutoComplete($padding, 'row-padding-' . $i, false, '', array(
|
||||
'values' => array(
|
||||
0,
|
||||
5,
|
||||
10,
|
||||
20,
|
||||
30
|
||||
),
|
||||
'style' => 'width: 22px;'
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,311 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Settings;
|
||||
|
||||
|
||||
use Nextend\Framework\Form\Element\Button;
|
||||
use Nextend\Framework\Form\Element\Devices;
|
||||
use Nextend\Framework\Form\Element\Grouping;
|
||||
use Nextend\Framework\Form\Element\LayerWindowFocus;
|
||||
use Nextend\Framework\Form\Element\MarginPadding;
|
||||
use Nextend\Framework\Form\Element\Message\Warning;
|
||||
use Nextend\Framework\Form\Element\OnOff;
|
||||
use Nextend\Framework\Form\Element\Select;
|
||||
use Nextend\Framework\Form\Element\Select\Gradient;
|
||||
use Nextend\Framework\Form\Element\Select\LinkTarget;
|
||||
use Nextend\Framework\Form\Element\Text;
|
||||
use Nextend\Framework\Form\Element\Text\Color;
|
||||
use Nextend\Framework\Form\Element\Text\FieldImage;
|
||||
use Nextend\Framework\Form\Element\Text\FieldImageResponsive;
|
||||
use Nextend\Framework\Form\Element\Text\Number;
|
||||
use Nextend\Framework\Form\Element\Text\NumberAutoComplete;
|
||||
use Nextend\Framework\Form\Element\Text\NumberSlider;
|
||||
use Nextend\Framework\Form\Element\Text\Url;
|
||||
use Nextend\Framework\Form\Element\Text\Video;
|
||||
use Nextend\Framework\Form\Element\Textarea;
|
||||
use Nextend\Framework\Form\Fieldset\LayerWindow\FieldsetLayerWindow;
|
||||
use Nextend\Framework\Form\Fieldset\LayerWindow\FieldsetLayerWindowLabelFields;
|
||||
use Nextend\SmartSlider3\Form\Element\BackgroundImage;
|
||||
use Nextend\SmartSlider3\Form\Element\DatePicker;
|
||||
use Nextend\SmartSlider3\Slider\Admin\AdminSlider;
|
||||
use Nextend\SmartSlider3\Slider\SliderType\SliderTypeFactory;
|
||||
|
||||
class LayerWindowSettingsSlide extends AbstractLayerWindowSettings {
|
||||
|
||||
/** @var AdminSlider */
|
||||
protected $renderableAdminSlider;
|
||||
|
||||
/**
|
||||
* LayerWindowSettingsSlide constructor.
|
||||
*
|
||||
* @param $blockLayerWindow
|
||||
* @param AdminSlider $renderableAdminSlider
|
||||
*/
|
||||
public function __construct($blockLayerWindow, $renderableAdminSlider) {
|
||||
$this->renderableAdminSlider = $renderableAdminSlider;
|
||||
parent::__construct($blockLayerWindow);
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return 'slide';
|
||||
}
|
||||
|
||||
protected function extendContent() {
|
||||
|
||||
$general = new FieldsetLayerWindow($this->contentContainer, 'fields-slide-general', n2_('General'));
|
||||
new Text($general, 'slide-title', n2_('Slide title'), n2_('Slide'), array(
|
||||
'style' => 'width:302px;',
|
||||
));
|
||||
new Textarea($general, 'slide-description', n2_('Description'), '', array(
|
||||
'width' => 314
|
||||
));
|
||||
|
||||
new FieldImage($general, 'slide-thumbnail', n2_('Thumbnail'), '', array(
|
||||
'width' => 220,
|
||||
'relatedFields' => array(
|
||||
'layerslide-thumbnailAlt'
|
||||
)
|
||||
));
|
||||
new Text($general, 'slide-thumbnailAlt', n2_('Thumbnail alt') . ' [SEO]', '', array(
|
||||
'style' => "width:133px;"
|
||||
));
|
||||
|
||||
|
||||
if (!$this->renderableAdminSlider->getEditedSlide()
|
||||
->isStatic()) {
|
||||
$link = new FieldsetLayerWindow($this->contentContainer, 'fields-slide-link', n2_('Link'));
|
||||
|
||||
new Url($link, 'slide-href', n2_('Link'), '', array(
|
||||
'relatedFields' => array(
|
||||
'layerslide-href-target',
|
||||
'layerslide-aria-label'
|
||||
),
|
||||
'width' => 248
|
||||
));
|
||||
new LinkTarget($link, 'slide-href-target', n2_('Target window'));
|
||||
|
||||
new Text($link, 'slide-aria-label', n2_('ARIA label'), '', array(
|
||||
'style' => 'width:190px;',
|
||||
'tipLabel' => n2_('ARIA label')
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
if (!$this->renderableAdminSlider->getEditedSlide()
|
||||
->isStatic()) {
|
||||
SliderTypeFactory::getType($this->renderableAdminSlider->data->get('type'))
|
||||
->createAdmin()
|
||||
->renderSlideFields($this->contentContainer);
|
||||
}
|
||||
|
||||
if ($this->renderableAdminSlider->getEditedSlide()
|
||||
->hasGenerator()) {
|
||||
$generator = new FieldsetLayerWindow($this->contentContainer, 'fields-slide-generator', n2_('Generator'));
|
||||
new Number($generator, 'slide-slide-generator-slides', n2_('Slides'), 5, array(
|
||||
'unit' => n2_x('slides', 'Unit'),
|
||||
'wide' => 3
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
$advanced = new FieldsetLayerWindow($this->contentContainer, 'fields-slide-advanced', n2_('Advanced'));
|
||||
|
||||
if ($this->renderableAdminSlider->params->get('global-lightbox', 0)) {
|
||||
new FieldImageResponsive($advanced, 'slide-ligthboxImage', n2_('Custom lightbox image'), '', array(
|
||||
'width' => 180
|
||||
));
|
||||
}
|
||||
|
||||
new OnOff($advanced, 'slide-published', n2_('Published'), 1);
|
||||
|
||||
if (!$this->renderableAdminSlider->getEditedSlide()
|
||||
->isStatic() && $this->renderableAdminSlider->params->get('autoplay')) {
|
||||
new Number($advanced, 'slide-slide-duration', n2_('Slide duration'), 0, array(
|
||||
'unit' => 'ms',
|
||||
'wide' => 5
|
||||
));
|
||||
}
|
||||
|
||||
if (!$this->renderableAdminSlider->getEditedSlide()
|
||||
->isStatic()) {
|
||||
new Select($advanced, 'slide-thumbnailType', n2_('Thumbnail type'), 'default', array(
|
||||
'options' => array(
|
||||
'default' => n2_('Default'),
|
||||
'videoDark' => n2_('Video')
|
||||
),
|
||||
'tipLabel' => n2_('Thumbnail type'),
|
||||
'tipDescription' => n2_('If you have a video on your slide, you can put a play icon on the thumbnail image to indicate that.'),
|
||||
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1724-slide#thumbnail-type'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
protected function extendStyle() {
|
||||
if (!$this->renderableAdminSlider->getEditedSlide()
|
||||
->isStatic()) {
|
||||
$this->background();
|
||||
}
|
||||
|
||||
$spacing = new FieldsetLayerWindowLabelFields($this->styleContainer, 'fields-slide-spacing', n2_('Spacing'));
|
||||
|
||||
$padding = new MarginPadding($spacing, 'slide-padding', n2_('Padding'), '10|*|10|*|10|*|10', array(
|
||||
'unit' => 'px',
|
||||
'rowAttributes' => array(
|
||||
'data-devicespecific' => ''
|
||||
)
|
||||
));
|
||||
|
||||
for ($i = 1; $i < 5; $i++) {
|
||||
new NumberAutoComplete($padding, 'slide-padding-' . $i, false, '', array(
|
||||
'values' => array(
|
||||
0,
|
||||
5,
|
||||
10,
|
||||
20,
|
||||
30
|
||||
),
|
||||
'style' => 'width: 22px;'
|
||||
));
|
||||
}
|
||||
|
||||
new Button($spacing, '-slide-clear-device-specific-changes', n2_('Device specific settings'), n2_('Clear'), array(
|
||||
'tipLabel' => n2_('Clear device specific settings'),
|
||||
'tipDescription' => n2_('Erases all device specific changes you made on the current device.'),
|
||||
));
|
||||
}
|
||||
|
||||
private function background() {
|
||||
|
||||
$background = new FieldsetLayerWindowLabelFields($this->styleContainer, 'fields-slide-background', n2_('Background'));
|
||||
new BackgroundImage($background->getFieldsetLabel(), 'slide-background-type', false, 'color', array(
|
||||
'relatedValueFields' => array(
|
||||
array(
|
||||
'values' => array(
|
||||
'image',
|
||||
'video'
|
||||
),
|
||||
'field' => array(
|
||||
'layer-slide-background-image',
|
||||
'layerslide-backgroundColorOverlay',
|
||||
'fieldset-layer-window-fields-slide-seo'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'values' => array(
|
||||
'image'
|
||||
),
|
||||
'field' => array(
|
||||
'layerslide-kenburns-animation'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'values' => array(
|
||||
'video'
|
||||
),
|
||||
'field' => array(
|
||||
'layer-slide-background-video'
|
||||
)
|
||||
),
|
||||
)
|
||||
));
|
||||
|
||||
$rowImage = new Grouping($background, '-slide-background-image');
|
||||
|
||||
$slideBackgroundAttr = array(
|
||||
'width' => 180,
|
||||
'relatedFields' => array(
|
||||
'layerslide-background-focus',
|
||||
'layerslide-backgroundFocusX',
|
||||
'layerslide-backgroundFocusY',
|
||||
'layerslide-backgroundImageOpacity',
|
||||
'layerslide-backgroundImageBlur',
|
||||
'layerslide-backgroundMode',
|
||||
'layerslide-background-notice-image',
|
||||
)
|
||||
);
|
||||
$fieldImage = new FieldImageResponsive($rowImage, 'slide-backgroundImage', n2_('Slide background'), '', $slideBackgroundAttr);
|
||||
|
||||
$focusField = new LayerWindowFocus($rowImage, 'slide-background-focus', n2_('Focus'));
|
||||
|
||||
$fieldFocusX = new Number($rowImage, 'slide-backgroundFocusX', false, 50, array(
|
||||
'wide' => 3,
|
||||
'sublabel' => 'X',
|
||||
'unit' => '%'
|
||||
));
|
||||
$fieldFocusY = new Number($rowImage, 'slide-backgroundFocusY', false, 50, array(
|
||||
'wide' => 3,
|
||||
'sublabel' => 'Y',
|
||||
'unit' => '%'
|
||||
));
|
||||
|
||||
$focusField->setFields($fieldImage, $fieldFocusX, $fieldFocusY);
|
||||
|
||||
new Warning($rowImage, 'slide-background-notice-image', sprintf(n2_('Please read %1$sour detailed guide%2$s about setting your own slide background correctly.'), '<a href="https://smartslider.helpscoutdocs.com/article/1922-how-to-set-your-background-image" target="_blank">', '</a>'));
|
||||
|
||||
|
||||
new Select\FillMode($rowImage, 'slide-backgroundMode', n2_('Fill mode'), 'default', array(
|
||||
'useGlobal' => true,
|
||||
'relatedValueFields' => array(
|
||||
array(
|
||||
'values' => array(
|
||||
'blurfit'
|
||||
),
|
||||
'field' => array(
|
||||
'layerslide-backgroundBlurFit'
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
new NumberSlider($rowImage, 'slide-backgroundBlurFit', n2_('Background blur'), 7, array(
|
||||
'unit' => 'px',
|
||||
'min' => 7,
|
||||
'max' => 50,
|
||||
'wide' => 3
|
||||
));
|
||||
|
||||
new NumberSlider($rowImage, 'slide-backgroundImageOpacity', n2_('Opacity'), 100, array(
|
||||
'unit' => '%',
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'style' => 'width:33px;'
|
||||
));
|
||||
|
||||
new NumberSlider($rowImage, 'slide-backgroundImageBlur', n2_('Blur'), 0, array(
|
||||
'unit' => 'px',
|
||||
'min' => 0,
|
||||
'max' => 50,
|
||||
'style' => 'width:33px;'
|
||||
));
|
||||
|
||||
$rowColor = new Grouping($background, '-slide-background-color');
|
||||
|
||||
new Color($rowColor, 'slide-backgroundColor', n2_('Color'), 'ffffff00', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
new Gradient($rowColor, 'slide-backgroundGradient', n2_('Gradient'), 'off', array(
|
||||
'relatedFields' => array(
|
||||
'layerslide-backgroundColorEnd'
|
||||
)
|
||||
));
|
||||
|
||||
new Color($rowColor, 'slide-backgroundColorEnd', n2_('Color end'), 'ffffff00', array(
|
||||
'alpha' => true
|
||||
));
|
||||
|
||||
new OnOff($rowColor, 'slide-backgroundColorOverlay', n2_('Overlay'), 0, array(
|
||||
'tipLabel' => n2_('Overlay'),
|
||||
'tipDescription' => n2_('Puts the color in front of the image.')
|
||||
));
|
||||
|
||||
|
||||
$seo = new FieldsetLayerWindowLabelFields($this->styleContainer, 'fields-slide-seo', n2_('SEO'));
|
||||
new Text($seo, 'slide-backgroundAlt', n2_('Image alt') . ' [SEO]', '', array(
|
||||
'style' => "width:133px;"
|
||||
));
|
||||
new Text($seo, 'slide-backgroundTitle', n2_('Image title') . ' [SEO]', '', array(
|
||||
'style' => "width:133px;"
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Tab;
|
||||
|
||||
|
||||
use Nextend\Framework\Form\ContainerInterface;
|
||||
use Nextend\Framework\Form\Form;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\BlockLayerWindow;
|
||||
|
||||
abstract class AbstractTab {
|
||||
|
||||
/**
|
||||
* @var BlockLayerWindow
|
||||
*/
|
||||
protected $blockLayerWindow;
|
||||
|
||||
/**
|
||||
* @var Form
|
||||
*/
|
||||
protected $form;
|
||||
|
||||
/**
|
||||
* AbstractTab constructor.
|
||||
*
|
||||
* @param BlockLayerWindow $blockLayerWindow
|
||||
*/
|
||||
public function __construct($blockLayerWindow) {
|
||||
|
||||
$this->blockLayerWindow = $blockLayerWindow;
|
||||
|
||||
$this->form = new Form($blockLayerWindow, 'layer');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ContainerInterface
|
||||
*/
|
||||
public function getContainer() {
|
||||
return $this->form->getContainer();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getName();
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getLabel();
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getIcon();
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->form->render();
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Tab;
|
||||
|
||||
|
||||
use Nextend\Framework\Form\Container\LayerWindow\ContainerAnimation;
|
||||
use Nextend\Framework\Form\Element\Grouping;
|
||||
use Nextend\Framework\Form\Element\MixedField;
|
||||
use Nextend\Framework\Form\Element\OnOff;
|
||||
use Nextend\Framework\Form\Element\Select;
|
||||
use Nextend\Framework\Form\Element\Select\Easing;
|
||||
use Nextend\Framework\Form\Element\Text;
|
||||
use Nextend\Framework\Form\Element\Text\Color;
|
||||
use Nextend\Framework\Form\Element\Text\Number;
|
||||
use Nextend\Framework\Form\Element\Text\NumberAutoComplete;
|
||||
use Nextend\Framework\Form\Element\Text\NumberSlider;
|
||||
use Nextend\Framework\Form\Element\Text\TextMultiAutoComplete;
|
||||
use Nextend\Framework\Form\Fieldset\LayerWindow\FieldsetLayerWindow;
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Tab;
|
||||
|
||||
class TabContent extends AbstractTab {
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return 'content';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLabel() {
|
||||
return n2_('Content');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getIcon() {
|
||||
return 'ssi_24 ssi_24--edit';
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Tab;
|
||||
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Core\FreeNeedMore\BlockFreeNeedMore;
|
||||
class TabGoPro extends AbstractTab {
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return 'animations';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLabel() {
|
||||
return n2_('Animation');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getIcon() {
|
||||
return 'ssi_24 ssi_24--animation';
|
||||
}
|
||||
|
||||
public function display() {
|
||||
$freeNeedMore = new BlockFreeNeedMore($this->getContainer()
|
||||
->getForm());
|
||||
$freeNeedMore->setSource('layer-window-animation');
|
||||
$freeNeedMore->display();
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\LayerWindow\Tab;
|
||||
|
||||
|
||||
class TabStyle extends AbstractTab {
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return 'style';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLabel() {
|
||||
return n2_('Style');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getIcon() {
|
||||
return 'ssi_24 ssi_24--style';
|
||||
}
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideBox;
|
||||
|
||||
|
||||
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\TraitAdminUrl;
|
||||
use Nextend\SmartSlider3\Slider\Feature\Optimize;
|
||||
use Nextend\SmartSlider3\Slider\Slide;
|
||||
use Nextend\SmartSlider3\Slider\Slider;
|
||||
|
||||
class BlockSlideBox extends AbstractBlock {
|
||||
|
||||
use TraitAdminUrl;
|
||||
|
||||
protected $groupID = 0;
|
||||
|
||||
/** @var Slider */
|
||||
protected $slider;
|
||||
|
||||
/** @var Slide */
|
||||
protected $slide;
|
||||
|
||||
/** @var Optimize */
|
||||
protected $optimize;
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('SlideBox');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $groupID
|
||||
*/
|
||||
public function setGroupID($groupID) {
|
||||
$this->groupID = $groupID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Slider $slider
|
||||
*/
|
||||
public function setSlider($slider) {
|
||||
$this->slider = $slider;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Slide $slide
|
||||
*/
|
||||
public function setSlide($slide) {
|
||||
$this->slide = $slide;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Optimize $optimize
|
||||
*/
|
||||
public function setOptimize($optimize) {
|
||||
$this->optimize = $optimize;
|
||||
}
|
||||
|
||||
public function getSlideId() {
|
||||
|
||||
return $this->slide->id;
|
||||
}
|
||||
|
||||
public function getSlideTitle() {
|
||||
|
||||
return $this->slide->getTitle(true);
|
||||
}
|
||||
|
||||
public function getEditUrl() {
|
||||
|
||||
return $this->getUrlSlideEdit($this->slide->id, $this->slider->sliderId, $this->groupID);
|
||||
}
|
||||
|
||||
public function getThumbnailOptimized() {
|
||||
$image = $this->slide->getThumbnailDynamic();
|
||||
if (empty($image)) {
|
||||
$image = ResourceTranslator::toUrl('$ss3-frontend$/images/placeholder/image.png');
|
||||
}
|
||||
|
||||
return $this->optimize->adminOptimizeThumbnail($image);
|
||||
}
|
||||
|
||||
public function getPublishUrl() {
|
||||
|
||||
return $this->getUrlSlidePublish($this->slide->id, $this->slider->sliderId, $this->groupID);
|
||||
}
|
||||
|
||||
public function getUnPublishUrl() {
|
||||
|
||||
return $this->getUrlSlideUnPublish($this->slide->id, $this->slider->sliderId, $this->groupID);
|
||||
}
|
||||
|
||||
public function getClasses() {
|
||||
$classes = array();
|
||||
|
||||
if ($this->slide->isStatic()) {
|
||||
$classes[] = 'n2_slide_box--static-overlay';
|
||||
}
|
||||
|
||||
if ($this->slide->isFirst()) {
|
||||
$classes[] = 'n2_slide_box--first-slide';
|
||||
}
|
||||
|
||||
if ($this->slide->published) {
|
||||
$classes[] = 'n2_slide_box--published';
|
||||
}
|
||||
|
||||
if ($this->slide->hasGenerator()) {
|
||||
$classes[] = 'n2_slide_box--has-generator';
|
||||
}
|
||||
|
||||
if ($this->slide->isCurrentlyEdited()) {
|
||||
$classes[] = 'n2_slide_box--currently-edited';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
public function isStaticSlide() {
|
||||
return !!$this->slide->parameters->get('static-slide', 0);
|
||||
}
|
||||
|
||||
public function hasGenerator() {
|
||||
return $this->slide->hasGenerator();
|
||||
}
|
||||
|
||||
public function getGeneratorLabel() {
|
||||
return $this->slide->getGeneratorLabel() . ' [' . $this->slide->getSlideStat() . ']';
|
||||
}
|
||||
|
||||
public function getGeneratorAttributeUrl() {
|
||||
return $this->getUrlGeneratorEdit($this->slide->generator_id, $this->groupID) . '"';
|
||||
}
|
||||
|
||||
public function getHiddenDeviceText() {
|
||||
$hiddenViews = array();
|
||||
if (!$this->slide->isVisibleDesktopPortrait()) {
|
||||
$hiddenViews[] = n2_('Desktop');
|
||||
}
|
||||
if (!$this->slide->isVisibleTabletPortrait()) {
|
||||
$hiddenViews[] = n2_('Tablet');
|
||||
}
|
||||
if (!$this->slide->isVisibleMobilePortrait()) {
|
||||
$hiddenViews[] = n2_('Mobile');
|
||||
}
|
||||
|
||||
if (!empty($hiddenViews)) {
|
||||
return sprintf(n2_('This slide is hidden on the following devices: %s'), implode(', ', $hiddenViews));
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideBox;
|
||||
|
||||
/**
|
||||
* @var BlockSlideBox $this
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="n2_slide_manager__box n2_slide_box <?php echo esc_attr(implode(' ', $this->getClasses())); ?>"
|
||||
data-slideid="<?php echo esc_attr($this->getSlideId()); ?>"
|
||||
<?php echo $this->hasGenerator() ? ' data-generator-edit="' . esc_url($this->getGeneratorAttributeUrl()) . '"' : ''; ?>>
|
||||
|
||||
<div class="n2_slide_box__content" style="background-image: url('<?php echo esc_url($this->getThumbnailOptimized()); ?>');">
|
||||
|
||||
<div class="n2_slide_box__slide_overlay">
|
||||
<a class="n2_slide_box__slide_overlay_link" href="<?php echo esc_url($this->getEditUrl()); ?>"></a>
|
||||
<a class="n2_slide_box__slide_overlay_edit_button" href="<?php echo esc_url($this->getEditUrl()); ?>">
|
||||
<?php
|
||||
n2_e('Edit');
|
||||
?>
|
||||
</a>
|
||||
<div class="n2_slide_box__slide_select_tick">
|
||||
<i class="ssi_16 ssi_16--check"></i>
|
||||
</div>
|
||||
|
||||
<div class="n2_slide_box__slide_actions">
|
||||
<a class="n2_slide_box__slide_action_more n2_button_icon n2_button_icon--small n2_button_icon--grey-dark" href="#"><i class="ssi_16 ssi_16--more"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="n2_slide_box__details">
|
||||
<?php
|
||||
if ($this->isStaticSlide()):
|
||||
?>
|
||||
<div class="n2_slide_box__details_static_slide"><?php n2_e('Static overlay'); ?></div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<?php
|
||||
if ($this->hasGenerator()):
|
||||
?>
|
||||
<div class="n2_slide_box__details_generator"><?php echo esc_html($this->getGeneratorLabel()); ?></div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="n2_slide_box__footer">
|
||||
<div class="n2_slide_box__footer_title">
|
||||
<?php
|
||||
echo esc_html($this->getSlideTitle());
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="n2_slide_box__footer_status">
|
||||
|
||||
<?php
|
||||
$hiddenViews = $this->getHiddenDeviceText();
|
||||
?>
|
||||
<a class="n2_slide_box__footer_status_hidden" href="<?php echo esc_url($this->getEditUrl()); ?>" data-n2tip="<?php echo esc_attr($hiddenViews); ?>">
|
||||
<i class="ssi_16 ssi_16--hide"></i>
|
||||
</a>
|
||||
|
||||
<div class="n2_slide_box__footer_status_first_slide" data-n2tip="<?php n2_e('First slide'); ?>">
|
||||
<i class="ssi_16 ssi_16--star"></i>
|
||||
</div>
|
||||
|
||||
<a class="n2_slide_box__footer_status_published" href="<?php echo esc_url($this->getUnPublishUrl()); ?>" data-n2tip="<?php n2_e('Published'); ?>">
|
||||
<i class="ssi_16 ssi_16--filledcheck"></i>
|
||||
</a>
|
||||
|
||||
<a class="n2_slide_box__footer_status_unpublished" href="<?php echo esc_url($this->getPublishUrl()); ?>" data-n2tip="<?php n2_e('Unpublished'); ?>">
|
||||
<i class="ssi_16 ssi_16--filledremove"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideManager\ActionBar;
|
||||
|
||||
/**
|
||||
* @var BlockActionBar $this
|
||||
*/
|
||||
?>
|
||||
<div class="n2_slide_manager__action_bar">
|
||||
<?php
|
||||
|
||||
$this->displayBulkActions();
|
||||
|
||||
?>
|
||||
</div>
|
@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideManager\ActionBar;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonPlain;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu\BlockFloatingMenu;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu\BlockFloatingMenuItem;
|
||||
|
||||
class BlockActionBar extends AbstractBlock {
|
||||
|
||||
/**
|
||||
* @var BlockFloatingMenu
|
||||
*/
|
||||
protected $blockBulkActions;
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('ActionBar');
|
||||
}
|
||||
|
||||
public function displayBulkActions() {
|
||||
|
||||
$this->blockBulkActions = new BlockFloatingMenu($this);
|
||||
$this->blockBulkActions->setRelatedClass('n2_slide_manager__action_bar_bulk_actions');
|
||||
$this->blockBulkActions->addClass('n2_slide_manager__action_bar_bulk_actions');
|
||||
$this->blockBulkActions->setContentID('n2_slide_manager_bulk_actions');
|
||||
|
||||
$blockButton = new BlockButtonPlain($this);
|
||||
$blockButton->setLabel(n2_('Bulk actions'));
|
||||
$blockButton->setIcon('ssi_16 ssi_16--selectarrow');
|
||||
$blockButton->setSmall();
|
||||
$this->blockBulkActions->setButton($blockButton);
|
||||
|
||||
|
||||
/**
|
||||
* Bulk actions
|
||||
*/
|
||||
$class = 'n2_slide_manager__action_bar_bulk_action';
|
||||
|
||||
$this->createAction(n2_('Duplicate'), 'duplicate', $class);
|
||||
$this->createAction(n2_('Copy'), 'copy', $class);
|
||||
$this->createAction(n2_('Delete'), 'delete', $class)
|
||||
->setRed();
|
||||
$this->createAction(n2_('Publish'), 'publish', $class);
|
||||
$this->createAction(n2_('Unpublish'), 'unpublish', $class);
|
||||
|
||||
|
||||
$this->blockBulkActions->addSeparator(array(
|
||||
'n2_slide_manager__action_bar_bulk_action'
|
||||
));
|
||||
|
||||
/**
|
||||
* Quick selection
|
||||
*/
|
||||
$this->createAction(n2_('Select all'), 'select-all', false, true);
|
||||
$this->createAction(n2_('Select none'), 'select-none', false);
|
||||
$this->createAction(n2_('Select published'), 'select-published', false, true);
|
||||
$this->createAction(n2_('Select unpublished'), 'select-unpublished', false, true);
|
||||
|
||||
|
||||
$this->blockBulkActions->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $label
|
||||
* @param $action
|
||||
* @param bool|string $class
|
||||
* @param bool $stayOpen
|
||||
*
|
||||
* @return BlockFloatingMenuItem
|
||||
*/
|
||||
private function createAction($label, $action, $class = false, $stayOpen = false) {
|
||||
|
||||
$item = new BlockFloatingMenuItem($this);
|
||||
$item->setLabel($label);
|
||||
$item->addAttribute('data-action', $action);
|
||||
|
||||
if ($class) {
|
||||
$item->addClass($class);
|
||||
}
|
||||
|
||||
if ($stayOpen) {
|
||||
$item->setStayOpen();
|
||||
}
|
||||
|
||||
$this->blockBulkActions->addMenuItem($item);
|
||||
|
||||
return $item;
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideManager\AddSlide;
|
||||
|
||||
use Nextend\Framework\Platform\Platform;
|
||||
|
||||
/**
|
||||
* @var $this BlockAddSlide
|
||||
*/
|
||||
|
||||
?>
|
||||
<div class="n2_slide_manager__add_slide_actions">
|
||||
<div class="n2_slide_manager__add_slide_actions_inner">
|
||||
|
||||
<a href="#" class="n2_slide_manager__add_slide_action n2_slide_manager__add_slide_action--image" data-action="image">
|
||||
<div class="n2_slide_manager__add_slide_action_icon">
|
||||
<i class="ssi_48 ssi_48--image"></i>
|
||||
</div>
|
||||
<div class="n2_slide_manager__add_slide_action_label"><?php n2_e('Image'); ?></div>
|
||||
</a>
|
||||
|
||||
<a href="#" class="n2_slide_manager__add_slide_action n2_slide_manager__add_slide_action--empty-slide" data-action="empty-slide">
|
||||
<div class="n2_slide_manager__add_slide_action_icon">
|
||||
<i class="ssi_48 ssi_48--empty"></i>
|
||||
</div>
|
||||
<div class="n2_slide_manager__add_slide_action_label"><?php n2_e('Blank'); ?></div>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if (Platform::hasPosts()) :
|
||||
?>
|
||||
<a href="#" class="n2_slide_manager__add_slide_action n2_slide_manager__add_slide_action--post" data-action="post">
|
||||
<div class="n2_slide_manager__add_slide_action_icon">
|
||||
<i class="ssi_48 ssi_48--post"></i>
|
||||
</div>
|
||||
<div class="n2_slide_manager__add_slide_action_label"><?php n2_e('Post'); ?></div>
|
||||
</a>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
|
||||
<a href="#" class="n2_slide_manager__add_slide_action n2_slide_manager__add_slide_action--static" data-action="static-overlay">
|
||||
<div class="n2_slide_manager__add_slide_action_icon">
|
||||
<i class="ssi_48 ssi_48--static"></i>
|
||||
</div>
|
||||
<div class="n2_slide_manager__add_slide_action_label"><?php n2_e('Static overlay'); ?></div>
|
||||
</a>
|
||||
|
||||
<a href="<?php echo esc_url($this->getDynamicSlidesUrl()); ?>" class="n2_slide_manager__add_slide_action n2_slide_manager__add_slide_action--dynamic">
|
||||
<div class="n2_slide_manager__add_slide_action_icon">
|
||||
<i class="ssi_48 ssi_48--dynamic"></i>
|
||||
</div>
|
||||
<div class="n2_slide_manager__add_slide_action_label"><?php n2_e('Dynamic slides'); ?></div>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideManager\AddSlide;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\TraitAdminUrl;
|
||||
|
||||
class BlockAddSlide extends AbstractBlock {
|
||||
|
||||
use TraitAdminUrl;
|
||||
|
||||
protected $groupID = 0;
|
||||
|
||||
protected $sliderID = 0;
|
||||
|
||||
public function display() {
|
||||
$this->renderTemplatePart('AddSlide');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $groupID
|
||||
*/
|
||||
public function setGroupID($groupID) {
|
||||
$this->groupID = $groupID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSliderID() {
|
||||
return $this->sliderID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $sliderID
|
||||
*/
|
||||
public function setSliderID($sliderID) {
|
||||
$this->sliderID = $sliderID;
|
||||
}
|
||||
|
||||
public function getDynamicSlidesUrl() {
|
||||
|
||||
return $this->getUrlGeneratorCreate($this->getSliderID(), $this->groupID);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideManager;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\TraitAdminUrl;
|
||||
use Nextend\SmartSlider3\Slider\Slider;
|
||||
|
||||
class BlockSlideManager extends AbstractBlock {
|
||||
|
||||
use TraitAdminUrl;
|
||||
|
||||
protected $groupID = 0;
|
||||
|
||||
/** @var integer */
|
||||
protected $sliderID;
|
||||
|
||||
protected $breadcrumbOpener = false;
|
||||
|
||||
protected $classes = array(
|
||||
'n2_slide_manager'
|
||||
);
|
||||
|
||||
/**
|
||||
* @return Slider
|
||||
*/
|
||||
public function getSliderObject() {
|
||||
|
||||
$sliderObj = new Slider($this, $this->sliderID, array(), true);
|
||||
$sliderObj->initSlider();
|
||||
|
||||
return $sliderObj;
|
||||
}
|
||||
|
||||
public function setGroupID($groupID) {
|
||||
|
||||
$this->groupID = $groupID;
|
||||
}
|
||||
|
||||
public function setSliderID($sliderID) {
|
||||
|
||||
$this->sliderID = $sliderID;
|
||||
}
|
||||
|
||||
public function display() {
|
||||
$this->renderTemplatePart('SlideManager');
|
||||
}
|
||||
|
||||
public function addClass($className) {
|
||||
$this->classes[] = $className;
|
||||
}
|
||||
|
||||
public function getClass() {
|
||||
return implode(' ', $this->classes);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasBreadcrumbOpener() {
|
||||
return $this->breadcrumbOpener;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $breadcrumbOpener
|
||||
*/
|
||||
public function setBreadcrumbOpener($breadcrumbOpener) {
|
||||
$this->breadcrumbOpener = $breadcrumbOpener;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,181 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideManager;
|
||||
|
||||
use Nextend\Framework\Asset\Js\Js;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideBox\BlockSlideBox;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideManager\ActionBar\BlockActionBar;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slide\SlideManager\AddSlide\BlockAddSlide;
|
||||
use Nextend\SmartSlider3\Application\Model\ModelSlides;
|
||||
use Nextend\SmartSlider3\Slider\Feature\Optimize;
|
||||
use Nextend\SmartSlider3\Slider\Slide;
|
||||
use Nextend\SmartSlider3\SmartSlider3Info;
|
||||
|
||||
/**
|
||||
* @var $this BlockSlideManager
|
||||
*/
|
||||
|
||||
$sliderObj = $this->getSliderObject();
|
||||
|
||||
$sliderType = $sliderObj->data->get('type', 'simple');
|
||||
|
||||
SmartSlider3Info::initLicense();
|
||||
|
||||
$slidesModel = new ModelSlides($this);
|
||||
|
||||
$slides = $slidesModel->getAll($sliderObj->sliderId);
|
||||
$optimize = new Optimize($sliderObj);
|
||||
|
||||
$parameters = array();
|
||||
$parameters['nonce'] = wp_create_nonce('internal-linking');
|
||||
$parameters['wpAjaxUrl'] = admin_url('admin-ajax.php');
|
||||
|
||||
|
||||
$sliderEditUrl = $this->getUrlSliderEdit($sliderObj->sliderId, $this->groupID);
|
||||
|
||||
$options = array(
|
||||
'url' => $this->getUrlSlidesUniversal($sliderObj->sliderId, $this->groupID),
|
||||
'ajaxUrl' => $this->getAjaxUrlSlidesUniversal($sliderObj->sliderId, $this->groupID),
|
||||
'sliderUrl' => $sliderEditUrl,
|
||||
'contentAjaxUrl' => $this->getAjaxUrlContentSearchContent()
|
||||
);
|
||||
|
||||
Js::addInline('new _N2.SlidesManager(' . json_encode($options) . ', ' . json_encode($parameters) . ', ' . (defined('N2_IMAGE_UPLOAD_DISABLE') ? 1 : 0) . ", '" . $this->createAjaxUrl(array('browse/upload')) . "', 'slider" . $sliderObj->sliderId . "');");
|
||||
|
||||
$slideCount = 0;
|
||||
$hasPublishedGenerator = false;
|
||||
foreach ($slides as $slide) {
|
||||
if ($slide['published']) {
|
||||
$slideCount++;
|
||||
if (!empty($slide['generator_id'])) {
|
||||
$hasPublishedGenerator = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Js::addGlobalInline('document.documentElement.setAttribute("data-slides", "' . count($slides) . '");');
|
||||
Js::addGlobalInline('document.documentElement.setAttribute("data-published-regular-slides", "' . $slideCount . '");');
|
||||
?>
|
||||
|
||||
<script>
|
||||
<?php
|
||||
if($this->hasBreadcrumbOpener()):
|
||||
?>
|
||||
_N2.r(['$', 'documentReady'], function () {
|
||||
var $ = _N2.$;
|
||||
var isVisible = false,
|
||||
$editorOverLay = $('.n2_admin_editor_overlay'),
|
||||
toggle = function () {
|
||||
isVisible = !isVisible;
|
||||
$editorOverLay.toggleClass('n2_admin_editor_overlay--show-slides', isVisible);
|
||||
},
|
||||
hide = function () {
|
||||
isVisible = true;
|
||||
toggle();
|
||||
},
|
||||
$slideManager = $('.n2_slide_manager');
|
||||
|
||||
$('.n2_nav_bar__breadcrumb_button_slides').on('click', toggle);
|
||||
$slideManager.find('.n2_slide_manager__exit').on('click', hide);
|
||||
});
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</script>
|
||||
|
||||
<div class="<?php echo esc_attr($this->getClass()); ?>" data-breadcrumbopener="<?php echo $this->hasBreadcrumbOpener() ? 1 : 0; ?>">
|
||||
<div class="n2_slide_manager__inner">
|
||||
<?php
|
||||
|
||||
$addSlide = new BlockAddSlide($this);
|
||||
$addSlide->setGroupID($this->groupID);
|
||||
$addSlide->setSliderID($sliderObj->sliderId);
|
||||
$addSlide->display();
|
||||
|
||||
$actionBar = new BlockActionBar($this);
|
||||
$actionBar->display();
|
||||
|
||||
?>
|
||||
<div class="n2_slide_manager__content">
|
||||
|
||||
<div class="n2_slide_manager__box n2_slide_manager__add_slide">
|
||||
<i class="n2_slide_manager__add_slide_icon ssi_48 ssi_48--plus"></i>
|
||||
<div class="n2_slide_manager__add_slide_label n2_slide_manager__add_slide_label--add-slide">
|
||||
<?php n2_e('Add slide'); ?>
|
||||
</div>
|
||||
<div class="n2_slide_manager__add_slide_label n2_slide_manager__add_slide_label--close">
|
||||
<?php n2_e('Close'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($sliderType == 'block'):
|
||||
?>
|
||||
<div class="n2_slide_manager__box n2_slide_manager__block_notice">
|
||||
<div class="n2_slide_box__footer_title n2_slide_manager__block_notice_description">
|
||||
<?php n2_e('Block must contain only one slide. Need more?'); ?>
|
||||
</div>
|
||||
<a class="n2_slide_manager__block_notice_button" href="<?php echo esc_url($sliderEditUrl); ?>#changeslidertype">
|
||||
<?php n2_e('Convert to slider'); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
elseif (!$hasPublishedGenerator):
|
||||
?>
|
||||
<div class="n2_slide_manager__box n2_slide_manager__autoplay_notice n2_form_element--hidden" data-field="autoplay-single-slide-notice">
|
||||
<div class="n2_slide_box__footer_title n2_slide_manager__autoplay_notice_description">
|
||||
<?php n2_e('Single slides are duplicated while autoplay is used.'); ?>
|
||||
</div>
|
||||
<a class="n2_slide_manager__autoplay_notice_button" href="#n2_top_bar_main_1">
|
||||
<?php n2_e('autoplay settings'); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
$slidesObj = array();
|
||||
foreach ($slides as $i => $slide) {
|
||||
$slidesObj[$i] = new Slide($sliderObj, $slide);
|
||||
$slidesObj[$i]->initGenerator();
|
||||
}
|
||||
|
||||
foreach ($slidesObj as $slideObj) {
|
||||
$slideObj->fillSample();
|
||||
|
||||
$blockSlideBox = new BlockSlideBox($this);
|
||||
|
||||
$blockSlideBox->setGroupID($this->groupID);
|
||||
$blockSlideBox->setSlider($sliderObj);
|
||||
$blockSlideBox->setSlide($slideObj);
|
||||
$blockSlideBox->setOptimize($optimize);
|
||||
|
||||
$blockSlideBox->display();
|
||||
}
|
||||
?>
|
||||
<div class="n2_slide_manager__box n2_slide_manager__dummy_slide">
|
||||
<i class="n2_slide_manager__dummy_slide_icon ssi_48 ssi_48--image"></i>
|
||||
<div class="n2_slide_manager__dummy_slide_label">
|
||||
<?php n2_e('Slide one'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($sliderType != 'block'): ?>
|
||||
<div class="n2_slide_manager__box n2_slide_manager__dummy_slide">
|
||||
<i class="n2_slide_manager__dummy_slide_icon ssi_48 ssi_48--image"></i>
|
||||
<div class="n2_slide_manager__dummy_slide_label">
|
||||
<?php n2_e('Slide two'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="n2_slide_manager__box n2_slide_manager__dummy_slide">
|
||||
<i class="n2_slide_manager__dummy_slide_icon ssi_48 ssi_48--drop"></i>
|
||||
<div class="n2_slide_manager__dummy_slide_label">
|
||||
<?php n2_e('Drop images here'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($this->hasBreadcrumbOpener()): ?>
|
||||
<div class="n2_slide_manager__exit"></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\DeviceZoom;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockDeviceZoom extends AbstractBlock {
|
||||
|
||||
public function display() {
|
||||
$this->renderTemplatePart('DeviceZoom');
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\DeviceZoom;
|
||||
|
||||
/**
|
||||
* @var $this BlockDeviceZoom
|
||||
*/
|
||||
|
||||
?>
|
||||
<div class="n2_device_changer">
|
||||
<div class="n2_device_changer__button">
|
||||
<i class="ssi_24 ssi_24--desktop"></i>
|
||||
</div>
|
||||
<div class="n2_device_tester"></div>
|
||||
</div>
|
||||
<script>
|
||||
_N2.r(['$', 'documentReady'], function () {
|
||||
var $ = _N2.$;
|
||||
var timeout,
|
||||
$el = $('.n2_device_tester_hover')
|
||||
.on({
|
||||
mouseenter: function () {
|
||||
if (timeout) {
|
||||
clearTimeout(timeout);
|
||||
timeout = undefined
|
||||
}
|
||||
$el.addClass('n2_device_tester_hover--hover');
|
||||
},
|
||||
mouseleave: function () {
|
||||
timeout = setTimeout(function () {
|
||||
$el.removeClass('n2_device_tester_hover--hover');
|
||||
}, 400);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderBox;
|
||||
|
||||
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\TraitAdminUrl;
|
||||
|
||||
class BlockSliderBox extends AbstractBlock {
|
||||
|
||||
use TraitAdminUrl;
|
||||
|
||||
protected $groupID = 0;
|
||||
|
||||
/** @var array */
|
||||
protected $slider;
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('SliderBox');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getSlider() {
|
||||
return $this->slider;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $slider
|
||||
*/
|
||||
public function setSlider($slider) {
|
||||
$this->slider = $slider;
|
||||
}
|
||||
|
||||
public function getEditUrl() {
|
||||
|
||||
return $this->getUrlSliderEdit($this->slider['id'], $this->groupID);
|
||||
}
|
||||
|
||||
public function getSimpleEditUrl() {
|
||||
|
||||
return $this->getUrlSliderSimpleEdit($this->slider['id'], $this->groupID);
|
||||
}
|
||||
|
||||
public function isGroup() {
|
||||
return $this->slider['type'] == 'group';
|
||||
}
|
||||
|
||||
public function getSliderTitle() {
|
||||
|
||||
return $this->slider['title'];
|
||||
}
|
||||
|
||||
public function getSliderID() {
|
||||
return $this->slider['id'];
|
||||
}
|
||||
|
||||
public function hasSliderAlias() {
|
||||
return !empty($this->slider['alias']);
|
||||
}
|
||||
|
||||
public function getSliderAlias() {
|
||||
return $this->slider['alias'];
|
||||
}
|
||||
|
||||
public function getThumbnail() {
|
||||
|
||||
$thumbnail = $this->slider['thumbnail'];
|
||||
if (empty($thumbnail)) {
|
||||
return '';
|
||||
} else {
|
||||
return ResourceTranslator::toUrl($thumbnail);
|
||||
}
|
||||
}
|
||||
|
||||
public function isThumbnailEmpty() {
|
||||
return empty($this->slider['thumbnail']);
|
||||
}
|
||||
|
||||
public function getChildrenCount() {
|
||||
if ($this->slider['slides'] > 0) {
|
||||
|
||||
return $this->slider['slides'];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
||||
public function getOrdering() {
|
||||
return $this->slider['ordering'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getGroupID() {
|
||||
return $this->groupID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $groupID
|
||||
*/
|
||||
public function setGroupID($groupID) {
|
||||
$this->groupID = $groupID;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderBox;
|
||||
|
||||
use Nextend\Framework\Sanitize;
|
||||
|
||||
/**
|
||||
* @var BlockSliderBox $this
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="n2_slider_manager__box n2_slider_box<?php echo $this->isGroup() ? ' n2_slider_box--group' : ' n2_slider_box--slider'; ?>"
|
||||
data-group="<?php echo $this->isGroup() ? '1' : '0'; ?>"
|
||||
data-title="<?php echo esc_attr($this->getSliderTitle()); ?>"
|
||||
data-sliderid="<?php echo esc_attr($this->getSliderID()); ?>"
|
||||
data-ordering="<?php echo esc_attr($this->getOrdering()); ?>">
|
||||
|
||||
<?php
|
||||
$thumbnailUrl = esc_attr($this->getThumbnail());
|
||||
$thumbnailStyle = '';
|
||||
if (!empty($thumbnailUrl)) {
|
||||
$thumbnailStyle = "background-image: url('" . $thumbnailUrl . "');";
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="n2_slider_box__content" style="<?php echo esc_attr($thumbnailStyle); ?>">
|
||||
<?php
|
||||
if ($this->isThumbnailEmpty()):
|
||||
$icon = "ssi_64 ssi_64--image";
|
||||
if ($this->isGroup()) {
|
||||
$icon = "ssi_64 ssi_64--folder";
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="n2_slider_box__icon">
|
||||
<div class="n2_slider_box__icon_container">
|
||||
<i class="<?php echo esc_attr($icon); ?>"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="n2_slider_box__slider_overlay">
|
||||
<a class="n2_slider_box__slider_overlay_link" href="<?php echo esc_url($this->getEditUrl()); ?>"></a>
|
||||
<a class="n2_slider_box__slider_overlay_edit_button n2_button n2_button--small n2_button--green" href="<?php echo esc_url($this->getEditUrl()); ?>">
|
||||
<?php
|
||||
n2_e('Edit');
|
||||
?>
|
||||
</a>
|
||||
<div class="n2_slider_box__slider_select_tick">
|
||||
<i class="ssi_16 ssi_16--check"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="n2_slider_box__slider_identifiers">
|
||||
<div class="n2_slider_box__slider_identifier">
|
||||
<?php
|
||||
echo '#' . esc_html($this->getSliderID());
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if ($this->isGroup()):
|
||||
?>
|
||||
<div class="n2_slider_box__slider_identifier">
|
||||
<?php
|
||||
n2_e('Group');
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<?php
|
||||
if ($this->hasSliderAlias()):
|
||||
?>
|
||||
<div class="n2_slider_box__slider_identifier">
|
||||
<?php
|
||||
echo esc_html($this->getSliderAlias());
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="n2_slider_box__slider_actions">
|
||||
<a class="n2_slider_box__slider_action_more n2_button_icon n2_button_icon--small n2_button_icon--grey-dark" href="#"><i class="ssi_16 ssi_16--more"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="n2_slider_box__footer">
|
||||
<?php
|
||||
if ($this->isGroup()):
|
||||
?>
|
||||
<div class="n2_slider_box__footer_icon">
|
||||
<i class="ssi_16 ssi_16--folderclosed"></i>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
<div class="n2_slider_box__footer_title">
|
||||
<?php
|
||||
echo esc_html($this->getSliderTitle());
|
||||
?>
|
||||
</div>
|
||||
<div class="n2_slider_box__footer_children_count">
|
||||
<?php
|
||||
echo esc_html($this->getChildrenCount());
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<a class="n2_slide_box__screen_reader" href="<?php echo esc_url($this->getSimpleEditUrl()); ?>">
|
||||
<?php
|
||||
echo esc_html(n2_('Edit Slider') . ': ' . $this->getSliderTitle());
|
||||
?>
|
||||
</a>
|
||||
</div>
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\ActionBar;
|
||||
|
||||
/**
|
||||
* @var BlockActionBar $this
|
||||
*/
|
||||
?>
|
||||
<div class="n2_slider_manager__action_bar">
|
||||
<div class="n2_slider_manager__action_bar_left">
|
||||
<?php
|
||||
|
||||
$this->displayOrderBy();
|
||||
|
||||
$this->displayCreateGroup();
|
||||
|
||||
$this->displayTrash();
|
||||
|
||||
$this->displayBulkActions();
|
||||
|
||||
?>
|
||||
</div>
|
||||
<div class="n2_slider_manager__action_bar_right">
|
||||
<?php if ($this->sliderManager->getGroupID() == 0) { ?>
|
||||
<div class="n2_slider_manager__search">
|
||||
<div class="n2_slider_manager__search_icon n2_slider_manager__search_icon--magnifier">
|
||||
<i class="ssi_16 ssi_16--magnifier"></i>
|
||||
</div>
|
||||
<div class="n2_slider_manager__search_icon n2_slider_manager__search_icon--abort">
|
||||
<i class="ssi_16 ssi_16--circularremove"></i>
|
||||
</div>
|
||||
<form class="n2_slider_manager__search_form" autocomplete="off">
|
||||
<input type="text" name="kw" class="n2_slider_manager__search_input" value="" placeholder="<?php n2_e('Search Project'); ?>" tabindex="-1">
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -0,0 +1,169 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\ActionBar;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonPlain;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu\BlockFloatingMenu;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu\BlockFloatingMenuItem;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\BlockSliderManager;
|
||||
use Nextend\SmartSlider3\Application\Admin\TraitAdminUrl;
|
||||
|
||||
class BlockActionBar extends AbstractBlock {
|
||||
|
||||
use TraitAdminUrl;
|
||||
|
||||
/**
|
||||
* @var BlockSliderManager
|
||||
*/
|
||||
protected $sliderManager;
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('ActionBar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BlockSliderManager $sliderManager
|
||||
*/
|
||||
public function setSliderManager($sliderManager) {
|
||||
$this->sliderManager = $sliderManager;
|
||||
}
|
||||
|
||||
public function displayCreateGroup() {
|
||||
}
|
||||
|
||||
public function displayTrash() {
|
||||
if ($this->sliderManager->getGroupID() == 0) {
|
||||
|
||||
$blockButton = new BlockButtonPlain($this);
|
||||
$blockButton->setUrl($this->getUrlTrash());
|
||||
$blockButton->setLabel(n2_('View trash'));
|
||||
$blockButton->addClass('n2_slider_trash');
|
||||
$blockButton->setSmall();
|
||||
$blockButton->setIconBefore('ssi_16 ssi_16--delete', 'n2_slider_icon--blue');
|
||||
$blockButton->setTabIndex(-1);
|
||||
$blockButton->display();
|
||||
}
|
||||
}
|
||||
|
||||
public function displayOrderBy() {
|
||||
if ($this->sliderManager->getGroupID() == 0) {
|
||||
|
||||
$orderBy = $this->sliderManager->getOrderBy();
|
||||
$orderByDirection = $this->sliderManager->getOrderByDirection();
|
||||
|
||||
$blockOrderBy = new BlockFloatingMenu($this);
|
||||
|
||||
$blockButton = new BlockButtonPlain($this);
|
||||
$blockButton->setLabel(n2_('Order by'));
|
||||
$blockButton->setIcon('ssi_16 ssi_16--selectarrow');
|
||||
$blockButton->setIconBefore('ssi_16 ssi_16--order', 'n2_slider_icon--blue');
|
||||
$blockButton->addClass('n2_slider_order');
|
||||
$blockButton->setSmall();
|
||||
$blockOrderBy->setButton($blockButton);
|
||||
|
||||
$manualOrder = new BlockFloatingMenuItem($this);
|
||||
$manualOrder->setLabel(n2_('Manual order'));
|
||||
$manualOrder->setIsActive($orderBy == 'ordering' && $orderByDirection == 'ASC');
|
||||
$manualOrder->addAttribute('data-ordering', 'ordering');
|
||||
$manualOrder->addAttribute('data-orderdirection', 'ASC');
|
||||
$manualOrder->addClass('n2_floating_menu__item-order');
|
||||
$manualOrder->setUrl('#');
|
||||
$blockOrderBy->addMenuItem($manualOrder);
|
||||
|
||||
$orderAZ = new BlockFloatingMenuItem($this);
|
||||
$orderAZ->setLabel(n2_('A-Z'));
|
||||
$orderAZ->setIsActive($orderBy == 'title' && $orderByDirection == 'ASC');
|
||||
$orderAZ->addAttribute('data-ordering', 'title');
|
||||
$orderAZ->addAttribute('data-orderdirection', 'ASC');
|
||||
$orderAZ->addClass('n2_floating_menu__item-order');
|
||||
$orderAZ->setUrl('#');
|
||||
$blockOrderBy->addMenuItem($orderAZ);
|
||||
|
||||
$orderZA = new BlockFloatingMenuItem($this);
|
||||
$orderZA->setLabel(n2_('Z-A'));
|
||||
$orderZA->setIsActive($orderBy == 'title' && $orderByDirection == 'DESC');
|
||||
$orderZA->addAttribute('data-ordering', 'title');
|
||||
$orderZA->addAttribute('data-orderdirection', 'DESC');
|
||||
$orderZA->addClass('n2_floating_menu__item-order');
|
||||
$orderZA->setUrl('#');
|
||||
$blockOrderBy->addMenuItem($orderZA);
|
||||
|
||||
$orderNewest = new BlockFloatingMenuItem($this);
|
||||
$orderNewest->setLabel(n2_('Newest first'));
|
||||
$orderNewest->setIsActive($orderBy == 'time' && $orderByDirection == 'DESC');
|
||||
$orderNewest->addAttribute('data-ordering', 'time');
|
||||
$orderNewest->addAttribute('data-orderdirection', 'DESC');
|
||||
$orderNewest->addClass('n2_floating_menu__item-order');
|
||||
$orderNewest->setUrl('#');
|
||||
$blockOrderBy->addMenuItem($orderNewest);
|
||||
|
||||
$orderOldest = new BlockFloatingMenuItem($this);
|
||||
$orderOldest->setLabel(n2_('Oldest first'));
|
||||
$orderOldest->setIsActive($orderBy == 'time' && $orderByDirection == 'ASC');
|
||||
$orderOldest->addAttribute('data-ordering', 'time');
|
||||
$orderOldest->addAttribute('data-orderdirection', 'ASC');
|
||||
$orderOldest->addClass('n2_floating_menu__item-order');
|
||||
$orderOldest->setUrl('#');
|
||||
$blockOrderBy->addMenuItem($orderOldest);
|
||||
|
||||
$blockOrderBy->display();
|
||||
}
|
||||
}
|
||||
|
||||
public function displayBulkActions() {
|
||||
|
||||
$blockBulkActions = new BlockFloatingMenu($this);
|
||||
$blockBulkActions->setRelatedClass('n2_slider_manager__action_bar_bulk_actions');
|
||||
$blockBulkActions->addClass('n2_slider_manager__action_bar_bulk_actions');
|
||||
$blockBulkActions->setContentID('n2_slider_manager_bulk_actions');
|
||||
|
||||
$blockButton = new BlockButtonPlain($this);
|
||||
$blockButton->setLabel(n2_('Bulk actions'));
|
||||
$blockButton->setSmall();
|
||||
$blockButton->setIcon('ssi_16 ssi_16--selectarrow');
|
||||
$blockButton->setIconBefore('ssi_16 ssi_16--slides', 'n2_slider_icon--blue');
|
||||
|
||||
$blockBulkActions->setButton($blockButton);
|
||||
|
||||
$duplicate = new BlockFloatingMenuItem($this);
|
||||
$duplicate->addClass('n2_slider_manager__action_bar_bulk_action');
|
||||
$duplicate->setLabel(n2_('Duplicate'));
|
||||
$duplicate->addAttribute('data-action', 'duplicate');
|
||||
$blockBulkActions->addMenuItem($duplicate);
|
||||
|
||||
$trash = new BlockFloatingMenuItem($this);
|
||||
$trash->setRed();
|
||||
$trash->addClass('n2_slider_manager__action_bar_bulk_action');
|
||||
$trash->setLabel(n2_('Move to trash'));
|
||||
$trash->addAttribute('data-action', 'trash');
|
||||
$blockBulkActions->addMenuItem($trash);
|
||||
|
||||
$export = new BlockFloatingMenuItem($this);
|
||||
$export->addClass('n2_slider_manager__action_bar_bulk_action');
|
||||
$export->setLabel(n2_('Export'));
|
||||
$export->addAttribute('data-action', 'export');
|
||||
$blockBulkActions->addMenuItem($export);
|
||||
|
||||
$blockBulkActions->addSeparator(array(
|
||||
'n2_slider_manager__action_bar_bulk_action'
|
||||
));
|
||||
|
||||
$selectAll = new BlockFloatingMenuItem($this);
|
||||
$selectAll->setLabel(n2_('Select all'));
|
||||
$selectAll->addAttribute('data-action', 'select-all');
|
||||
$selectAll->setStayOpen();
|
||||
$blockBulkActions->addMenuItem($selectAll);
|
||||
|
||||
$selectNone = new BlockFloatingMenuItem($this);
|
||||
$selectNone->setLabel(n2_('Select none'));
|
||||
$selectNone->addAttribute('data-action', 'select-none');
|
||||
$blockBulkActions->addMenuItem($selectNone);
|
||||
|
||||
$blockBulkActions->display();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager;
|
||||
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Model\ModelSliders;
|
||||
use Nextend\SmartSlider3\Settings;
|
||||
|
||||
class BlockSliderManager extends AbstractBlock {
|
||||
|
||||
protected $groupID = 0;
|
||||
|
||||
protected $orderBy = 'ordering';
|
||||
|
||||
protected $orderByDirection = 'ASC';
|
||||
|
||||
protected $paginationIndex = 0;
|
||||
|
||||
protected $paginationLimit = 'all';
|
||||
|
||||
public function display() {
|
||||
if ($this->groupID <= 0) {
|
||||
$this->orderBy = Settings::get('slidersOrder2', 'ordering');
|
||||
$this->orderByDirection = Settings::get('slidersOrder2Direction', 'ASC');
|
||||
$this->paginationLimit = Settings::get('limit', 'all');
|
||||
}
|
||||
|
||||
|
||||
$this->renderTemplatePart('SliderManager');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getGroupID() {
|
||||
return $this->groupID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $groupID
|
||||
*/
|
||||
public function setGroupID($groupID) {
|
||||
$this->groupID = $groupID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getPaginationIndex() {
|
||||
return $this->paginationIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $index
|
||||
*/
|
||||
public function setPaginationIndex($index) {
|
||||
$this->paginationIndex = $index;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
||||
public function getPaginationLimit() {
|
||||
return $this->paginationLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $status
|
||||
*
|
||||
*/
|
||||
public function getSliders($status = '*') {
|
||||
$slidersModel = new ModelSliders($this);
|
||||
|
||||
$sliders = $slidersModel->getAll($this->groupID, $status, $this->orderBy, $this->orderByDirection, $this->paginationIndex, $this->paginationLimit);
|
||||
if ($this->groupID <= 0 && empty($sliders) && $sliderCount = $this->getSliderCount('published', true)) {
|
||||
$lastPageIndex = intval(ceil(($sliderCount - $this->paginationLimit) / $this->paginationLimit));
|
||||
$sliders = $slidersModel->getAll($this->groupID, $status, $this->orderBy, $this->orderByDirection, $lastPageIndex, $this->paginationLimit);
|
||||
$this->paginationIndex = $lastPageIndex;
|
||||
}
|
||||
|
||||
return $sliders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $status
|
||||
* @param false $withGroup
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
|
||||
public function getSliderCount($status = '*', $withGroup = false) {
|
||||
$slidersModel = new ModelSliders($this);
|
||||
|
||||
return $slidersModel->getSlidersCount($status, $withGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getOrderBy() {
|
||||
return $this->orderBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getOrderByDirection() {
|
||||
return $this->orderByDirection;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\Paginator;
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonPlain;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonPlainIcon;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu\BlockFloatingMenu;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu\BlockFloatingMenuItem;
|
||||
|
||||
class BlockPaginator extends AbstractBlock {
|
||||
|
||||
protected $sliderCount;
|
||||
protected $paginationLimit;
|
||||
|
||||
/**
|
||||
* @var BlockSliderManager
|
||||
*/
|
||||
protected $sliderManager;
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('Paginator');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BlockSliderManager $sliderManager
|
||||
*/
|
||||
public function setSliderManager($sliderManager) {
|
||||
$this->sliderManager = $sliderManager;
|
||||
}
|
||||
|
||||
|
||||
public function setSliderCount($sliderCount) {
|
||||
$this->sliderCount = $sliderCount;
|
||||
}
|
||||
|
||||
public function setPaginationLimit($limit) {
|
||||
$this->paginationLimit = $limit;
|
||||
}
|
||||
|
||||
private function transformedPaginationLimit() {
|
||||
if ($this->paginationLimit === 'all') {
|
||||
/*used in calculations*/
|
||||
return $this->sliderCount;
|
||||
} else {
|
||||
return $this->paginationLimit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function displayPaginationButtons() {
|
||||
|
||||
$totalPages = $this->sliderCount ? ceil(($this->sliderCount / $this->transformedPaginationLimit())) : 0;
|
||||
$delta = 2;
|
||||
$left = intval($this->sliderManager->getPaginationIndex()) - $delta;
|
||||
$right = intval($this->sliderManager->getPaginationIndex()) + $delta;
|
||||
|
||||
/*PageList*/
|
||||
if ($totalPages > 1) {
|
||||
for ($i = 0; $i < $totalPages; $i++) {
|
||||
if ($i == 0 || $i == $totalPages - 1 || $i >= $left && $i <= $right) {
|
||||
$blockButton = new BlockButtonPlain($this);
|
||||
$blockButton->setUrl('#');
|
||||
$blockButton->setLabel($i + 1);
|
||||
$blockButton->addAttribute('data-page', $i);
|
||||
$blockButton->setSmall();
|
||||
$blockButton->setTabIndex(-1);
|
||||
$class = 'n2_slider_manager__paginator_item ' . (($i === intval($this->sliderManager->getPaginationIndex())) ? 'n2_slider_manager__paginator_item--active' : '');
|
||||
$blockButton->addAttribute('class', $class);
|
||||
$blockButton->display();
|
||||
} else if ($i === $left - 1 || $i === $right + 1) {
|
||||
echo "<div class='n2_slider_manager__paginator_item n2_slider_manager__paginator_item_spacer'>...</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function displayPaginationPrevious() {
|
||||
|
||||
$blockButtonPrev = new BlockButtonPlainIcon($this);
|
||||
$blockButtonPrev->setUrl('#');
|
||||
$blockButtonPrev->setIcon('ssi_16 ssi_16--paginatiorarrow');
|
||||
$blockButtonPrev->setSmall();
|
||||
$blockButtonPrev->setTabIndex(-1);
|
||||
$blockButtonPrev->addAttribute('data-page', 'prev');
|
||||
$blockButtonPrev->addAttribute('class', 'n2_slider_manager__paginator_item n2_slider_manager__paginator_item_arrow n2_slider_manager__paginator_item_arrow--prev n2_slider_manager__paginator_item_arrow--disabled');
|
||||
$blockButtonPrev->display();
|
||||
}
|
||||
|
||||
public function displayPaginationNext() {
|
||||
$blockButtonNext = new BlockButtonPlainIcon($this);
|
||||
$blockButtonNext->setUrl('#');
|
||||
$blockButtonNext->setIcon('ssi_16 ssi_16--paginatiorarrow');
|
||||
$blockButtonNext->setSmall();
|
||||
$blockButtonNext->setTabIndex(-1);
|
||||
$blockButtonNext->addAttribute('data-page', 'next');
|
||||
$blockButtonNext->addAttribute('class', 'n2_slider_manager__paginator_item n2_slider_manager__paginator_item_arrow n2_slider_manager__paginator_item_arrow--next n2_slider_manager__paginator_item_arrow--disabled');
|
||||
$blockButtonNext->display();
|
||||
}
|
||||
|
||||
public function displayPaginationLimiters() {
|
||||
$blockLimiter = new BlockFloatingMenu($this);
|
||||
$blockButton = new BlockButtonPlain($this);
|
||||
$limitText = intval($this->paginationLimit) ? $this->paginationLimit : n2_('All');
|
||||
$blockButton->setLabel(n2_('Show') . " <span class='limitNumber'>" . $limitText . "</span>");
|
||||
$blockButton->setIcon('ssi_16 ssi_16--selectarrow');
|
||||
$blockButton->setSmall();
|
||||
$blockLimiter->setButton($blockButton);
|
||||
|
||||
|
||||
$limits = array(
|
||||
10,
|
||||
25,
|
||||
50,
|
||||
100
|
||||
);
|
||||
|
||||
foreach ($limits as $limit) {
|
||||
$limitItem = new BlockFloatingMenuItem($this);
|
||||
$limitItem->setLabel($limit);
|
||||
$limitItem->setUrl('#');
|
||||
$limitItem->addAttribute('data-limit', $limit);
|
||||
$limitItem->addClass('n2_floating_menu__item-limiter');
|
||||
$limitItem->setIsActive($this->paginationLimit == $limit);
|
||||
$blockLimiter->addMenuItem($limitItem);
|
||||
}
|
||||
|
||||
$limitAll = new BlockFloatingMenuItem($this);
|
||||
$limitAll->setLabel(n2_('All'));
|
||||
$limitAll->setUrl('#');
|
||||
$limitAll->addAttribute('data-limit', 'all');
|
||||
$limitAll->addClass('n2_floating_menu__item-limiter');
|
||||
$limitAll->setIsActive($this->paginationLimit == 'all');
|
||||
$blockLimiter->addMenuItem($limitAll);
|
||||
|
||||
|
||||
$blockLimiter->display();
|
||||
}
|
||||
|
||||
public function displayPaginationLabel() {
|
||||
|
||||
|
||||
$actualSliderStart = $this->transformedPaginationLimit() * $this->sliderManager->getPaginationIndex();
|
||||
$actualSlidersEnd = $actualSliderStart + $this->transformedPaginationLimit();
|
||||
$allSliders = $this->sliderCount;
|
||||
|
||||
echo sprintf(n2_("Showing %s to %s of %s projects"), "<span class='n2_slider_manager__paginator_label_item__from'>" . (($actualSliderStart === 0) ? 1 : esc_html($actualSliderStart)) . "</span>", "<span class='n2_slider_manager__paginator_label_item__to' > " . esc_html(($actualSlidersEnd < $this->sliderCount) ? $actualSlidersEnd : $this->sliderCount) . "</span > ", "<span class='n2_slider_manager__paginator_label_item__max' > " . esc_html($allSliders) . "</span > ");
|
||||
}
|
||||
|
||||
public function displayNoSlidersLabel() {
|
||||
n2_e('No projects to show');
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\Paginator;
|
||||
|
||||
/**
|
||||
* @var BlockPaginator $this
|
||||
*/
|
||||
|
||||
?>
|
||||
<div class="n2_slider_manager__paginator_label <?php echo $this->sliderCount === 0 ? "n2_slider_manager__paginator_label--nosliders" : "" ?>">
|
||||
<p class="n2_slider_manager__paginator_label_item n2_slider_manager__paginator_label_item--active"><?php $this->displayPaginationLabel(); ?></p>
|
||||
<p class="n2_slider_manager__paginator_label_item n2_slider_manager__paginator_label_item--empty"><?php $this->displayNoSlidersLabel(); ?></p>
|
||||
</div>
|
||||
<div class=" n2_slider_manager__paginator_buttons">
|
||||
|
||||
<?php
|
||||
$this->displayPaginationPrevious();
|
||||
?>
|
||||
<div class="n2_slider_manager__paginator_buttons--numbers">
|
||||
<?php
|
||||
$this->displayPaginationButtons();
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
$this->displayPaginationNext();
|
||||
?>
|
||||
</div>
|
||||
<div class="n2_slider_manager__paginator_limiter">
|
||||
<?php $this->displayPaginationLimiters() ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager;
|
||||
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderBox\BlockSliderBox;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\ActionBar\BlockActionBar;
|
||||
use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\Paginator\BlockPaginator;
|
||||
|
||||
/**
|
||||
* @var BlockSliderManager $this
|
||||
*/
|
||||
$groupID = $this->getGroupID();
|
||||
$orderBy = $this->getOrderBy();
|
||||
$orderByDirection = $this->getOrderByDirection();
|
||||
|
||||
$sliders = $this->getSliders('published');
|
||||
$sliderCount = $this->getSliderCount('published', true);
|
||||
|
||||
$limit = $this->getPaginationLimit();
|
||||
$paginationIndex = $this->getPaginationIndex();
|
||||
|
||||
?>
|
||||
<div class="n2_slider_manager" data-groupid="<?php echo esc_attr($groupID); ?>" data-orderby="<?php echo esc_attr($orderBy); ?>" data-orderbydirection="<?php echo esc_attr($orderByDirection); ?>">
|
||||
<?php
|
||||
|
||||
$actionBar = new BlockActionBar($this);
|
||||
$actionBar->setSliderManager($this);
|
||||
$actionBar->display();
|
||||
|
||||
?>
|
||||
<div class="n2_slider_manager__content">
|
||||
|
||||
<div class="n2_slider_manager__box n2_slider_manager__new_slider">
|
||||
<i class="n2_slider_manager__new_slider_icon ssi_48 ssi_48--plus"></i>
|
||||
<span class="n2_slider_manager__new_slider_label">
|
||||
<?php n2_e('New project'); ?>
|
||||
</span>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
foreach ($sliders as $sliderObj) {
|
||||
|
||||
$blockSliderBox = new BlockSliderBox($this);
|
||||
$blockSliderBox->setGroupID($groupID);
|
||||
$blockSliderBox->setSlider($sliderObj);
|
||||
$blockSliderBox->display();
|
||||
}
|
||||
?>
|
||||
<?php if ($groupID <= 0) { ?>
|
||||
<div class="n2_slider_manager__content--empty">
|
||||
<div class="n2_slider_manager__content--empty__logo">
|
||||
<i class="ssi_48 ssi_48--bug"></i>
|
||||
</div>
|
||||
<div class="n2_slider_manager__content--empty__heading">
|
||||
<?php n2_e('Sorry we couldn’t find any matches'); ?>
|
||||
</div>
|
||||
<div class="n2_slider_manager__content--empty__paragraph">
|
||||
<?php n2_e('Please try searching with another term.'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
<?php if ($groupID <= 0) { ?>
|
||||
<div class="n2_slider_manager__paginator" data-countstart="<?php echo esc_attr($sliderCount); ?>" data-currentstart="<?php echo esc_attr($paginationIndex); ?>" data-limitstart="<?php echo esc_attr($limit); ?>">
|
||||
<?php
|
||||
$blockPaginator = new BlockPaginator($this);
|
||||
$blockPaginator->setSliderManager($this);
|
||||
$blockPaginator->setSliderCount($sliderCount);
|
||||
$blockPaginator->setPaginationLimit($limit);
|
||||
$blockPaginator->display();
|
||||
?>
|
||||
</div>
|
||||
<div class="n2_slider_manager__search_label">
|
||||
<p class="n2_slider_manager__search_label_item n2_slider_manager__search_label_item"><?php echo sprintf(n2_("Showing %s results for %s."), "<span class='n2_slider_manager__search_label_item__counter'>0</span>", "<span class='n2_slider_manager__search_label_item__keyword'></span>") ?></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderPublish;
|
||||
|
||||
use Nextend\Framework\View\AbstractBlock;
|
||||
|
||||
class BlockPublishSlider extends AbstractBlock {
|
||||
|
||||
/** @var int */
|
||||
protected $sliderID;
|
||||
|
||||
/** @var string */
|
||||
protected $sliderAlias;
|
||||
|
||||
public function display() {
|
||||
|
||||
$this->renderTemplatePart('Common');
|
||||
$this->renderTemplatePart('WordPress');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSliderID() {
|
||||
return $this->sliderID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSliderAlias() {
|
||||
return $this->sliderAlias;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $sliderID
|
||||
*/
|
||||
public function setSliderID($sliderID) {
|
||||
$this->sliderID = $sliderID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sliderAlias
|
||||
*/
|
||||
public function setSliderAlias($sliderAlias) {
|
||||
$this->sliderAlias = $sliderAlias;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderPublish;
|
||||
|
||||
/**
|
||||
* @var $this BlockPublishSlider
|
||||
*/
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
_N2.r(['$', 'documentReady'], function () {
|
||||
var $ = _N2.$;
|
||||
|
||||
$('.n2_ss_slider_publish__option_code')
|
||||
.on('click', function (e) {
|
||||
var element = e.currentTarget;
|
||||
if (document.selection) {
|
||||
var range = body.createTextRange();
|
||||
range.moveToElementText(this);
|
||||
range.select();
|
||||
} else if (window.getSelection) {
|
||||
var range = document.createRange();
|
||||
range.selectNode(element);
|
||||
var selection = window.getSelection();
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
document.addEventListener('copy', function (e) {
|
||||
if ($(e.target).hasClass('n2_ss_slider_publish__option_code')) {
|
||||
try {
|
||||
e.clipboardData.setData('text/plain', window.getSelection().toString());
|
||||
e.clipboardData.setData('text/html', '<div>' + window.getSelection().toString() + '</div>');
|
||||
e.preventDefault();
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user