Prev | Current Page 469 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

??™;
private static var SAVE_MESSAGE = ???The page content has been
succesfully saved.??™;
private static var HOME_TITLE = ???Home Page??™;
public var uri(default, null) : String;
private var dir : String;
private var action : RequestAction;
public function new(uri : String, dir : String, action : RequestAction)
{
if(uri == ROOT_URI)
uri = ROOT_PAGE;
if(uri.substr(uri.length - ROOT_URI.length) == ROOT_URI)
uri = uri.substr(0, uri.length - ROOT_URI.length);
this.uri = uri;
Chapter 9: Building Websites with HaXe
243
this.dir = dir;
this.action = action;
}
public function execute() : Void
{
var page : Page;
switch(action)
{
case Edit:
page = new PageEdit(this, DEFAULT_EDIT_TEXT);
case View:
page = new PageView(this, DEFAULT_VIEW_TEXT);
case Save(content):
if(content == ?????™)
removePage();
else
savePage(content);
page = new PageView(this, null, SAVE_MESSAGE);
}
Lib.print(page.render());
}
public function getPageContent(alternative : String) : String
{
if(pageExists())
return neko.


Pages:
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481