openrat-cms

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

commit a41b08860b718bf6d38ffc207b15ef6e2b3b391d
parent 31e626903fdd8aa8e80710d3e6d2c4a21c6fad4b
Author: dankert <devnull@localhost>
Date:   Tue, 28 Dec 2004 23:59:13 +0100

Funktion Seite veroeffentlichen nach Speichern

Diffstat:
actionClasses/PageAction.class.php | 23++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/actionClasses/PageAction.class.php b/actionClasses/PageAction.class.php @@ -97,7 +97,7 @@ class PageAction extends ObjectAction $value->page = &$this->page; // Ermitteln, ob Inhalt sofort freigegeben werden kann und soll - if ( $this->page->hasRight('release') && $this->getRequestVar('release')!='' ) + if ( $this->page->hasRight( ACL_RELEASE ) && $this->hasRequestVar('release') ) $value->publish = true; else $value->publish = false; @@ -123,8 +123,11 @@ class PageAction extends ObjectAction } } $this->page->setTimestamp(); // "Letzte Aenderung" setzen - - $this->callSubAction( 'el' ); + + if ( $this->hasRequestVar('publish') ) + $this->callSubAction( 'pubnow' ); + else + $this->callSubAction( 'el' ); } @@ -200,8 +203,12 @@ class PageAction extends ObjectAction } $this->page->setTimestamp(); // "Letzte Aenderung" setzen - $this->callSubAction( 'el' ); - //$this->callSubAction( $this->getRequestVar('old_pageaction') ); + + // Falls ausgewaehlt die Seite sofort veroeffentlichen + if ( $this->hasRequestVar('publish') ) + $this->callSubAction( 'pubnow' ); // Weiter zum veroeffentlichen + else + $this->callSubAction( 'el' ); // Element-Liste anzeigen } @@ -437,6 +444,9 @@ class PageAction extends ObjectAction } } + $this->setTemplateVar( 'release',$this->page->hasRight(ACL_RELEASE) ); + $this->setTemplateVar( 'publish',$this->page->hasRight(ACL_PUBLISH) ); + $this->setTemplateVar('el',$list); $this->forward('page_form'); } @@ -571,6 +581,9 @@ class PageAction extends ObjectAction */ function pubnow() { + if ( !$this->page->hasRight( ACL_PUBLISH ) ) + die( 'no right for publish' ); + $this->page->publish(); foreach( $this->page->publish->publishedObjects as $o )