public static function deleteRecord($id)
 {
     $query = "delete from structured_field where id={$id}";
     $result = mysql_query($query) or die(sqlError(__FILE__, __LINE__, $query));
     // delete values and assets
     StructuredFieldValue::deleteAll($id);
     StructuredFieldAsset::deleteAll($id);
 }
Esempio n. 2
0
    } else {
        $lockVal = $selectedRecord[4];
    }
    StructuredField::updateRecord($selectedRecord[0], $recordName, $selectedRecord[2], $lockVal);
    $records = StructuredField::getSortedRecords($id, $isAdmin);
}
//get default values for the textareas (either from the selecting record, or from the first record)
if ($init) {
    $selectedRecord = StructuredField::readRecord($init);
} else {
    $selectedRecord = $records[0];
    $init = $selectedRecord[0];
}
if ($init) {
    $textArray = StructuredFieldValue::getValues($init);
    $assetArray = StructuredFieldAsset::getAssets($init);
    $selectedRecordName = displayValue($selectedRecord[3]);
    // don't show locked record for non-admin users or there is no record name in the URL
    $lock = $selectedRecord[4];
    if (empty($name) || $lock == 1 && !$isAdmin) {
        header('location:index.php');
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>standupweb CMS - Edit <?php 
echo $name;
?>