<?php

define('BASEPATH', 'WHATEVER');
//used so dont have to edit CI libraries.
include "lib/form_helper.php";
$fb = new Formbuilder();
$action = isset($_GET['action']) ? $_GET['action'] : null;
switch ($action) {
    case 'properties':
        $fb->properties($_GET);
        break;
    case 'element':
        $fb->element($_GET);
        break;
    default:
        break;
}
/**
 * Filemanager
 */
class Formbuilder
{
    /*
    Build is used to output the forms data as a html form
    $data is an array generated on post from the builder.
    */
    function build($data)
    {
        if (!isset($data['properties'])) {
            return false;
        }