Ejemplo n.º 1
0
 function getTableMatrix()
 {
     if (isset($_SESSION['articleId'])) {
         require_once JPATH_COMPONENT . DS . 'models' . DS . 'bkef.php';
         $model = new BkefModel();
         $article = $_SESSION['articleId'];
         $obsahSouboru = $model->load($article)->asXML();
         libxml_use_internal_errors(true);
         $xdoc = new DomDocument();
         $cestaKTransformaci = JPATH_COMPONENT . DS . "influences" . DS . "bkef-matrix-influence.xsl";
         //echo $_POST["zaskrtnuto"];
         //V případě, že by měla proměnná xmldocument obsahovat celý dokument jako string, je potřebná funkce na dalším řádku.
         $xdoc->loadXML($obsahSouboru);
         //echo $xdoc->saveXML();
         $xdoc2 = new DomDocument();
         $xdoc2->load($cestaKTransformaci);
         $variables = $xdoc2->getElementsByTagName("variable");
         foreach ($variables as $variable) {
             //echo "Hele ".$variable->getAttribute("name")." <br>";
             if ($variable->getAttribute("name") == "attribute") {
                 $variable->setAttribute("select", "'" . $_POST["attribute"] . "'");
             }
             if ($variable->getAttribute("name") == "attributeII") {
                 $variable->setAttribute("select", "'" . $_POST["attributeii"] . "'");
             }
         }
         //echo $xdoc2->saveXML();
         //echo "<div>".$xdoc2->saveXML()."</div>";
         $xsl = new XSLTProcessor();
         $xsl->importStylesheet($xdoc2);
         if ($html = $xsl->transformToXML($xdoc)) {
             //Výpis výsledku transformace
             echo $html;
             //."<div id=\"coZaskrtnout\" style=\"display: none;\">".$_GET["additionalInfo"]."</div>"
         } else {
             echo JText::_('TRANSFORMATION_ERROR');
         }
         libxml_clear_errors();
     }
 }
Ejemplo n.º 2
0
 /**
  * Funkce pro smazání value 
  */
 function nominalEnumerationDeleteValue()
 {
     /*DONE*/
     require_once JPATH_COMPONENT . DS . 'models' . DS . 'bkef.php';
     $model = new BkefModel();
     //skutecne smazeme
     $xml = $model->load(JRequest::getInt('article'));
     $maId = intval(JRequest::getInt('maId', -1));
     $fId = intval(JRequest::getInt('fId', -1));
     $phId = intval(JRequest::getInt('phId', -1));
     $binId = intval(JRequest::getInt('binId', -1));
     $vId = intval(JRequest::getInt('vId', -1));
     unset($xml->MetaAttributes[0]->MetaAttribute[$maId]->Formats[0]->Format[$fId]->PreprocessingHints[0]->DiscretizationHint[$phId]->NominalEnumeration[0]->NominalBin[$binId]->Value[$vId]);
     //aktualizace BKEF lastmodified
     $author = $this->getUserName();
     $xmlLastModified = $xml->Header[0]->LastModified[0];
     $xmlLastModified->Timestamp = date('c');
     $xmlLastModified->Author = $author;
     //aktualizace lastmodified u metaatributu
     $metaAttribute = $xml->MetaAttributes[0]->MetaAttribute[$maId];
     $metaAttribute->LastModified[0]->Timestamp = date('c');
     $metaAttribute->LastModified[0]->Author = $author;
     //aktualizace lastmodified u formatu
     $format = $metaAttribute->Formats[0]->Format[$fId];
     $format->LastModified[0]->Timestamp = date('c');
     $format->LastModified[0]->Author = $author;
     //aktualizace lastmodified u discretization hintu
     $discretizationHint = $format->PreprocessingHints[0]->DiscretizationHint[$phId];
     $discretizationHint->LastModified[0]->Timestamp = date('c');
     $discretizationHint->LastModified[0]->Author = $author;
     $model->save(JRequest::getInt('article'), $xml->asXML());
     $this->_redirect = 'index.php?option=com_bkef&task=format&article=' . JRequest::getInt('article') . '&maId=' . $maId . '&fId=' . $fId . '#preprocessingHints';
 }