本文整理汇总了PHP中JModelForm::preprocessForm方法的典型用法代码示例。如果您正苦于以下问题:PHP JModelForm::preprocessForm方法的具体用法?PHP JModelForm::preprocessForm怎么用?PHP JModelForm::preprocessForm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JModelForm
的用法示例。
在下文中一共展示了JModelForm::preprocessForm方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preprocessForm
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');
}
示例2: preprocessForm
/**
* 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);
}
示例3: preprocessForm
/**
* 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);
}
示例4: preprocessForm
/**
* 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);
}
示例5: preprocessForm
/**
* 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);
}
示例6: preprocessForm
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);
}