GetForLink(); $oContentLayout->AddMainBlock(TitleFactory::MakeForPage(Dict::S('UI:Preferences:Title'))); ////////////////////////////////////////////////////////////////////////// // // User Language selection // ////////////////////////////////////////////////////////////////////////// $oUserLanguageBlock = new Panel(Dict::S('UI:FavoriteLanguage'), array(), 'grey', 'ibo-user-language-selection'); $oUserLanguageForm = GetUserLanguageForm($oAppContext, $sURL); $oUserLanguageBlock->AddSubBlock($oUserLanguageForm); $oContentLayout->AddMainBlock($oUserLanguageBlock); ////////////////////////////////////////////////////////////////////////// // // Other (miscellaneous) settings // ////////////////////////////////////////////////////////////////////////// $oMiscSettingsBlock = new Panel(Dict::S('UI:FavoriteOtherSettings'), array(), 'grey', 'ibo-misc-settings'); $oMiscSettingsStartForm = new Html('
'); $oMiscSettingsBlock->AddSubBlock($oMiscSettingsStartForm); $oMiscSettingsBlock->AddSubBlock($oMiscSettingsHtml); $oMiscSettingsBlock->AddSubBlock($oMiscSettingsCancelButton); $oMiscSettingsBlock->AddSubBlock($oMiscSettingsSubmitButton); $oMiscSettingsBlock->AddSubBlock($oMiscSettingsEndHtmlBlock); $oContentLayout->AddMainBlock($oMiscSettingsBlock); $oP->add_script( <<
');
$('#ibo-misc-settings-submit').prop('disabled', true);
return false;
}
}
EOF
);
//////////////////////////////////////////////////////////////////////////
//
// Favorite Organizations
//
//////////////////////////////////////////////////////////////////////////
$oFavoriteOrganizationsBlock = new Panel(Dict::S('UI:FavoriteOrganizations'), array(), 'grey', 'ibo-favorite-organizations');
$oFavoriteOrganizationsBlock->AddHtml(Dict::S('UI:FavoriteOrganizations+'));
$oFavoriteOrganizationsBlock->AddHtml('';
$oFavoriteOrganizationsEndHtmlBlock = new Html($sFavoriteOrganizationsEndHtml);
$aFavoriteOrgs = appUserPreferences::GetPref('favorite_orgs', null);
if ($aFavoriteOrgs == null)
{
// All checked
$oP->add_ready_script(
<<';
$oSet = new DBObjectSet($oBMSearch);
if ($oSet->Count() > 0) {
$sButtons = ' '.Dict::S('UI:Preferences:ChooseAPlaceholder+').'
';
$sButtons .= '';
$sButtons .= '';
// Selection count updated by the pager, and used to enable buttons
$sShortcutsHtml .= '';
$sConfirmDelete = addslashes(Dict::S('UI:ShortcutDelete:Confirm'));
$oP->add_ready_script(
<< $sButtons ');
$('#shortcut_selection_count').bind('change', OnSelectionCountChange);
$('#shortcut_btn_rename').bind('click', OnShortcutBtnRename);
$('#shortcut_btn_delete').bind('click', OnShortcutBtnDelete);
OnSelectionCountChange();
EOF
);
} // if count > 0
$oShortcutsHtmlBlock = new Html($sShortcutsHtml);
$oShortcutsBlock->AddSubBlock($oShortcutsHtmlBlock);
$oContentLayout->AddMainBlock($oShortcutsBlock);
//////////////////////////////////////////////////////////////////////////
//
// Newsroom
//
//////////////////////////////////////////////////////////////////////////
$iCountProviders = 0;
$oUser = UserRights::GetUserObject();
$aProviders = MetaModel::EnumPlugins('iNewsroomProvider');
foreach($aProviders as $oProvider)
{
if ($oProvider->IsApplicable($oUser))
{
$iCountProviders++;
}
}
$bNewsroomEnabled = (MetaModel::GetConfig()->Get('newsroom_enabled') !== false);
if ($bNewsroomEnabled && ($iCountProviders > 0))
{
$oNewsroomBlock = new Panel(Dict::S('UI:Newsroom:Preferences'), array(), 'grey', 'ibo-newsroom');
$sNewsroomHtml = '';
$sNewsroomHtml .= '';
$oNewsroomEndHtmlBlock = new Html($sNewsroomEndHtml);
$oNewsroomHtmlBlock = new Html($sNewsroomHtml);
$oNewsroomBlock->AddSubBlock($oNewsroomHtmlBlock);
$oNewsroomBlock->AddSubBlock($oNewsroomResetCacheButton);
$oNewsroomBlock->AddSubBlock($oNewsroomCancelButton);
$oNewsroomBlock->AddSubBlock($oNewsroomSubmitButton);
$oNewsroomBlock->AddSubBlock($oNewsroomEndHtmlBlock);
$oContentLayout->AddMainBlock($oNewsroomBlock);
}
//////////////////////////////////////////////////////////////////////////
//
// Rich text editor preferences
//
//////////////////////////////////////////////////////////////////////////
$oRichTextBlock = new Panel(Dict::S('UI:RichText:Preferences'), array(), 'grey', 'ibo-richtext');
$oRichTextForm = new Form();
$oRichTextForm->AddSubBlock(InputFactory::MakeForHidden('operation', 'apply_richtext_config'));
$sRichTextToolbarDefaultState = isset(utils::GetCkeditorPref()['toolbarStartupExpanded']) ? (bool)utils::GetCkeditorPref()['toolbarStartupExpanded'] : false;
$oRichTextToolbarDefaultStateInput = InputFactory::MakeForSelectWithLabel('toolbarexpanded', Dict::S('UI:RichText:ToolbarState'));
$oRichTextToolbarDefaultStateInput->GetInput()->AddOption(InputFactory::MakeForSelectOption('true', Dict::S('UI:RichText:ToolbarState:Expanded'), $sRichTextToolbarDefaultState));
$oRichTextToolbarDefaultStateInput->GetInput()->AddOption(InputFactory::MakeForSelectOption('false', Dict::S('UI:RichText:ToolbarState:Collapsed'), !$sRichTextToolbarDefaultState));
$oRichTextForm->AddSubBlock($oRichTextToolbarDefaultStateInput);
// - Cancel button
$oRichTextCancelButton = ButtonFactory::MakeForSecondaryAction(Dict::S('UI:Button:Cancel'));
$oRichTextCancelButton->SetOnClickJsCode("window.location.href = '$sURL'");
$oRichTextForm->AddSubBlock($oRichTextCancelButton);
// - Submit button
$oRichTextSubmitButton = ButtonFactory::MakeForPrimaryAction(Dict::S('UI:Button:Apply'), null, null, true);
$oRichTextForm->AddSubBlock($oRichTextSubmitButton);
$oRichTextBlock->AddSubBlock($oRichTextForm);
$oContentLayout->AddMainBlock($oRichTextBlock);
//////////////////////////////////////////////////////////////////////////
//
// User picture placeholder
//
//////////////////////////////////////////////////////////////////////////
$oUserPicturePlaceHolderBlock = new Panel(Dict::S('UI:Preferences:ChooseAPlaceholder'), array(), 'grey', 'ibo-user-picture-placeholder');
$sUserPicturesFolder = '../images/user-pictures/';
$sUserDefaultPicture = appUserPreferences::GetPref('user_picture_placeholder', 'default-placeholder.png');
$sUserPicturePlaceHolderHtml = '';
$sUserPicturePlaceHolderHtml .= ' ';
}
$oP->add_ready_script(
<<
".Dict::S('UI:FatalErrorMessage')."
\n");
$oP->error(Dict::Format('UI:Error_Details', $e->getHtmlDesc()));
$oP->output();
if (MetaModel::IsLogEnabledIssue())
{
if (MetaModel::IsValidClass('EventIssue'))
{
$oLog = new EventIssue();
$oLog->Set('message', $e->getMessage());
$oLog->Set('userinfo', '');
$oLog->Set('issue', $e->GetIssue());
$oLog->Set('impact', 'Page could not be displayed');
$oLog->Set('callstack', $e->getTrace());
$oLog->Set('data', $e->getContextData());
$oLog->DBInsertNoReload();
}
IssueLog::Error($e->getMessage());
}
// For debugging only
//throw $e;
}
catch(Exception $e)
{
require_once(APPROOT.'/setup/setuppage.class.inc.php');
$oP = new ErrorPage(Dict::S('UI:PageTitle:FatalError'));
$oP->add("".Dict::S('UI:FatalErrorMessage')."
\n");
$oP->error(Dict::Format('UI:Error_Details', $e->getMessage()));
$oP->output();
if (MetaModel::IsLogEnabledIssue())
{
if (MetaModel::IsValidClass('EventIssue'))
{
$oLog = new EventIssue();
$oLog->Set('message', $e->getMessage());
$oLog->Set('userinfo', '');
$oLog->Set('issue', 'PHP Exception');
$oLog->Set('impact', 'Page could not be displayed');
$oLog->Set('callstack', $e->getTrace());
$oLog->Set('data', array());
$oLog->DBInsertNoReload();
}
IssueLog::Error($e->getMessage());
}
}