Exemple #1
0
if (count($config['fields'])) {
    $fields = array_merge($fields, $config['fields']);
    // Test: a loop may be faster.
    $config['fields'] = NULL;
    unset($config['fields']);
}
// ACL
if (!$canAccess && $canEditOwn && !$config['author']) {
    if (empty($config['id'])) {
        $location = $type->storage_location ? $type->storage_location : $config['base']['location'];
        $config['author'] = JCckDatabase::loadResult('SELECT a.author_id FROM #__cck_core AS a WHERE a.storage_location = "' . $location . '" AND a.pk = ' . (int) $config['pk']);
    } else {
        $config['author'] = JCckDatabase::loadResult('SELECT a.author_id FROM #__cck_core AS a WHERE a.id = ' . (int) $config['id']);
    }
    if ((!$config['author'] || $config['author'] != $user->get('id')) && !$canEditOwnContent) {
        CCK_Form::redirect($no_action, $no_redirect, $no_message, $no_style, $config);
        return;
    }
}
// BeforeRender
if (isset($config['process']['beforeRenderForm']) && count($config['process']['beforeRenderForm'])) {
    foreach ($config['process']['beforeRenderForm'] as $process) {
        if ($process->type) {
            JCck::callFunc_Array('plg' . $process->group . $process->type, 'on' . $process->group . 'beforeRenderForm', array($process->params, &$fields, &$config['storages'], &$config));
        }
    }
}
// Finalize
$doc->fields =& $fields;
$infos = array('context' => '', 'params' => $templateStyle->params, 'path' => $path, 'root' => JURI::root(true), 'template' => $templateStyle->name, 'theme' => $tpl['home']);
$doc->finalize('form', $type->name, $config['client'], $positions, $positions_more, $infos);