Beispiel #1
0
 $name = isset($_POST['name']) ? $_POST['name'] : '';
 $extra = isset($_POST['extra']) ? $_POST['extra'] : '';
 $title = isset($_POST['title']) ? $_POST['title'] : '';
 $description = isset($_POST['description']) ? $_POST['description'] : '';
 $header = isset($_POST['header']) ? $_POST['header'] : '';
 $subheader = isset($_POST['subheader']) ? $_POST['subheader'] : '';
 $featured = isset($_POST['featured']) ? $_POST['featured'] : '';
 $body = isset($_POST['body']) ? $_POST['body'] : '';
 $url = isset($_POST['url']) ? $_POST['url'] : '';
 $type = isset($_POST['type']) ? $_POST['type'] : '';
 $published_date = isset($_POST['published_date']) ? $_POST['published_date'] : '';
 $author = isset($_POST['author']) ? $_POST['author'] : '';
 $tag = isset($_POST['tag']) ? $_POST['tag'] : '';
 if (checkPermissions('createPage', $published)) {
     if (count($segments) > 4 && $segments[2] === 'revisions' && $segments[4] === 'extras') {
         $response = $Cosmo->revisionsExtrasCreate($segments[3], $segments[1], $name, $extra);
     }
     if (count($segments) > 2 && $segments[2] === 'revisions') {
         $response['id'] = $Cosmo->revisionsCreate($segments[1], $title, $description, $header, $subheader, $featured, $body, $url, $type, $published, $published_date, $author);
     } else {
         if (count($segments) > 2 && $segments[2] === 'extras') {
             $response = $Cosmo->contentExtrasCreate($segments[1], $name, $extra);
         } else {
             if (count($segments) > 2 && $segments[2] === 'tags') {
                 $response = $Cosmo->contentTagsCreate($segments[1], $tag);
             } else {
                 // Create a new page
                 $response['id'] = $Cosmo->contentCreate($title, $description, $header, $subheader, $featured, $body, $url, $author, $type, $published, $published_date);
             }
         }
     }