Example #1
0
 public function testId()
 {
     $id = 'one/two/three';
     $pattern = new Pattern($id, __FILE__);
     $this->assertEquals($id, $pattern->getId());
 }
    foreach ($_REQUEST as $i => $v) {
        $r[join('.', explode('_', $i))] = $v;
        //convert _ back to .
    }
    $regels = array();
    for ($i0 = 0; isset($r['0.' . $i0]); $i0++) {
        $regels[$i0] = @$r['0.' . $i0 . ''];
    }
    $relaties = array();
    for ($i0 = 0; isset($r['1.' . $i0]); $i0++) {
        $relaties[$i0] = @$r['1.' . $i0 . ''];
    }
    $Conceptueeldiagram = @$r['2'];
    $Pattern = new Pattern($ID, $regels, $relaties, $Conceptueeldiagram);
    if ($Pattern->save() !== false) {
        die('ok:' . serviceref($_REQUEST['content']) . '&Pattern=' . urlencode($Pattern->getId()));
    } else {
        die('Please fix errors!');
    }
    exit;
    // do not show the interface
}
$buttons = "";
if (isset($_REQUEST['new'])) {
    $new = true;
} else {
    $new = false;
}
if (isset($_REQUEST['edit']) || $new) {
    $edit = true;
} else {