[Ataraxis-checkins] SF.net SVN: ataraxis: [25] core
Status: Planning
Brought to you by:
klarinetking
|
From: <kla...@us...> - 2006-08-02 15:32:42
|
Revision: 25 Author: klarinetking Date: 2006-08-02 08:32:22 -0700 (Wed, 02 Aug 2006) ViewCVS: http://svn.sourceforge.net/ataraxis/?rev=25&view=rev Log Message: ----------- Started work on the register page. Modified Paths: -------------- core/common.inc.php core/inc/classes/class.page.php core/index.php core/login.php Modified: core/common.inc.php =================================================================== --- core/common.inc.php 2006-08-01 15:08:32 UTC (rev 24) +++ core/common.inc.php 2006-08-02 15:32:22 UTC (rev 25) @@ -48,6 +48,12 @@ $registry->register('session', $session); $user = new user($registry); +$registry->register('user', $user); $page = new page($registry); + +if ( $session->loggedOn == TRUE ) +{ + $template->assign('loggedOn', 'True'); +} ?> \ No newline at end of file Modified: core/inc/classes/class.page.php =================================================================== --- core/inc/classes/class.page.php 2006-08-01 15:08:32 UTC (rev 24) +++ core/inc/classes/class.page.php 2006-08-02 15:32:22 UTC (rev 25) @@ -30,6 +30,8 @@ $this->settings = $registry->get('settings'); $this->template = $registry->get('template'); $this->db = $registry->get('db'); + $this->session = $registry->get('session'); + $this->user = $registry->get('user'); } /** @@ -75,8 +77,13 @@ public function outputRightSidebar () { $this->template->assign(array( + 'lLogout' => '(Logout)', 'lRegister' => 'Register', - 'uRegister' => './register.php') + + 'uRegister' => './register.php', + 'uLogout' => $this->session->appendSid('./login.php?logout=true'), + + 'vUsername' => $this->user->info->username) ); $this->template->display('sidebarRight.inc.tpl'); @@ -106,17 +113,41 @@ $this->template->display('footer.inc.tpl'); } + /** + * outputAll + * + * Outputs all the pieces of the template. + * + * @access public + * @param string $pageTitle + * @param string $templateFile + */ + + public function outputAll($pageTitle, $templateFile) + { + $this->outputHeader($pageTitle); + $this->outputLeftSidebar(); + $this->outputRightSidebar(); + $this->template->display($templateFile); + $this->outputFooter(); + } + + /** + * outputMessage + * + * Easily displays a message. + * + * @access public + * @param string $message + */ + public function outputMessage ($message) { $this->template->assign(array( 'lMessage' => $message) ); - $this->outputHeader('Message'); - $this->outputLeftSidebar(); - $this->template->display('messageBody.inc.tpl'); - $this->outputRightSidebar(); - $this->outputFooter(); + $this->outputAll('Message', 'messageBody.inc.tpl'); } } ?> \ No newline at end of file Modified: core/index.php =================================================================== --- core/index.php 2006-08-01 15:08:32 UTC (rev 24) +++ core/index.php 2006-08-02 15:32:22 UTC (rev 25) @@ -7,24 +7,7 @@ require_once ('./common.inc.php'); -if ( $session->loggedOn == TRUE ) -{ - $template->assign('loggedOn', 'True'); -} - -$template->assign(array( - 'vUsername' => $user->info->username, - - 'lLogout' => '(Logout)', - - 'uLogout' => $session->appendSid('./login.php?logout=true')) -); - // Output the page -$page->outputHeader('Main Page'); -$page->outputLeftSidebar(); -$page->outputRightSidebar(); -$template->display('indexBody.inc.tpl'); -$page->outputFooter(); +$page->outputAll('Main Page', 'indexBody.inc.tpl'); ?> \ No newline at end of file Modified: core/login.php =================================================================== --- core/login.php 2006-08-01 15:08:32 UTC (rev 24) +++ core/login.php 2006-08-02 15:32:22 UTC (rev 25) @@ -16,7 +16,7 @@ $session->destroySession($_GET['sid']); $page->outputMessage('You have been logged out. Click <a href="./index.php">here</a> to return to the index'); } -elseif ( isset($_POST['loginUsername']) && isset($_POST['loginPassword']) ) +elseif ( isset($_POST['loginSubmit']) && !empty($_POST['loginSubmit']) && $_POST['loginSubmit'] == 'Login' ) { // @todo: clean variables later This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |