+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
+ | Copyright CiviCRM LLC (c) 2004-2020 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC (c) 2004-2020
* $Id$
*
*/
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() {
+ $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;
+ }
+
}