Example #1
0
 public function subform($appType, $configurationXmlFile, $values, $control_name, $name)
 {
     if (N2Filesystem::fileexists($configurationXmlFile)) {
         N2Loader::import('libraries.form.form');
         $form = new N2Form($appType);
         $form->loadArray($values);
         //$subformValue = array();
         //$subformValue[N2Post::getVar('name')] = N2Post::getVar('value');
         //$form->loadArray($subformValue);
         $form->loadXMLFile($configurationXmlFile);
         ob_end_clean();
         // To clear the output of the platform
         ob_start();
         $subform = $form->getSubFormAjax(N2Post::getVar('tab'), $name);
         $subform->initAjax($control_name);
         echo $subform->renderForm();
         //echo N2AssetsManager::generateAjaxCSS();
         $scripts = N2AssetsManager::generateAjaxJS();
         $html = ob_get_clean();
         $response = array('html' => $html, 'scripts' => $scripts);
     } else {
         $response = array('error' => 'Configuration file not found: ' . $configurationXmlFile);
     }
     return $response;
 }
Example #2
0
 public function actionIndex()
 {
     if ($this->validateToken() && $this->validatePermission('smartslider_edit')) {
         $sliderData = N2Post::getVar('slider', false);
         if (count($sliderData)) {
             $this->addView("index", array('sliderData' => $sliderData, 'sliderId' => $this->sliderId));
             $this->render();
         }
     }
 }
Example #3
0
 public function sliderWidget($appType, $name)
 {
     $configurationXmlFile = $this->getWidgetPath($name) . 'config.xml';
     $values = (array) N2Request::getVar('values', array());
     $values['widget' . $name] = N2Post::getVar('value');
     $class = 'N2SSPluginWidget' . $name . N2Post::getVar('value');
     if (class_exists($class, false)) {
         $values = array_merge(call_user_func(array($class, 'getDefaults')), $values);
     }
     return $this->subform($appType, $configurationXmlFile, $values, 'slider', 'widget' . $name);
 }
Example #4
0
 public function actionIndex()
 {
     if ($this->canDo('nextend_config')) {
         $data = N2Post::getVar('global');
         if (is_array($data)) {
             if ($this->validateToken()) {
                 N2Settings::setAll($data);
             } else {
                 $this->refresh();
             }
         }
         $this->addView("../../inline/sidebar/settings", array("appObj" => $this), "sidebar");
         $this->addView("index");
         $this->render();
     } else {
         $this->noAccess();
     }
 }
Example #5
0
 public static function init()
 {
     self::$storage = N2RequestStorage::$POST;
 }