Exemple #1
0
    $output = $_POST['output'];
    $theme = isset($_POST['theme']) ? $_POST['theme'] : "";
    /* Any change to the below must be reflected in settings.php */
    if ($name != "" && $output != "" && $theme != "") {
        if (!file_exists($output) || !is_writable($output)) {
            \Lobby::ser("Output Path problem", "The path you gave as output doesn't exist or permission is not acceptable. Make sure it's an existing directory with Read & Write permission", false);
        } else {
            if (!ctype_alnum(str_replace(" ", "", $name))) {
                \Lobby::ser("Invalid Name", "Only alphanumeric characters are allowed for Site Name", false);
            } else {
                if (array_search($theme, $this->themes) === false) {
                    \Lobby::ser("Invalid Theme", "The theme you selected doesn't exist", false);
                } else {
                    // Everything's great
                    $this->addSite($name, $output, $theme);
                    \Lobby::sss("Site added", "The site was added successfully");
                }
            }
        }
    } else {
        \Lobby::ser("Fill Up", "Please fill the form completely", false);
    }
}
?>
  <form action="" method="POST">
    <label>
      <div>Site Name</div>
      <input type="text" name="site" />
    </label><cl/>
    <label>
      <div>Output Location</div>
Exemple #2
0
    $output = $_POST['output'];
    $tagline = $_POST['tagline'];
    $theme = isset($_POST['theme']) ? $_POST['theme'] : "";
    if ($output != "" && $theme != "") {
        if (!file_exists($output) || !is_writable($output)) {
            \Lobby::ser("Output Path problem", "The path you gave as output doesn't exist or permission is not acceptable. Make sure it's an existing directory with Read & Write permission", false);
        } else {
            if (array_search($theme, $this->themes) === false) {
                \Lobby::ser("Invalid Theme", "The theme you selected doesn't exist", false);
            } else {
                // Everything's great
                $this->addSite($name, $tagline, $output, $theme, isset($_POST['empty']) ? 1 : 0, isset($_POST['titleTag']) ? 1 : 0);
                /* Generate the site */
                $gSite = new sigeSite($this->getSite($name));
                $gSite->generate($this->getPages($name));
                \Lobby::sss("Site updated", "The site was updated and generated successfully");
            }
        }
    } else {
        \Lobby::ser("Fill Up", "Please fill the form completely", false);
    }
}
?>
  <form action="<?php 
echo \Lobby::u();
?>
" method="POST" clear>
    <?php 
$site = $this->getSite($name);
$empty = $site['empty'] == 1 ? "checked='checked'" : "";
$titleTag = isset($site['titleTag']) && $site['titleTag'] == 1 ? "checked='checked'" : "";
Exemple #3
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>
Exemple #4
0
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();
?>
" style="width: 700px;">
    <?php 
if ($data['title'] == "") {
    ?>
Exemple #5
0
function sss($title, $description)
{
    \Lobby::sss($title, $description);
}
Exemple #6
0
if (isset($_POST['submit'])) {
    $pname = $valid === 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 Updated", "The page was successfully " . ($valid ? "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();
?>
" style="width: 700px;">
    <?php 
if ($data['title'] == "") {
    ?>