From 531b89f69ab5e72900fbd2484d60491f68e9153b Mon Sep 17 00:00:00 2001 From: neoraider Date: Tue, 18 Apr 2006 00:20:03 +0000 Subject: Sofort-Bearbeiten funktioniert jetzt. --- pages/content/Pages:Edit.xml | 30 +++++++++----------------- pages/content/Pages:Edit:Do.xml | 47 +++++++++++++++++++++++++++++++++++++++++ pages/content/Pages:Handle.xml | 12 +++++------ 3 files changed, 62 insertions(+), 27 deletions(-) create mode 100644 pages/content/Pages:Edit:Do.xml (limited to 'pages/content') diff --git a/pages/content/Pages:Edit.xml b/pages/content/Pages:Edit.xml index dfe9a51..beaa0b3 100644 --- a/pages/content/Pages:Edit.xml +++ b/pages/content/Pages:Edit.xml @@ -3,7 +3,7 @@ Pages:Edit - 0:0 + 9:0 c @@ -11,32 +11,22 @@ GetNeonLink('Pages', 'type=' . $_POST['type'], false)); - exit(); - } - - if(!$_POST['name']) exit(); - - $data = array(); + if(!$_GET['name'] || !$_GET['backlink']) exit(); - foreach($_POST as $key => $val) { - if(substr($key, 0, 5) != 'data_') continue; - - $data[substr($key, 5)] = Unquote($val); - } - - $GLOBALS['pages']->Edit(Unquote($_POST['name']), $_POST['type'], $data); + if(!$GLOBALS['pages']->HasWriteAccess(Unquote($_GET['name']), $_GET['type'])) + exit(); - header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false)); - exit(); + $data = $GLOBALS['pages']->GetEditor(Unquote($_GET['name']), $_GET['type'], Unquote($_GET['backlink'])); + + $title = $data['title']; + + echo $data['content']; ?> ]]> diff --git a/pages/content/Pages:Edit:Do.xml b/pages/content/Pages:Edit:Do.xml new file mode 100644 index 0000000..15c5f51 --- /dev/null +++ b/pages/content/Pages:Edit:Do.xml @@ -0,0 +1,47 @@ + + + + Pages:Edit:Do + + 9:0 + c + + + + HasWriteAccess(Unquote($_POST['name']), $_POST['type'])) + exit(); + + $data = array(); + + foreach($_POST as $key => $val) { + if(substr($key, 0, 5) != 'data_') continue; + + $data[substr($key, 5)] = Unquote($val); + } + + $GLOBALS['pages']->Edit(Unquote($_POST['name']), $_POST['type'], $data); + + header('Location: ' . Unquote($_POST['backlink'])); + exit(); +?> + ]]> + + + diff --git a/pages/content/Pages:Handle.xml b/pages/content/Pages:Handle.xml index c2b6602..cc334e0 100644 --- a/pages/content/Pages:Handle.xml +++ b/pages/content/Pages:Handle.xml @@ -44,13 +44,11 @@ GetEditor(Unquote($_POST['name']), $_POST['type']); - - $title = $data['title']; - - echo $data['content']; - } + $backlink = $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false); + + header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages:Edit', 'type=' . $_POST['type'] . + '&name=' . urlencode(Unquote($_POST['name'])) . '&backlink=' . urlencode($backlink), false)); + exit(); } elseif(isset($_POST['privs'])) { if($_POST['name']) { -- cgit v1.2.3