/**
  * Test JModelAdmin::__construct
  *
  * @since   3.4
  *
  * @return  void
  *
  * @testdox Constructor applies configuration
  */
 public function testConstructorAppliesConfiguration()
 {
     $config = array('event_after_delete' => 'event_after_delete', 'event_after_save' => 'event_after_save', 'event_before_delete' => 'event_before_delete', 'event_before_save' => 'event_before_save', 'event_change_state' => 'event_change_state', 'text_prefix' => 'text_prefix');
     $this->object->__construct($config);
     // Check if config was applied correctly
     foreach ($config as $key => $value) {
         if ($key == "text_prefix") {
             $this->assertEquals(strtoupper($value), TestReflection::getValue($this->object, $key));
         } else {
             $this->assertEquals($value, TestReflection::getValue($this->object, $key));
         }
     }
 }
Beispiel #2
0
 /**
  * Constructor
  *
  * @since 0.9
  */
 function __construct()
 {
     parent::__construct();
     $cid = JRequest::getVar('cid', array(0), '', 'array');
     JArrayHelper::toInteger($cid, array(0));
     $this->setId($cid[0]);
 }
Beispiel #3
0
 /**
  * @param array $config
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $container = RokCommon_Service::getContainer();
     /** @var $dispatcher RokCommon_Dispatcher */
     $this->dispatcher = $container->roksprocket_dispatcher;
 }
Beispiel #4
0
 /**
  * Constructor
  * Determines the template ID
  *
  *
  * @since 1.1.0
  */
 public function __construct()
 {
     parent::__construct();
     $jinput = JFactory::getApplication()->input;
     $array = $jinput->get('cid', 0, '', 'array');
     $this->setId((int) $array[0]);
 }
Beispiel #5
0
 function __construct()
 {
     $app = JFactory::getApplication();
     $this->contentid = JRequest::getCmd('id');
     $this->input = $app->input;
     parent::__construct();
 }
Beispiel #6
0
 /**
  * Constructor that retrieves the ID from the request
  *
  * @access	public
  * @return	void
  */
 function __construct()
 {
     parent::__construct();
     //$array = JRequest::getVar('cid',  0, '', 'array');
     $array = JFactory::getApplication()->input->server->get('cid', 0, 'INT');
     $this->setId((int) $array[0]);
 }
Beispiel #7
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->app = JFactory::getApplication();
     $this->me = KunenaUserHelper::getMyself();
     $this->config = KunenaFactory::getConfig();
 }
Beispiel #8
0
 function __construct()
 {
     $this->imageCount = 0;
     $this->categoryCount = 0;
     $this->firstImageFolder = '';
     parent::__construct();
 }
 /**
  * Constructor.
  *
  * @param   array $config An optional associative array of configuration settings.
  *
  * @see         JController
  * @since       1.0.0
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     if (isset($config['item_states'])) {
         $this->_item_states = $config['item_states'];
     }
 }
Beispiel #10
0
 /**
  * Constructor
  *
  * @since 0.9
  */
 function __construct()
 {
     parent::__construct();
     $group_id = JRequest::getVar('group_id', 0, '', 'int');
     $this->set('group_id', $group_id);
     $array = JRequest::getVar('cid', 0, '', 'array');
     $this->setId((int) $array[0]);
 }
Beispiel #11
0
 /**
  * Class constructor.
  *
  * @param	array	$config	A named array of configuration variables.
  *
  * @return	JControllerForm
  * @since	1.6
  */
 function __construct($config = array())
 {
     parent::__construct($config);
     $params = JComponentHelper::getParams($this->option);
     $images_path = JPATH_SITE . '/' . $params->get('images_path', 'images/bt_portfolio') . '/';
     self::createFolder($images_path);
     self::createFolder($images_path . 'categories/');
 }
Beispiel #12
0
 /**
  * Constructor.
  *
  * @param    array    An optional associative array of configuration settings.
  *
  * @see        JController
  */
 public function __construct()
 {
     // Load plugin parameters
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
     $this->parameters = nnParameters::getInstance();
     $this->_config = $this->parameters->getComponentParams('snippets');
     parent::__construct();
 }
Beispiel #13
0
 /**
  * Constructor
  *
  * @access	public
  * @param	array	$config	An optional associative array of configuration settings.
  * @return	void
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $layout = $this->getLayout();
     $jinput = JFactory::getApplication()->input;
     $render = $jinput->get('render', null, 'CMD');
     $this->context = strtolower($this->option . '.' . $this->getName() . ($layout ? '.' . $layout : '') . ($render ? '.' . $render : ''));
 }
Beispiel #14
0
 function __construct()
 {
     parent::__construct();
     if (!class_exists('TableTour')) {
         AImporter::table('tour');
     }
     $this->_table = $this->getTable('tour');
 }
Beispiel #15
0
 function __construct($config)
 {
     parent::__construct();
     $this->option = JOOMDOC_OPTION;
     $this->name = $this->getName();
     $this->setState($this->getName() . '.id', JRequest::getInt('id'));
     $this->checkin();
 }
 function __construct()
 {
     parent::__construct();
     if (!class_exists('TablePackagerate')) {
         AImporter::table('packagerate');
     }
     $this->_table = $this->getTable('packagerate');
 }
Beispiel #17
0
 /**
  * Constructor.
  *
  * @param   array  $config  An optional associative array of configuration settings.
  *
  * @since   3.2
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     // Load the Joomla! RAD layer
     if (!defined('FOF_INCLUDED')) {
         include_once JPATH_LIBRARIES . '/fof/include.php';
     }
 }
Beispiel #18
0
 /**
  * Constructor.
  *
  * @param   array  $config  An optional associative array of configuration settings.
  *
  * @since   3.2
  */
 public function __construct($config = array())
 {
     $config = array_merge(array('event_after_delete' => 'onUserAfterDelete', 'event_after_save' => 'onUserAfterSave', 'event_before_delete' => 'onUserBeforeDelete', 'event_before_save' => 'onUserBeforeSave', 'events_map' => array('save' => 'user', 'delete' => 'user')), $config);
     parent::__construct($config);
     // Load the Joomla! RAD layer
     if (!defined('FOF_INCLUDED')) {
         include_once JPATH_LIBRARIES . '/fof/include.php';
     }
 }
Beispiel #19
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     if (isset($config['event_transaction_change_state'])) {
         $this->event_transaction_change_state = $config['event_transaction_change_state'];
     } elseif (empty($this->event_transaction_change_state)) {
         $this->event_transaction_change_state = 'onTransactionChangeState';
     }
 }
Beispiel #20
0
 /**
  * Constructor
  *
  * @since 0.1
  */
 function __construct()
 {
     parent::__construct();
     $array = JRequest::getVar('cid', array(0), '', 'array');
     $edit = JRequest::getVar('edit', true);
     if ($edit) {
         $this->setId((int) $array[0]);
     }
 }
Beispiel #21
0
 /**
  * Constructor.
  *
  * @param   array  $config  An optional associative array of configuration settings.
  *
  * @see     JModelLegacy
  * @since   12.2
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->event_after_delete = 'onMediaAfterDelete';
     $this->event_after_save = 'onMediaAfterSave';
     $this->event_before_delete = 'onMediaBeforeDelete';
     $this->event_before_save = 'onMediaBeforeSave';
     $this->event_change_state = 'onMediaChangeState';
 }
 /**
  * Constructor.
  *
  * @param   array $config An optional associative array of configuration settings.
  *
  * @see         JController
  * @since       1.1.0
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     if (isset($config['event_change_required'])) {
         $this->event_change_required = $config['event_change_required'];
     } elseif (empty($this->event_change_required)) {
         $this->event_change_required = 'onContentChangeRequired';
     }
 }
 public function __construct($config = array())
 {
     parent::__construct($config);
     if (array_key_exists('event_transaction_change_state', $config)) {
         $this->event_transaction_change_state = $config['event_transaction_change_state'];
     } elseif (!$this->event_transaction_change_state) {
         $this->event_transaction_change_state = 'onTransactionChangeState';
     }
 }
Beispiel #24
0
 function __construct()
 {
     parent::__construct();
     // large databases need lots of memory
     ini_set('memory_limit', '128M');
     $this->_getMemberships();
     $db = JFactory::getDBO();
     $db->setQuery("SET SQL_BIG_SELECTS=1");
     $db->execute();
 }
Beispiel #25
0
 /**
  * Constructor.
  *
  * @param   array  $config  Configuration array
  *
  * @throws  RuntimeException
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     if (is_null($this->context)) {
         $this->context = strtolower($this->option . '.edit.' . $this->getName());
     }
     if (is_null($this->formName)) {
         $this->formName = strtolower($this->getName());
     }
 }
Beispiel #26
0
 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->input = JFactory::getApplication()->input;
     $array = JRequest::getVar('cid', array(0), '', 'array');
     $edit = JRequest::getVar('edit', true);
     if ($edit) {
         $this->setId((int) $array[0]);
     }
 }
Beispiel #27
0
 /**
  * Constructor.
  *
  * @param   array  $config  An optional associative array of configuration settings.
  *
  * @see     JModelLegacy
  * @since   12.2
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->event_after_delete = 'onStateAfterDelete';
     $this->event_after_save = 'onStateAfterSave';
     $this->event_before_delete = 'onStateBeforeDelete';
     $this->event_before_save = 'onStateBeforeSave';
     $this->event_change_state = 'onStateChangeState';
     $this->text_prefix = strtoupper($this->option);
 }
Beispiel #28
0
 /**
  * Constructor.
  *
  * @param   array $config An optional associative array of configuration settings.
  *
  * @see     JModelLegacy
  * @since   12.2
  */
 public function __construct($config = array())
 {
     $this->app = JArrayHelper::getValue($config, 'app', JFactory::getApplication());
     $this->user = JArrayHelper::getValue($config, 'user', JFactory::getUser());
     $this->config = JArrayHelper::getValue($config, 'config', JFactory::getConfig());
     $this->session = JArrayHelper::getValue($config, 'session', JFactory::getSession());
     $this->db = JArrayHelper::getValue($config, 'db', JFactory::getDbo());
     $this->pluginManager = JArrayHelper::getValue($config, 'pluginManager', JModelLegacy::getInstance('Pluginmanager', 'FabrikFEModel'));
     parent::__construct($config);
 }
Beispiel #29
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     global $ext_name_com, $ext_prefix;
     $this->ext_name_com = $ext_name_com;
     $this->ext_prefix = $ext_prefix;
     $this->context = $this->ext_name_com;
     $this->context .= '.' . $this->getName();
     $this->context .= ($layout = JRequest::getVar('layout', 'default')) ? '.' . $layout : '';
     $this->params = JComponentHelper::getParams($this->ext_name_com);
 }
 public function __construct($config = array())
 {
     // Guess the option from the class name (Option)Model(View).
     if (empty($this->option)) {
         $r = null;
         if (!preg_match('/(.*)Model/i', get_class($this), $r)) {
             throw new Exception(JText::_('JLIB_APPLICATION_ERROR_MODEL_GET_NAME'), 500);
         }
         $this->option = 'com_tz_portfolio_plus';
     }
     parent::__construct($config);
 }