Ejemplo n.º 1
0
         } else {
             echo json_encode(array('result' => $result, 'msg' => 'Primary Page Path cannot be updated - there is already a node with this page path'));
             exit;
         }
     } else {
         echo json_encode(array('result' => false, 'msg' => 'AJAX Validation failed'));
         exit;
     }
 }
 ////////////////////////////////////////////////////
 // getPrimaryPagePath - gets the primary url to a page from nodeID - used in pickers
 ////////////////////////////////////////////////////
 if ($_POST['action'] == 'getPrimaryPagePath') {
     if (isset($_POST['nodeID']) && is_int((int) $_POST['nodeID'])) {
         // first check we're not about to create a duplicate
         $content->getPagePaths((int) $_POST['nodeID'], 1);
         $paths = $content->results['pagepath'];
         $pathOut = "ERROR - no page path set";
         foreach ($paths as $path) {
             if ($path['type'] == 0) {
                 $pathOut = '/' . $path['path'];
             }
         }
         echo json_encode(array('result' => true, 'path' => $pathOut));
         exit;
     }
 }
 ////////////////////////////////////////////////////
 // testCopyNode - add test nodes3
 ////////////////////////////////////////////////////
 if ($_POST['action'] == 'copyNodeTest') {