/**
  * Renders modules defined in the manifest
  *
  * @access private
  * @return void
  */
 private function _renderModules()
 {
     $modules = $this->getModules();
     if (!empty($modules) && is_array($modules)) {
         $placeholders = $this->getPlaceholders();
         foreach ($modules as $key => $config) {
             $tpl = isset($config['tpl']) && !empty($config['tpl']) ? $config['tpl'] : false;
             if (!$tpl) {
                 $this->modx->log(modX::LOG_LEVEL_ERROR, "[DiscussController] Error: no tpl passed for module {$key}.", '', '_renderModules', __FILE__, __LINE__);
                 continue;
             }
             $phs = isset($config['options']) && is_array($config['options']) ? array_merge($placeholders, $config['options']) : $placeholders;
             $tpl = $this->discuss->getChunk($tpl, $phs, 'modulesPath');
             if (!$tpl) {
                 $this->modx->log(modX::LOG_LEVEL_ERROR, "[DiscussController] Error: tpl for module {$key} is empty.", '', '_renderModules', __FILE__, __LINE__);
                 continue;
             }
             $this->setPlaceholder($key, $tpl);
         }
     }
 }
 public function indexAction()
 {
     var_dump($this->discussService->getLatestThreads());
     return new ViewModel();
 }
Exemple #3
0
<?php

/**
 * Discuss
 *
 * Copyright 2010-11 by Shaun McCormick <*****@*****.**>
 *
 * This file is part of Discuss, a native forum for MODx Revolution.
 *
 * Discuss is free software; you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * Discuss is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * Discuss; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 * Suite 330, Boston, MA 02111-1307 USA
 *
 * @package discuss
 */
/**
 * @package discuss
 * @subpackage controllers
 */
require_once dirname(dirname(__FILE__)) . '/model/discuss/discuss.class.php';
$discuss = new Discuss($modx);
return $discuss->initialize('mgr');
 /**
  * Method called to associate a Discuss object to this object
  * through the Discuss foreign key attribute
  *
  * @param      Discuss $l Discuss
  * @return     void
  * @throws     PropelException
  */
 public function addDiscuss(Discuss $l)
 {
     $this->collDiscusss[] = $l;
     $l->setSchema($this);
 }
 /**
  * Method called to associate a Discuss object to this object
  * through the Discuss foreign key attribute
  *
  * @param      Discuss $l Discuss
  * @return     void
  * @throws     PropelException
  */
 public function addDiscuss(Discuss $l)
 {
     $this->collDiscusss[] = $l;
     $l->setConceptProperty($this);
 }
 /**
  * Method called to associate a Discuss object to this object
  * through the Discuss foreign key attribute
  *
  * @param      Discuss $l Discuss
  * @return     void
  * @throws     PropelException
  */
 public function addDiscuss(Discuss $l)
 {
     $this->collDiscusss[] = $l;
     $l->setSchemaPropertyElement($this);
 }
 /**
  * Method called to associate a Discuss object to this object
  * through the Discuss foreign key attribute
  *
  * @param      Discuss $l Discuss
  * @return     void
  * @throws     PropelException
  */
 public function addDiscussRelatedByDeletedUserId(Discuss $l)
 {
     $this->collDiscusssRelatedByDeletedUserId[] = $l;
     $l->setUserRelatedByDeletedUserId($this);
 }
Exemple #8
0
 public function discusses()
 {
     return Discuss::search()->filterBy('comment', $this)->find();
 }
 /**
  * Method called to associate a Discuss object to this object
  * through the Discuss foreign key attribute
  *
  * @param      Discuss $l Discuss
  * @return     void
  * @throws     PropelException
  */
 public function addDiscussRelatedByParentId(Discuss $l)
 {
     $this->collDiscusssRelatedByParentId[] = $l;
     $l->setDiscussRelatedByParentId($this);
 }
 /**
  * Method called to associate a Discuss object to this object
  * through the Discuss foreign key attribute
  *
  * @param      Discuss $l Discuss
  * @return     void
  * @throws     PropelException
  */
 public function addDiscuss(Discuss $l)
 {
     $this->collDiscusss[] = $l;
     $l->setVocabulary($this);
 }