Example #1
0
 public function execute()
 {
     $type = $this->getParameter('type');
     $actie = $this->getParameter('actie');
     $naamprefix = Uri::SMWuriNaarLeesbareTitel($this->getParameter('hoofdcontextUri'));
     $return = "";
     if ($type == 'context') {
         if ($actie == 'nieuw') {
             $naam = $naamprefix . ' ' . $this->getParameter('titel');
             $supercontext_uri = $this->getParameter('supercontext');
             Model::nieuweContext($naam);
             Model::nieuweVN($naam . ' VN', 'Context', $naam);
             Model::extraSupercontext($naam, $supercontext_uri);
         } elseif ($actie == 'extrasupercontext') {
             $context = $params['context'];
             $supercontext = $params['supercontext'];
             if ($context != $supercontext) {
                 Model::extraSupercontext($context, $supercontext);
             }
         } elseif ($actie == 'supercontextverwijderen') {
             list($context, $supercontext) = explode('|', $params['verwijder-supercontexten']);
             Model::supercontextVerwijderen($context, $supercontext);
         }
     } elseif ($type == 'ie') {
         if ($actie == 'contexttoevoegen') {
             $ie = $params['ie'];
             $context = $params['context'];
             Model::contextToevoegenAanIE($ie, $context);
         } elseif ($actie == 'nieuw') {
             $naam = $this->getParameter('titel');
             Model::nieuwIE($this->getParameter('instanceOf'), $this->getParameter('context'), $naam, $naamprefix);
             Model::nieuweVN($naam . ' VN', 'Intentional Element', $naamprefix . ' ' . $naam);
         } elseif ($actie == 'maakverband') {
             $eigenschappen = array();
             $linkType = ucfirst($this->getParameter('linkType'));
             if ($this->getParameter('notitie')) {
                 $eigenschappen['Element link note'] = $this->getParameter('notitie');
             }
             if ($linkType == 'Contributes') {
                 $eigenschappen['Element contribution value'] = $this->getParameter('contributionValue');
             }
             if ($linkType == 'Connects') {
                 $eigenschappen['Element connection type'] = $this->getParameter('connectionType');
                 $eigenschappen['Element link condition'] = $this->getParameter('linkCondition');
             }
             Model::maakVerband($this->getParameter('van'), $this->getParameter('naar'), $linkType, $eigenschappen);
         } elseif ($actie == 'verwijderverband') {
             $waardes = explode('|', $params['verwijder-verband']);
             Model::verwijderVerband($waardes[0], $waardes[2], $waardes[1]);
         }
     } elseif ($actie == 'naamNaarUri') {
         $naam = $this->getParameter('naam');
         $return = 'wiki:' . Uri::codeerSMWNaam($naamprefix . ' ' . $naam);
     }
     /*$formattedData = array();
     		$result = $this->getResult();
     		$result->setIndexedTagName($formattedData, 'p');
     		$result->addValue(null, $this->getModuleName(), $formattedData);*/
     $this->getResult()->addValue(null, $this->getModuleName(), $return);
 }
         if ($context != $supercontext) {
             Model::extraSupercontext($context, $supercontext);
         }
     } elseif ($actie == 'supercontextverwijderen') {
         list($context, $supercontext) = explode('|', $_POST['verwijder-supercontexten']);
         Model::supercontextVerwijderen($context, $supercontext);
     }
 } elseif ($type == 'ie') {
     if ($actie == 'contexttoevoegen') {
         $ie = $_POST['ie'];
         $context = $_POST['context'];
         Model::contextToevoegenAanIE($ie, $context);
     } elseif ($actie == 'nieuw') {
         $naam = $naamprefix . ' ' . $_POST['titel'];
         Model::nieuwIE($_POST['ie'], $_POST['context'], $naam);
         Model::nieuweVN($naam . ' VN', 'Intentional Element', $naam);
     } elseif ($actie == 'maakverband') {
         $eigenschappen = array();
         if ($_POST['notitie']) {
             $eigenschappen['Element link note'] = $_POST['notitie'];
         }
         if ($_POST['type'] == 'Contributes') {
             $eigenschappen['Element contribution value'] = $_POST['subtype'];
         }
         if ($_POST['type'] == 'Connects') {
             $eigenschappen['Element connection type'] = $_POST['subtype'];
         }
         Model::maakVerband($_POST['van'], $_POST['naar'], $_POST['type'], $eigenschappen);
     } elseif ($actie == 'verwijderverband') {
         $waardes = explode('|', $_POST['verwijder-verband']);
         Model::verwijderVerband($waardes[0], $waardes[2], $waardes[1]);