Ejemplo n.º 1
0
            } else {
                if (startsWith($file, "other-")) {
                    array_push($other_files, $file);
                } else {
                    if ($file != "menu.php") {
                        array_push($development_files, $file);
                    }
                }
            }
        }
    }
}
echoList("Developments", $development_files);
echoList("Components", $component_files);
echoList("References", $reference_files);
echoList("Others", $other_files);
function echoList($name, $list)
{
    echo "<h1>" . $name . "</h1>";
    echo "<ul>";
    foreach ($list as $item) {
        printf("<li><a href=\"%s\">%s</a></li>", $item, $item);
    }
    echo "</ul>";
}
function startsWith($haystack, $needle)
{
    // search forward starting from end minus needle length characters
    return $needle === "" || strpos($haystack, $needle, 0) !== FALSE;
}
function endsWith($haystack, $needle)
// now we have the folderId. we can display it or pass it into another method.
// lets create a document and pass in the folderId $b.
echo $docRequest->postDoc($b, 1, 'phpParseFile', 'a test file', 'parse.txt', '{}');
// parseListResponse() (list of field values returned)
// for the parseListResponse method an array is returned.
// we write a sample function here to display the results.
function echoList($array, $itemCount)
{
    for ($i = 0; $i < $itemCount; $i++) {
        echo $array[$i] . "\n";
    }
}
// now the getUsers() method is called and the response is stored as a variable $c.
$c = $usersRequest->getUsers();
// now we pass in the response from the getUsers() call and request a list of 10 userId's
// stored as an array $d.
$d = $parseRequest->parseListResponse($c, 'name', '10');
// now we call echoList to display the users in the array returned by parseListResponse().
echoList($d, '10');
// EMBED A FORM FROM VISUALVAULT
// first method call requests and stores the users WebToken (userId is passed in here).
$userToken = $u->getUsersToken('5eefec33-ca71-e511-befe-98991b71acc0');
// now a URL is returned by the formTemplateId of the form you want returned, and the userToken
// passed in from the previous method call.
echo $f->embedForm('9d4d2408-1183-e511-bf05-9c4e36b08790', $userToken);
// EMBED A FORM WITH PERSISTED DATA FROM VISUALVAULT
// first method call requests and stores the users WebToken (userId is passed in here).
$userToken = $u->getUsersToken('5eefec33-ca71-e511-befe-98991b71acc0');
// now a URL is returned by the formTemplateId of the form you want returned, the persistedDataId
// you want to fill out the form fields and the userToken passed in from the previous method call.
echo $p->postFormPdata('9d4d2408-1183-e511-bf05-9c4e36b08790', 'c054e3bb-bd4c-4185-8d45-cf062d369a66', $userToken);