protected function preprocessForm(JForm $form, $data, $group = 'contact') { $userParams = JComponentHelper::getParams('com_contact'); // Deal with captcha $captcha = $userParams->get('captcha', '0'); if ($captcha === '0') { $form->removeField('captcha'); } else { $form->setFieldAttribute('captcha', 'plugin', $captcha); } parent::preprocessForm($form, $data, 'user'); }
/** * Override JModelAdmin::preprocessForm to ensure the correct plugin group is loaded. * * @param JForm $form A JForm object. * @param mixed $data The data expected for the form. * @param string $group The name of the plugin group to import (defaults to "content"). * * @return void * * @since 1.6 * @throws Exception if there is an error in the form event. */ protected function preprocessForm(JForm $form, $data, $group = 'user') { parent::preprocessForm($form, $data, $group); }
/** * Override preprocessForm to load the user plugin group instead of content. * * @param object A form object. * @param mixed The data expected for the form. * @throws Exception if there is an error in the form event. * @since 1.6 */ protected function preprocessForm(JForm $form, $data, $group = 'user') { if (JComponentHelper::getParams('com_users')->get('frontend_userparams')) { $form->loadFile('frontend', false); if (JFactory::getUser()->authorise('core.login.admin')) { $form->loadFile('frontend_admin', false); } } parent::preprocessForm($form, $data, $group); }
/** * Override preprocessForm to load the user plugin group instead of content. * * @param object A form object. * @param mixed The data expected for the form. * @throws Exception if there is an error in the form event. * @since 1.6 */ protected function preprocessForm(JForm $form, $data, $group = 'user') { $userParams = JComponentHelper::getParams('com_users'); //Add the choice for site language at registration time if ($userParams->get('site_language') == 1 && $userParams->get('frontend_userparams') == 1) { $form->loadFile('sitelang', false); } parent::preprocessForm($form, $data, $group); }
/** * Override preprocessForm to load the user plugin group instead of content. * * @param object A form object. * @param mixed The data expected for the form. * @throws Exception if there is an error in the form event. * @since 1.6 */ protected function preprocessForm(JForm $form, $data, $group = 'user') { $userParams = JComponentHelper::getParams('com_users'); // Deal with captcha $captcha = $userParams->get('captcha', '0'); $captchaRemind = $userParams->get('allowCaptchaUserReset', '0'); if ($captcha === '0') { $form->removeField('captcha'); } else { if ($captchaRemind === '0') { $form->removeField('captcha'); } else { $form->setFieldAttribute('captcha', 'plugin', $captcha); } } parent::preprocessForm($form, $data, $group); }
protected function preprocessForm(JForm $form, $data, $group = 'user') { $userParams = JComponentHelper::getParams('com_bt_socialconnect'); $session = JFactory::getSession(); $user = $session->get('btPrepareUser'); if ($user) { $data->name = $user->name; $data->username = $user->username; $data->email1 = $user->email1; $data->email2 = $user->email2; $data->enabled_publishing = $user->enabled_publishing; $data->socialId = $user->socialId; $data->loginType = $user->loginType; $data->access_token = $user->access_token; } if ($userParams->get('site_language') == 1 && $userParams->get('frontend_userparams') == 1) { $form->loadFile('sitelang', false); } parent::preprocessForm($form, $data, $group); }