Your IP : 216.73.216.240


Current Path : /home/juvelize/www/libraries/smartslider3/src/Framework/Form/Element/Button/
Upload File :
Current File : /home/juvelize/www/libraries/smartslider3/src/Framework/Form/Element/Button/ButtonRecordViewer.php

<?php


namespace Nextend\Framework\Form\Element\Button;


use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\Form\Element\Button;

class ButtonRecordViewer extends Button {

    public function __construct($insertAt, $name = '', $parameters = array()) {
        parent::__construct($insertAt, $name, '', n2_('View records'), $parameters);


        $this->addClass('n2_field_button--blue');
    }

    protected function fetchElement() {

        $ajaxRecordUrl = $this->getForm()
                              ->createAjaxUrl(array(
                                  'generator/recordstable'
                              ));
        Js::addInline('new _N2.FieldRecordViewer(' . json_encode($this->fieldID) . ',' . json_encode($ajaxRecordUrl) . ');');


        return parent::fetchElement();
    }
}