Beispiel #1
0
<?php

if (array_key_exists('recipeURL', $_POST)) {
    require_once '../consume.php';
    $consume = new Consume();
    $gotAllRequirements = array();
    $recipes = $consume->parseRecipeFromURL($_POST['recipeURL']);
    foreach ($recipes as $i => $recipe) {
        $requires = $recipe->getRequires();
        $good = true;
        foreach ($requires as $type => $fields) {
            foreach ($fields as $field) {
                if (!array_key_exists('field' . $field['name'], $_POST)) {
                    $good = false;
                }
            }
        }
        $gotAllRequirements[$i] = $good;
    }
    session_start();
}
//generate a list of available recipies
$basePath = pathinfo($_SERVER['REQUEST_URI']);
$basePath = ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $basePath['dirname'];
$recipies = array();
$stylesheets = array();
if ($handle = opendir('../recipes/')) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {
            $info = pathinfo("../recipes/{$file}");
            switch ($info['extension']) {