<?php
$slidersModel = new N2SmartsliderSlidersModel();

$orderBy          = N2SmartSliderSettings::get('slidersOrder2', 'ordering');
$orderByDirection = N2SmartSliderSettings::get('slidersOrder2Direction', 'ASC');

$sliders = $slidersModel->getAll($groupID, $orderBy, $orderByDirection);

$router = N2Base::getApplication('smartslider')
                ->getApplicationType('backend')->router;
?>
<div id="n2-ss-slider-container" data-groupid="<?php echo $groupID; ?>">
    <div class="n2-ss-sliders">
        <div class="n2-ss-sliders-container">
            <?php

            if ($groupID > 0) {
                echo N2Html::tag('div', array(
                    'class'   => 'n2-box n2-box-full n2-box-up-group n2-h3 n2-uc',
                    'onclick' => 'window.location="' . $router->createUrl(array(
                            'sliders/' . $mode,
                            array(
                                'groupID' => 0
                            )
                        )) . '"'
                ), N2Html::link(n2_('UP'), '#', array(
                    'class' => 'n2-button n2-button-l n2-button-grey n2-radius-s n2-uc n2-h3'
                )));


                if ($mode == 'embed') {
                    echo N2Html::tag('div', array(
                        'class'   => 'n2-box n2-box-full n2-box-insert-group n2-h3 n2-uc',
                        'onclick' => 'window.parent.postMessage("' . $groupID . '", "*");',
                    ), N2Html::link(n2_('Insert group'), '#', array(
                        'class' => 'n2-button n2-button-l n2-button-green n2-radius-s n2-uc n2-h3'
                    )));
                }
            }

            foreach ($sliders AS $sliderObj) {
                echo N2SmartsliderSlidersModel::embedBox($mode, $sliderObj, $this->widget, $this->appType);
            }
            ?>

            <div class="n2-clear"></div>
        </div>
    </div>
</div>