/**
  * Build widget.
  *
  * @throws SystemException 'ERR_BAD_DATA'
  */
 public function buildWidget()
 {
     if (!isset($_POST['xml'])) {
         throw new SystemException('ERR_BAD_DATA');
     }
     $xml = $_POST['xml'];
     $xml = simplexml_load_string($xml);
     unset($_SERVER['HTTP_X_REQUEST']);
     $this->request->shiftPath(1);
     $this->tmpComponent = ComponentManager::createBlockFromDescription($xml);
     $this->tmpComponent->run();
 }
Esempio n. 2
0
 /**
  * Show division tree for form of adding/editing.
  */
 protected function showSmapSelector()
 {
     $n = 1;
     $params = [];
     $sp = $this->getStateParams(true);
     if (isset($sp['smap_id'])) {
         $n++;
         $siteID = E()->getSiteManager()->getSiteByPage($sp['smap_id'])->id;
         if ($siteID) {
             //$params['smap_id'] = $sp['smap_id'];
             $params['site'] = $siteID;
         }
     }
     $this->request->shiftPath($n);
     $this->divisionEditor = ComponentManager::createBlockFromDescription(ComponentManager::getDescriptionFromFile(CORE_DIR . '/modules/apps/templates/content/site_div_selector.container.xml'), $params);
     $this->divisionEditor->run();
 }