Example #1
0
}
if (!empty($_POST['visibility'])) {
    $setVisibility = $_POST['visibility'];
    $visibility = setCategoryVisibility($blogid, $selected, $setVisibility);
} else {
    $visibility = getCategoryVisibility($blogid, $selected);
}
if (!empty($_POST['deleteCategory'])) {
    $parent = getParentCategoryId($blogid, $_POST['deleteCategory']);
    $selected = is_null($parent) ? 0 : $parent;
    $_POST['modifyCategoryName'] = '';
    $_POST['modifyCategoryBodyId'] = '';
    deleteCategory($blogid, $_POST['deleteCategory']);
}
if (!empty($_POST['direction'])) {
    moveCategory($blogid, $selected, $_POST['direction']);
}
if ($selected == 0) {
    $depth = 0;
} else {
    if (!empty($_GET['name1']) && !empty($_GET['name2'])) {
        $depth = 2;
    } else {
        if (!empty($_GET['name1']) && empty($_GET['name2'])) {
            $depth = 1;
        } else {
            $depth = 0;
        }
    }
}
if (empty($_GET['entries']) || $_GET['entries'] == 0) {
Example #2
0
            updateCategory($name, $id, $description, $target, $type);
            break;
        case "move_category":
            $oldid = '';
            $newid = '';
            $type = '';
            if (isset($_REQUEST['oldid'])) {
                $oldid = $_REQUEST['oldid'];
            }
            if (isset($_REQUEST['newid'])) {
                $newid = $_REQUEST['newid'];
            }
            if (isset($_REQUEST['type'])) {
                $type = $_REQUEST['type'];
            }
            moveCategory($type, $oldid, $newid);
            break;
        default:
            echo json_encode(array("success" => false, "msg" => "ERROR1: API:" . $task . " is not present"));
    }
} catch (Exception $x) {
    //  $body= 'File: '.($x->getFile()).' Line: '.($x->getLine()).' Message:'. ($x->getMessage()).' Trace'.(var_log($x->getTrace());
    $logService->log('ERROR', 'API ' . $task . '(duration:' . number_format(microtime(TRUE) * 1000000 - $t) . ')', fe($x), $identity);
    echo json_encode(array("success" => false, "msg" => "ERROR2: Exception:" . $x->getMessage()));
}
if ($task != 'tick') {
    $logService->log('TRACE', 'EXIT API ' . $task . '(duration:' . number_format(microtime(TRUE) * 1000000 - $t) . ')', $response, $identity);
}
/**
 **/
function getD4Status($forum, $url)