Example #1
0
 function update_config($values = '')
 {
     //calls on for the database class
     include_once "classes/Property.php";
     $property = new Property();
     //sets the properties to store them, use a switch statement to store different description based on different properties
     if ($property->set_property("Plugin_HelloWorld_greetings", $_POST['Plugin_HelloWorld_greetings'], "Hello World description")) {
         return true;
     } else {
         return false;
     }
 }
Example #2
0
function updateProperties($properties)
{
    //global all variables
    global $keys, $propertyForm;
    //create an empty temporary array to store all the new values given from the form
    $tempArray = array();
    foreach ($keys as $index => $key) {
        $key = str_replace(" ", "_", $key);
        $tempArray[$key] = trim($_POST[$key]);
    }
    print_r($tempArray);
    $index = 0;
    foreach ($properties as $id => $value) {
        $thisProperty = new Property();
        //error check
        $thisProperty->set_property($id, $tempArray[$keys[$index]]);
        $index++;
    }
    $status = "success";
    echo "<meta http-equiv=\"REFRESH\" content=\"0;url=" . $_SERVER['PHP_SELF'] . "?update=" . $status . "\">";
}