Exemplo n.º 1
0
<div class="contents">
  <h2><?php 
echo $name;
?>
</h2>
  <p>About yout site.</p>
  <p><strong>Note that a page called "index" should be created in the site.</strong></p>
  <p clear>
    <?php 
echo \Lobby::l("{$su}/settings", "Settings", "class='button'");
?>
    <?php 
echo \Lobby::l("{$su}/pages", "Pages", "class='button'");
?>
  </p>
  <form clear method="POST" action="<?php 
echo \Lobby::u();
?>
">
    <button style="font-size: 25px;" name="generate" class="button orange">Generate Site NOW!</button>
  </form>
  <?php 
if (isset($_POST['generate'])) {
    /* Generate the site */
    $gSite = new \Lobby\App\sige\Site($this->getSite($name), $this);
    $gSite->generate($this->getPages($name));
    \Lobby::sss("Generated Site", "The site was successfully generated");
}
?>
</div>
Exemplo n.º 2
0
    $data = $this->getPages($name, $_GET['id']);
    $page_edit = $data['slug'] === "" ? false : true;
    $pid = $_GET['id'];
}
if (isset($_POST['submit'])) {
    $pname = $page_edit === true ? $_GET['id'] : $_POST['name'];
    $title = $_POST['title'];
    $body = $_POST['content'];
    $slug = $_POST['slug'];
    if ($pname == "" || $body == "" || $title == "" || $slug == "") {
        \Lobby::ser("Fill Up", "Please fill up all the fields");
    } else {
        if (!ctype_alnum(str_replace(" ", "", $pname))) {
            \Lobby::ser("Invalid Name", "The page name should only contain alphanumeric characters");
        } else {
            $gSite = new \Lobby\App\sige\Site($site, $this);
            $page = $gSite->page($slug, array("{{page-title}}" => $title, "{{page-content}}" => $body));
            if ($page === true) {
                $this->addPage($name, $pname, array("title" => $title, "slug" => $slug, "body" => $body));
                \Lobby::sss("Page " . ($page_edit ? "Updated" : "Created"), "The page was successfully " . ($page_edit ? "updated" : "created"));
            } else {
                \Lobby::ser("Error", "Some error was occured while creating the page. Try again.");
            }
            $data = $this->getPages($name, $pname);
        }
    }
}
?>
  <form method="POST" action="<?php 
echo \Lobby::u();
?>