示例#1
0
文件: index.php 项目: patkira/mahara
/**
 * This function is called to cancel the form submission. It redirects the user
 * back to the blog.
 */
function editblog_cancel_submit(Pieform $form)
{
    $id = param_integer('id');
    if ($data = $form->get_element('institution')) {
        redirect('/artefact/blog/view/index.php?id=' . $id . '&institution=' . $data['value']);
    } else {
        if ($data = $form->get_element('group')) {
            redirect('/artefact/blog/view/index.php?id=' . $id . '&group=' . $data['value']);
        } else {
            redirect('/artefact/blog/view/index.php?id=' . $id);
        }
    }
}
示例#2
0
文件: before.php 项目: Br3nda/mahara
/**
 * Checks whether the given element's value is less than another element.
 *
 * Typically useful for dates.
 *
 * @param Pieform $form      The form the rule is being applied to
 * @param string  $value     The value to check
 * @param array   $element   The element to check
 * @param string  $otherelement The other element to check for
 * @return string            The error message, if the value is invalid.
 */
function pieform_rule_before(Pieform $form, $value, $element, $otherelement)
{
    /*{{{*/
    $otherelement = $form->get_element($otherelement);
    $othervalue = $form->get_value($otherelement);
    if ($value != '' && $othervalue != '' && intval($value) > intval($othervalue)) {
        return sprintf($form->i18n('rule', 'before', 'before', $element), $otherelement['title']);
    }
}
示例#3
0
文件: index.php 项目: kienv/mahara
/**
 * This function gets called to cancel a submission.
 */
function newblog_cancel_submit(Pieform $form)
{
    $data = $form->get_element('institution');
    if ($data['value'] != false) {
        redirect('/artefact/blog/index.php?institution=' . $data['value']);
    } else {
        redirect('/artefact/blog/index.php');
    }
}