break; ################################################## # Menus # ################################################## ################################################## # Menus # ################################################## case 'menus': switch ($method) { case 'GET': $response = $Cosmo->menusRead(); break; case 'POST': $name = isset($_POST['name']) ? $_POST['name'] : ''; if ($role === 'admin') { $response = $Cosmo->menusCreate($name); } break; case 'PUT': $name = isset($_PUT['name']) ? $_PUT['name'] : ''; $menu = isset($_PUT['menu']) ? $_PUT['menu'] : ''; $area = isset($_PUT['area']) ? $_PUT['area'] : ''; if ($role === 'admin') { $response = $Cosmo->menusUpdate($segments[1], $name, $menu, $area); } break; case 'DELETE': if (isset($segments[1])) { if ($role === 'admin') { $response = $Cosmo->menusDelete($segments[1]); }
$Cosmo->contentCreate('Welcome to Cosmo', 'Welcome to Pendant, a blog theme developed for Cosmo.', 'Welcome to Cosmo', 'Your new website awaits', 'uploads/MIbCzcvxQdahamZSNQ26_12082014-IMG_3526-54571eebdae22.jpg', '<p class="ng-scope">Your site is now running on Cosmo, an open source content management system that\'s designed to help make editing your website quick and easy, it\'s created by James and<a href="http://twitter.com/jordandunn"> Jordan Dunn</a>. If this is your first time using Cosmo we recommend <a href="http://cosmocms.org/cosmo-basics">checking out our how-to\'s</a> for creating pages, editing content, uploading media and more. Once you\'re ready to make your first page, click the umbrella to your left, go to content > new page and you\'ll be on your way.</p><p class="ng-scope"><span class="ng-scope">If you\'re looking to create a new theme for Cosmo you can view all documentation for <a href="http://cosmocms.org/how-to-create-a-theme-for-cosmo">theme creation</a> along with how to use or <a href="http://cosmocms.org/how-to-create-a-module-for-cosmo">create new modules</a> to run within Cosmo.</span></p><p class="ng-scope">If you\'re looking for some free photos to work well with your new site, we recommend checking out <a href="http://deathtothestockphoto.com">Death to Stock Photo</a> or <a href="https://unsplash.com">Unsplash</a>.</p><p class="ng-scope">Once your website is up and running, <a href="http://twitter.com/cosmocms">send us a link</a> so we can check it out and maybe even highlight it on our website or social media.</p>', '/welcome-to-cosmo', 1, 'post.html', 'Y', NULL); $Cosmo->contentExtrasCreate(4, 'featured', '{"id":"featured","alt":"Welcome","src":"uploads/MIbCzcvxQdahamZSNQ26_12082014-IMG_3526-54571eebdae22.jpg","size":"responsive","responsive":"yes"}'); $Cosmo->contentTagsCreate(4, 'blog'); // Insert first file $stmt = $pdo->prepare('INSERT INTO ' . $prefix . 'files (filename, responsive, type, timestamp) VALUES (?,?,?,?)'); $data = array('uploads/MIbCzcvxQdahamZSNQ26_12082014-IMG_3526-54571eebdae22.jpg', 'yes', 'image', time()); $stmt->execute($data); // Insert first block $Cosmo->blocksCreate('Home Page'); $Cosmo->blocksUpdate('Home Page', '<div one-post="blog"></div>', 0, 'block1', 1); $Cosmo->blocksRequirementsCreate(1, 'visible', '/'); // Insert footer block $Cosmo->blocksCreate('Copyright'); $Cosmo->blocksUpdate('Copyright', '<p>Copyright © {{page.current_year}} | Built with <a href="http://www.cosmocms.org/"><img class="cosmo-logo" alt="Single Page Application CMS" src="core/img/cosmo-logo.svg"></a></p>', 0, 'footer', 2); // Insert example primary menu $Cosmo->menusCreate('Primary'); $Cosmo->menusUpdate(1, 'Primary', '[{"id":1,"title":"About","url":"about","items":[]},{"id":100,"title":"Contact","url":"contact","items":[]}]', 'primary'); } catch (Exception $e) { } } // User hasn't submitted the form yet if (!$_GET) { ?> <html ng-app="app"> <head> <title translate>install_cosmo</title> <link rel="stylesheet" type="text/css" href="core/css/cosmo-default-style.minify.css"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"> <script src="core/js/angular/angular.min.js"></script> <script src="core/js/3rd-party/angular-translate.min.js"></script> <!--<script src="core/js/3rd-party/angular-translate-storage-cookie.min.js"></script>-->