File: //opt/cpanel/ea-php54/root/usr/share/pear/RVSeagullMod/modules/default/classes/memberPageMgr.php
<?php
/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
// | Copyright (c) 2008, Demian Turner |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution. |
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +---------------------------------------------------------------------------+
// | Seagull 0.6 |
// +---------------------------------------------------------------------------+
// | memberPageMgr.php |
// +---------------------------------------------------------------------------+
// | Author: Demian Turner <demian@phpkitchen.com> |
// +---------------------------------------------------------------------------+
// $Id: memberPageMgr.php,v 1.12 2005/04/21 06:34:39 demian Exp $
/**
* Sets up objects for home page.
*
* @package default
* @author Demian Turner <demian@phpkitchen.com>
* @version $Revision: 1.12 $
*/
require_once SGL_MOD_DIR . '/user/classes/LoginMgr.php';
class memberPageMgr extends SGL_Manager
{
function memberPageMgr()
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
parent::SGL_Manager();
$this->pageTitle = 'Home';
$this->_aActionsMapping = array(
'list' => array('list'),
);
}
function validate($req, &$input)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$this->validated = true;
$input->masterTemplate = 'masterBlank.html';
$input->pageTitle = $this->pageTitle;
$page = ($req->get('page')) ? $req->get('page') : 'home.html';
$page = urldecode($page);
$input->action = ($req->get('action')) ? $req->get('action') : 'list';
$fileAutoConf = SGL_VAR_DIR . '/listcomponentmemberpage.ini.php';
if (is_file($fileAutoConf) == true) {
$aAutoConf = RvsLibs_Config::parse_ini_file($fileAutoConf, true);
}
switch ($page) {
case 'Blog':
case 'Faq':
$input->template = (isset($aAutoConf['Template_' . $page])) ? urldecode($aAutoConf['Template_' . $page]) : 'home.html';
break;
case 'Tryout':
$this->setToRedirectTryout();
// break;
case 'PhotoGallery':
case 'Online_Form':
$input->pageId = ($req->get('pageId')) ? $req->get('pageId') : '';
$input->template = (isset($aAutoConf['Template_' . $page . '_' . $input->pageId]))
? urldecode($aAutoConf['Template_' . $page . '_' . $input->pageId])
: 'home.html';
break;
case 'GuestBook':
$input->pageId = ($req->get('pageId')) ? $req->get('pageId') : '';
$input->template = (isset($aAutoConf['Template_' . $page . '_' . $input->pageId]))
? urldecode($aAutoConf['Template_' . $page . '_' . $input->pageId])
: 'home.html';
break;
default:
//case ที่ ไม่ใช่ component
$input->masterTemplate = 'masterNull.html';
$input->template = $page;
}
if (!empty($input->template)) {
$input->formUrl = SGL_BASE_URL . '/' . $input->template;
}
}
function _cmd_list(&$input, &$output)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
//all case: goto redirect
if (isset($input->formUrl)) {
header('Location: ' . $input->formUrl);
}
}
function setToRedirectTryout()
{
//case tryout template category
$aUrl = array(
'managerName' => 'RvsCategory',
'moduleName' => 'tryout'
);
SGL_HTTP::redirect($aUrl);
/*if (SGL_Session::getRoleId() == '1') {
$aUrl = array(
'managerName' => 'user',
'moduleName' => 'user'
);
SGL_HTTP::redirect($aUrl);
} else {
$aUrl = array(
'managerName' => 'RedirectSitebuilder',
'moduleName' => 'user',
'action' => 'redirectToSitebuilder'
);
SGL_HTTP::redirect($aUrl);
}*/
}
}
?>