示例#1
0
<?php

use CCK\ContentAPI;
# New ContentAPI Object
$_cck_api_content = new ContentAPI($_cck_types, $_cck_config);
# Get Content
$_cck_api_content->get($_GET);
示例#2
0
<?php

use CCK\ContentAPI;
use CCK\FieldsUI;
# Create FieldsUI Object
$fieldsUI = new FieldsUI($_cck_types, $_cck_config);
# New ContentAPI Object
$_cck_api_content = new ContentAPI($_cck_types, $_cck_config);
# Check for ID
if (isset($_GET['ID']) && is_numeric($_GET['ID'])) {
    # Get Content
    $content = $_cck_api_content->get($_GET, 'Array');
    # If not false, pass to UI.
    if ($content) {
        # The Content
        $theContent = $content[0];
        # Get Type
        if (!$fieldsUI->typeExists($theContent['type'])) {
            add_var('error', '<strong>' . $theContent['type'] . '</strong> is not a valid content type.');
        } else {
            # Type
            $type = $theContent['type'];
            # Pass to UI
            add_var('fields', $fieldsUI->buildForm($type, $theContent));
            add_var('type', $type);
        }
    }
} else {
    header('location: /manage');
}
示例#3
0
<?php

use CCK\ContentAPI;
# New ContentAPI Object
$_cck_api_content = new ContentAPI($_cck_types, $_cck_config);
# Get Args
$args = count($_GET) > 1 ? $_GET : array('status' => array(0, 1));
# Get Content
$content = $_cck_api_content->get($args, 'Array');
# Pass to UI
add_var('cck_content', $content);