/[cvs]/bareface/yakka/methods/YakkaMethodView.php
ViewVC logotype

Contents of /bareface/yakka/methods/YakkaMethodView.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Mon Jan 6 13:35:23 2003 UTC (21 years, 10 months ago) by bareface
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +15 -0 lines
added version setting;

1 <?php
2
3 class YakkaMethodView {
4 function YakkaMethodView(&$engine) {
5 $this->engine = &$engine;
6 }
7
8 function run() {
9 /* getting pagesource from edit/create */
10 if ($pageSource = $this->engine->arguments->getArgument("page-source")) {
11 $this->engine->runtime->page->setSource($pageSource);
12 $this->engine->runtime->page->setModifyUser($this->engine->runtime->user);
13
14 switch($this->engine->arguments->getArgument("page-version-severity")) {
15 case "release":
16 $this->engine->runtime->page->increaseReleaseVersion();
17 break;
18 case "major":
19 $this->engine->runtime->page->increaseMajorVersion();
20 break;
21 case "minor":
22 $this->engine->runtime->page->increaseMinorVersion();
23 break;
24 case "create":
25 $this->engine->runtime->page->setVersion("0.1.0");
26 break;
27 }
28 $this->engine->runtime->page->save();
29 if ($pageParent = $this->engine->arguments->getArgument("page-parent")) {
30 $this->engine->runtime->page->copyGrantsOf($pageParent);
31 $this->engine->runtime->page->copyRevokesOf($pageParent);
32 }
33 }
34
35 /* login */
36 if (($username = $this->engine->arguments->getArgument("username")) && ($password = $this->engine->arguments->getArgument("password"))) {
37 $this->engine->runtime->user = new YakkaUser();
38 $this->engine->runtime->user->authenticate($username, $password);
39 $this->engine->session->user = $this->engine->runtime->user->toString();
40 }
41
42 return "<method id='view' access-privilege='read'/>";
43 }
44 }
45
46 ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed