'doShow', ); public function doShow() { if (empty($this->DBObj->id)) { skHTTP::redirect(BASE_URL . '/' . CURR_PAGE_FULL . '/' . $this->DBObj->getIdOfFirstDaughterPage(), true); return $this; } $this->DBObj->initFromDB(); $data = $this->DBObj->getData(); $members = $this->_getClassifiedMembers($this->DBObj->getMembers()); if ('board' != $data['type']) { $totalCount = 0; foreach ($members as $key => $typedMembers) { if ('staff-liaison' != $key) { $totalCount += count($typedMembers); } } $membersPerColumn = ceil($totalCount / self::COLUMNS_COUNT); } if (empty($data)) { $this->Doc->display404(); return $this; } $data['goals'] = $this->DBObj->getGoals(); $this->Doc->addItem( array( 'tpl' => 'Volunteer/show.tpl', 'data' => $data, 'members' => $members, 'positions' => VolunteerMember::getInstance()->setId(null)->setParentId(null)->getAllPositions(), 'membersPerColumn' => isset($membersPerColumn) ? $membersPerColumn : null, ) ); $this->Doc->addItemProp('JSs', 'js/jquery.cluetip.js'); $this->Doc->addItemProp('CSSs', 'css/jquery.cluetip.css'); $this->Doc->addItemProp('JSs', 'js/jquery.dimensions-1.2.js'); $this->Doc->addItemProp('initFuncs', 'addtooltips'); return $this; } protected function _getClassifiedMembers($members) { $classifiedMembers = array(); foreach ($members as $member) { $classifiedMembers[$member['type']][] = $member; } return $classifiedMembers; } }