Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class CommunitiesController extends AppController{
- /**
- * undocumented function
- *
- * @return void
- * @access public
- */
- function index() {
- $communities = $this->Community->find('all');
- $curSec = 'community';
- $this->set(compact('communities', 'curSec'));
- }
- /**
- * The Communities overview page
- *
- * @param string $id
- * @return void
- * @access public
- */
- function view($id, $batchFind = array()) {
- $community = $this->Community->find('first', array(
- 'fields' => array('id', 'title'),
- 'conditions' => compact('id')
- ));
- Assert::notEmpty($community, '404');
- Assert::true(empty($batchFind) || ($this->action != 'view'), '500');
- if (empty($batchFind)) {
- $batchFind = array(
- 'news' => $id,
- 'users' => $id,
- 'conditions' => $id,
- 'conferences' => $id,
- 'ratings' => $id,
- 'classes' => $id,
- 'wall' => $id,
- );
- }
- $this->set(am(
- compact('id', 'community'),
- $this->Community->find('headerInfo'),
- $this->Community->batchFind($batchFind)
- ));
- }
- /**
- * undocumented function
- *
- * @param string $id
- * @return void
- * @access public
- */
- function news($id) {
- $this->view($id, array(
- 'news' => $id,
- 'classes' => $id,
- 'conditions' => $id
- ));
- }
- /**
- * undocumented function
- *
- * @param string $id
- * @return void
- * @access public
- */
- function discussions($id) {
- $this->view($id, array(
- 'discussions' => $id,
- 'classes' => $id,
- 'conditions' => $id
- ));
- }
- /**
- * undocumented function
- *
- * @param string $id
- * @return void
- * @access public
- */
- function conferences($id) {
- $this->view($id, array(
- 'conferences' => $id,
- 'ratings' => $id,
- 'classes' => $id,
- 'conditions' => $id,
- 'users' => $id,
- ));
- }
- /**
- * undocumented function
- *
- * @param string $id
- * @return void
- * @access public
- */
- function conditions($id) {
- $this->view($id, array(
- 'conditions' => $id,
- 'ratings' => $id,
- 'classes' => $id,
- ));
- }
- /**
- * undocumented function
- *
- * @param string $id
- * @return void
- * @access public
- */
- function related_drugs($id) {
- $this->view($id, array(
- 'classes' => $id,
- ));
- }
- }
- ?>
Add Comment
Please, Sign In to add comment