commit 50641fd1f14a1fa93c288548c909fc41e189f45a
parent d252842e1025f6823b02cd6fa98bef32068150af
Author: dankert <devnull@localhost>
Date: Thu, 9 Jan 2014 21:43:44 +0100
Anlegen von Seiten.
Diffstat:
2 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/config.ini b/config.ini
@@ -15,6 +15,5 @@ rootfolderid=5145
urlschema=daily
templateid=23
-elementid_title=
elementid_text=69
elementid_image=
diff --git a/index.php b/index.php
@@ -124,6 +124,43 @@ function request( $client,$method,$parameter )
$folderid = $nextfolderid;
}
+ // Seite anlegen.
+ $response = request( $client,'POST', array
+ (
+ 'action' => 'folder',
+ 'subaction' => 'createpage',
+ 'id' => $folderid,
+ 'templateid' => $config['project']['templateid'],
+ 'token' => $token,
+ 'name' => $_POST['title'],
+ 'filename' => $_POST['title']
+ ) );
+ $pageobjectid = $response['objectid'];
+
+ /*
+ *
+ // Ggf. Datei anlegen.
+ $response = request( $client,'POST', array
+ (
+ 'action' => 'folder',
+ 'subaction' => 'createfile',
+ 'token' => $token,
+ 'name' => $title,
+ 'filename' => $title
+ ) );
+ $pageobjectid = $response['objectid'];
+ */
+
+ // Text speichern anlegen.
+ $response = request( $client,'POST', array
+ (
+ 'action' => 'pageelement',
+ 'subaction' => 'edit',
+ 'id' => $pageobjectid,
+ 'elementid' => $config['project']['elementid_text'],
+ 'token' => $token,
+ 'text' => $_POST['text']
+ ) );
?>