本文整理汇总了PHP中GetApplication函数的典型用法代码示例。如果您正苦于以下问题:PHP GetApplication函数的具体用法?PHP GetApplication怎么用?PHP GetApplication使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetApplication函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetPageList
public function GetPageList()
{
$currentPageCaption = $this->GetShortCaption();
$result = new PageList($this);
if (GetCurrentUserGrantForDataSource('public.office_holder')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Office Holders'), 'public.office_holder.php', $this->RenderText('Office Holders'), $currentPageCaption == $this->RenderText('Office Holders')));
}
if (GetCurrentUserGrantForDataSource('public.office')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Political Offices'), 'public.office.php', $this->RenderText('Political Offices'), $currentPageCaption == $this->RenderText('Political Offices')));
}
if (GetCurrentUserGrantForDataSource('public.office_docs')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Political Office Filing Documents'), 'public.office_docs.php', $this->RenderText('Political Office Filing Documents'), $currentPageCaption == $this->RenderText('Political Office Filing Documents')));
}
if (GetCurrentUserGrantForDataSource('public.election_div')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Election Divisions'), 'public.election_div.php', $this->RenderText('Election Divisions'), $currentPageCaption == $this->RenderText('Election Divisions')));
}
if (GetCurrentUserGrantForDataSource('public.election_div_docs')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Election Division Filing Documents'), 'public.election_div_docs.php', $this->RenderText('Election Division Filing Documents'), $currentPageCaption == $this->RenderText('Election Division Filing Documents')));
}
if (GetCurrentUserGrantForDataSource('public.district')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Political Districts'), 'public.district.php', $this->RenderText('Political Districts'), $currentPageCaption == $this->RenderText('Political Districts')));
}
if (GetCurrentUserGrantForDataSource('public.office_position')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Political Office Positions'), 'public.office_position.php', $this->RenderText('Political Office Positions'), $currentPageCaption == $this->RenderText('Political Office Positions')));
}
if (HasAdminPage() && GetApplication()->HasAdminGrantForCurrentUser()) {
$result->AddPage(new PageLink($this->GetLocalizerCaptions()->GetMessageString('AdminPage'), 'phpgen_admin.php', $this->GetLocalizerCaptions()->GetMessageString('AdminPage'), false, true));
}
return $result;
}
示例2: __construct
public function __construct($name, Page $page, Dataset $dataset)
{
$this->name = $name;
$this->dataset = $dataset;
$this->page = $page;
$this->superGlobals = GetApplication()->GetSuperGlobals();
}
示例3: Render
public function Render(Renderer $renderer)
{
try {
$errorReporting = error_reporting(null);
GetApplication()->SetOperation(OPERATION_COMMIT_DELETE);
$this->grid->SetState(OPERATION_COMMIT_DELETE);
$this->grid->GetState()->SetUseGetToExtractPrimaryKeys(true);
$this->grid->ProcessMessages();
header('Content-Type: text/xml');
if ($this->grid->GetErrorMessage() != '') {
$xmlWriter = XMLWriterFactory::CreateXMLWriter();
$xmlWriter->StartDocument('1.0', 'UTF-8');
$xmlWriter->StartElement('response');
$xmlWriter->WriteElement('type', 'error');
$xmlWriter->WriteElement('error_message', $this->grid->GetErrorMessage());
$xmlWriter->EndElement('response');
echo $xmlWriter->GetResult();
} else {
$xmlWriter = XMLWriterFactory::CreateXMLWriter();
$xmlWriter->StartDocument('1.0', 'UTF-8');
$xmlWriter->StartElement('response');
$xmlWriter->WriteElement('type', 'OK');
$xmlWriter->EndElement('response');
echo $xmlWriter->GetResult();
}
error_reporting($errorReporting);
} catch (Exception $e) {
echo '<?xml version="1.0" encoding="UTF-8"?><response><type>error</type><error_message>' . htmlspecialchars($e->getMessage()) . '</error_message></response>';
}
}
示例4: GetPageList
public function GetPageList()
{
$currentPageCaption = $this->GetShortCaption();
$result = new PageList($this);
$result->AddGroup($this->RenderText('Default'));
if (GetCurrentUserGrantForDataSource('dbo.EtatConnexion')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Dbo.EtatConnexion'), 'dbo.EtatConnexion.php', $this->RenderText('Dbo.EtatConnexion'), $currentPageCaption == $this->RenderText('Dbo.EtatConnexion'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('dbo.EvenementSysteme')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Dbo.EvenementSysteme'), 'dbo.EvenementSysteme.php', $this->RenderText('Dbo.EvenementSysteme'), $currentPageCaption == $this->RenderText('Dbo.EvenementSysteme'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('dbo.InfosFichiers')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Dbo.InfosFichiers'), 'dbo.InfosFichiers.php', $this->RenderText('Dbo.InfosFichiers'), $currentPageCaption == $this->RenderText('Dbo.InfosFichiers'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('dbo.IPClients')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Dbo.IPClients'), 'dbo.IPClients.php', $this->RenderText('Dbo.IPClients'), $currentPageCaption == $this->RenderText('Dbo.IPClients'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('dbo.MachinesClientes')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Dbo.MachinesClientes'), 'dbo.MachinesClientes.php', $this->RenderText('Dbo.MachinesClientes'), $currentPageCaption == $this->RenderText('Dbo.MachinesClientes'), false, $this->RenderText('Default')));
}
if (HasAdminPage() && GetApplication()->HasAdminGrantForCurrentUser()) {
$result->AddGroup('Admin area');
$result->AddPage(new PageLink($this->GetLocalizerCaptions()->GetMessageString('AdminPage'), 'phpgen_admin.php', $this->GetLocalizerCaptions()->GetMessageString('AdminPage'), false, false, 'Admin area'));
}
return $result;
}
示例5: __construct
/**
* @param TableBasedUserGrantsManager $tableBasedGrantsManager
* @param IdentityCheckStrategy $identityCheckStrategy
*/
private function __construct($tableBasedGrantsManager, $identityCheckStrategy)
{
$this->tableBasedGrantsManager = $tableBasedGrantsManager;
$this->identityCheckStrategy = $identityCheckStrategy;
$this->router = $this->CreateAndConfigureRequestRouter();
$this->app = GetApplication();
$this->userIdentityStorage = new UserIdentityCookieStorage($identityCheckStrategy);
}
示例6: GetCurrentPageMode
private function GetCurrentPageMode()
{
switch (GetApplication()->GetOperation()) {
case OPERATION_VIEWALL:
return PageMode::ViewAll;
}
return null;
}
示例7: __construct
/**
* @param TableBasedUserGrantsManager $tableBasedGrantsManager
* @param IdentityCheckStrategy $identityCheckStrategy
* @param UserIdentityStorage $userIdentityStorage
*/
private function __construct(TableBasedUserGrantsManager $tableBasedGrantsManager, IdentityCheckStrategy $identityCheckStrategy, UserIdentityStorage $userIdentityStorage)
{
$this->tableBasedGrantsManager = $tableBasedGrantsManager;
$this->identityCheckStrategy = $identityCheckStrategy;
$this->router = $this->CreateAndConfigureRequestRouter();
$this->app = GetApplication();
$this->userIdentityStorage = $userIdentityStorage;
}
示例8: __construct
/**
* @param Grid $grid
* @param Captions $captions
*/
public function __construct(Grid $grid, Captions $captions)
{
$this->captions = $captions;
$this->superGlobals = GetApplication()->GetSuperGlobals();
$this->parentGrid = $grid;
$this->filter = new Filter($grid->GetPage()->GetContentEncoding());
$this->generator = $this->createSQLGenerator();
$this->fields = array();
}
示例9: SetUpUserAuthorization
function SetUpUserAuthorization()
{
global $usersIds;
global $grants;
global $appGrants;
global $dataSourceRecordPermissions;
$userAuthorizationStrategy = new HardCodedUserAuthorization(new UserIdentitySessionStorage(GetIdentityCheckStrategy()), new HardCodedUserGrantsManager($grants, $appGrants), $usersIds);
GetApplication()->SetUserAuthorizationStrategy($userAuthorizationStrategy);
GetApplication()->SetDataSourceRecordPermissionRetrieveStrategy(new HardCodedDataSourceRecordPermissionRetrieveStrategy($dataSourceRecordPermissions));
}
示例10: ShowSecurityErrorPage
/**
* @param Page $parentPage
* @param string $message
*/
function ShowSecurityErrorPage($parentPage, $message)
{
$urlToRedirect = '';
if ($parentPage instanceof Page) {
$linkBuilder = $parentPage->CreateLinkBuilder();
GetApplication()->GetSuperGlobals()->fillGetParams($linkBuilder);
$urlToRedirect = '?redirect=' . urlencode($linkBuilder->GetLink());
}
$renderer = new ViewAllRenderer($parentPage->GetLocalizerCaptions());
$errorPage = new CustomErrorPage($parentPage->GetLocalizerCaptions()->GetMessageString('AccessDenied'), $parentPage->GetContentEncoding(), $message, sprintf($parentPage->GetLocalizerCaptions()->GetMessageString('AccessDeniedErrorSuggestions'), 'login.php' . $urlToRedirect), $parentPage);
echo $renderer->Render($errorPage);
}
示例11: GetPageList
public function GetPageList()
{
$currentPageCaption = $this->GetShortCaption();
$result = new PageList($this);
if (GetCurrentUserGrantForDataSource('banner')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Banner Management'), 'banner.php', $this->RenderText('Banner Management'), $currentPageCaption == $this->RenderText('Banner Management')));
}
if (HasAdminPage() && GetApplication()->HasAdminGrantForCurrentUser()) {
$result->AddPage(new PageLink($this->GetLocalizerCaptions()->GetMessageString('AdminPage'), 'phpgen_admin.php', $this->GetLocalizerCaptions()->GetMessageString('AdminPage'), false, true));
}
return $result;
}
示例12: ProcessMessages
public function ProcessMessages()
{
$primaryKeysArray = array();
for ($i = 0; $i < GetApplication()->GetPOSTValue('recordCount'); $i++) {
if (GetApplication()->IsPOSTValueSet('rec' . $i)) {
// TODO : move GetPrimaryKeyFieldNames function to private
$primaryKeys = array();
$primaryKeyNames = $this->grid->GetDataset()->GetPrimaryKeyFieldNames();
for ($j = 0; $j < count($primaryKeyNames); $j++) {
$primaryKeys[] = GetApplication()->GetPOSTValue('rec' . $i . '_pk' . $j);
}
$primaryKeysArray[] = $primaryKeys;
}
}
$inlineInsertedRecordPrimaryKeyNames = GetApplication()->GetSuperGlobals()->GetPostVariablesIf(create_function('$str', 'return StringUtils::StartsWith($str, \'inline_inserted_rec_\') && !StringUtils::Contains($str, \'pk\');'));
foreach ($inlineInsertedRecordPrimaryKeyNames as $name => $value) {
$primaryKeys = array();
$primaryKeyNames = $this->grid->GetDataset()->GetPrimaryKeyFieldNames();
for ($i = 0; $i < count($primaryKeyNames); $i++) {
$primaryKeys[] = GetApplication()->GetSuperGlobals()->GetPostValue($name . '_pk' . $i);
}
$primaryKeysArray[] = $primaryKeys;
}
foreach ($primaryKeysArray as $primaryKeyValues) {
$this->grid->GetDataset()->SetSingleRecordState($primaryKeyValues);
$this->grid->GetDataset()->Open();
if ($this->grid->GetDataset()->Next()) {
$message = '';
$fieldValues = $this->grid->GetDataset()->GetCurrentFieldValues();
if ($this->CanChangeData($fieldValues, $message)) {
try {
$this->grid->GetDataset()->Delete();
$this->DoAfterChangeData($fieldValues);
} catch (Exception $e) {
$this->grid->GetDataset()->SetAllRecordsState();
$this->ChangeState(OPERATION_VIEWALL);
$this->SetGridErrorMessage($e);
return;
}
} else {
$this->grid->GetDataset()->SetAllRecordsState();
$this->ChangeState(OPERATION_VIEWALL);
$this->SetGridSimpleErrorMessage($message);
return;
}
}
$this->grid->GetDataset()->Close();
}
$this->ApplyState(OPERATION_VIEWALL);
}
示例13: ExtractPrimaryKeyValues
function ExtractPrimaryKeyValues(&$primaryKeyValues, $method = METHOD_GET)
{
$paramNumber = 0;
if ($method == METHOD_GET) {
while (GetApplication()->IsGETValueSet("pk{$paramNumber}")) {
$primaryKeyValues[] = GetApplication()->GetGETValue("pk{$paramNumber}");
$paramNumber++;
}
} elseif ($method == METHOD_POST) {
while (GetApplication()->IsPOSTValueSet("pk{$paramNumber}")) {
$primaryKeyValues[] = GetApplication()->GetPOSTValue("pk{$paramNumber}");
$paramNumber++;
}
}
}
示例14: SetUpUserAuthorization
function SetUpUserAuthorization()
{
global $grants;
global $appGrants;
global $dataSourceRecordPermissions;
$hardCodedGrantsManager = new HardCodedUserGrantsManager($grants, $appGrants);
$tableBasedGrantsManager = CreateTableBasedGrantsManager();
$grantsManager = new CompositeGrantsManager();
$grantsManager->AddGrantsManager($hardCodedGrantsManager);
if (!is_null($tableBasedGrantsManager)) {
$grantsManager->AddGrantsManager($tableBasedGrantsManager);
GetApplication()->SetUserManager($tableBasedGrantsManager);
}
$userAuthorizationStrategy = new TableBasedUserAuthorization(new UserIdentitySessionStorage(GetIdentityCheckStrategy()), new MyPDOConnectionFactory(), GetGlobalConnectionOptions(), 'atig_users', 'user_name', 'user_id', $grantsManager);
GetApplication()->SetUserAuthorizationStrategy($userAuthorizationStrategy);
GetApplication()->SetDataSourceRecordPermissionRetrieveStrategy(new HardCodedDataSourceRecordPermissionRetrieveStrategy($dataSourceRecordPermissions));
}
示例15: GetPageList
public function GetPageList()
{
$currentPageCaption = $this->GetShortCaption();
$result = new PageList($this);
$result->AddGroup($this->RenderText('Default'));
if (GetCurrentUserGrantForDataSource('clienti')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Clienti'), 'clienti.php', $this->RenderText('Clienti'), $currentPageCaption == $this->RenderText('Clienti'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('articoli')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Articoli'), 'articoli.php', $this->RenderText('Articoli'), $currentPageCaption == $this->RenderText('Articoli'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('famiglie')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Famiglie'), 'famiglie.php', $this->RenderText('Famiglie'), $currentPageCaption == $this->RenderText('Famiglie'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('offerte')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Offerte'), 'offerte.php', $this->RenderText('Offerte'), $currentPageCaption == $this->RenderText('Offerte'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('listino_articoli')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Listino Articoli'), 'listino_articoli.php', $this->RenderText('Listino Articoli'), $currentPageCaption == $this->RenderText('Listino Articoli'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('voci_costo')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Voci Costo'), 'voci_costo.php', $this->RenderText('Voci Costo'), $currentPageCaption == $this->RenderText('Voci Costo'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('formule_calcolo')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Formule Calcolo'), 'formule_calcolo.php', $this->RenderText('Formule Calcolo'), $currentPageCaption == $this->RenderText('Formule Calcolo'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('listini')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Listini'), 'listini.php', $this->RenderText('Listini'), $currentPageCaption == $this->RenderText('Listini'), false, $this->RenderText('Default')));
}
if (GetCurrentUserGrantForDataSource('scontistica_clienti')->HasViewGrant()) {
$result->AddPage(new PageLink($this->RenderText('Scontistica Clienti'), 'scontistica_clienti.php', $this->RenderText('Scontistica Clienti'), $currentPageCaption == $this->RenderText('Scontistica Clienti'), false, $this->RenderText('Default')));
}
if (HasAdminPage() && GetApplication()->HasAdminGrantForCurrentUser()) {
$result->AddGroup('Admin area');
$result->AddPage(new PageLink($this->GetLocalizerCaptions()->GetMessageString('AdminPage'), 'phpgen_admin.php', $this->GetLocalizerCaptions()->GetMessageString('AdminPage'), false, false, 'Admin area'));
}
return $result;
}