当前位置: 首页>>代码示例>>PHP>>正文


PHP Horde_Form::isSubmitted方法代码示例

本文整理汇总了PHP中Horde_Form::isSubmitted方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Form::isSubmitted方法的具体用法?PHP Horde_Form::isSubmitted怎么用?PHP Horde_Form::isSubmitted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Horde_Form的用法示例。


在下文中一共展示了Horde_Form::isSubmitted方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elseif

            } else {
                $notification->push(_("Your data were successfully updated."), 'horde.success');
                if (empty($data['user_picture'])) {
                    $folks_driver->logActivity(_("Updated his/her profile details."));
                } else {
                    $folks_driver->logActivity(_("Updated his/her profile picture."));
                }
                Horde::url('edit/edit.php')->redirect();
            }
            break;
        case _("Delete picture"):
            $result = $folks_driver->deleteImage($GLOBALS['registry']->getAuth());
            if ($result instanceof PEAR_Error) {
                $notification->push($result);
            } else {
                $notification->push(_("Your image was deleted successfully."), 'horde.success');
            }
            break;
    }
} elseif (!$form->isSubmitted()) {
    foreach ($profile as $key => $value) {
        if ($key != 'user_picture' && !empty($value)) {
            $vars->set($key, $value);
        }
    }
}
$page_output->header(array('title' => $title));
require FOLKS_TEMPLATES . '/menu.inc';
echo $tabs->render('edit');
$form->renderActive(null, null, null, 'post');
$page_output->footer();
开发者ID:raz0rsdge,项目名称:horde,代码行数:31,代码来源:edit.php

示例2: catch

try {
    $gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getGallery($vars->get('gallery'));
} catch (Ansel_Exception $e) {
    $notification->push($gallery->getMessage());
    Horde::url('view.php?view=List', true)->redirect();
    exit;
}
$url = $vars->get('url');
$form = new Horde_Form($vars, _("Content Disclaimer"), 'disclamer');
$form->addVariable($gallery->get('name'), 'name', 'description', false);
$form->addVariable($gallery->get('desc'), 'desc', 'description', false);
$form->addHidden('', 'url', 'text', true);
$form->addHidden('', 'gallery', 'int', true);
$msg = sprintf(_("Photo content may be offensive. You must be over %d to continue."), $gallery->get('age'));
$form->addVariable($msg, 'warning', 'description', false);
$form->setButtons(array(sprintf(_("Continue - I'm over %d"), $gallery->get('age')), _("Cancel")));
if ($form->isSubmitted()) {
    if (Horde_Util::getFormData('submitbutton') == _("Cancel")) {
        $notification->push("You are not authorised to view this photo.", 'horde.warning');
        Horde::url('view.php?view=List', true)->redirect();
        exit;
    } else {
        $session->set('ansel', 'user_age', (int) $gallery->get('age'));
        $url->redirect();
        exit;
    }
}
$page_output->header();
$notification->notify(array('listeners' => 'status'));
$form->renderActive(null, null, null, 'post');
$page_output->footer();
开发者ID:jubinpatel,项目名称:horde,代码行数:31,代码来源:disclamer.php

示例3: array

    $question = $u_prefs->getValue('security_question');
} else {
    $answer = $prefs->getValue('security_answer');
    $question = $prefs->getValue('security_question');
}
/* Set up the fields for the username and alternate email. */
$form->addHidden('', 'url', 'text', false);
$form->addVariable(_("Username"), 'username', 'text', true);
if (!empty($answer)) {
    if (!empty($question)) {
        $form->addVariable(_("Please respond to your security question: ") . $question, 'security_question', 'description', true);
    }
    $form->addVariable(_("Security answer"), 'security_answer', 'text', true);
} else {
    $desc = _("The picture above is for antispam checking. Please retype the characters from the picture. They are case sensitive.");
    $form->addVariable(_("Human check"), 'captcha', 'captcha', true, false, $desc, array(Folks::getCAPTCHA(!$form->isSubmitted()), HORDE_BASE . '/config/couri.ttf'));
}
/* Validate the form. */
if ($form->validate()) {
    $form->getInfo(null, $info);
    /* Get user email. */
    $email = Folks::getUserEmail($info['username']);
    if ($email instanceof PEAR_Error) {
        $notification->push($email);
        throw new Horde_Exception_AuthenticationFailure();
    }
    /* Check the given values with the prefs stored ones. */
    if (!empty($answer) && Horde_String::lower($answer) == Horde_String::lower($info['security_answer']) || empty($answer)) {
        /* Info matches, so reset the password. */
        $password = $auth->resetPassword($info['username']);
        if ($password instanceof PEAR_Error) {
开发者ID:jubinpatel,项目名称:horde,代码行数:31,代码来源:resetpassword.php


注:本文中的Horde_Form::isSubmitted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。