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


PHP AdminHelper::formSuccess方法代码示例

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


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

示例1: handleRedirectReturn

 public static function handleRedirectReturn($data = false)
 {
     $connections = CASHSystem::getSystemSettings('system_connections');
     if (isset($connections['com.amazon'])) {
         $s3_default_email = $connections['com.amazon']['email'];
     } else {
         $s3_default_email = false;
     }
     $success = S3Seed::connectAndAuthorize($data['key'], $data['secret'], $data['bucket'], $s3_default_email);
     if ($success) {
         // we can safely assume (AdminHelper::getPersistentData('cash_effective_user') as the OAuth
         // calls would only happen in the admin. If this changes we can fuck around with it later.
         $new_connection = new CASHConnection(AdminHelper::getPersistentData('cash_effective_user'));
         $connection_name = $data['bucket'] . ' (Amazon S3)';
         if (substr($connection_name, 0, 10) == 'cashmusic.') {
             $connection_name = 'Amazon S3 (created ' . date("M j, Y") . ')';
         }
         $result = $new_connection->setSettings($connection_name, 'com.amazon', array('bucket' => $data['bucket']));
         if ($result) {
             AdminHelper::formSuccess('Success. Connection added. You\'ll see it in your list of connections.', '/settings/connections/');
         } else {
             AdminHelper::formFailure('Error. Something just didn\'t work right.');
         }
     } else {
         //$return_markup = '<h4>Error</h4>'
         //			   . '<p>We couldn\'t connect with your S3 account. Please check the key and secret.</p>';
         AdminHelper::formFailure('We couldn\'t connect your S3 account. Please check the key and secret.');
     }
     return $return_markup;
 }
开发者ID:JamesLinus,项目名称:platform,代码行数:30,代码来源:S3Seed.php

示例2:

<?php

if (!$request_parameters) {
    AdminHelper::controllerRedirect('/people/lists/');
}
if (isset($_POST['dodelete']) || isset($_REQUEST['modalconfirm'])) {
    $delete_response = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'deletelist', 'list_id' => $request_parameters[0]));
    if ($delete_response['status_uid'] == 'people_deletelist_200') {
        if (isset($_REQUEST['redirectto'])) {
            AdminHelper::formSuccess('Success. Deleted.', $_REQUEST['redirectto']);
        } else {
            AdminHelper::formSuccess('Success. Deleted.', '/people/lists/');
        }
    }
}
$cash_admin->page_data['title'] = 'People: Delete list';
$cash_admin->setPageContentTemplate('delete_confirm');
开发者ID:JamesLinus,项目名称:platform,代码行数:17,代码来源:people_lists_delete.php

示例3: handleRedirectReturn

 public static function handleRedirectReturn($data = false)
 {
     if (!isset($data['state'])) {
         return "Please start the Dropbox authentication flow from the beginning.";
     }
     $connections = CASHSystem::getSystemSettings('system_connections');
     if (!isset($connections['com.dropbox'])) {
         return 'Please add default Dropbox credentials.';
     }
     $auth_client = DropboxSeed::getWebAuthClient($connections['com.dropbox']['redirect_uri']);
     try {
         list($token, $user_id) = $auth_client->finish($data);
     } catch (Exception $e) {
         $token = false;
     }
     if (!$token) {
         return "The Dropbox authentication flow failed - please try again.";
     }
     $new_connection = new CASHConnection(AdminHelper::getPersistentData('cash_effective_user'));
     $result = $new_connection->setSettings($user_id . ' (Dropbox)', 'com.dropbox', array('access_token' => $token, 'user_id' => $user_id));
     if (!$result) {
         $settings_for_user = $new_connection->getAllConnectionsforUser();
         if (is_array($settings_for_user)) {
             foreach ($settings_for_user as $key => $connection_data) {
                 if ($connection_data['name'] == $user_id . ' (Dropbox)') {
                     $result = $connection_data['id'];
                     break;
                 }
             }
         }
     }
     if (isset($data['return_result_directly'])) {
         return $result;
     } else {
         if ($result) {
             AdminHelper::formSuccess('Success. Connection added. You\'ll see it in your list of connections.', '/settings/connections/');
         } else {
             AdminHelper::formFailure('Error. Something just didn\'t work right.', '/settings/connections/');
         }
     }
 }
开发者ID:JamesLinus,项目名称:platform,代码行数:41,代码来源:DropboxSeed.php

示例4:

    $addvenue_address1 = '';
    $addvenue_address2 = '';
    $addvenue_postalcode = '';
    $addvenue_url = '';
    $addvenue_phone = '';
    if (isset($_POST['venue_address1'])) {
        $addvenue_address1 = $_POST['venue_address1'];
    }
    if (isset($_POST['venue_address2'])) {
        $addvenue_address2 = $_POST['venue_address2'];
    }
    if (isset($_POST['venue_postalcode'])) {
        $addvenue_postalcode = $_POST['venue_postalcode'];
    }
    if (isset($_POST['venue_url'])) {
        $addvenue_url = $_POST['venue_url'];
    }
    if (isset($_POST['venue_phone'])) {
        $addvenue_phone = $_POST['venue_phone'];
    }
    $add_response = $cash_admin->requestAndStore(array('cash_request_type' => 'calendar', 'cash_action' => 'addvenue', 'name' => $_POST['venue_name'], 'city' => $_POST['venue_city'], 'region' => $_POST['venue_region'], 'country' => $_POST['venue_country'], 'address1' => $addvenue_address1, 'address2' => $addvenue_address2, 'postalcode' => $addvenue_postalcode, 'url' => $addvenue_url, 'phone' => $addvenue_phone));
    if ($add_response['payload']) {
        AdminHelper::formSuccess('Success. Venue added.', '/calendar/venues/edit/' . $add_response['payload']);
    } else {
        AdminHelper::formFailure('Error. Something just didn\'t work right.', '/calendar/venues/add/');
    }
}
$cash_admin->page_data['form_state_action'] = 'dovenueadd';
$cash_admin->page_data['venue_button_text'] = 'Add the venue';
$cash_admin->page_data['country_options'] = AdminHelper::drawCountryCodeUL();
$cash_admin->setPageContentTemplate('calendar_venues_details');
开发者ID:JamesLinus,项目名称:platform,代码行数:31,代码来源:calendar_venues_add.php

示例5:

<?php

if (isset($_REQUEST['modalconfirm'])) {
    $new_template = 0;
    $requested_campaign_id = $request_parameters[0];
    if ($requested_campaign_id != 0) {
        $current_response = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'getcampaign', 'id' => $requested_campaign_id));
        $campaign = $current_response['payload'];
        $new_template = $campaign['template_id'];
    }
    $settings_response = $cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'setsettings', 'type' => 'public_profile_template', 'value' => $new_template, 'user_id' => $cash_admin->effective_user_id));
    if ($settings_response['payload']) {
        if ($new_template == 0) {
            AdminHelper::formSuccess('Success. You have unpublished all campaigns.', '/');
        } else {
            AdminHelper::formSuccess('Success. Campaign published.', '/');
        }
    } else {
        AdminHelper::formFailure('Error. Something just didn\'t work right.', '/');
    }
} else {
    AdminHelper::controllerRedirect('/');
}
开发者ID:JamesLinus,项目名称:platform,代码行数:23,代码来源:campaigns_publish.php

示例6: array

<?php

// first handle add
if (isset($_POST['dotemplateset'])) {
    // form was submitted. set the template
    $effective_user = $cash_admin->effective_user_id;
    if (!isset($_POST['template_id'])) {
        $template_id = false;
    } else {
        $template_id = $_POST['template_id'];
    }
    $template_response = $cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'settemplate', 'template' => $_POST['template'], 'template_id' => $template_id, 'user_id' => $effective_user));
    if ($template_response['payload']) {
        AdminHelper::formSuccess('Success.', '/elements/templates/' . $template_response['payload']);
    } else {
        AdminHelper::formFailure('Error. Something just didn\'t work right.', '/elements/templates/');
    }
}
// get all the templates
$template_response = $cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'gettemplatesforuser', 'user_id' => $cash_admin->effective_user_id));
if (is_array($template_response['payload'])) {
    $page_templates = array();
    $embed_templates = array();
    foreach ($template_response['payload'] as $template) {
        if ($template['type'] == 'page') {
            $page_templates[] = $template;
        } elseif ($template['type'] == 'embed') {
            $embed_templates[] = $template;
        }
    }
    if (count($page_templates)) {
开发者ID:JamesLinus,项目名称:platform,代码行数:31,代码来源:elements_templates.php

示例7: CASHRequest

<?php

// parsing posted data:
if (isset($_POST['docampaignadd'])) {
    // do the actual list add stuffs...
    $effective_user = $cash_admin->effective_user_id;
    $add_response = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'addcampaign', 'title' => $_POST['campaign_title'], 'description' => $_POST['campaign_description'], 'user_id' => $effective_user));
    if ($add_response['payload']) {
        // make the new campaign selected
        $admin_primary_cash_request->sessionSet('current_campaign', $add_response['payload']);
        $settings_request = new CASHRequest(array('cash_request_type' => 'system', 'cash_action' => 'setsettings', 'type' => 'selected_campaign', 'value' => $add_response['payload'], 'user_id' => $cash_admin->effective_user_id));
        AdminHelper::formSuccess('Success. Campaign added.', '/');
    } else {
        AdminHelper::formFailure('Error. Something just didn\'t work right.', '/campaigns/add/');
    }
}
$cash_admin->page_data['form_state_action'] = 'docampaignadd';
$cash_admin->page_data['button_text'] = 'Save changes';
$cash_admin->setPageContentTemplate('campaign_edit');
开发者ID:JamesLinus,项目名称:platform,代码行数:19,代码来源:campaigns_add.php

示例8: handleElementFormPOST

 public static function handleElementFormPOST($post_data, &$cash_admin)
 {
     global $admin_primary_cash_request;
     if (AdminHelper::elementFormSubmitted($post_data)) {
         // first create the options array
         $options_array = array();
         // now populate it from the POST data, fixing booleans
         $app_json = AdminHelper::getElementAppJSON($post_data['element_type']);
         if ($app_json) {
             foreach ($app_json['options'] as $section_name => $details) {
                 foreach ($details['data'] as $data => $values) {
                     if ($values['type'] == 'boolean') {
                         if (isset($post_data[$data])) {
                             $options_array[$data] = 1;
                         } else {
                             $options_array[$data] = 0;
                         }
                     } elseif ($values['type'] == 'options') {
                         if (is_array($values['values'])) {
                             foreach ($values['values'] as $subname => $subvalues) {
                                 $options_array[$data][$subname] = $post_data[$data . '-' . $subname];
                             }
                         }
                     } else {
                         if ($values['type'] != 'scalar') {
                             $options_array[$data] = $post_data[$data];
                         }
                     }
                 }
             }
             $scalars = AdminHelper::processScalarData($post_data, $app_json);
             $options_array = array_merge($options_array, $scalars);
         }
         if (isset($post_data['doelementadd'])) {
             // Adding a new element:
             $cash_admin->setCurrentElementState('add');
             $admin_primary_cash_request->processRequest(array('cash_request_type' => 'element', 'cash_action' => 'addelement', 'name' => $post_data['element_name'], 'type' => $post_data['element_type'], 'options_data' => $options_array, 'user_id' => AdminHelper::getPersistentData('cash_effective_user')));
             if ($admin_primary_cash_request->response['status_uid'] == 'element_addelement_200') {
                 $current_campaign = false;
                 if ($post_data['in_campaign']) {
                     $current_campaign = $post_data['in_campaign'];
                 } else {
                     $current_campaign = AdminHelper::getPersistentData('current_campaign');
                 }
                 if ($current_campaign) {
                     $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'addelementtocampaign', 'campaign_id' => $current_campaign, 'element_id' => $admin_primary_cash_request->response['payload']));
                     // handle differently for AJAX and non-AJAX
                     if ($cash_admin->page_data['data_only']) {
                         AdminHelper::formSuccess('Success. New element added.', '/');
                     } else {
                         $cash_admin->setCurrentElement($admin_primary_cash_request->response['payload']);
                     }
                 } else {
                     // handle differently for AJAX and non-AJAX
                     if ($cash_admin->page_data['data_only']) {
                         AdminHelper::formSuccess('Success. New element added.', '/elements/edit/' . $admin_primary_cash_request->response['payload']);
                     } else {
                         $cash_admin->setCurrentElement($admin_primary_cash_request->response['payload']);
                     }
                 }
             } else {
                 // handle differently for AJAX and non-AJAX
                 if ($cash_admin->page_data['data_only']) {
                     AdminHelper::formFailure('Error. Something just didn\'t work right.', '/elements/add/' . $post_data['element_type']);
                 } else {
                     $cash_admin->setErrorState('element_add_failure');
                 }
             }
         } elseif (isset($post_data['doelementedit'])) {
             // Editing an existing element:
             $cash_admin->setCurrentElementState('edit');
             $admin_primary_cash_request->processRequest(array('cash_request_type' => 'element', 'cash_action' => 'editelement', 'id' => $post_data['element_id'], 'name' => $post_data['element_name'], 'options_data' => $options_array));
             if ($admin_primary_cash_request->response['status_uid'] == 'element_editelement_200') {
                 // handle differently for AJAX and non-AJAX
                 if ($cash_admin->page_data['data_only']) {
                     // AJAX
                     AdminHelper::formSuccess('Success. Edited.', '/elements/edit/' . $post_data['element_id']);
                 } else {
                     // non-AJAX
                     $cash_admin->setCurrentElement($post_data['element_id']);
                 }
             } else {
                 // handle differently for AJAX and non-AJAX
                 if ($cash_admin->page_data['data_only']) {
                     // AJAX
                     AdminHelper::formFailure('Error. Something just didn\'t work right.', '/elements/edit/' . $post_data['element_id']);
                 } else {
                     // non-AJAX
                     $cash_admin->setErrorState('element_edit_failure');
                 }
             }
         }
         AdminHelper::setBasicElementFormData($cash_admin);
     }
 }
开发者ID:JamesLinus,项目名称:platform,代码行数:95,代码来源:AdminHelper.php

示例9:

<?php

if (isset($_POST['dodelete']) || isset($_REQUEST['modalconfirm'])) {
    $delete_response = $cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'deletelogin', 'address' => $admin_primary_cash_request->sessionGet('cash_effective_user_email')));
    if ($delete_response['status_uid'] == 'system_deletelogin_200') {
        AdminHelper::formSuccess('Success. Deleted.', '/logout/');
    }
}
$cash_admin->page_data['title'] = 'Account: Delete account';
$cash_admin->setPageContentTemplate('delete_confirm');
开发者ID:JamesLinus,项目名称:platform,代码行数:10,代码来源:account_delete.php

示例10:

  ***************************************************************************/
 // receipt request requested
 if (isset($_POST['resend_store_url'])) {
     $resend_response = $cash_admin->requestAndStore(array('cash_request_type' => 'commerce', 'cash_action' => 'sendorderreceipt', 'id' => $request_parameters[0], 'finalize_url' => $_POST['resend_store_url']));
     AdminHelper::formSuccess('Receipt sent!', '/commerce/orders/view/' . $request_parameters[0]);
 }
 // edit order notes
 if (isset($_POST['ordernotes'])) {
     $order_details_response = $cash_admin->requestAndStore(array('cash_request_type' => 'commerce', 'cash_action' => 'editorder', 'id' => $request_parameters[0], 'notes' => $_POST['ordernotes']));
     AdminHelper::formSuccess('Changes saved.', '/commerce/orders/view/' . $request_parameters[0]);
 }
 // mark order as fulfilled
 if (isset($request_parameters[1])) {
     if ($request_parameters[1] == 'fulfilled') {
         $order_details_response = $cash_admin->requestAndStore(array('cash_request_type' => 'commerce', 'cash_action' => 'editorder', 'id' => $request_parameters[0], 'fulfilled' => 1));
         AdminHelper::formSuccess('Order fulfilled.', '/commerce/orders/view/' . $request_parameters[0]);
     }
     /* else if ($request_parameters[1] == 'cancel') {
     			$order_cancel_response = $cash_admin->requestAndStore(
     				array(
     					'cash_request_type' => 'commerce',
     					'cash_action' => 'cancelorder',
     					'id' => $request_parameters[0]
     				)
     			);
     			if ($order_cancel_response['payload']) {
     				AdminHelper::formSuccess('Order cancelled.','/commerce/orders/view/' . $request_parameters[0]);
     			} else {
     				AdminHelper::formFailure('Try again.','/commerce/orders/view/' . $request_parameters[0]);
     			}
     		} */
开发者ID:jmcclenon,项目名称:platform,代码行数:31,代码来源:commerce_orders_view.php

示例11: array

<?php

$cash_admin->page_data['country_codes'] = AdminHelper::drawCountryCodeUL();
$effective_user = $cash_admin->effective_user_id;
if (isset($_POST['docontactadd'])) {
    $add_response = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'addcontact', 'user_id' => $effective_user, 'email_address' => $_POST['email_address'], 'first_name' => $_POST['first_name'], 'last_name' => $_POST['last_name'], 'organization' => $_POST['organization'], 'address_line1' => $_POST['address1'], 'address_city' => $_POST['address_city'], 'address_region' => $_POST['address_region'], 'address_postalcode' => $_POST['address_postalcode'], 'address_country' => $_POST['address_country'], 'phone' => $_POST['phone']));
    if ($add_response['payload']) {
        AdminHelper::formSuccess('Success. Contact added.');
    } else {
        AdminHelper::formFailure('Error. Something just didn\'t work right.');
    }
}
$initials_response = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'getcontactinitials', 'user_id' => $effective_user));
if ($initials_response['payload']) {
    $alphabet = array('A' => array('letter' => 'A', 'contact' => false), 'B' => array('letter' => 'B', 'contact' => false), 'C' => array('letter' => 'C', 'contact' => false), 'D' => array('letter' => 'D', 'contact' => false), 'E' => array('letter' => 'E', 'contact' => false), 'F' => array('letter' => 'F', 'contact' => false), 'G' => array('letter' => 'G', 'contact' => false), 'H' => array('letter' => 'H', 'contact' => false), 'I' => array('letter' => 'I', 'contact' => false), 'J' => array('letter' => 'J', 'contact' => false), 'K' => array('letter' => 'K', 'contact' => false), 'L' => array('letter' => 'L', 'contact' => false), 'M' => array('letter' => 'M', 'contact' => false), 'N' => array('letter' => 'N', 'contact' => false), 'O' => array('letter' => 'O', 'contact' => false), 'P' => array('letter' => 'P', 'contact' => false), 'Q' => array('letter' => 'Q', 'contact' => false), 'R' => array('letter' => 'R', 'contact' => false), 'S' => array('letter' => 'S', 'contact' => false), 'T' => array('letter' => 'T', 'contact' => false), 'U' => array('letter' => 'U', 'contact' => false), 'V' => array('letter' => 'V', 'contact' => false), 'W' => array('letter' => 'W', 'contact' => false), 'X' => array('letter' => 'X', 'contact' => false), 'Y' => array('letter' => 'Y', 'contact' => false), 'Z' => array('letter' => 'Z', 'contact' => false));
    if (is_array($initials_response['payload'])) {
        foreach ($initials_response['payload'] as $value) {
            if (array_key_exists($value['initial'], $alphabet)) {
                $alphabet[$value['initial']]['contact'] = true;
            }
        }
        $cash_admin->page_data['alphabet'] = new ArrayIterator($alphabet);
    }
}
if (isset($request_parameters[1])) {
    if ($request_parameters[0] == 'bylastname') {
        $contacts_response = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'getcontactsbyinitials', 'user_id' => $effective_user, 'initial' => $request_parameters[1]));
        if ($contacts_response['payload']) {
            $cash_admin->page_data['contact_list'] = new ArrayIterator($contacts_response['payload']);
        }
    }
开发者ID:JamesLinus,项目名称:platform,代码行数:31,代码来源:people_contacts.php

示例12: array

<?php

$misc_message = false;
if (isset($_POST['domisc'])) {
    CASHSystem::setSystemSetting('timezone', $_POST['timezone']);
    CASHSystem::setSystemSetting('systememail', $_POST['systememail']);
    AdminHelper::formSuccess('Success. All changed.');
}
$migrate_message = false;
if (isset($_POST['domigrate'])) {
    $new_settings = array('hostname' => $_POST['hostname'], 'username' => $_POST['adminuser'], 'password' => $_POST['adminpassword'], 'database' => $_POST['databasename']);
    $migrate_response = $cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'migratedb', 'todriver' => $_POST['driver'], 'tosettings' => $new_settings));
    if ($migrate_response['payload']) {
        AdminHelper::formSuccess('Success. Database upgraded. Enjoy!');
    } else {
        AdminHelper::formFailure('Error. There was a problem migrating your data.');
    }
}
$platform_settings = CASHSystem::getSystemSettings();
$cash_admin->page_data['system_email'] = $platform_settings['systememail'];
$cash_admin->page_data['timezone_options'] = AdminHelper::drawTimeZones($platform_settings['timezone']);
$db_types = array('mysql' => 'MySQL', 'sqlite' => 'SQLite');
$db_type = 'unknown';
if (array_key_exists($platform_settings['driver'], $db_types)) {
    $cash_admin->page_data['db_type'] = $db_types[$platform_settings['driver']];
}
if ($cash_admin->page_data['db_type'] == 'MySQL') {
    $cash_admin->page_data['migrate_from_mysql'] = true;
} elseif ($cash_admin->page_data['db_type'] == 'SQLite') {
    $cash_admin->page_data['migrate_from_sqlite'] = true;
}
开发者ID:JamesLinus,项目名称:platform,代码行数:31,代码来源:settings.php

示例13: array_map

    } else {
        AdminHelper::formFailure('Error. There was a problem editing.');
    }
}
if (isset($_POST['dobatchcontactsadd'])) {
    if (!empty($_POST['element_content'])) {
        $email_array = array_map('trim', explode(",", str_replace(PHP_EOL, ',', $_POST['element_content'])));
        if (count($email_array) > 0) {
            $total_added = 0;
            foreach ($email_array as $address) {
                $add_response = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'addaddresstolist', 'do_not_verify' => 1, 'address' => $address, 'list_id' => $request_parameters[0]));
                if ($add_response['payload']) {
                    $total_added++;
                }
            }
            AdminHelper::formSuccess('Success. Added ' . $total_added . ' new people.', '/people/lists/view/' . $request_parameters[0]);
        } else {
            AdminHelper::formFailure('Error. There was a problem adding new people.', '/people/lists/view/' . $request_parameters[0]);
        }
    } else {
        $cash_admin->page_data['error_message'] = 'Error. Please try again.';
    }
}
$current_response = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'getlist', 'list_id' => $request_parameters[0]));
$cash_admin->page_data['ui_title'] = '' . $current_response['payload']['name'] . '';
$current_list = $current_response['payload'];
$cash_admin->page_data['no_selected_connection'] = true;
if (is_array($current_list)) {
    $cash_admin->page_data = array_merge($cash_admin->page_data, $current_list);
    if ($current_list['connection_id'] != 0) {
        $cash_admin->page_data['no_selected_connection'] = false;
开发者ID:JamesLinus,项目名称:platform,代码行数:31,代码来源:people_lists_batch_edit.php

示例14: str_replace

        }
        if (isset($_POST['pagetheme'])) {
            if ($_POST['pagetheme'] == 'light') {
                $template_default = str_replace('<body', '<body class="light"', $template_default);
            } else {
                if ($_POST['pagetheme'] == 'dark') {
                    $template_default = str_replace('<body', '<body class="dark"', $template_default);
                }
            }
        }
        $template_default = str_replace('{{{element_n}}}', $replacement, $template_default);
        $template_response = $cash_admin->requestAndStore(array('cash_request_type' => 'system', 'cash_action' => 'settemplate', 'name' => '', 'type' => 'page', 'template' => $template_default, 'user_id' => $cash_admin->effective_user_id));
        $template_id = $template_response['payload'];
        $edit_response = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'editcampaign', 'id' => $requested_campaign_id, 'template_id' => $template_id));
        if ($edit_response['payload']) {
            AdminHelper::formSuccess('Success. Page theme created. You can edit it at any time.', '/');
        } else {
            AdminHelper::formFailure('Error. Something just didn\'t work right.', '/');
        }
    }
} else {
    // you're a wizard now, harry!
    $new_template = 0;
    $requested_campaign_id = $request_parameters[0];
    $current_response = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'getcampaign', 'id' => $requested_campaign_id));
    $campaign = $current_response['payload'];
    if ($campaign['template_id'] != 0) {
        // no points for gryffindor
        AdminHelper::controllerRedirect('/elements/templates/edit/' . $campaign['template_id'] . '/page/parent/' . $requested_campaign_id);
    }
    $elements_response = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'getelementsforcampaign', 'id' => $requested_campaign_id));
开发者ID:JamesLinus,项目名称:platform,代码行数:31,代码来源:campaigns_theme.php

示例15: foreach

                foreach ($settings_types_data[$settings_type]['dataTypes'][$cash_admin->platform_type] as $key => $data) {
                    $settings_data_array[$key] = $_POST[$key];
                }
                $result = $page_data_object->setSettings($_POST['settings_name'], $_POST['settings_type'], $settings_data_array, $_POST['connection_id']);
                if ($result) {
                    $cash_admin->page_data['action_message'] = '<strong>Success.</strong> All changed. See connection below.';
                } else {
                    $cash_admin->page_data['action_message'] = '<strong>Error.</strong> Something went wrong.';
                }
            }
            break;
        case 'delete':
            $connection_id = $request_parameters[1];
            $result = $page_data_object->deleteSettings($connection_id);
            if ($result) {
                AdminHelper::formSuccess('Success. Deleted. Sad.', '/');
                //$cash_admin->page_data['action_message'] = '<strong>Success.</strong> All gone. Sad.';
            } else {
                AdminHelper::formFailure('Something went wrong.', '/');
                //$cash_admin->page_data['action_message'] = '<strong>Error.</strong> Something went wrong.';
            }
            break;
    }
}
if (!$settings_action || isset($_POST['dosettingsadd']) || isset($_POST['dosettingsedit']) || $settings_action == 'delete') {
    $cash_admin->page_data['state_markup'] = '<h4>Current connections:</h4>' . '<p>Here are the settings that have already been added:</p>';
    $settings_for_user = $page_data_object->getAllConnectionsforUser();
    if (is_array($settings_for_user)) {
        foreach ($settings_for_user as $key => $data) {
            $cash_admin->page_data['state_markup'] .= '<div class="callout">' . '<h6>' . $data['name'] . '</h6>';
            if (array_key_exists($data['type'], $settings_types_data)) {
开发者ID:JamesLinus,项目名称:platform,代码行数:31,代码来源:settings_connections.php


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