<?php
/* SVN FILE: $Id: search.php 412 2008-05-18 07:46:01Z bb_yujiro $ */
/**
 * Model_View Controller
 *
 * PHP versions 5
 *
 *      Hitsuji : Social Network Service <http://rakuto.net/rktSNS/>
 *      Copyright (c) 2007 Yujiro Takahashi
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @package         Hitsuji
 * @copyright       Copyright (c) 2007 Yujiro Takahashi
 * @link            http://rakuto.net/
 * @author          Yujiro Takahashi <yujiro@rakuto.net>
 * @version         $Revision: 412 $
 * @modifiedby      $LastChangedBy: bb_yujiro $
 * @lastmodified    $Date: 2008-05-18 16:46:01 +0900 (日, 18 5 2008) $
 * @license         http://opensource.org/licenses/mit-license.php The MIT License
 */

/**
 * Controllerクラス
 *
 * @category        Hitsuji : controller
 * @package         Hitsuji
 * @copyright       Copyright (c) 2007 Yujiro Takahashi
 * @link            http://rakuto.net/rktSNS/
 * @author          Yujiro Takahashi <yujiro@rakuto.net>
 * @version         $Revision: 412 $
 * @modifiedby      $LastChangedBy: bb_yujiro $
 * @lastmodified    $Date: 2008-05-18 16:46:01 +0900 (日, 18 5 2008) $
 * @license         http://opensource.org/licenses/mit-license.php The MIT License
 */
class Controller extends Community_Controller 
{
    /**
     * 使用モデル名
     * @var array
     */
    public $models = array(
        'manip'=> array(
        ),
        'view'=> array(
            'com_event',
        ),            
    );

    /**
     * com_event モデルオブジェクト
     * @var object 
     */
    public $v_com_event = null;

    /**
     * 変数の初期化
     *
     * @abstract
     * @access protected
     * @return void
     */
    protected function initValue()
    {
        $this->objvew->setTemplate('groupbar_tpl', 'common/menuBar/private.tpl');
        $this->objvew->setTemplate('sidebar_tpl', 'common/menu/eventSearch.tpl');
        $this->objvew->addCss('css/private.css');
        $this->objvew->baseAssign('member',  $this->account);

        $visible = VISIBILITY_PUBLIC;
        if ($this->account['status'] != STATUS_GUEST){
            $visible |= VISIBILITY_PROTECTED;
        }
        $this->v_com_event->setValue('visibility',  $visible, '&');
        $this->v_com_event->setOrder('start_date DESC');
    }

    /**
     * 実行処理
     *
     * @access public
     * @return void
     **/
    protected function action()
    {
        $this->objvew->assign('aheadDay',    strtotime('1 day'));
        $this->objvew->assign('aheadWeek',   strtotime('7 day'));
        $this->objvew->assign('aheadMonth',  strtotime('31 day'));
        $this->objvew->assign('aheadMonths', strtotime('3 months'));
        $this->objvew->assign('basing',      time());

        $this->objvew->assign('page', 'search');
    }
} // class Controller
?>
