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


PHP EE_Admin_Page::get_request_data方法代码示例

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


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

示例1: ee_deprecated_update_attendee_registration_form_old

/**
 * @deprecated since 4.8.32.rc.000 because it has issues on https://events.codebasehq.com/projects/event-espresso/tickets/9165
 * it is preferred to instead use _update_attendee_registration_form_new() which
 * also better handles form validation. Exits
 * @param EE_Admin_Page $admin_page
 * @return void
 */
function ee_deprecated_update_attendee_registration_form_old($admin_page)
{
    //check if the old hooks are in use. If not, do the default
    if (!ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() || !$admin_page instanceof EE_Admin_Page) {
        return;
    }
    $req_data = $admin_page->get_request_data();
    $qstns = isset($req_data['qstn']) ? $req_data['qstn'] : FALSE;
    $REG_ID = isset($req_data['_REG_ID']) ? absint($req_data['_REG_ID']) : FALSE;
    $qstns = apply_filters('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns);
    if (!$REG_ID || !$qstns) {
        EE_Error::add_error(__('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
    }
    $success = TRUE;
    // allow others to get in on this awesome fun   :D
    do_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns);
    // loop thru questions... FINALLY!!!
    foreach ($qstns as $QST_ID => $qstn) {
        //if $qstn isn't an array then it doesn't already have an answer, so let's create the answer
        if (!is_array($qstn)) {
            $success = $this->_save_new_answer($REG_ID, $QST_ID, $qstn);
            continue;
        }
        foreach ($qstn as $ANS_ID => $ANS_value) {
            //get answer
            $query_params = array(0 => array('ANS_ID' => $ANS_ID, 'REG_ID' => $REG_ID, 'QST_ID' => $QST_ID));
            $answer = EEM_Answer::instance()->get_one($query_params);
            //this MAY be an array but NOT have an answer because its multi select.  If so then we need to create the answer
            if (!$answer instanceof EE_Answer) {
                $set_values = array('QST_ID' => $QST_ID, 'REG_ID' => $REG_ID, 'ANS_value' => $qstn);
                $success = EEM_Answer::instance()->insert($set_values);
                continue 2;
            }
            $answer->set('ANS_value', $ANS_value);
            $success = $answer->save();
        }
    }
    $what = __('Registration Form', 'event_espresso');
    $route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default');
    $admin_page->redirect_after_action($success, $what, __('updated', 'event_espresso'), $route);
    exit;
}
开发者ID:adrianjonmiller,项目名称:hearts-being-healed,代码行数:49,代码来源:EE_Deprecated.core.php


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