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


PHP SJB_Request::getVar方法代码示例

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


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

示例1: execute

 public function execute()
 {
     $count_listing = SJB_Request::getVar('count_listing', 10);
     $listings_structure = array();
     $listing_structure_meta_data = array();
     $tp = SJB_System::getTemplateProcessor();
     if (SJB_UserManager::isUserLoggedIn()) {
         $user_sid = SJB_UserManager::getCurrentUserSID();
         $viewed_listings = SJB_UserManager::getRecentlyViewedListingsByUserSid($user_sid, $count_listing);
         if (count($viewed_listings)) {
             foreach ($viewed_listings as $viewed_listing) {
                 $listing = SJB_ListingManager::getObjectBySID($viewed_listing['listing_sid']);
                 if (empty($listing)) {
                     continue;
                 }
                 $listing_structure = SJB_ListingManager::createTemplateStructureForListing($listing);
                 $listings_structure[] = $listing_structure;
                 if (isset($listing_structure['METADATA'])) {
                     $listing_structure_meta_data = array_merge($listing_structure_meta_data, $listing_structure['METADATA']);
                 }
             }
             $metaDataProvider = SJB_ObjectMother::getMetaDataProvider();
             $tp->assign("METADATA", array("listing" => $metaDataProvider->getMetaData($listing_structure_meta_data)));
             $tp->assign("listings", $listings_structure);
         }
         $tp->display('recently_viewed_listings.tpl');
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:28,代码来源:recently_viewed_listings.php

示例2: displayItem

 private function displayItem()
 {
     $sid = SJB_Request::getVar('sid', false);
     $paymentLogItem = SJB_PaymentLogManager::getPaymentLogInfoBySID($sid);
     $this->templateProcessor->assign('paymentLogItem', $paymentLogItem);
     $this->templateProcessor->display('payment_log_details.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:7,代码来源:payment_log.php

示例3: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $bannersObj = new SJB_Banners();
     $action = SJB_Request::getVar('action');
     if (isset($action)) {
         $groupID = SJB_Request::getVar('groupID');
         switch ($action) {
             case 'add':
                 if ($groupID == '') {
                     SJB_FlashMessages::getInstance()->addWarning('EMPTY_VALUE', array('fieldCaption' => 'Group ID'));
                     break;
                 }
                 $result = $bannersObj->addBannerGroup($groupID);
                 if ($result === false) {
                     SJB_FlashMessages::getInstance()->addWarning('ERROR_ADD_BANNER_GROUP');
                     break;
                 }
                 $site_url = SJB_System::getSystemsettings('SITE_URL') . "/manage-banner-groups/";
                 header("Location: {$site_url}");
                 break;
         }
     }
     $tp->display("add_banner_group.tpl");
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:25,代码来源:add_banner_group.php

示例4: execute

 public function execute()
 {
     $listingTypeID = SJB_Request::getVar('listing_type', 'Job');
     $tp = SJB_System::getTemplateProcessor();
     $tp->assign('listing_type', $listingTypeID);
     $tp->display('select_posting_type.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:7,代码来源:select_posting_type.php

示例5: execute

 public function execute()
 {
     $guestAlert = new SJB_GuestAlert(array());
     $guestAlert->addSubscriptionDateProperty();
     $guestAlert->addStatusProperty();
     $search_form_builder = new SJB_SearchFormBuilder($guestAlert);
     $criteria_saver = new SJB_GuestAlertCriteriaSaver();
     $criteria = $search_form_builder->extractCriteriaFromRequestData($criteria_saver->getCriteria(), $guestAlert);
     $sortingField = SJB_Request::getVar('sorting_field', 'subscription_date');
     $sortingOrder = SJB_Request::getVar('sorting_order', 'DESC');
     $searcher = new SJB_GuestAlertSearcher(false, $sortingField, $sortingOrder);
     $foundGuestAlerts = $searcher->getObjectsSIDsByCriteria($criteria);
     foreach ($foundGuestAlerts as $id => $guestAlertSID) {
         $foundGuestAlerts[$id] = SJB_GuestAlertManager::getGuestAlertInfoBySID($guestAlertSID);
     }
     $type = SJB_Request::getVar('type', 'csv');
     $fileName = 'guest_alerts_' . date('Y-m-d');
     SJB_StatisticsExportController::createExportDirectory();
     switch ($type) {
         case 'csv':
             $ext = 'csv';
             SJB_StatisticsExportController::makeCSVExportFile($foundGuestAlerts, $fileName . '.' . $ext, 'Guest Alerts');
             break;
         default:
         case 'xls':
             $ext = 'xls';
             SJB_StatisticsExportController::makeXLSExportFile($foundGuestAlerts, $fileName . '.' . $ext, 'Guest Alerts');
             break;
     }
     SJB_StatisticsExportController::archiveAndSendExportFile($fileName, $ext);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:31,代码来源:export.php

示例6: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     if (isset($_REQUEST['ajax'])) {
         $sent = 0;
         $ids = array();
         if (isset($_REQUEST['userids'])) {
             $ids = $_REQUEST['userids'];
             foreach ($ids as $user_sid) {
                 if (!empty($user_sid) && SJB_Notifications::sendUserActivationLetter($user_sid)) {
                     $sent++;
                 }
             }
         }
         $tp->assign("countOfSuccessfulSent", $sent);
         $tp->assign("countOfUnsuccessfulSent", count($ids) - $sent);
         $tp->display("send_activation_letter.tpl");
         exit;
     }
     $user_sid = SJB_Request::getVar('usersid', null);
     $error = null;
     if (!SJB_UserManager::getObjectBySID($user_sid)) {
         $error = "USER_DOES_NOT_EXIST";
     } elseif (!SJB_Notifications::sendUserActivationLetter($user_sid)) {
         $error = "CANNOT_SEND_EMAIL";
     }
     $tp->assign("error", $error);
     $tp->display("send_activation_letter.tpl");
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:29,代码来源:send_activation_letter.php

示例7: search

 public function search()
 {
     $action = SJB_Request::getVar('action');
     $period = SJB_Request::getVar('period', array());
     $sorting_field = SJB_Request::getVar('sorting_field', 'usageCount');
     $sorting_order = SJB_Request::getVar('sorting_order', 'DESC');
     $i18n = SJB_I18N::getInstance();
     $statistics = array();
     if ($action) {
         if (!empty($period['from']) && !empty($period['to'])) {
             $from = $i18n->getInput('date', $period['from']);
             $to = $i18n->getInput('date', $period['to']);
             if (strtotime($from) > strtotime($to)) {
                 throw new Exception('SELECTED_PERIOD_IS_INCORRECT');
             }
         }
         $statistics = SJB_Statistics::getPromotionsStatistics($period, $sorting_field, $sorting_order);
     }
     $periodView = array();
     foreach ($period as $key => $value) {
         $periodView[$key] = $i18n->getInput('date', $period[$key]);
     }
     $this->tp->assign('currency', SJB_CurrencyManager::getDefaultCurrency());
     $this->tp->assign('action', $action);
     $this->tp->assign('period', $period);
     $this->tp->assign('periodView', $periodView);
     $this->tp->assign('statistics', $statistics);
     $this->tp->assign('countResult', count($statistics));
     $this->tp->assign('sorting_field', $sorting_field);
     $this->tp->assign('sorting_order', $sorting_order);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:31,代码来源:promotions.php

示例8: execute

 public function execute()
 {
     if (isset($_REQUEST['passed_parameters_via_uri'])) {
         $passed_parameters_via_uri = SJB_UrlParamProvider::getParams();
         $etSID = SJB_Array::get($passed_parameters_via_uri, 0);
     }
     $field_id = SJB_Request::getVar('field_id', null);
     $etInfo = SJB_EmailTemplateEditor::getEmailTemplateInfoBySID($etSID);
     if (is_null($etSID) || is_null($field_id)) {
         $errors['PARAMETERS_MISSED'] = 1;
     } elseif (is_null($etInfo) || !isset($etInfo[$field_id])) {
         $errors['WRONG_PARAMETERS_SPECIFIED'] = 1;
     } else {
         $uploaded_file_id = $etInfo[$field_id];
         SJB_UploadFileManager::deleteUploadedFileByID($uploaded_file_id);
         $etInfo[$field_id] = '';
         $emailTemplate = new SJB_EmailTemplate($etInfo);
         $emailTemplate->setSID($etSID);
         SJB_EmailTemplateEditor::saveEmailTemplate($emailTemplate);
         SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/edit-email-templates/' . $emailTemplate->getPropertyValue('group') . '/' . $etSID);
     }
     $tp = SJB_System::getTemplateProcessor();
     $tp->assign('errors', isset($errors) ? $errors : null);
     $tp->display('delete_uploaded_file.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:25,代码来源:email_templates_delete_uploaded_file.php

示例9: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $user = SJB_UserManager::getCurrentUser();
     if ($user) {
         $userNotificationsManager = new SJB_UserNotificationsManager($user);
         $userNotificationsInfo = $userNotificationsManager->getUserNotificationsInfo();
         $userNotificationsInfo = array_merge($userNotificationsInfo, $_REQUEST);
         $userNotifications = new SJB_UserNotifications($userNotificationsInfo);
         $userNotificationsForm = new SJB_Form($userNotifications);
         $userNotificationsForm->registerTags($tp);
         $userNotificationsFields = $userNotificationsForm->getFormFieldsInfo();
         $tp->assign('form_fields', $userNotificationsFields);
         if (SJB_Request::getVar('action') === 'save') {
             $errors = array();
             if ($userNotificationsForm->isDataValid($errors)) {
                 $userNotifications->update();
                 $tp->assign('isSaved', true);
             }
             $tp->assign('errors', $errors);
         }
         $tp->assign('userNotificationGroups', $userNotificationsManager->getNotificationGroups()->getGroups());
         $tp->assign('userNotifications', $userNotificationsManager->getEnabledForGroupUserNotifications());
         $listingTypes = SJB_ListingTypeManager::getListingTypeByUserSID($user->getSID());
         $approveSetting = SJB_ListingTypeManager::getWaitApproveSettingByListingType($listingTypes);
         $tp->assign('approve_setting', $approveSetting);
         $tp->display('user_notifications.tpl');
     } else {
         $tp->display('login.tpl');
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:31,代码来源:user_notifications.php

示例10: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     if (SJB_UserManager::isUserLoggedIn()) {
         $user_id = SJB_UserManager::getCurrentUserSID();
         if (SJB_Request::getVar('pm_action', '', SJB_Request::METHOD_POST) == 'delete') {
             $checked = SJB_Request::getVar('pm_check', array(), SJB_Request::METHOD_POST);
             SJB_PrivateMessage::delete($checked);
         }
         $page = intval(SJB_Request::getVar('page', 1, SJB_Request::METHOD_GET));
         $messagesPerPage = SJB_Request::getInt('messagesPerPage', 10);
         $total = SJB_PrivateMessage::getTotalOutbox($user_id);
         $totalPages = ceil($total / $messagesPerPage);
         if ($totalPages == 0) {
             $totalPages = 1;
         }
         if (empty($page) || $page <= 0) {
             $page = 1;
         }
         if ($totalPages < $page) {
             SJB_HelperFunctions::redirect("?page={$totalPages}");
         }
         $list = SJB_PrivateMessage::getListOutbox($user_id, $page, $messagesPerPage);
         $tp->assign('message_list', $list);
         $tp->assign('messagesPerPage', $messagesPerPage);
         $tp->assign('page', $page);
         $tp->assign('totalPages', $totalPages);
         $tp->assign('include', 'list_outbox.tpl');
         $tp->assign('unread', SJB_PrivateMessage::getCountUnreadMessages($user_id));
     }
     $tp->display('main.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:32,代码来源:private_messages_outbox.php

示例11: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $errors = array();
     $listingTypeID = SJB_Request::getVar('listing_type_id', '');
     if (SJB_UserManager::isUserLoggedIn()) {
         if (!SJB_Acl::getInstance()->isAllowed('save_' . trim($listingTypeID))) {
             $errors[] = 'DENIED_VIEW_SAVED_LISTING';
         }
         if (!$errors) {
             $userSid = SJB_UserManager::getCurrentUserSID();
             if (SJB_Request::getVar('action', '') == 'delete') {
                 $listing_id = SJB_Request::getVar('listing_id', null);
                 if (!is_null($listing_id)) {
                     foreach ($listing_id as $key => $value) {
                         SJB_SavedListings::deleteListingFromDBBySID($key, $userSid);
                     }
                     SJB_HelperFunctions::redirect(SJB_System::getSystemSettings("SITE_URL") . SJB_Navigator::getURI());
                 }
             }
             $saved_listings_id = SJB_SavedListings::getSavedListingsFromDB($userSid);
             $listings_structure = array();
             $listing_structure_meta_data = array();
             foreach ($saved_listings_id as $saved_listing) {
                 $saved_listing_id = $saved_listing['listing_sid'];
                 $listing = SJB_ListingManager::getObjectBySID($saved_listing_id);
                 if (is_null($listing)) {
                     continue;
                 }
                 $listing->addPicturesProperty();
                 $listing_structure = SJB_ListingManager::createTemplateStructureForListing($listing);
                 $listings_structure[$listing->getID()] = $listing_structure;
                 $listings_structure[$listing->getID()]['saved_listing'] = $saved_listing;
                 if (isset($listing_structure['METADATA'])) {
                     $listing_structure_meta_data = array_merge($listing_structure_meta_data, $listing_structure['METADATA']);
                 }
             }
             $metaDataProvider = SJB_ObjectMother::getMetaDataProvider();
             $tp->assign("METADATA", array("listing" => $metaDataProvider->getMetaData($listing_structure_meta_data)));
             $tp->assign("listings", $listings_structure);
             $tp->assign("listing_type_id", $listingTypeID);
             $tp->display("saved_listings.tpl");
         } else {
             $tp->assign("errors", $errors);
             $tp->display("save_search_failed.tpl");
         }
     } else {
         $url = base64_encode(SJB_System::getSystemSettings("SITE_URL") . "/system/classifieds" . SJB_System::getURI());
         switch ($listingTypeID) {
             case 'job':
                 $url = base64_encode(SJB_System::getSystemSettings("SITE_URL") . "/saved-jobs/");
                 break;
             case 'resume':
                 $url = base64_encode(SJB_System::getSystemSettings("SITE_URL") . "/saved-resumes/");
                 break;
         }
         $tp->assign("return_url", $url);
         $tp->display("../users/login.tpl");
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:60,代码来源:saved_listings.php

示例12: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $listing_field_sid = SJB_Request::getVar('listing_sid', null);
     $errors = array();
     $listingTypes = array();
     if (!is_null($listing_field_sid)) {
         $listing_field = SJB_ListingFieldManager::getFieldInfoBySID($listing_field_sid);
         $listing_type_id = 'Job/Resume';
         if ($listing_field['listing_type_sid'] != 0) {
             $listing_type_id = SJB_ListingTypeManager::getListingTypeIDBySID($listing_field['listing_type_sid']);
             array_push($listingTypes, SJB_ListingTypeManager::getListingTypeInfoBySID(SJB_Array::get($listing_field, 'listing_type_sid')));
         } else {
             $listingTypes = SJB_ListingTypeManager::getAllListingTypesInfo();
         }
         $tp->assign('listingTypesInfo', $listingTypes);
         $tp->assign('listing_type_id', $listing_type_id);
         $tp->assign('listing_sid', $listing_field_sid);
         $tp->assign('listing_field_info', $listing_field);
         $tp->assign('listing_type_sid', $listing_field['listing_type_sid']);
     } else {
         $errors[] = 'The system cannot proceed as Listing SID is not set';
     }
     $tp->assign('errors', $errors);
     $tp->display('attention_listing_type_field.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:26,代码来源:attention_listing_type_field.php

示例13: execute

 public function execute()
 {
     $user_group_sid = isset($_REQUEST['user_group_sid']) ? $_REQUEST['user_group_sid'] : null;
     $user_group_info = SJB_UserGroupManager::getUserGroupInfoBySID($user_group_sid);
     $user_profile_field = new SJB_UserProfileField($_REQUEST);
     $user_profile_field->setUserGroupSID($user_group_sid);
     //infill instructions field
     //$user_profile_field->addInfillInstructions(SJB_Request::getVar('instructions'));
     $add_user_profile_field_form = new SJB_Form($user_profile_field);
     $form_is_submitted = isset($_REQUEST['action']) && $_REQUEST['action'] == 'add';
     $errors = null;
     if ($form_is_submitted && $add_user_profile_field_form->isDataValid($errors)) {
         SJB_UserProfileFieldManager::saveUserProfileField($user_profile_field);
         if (SJB_Request::getVar('type', '') == 'youtube') {
             SJB_HelperFunctions::redirect(SJB_System::getSystemSettings("SITE_URL") . "/instruction_user_profile_field/?user_group_sid=" . $user_group_sid . "&user_field_sid=" . $user_profile_field->sid);
         } else {
             SJB_HelperFunctions::redirect(SJB_System::getSystemSettings("SITE_URL") . "/edit-user-profile/?user_group_sid=" . $user_group_sid);
         }
     } else {
         $template_processor = SJB_System::getTemplateProcessor();
         $add_user_profile_field_form->registerTags($template_processor);
         $template_processor->assign("form_fields", $add_user_profile_field_form->getFormFieldsInfo());
         $template_processor->assign("user_group_sid", $user_group_sid);
         $template_processor->assign("errors", $errors);
         $template_processor->assign("user_group_info", $user_group_info);
         $template_processor->display("add_user_profile_field.tpl");
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:28,代码来源:add_user_profile_field.php

示例14: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $errors = array();
     $location = new SJB_Location($_REQUEST);
     if (SJB_Request::getVar('state', false)) {
         $location->state_code = SJB_StatesManager::getStateCodeByStateName(SJB_Request::getVar('state', ''));
     } else {
         $location->state_code = '';
     }
     $formSubmitted = 'add' == SJB_Request::getVar('action', false);
     $locationAdded = false;
     if ($formSubmitted) {
         if ($location->isDataValid($errors)) {
             if (SJB_LocationManager::saveLocation($location)) {
                 $location = new SJB_Location();
                 $locationAdded = true;
             } else {
                 $errors['Name'] = 'NOT_UNIQUE_VALUE';
             }
         }
     }
     $countries = SJB_CountriesManager::getAllCountriesCodesAndNames();
     $locationInfo = $location->getInfo();
     $tp->assign('locationAdded', $locationAdded);
     $tp->assign('countries', $countries);
     $tp->assign('errors', $errors);
     $tp->assign('location_info', $locationInfo);
     $tp->display('add_location.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:30,代码来源:add_location.php

示例15: execute

 public function execute()
 {
     $errors = array();
     $template_processor = SJB_System::getTemplateProcessor();
     if (isset($_REQUEST['action'])) {
         $action_name = $_REQUEST['action'];
         $action = SJB_PhraseActionFactory::get($action_name, $_REQUEST, $template_processor);
         if ($action->canPerform()) {
             $action->perform();
             $template_processor->display('refresh_opener_and_close_popup.tpl');
             return;
         } else {
             $errors = $action->getErrors();
         }
     }
     $phrase_id = SJB_Request::getVar('phrase', null);
     $domain_id = SJB_Request::getVar('domain', null);
     $i18n = SJB_ObjectMother::createI18N();
     $langs = $i18n->getLanguagesData();
     $template_processor->assign('langs', $langs);
     $template_processor->assign('errors', $errors);
     if (!$i18n->phraseExists($phrase_id, $domain_id)) {
         $domains = $i18n->getDomainsData();
         $template_processor->assign('domains', $domains);
         $template_processor->assign('request_data', $_REQUEST);
         $template_processor->display('add_phrase.tpl');
     } else {
         $phrase_data = $i18n->getPhraseData($phrase_id, $domain_id);
         $template_processor->assign('phrase', $phrase_data);
         $template_processor->display('update_phrase.tpl');
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:32,代码来源:auto_translate.php


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