* @package space * @version $Id$ * @link https://www.qucheng.com */ class space extends control { /** * Browse departments and users of a space. * * @param int $param * @param string $type * @param string $orderBy * @param int $recTotal * @param int $recPerPage * @param int $pageID @access public * @return void */ public function browse($spaceID = null, $browseType = 'all', $recTotal = 0, $recPerPage = 24, $pageID = 1) { $this->app->loadLang('instance'); $this->loadModel('instance'); $this->loadModel('store'); $spaceType = $this->cookie->spaceType ? $this->cookie->spaceType : 'bycard'; $space = null; if($spaceID) $space = $this->space->getByID($spaceID); if(empty($space)) $space = $this->space->defaultSpace($this->app->user->account); $search = ''; if(!empty($_POST)) { $conditions = fixer::input('post') ->trim('search') ->setDefault('search', '') ->get(); $search = $conditions->search; } $this->app->loadClass('pager', true); $pager = pager::init($recTotal, $recPerPage, $pageID); $instances = $this->space->getSpaceInstances($space->id, $browseType, $search, $pager); $this->view->title = $this->lang->space->common; $this->view->position[] = $this->lang->space->common; $this->view->pager = $pager; $this->view->browseType = $browseType; $this->view->spaceType = $spaceType; $this->view->instances = $instances; $this->view->currentSpace = $space; $this->view->searchName = $search; $this->display(); } }