本文整理汇总了PHP中SJB_System::getSystemSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP SJB_System::getSystemSettings方法的具体用法?PHP SJB_System::getSystemSettings怎么用?PHP SJB_System::getSystemSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SJB_System
的用法示例。
在下文中一共展示了SJB_System::getSystemSettings方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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");
}
}
示例2: execute
public function execute()
{
$template_processor = SJB_System::getTemplateProcessor();
$errors = array();
$UserProfileFieldListItemManager = new SJB_UserProfileFieldListItemManager();
if (!isset($_REQUEST['field_sid'], $_REQUEST['item_sid'])) {
echo 'The system cannot proceed as some key paramaters are missed';
} else {
if (is_null($list_item = $UserProfileFieldListItemManager->getListItemBySID($_REQUEST['item_sid']))) {
echo 'Wrong parameters are specified';
} else {
$list_item_info['value'] = $list_item->getValue();
$template_processor->assign("list_item_info", $list_item_info);
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'save') {
$list_item->setValue($_REQUEST['list_item_value']);
if (empty($_REQUEST['list_item_value'])) {
$errors = array('Value' => 'EMPTY_VALUE');
} else {
$UserProfileFieldListItemManager->saveListItem($list_item);
SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . "/edit-user-profile-field/edit-list/?field_sid=" . $_REQUEST['field_sid']);
}
}
$user_profile_field = SJB_UserProfileFieldManager::getFieldBySID($_REQUEST['field_sid']);
$user_profile_field_info = SJB_UserProfileFieldManager::getFieldInfoBySID($_REQUEST['field_sid']);
$template_processor->assign("user_profile_field_info", $user_profile_field_info);
$template_processor->assign("user_group_sid", $user_profile_field->getUserGroupSID());
$template_processor->assign("user_profile_field_sid", $_REQUEST['field_sid']);
$template_processor->assign("item_sid", $_REQUEST['item_sid']);
$template_processor->assign("list_item_value", htmlspecialchars($list_item->getValue()));
$template_processor->assign("errors", $errors);
$template_processor->assign("user_group_info", SJB_UserGroupManager::getUserGroupInfoBySID($user_profile_field->getUserGroupSID()));
$template_processor->display("user_profile_list_item_editing.tpl");
}
}
}
示例3: logout
public static function logout()
{
$blogPath = SJB_Settings::getSettingByName('blog_path');
if (empty($blogPath)) {
return;
}
$url = SJB_System::getSystemSettings('SITE_URL') . $blogPath . '/';
$client = new Zend_Http_Client($url, array('useragent' => SJB_Request::getUserAgent(), 'maxredirects' => 0));
if (isset($_SESSION['wp_cookie_jar'])) {
$client->setCookieJar(@unserialize($_SESSION['wp_cookie_jar']));
}
try {
$response = $client->request();
$matches = array();
if (preg_match('/_wpnonce=([\\w\\d]+)"/', $response->getBody(), $matches)) {
$wpnonce = $matches[1];
$url = $url . 'wp-login.php?action=logout&_wpnonce=' . $wpnonce . '&noSJB=1';
$client->setUri($url);
$response = $client->request();
foreach ($response->getHeaders() as $key => $header) {
if ('set-cookie' == strtolower($key)) {
if (is_array($header)) {
foreach ($header as $val) {
header("Set-Cookie: " . $val, false);
}
} else {
header("Set-Cookie: " . $header, false);
}
}
}
}
} catch (Exception $ex) {
}
}
示例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');
}
示例5: 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();
}
}
示例6: 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');
}
}
示例7: 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");
}
}
示例8: get
public static function get($action, $params)
{
if (SJB_System::getSystemSettings('isDemo')) {
return new SJB_LanguageAction();
}
$i18n = SJB_I18N::getInstance();
$lang = isset($params['languageId']) ? $params['languageId'] : null;
switch ($action) {
case 'set_default_language':
return new SJB_SetDefaultLanguageAction($i18n, $lang);
break;
case 'add_language':
return new SJB_AddLanguageAction($i18n, $params);
break;
case 'update_language':
return new SJB_UpdateLanguageAction($i18n, $params);
break;
case 'delete_language':
return new SJB_DeleteLanguageAction($i18n, $lang);
break;
case 'import_language':
return new SJB_ImportLanguageAction($i18n, $params);
break;
case 'export_language':
return new SJB_ExportLanguageAction($i18n, $lang);
break;
default:
return new SJB_LanguageAction();
}
}
示例9: execute
public function execute()
{
$list_of_pages = SJB_PageManager::get_pages('user');
$scriptPath = explode(SJB_System::getSystemSettings("SYSTEM_URL_BASE"), __FILE__);
$scriptPath = array_shift($scriptPath);
$handle = fopen($scriptPath . "sitemap.xml", "w");
$text = '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
fwrite($handle, $text);
foreach ($list_of_pages as $page) {
if ($page['uri'] == '/display-job/') {
$request['action'] = 'search';
$request['listing_type']['equal'] = 'Job';
$found_listings_sids = $this->searchListings($request, 'Job');
foreach ($found_listings_sids as $sid) {
$listing_info = SJB_ListingManager::getListingInfoBySID($sid);
$title = htmlspecialchars($listing_info['Title']);
$title = $sid . "/" . preg_replace("/[\\/\\\\:*?\"<>|%#\$\\s]/", "_", $title) . ".html";
$text = '
<url>
<loc>' . SJB_System::getSystemSettings("SITE_URL") . $page['uri'] . $title . '</loc>
<lastmod>' . date('Y-m-d') . '</lastmod>
<changefreq>daily</changefreq>
<priority>1</priority>
</url>';
fwrite($handle, $text);
}
} elseif ($page['uri'] == '/display-resume/') {
$request['action'] = 'search';
$request['listing_type']['equal'] = 'Resume';
$found_listings_sids = $this->searchListings($request, 'Resume');
foreach ($found_listings_sids as $sid) {
$listing_info = SJB_ListingManager::getListingInfoBySID($sid);
$title = htmlspecialchars($listing_info['Title']);
$title = $sid . "/" . preg_replace("/[\\/\\\\:*?\"<>|%#\$\\s]/", "_", $title) . ".html";
$text = '
<url>
<loc>' . SJB_System::getSystemSettings("SITE_URL") . $page['uri'] . $title . '</loc>
<lastmod>' . date('Y-m-d') . '</lastmod>
<changefreq>daily</changefreq>
<priority>1</priority>
</url>';
fwrite($handle, $text);
}
} elseif ($page['uri'] != '/callback/') {
$text = '
<url>
<loc>' . SJB_System::getSystemSettings("SITE_URL") . $page['uri'] . '</loc>
<lastmod>' . date('Y-m-d') . '</lastmod>
<changefreq>daily</changefreq>
<priority>1</priority>
</url>';
fwrite($handle, $text);
}
}
$text = '
</urlset>';
fwrite($handle, $text);
fclose($handle);
}
示例10: 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");
}
}
示例11: 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');
}
}
示例12: execute
public function execute()
{
$errors = array();
$params = array();
$template_processor = SJB_System::getTemplateProcessor();
if (isset($_REQUEST['action'])) {
$action_name = $_REQUEST['action'];
$params = $_REQUEST;
$action = SJB_PhraseActionFactory::get($action_name, $params, $template_processor);
if ($action->canPerform()) {
$action->perform();
SJB_WrappedFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/manage-phrases/?action=remember_previous_state&result=' . $action->result);
} else {
$errors = $action->getErrors();
}
}
$i18n = SJB_ObjectMother::createI18N();
$domains = $i18n->getDomainsData();
$langs = $i18n->getLanguagesData();
$template_processor->assign('domains', $domains);
$template_processor->assign('langs', $langs);
$template_processor->assign('request_data', $_REQUEST);
$template_processor->assign('errors', $errors);
$template_processor->display('add_phrase.tpl');
}
示例13: execute
public function execute()
{
$tp = SJB_System::getTemplateProcessor();
$filenameToCheck = SJB_Request::getVar('filepath');
$updateName = SJB_Request::getVar('update_name');
$updatesDir = SJB_System::getSystemSettings('SJB_UPDATES_DIR');
try {
if (empty($filenameToCheck)) {
throw new Exception('Empty filename to diff');
}
$fileExists = file_exists(SJB_BASE_DIR . $filenameToCheck);
$currentFile = SJB_BASE_DIR . $filenameToCheck;
$updateFile = $updatesDir . $updateName . DIRECTORY_SEPARATOR . $filenameToCheck;
$tp->assign('current_file', $currentFile);
$tp->assign('update_file', $updateFile);
require_once 'PEAR/PEAR/Text_Diff/Diff.php';
if ($fileExists) {
$diff = new Text_Diff('native', array(file($currentFile, FILE_IGNORE_NEW_LINES), file($updateFile, FILE_IGNORE_NEW_LINES)));
} else {
$diff = new Text_Diff('native', array(array(), file($updateFile, FILE_IGNORE_NEW_LINES)));
}
$out = self::getTableViewForDiff($diff);
$tp->assign('diffTbl', $out);
} catch (Exception $e) {
$tp->assign('errors', array($e->getMessage()));
}
$tp->display('update_diff.tpl');
}
示例14: getContentToPostToGroup
/**
* @param $title
* @param $text
* @param $link
* @param $imageUrl
* @return mixed
*/
public function getContentToPostToGroup($title, $text, $link, $imageUrl)
{
$siteUrl = SJB_System::getSystemSettings("USER_SITE_URL");
$xml = "\n\t\t<post>\n\t\t\t<title><![CDATA[{$siteUrl}]]></title>\n\t\t\t<summary></summary>\n\t\t\t<content>\n\t\t\t\t<title><![CDATA[{$title}]]></title>\n\t\t\t\t<description><![CDATA[{$text}]]></description>\n\t\t\t\t<submitted-url><![CDATA[{$link}]]></submitted-url>\n\t\t\t\t<submitted-image-url><![CDATA[{$imageUrl}]]></submitted-image-url>\n\t\t\t</content>\n\t\t</post>";
$result = new SimpleXMLElement($xml);
return $result->asXML();
}
示例15: get
public function get($language_id)
{
if (!isset($this->repository[$language_id])) {
$file_paths = $this->fileHelper->getFilePathToLangFiles($language_id);
// загрузим переводы (languages & pages)
$adminMode = SJB_System::getSystemSettings('SYSTEM_ACCESS_TYPE') === 'admin';
$loadTrPages = $adminMode || $language_id === $this->fileHelper->context->langSettings->getCurrentLangID();
if ($loadTrPages) {
// генерим данные с pages & languages
$file_path = $file_paths['pages'];
$cache_path = SJB_System::getSystemSettings('CACHE_DIR') . DIRECTORY_SEPARATOR . basename($file_path) . '.cache';
$conf_file_path = $file_paths['languages'];
$generateTr = !file_exists($cache_path) || filemtime($file_path) >= filemtime($cache_path) || filemtime($conf_file_path) >= filemtime($cache_path);
if ($generateTr) {
// генерим languages data
$trAdmin = $this->getLanguagesTrAdmin($file_paths);
// генерим pages data
$trAdmin->getLanguagePages();
$this->createCache($cache_path, $trAdmin);
} else {
$trAdmin = $this->getTrAdminFromCache($cache_path);
}
} else {
// генерим только данные с languages
$trAdmin = $this->getLanguagesTrAdmin($file_paths);
}
$this->repository[$language_id] = $trAdmin;
} else {
$trAdmin = $this->repository[$language_id];
}
return $trAdmin;
}