本文整理汇总了PHP中SJB_UserManager::createTemplateStructureForCurrentUser方法的典型用法代码示例。如果您正苦于以下问题:PHP SJB_UserManager::createTemplateStructureForCurrentUser方法的具体用法?PHP SJB_UserManager::createTemplateStructureForCurrentUser怎么用?PHP SJB_UserManager::createTemplateStructureForCurrentUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SJB_UserManager
的用法示例。
在下文中一共展示了SJB_UserManager::createTemplateStructureForCurrentUser方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
$tp = SJB_System::getTemplateProcessor();
if (SJB_UserManager::isUserLoggedIn()) {
$user_id = SJB_UserManager::getCurrentUserSID();
$errors = array();
$id = SJB_Request::getInt('id', 0, 'GET');
$action = SJB_Request::getVar('action', '', 'GET');
if ($id > 0) {
// read message
if (SJB_PrivateMessage::isMyMessage($id)) {
if ($action == 'delete') {
SJB_PrivateMessage::delete(array($id));
SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/private-messages/inbox/');
}
$message = SJB_PrivateMessage::readMessage($id);
SJB_Authorization::updateCurrentUserSession();
$current_user_info = SJB_UserManager::createTemplateStructureForCurrentUser();
$current_user_info['logged_in'] = true;
$current_user_info['new_messages'] = SJB_PrivateMessage::getCountUnreadMessages($current_user_info['id']);
SJB_System::setCurrentUserInfo($current_user_info);
$tp->assign('message', $message);
$tp->assign('include', 'message_detail.tpl');
} else {
$errors['NOT_EXISTS_MESSAGE'] = 1;
}
}
$tp->assign('errors', $errors);
$tp->assign('unread', SJB_PrivateMessage::getCountUnreadMessages($user_id));
$tp->display('main.tpl');
} else {
$tp->assign('return_url', base64_encode(SJB_Navigator::getURIThis()));
$tp->display('../users/login.tpl');
}
}
示例2: execute
public function execute()
{
$current_user_info = array('logged_in' => false);
if (SJB_UserManager::isUserLoggedIn()) {
SJB_Authorization::updateCurrentUserSession();
$current_user_info = SJB_UserManager::createTemplateStructureForCurrentUser();
$current_user_info['logged_in'] = true;
$current_user_info['new_messages'] = SJB_PrivateMessage::getCountUnreadMessages($current_user_info['id']);
} else {
// social plugin
$userGroups = SJB_UserGroupManager::getAllUserGroupsInfo();
SJB_System::setCurrentUserGroupsInfo($userGroups);
SJB_Event::dispatch('Login_Plugin');
}
SJB_System::setCurrentUserInfo($current_user_info);
}
示例3: getFormFields
function getFormFields($invoice)
{
$form_fields = array();
$properties = $this->details->getProperties();
$form_fields['gw'] = $properties['id']->getValue();
// payment-related fields
$form_fields['item_number'] = $invoice->getSID();
$form_fields['item_name'] = $invoice->getProductNames();
$form_fields['x_description'] = $invoice->getProductNames();
$form_fields['x_amount'] = $invoice->getPropertyValue('total');
$form_fields['x_currency_code'] = $properties['currency_code']->getValue();
$user = SJB_UserManager::createTemplateStructureForCurrentUser();
$form_fields['x_first_name'] = isset($user['FirstName']) ? $user['FirstName'] : '';
$form_fields['x_last_name'] = isset($user['LastName']) ? $user['LastName'] : '';
$form_fields['x_company'] = isset($user['CompanyName']) ? $user['CompanyName'] : '';
$form_fields['x_address'] = isset($user['Location']['Address']) ? $user['Location']['Address'] : '';
$form_fields['x_city'] = isset($user['Location']['City']) ? $user['Location']['City'] : '';
$form_fields['x_state'] = isset($user['Location']['State']) ? $user['Location']['State'] : '';
$form_fields['x_zip'] = isset($user['Location']['ZipCode']) ? $user['Location']['ZipCode'] : '';
$form_fields['x_country'] = isset($user['Location']['Country']) ? $user['Location']['Country'] : '';
$form_fields['x_email'] = isset($user['Location']['email']) ? $user['Location']['email'] : '';
$form_fields['x_phone'] = isset($user['Location']['PhoneNumber']) ? $user['Location']['PhoneNumber'] : '';
return $form_fields;
}
示例4: getFormFields
function getFormFields($invoice)
{
$form_fields = array();
$properties = $this->details->getProperties();
$id = $properties['id']->getValue();
$form_fields['sid'] = $properties['2co_account_id']->getValue();
$form_fields['mode'] = '2CO';
$form_fields['merchant_order_id'] = $invoice->getSID();
$i = 1;
$items = $invoice->getPropertyValue('items');
$taxInfo = $invoice->getPropertyValue('tax_info');
foreach ($items['products'] as $key => $product) {
if ($product == -1) {
$form_fields['li_' . $i . '_name'] = $items['custom_item'][$key];
} else {
$productInfo = $invoice->getItemValue($key);
$form_fields['li_' . $i . '_name'] = $productInfo['name'];
$form_fields['li_' . $i . '_product_id'] = $product;
if ($invoice->isRecurring() && !empty($productInfo['recurring'])) {
$form_fields['li_' . $i . '_duration'] = 'Forever';
if (!empty($productInfo['period_name']) && $productInfo['period_name'] != 'unlimited') {
$period = $productInfo['period'] . " " . ucwords($productInfo['period_name']);
$form_fields['li_' . $i . '_recurrence'] = $period;
} else {
$form_fields['li_' . $i . '_recurrence'] = " Week";
}
}
}
$form_fields['li_' . $i . '_type'] = 'product';
if ($items['qty'][$key] > 0) {
$form_fields['li_' . $i . '_quantity'] = 1;
$form_fields['li_' . $i . '_price'] = sprintf('%.02f', $items['amount'][$key]);
if ($taxInfo && !$taxInfo['price_includes_tax']) {
$form_fields['li_' . $i . '_price'] += SJB_TaxesManager::getTaxAmount($form_fields['li_' . $i . '_price'], $taxInfo['tax_rate'], $taxInfo['price_includes_tax']);
}
} else {
$form_fields['li_' . $i . '_quantity'] = $items['qty'][$key];
$form_fields['li_' . $i . '_price'] = sprintf('%.02f', $items['price'][$key]);
if ($taxInfo && !$taxInfo['price_includes_tax']) {
$form_fields['li_' . $i . '_price'] += SJB_TaxesManager::getTaxAmount($form_fields['li_' . $i . '_price'], $taxInfo['tax_rate'], $taxInfo['price_includes_tax']);
}
}
$form_fields['li_' . $i . '_tangible'] = 'N';
$i++;
}
$user = SJB_UserManager::createTemplateStructureForCurrentUser();
$form_fields['first_name'] = isset($user['FirstName']) ? $user['FirstName'] : '';
$form_fields['last_name'] = isset($user['LastName']) ? $user['LastName'] : '';
$form_fields['street_address'] = isset($user['Location']['Address']) ? $user['Location']['Address'] : '';
$form_fields['city'] = isset($user['Location']['City']) ? $user['Location']['City'] : '';
$form_fields['state'] = isset($user['Location']['State']) ? $user['Location']['State'] : '';
$form_fields['zip'] = isset($user['Location']['ZipCode']) ? $user['Location']['ZipCode'] : '';
$form_fields['country'] = isset($user['Location']['Country']) ? $user['Location']['Country'] : '';
$form_fields['email'] = isset($user['email']) ? $user['email'] : '';
$form_fields['phone'] = isset($user['PhoneNumber']) ? $user['PhoneNumber'] : '';
$form_fields['x_receipt_link_url'] = SJB_System::getSystemSettings('SITE_URL') . "/system/payment/callback/{$id}/{$invoice->getSID()}/";
return $form_fields;
}
示例5: getFormFields
function getFormFields($invoice)
{
$form_fields = array();
$properties = $this->details->getProperties();
$x_fp_sequence = rand(1, 1000);
$x_fp_timestamp = time();
$fingerprint = $this->hmac($properties['authnet_api_transaction_key']->getValue(), $properties['authnet_api_login_id']->getValue() . '^' . $x_fp_sequence . '^' . $x_fp_timestamp . '^' . $invoice->getPropertyValue('total') . '^' . $properties['currency_code']->getValue());
$id = $properties['id']->getValue();
// hard-coded fields
$form_fields['x_show_form'] = 'PAYMENT_FORM';
// configuration fields
$form_fields['x_login'] = $properties['authnet_api_login_id']->getValue();
$form_fields['x_fp_hash'] = $fingerprint;
$form_fields['x_fp_sequence'] = $x_fp_sequence;
$form_fields['x_fp_timestamp'] = $x_fp_timestamp;
$form_fields['x_currency_code'] = $properties['currency_code']->getValue();
$form_fields['x_receipt_link_method'] = 'POST';
$form_fields['x_receipt_link_text'] = 'Return to the merchant';
// return page field (response)
$form_fields['x_receipt_link_url'] = SJB_System::getSystemSettings('SITE_URL') . "/system/payment/callback/{$id}/{$invoice->getSID()}/";
// payment-related fields
$form_fields['x_description'] = $invoice->getProductNames();
$form_fields['item_name'] = $invoice->getProductNames();
$form_fields['x_amount'] = $invoice->getPropertyValue('total');
$form_fields['item_number'] = $invoice->getSID();
$user = SJB_UserManager::createTemplateStructureForCurrentUser();
$form_fields['x_first_name'] = isset($user['FirstName']) ? $user['FirstName'] : '';
$form_fields['x_last_name'] = isset($user['LastName']) ? $user['LastName'] : '';
$form_fields['x_company'] = isset($user['CompanyName']) ? $user['CompanyName'] : '';
$form_fields['x_address'] = isset($user['Location']['Address']) ? $user['Location']['Address'] : '';
$form_fields['x_city'] = isset($user['Location']['City']) ? $user['Location']['City'] : '';
$form_fields['x_state'] = isset($user['Location']['State']) ? $user['Location']['State'] : '';
$form_fields['x_zip'] = isset($user['Location']['ZipCode']) ? $user['Location']['ZipCode'] : '';
$form_fields['x_country'] = isset($user['Location']['Country']) ? $user['Location']['Country'] : '';
$form_fields['x_email'] = isset($user['email']) ? $user['email'] : '';
$form_fields['x_phone'] = isset($user['PhoneNumber']) ? $user['PhoneNumber'] : '';
return $form_fields;
}