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


PHP SJB_HelperFunctions类代码示例

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


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

示例1: execute

 public function execute()
 {
     $uri = parse_url($_SERVER['REQUEST_URI']);
     if (!preg_match("/\\/\$/", $uri['path'])) {
         $uri = parse_url($_SERVER['REQUEST_URI']);
         $query = isset($uri['query']) ? '?' . $uri['query'] : '';
         SJB_HelperFunctions::redirect($uri['path'] . '/' . $query);
     } else {
         $uri = SJB_Request::getVar('browseUrl', $this->getUri());
     }
     $listingTypeId = SJB_Request::getVar('listing_type_id', '');
     $browseManager = SJB_ObjectMother::createBrowseManager($listingTypeId, $this->parameters);
     $browseItems = array();
     if ($browseManager->canBrowse()) {
         if (SJB_Settings::getValue('enableBrowseByCounter')) {
             $browseItems = $browseManager->getItemsFromDB($uri, true);
         } else {
             $browseItems = $browseManager->getItems($this->parameters, true);
         }
     }
     $tp = $this->getTemplateProcessor($browseManager, $listingTypeId);
     $tp->assign('browseItems', $browseItems);
     $tp->assign('recordsNumToDisplay', SJB_Request::getVar('recordsNumToDisplay', 20));
     $tp->assign('user_page_uri', $uri);
     $tp->assign('sitePageUri', SJB_HelperFunctions::getSiteUrl() . $this->getUri());
     $tp->assign('browse_level', $browseManager->getLevel() + 1);
     $tp->assign('browse_navigation_elements', $browseManager->getNavigationElements($uri));
     $tp->display(SJB_Request::getVar('browse_template', 'browse_items_and_results.tpl'));
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:29,代码来源:browse.php

示例2: __construct

 /**
  * @param array $info
  * @param bool $isGroupsExist
  * @param bool $isAuthorized
  */
 function __construct($info = array(), $isGroupsExist = false, $isAuthorized = false)
 {
     $this->commonFields = parent::getCommonFields();
     $this->postingFields = self::getPostingFields();
     $this->systemFields = self::getSystemFields($isGroupsExist, $isAuthorized);
     $detailsInfo = self::getDetails($this->commonFields, $isGroupsExist, $isAuthorized);
     $locationPrefix = '';
     foreach ($detailsInfo as $index => $propertyInfo) {
         $sortArray[$index] = $propertyInfo['order'];
         if ($propertyInfo['type'] == 'location') {
             $locationPrefix = $propertyInfo['id'];
         }
     }
     $sortArray = SJB_HelperFunctions::array_sort($sortArray);
     foreach ($sortArray as $index => $value) {
         $sortedDetailsInfo[$index] = $detailsInfo[$index];
     }
     foreach ($sortedDetailsInfo as $detailInfo) {
         $detailInfo['value'] = '';
         if (isset($info[$detailInfo['id']])) {
             $detailInfo['value'] = $info[$detailInfo['id']];
         } elseif ($detailInfo['id'] == 'post_template') {
             $detailInfo['value'] = '{$user.CompanyName}: {$listing.Title} ({$listing.' . $locationPrefix . '.City}, {$listing.' . $locationPrefix . '.State})';
         }
         $this->properties[$detailInfo['id']] = new SJB_ObjectProperty($detailInfo);
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:32,代码来源:LinkedInSocialDetails.php

示例3: execute

 public function execute()
 {
     $listing_field = new SJB_ListingField($_REQUEST);
     /**
      * add infilll instructions field
      */
     //$listing_field->addInfillInstructions(SJB_Request::getVar('instructions'));
     $template_processor = SJB_System::getTemplateProcessor();
     $add_listing_field_form = new SJB_Form($listing_field);
     $add_listing_field_form->registerTags($template_processor);
     $form_is_submitted = isset($_REQUEST['action']) && $_REQUEST['action'] == 'add';
     $errors = null;
     $pages = SJB_PostingPagesManager::getFirstPageEachListingType();
     if ($form_is_submitted && $add_listing_field_form->isDataValid($errors)) {
         $pages = SJB_PostingPagesManager::getFirstPageEachListingType();
         SJB_ListingFieldManager::saveListingField($listing_field, $pages);
         $listing_sid = $listing_field->getSID();
         SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . "/attention-listing-type-field/?listing_sid={$listing_sid}");
     } else {
         $pagesNum = SJB_PostingPagesManager::getNumAllPages();
         $pageCount = 0;
         foreach ($pagesNum as $val) {
             if ($val['num'] > 1) {
                 $pageCount = 1;
             }
         }
         $template_processor->assign("pageCount", $pageCount);
         $template_processor->assign("errors", $errors);
         $add_listing_field_form->registerTags($template_processor);
         $template_processor->assign("form_fields", $add_listing_field_form->getFormFieldsInfo());
         $template_processor->display("add_listing_field.tpl");
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:33,代码来源:add_listing_field.php

示例4: 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

示例5: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $action = SJB_Request::getVar('action');
     $api = SJB_Request::getVar('api', false);
     $request = $_REQUEST;
     unset($request['action']);
     switch ($action) {
         case 'header':
             $test = $tp->fetch("header.tpl");
             echo $test;
             exit;
             break;
         case 'simplyHired':
             SJB_Statistics::addStatistics('partneringSites');
             break;
         default:
             $isIPhone = false;
             if (class_exists('MobilePlugin')) {
                 $isIPhone = MobilePlugin::isPhone();
             }
             $url = SJB_Request::getVar('url');
             $url = $url ? base64_decode($url) : '';
             if (str_replace('www.', '', $_SERVER['HTTP_HOST']) === SJB_Settings::getValue('mobile_url') || SJB_Settings::getValue('detect_iphone') && $isIPhone) {
                 $url = str_replace('viewjob', 'm/viewjob', $url);
             }
             SJB_Statistics::addStatistics('partneringSites');
             if ($api && $api == 'indeed') {
                 SJB_HelperFunctions::redirect($url);
             }
             $tp->assign('url', $url);
             $tp->display("partnersite.tpl");
             break;
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:35,代码来源:partnersite.php

示例6: SJB_FacebookSocialDetails

 public function SJB_FacebookSocialDetails($info)
 {
     $this->commonFields = parent::getCommonFields();
     $this->postingFields = self::getPostingFields();
     $this->systemFields = self::getSystemFields();
     $detailsInfo = self::getDetails($this->commonFields);
     $sortArray = array();
     $locationPrefix = '';
     foreach ($detailsInfo as $index => $propertyInfo) {
         $sortArray[$index] = $propertyInfo['order'];
         if ($propertyInfo['type'] == 'location') {
             $locationPrefix = $propertyInfo['id'];
         }
     }
     $sortArray = SJB_HelperFunctions::array_sort($sortArray);
     foreach ($sortArray as $index => $value) {
         $sortedDetailsInfo[$index] = $detailsInfo[$index];
     }
     foreach ($sortedDetailsInfo as $detailInfo) {
         $detailInfo['value'] = '';
         $accountID = SJB_Request::getVar('account_id', false);
         if (isset($info[$detailInfo['id']])) {
             $detailInfo['value'] = $info[$detailInfo['id']];
         } elseif ($detailInfo['id'] == 'hash_tags') {
             $detailInfo['value'] = '#Jobs';
         } elseif ($detailInfo['id'] == 'post_template') {
             $detailInfo['value'] = '{$user.CompanyName}: {$listing.Title} ({$listing.' . $locationPrefix . '.City}, {$listing.' . $locationPrefix . '.State})';
         } elseif (isset($accountID) && $detailInfo['id'] == 'account_id') {
             $detailInfo['value'] = $accountID;
         }
         $this->properties[$detailInfo['id']] = new SJB_ObjectProperty($detailInfo);
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:33,代码来源:FacebookSocialDetails.php

示例7: 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

示例8: 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');
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:35,代码来源:private_messages_read.php

示例9: init

 public function init()
 {
     $this->cleanSessionData(self::$network);
     $error = SJB_Request::getVar('error', false);
     if ($error && $error == 'access_denied') {
         SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL'));
     }
     if (isset($_GET['code'])) {
         $this->initialize();
         $googlePlusService = new Google_PlusService(self::$object);
         $oauth2 = new Google_Oauth2Service(self::$object);
         self::$object->authenticate($_GET['code']);
         $_SESSION['access_token'] = self::$object->getAccessToken();
         if (!empty($_SESSION['access_token'])) {
             self::$oProfile = self::getProfileInformation($googlePlusService, $oauth2);
             if (self::$oProfile) {
                 $this->flagSocialPluginInSession(self::$network);
                 self::$oSocialPlugin = $this;
                 $this->redirectToRegistrationSocialPage();
             }
         }
     }
     if (is_null(self::$object) && empty($_SESSION['sn']['authorized'])) {
         $this->initialize();
         $authUrl = self::$object->createAuthUrl();
         SJB_HelperFunctions::redirect($authUrl);
     } elseif (self::$oProfile && !parent::ifUserIsRegistered(self::$network)) {
         $this->redirectToRegistrationSocialPage();
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:30,代码来源:google_plus_integration_plugin.php

示例10: execute

 public function execute()
 {
     set_time_limit(0);
     $notifiedEmails = array();
     $emailScheduling = SJB_Settings::getSettingByName('email_scheduling');
     $numberEmails = SJB_Settings::getSettingByName('number_emails');
     $emailsSend = SJB_Settings::getSettingByName('send_emails');
     $limit = $numberEmails - $emailsSend;
     $limit = $limit > 0 ? $limit : 20;
     $letters = SJB_DB::query('SELECT * FROM `email_scheduling` ORDER BY `id` ASC LIMIT 0, ?n', $limit);
     if ($emailScheduling && $numberEmails || count($letters)) {
         foreach ($letters as $letter) {
             $params = $letter;
             unset($params['id']);
             $email = new SJB_Email($params['email']);
             $email->setSubject($params['subject']);
             $email->setText($params['text']);
             $email->setFile($params['file']);
             if ($email->send(true)) {
                 SJB_DB::query('DELETE FROM `email_scheduling` WHERE `id` = ?n', $letter['id']);
                 array_push($notifiedEmails, $params['email']);
             }
         }
     }
     $tp = SJB_System::getTemplateProcessor();
     $tp->assign('notified_emails', $notifiedEmails);
     $schedulerLog = $tp->fetch('email_scheduler_log.tpl');
     SJB_HelperFunctions::writeCronLogFile('email_scheduler.log', $schedulerLog);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:29,代码来源:email_scheduling.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();
     $user = SJB_UserManager::getUserInfoBySID(SJB_Request::getVar('user_sid', 0, SJB_Request::METHOD_GET));
     $user_id = $user['sid'];
     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));
     $per_page = 10;
     $total = SJB_PrivateMessage::getTotalOutbox($user_id);
     $max_pages = ceil($total / $per_page);
     if ($max_pages == 0) {
         $max_pages = 1;
     }
     if ($max_pages < $page) {
         SJB_HelperFunctions::redirect("?user_sid={$user_id}&page={$max_pages}");
     }
     $navigate = SJB_PrivateMessage::getNavigate($page, $total, $per_page);
     $list = SJB_PrivateMessage::getListOutbox($user_id, $page, $per_page);
     $userGroupInfo = SJB_UserGroupManager::getUserGroupInfoBySID($user['user_group_sid']);
     SJB_System::setGlobalTemplateVariable('wikiExtraParam', $userGroupInfo['id']);
     $tp->assign("user_group_info", $userGroupInfo);
     $tp->assign('username', $user['username']);
     $tp->assign('user_sid', $user_id);
     $tp->assign('message', $list);
     $tp->assign('navigate', $navigate);
     $tp->assign('page', $page);
     $tp->display('pm_outbox.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:31,代码来源:pm_outbox.php

示例13: 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

示例14: execute

 public function execute()
 {
     $user_group = new SJB_UserGroup($_REQUEST);
     $add_user_group_form = new SJB_Form($user_group);
     $form_is_submitted = isset($_REQUEST['action']) && $_REQUEST['action'] == 'add';
     $errors = null;
     $tp = SJB_System::getTemplateProcessor();
     if ($form_is_submitted && $add_user_group_form->isDataValid($errors)) {
         SJB_UserGroupManager::saveUserGroup($user_group);
         $page = array('uri' => '/' . mb_strtolower($user_group->getPropertyValue('id'), 'UTF-8') . '-products/', 'module' => 'payment', 'function' => 'user_products', 'access_type' => 'user', 'parameters' => 'userGroupID=' . $user_group->getID());
         $userPage = new SJB_UserPage();
         $page_data = SJB_UserPage::extractPageData($page);
         $userPage->setPageData($page_data);
         $userPage->save();
         $this->addLocationField($user_group->getSID());
         SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . "/user-groups/");
     } else {
         $add_user_group_form->registerTags($tp);
         $tp->assign('notifications', $user_group->getNotifications());
         $tp->assign('notificationGroups', $user_group->getNotificationsGroups());
         $tp->assign('form_fields', $add_user_group_form->getFormFieldsInfo());
         $tp->assign('errors', $errors);
         $tp->display('add_user_group.tpl');
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:25,代码来源:add_user_group.php

示例15: execute

 public function execute()
 {
     ini_set('max_execution_time', 0);
     $tp = SJB_System::getTemplateProcessor();
     $userGroupID = SJB_Request::getVar('user_group_id', 0);
     $user = SJB_UsersExportController::createUser($userGroupID);
     $searchFormBuilder = new SJB_SearchFormBuilder($user);
     $criteria = $searchFormBuilder->extractCriteriaFromRequestData($_REQUEST, $user);
     $searchFormBuilder->registerTags($tp);
     $searchFormBuilder->setCriteria($criteria);
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $exportProperties = SJB_Request::getVar('export_properties', array());
         if (empty($exportProperties)) {
             SJB_FlashMessages::getInstance()->addWarning('EMPTY_EXPORT_PROPERTIES');
         } else {
             $innerJoin = false;
             if (isset($_REQUEST['product']['multi_like']) && $_REQUEST['product']['multi_like'] != '') {
                 $products = $_REQUEST['product']['multi_like'];
                 if (is_array($products)) {
                     $products = implode(',', $products);
                 }
                 $whereParam = implode(',', explode(',', SJB_DB::quote($products)));
                 $innerJoin = array('contracts' => array('join_field' => 'user_sid', 'join_field2' => 'sid', 'join' => 'INNER JOIN', 'where' => "AND FIND_IN_SET(`contracts`.`product_sid`, '{$whereParam}')"));
                 unset($criteria['system']['product']);
             }
             $searcher = new SJB_UserSearcher(false, 'parent_sid', 'ASC', $innerJoin);
             $searchAliases = SJB_UsersExportController::getSearchPropertyAliases();
             $foundUsersSid = $searcher->getObjectsSIDsByCriteria($criteria, $searchAliases);
             if (!empty($foundUsersSid)) {
                 $result = SJB_UsersExportController::createExportDirectories();
                 if ($result === true) {
                     $exportProperties['extUserID'] = 1;
                     $exportProperties['parent_sid'] = 1;
                     $exportAliases = SJB_UsersExportController::getExportPropertyAliases();
                     $exportData = SJB_UsersExportController::getExportData($foundUsersSid, $exportProperties, $exportAliases);
                     $fileName = 'users.xls';
                     SJB_UsersExportController::makeExportFile($exportData, $fileName);
                     if (!file_exists(SJB_System::getSystemSettings('EXPORT_FILES_DIRECTORY') . "/{$fileName}")) {
                         SJB_FlashMessages::getInstance()->addWarning('CANT_CREATE_EXPORT_FILES');
                     } else {
                         SJB_HelperFunctions::redirect(SJB_System::getSystemSettings("SITE_URL") . "/users/archive-and-send-export-data/");
                     }
                 }
             } else {
                 SJB_FlashMessages::getInstance()->addWarning('EMPTY_EXPORT_DATA');
             }
         }
     }
     $userSystemProperties = SJB_UserManager::getAllUserSystemProperties();
     $userGroups = SJB_UserGroupManager::getAllUserGroupsInfo();
     $userCommonProperties = array();
     foreach ($userGroups as $userGroup) {
         $userGroupProperties = SJB_UserProfileFieldManager::getFieldsInfoByUserGroupSID($userGroup['sid']);
         $userCommonProperties[$userGroup['id']] = $userGroupProperties;
     }
     $tp->assign('userSystemProperties', $userSystemProperties);
     $tp->assign('userCommonProperties', $userCommonProperties);
     $tp->assign('selected_user_group_id', $userGroupID);
     $tp->display('export_users.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:60,代码来源:export_users.php


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