Esempio n. 1
0
function txPageBuild()
{
    global $json, $DB;
    VerifyAdministrator(TRUE);
    $GLOBALS['override_page_lock'] = TRUE;
    if ($_REQUEST['new']) {
        BuildNewSelected(array($_REQUEST['page_id']));
    } else {
        BuildSelected(array($_REQUEST['page_id']));
    }
    echo $json->encode(array('status' => JSON_SUCCESS, 'message' => 'The selected TGP page has been built'));
}
Esempio n. 2
0
require_once "{$GLOBALS['BASE_DIR']}/includes/template.class.php";
require_once "{$GLOBALS['BASE_DIR']}/admin/includes/functions.php";
$DB = new DB($C['db_hostname'], $C['db_username'], $C['db_password'], $C['db_name']);
$DB->Connect();
// Run function based on command line argument
switch ($GLOBALS['argv'][1]) {
    case '--build-with-new':
        $args = ParseCommandLine();
        if ($args['override-lock']) {
            $GLOBALS['override_page_lock'] = TRUE;
        }
        if (!IsEmptyString($args['pages'])) {
            if (preg_match('~(\\d+)-(\\d+)~', $args['pages'], $matches)) {
                $args['pages'] = join(',', range($matches[1], $matches[2]));
            }
            BuildNewSelected(explode(',', $args['pages']));
        } else {
            if (!IsEmptyString($args['tags'])) {
                BuildNewTagged($args['tags']);
            } else {
                BuildNewAll();
            }
        }
        break;
    case '--build':
        $args = ParseCommandLine();
        if ($args['override-lock']) {
            $GLOBALS['override_page_lock'] = TRUE;
        }
        if (!IsEmptyString($args['pages'])) {
            if (preg_match('~(\\d+)-(\\d+)~', $args['pages'], $matches)) {