Ejemplo n.º 1
0
<?php

defined('C5_EXECUTE') or die("Access Denied.");
$sh = Loader::helper('concrete/dashboard/sitemap');
if (!$sh->canRead()) {
    die(t('Access Denied'));
}
if (isset($_REQUEST['cID']) && is_array($_REQUEST['cID'])) {
    foreach ($_REQUEST['cID'] as $displayOrder => $cID) {
        $v = array($displayOrder, $cID);
        $c = Page::getByID($cID);
        $c->updateDisplayOrder($displayOrder, $cID);
    }
}
$r = new PageEditResponse();
$r->setMessage(t("Display order saved."));
$r->outputJSON();
Ejemplo n.º 2
0
         foreach ($permissions as $pk) {
             $paID = $_POST['pkID'][$pk->getPermissionKeyID()];
             $ps->addPermissionAssignment($pk->getPermissionKeyID(), $paID);
         }
         $pkr->setPagePermissionSet($ps);
         $pkr->setRequesterUserID($u->getUserID());
         $u->unloadCollectionEdit($c);
         $response = $pkr->trigger();
         if (!$response instanceof \Concrete\Core\Workflow\Progress\Response) {
             $deferred = true;
         }
     }
     $r = new PageEditResponse();
     $r->setPage($c);
     if ($deferred) {
         $r->setMessage(t('Page permissions request saved successfully. You must approve this workflow request before the permissions are changed.'));
     } else {
         $r->setMessage(t('Page permissions saved successfully.'));
     }
     $r->outputJSON();
 }
 if ($_REQUEST['task'] == 'bulk_add_access' && Loader::helper('validation/token')->validate('bulk_add_access')) {
     if (is_array($_REQUEST['pkID'])) {
         $pkID = key($_REQUEST['pkID']);
         $pk = PermissionKey::getByID($pkID);
         $newPAID = $_REQUEST['pkID'][$pkID];
         $u = new User();
         $deferred = false;
         foreach ($pages as $c) {
             if ($_REQUEST['paReplaceAll'] == 'add') {
                 $pk->setPermissionObject($c);