Exemplo n.º 1
0
 public static function renderForm()
 {
     $configurationXmlFile = dirname(__FILE__) . '/forms/login.xml';
     N2Loader::import('libraries.form.form');
     $form = new N2Form(N2Base::getApplication('system')->getApplicationType('backend'));
     $form->loadXMLFile($configurationXmlFile);
     return $form->render('login');
 }
Exemplo n.º 2
0
 function renderForm($type, $item, $data = array())
 {
     $configurationXmlFile = $item[4] . 'configuration.xml';
     $form = new N2Form(N2Base::getApplication('smartslider')->getApplicationType('backend'));
     $form->loadArray($data);
     $form->loadXMLFile($configurationXmlFile);
     echo $form->render('item_' . $type);
 }
Exemplo n.º 3
0
 public static function renderRestoreFromServerForm()
 {
     $configurationXmlFile = dirname(__FILE__) . '/forms/import/restorefromserver.xml';
     N2Loader::import('libraries.form.form');
     $form = new N2Form(N2Base::getApplication('smartslider')->getApplicationType('backend'));
     $form->loadXMLFile($configurationXmlFile);
     echo $form->render('slider');
 }
Exemplo n.º 4
0
 public function renderSetsForm()
 {
     $configurationXmlFile = $this->getPath() . '/forms/' . $this->type . '/sets.xml';
     N2Loader::import('libraries.form.form');
     $form = new N2Form();
     $form->loadXMLFile($configurationXmlFile);
     echo $form->render($this->type . 'set');
 }
Exemplo n.º 5
0
 function renderForm($data = array())
 {
     N2Loader::import('libraries.animations.manager');
     $configurationXmlFile = dirname(__FILE__) . '/forms/layer.xml';
     N2Loader::import('libraries.form.form');
     $form = new N2Form();
     $form->loadArray($data);
     $form->loadXMLFile($configurationXmlFile);
     echo $form->render('layer');
 }
Exemplo n.º 6
0
 public function render($xmlpath, $data)
 {
     N2Loader::import('libraries.form.form');
     $form = new N2Form(N2Base::getApplication('smartslider')->getApplicationType('backend'));
     $form->loadArray($data);
     $form->loadXMLFile($xmlpath);
     echo $form->render('settings');
     N2JS::addFirstCode('
         new NextendForm("smartslider-form", ' . json_encode($form->_data) . ', null, "' . N2Filesystem::toLinux(N2Filesystem::pathToRelativePath($xmlpath)) . '", "settings", "' . N2Uri::ajaxUri('nextend', 'smartslider') . '");
     ');
 }
Exemplo n.º 7
0
 public function renderFontsConfigurationForm()
 {
     $values = N2Fonts::loadSettings();
     $form = new N2Form($this->appType);
     $form->loadArray($values);
     $form->loadArray($values['plugins']->toArray());
     $form->loadXMLFile(N2Loader::getPath('models', 'system') . '/forms/fonts.xml');
     echo N2Html::openTag("form", array("id" => "nextend-config", "method" => "post", "action" => N2Request::getRequestUri()));
     $form->render('fonts');
     echo N2Html::closeTag("form");
 }
Exemplo n.º 8
0
 function renderForm()
 {
     $file = N2XmlHelper::getAttribute($this->_xml, 'file');
     $form = new N2Form($this->_form->appType);
     $form->_data =& $this->_form->_data;
     $form->loadXMLFile($this->getSubFormfolder($this->getValue()) . $file);
     ob_start();
     $this->onRender();
     $form->render($this->control_name);
     return ob_get_clean();
 }
Exemplo n.º 9
0
 function fetchElement()
 {
     $widgetTypes = $this->getOptions();
     $id = 'n2-form-matrix-' . $this->_id;
     $html = N2Html::openTag("div", array('id' => $id, "class" => "n2-form-matrix"));
     $value = $this->getValue();
     $test = false;
     foreach ($widgetTypes as $type => $v) {
         if ($value == $type) {
             $test = true;
             break;
         }
     }
     if (!$test) {
         $value = 'arrow';
     }
     $html .= N2Html::openTag('div', array('class' => 'n2-h2 n2-content-box-title-bg n2-form-matrix-views'));
     $class = 'n2-underline n2-h4 n2-uc n2-has-underline n2-form-matrix-menu';
     foreach ($widgetTypes as $type => $v) {
         $html .= N2Html::tag("div", array("onclick" => "n2('#{$this->_id}').val('{$type}');", "class" => $class . ($value == $type ? ' n2-active' : '')), N2Html::tag("span", array("class" => "n2-underline"), $v[0]));
     }
     $html .= N2Html::closeTag("div");
     $html .= N2Html::openTag("div", array("class" => "n2-tabs"));
     foreach ($widgetTypes as $type => $v) {
         $html .= N2Html::openTag('div', array('class' => 'n2-form-matrix-pane' . ($value == $type ? ' n2-active' : '')));
         $GLOBALS['nextendbuffer'] = '';
         $form = new N2Form($this->_form->appType);
         $form->_data =& $this->_form->_data;
         $form->loadXMLFile($v[1] . 'config.xml');
         ob_start();
         $form->render($this->control_name);
         $html .= ob_get_clean();
         $html .= $GLOBALS['nextendbuffer'];
         $html .= N2Html::closeTag("div");
     }
     $html .= N2Html::closeTag("div");
     $html .= N2Html::closeTag("div");
     N2JS::addInline('
         (function(){
             var matrix = $("#' . $id . '"),
                 views = matrix.find("> .n2-form-matrix-views > div"),
                 panes = matrix.find("> .n2-tabs > div");
             views.on("click", function(){
                 views.removeClass("n2-active");
                 panes.removeClass("n2-active");
                 var i = views.index(this);
                 views.eq(i).addClass("n2-active");
                 panes.eq(i).addClass("n2-active");
             });
         })()
     ');
     return $html . parent::fetchElement();
 }
Exemplo n.º 10
0
 public function renderDefaultsForm()
 {
     $settings = array('font' => array(), 'style' => array());
     N2Pluggable::doAction('smartsliderDefault', array(&$settings));
     $xmlString = '<root>';
     $this->defaultsAddTab($xmlString, $settings['font'], 'font', 'Font');
     $this->defaultsAddTab($xmlString, $settings['style'], 'style', 'Style');
     $xmlString .= '</root>';
     $form = new N2Form();
     $xml = simplexml_load_string($xmlString);
     $form->setXML($xml);
     $form->render('defaults');
 }
Exemplo n.º 11
0
 public function renderFormExtra()
 {
     $form = new N2Form();
     $form->loadXMLFile(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'font' . DIRECTORY_SEPARATOR . 'extra.xml');
     $form->render('n2-font-editor');
 }
Exemplo n.º 12
0
 /**
  * @param array $data
  */
 private function editForm($data = array())
 {
     $this->simpleEditForm($data);
     $slidersModel = new N2SmartsliderSlidersModel();
     $slider = $slidersModel->get(N2Request::getInt('sliderid', 0));
     $slidersSliderXml = call_user_func(array('N2SSPluginType' . $slider['type'], "getPath")) . '/slide.xml';
     if ((!isset($data['static-slide']) || $data['static-slide'] != 1) && N2Filesystem::existsFile($slidersSliderXml)) {
         $form = new N2Form();
         $form->loadArray($data);
         $form->loadXMLFile($slidersSliderXml);
         echo $form->render('slide');
     }
     if (isset($data['generator_id']) && $data['generator_id'] > 0) {
         $form = new N2Form();
         $form->loadArray($data);
         $form->loadXMLFile(dirname(__FILE__) . '/forms/slide_generator.xml');
         echo $form->render('slide');
     }
     N2JS::addFirstCode("new NextendForm('smartslider-form','', {});");
 }
 public function generatorSpecificForm($group, $type, $data = array())
 {
     $info = $this->getGeneratorInfo($group, $type);
     $xmlPath = $info->path . '/config.xml';
     $form = new N2Form();
     $form->loadArray($data);
     $form->loadXMLFile($xmlPath);
     $form->set('info', $info);
     echo $form->render('generator');
     return $xmlPath;
 }
Exemplo n.º 14
0
 public function renderForm()
 {
     $form = new N2Form();
     $form->loadXMLFile(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'image' . DIRECTORY_SEPARATOR . 'form.xml');
     $form->render('n2-image-editor');
 }