|
|
|
@ -7,10 +7,20 @@ $pub = false;
|
|
|
|
|
|
|
|
|
|
$pubdata = [];
|
|
|
|
|
|
|
|
|
|
$edit = false;
|
|
|
|
|
|
|
|
|
|
if (is_numeric($VARS['pubid'])) {
|
|
|
|
|
if ($database->has('publications', ['pubid' => $VARS['pubid']])) {
|
|
|
|
|
$pub = $VARS['pubid'];
|
|
|
|
|
$pubdata = $database->get("publications", ["pubname", "pubdate", "styleid", "columns", "page_size", "landscape"], ["pubid" => $pub]);
|
|
|
|
|
$pubdata = $database->get("publications", ["[>]pub_permissions" => ["permid" => "permid"]], ["pubname", "uid", "pubdate", "styleid", "columns", "page_size", "landscape", "publications.permid", "permname"], ["pubid" => $pub]);
|
|
|
|
|
if ($pubdata["uid"] == $_SESSION['uid']) {
|
|
|
|
|
$edit = true;
|
|
|
|
|
} else {
|
|
|
|
|
if ($pubdata["permname"] == "OWNER") {
|
|
|
|
|
header("Location: app.php?page=content&msg=no_permission");
|
|
|
|
|
die();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
header("Location: app.php?page=content&msg=invalid_pubid");
|
|
|
|
|
die();
|
|
|
|
@ -33,13 +43,13 @@ if ($pub === false) {
|
|
|
|
|
?>
|
|
|
|
|
</select>
|
|
|
|
|
<input type="hidden" name="page" value="content" />
|
|
|
|
|
<button type="submit" class="btn btn-success"><i class="fa fa-arrow-right"></i> <?php lang("open"); ?></button>
|
|
|
|
|
<button type="submit" class="btn btn-success"><i class="fa fa-folder-open-o"></i> <?php lang("open"); ?></button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<?php
|
|
|
|
|
} else {
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<?php if ($edit) { ?>
|
|
|
|
|
<div class="modal fade" id="tile-options-modal" tabindex="-1" role="dialog" aria-labelledby="tile-options-title">
|
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
@ -125,15 +135,19 @@ if ($pub === false) {
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
|
|
<div class="btn-group mgn-btm-10px">
|
|
|
|
|
<?php if ($edit) { ?>
|
|
|
|
|
<div class="btn btn-success" id="new_tile_btn" data-toggle="modal" data-target="#new-tile-modal"><i class="fa fa-plus"></i> <?php lang("new tile"); ?></div>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
<a class="btn btn-primary" id="preview_btn" href="lib/gencontent.php?pubid=<?php echo $pub; ?>" target="_BLANK"><i class="fa fa-search"></i> <?php lang("preview"); ?></a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="pages-box">
|
|
|
|
|
<?php
|
|
|
|
|
define("IN_NEWSPEN", true);
|
|
|
|
|
define("EDIT_MODE", true);
|
|
|
|
|
define("EDIT_MODE", $edit);
|
|
|
|
|
require_once __DIR__ . "/../lib/gencontent.php";
|
|
|
|
|
echo $content;
|
|
|
|
|
?>
|
|
|
|
|