コード例 #1
0
    $order->clean($options['parent']);
} else {
    $options['position'] = $old_position;
}
// Work out level and root parent
if ($options['parent'] != '0') {
    $options['level'] = CAT_Helper_Page::properties($options['parent'], 'level') + 1;
}
$options['root_parent'] = $options['level'] == 1 ? $options['parent'] : CAT_Helper_Page::getRootParent($options['parent']);
// changes the values in the options array
CAT_Helper_Page::sanitizeLink($options);
CAT_Helper_Page::sanitizeTemplate($options);
CAT_Helper_Page::sanitizeLanguage($options);
// Check if page already exists; checks access file, directory, and database
if ($options['link'] !== $old_link) {
    if (CAT_Helper_Page::exists($options['link'])) {
        $ajax = array('message' => $backend->lang()->translate('A page with the same or similar link exists'), 'success' => false);
        print json_encode($ajax);
        exit;
    }
}
// we use reset() to reload the page tree
CAT_Helper_Page::reset();
// Get page trail
$options['page_trail'] = CAT_Helper_Page::getPageTrail($options['parent']) . ',' . $page_id;
if (substr($options['page_trail'], 0, 1) == 0) {
    $options['page_trail'] = str_replace('0,', '', $options['page_trail']);
}
// ==================================================
// ! save page
// ==================================================