Esempio n. 1
0
if ($loggingEnabled) {
    $loggingColumns = (string) $overviewConfig[0]->attributes()->loggingcolumns;
    if (!strlen($loggingColumns)) {
        throw new Exception($i18n->getMessage("entitylogging_nologgingcolumns"));
    }
}
if (isset($_REQUEST['id'])) {
    $id = (int) $_REQUEST['id'];
}
echo "<h1>" . $i18n->getMessage("entity_" . $entity) . "</h1>";
// remove alias
$tablePrefix = $website->getConfig("db_prefix") . "_";
$mainTable = $tablePrefix . $entityConfig[0]->attributes()->dbtable;
$spaceTablePos = strrpos($mainTable, " ");
$mainTableAlias = $spaceTablePos ? substr($mainTable, $spaceTablePos) . "." : "";
$dbTableWithoutPrefix = ModuleConfigHelper::removeAliasFromDbTableName($entityConfig[0]->attributes()->dbtable);
$dbTable = $tablePrefix . $dbTableWithoutPrefix;
// show overview by default
$showOverview = TRUE;
// process add/edit form action
if ($show == "add" || $show == "edit") {
    $showOverview = FALSE;
    $enableFileUpload = FALSE;
    // field config
    $fields = $entityConfig[0]->xpath("editform/field");
    $formFields = array();
    foreach ($fields as $field) {
        $attrs = $field->attributes();
        if ($show == "add" && (bool) $attrs["editonly"]) {
            continue;
        }