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


PHP AdminHelper::handleElementFormPOST方法代码示例

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


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

示例1: arsort

             }
         }
         arsort($tmp_locations_array);
         // sort temp array most to least
         $tmp_locations_array = array_slice($tmp_locations_array, 0, 5);
         // trim temp array to no more than 5
         $locations_array = array();
         // let's rebuild the locations array
         foreach ($tmp_locations_array as $location => $total) {
             $locations_array[] = array('access_location' => $location, 'total' => $total);
         }
         $cash_admin->page_data['location_analytics'] = new ArrayIterator($locations_array);
         $cash_admin->page_data['method_analytics'] = new ArrayIterator($methods_array);
     }
     // Detects if element add has happened and deals with POST data if it has
     AdminHelper::handleElementFormPOST($_POST, $cash_admin);
     // Set basic id/name stuff for the element
     AdminHelper::setBasicElementFormData($cash_admin);
     // pull stored element data
     $cash_admin->page_data = array_merge($cash_admin->page_data, AdminHelper::getElementValues($current_element));
     $cash_admin->page_data['ui_title'] = '' . $current_element['name'] . '';
     $cash_admin->page_data['element_button_text'] = 'Save changes';
     $cash_admin->page_data['element_rendered_content'] = $cash_admin->mustache_groomer->render(AdminHelper::getElementTemplate($current_element), $cash_admin->page_data);
     $campaign_response = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'getcampaignforelement', 'id' => $current_element['id']));
     if ($campaign_response['payload']) {
         $cash_admin->page_data['campaign_id'] = $campaign_response['payload']['id'];
         $cash_admin->page_data['campaign_title'] = $campaign_response['payload']['title'];
     }
 } else {
     AdminHelper::controllerRedirect('/elements/');
 }
开发者ID:JamesLinus,项目名称:platform,代码行数:31,代码来源:elements_edit.php

示例2: array

<?php

// Identify the workflow state:
if (AdminHelper::elementFormSubmitted($_POST)) {
    AdminHelper::handleElementFormPOST($_POST, $cash_admin, array('email_list_id' => $_POST['email_list_id'], 'display_title' => $_POST['display_title'], 'display_message' => $_POST['display_message']));
}
// Page data needed for a blank 'add' form:
$cash_admin->page_data['options_people_lists'] = AdminHelper::echoFormOptions('items', 0, false, true);
$current_element = $cash_admin->getCurrentElement();
if ($current_element) {
    // Current element found, so fill in the 'edit' form, basics first:
    AdminHelper::setBasicElementFormData($cash_admin);
    // Now any element-specific options:
    $cash_admin->page_data['options_display_title'] = $current_element['options']['display_title'];
    $cash_admin->page_data['options_display_message'] = $current_element['options']['display_message'];
    $cash_admin->page_data['options_people_lists'] = AdminHelper::echoFormOptions('people_lists', $current_element['options']['email_list_id'], false, true);
}
开发者ID:blacktire,项目名称:DIY,代码行数:17,代码来源:admin.php

示例3: str_replace

        if (substr($key, 0, 15) == 'twitterusername' && $value !== '') {
            $twitterusername = str_replace('@', '', $value);
            if (isset($_POST[str_replace('twitterusername', 'twitterhidereplies', $key)])) {
                $twitterhidereplies = true;
            } else {
                $twitterhidereplies = false;
            }
            $twitterfiltertype = $_POST[str_replace('twitterusername', 'twitterfiltertype', $key)];
            $twitterfiltervalue = $_POST[str_replace('twitterusername', 'twitterfiltervalue', $key)];
            $twitter_feeds[] = array('twitterusername' => $twitterusername, 'twitterhidereplies' => $twitterhidereplies, 'twitterfiltertype' => $twitterfiltertype, 'twitterfiltervalue' => $twitterfiltervalue);
        }
    }
    $all_feeds['tumblr'] = $tumblr_feeds;
    $all_feeds['twitter'] = $twitter_feeds;
    $all_feeds['post_limit'] = $_POST['post_limit'];
    AdminHelper::handleElementFormPOST($_POST, $cash_admin, $all_feeds);
}
$current_element = $cash_admin->getCurrentElement();
if ($current_element) {
    // Current element found, so fill in the 'edit' form, basics first:
    AdminHelper::setBasicElementFormData($cash_admin);
    // Now any element-specific options:
    $cash_admin->page_data['options_post_limit'] = $current_element['options']['post_limit'];
    // Deal with all the feed array mess:
    $cash_admin->page_data['tumblr_count'] = 1;
    if (is_array($current_element['options']['tumblr'])) {
        $tumblr_feeds = array();
        $feed_counter = 1;
        foreach ($current_element['options']['tumblr'] as $feed) {
            // Flattening each feed type for easier mustache checkbox shit-storming
            $formatted_feed = array('tumblrurl' => $feed['tumblrurl'], 'tumblrtag' => $feed['tumblrtag'], 'feed_count' => $feed_counter);
开发者ID:blacktire,项目名称:DIY,代码行数:31,代码来源:admin.php


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