X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FSystem%2FDrupalBase.php;h=5521bd4efd22f16b7fba5aeb8386de0ae2d1e273;hb=5ec753e358cd1692934daa7f5bd99384097fdf8c;hp=75d04ca71252e942cccc759c2bedf7522b2bc964;hpb=358a1864ba3c5a3fc3ff65f03b3db045ea2199a8;p=civicrm-core.git diff --git a/CRM/Utils/System/DrupalBase.php b/CRM/Utils/System/DrupalBase.php index 75d04ca712..5521bd4efd 100644 --- a/CRM/Utils/System/DrupalBase.php +++ b/CRM/Utils/System/DrupalBase.php @@ -1,34 +1,18 @@ 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() { + $path = CRM_Utils_System::getUrlPath(); + + // 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; + } + }