miniblog

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 8b3853172ebeb8cfe84420d837d4050cdb590ff5
parent 7833024919f1eb3f6996dee2f44170f4e368df43
Author: dankert <devnull@localhost>
Date:   Thu,  9 Jan 2014 22:30:09 +0100

Das Projekt auswählen, den Inhalt freigeben.

Diffstat:
config.ini | 6++++--
index.php | 24++++++++++++++++++------
2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/config.ini b/config.ini @@ -2,14 +2,16 @@ [server] -host="localhost" +host="duese" port="80" -path="/~dankert/cms-test/09/dispatcher.php" +path="/~dankert/cms/cms09/dispatcher.php" database="pg_prod" [project] +projectid=13 +languageid=19 rootfolderid=5145 ; daily|monthly|yearly|flat urlschema=daily diff --git a/index.php b/index.php @@ -67,6 +67,14 @@ function request( $client,$method,$parameter ) $client->cookie =$response['session']['name'].'='.$response['session']['id']; $token = $response['session']['token']; + + + // PRojekt auswählen + $response = request( $client,'POST', array( + 'action' => 'start', + 'subaction' => 'projectmenu', + 'token' => $token, + 'id' => $config['project']['projectid']) ); // Ordner laden. @@ -97,12 +105,13 @@ function request( $client,$method,$parameter ) $response = request( $client,'GET', array ( 'action' => 'folder', - 'subaction' => 'show', + 'subaction' => 'edit', 'id' => $folderid ) ); - + + // Prüfen, ob der nächste Unterordner bereits existiert. $nextfolderid = null; - foreach( $response['object'] as $objectid=>$object ) + foreach( $response['output']['object'] as $objectid=>$object ) { if ( $object['name'] == $foldername ) { @@ -112,14 +121,16 @@ function request( $client,$method,$parameter ) } if ( empty($nextfolderid) ) { - $response = request( $client,'POST', array + // Der nächste Unterordner existiert noch nicht, also müssen wir diesen anlegen. + $responseCreate = request( $client,'POST', array ( 'action' => 'folder', 'subaction' => 'createfolder', + 'id' => $folderid, 'token' => $token, 'name' => $foldername ) ); - $nextfolderid = $response['objectid']; + $nextfolderid = $responseCreate['output']['objectid']; } $folderid = $nextfolderid; } @@ -135,7 +146,7 @@ function request( $client,$method,$parameter ) 'name' => $_POST['title'], 'filename' => $_POST['title'] ) ); - $pageobjectid = $response['objectid']; + $pageobjectid = $response['output']['objectid']; /* * @@ -159,6 +170,7 @@ function request( $client,$method,$parameter ) 'id' => $pageobjectid, 'elementid' => $config['project']['elementid_text'], 'token' => $token, + 'release' => '1', 'text' => $_POST['text'] ) );