Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
81144b6d
Unverified
Commit
81144b6d
authored
5 years ago
by
totten
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #14876 from eileenmcnaughton/is_front
#378
Determine front end pages in drupal
parents
812950b5
68e3bc34
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/Utils/System/Base.php
+13
-0
13 additions, 0 deletions
CRM/Utils/System/Base.php
CRM/Utils/System/DrupalBase.php
+22
-0
22 additions, 0 deletions
CRM/Utils/System/DrupalBase.php
Civi/Core/Themes.php
+1
-1
1 addition, 1 deletion
Civi/Core/Themes.php
with
36 additions
and
1 deletion
CRM/Utils/System/Base.php
+
13
−
0
View file @
81144b6d
...
...
@@ -414,6 +414,19 @@ abstract class CRM_Utils_System_Base {
return
FALSE
;
}
/**
* Is a front end page being accessed.
*
* Generally this would be a contribution form or other public page as opposed to a backoffice page (like contact edit).
*
* @todo Drupal uses the is_public setting - clarify & rationalise. See https://github.com/civicrm/civicrm-drupal/pull/546/files
*
* @return bool
*/
public
function
isFrontEndPage
()
{
return
CRM_Core_Config
::
singleton
()
->
userFrameworkFrontend
;
}
/**
* Get user login URL for hosting CMS (method declared in each CMS system class)
*
...
...
This diff is collapsed.
Click to expand it.
CRM/Utils/System/DrupalBase.php
+
22
−
0
View file @
81144b6d
...
...
@@ -663,4 +663,26 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
return
(
!
empty
(
$language
->
language
))
?
$language
->
language
:
$language
;
}
/**
* Is a front end page being accessed.
*
* Generally this would be a contribution form or other public page as opposed to a backoffice page (like contact edit).
*
* See https://github.com/civicrm/civicrm-drupal/pull/546/files
*
* @return bool
*/
public
function
isFrontEndPage
()
{
// Get the menu items.
$args
=
explode
(
'?'
,
$_GET
[
'q'
]);
$path
=
$args
[
0
];
// Get the menu for above URL.
$item
=
CRM_Core_Menu
::
get
(
$path
);
if
(
!
empty
(
CRM_Utils_Array
::
value
(
'is_public'
,
$item
)))
{
return
TRUE
;
}
return
FALSE
;
}
}
This diff is collapsed.
Click to expand it.
Civi/Core/Themes.php
+
1
−
1
View file @
81144b6d
...
...
@@ -85,7 +85,7 @@ class Themes {
if
(
$this
->
activeThemeKey
===
NULL
)
{
// Ambivalent: is it better to use $config->userFrameworkFrontend or $template->get('urlIsPublic')?
$config
=
\CRM_Core_Config
::
singleton
();
$settingKey
=
$config
->
user
Framework
Front
e
nd
?
'theme_frontend'
:
'theme_backend'
;
$settingKey
=
$config
->
user
System
->
is
Front
E
nd
Page
()
?
'theme_frontend'
:
'theme_backend'
;
$themeKey
=
Civi
::
settings
()
->
get
(
$settingKey
);
if
(
$themeKey
===
'default'
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment