openrat-cms

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

commit d90995505e90905a2b642ce1694331013890c45f
parent d04a7ef693a8858db372bf3aba4b88e2a950eefb
Author: dankert <dankert@laptop-jan>
Date:   Thu, 21 Mar 2013 09:22:29 +0100

Veröffentlichen aller Seiten zu einer Vorlage.

Diffstat:
Maction/TemplateAction.class.php | 44++++++++++++++++++++++++++++++++++++++++++++
Mmodel/Template.class.php | 3++-
Athemes/default/templates/template/pub.tpl.src.xml | 32++++++++++++++++++++++++++++++++
3 files changed, 78 insertions(+), 1 deletion(-)

diff --git a/action/TemplateAction.class.php b/action/TemplateAction.class.php @@ -474,6 +474,50 @@ class TemplateAction extends Action /** + * Anzeigen der Maske zum Veröffentlichen. + */ + public function pubView() + { + + } + + + + /** + * Veröffentlichen. + */ + public function pubPost() + { + $objectIds = $this->template->getDependentObjectIds(); + + foreach( $objectIds as $objectid ) + { + $page = new Page( $objectid ); + + if ( !$page->hasRight( ACL_PUBLISH ) ) + continue; + + $page->public = true; + $page->publish(); + $page->publish->close(); + + // foreach( $this->page->publish->publishedObjects as $o ) + // { + // $this->addNotice($o['type'],$o['full_filename'],'PUBLISHED','ok'); + // } + + $this->addNotice( 'page', + $page->fullFilename, + 'PUBLISHED'.($page->publish->ok?'':'_ERROR'), + $page->publish->ok, + array(), + $page->publish->log ); + } + } + + + + /** * Stellt fest, welche Menüeinträge ggf. ausgeblendet werden. * * @see actionClasses/Action#checkMenu($name) diff --git a/model/Template.class.php b/model/Template.class.php @@ -364,7 +364,8 @@ SQL /** - * Ermitteln alles Objekte (=Seiten), welche auf diesem Template basieren + * Ermitteln alles Objekte (=Seiten), welche auf diesem Template basieren. + * * @return Array Liste von Objekt-IDs */ function getDependentObjectIds() diff --git a/themes/default/templates/template/pub.tpl.src.xml b/themes/default/templates/template/pub.tpl.src.xml @@ -0,0 +1,31 @@ +<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openrat.de/template ../template.xsd"> + + <!-- + Falls das Veroeffentlichen deaktiviert ist, eine Warnmeldung anzeigen. + --> + <if true="config:security/nopublish"> + <part class="message warn"> + <text key="GLOBAL_NOPUBLISH_DESC" class="help"></text> + </part> + </if> + + + + <form> + <group title="message:options"> + + <part class="line"> + <part class="label"> + </part> + <part class="input"> + <checkbox name="pages" readonly="true" default="true"></checkbox> + <label for="files"> + <text text="publish"></text> + </label> + </part> + </part> + + </group> + </form> +</output> +\ No newline at end of file