$uuid, 'key'=>$uuid, 'slug'=>$uuid, 'title'=>$title, 'content'=>$content, 'type'=>'draft' ); // Get the page key by the UUID $pageKey = $pages->getByUUID($uuid); // if pageKey is empty means the page doesn't exist if (empty($pageKey)) { createPage($page); } else { editPage($page); } ajaxResponse(0, 'Save as draft successfully.', array( 'uuid'=>$uuid )); ?>