Ejemplo n.º 1
0
 /**
  * Test JController::addModelPath
  *
  * @since	11.3
  *
  * @covers  JController::addModelPath
  */
 public function testAddModelPath()
 {
     $path = JPath::clean(JPATH_ROOT . '/addmodelpath');
     JController::addModelPath($path);
     // The default path is the class file folder/forms
     $valid = JPATH_PLATFORM . '/joomla/form/fields';
     $this->assertThat(in_array($path, JModel::addIncludePath()), $this->isTrue(), 'Line:' . __LINE__ . ' The path should be added to the JModel paths.');
 }
Ejemplo n.º 2
0
 /**
  * Test JController::addModelPath
  *
  * @since	1.6
  */
 public function testAddModelPath()
 {
     // Include JModel as this method is a proxy for JModel::addIncludePath
     require_once JPATH_PLATFORM . '/joomla/application/component/model.php';
     $path = JPATH_ROOT . '/addmodelpath';
     JController::addModelPath($path);
     // The default path is the class file folder/forms
     $valid = JPATH_PLATFORM . '/joomla/form/fields';
     $this->assertThat(in_array($path, JModel::addIncludePath()), $this->isTrue(), 'Line:' . __LINE__ . ' The path should be added to the JModel paths.');
 }
Ejemplo n.º 3
0
 /**
  * Test JController::addModelPath
  *
  * @since	1.6
  */
 public function testAddModelPath()
 {
     // Include JModel as this method is a proxy for JModel::addIncludePath
     require_once JPATH_BASE . '/libraries/joomla/application/component/model.php';
     $path = dirname(__FILE__) . DS . 'addmodelpath';
     JController::addModelPath($path);
     // The default path is the class file folder/forms
     $valid = JPATH_LIBRARIES . DS . 'joomla' . DS . 'form/fields';
     $this->assertThat(in_array($path, JModel::addIncludePath()), $this->isTrue(), 'Line:' . __LINE__ . ' The path should be added to the JModel paths.');
 }
Ejemplo n.º 4
0
 public function Submitters()
 {
     $mainframe =& JFactory::getApplication();
     $mainframe->redirect('index.php?option=com_redform&controller=submitters&task=submitters&integration=redevent&xref=' . JRequest::getInt('xref') . '&form_id=' . JRequest::getInt('form_id') . '&filter=' . JRequest::getInt('filter'));
     /* Create the view object */
     $view = $this->getView('submitters', 'html');
     /* Standard model */
     JController::addModelPath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_redform' . DS . 'models');
     $view->setModel($this->getModel('submitters', 'RedformModel'), true);
     $view->setModel($this->getModel('redform', 'RedformModel'));
     $view->setLayout('submitters');
     /* Now display the view */
     $view->display();
 }