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


PHP SJB_System::setGlobalTemplateVariable方法代码示例

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


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

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

示例2: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $errors = array();
     $listing_id = SJB_Request::getVar('listing_id', null);
     $listingInfo = SJB_ListingManager::getListingInfoBySID($listing_id);
     $listingTypeInfo = SJB_ListingTypeManager::getListingTypeInfoBySID($listingInfo['listing_type_sid']);
     $display_form = new SJB_Form();
     $display_form->registerTags($tp);
     if (is_null($listing_id)) {
         $errors['LISTING_ID_DOESNOT_SPECIFIED'] = $listing_id;
     } else {
         $listing = SJB_ListingManager::getObjectBySID($listing_id);
         $filename = SJB_Request::getVar('filename', false);
         if ($filename) {
             $file = SJB_UploadFileManager::openFile($filename, $listing_id);
             $errors['NO_SUCH_FILE'] = true;
         }
         if (!empty($listing)) {
             $listing->addPicturesProperty();
             if ($listing->listing_type_sid == 6) {
                 $listing->deleteProperty('access_type');
                 $listing->deleteProperty('anonymous');
             }
             $access_type_properties = $listing->getProperty('access_type');
             $tp->assign('access_type_properties', $access_type_properties);
             $listing_structure = SJB_ListingManager::createTemplateStructureForListing($listing);
             $tp->assign("listing", $listing_structure);
             $display_form = new SJB_Form($listing);
             $display_form->registerTags($tp);
             $form_fields = $display_form->getFormFieldsInfo();
             $tp->assign("form_fields", $form_fields);
             $waitApprove = SJB_ListingTypeManager::getWaitApproveSettingByListingType($listing->listing_type_sid);
             $tp->assign('wait_approve', $waitApprove);
         } else {
             $errors['LISTING_DOESNOT_EXIST'] = $listing_id;
         }
     }
     $comments = SJB_CommentManager::getEnabledCommentsToListing($listing_id);
     $comments_total = count($comments);
     $rate = SJB_Rating::getRatingNumToListing($listing_id);
     $displayTemplate = SJB_Request::getVar('display_template', 'display_listing.tpl');
     $videoFileId = SJB_Request::getVar('videoFileId', false);
     if ($videoFileId) {
         $videoFileLink = SJB_UploadFileManager::getUploadedFileLink($videoFileId);
         $tp->assign('videoFileLink', $videoFileLink);
     }
     $tp->assign('listingType', SJB_ListingTypeManager::createTemplateStructure($listingTypeInfo));
     $tp->assign('errors', $errors);
     $tp->assign('comments_total', $comments_total);
     $tp->assign('rate', $rate);
     SJB_System::setGlobalTemplateVariable('wikiExtraParam', $listingTypeInfo['id']);
     $tp->display($displayTemplate);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:54,代码来源:display_listing.php

示例3: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $user = SJB_UserManager::getUserInfoBySID(SJB_Request::getVar('user_sid'));
     $user_id = $user['sid'];
     $total_in = SJB_PrivateMessage::getTotalInbox($user_id);
     $total_out = SJB_PrivateMessage::getTotalOutbox($user_id);
     $userGroupInfo = SJB_UserGroupManager::getUserGroupInfoBySID($user['user_group_sid']);
     SJB_System::setGlobalTemplateVariable('wikiExtraParam', $userGroupInfo['id']);
     $tp->assign('username', $user['username']);
     $tp->assign("user_group_info", $userGroupInfo);
     $tp->assign('user_sid', $user_id);
     $tp->assign('total_in', $total_in);
     $tp->assign('total_out', $total_out);
     $tp->display('main.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:16,代码来源:pm.php

示例4: getPage

 /**
  * 
  * @param SJB_PageConfig $page_config
  */
 public static function getPage($page_config)
 {
     SJB_System::setPageTitle($page_config->getPageTitle());
     SJB_System::setGlobalTemplateVariable('user_page_uri', $page_config->getPageUri());
     SJB_System::setPageKeywords($page_config->getPageKeywords());
     SJB_System::setPageDescription($page_config->getPageDescription());
     if ($page_config->getMainContentFunction() == 'add_listing') {
         $passed_parameters_via_uri = SJB_Request::getVar('passed_parameters_via_uri', false);
         if ($passed_parameters_via_uri) {
             $passed_parameters_via_uri = SJB_UrlParamProvider::getParams();
             if (isset($passed_parameters_via_uri[2])) {
                 $page_config->setMainContentFunction('add_listing_step');
             }
         }
     }
     $maincontent = SJB_System::executeFunction($page_config->getMainContentModule(), $page_config->getMainContentFunction(), $page_config->getParameters(), $page_config->getPageUri());
     if ($page_config->hasRawOutput()) {
         return $maincontent;
     }
     $page_templates_set_name = SJB_System::getSystemSettings('PAGE_TEMPLATES_MODULE_NAME');
     $template_supplier = new SJB_TemplateSupplier($page_templates_set_name);
     $tp = new SJB_TemplateProcessor($template_supplier);
     // assign 'highlight_templates' variable to main or index template
     if (SJB_Settings::getSettingByName('highlight_templates') == 1 && SJB_Request::getVar('admin_mode', false, 'COOKIE')) {
         $tp->assign('highlight_templates', true);
     }
     if ($errors = SJB_Error::getErrorContent()) {
         SJB_FlashMessages::getInstance()->addWarning($errors);
     }
     $tp->assign('MAIN_CONTENT', $maincontent);
     $tp->registerGlobalVariables();
     $tp->assign('sjb_version', SJB_System::getSystemSettings('SJB_VERSION'));
     $template = $page_config->getPageTemplate();
     $template_supplier->addContainerTemplate($template);
     if (SJB_Request::isAjax()) {
         $template = SJB_System::getSettingByName('default_page_template_by_http');
     } elseif (SJB_FormBuilderManager::getIfBuilderModeIsSet()) {
         $template = 'index_b.tpl';
     } else {
         if (empty($template)) {
             $template = SJB_Settings::getSettingByName('DEFAULT_PAGE_TEMPLATE');
         }
     }
     return $tp->fetch($template);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:49,代码来源:PageConstructor.php

示例5: isAccessible

 public function isAccessible()
 {
     switch (SJB_Request::getVar('type')) {
         case 'user':
             $userSid = SJB_Request::getVar('role', null);
             $userGroupID = SJB_UserGroupManager::getUserGroupIDByUserSID($userSid);
             SJB_System::setGlobalTemplateVariable('wikiExtraParam', $userGroupID);
             $this->setPermissionLabel('manage_' . strtolower($userGroupID));
             break;
         case 'group':
             $this->setPermissionLabel('manage_user_groups_permissions');
             break;
         case 'product':
             $this->setPermissionLabel('manage_products');
             break;
     }
     return parent::isAccessible();
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:18,代码来源:acl.php

示例6: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $action = SJB_Request::getVar('action', '', SJB_Request::METHOD_GET);
     $mess_id = intval(SJB_Request::getVar('mess', 0, SJB_Request::METHOD_GET));
     $return_to = SJB_Request::getVar('from', 'in', SJB_Request::METHOD_GET);
     $page = intval(SJB_Request::getVar('page', 1, SJB_Request::METHOD_GET));
     $user = SJB_UserManager::getUserInfoBySID(SJB_Request::getVar('user_sid'));
     $user_id = $user['sid'];
     if ($action == 'delete') {
         SJB_DB::query("DELETE FROM `private_message` WHERE `id` = '{$mess_id}'");
         $per_page = 10;
         if ($return_to == 'in') {
             $total = SJB_PrivateMessage::getTotalInbox($user_id);
         } else {
             $total = SJB_PrivateMessage::getTotalOutbox($user_id);
         }
         $max_pages = ceil($total / $per_page);
         if ($max_pages == 0) {
             $max_pages = 1;
         }
         if ($max_pages < $page) {
             $page = $max_pages;
         }
         $site_url = SJB_System::getSystemSettings('SITE_URL');
         SJB_HelperFunctions::redirect($site_url . '/private-messages/pm-' . ($return_to == 'in' ? 'inbox' : 'outbox') . "/?user_sid={$user_id}&page={$page}");
     }
     $message = SJB_PrivateMessage::ReadMessage($mess_id, true);
     $userGroupInfo = SJB_UserGroupManager::getUserGroupInfoBySID($user['user_group_sid']);
     SJB_System::setGlobalTemplateVariable('wikiExtraParam', $userGroupInfo['id']);
     $tp->assign("user_group_info", $userGroupInfo);
     $tp->assign('returt_to', $return_to);
     $tp->assign('username', $user['username']);
     $tp->assign('user_sid', $user_id);
     $tp->assign('message', $message);
     $tp->assign('page', $page);
     $tp->display('pm_read.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:38,代码来源:pm_read.php

示例7: deleteLanguage

 function deleteLanguage($lang_id)
 {
     if ($this->admin->deleteLanguage($lang_id)) {
         if ($lang_id == $this->context->getLang()) {
             $defaultLang = $this->context->getDefaultLang();
             $this->context->setLang($defaultLang);
             SJB_System::setGlobalTemplateVariable('current_language', $defaultLang);
         }
         return true;
     }
     return false;
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:12,代码来源:I18N.php

示例8: _tpl_breadcrumbs

 function _tpl_breadcrumbs($params, $content)
 {
     SJB_System::setGlobalTemplateVariable('ADMIN_BREADCRUMBS', $content, false);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:4,代码来源:TemplateProcessor.php

示例9: microtime

<?php

$timeBegin = microtime(true);
error_reporting(-1);
ini_set('display_errors', 'on');
define('PATH_TO_SYSTEM_CLASS', '../system/core/System.php');
$DEBUG = array();
$PATH_BASE = str_replace('/admin', '', dirname(__FILE__));
require_once PATH_TO_SYSTEM_CLASS;
define('SJB_BASE_DIR', realpath(dirname(__FILE__) . "/..") . '/');
SJB_System::loadSystemSettings('../system/admin-config/DefaultSettings.php');
SJB_System::loadSystemSettings('../config.php');
$GLOBALS['system_settings']['USER_SITE_URL'] = $GLOBALS['system_settings']['SITE_URL'];
$GLOBALS['system_settings']['SITE_URL'] = $GLOBALS['system_settings']['ADMIN_SITE_URL'];
// load installed SJB version info
SJB_System::setGlobalTemplateVariable('version', SJB_System::getSystemSettings('version'));
SJB_System::boot();
SJB_System::init();
if (SJB_Profiler::getInstance()->isProfilerEnable()) {
    SJB_Profiler::getInstance()->setStartTime($timeBegin);
}
// bind send notification emails if listing deactivated/deleted
SJB_Event::handle('listingDeactivated', array('SJB_Notifications', 'notifyOnUserListingDeactivated'));
SJB_Event::handle('beforeListingDelete', array('SJB_Notifications', 'notifyOnUserListingDeleted'));
// bind send notification emails if user deactivated/deleted
SJB_Event::handle('onBeforeUserDelete', array('SJB_Notifications', 'notifyOnUserDeleted'));
SJB_Event::handle('onBeforeUserDeactivate', array('SJB_Notifications', 'notifyOnUserDeactivated'));
SJB_Request::getInstance()->execute();
SJB_HelperFunctions::debugInfoPrint();
开发者ID:Maxlander,项目名称:shixi,代码行数:29,代码来源:index.php

示例10: getCurrentTheme

 public static function getCurrentTheme($accessType = false)
 {
     $i18n = SJB_I18N::getInstance();
     $i18n->switchLang();
     $activeLanguagesData = $i18n->getActiveLanguagesData();
     $currentLanguage = $i18n->getCurrentLanguage();
     $currentLanguageData = null;
     foreach ($activeLanguagesData as $activeLanguageData) {
         if ($activeLanguageData['id'] == $currentLanguage) {
             $currentLanguageData = $activeLanguageData;
         }
     }
     SJB_System::setGlobalTemplateVariable('languages', $activeLanguagesData);
     SJB_System::setGlobalTemplateVariable('current_language', $currentLanguage);
     SJB_System::setGlobalTemplateVariable('current_language_data', $currentLanguageData);
     $arr = glob(SJB_BASE_DIR . 'system/ext/jquery/datepicker/i18n/jquery.ui.datepicker-*.js');
     if (is_array($arr) && !empty($arr)) {
         $available_datepicker_localizations = array();
         foreach ($arr as $item) {
             $matches = array();
             if (!preg_match('/datepicker-([a-zA-Z0-9-]+).js$/', $item, $matches)) {
                 continue;
             }
             $available_datepicker_localizations[$matches[1]] = $matches[1];
         }
         SJB_System::setGlobalTemplateVariable('available_datepicker_localizations', $available_datepicker_localizations);
     }
     $theme = null;
     if (SJB_System::getSystemSettings('SYSTEM_ACCESS_TYPE') == 'admin') {
         if ($accessType === false || $accessType === 'admin') {
             return SJB_System::getSystemSettings('SYSTEM_TEMPLATE_DIR') . '/admin';
         }
     } else {
         if (isset($_GET['theme'])) {
             $theme = $_GET['theme'];
             if (strtolower($theme) == 'mobile') {
                 $theme = 'mobile';
             }
             SJB_Session::setValue('theme', $theme);
         }
     }
     if (!ThemeManager::isThemeExists($theme, $accessType)) {
         $theme = SJB_Session::getValue('theme');
         if (empty($theme) || !ThemeManager::isThemeExists($theme, $accessType)) {
             $theme = SJB_Settings::getSettingByName('CURRENT_THEME');
             if (!ThemeManager::isThemeExists($theme, $accessType)) {
                 $theme = SJB_System::getSystemSettings('DEFAULT_THEME');
             }
         }
     }
     SJB_Event::dispatch('GetCurrentTheme', $theme, true);
     SJB_Session::setValue('CURRENT_THEME', $theme);
     return $theme;
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:54,代码来源:TemplateSupplier.php

示例11: init

 public static function init()
 {
     SJB_DB::init(SJB_System::getSystemSettings('DBHOST'), SJB_System::getSystemSettings('DBUSER'), SJB_System::getSystemSettings('DBPASSWORD'), SJB_System::getSystemSettings('DBNAME'));
     ini_set('zlib.output_compression', SJB_System::getSettingByName('gzip_compression'));
     $GLOBALS['fatal_error_reserve_buffer'] = str_repeat('x', 1024 * 200);
     ob_start(array('SJB_Error', 'fatalErrorHandler'));
     SJB_Session::init(SJB_System::getSystemSettings('SITE_URL'));
     $sessionId = SJB_DB::queryValue("SELECT `session_id` FROM `user_session_data_storage` WHERE `session_id` = ?s", SJB_Session::getSessionId());
     // if not updated (row not exists) - insert that value
     if (empty($sessionId)) {
         SJB_DB::query("INSERT INTO `user_session_data_storage` SET `last_activity` = NOW(), `session_id` = ?s", SJB_Session::getSessionId());
     } else {
         SJB_DB::query("UPDATE `user_session_data_storage` SET `last_activity` = NOW() WHERE `session_id` = ?s", $sessionId);
     }
     //set timezone
     if (SJB_Settings::getSettingByName('timezone')) {
         ini_set('date.timezone', SJB_Settings::getSettingByName('timezone'));
     }
     // Set Error Handler and Shutdown function
     set_error_handler(array('SJB_Error', 'errorHandler'));
     register_shutdown_function(array('SJB_System', 'shutdownFunction'));
     SJB_System::prepareGlobalArrays();
     SJB_System::setGlobalTemplateVariable('is_ajax', SJB_Request::isAjax());
     SJB_System::setGlobalTemplateVariable('site_url', SJB_System::getSystemSettings('SITE_URL'));
     SJB_System::setGlobalTemplateVariable('user_site_url', SJB_System::getSystemSettings('USER_SITE_URL'));
     SJB_System::setGlobalTemplateVariable('admin_site_url', SJB_System::getSystemSettings('ADMIN_SITE_URL'));
     SJB_System::setGlobalTemplateVariable('radius_search_unit', SJB_System::getSettingByName('radius_search_unit'));
     SJB_System::setGlobalTemplateVariable('settings', SJB_Settings::getSettings());
     ThemeManager::getCurrentTheme();
     SJB_PluginManager::loadPlugins(SJB_System::getSystemSettings('PLUGINS_DIR'));
     SJB_System::setGlobalTemplateVariable('plugins', SJB_PluginManager::getAllPluginsList());
     $GLOBALS['System']['MODULE_MANAGER'] = new SJB_ModuleManager();
     SJB_Event::dispatch('moduleManagerCreated');
     $GLOBALS['System']['MODULE_MANAGER']->executeModulesStartupFunctions();
     // define if subadmin loged in and set subamdinmode for templates
     if (SJB_System::getSystemSettings('SYSTEM_ACCESS_TYPE') == SJB_System::getSystemSettings('ADMIN_ACCESS_TYPE') && SJB_SubAdmin::getSubAdminSID()) {
         SJB_System::setGlobalTemplateVariable('subAdminSID', SJB_SubAdmin::getSubAdminSID());
     }
     $GLOBALS['uri'] = SJB_Navigator::getURI();
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:40,代码来源:System.php

示例12: execute


//.........这里部分代码省略.........
                 $user->deleteProperty('password');
             }
             SJB_UserManager::saveUser($user);
             // >>> SJB-1197
             // needs to check session for ajax-uploaded files, and set it to user profile
             $tmpUploadsStorage = SJB_Session::getValue('tmp_uploads_storage');
             $formToken = SJB_Request::getVar('form_token');
             if (!empty($formToken)) {
                 $tmpUploadedFields = SJB_Array::getPath($tmpUploadsStorage, $formToken);
                 if (!is_null($tmpUploadsStorage) && is_array($tmpUploadedFields)) {
                     // prepare user profile fields array
                     $userProfileFieldsInfo = SJB_UserProfileFieldManager::getAllFieldsInfo();
                     $userProfileFields = array();
                     foreach ($userProfileFieldsInfo as $field) {
                         $userProfileFields[$field['id']] = $field;
                     }
                     // look for temporary values
                     foreach ($tmpUploadedFields as $fieldId => $fieldInfo) {
                         // check field ID for valid ID in user profile fields
                         if (!array_key_exists($fieldId, $userProfileFields) || empty($fieldInfo)) {
                             continue;
                         }
                         $fieldType = $userProfileFields[$fieldId]['type'];
                         $profilePropertyId = $fieldId . '_' . $user->getSID();
                         switch (strtolower($fieldType)) {
                             case 'video':
                             case 'file':
                                 // change temporary file ID
                                 SJB_DB::query("UPDATE `uploaded_files` SET `id` = ?s WHERE `id` = ?s", $profilePropertyId, $fieldInfo['file_id']);
                                 // set value of user property to new uploaded file
                                 $user->setPropertyValue($fieldId, $profilePropertyId);
                                 break;
                             case 'logo':
                                 // change temporary file ID and thumb ID
                                 SJB_DB::query("UPDATE `uploaded_files` SET `id` = ?s WHERE `id` = ?s", $profilePropertyId, $fieldInfo['file_id']);
                                 SJB_DB::query("UPDATE `uploaded_files` SET `id` = ?s WHERE `id` = ?s", $profilePropertyId . '_thumb', $fieldInfo['file_id'] . '_thumb');
                                 // set value of user property to new uploaded file
                                 $user->setPropertyValue($fieldId, $profilePropertyId);
                                 break;
                             default:
                                 break;
                         }
                         $tmpUploadsStorage = SJB_Array::unsetValueByPath($tmpUploadsStorage, "{$formToken}/{$fieldId}");
                     }
                     // and save user with new fields data
                     SJB_UserManager::saveUser($user);
                     SJB_Authorization::updateCurrentUserSession();
                     // clean temporary storage
                     $tmpUploadsStorage = SJB_Array::unsetValueByPath($tmpUploadsStorage, "{$formToken}");
                     // CLEAR TEMPORARY SESSION STORAGE
                     SJB_Session::setValue('tmp_uploads_storage', $tmpUploadsStorage);
                 }
             }
             // <<< SJB-1197
             if (SJB_Request::isAjax()) {
                 echo "<p class=\"green\">User Saved</p>";
                 exit;
             }
             if ($form_submitted == 'save_info') {
                 $userGroupInfo = SJB_UserGroupManager::getUserGroupInfoBySID($user_info['user_group_sid']);
                 SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . "/manage-users/" . mb_strtolower($userGroupInfo['id'], 'utf8'));
             }
             if (!empty($properties)) {
                 $user->details->properties = $properties;
             }
         }
         if (SJB_UserGroupManager::isUserEmailAsUsernameInUserGroup($user_info['user_group_sid'])) {
             $user->deleteProperty("username");
         }
         $listingTypes = SJB_ListingTypeManager::getAllListingTypesInfo();
         $products = SJB_ProductsManager::getProductsInfoByUserGroupSID($user_info['user_group_sid']);
         $allowedListingTypes = array();
         foreach ($products as $product) {
             if (!empty($product['listing_type_sid']) && empty($allowedListingTypes[$product['listing_type_sid']])) {
                 foreach ($listingTypes as $listingType) {
                     if ($product['listing_type_sid'] == $listingType['sid']) {
                         $allowedListingTypes[$product['listing_type_sid']] = $listingType;
                     }
                 }
             }
         }
         $edit_user_form = SJB_ObjectMother::createForm($user);
         $edit_user_form->registerTags($tp);
         $userGroupInfo = SJB_UserGroupManager::getUserGroupInfoBySID($user_info['user_group_sid']);
         if (SJB_UserManager::checkBan($errors, $user_info['ip'])) {
             $user_info['ip_is_banned'] = 1;
         }
         $tp->assign("form_fields", $edit_user_form->getFormFieldsInfo());
         $tp->assign("uploadMaxFilesize", SJB_UploadFileManager::getIniUploadMaxFilesize());
         $tp->assign("errors", $errors);
         $tp->assign("listingTypes", $allowedListingTypes);
         $tp->assign("user_info", $user_info);
         $tp->assign("user_group_info", $userGroupInfo);
         $tp->assign('userTree', true);
         $tp->assign("parent_name", $parent_name);
         $tp->assign("restore", preg_match('/manage-(jobseekers)|(employers)|([a-z0-9\\_]-users)/', SJB_Request::getVar('HTTP_REFERER', '', 'SERVER')));
         SJB_System::setGlobalTemplateVariable('wikiExtraParam', $userGroupInfo['id']);
         $tp->display("edit_user.tpl");
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:101,代码来源:edit_user.php

示例13: execute


//.........这里部分代码省略.........
             $data = $cache->load($hash);
             $geoCod = '';
             if (!$data) {
                 try {
                     $geoCod = SJB_HelperFunctions::getUrlContentByCurl("http://maps.googleapis.com/maps/api/geocode/json?address={$address}&sensor=false");
                     $geoCod = json_decode($geoCod);
                     if ($geoCod->status == 'OK') {
                         $cache->save($geoCod, $hash);
                     }
                 } catch (Exception $e) {
                     $backtrace = SJB_Logger::getBackTrace();
                     SJB_Error::writeToLog(array(array('level' => 'E_USER_WARNING', 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'backtrace' => sprintf("BACKTRACE:\n [%s]", join("<br/>\n", $backtrace)))));
                 }
             } else {
                 $geoCod = $data;
             }
             try {
                 if (!is_object($geoCod)) {
                     throw new Exception("Map object nave not been Created");
                 }
                 if ($geoCod->status !== 'OK') {
                     throw new Exception("Status is not OK");
                 }
                 $location = $geoCod->results[0]->geometry->location;
                 $listing_structure['latitude'] = $location->lat;
                 $listing_structure['longitude'] = $location->lng;
             } catch (Exception $e) {
                 $backtrace = SJB_Logger::getBackTrace();
                 SJB_Error::writeToLog(array(array('level' => 'E_USER_WARNING', 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'backtrace' => sprintf("BACKTRACE:\n [%s]", join("<br/>\n", $backtrace)))));
             }
         }
         if (SJB_Request::getVar('view')) {
             $tp->assign('listings', array($listing_structure));
         }
         $tp->filterThenAssign("listing", $listing_structure);
         $tp->assign("prev_next_ids", $prevNextIds);
         $tp->assign("searchId", $searchId);
         $tp->assign("page", $page);
         $tp->filterThenAssign("search_criteria", $search_criteria_structure);
         $tp->filterThenAssign("search_uri", $criteria_saver->getUri());
         if ($field_id = SJB_Request::getVar('field_id')) {
             // SJB-825
             $complexEnum = SJB_Request::getVar('complexEnum', null, 'GET');
             $complexFieldID = SJB_Request::getVar('complexParent', null, 'GET');
             if (!is_null($complexEnum) && !is_null($complexFieldID)) {
                 $videoFileID = $complexFieldID . ':' . $field_id . ':' . $complexEnum . '_' . $listing_id;
                 $videoFileLink = SJB_UploadFileManager::getUploadedFileLink($videoFileID);
                 if ($videoFileLink) {
                     $tp->assign('videoFileLink', $videoFileLink);
                 }
             }
             // SJB-825
             $tp->assign('field_id', $field_id);
         } else {
             if (SJB_Request::getVar('action', false) == 'download_pdf_version') {
                 $formBuilder = SJB_FormBuilderManager::getFormBuilder(SJB_FormBuilderManager::FORM_BUILDER_TYPE_PDF, $listing_type_id);
                 $formBuilder->setChargedTemplateProcessor($tp);
                 $tpl = 'resume_to_pdf.tpl';
                 if ($listing_structure['anonymous'] == '1') {
                     $filename = 'Anonymous User_' . $listing_structure['Title'] . '.pdf';
                 } else {
                     $filename = $listing_structure['user']['FirstName'] . ' ' . $listing_structure['user']['LastName'] . '_' . $listing_structure['Title'] . '.pdf';
                 }
                 try {
                     $html = $tp->fetch($tpl);
                     $html = preg_replace('/<div[^>]*>/', '', $html);
                     $html = str_replace('</div>', '', $html);
                     SJB_HelperFunctions::html2pdf($html, $filename, str_replace('http://', '', SJB_HelperFunctions::getSiteUrl()));
                     exit;
                 } catch (Exception $e) {
                     SJB_Error::writeToLog($e->getMessage());
                     SJB_HelperFunctions::redirect(SJB_System::getSystemSettings("SITE_URL") . '/display-resume/' . $listing_id . '/?error=TCPDF_ERROR');
                 }
             } else {
                 $formBuilder = SJB_FormBuilderManager::getFormBuilder(SJB_FormBuilderManager::FORM_BUILDER_TYPE_DISPLAY, $listing_type_id);
                 $formBuilder->setChargedTemplateProcessor($tp);
             }
         }
     }
     if ($errors) {
         foreach ($errors as $k => $v) {
             switch ($k) {
                 case 'TCPDF_ERROR':
                 case 'UNDEFINED_LISTING_ID':
                 case 'WRONG_LISTING_ID_SPECIFIED':
                 case 'LISTING_IS_NOT_ACTIVE':
                 case 'LISTING_IS_NOT_APPROVED':
                     $header = $_SERVER['SERVER_PROTOCOL'] . ' 404  Not Found';
                     $header_status = "Status: 404  Not Found";
                     header($header_status);
                     header($header);
                     SJB_System::setGlobalTemplateVariable('page_not_found', true);
                     break;
             }
         }
     }
     $tp->assign('errors', $errors);
     $tp->assign('tcpdfError', $tcpdfError);
     $tp->display($template);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:101,代码来源:display_listing.php

示例14: execute


//.........这里部分代码省略.........
                 $orderInfo = false;
                 $sortByUsername = true;
                 break;
             case 'status':
                 $orderInfo = array('sorting_field' => 'status', 'sorting_order' => $order);
                 break;
             case 'company':
                 $orderInfo = array('sorting_field' => 'CompanyName', 'sorting_order' => $order, 'inner_join' => array('table' => 'listings', 'field1' => 'sid', 'field2' => 'listing_id'), 'inner_join2' => array('table1' => 'users', 'table2' => 'listings', 'field1' => 'sid', 'field2' => 'user_sid'));
                 break;
         }
     }
     if ($cu['user_group_sid'] == 41) {
         // Работадатель
         if (isset($_REQUEST['action'])) {
             switch ($_REQUEST['action']) {
                 case 'approve':
                     if (isset($_POST['applications'])) {
                         foreach ($_POST['applications'] as $key => $value) {
                             SJB_Applications::accept($key);
                         }
                     }
                     break;
                 case 'reject':
                     if (isset($_POST['applications'])) {
                         foreach ($_POST['applications'] as $key => $value) {
                             SJB_Applications::reject($key);
                         }
                     }
                     break;
                 case 'delete':
                     if (isset($_POST['applications'])) {
                         foreach ($_POST['applications'] as $key => $value) {
                             SJB_Applications::hideEmp($key);
                         }
                     }
                     break;
             }
         }
         if ($appJobId) {
             $apps = SJB_Applications::getByJob($appJobId, $orderInfo);
         } else {
             $apps = SJB_Applications::getByEmployer($cu['sid'], $orderInfo);
         }
         for ($i = 0; $i < count($apps); ++$i) {
             $apps[$i]['job'] = SJB_ListingManager::getListingInfoBySID($apps[$i]['listing_id']);
             if (isset($apps[$i]['resume']) && !empty($apps[$i]['resume'])) {
                 $apps[$i]['resumeInfo'] = SJB_ListingManager::getListingInfoBySID($apps[$i]['resume']);
             }
             if ($apps[$i]['jobseeker_id'] == 0) {
                 $apps[$i]['user']['FirstName'] = $apps[$i]['username'];
             } else {
                 $apps[$i]['user'] = SJB_UserManager::getUserInfoBySID($apps[$i]['jobseeker_id']);
             }
         }
         $jobs = SJB_ListingManager::getListingsByUserSID($cu['sid']);
         $appJobs = array();
         foreach ($jobs as $job) {
             $appJobs[] = array('title' => $job->details->properties['Title']->value, 'id' => $job->sid);
         }
         $tp->assign('appJobs', $appJobs);
         $tp->assign('current_filter', $appJobId);
     } else {
         // Соискатель
         if (SJB_Request::getVar('action', '', SJB_Request::METHOD_POST) == 'Delete selected') {
             if (isset($_POST['applications'])) {
                 foreach ($_POST['applications'] as $key => $value) {
                     SJB_Applications::hideJS($key);
                 }
             }
         }
         $apps = SJB_Applications::getByJobseeker($cu['sid'], $orderInfo);
         for ($i = 0; $i < count($apps); ++$i) {
             $apps[$i]['job'] = SJB_ListingManager::getListingInfoBySID($apps[$i]['listing_id']);
             $apps[$i]['company'] = SJB_UserManager::getUserInfoBySID($apps[$i]['job']['user_sid']);
         }
         $displayTemplate = 'view_seeker.tpl';
     }
     if (isset($sortByUsername)) {
         $order = $order == 'desc' ? SORT_DESC : SORT_ASC;
         foreach ($apps as $key => $value) {
             if (!isset($apps[$key]['user']['FirstName'])) {
                 $apps[$key]['user']['FirstName'] = '';
             }
             if (!isset($apps[$key]['user']['LastName'])) {
                 $apps[$key]['user']['LastName'] = '';
             }
             $sortKeys[$key] = $apps[$key]['user']['FirstName'] . ' ' . $apps[$key]['user']['LastName'];
         }
         if ($apps) {
             array_multisort($sortKeys, $order, SORT_REGULAR, $apps);
         }
     }
     $userGroupInfo = SJB_UserGroupManager::getUserGroupInfoBySID($cu['user_group_sid']);
     SJB_System::setGlobalTemplateVariable('wikiExtraParam', $userGroupInfo['id']);
     $tp->assign('METADATA', SJB_Application::getApplicationMeta());
     $tp->assign("user_group_info", $userGroupInfo);
     $tp->assign('applications', $apps);
     $tp->assign('errors', $errors);
     $tp->display($displayTemplate);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:101,代码来源:view.php

示例15: execute


//.........这里部分代码省略.........
             SJB_ListingManager::saveListing($listing);
             SJB_BrowseDBManager::addListings($listingSid);
             $formToken = SJB_Request::getVar('form_token');
             $sessionFilesStorage = SJB_Session::getValue('tmp_uploads_storage');
             $uploadedFields = SJB_Array::getPath($sessionFilesStorage, $formToken);
             if (!empty($uploadedFields)) {
                 foreach ($uploadedFields as $fieldId => $fieldValue) {
                     // get field of listing
                     $isComplex = false;
                     if (strpos($fieldId, ':') !== false) {
                         $isComplex = true;
                     }
                     $tmpUploadedFileId = $fieldValue['file_id'];
                     // rename it to real listing field value
                     $newFileId = $fieldId . "_" . $listing->getSID();
                     SJB_DB::query("UPDATE `uploaded_files` SET `id` = ?s WHERE `id` =?s", $newFileId, $tmpUploadedFileId);
                     if ($isComplex) {
                         list($parentField, $subField, $complexStep) = explode(':', $fieldId);
                         $parentProp = $listing->getProperty($parentField);
                         $parentValue = $parentProp->getValue();
                         // look for complex property with current $fieldID and set it to new value of property
                         if (!empty($parentValue)) {
                             foreach ($parentValue as $id => $value) {
                                 if ($id == $subField) {
                                     $parentValue[$id][$complexStep] = $newFileId;
                                 }
                             }
                             $listing->setPropertyValue($parentField, $parentValue);
                         }
                     } else {
                         $listing->setPropertyValue($fieldId, $newFileId);
                     }
                     // unset value from session temporary storage
                     $sessionFilesStorage = SJB_Array::unsetValueByPath($sessionFilesStorage, "{$formToken}/{$fieldId}");
                 }
                 //and remove token key from temporary storage
                 $sessionFilesStorage = SJB_Array::unsetValueByPath($sessionFilesStorage, "{$formToken}");
                 SJB_Session::setValue('tmp_uploads_storage', $sessionFilesStorage);
                 SJB_ListingManager::saveListing($listing);
             }
             SJB_Event::dispatch('listingEdited', $listingSid);
             if (SJB_Request::isAjax()) {
                 echo '<p class="green">Listing Saved</p>';
                 exit;
             }
             if ($form_is_submitted == 'save_info') {
                 $listingTypeId = SJB_ListingTypeManager::getListingTypeIDBySID($listing_info['listing_type_sid']);
                 $listingType = $listingTypeId != 'Job' && $listingTypeId != 'Resume' ? $listingTypeId . '-listings' : $listingTypeId . 's';
                 SJB_HelperFunctions::redirect(SJB_System::getSystemSettings("SITE_URL") . "/manage-" . strtolower($listingType) . "/?restore=1");
             }
         }
         $listing->deleteProperty('access_list');
         $comments = SJB_CommentManager::getEnabledCommentsToListing($listing_id);
         $comments_total = count($comments);
         $rate = SJB_Rating::getRatingNumToListing($listing_id);
         $form_fields = $listing_edit_form->getFormFieldsInfo();
         $pages = SJB_PostingPagesManager::getPagesByListingTypeSID($listing->getListingTypeSID());
         $realFormFields = array();
         foreach ($pages as $page) {
             $listingFields = SJB_PostingPagesManager::getAllFieldsByPageSIDForForm($page['sid']);
             foreach ($listingFields as $fieldID => $listingField) {
                 if (isset($form_fields[$fieldID])) {
                     $realFormFields[$fieldID] = $form_fields[$fieldID];
                 }
             }
         }
         $adminFields = array();
         foreach ($form_fields as $fieldName => $field) {
             if (!isset($realFormFields[$fieldName])) {
                 $adminFields[$fieldName] = $field;
             }
         }
         $realFormFields = array_merge($adminFields, $realFormFields);
         $tp = SJB_System::getTemplateProcessor();
         $listing_edit_form->registerTags($tp);
         $extraInfo = $listing_info['product_info'];
         if ($extraInfo) {
             $extraInfo = unserialize($extraInfo);
             $numberOfPictures = isset($extraInfo['number_of_pictures']) ? $extraInfo['number_of_pictures'] : 0;
             $tp->assign("listing_duration", $extraInfo['listing_duration']);
             $tp->assign("pic_limit", $numberOfPictures);
         }
         $listing_structure = SJB_ListingManager::createTemplateStructureForListing($listing);
         if (!isset($listing_structure['access_type'])) {
             $listing_structure['access_type'] = 'everyone';
         }
         $listing_access_list = SJB_ListingManager::getListingAccessList($listing_id, $listing->getPropertyValue('access_type'));
         $tp->assign("uploadMaxFilesize", SJB_UploadFileManager::getIniUploadMaxFilesize());
         $tp->assign('form_fields', $realFormFields);
         $tp->assign('listing', $listing_structure);
         $tp->assign('errors', $errors);
         $tp->assign('listingType', SJB_ListingTypeManager::createTemplateStructure($listingTypeInfo));
         $tp->assign('listing_access_list', $listing_access_list);
         $tp->assign('comments_total', $comments_total);
         $tp->assign('rate', $rate);
         $tp->assign('expired', SJB_ListingManager::getIfListingHasExpiredBySID($listing->getSID()));
         SJB_System::setGlobalTemplateVariable('wikiExtraParam', $listingTypeInfo['id']);
         $tp->display('edit_listing.tpl');
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:101,代码来源:edit_listing.php


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