Your IP : 216.73.216.216


Current Path : /proc/thread-self/root/var/tmp/
Upload File :
Current File : //proc/thread-self/root/var/tmp/phpFjKaaC

ModelPostBackgroundAnimation.php000064400000004135152410525450013031 0ustar00<?php


namespace Nextend\SmartSlider3Pro\PostBackgroundAnimation;


use Nextend\Framework\Form\Container\ContainerTable;
use Nextend\Framework\Form\Element\Select;
use Nextend\Framework\Form\Element\Text\NumberAutoComplete;
use Nextend\Framework\Form\Fieldset\FieldsetVisualSet;
use Nextend\Framework\Form\Form;
use Nextend\Framework\Model\StorageSectionManager;
use Nextend\Framework\Visual\ModelVisual;

class ModelPostBackgroundAnimation extends ModelVisual {

    protected $type = 'postbackgroundanimation';

    protected function init() {

        PostBackgroundAnimationStorage::getInstance();

        $this->storage = StorageSectionManager::getStorage('smartslider');
    }

    protected function getPath() {
        return dirname(__FILE__);
    }

    public function renderSetsForm() {

        $form = new Form($this, $this->type . 'set');
        $form->addClass('n2_fullscreen_editor__content_sidebar_top_bar');
        $form->setDark();

        $setsTab = new FieldsetVisualSet($form->getContainer(), 'postbackgroundanimation-sets', n2_('Animation type'));
        new Select($setsTab, 'sets', false);

        $form->render();
    }

    public function renderForm() {
        $form = new Form($this, 'n2-post-background');

        $table = new ContainerTable($form->getContainer(), 'post-background-preview', n2_('Preview'));

        $table->setFieldsetPositionEnd();

        new NumberAutoComplete($table->getFieldsetLabel(), 'transformorigin-x', false, '50', array(
            'style'    => 'width:22px;',
            'values'   => array(
                0,
                50,
                100
            ),
            'unit'     => '%',
            'sublabel' => 'X'
        ));

        new NumberAutoComplete($table->getFieldsetLabel(), 'transformorigin-y', false, '50', array(
            'style'    => 'width:22px;',
            'values'   => array(
                0,
                50,
                100
            ),
            'unit'     => '%',
            'sublabel' => 'Y'
        ));

        $form->render();
    }
}PostBackgroundAnimationManager.php000064400000001032152410525470013336 0ustar00<?php


namespace Nextend\SmartSlider3Pro\PostBackgroundAnimation;


use Nextend\Framework\Pattern\VisualManagerTrait;
use Nextend\SmartSlider3Pro\PostBackgroundAnimation\Block\PostBackgroundAnimationManager\BlockPostBackgroundAnimationManager;

class PostBackgroundAnimationManager {

    use VisualManagerTrait;

    public function display() {

        $postBackgroundAnimationManagerBlock = new BlockPostBackgroundAnimationManager($this->MVCHelper);
        $postBackgroundAnimationManagerBlock->display();
    }

}PostBackgroundAnimationStorage.php000064400000005210152410525500013364 0ustar00<?php

namespace Nextend\SmartSlider3Pro\PostBackgroundAnimation;

use Nextend\Framework\Pattern\SingletonTrait;
use Nextend\Framework\Plugin;

class PostBackgroundAnimationStorage {

    use SingletonTrait;

    private $sets = array();

    private $animation = array();

    private $animationBySet = array();

    private $animationById = array();

    protected function init() {
        Plugin::addAction('smartsliderpostbackgroundanimationset', array(
            $this,
            'animationSet'
        ));
        Plugin::addAction('smartsliderpostbackgroundanimation', array(
            $this,
            'animations'
        ));
        Plugin::addAction('postbackgroundanimation', array(
            $this,
            'animation'
        ));
    }

    private function load() {
        static $loaded;
        if (!$loaded) {
            Plugin::doAction('postBackgroundAnimationStorage', array(
                &$this->sets,
                &$this->animation
            ));

            for ($i = 0; $i < count($this->animation); $i++) {
                if (!isset($this->animationBySet[$this->animation[$i]['referencekey']])) {
                    $this->animationBySet[$this->animation[$i]['referencekey']] = array();
                }
                $this->animationBySet[$this->animation[$i]['referencekey']][] = &$this->animation[$i];
                $this->animationById[$this->animation[$i]['id']]              = &$this->animation[$i];
            }
            $loaded = true;
        }
    }

    public function animationSet($referenceKey, &$sets) {
        $this->load();

        for ($i = count($this->sets) - 1; $i >= 0; $i--) {
            $this->sets[$i]['isSystem'] = 1;
            $this->sets[$i]['editable'] = 0;
            array_unshift($sets, $this->sets[$i]);
        }

    }

    public function animations($referenceKey, &$animation) {
        $this->load();
        if (isset($this->animationBySet[$referenceKey])) {
            $_animation = &$this->animationBySet[$referenceKey];
            for ($i = count($_animation) - 1; $i >= 0; $i--) {
                $_animation[$i]['isSystem'] = 1;
                $_animation[$i]['editable'] = 0;
                array_unshift($animation, $_animation[$i]);
            }

        }
    }

    public function animation($id, &$animation) {
        $this->load();
        if (isset($this->animationById[$id])) {
            $this->animationById[$id]['isSystem'] = 1;
            $this->animationById[$id]['editable'] = 0;
            $animation                            = $this->animationById[$id];
        }
    }
}Block/PostBackgroundAnimationManager/BlockPostBackgroundAnimationManager.php000064400000003342152410525530023426 0ustar00