<?php
/**
 * @var N2SmartsliderBackendGeneratorView $_class
 * @var N2SliderGeneratorPluginAbstract   $generatorGroup
 * @var N2GeneratorAbstract               $source
 */
?>
<?php
N2Html::topBar(array(
    "actions" => array(
        N2Html::tag('a', array(
            'href'  => $this->appType->router->createUrl(array(
                "slider/edit",
                array(
                    "sliderid" => $slider['id']
                )
            )),
            'class' => 'n2-button n2-button-normal n2-button-l n2-radius-s n2-button-red n2-h4 n2-b n2-uc'
        ), n2_('Cancel')),
        N2Html::tag('a', array(
            'href'    => '#',
            'class'   => 'n2-button n2-button-normal n2-button-l n2-radius-s n2-button-green n2-h4 n2-b n2-uc',
            'onclick' => 'return N2Classes.Form.submit("#smartslider-form");'
        ), n2_('Save'))
    )
));
?>

<form id="smartslider-form" action="#" method="post">
        <?php

        $generatorModel = new N2SmartsliderGeneratorModel();

        N2HTML::heading(array(
            'title' => $generatorGroup->getLabel() . ' - ' . $source->getLabel()
        ));

        $form = new N2Form();

        $source->renderFields($form);

        echo $form->render('generator');

        $generatorModel->generatorCommonForm();
        ?>
    <input name="generator[group]" value="<?php echo $generatorGroup->getName(); ?>" type="hidden"/>
        <input name="generator[type]" value="<?php echo $source->getName(); ?>" type="hidden"/>
        <input name="slider-id" value="<?php echo N2Request::getInt('sliderid'); ?>" type="hidden"/>
        <input name="save" value="1" type="hidden"/>
    </form>
    <style>
        #generatorrecords {
            overflow: auto;
            width: 100%;
        }

        #generatorrecords table div {
            max-width: 200px;
            max-height: 200px;
            overflow: auto;
        }
    </style>

<?php

N2JS::addInline('new N2Classes.SmartSliderGeneratorRecords("' . $this->appType->router->createAjaxUrl(array(
        'generator/recordstable'
    )) . '");');
?>

<div style="height: 200px"></div>
