+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
- static function &xmlItems() {
- if (!self::$_items) {
+ /**
+ * This function fetches the menu items from xml and xmlMenu hooks
+ *
+ * @param boolen $fetchFromXML fetch the menu items from xml and not from cache
+ *
+ * @return array
+ */
+ static function &xmlItems($fetchFromXML = FALSE) {
+ if (!self::$_items || $fetchFromXML) {
static function read($name, &$menu) {
$config = CRM_Core_Config::singleton();
static function read($name, &$menu) {
$config = CRM_Core_Config::singleton();
static function fillMenuValues(&$menu, $path) {
$fieldsToPropagate = array(
'access_callback',
static function fillMenuValues(&$menu, $path) {
$fieldsToPropagate = array(
'access_callback',
static function store($truncate = TRUE) {
// first clean up the db
if ($truncate) {
$query = 'TRUNCATE civicrm_menu';
CRM_Core_DAO::executeQuery($query);
}
static function store($truncate = TRUE) {
// first clean up the db
if ($truncate) {
$query = 'TRUNCATE civicrm_menu';
CRM_Core_DAO::executeQuery($query);
}
- $query = CRM_Utils_Array::value('path_arguments', $item) ? str_replace(',', '&', $item['path_arguments']) . '&reset=1' : 'reset=1';
+ $query = !empty($item['path_arguments']) ? str_replace(',', '&', $item['path_arguments']) . '&reset=1' : 'reset=1';
- 'url' => CRM_Utils_System::url($path, $query, FALSE),
+ 'url' => CRM_Utils_System::url($path, $query,
+ FALSE, // absolute
+ NULL, // fragment
+ TRUE, // htmlize
+ FALSE, // frontend
+ TRUE // forceBackend; CRM-14439 work-around; acceptable for now because we don't display breadcrumbs on frontend
+ ),
'icon' => CRM_Utils_Array::value('icon', $item),
'extra' => CRM_Utils_Array::value('extra', $item),
);
'icon' => CRM_Utils_Array::value('icon', $item),
'extra' => CRM_Utils_Array::value('extra', $item),
);
if (array_key_exists($currentPath, $menu) &&
isset($menu[$currentPath]['title'])
) {
if (array_key_exists($currentPath, $menu) &&
isset($menu[$currentPath]['title'])
) {
$crumbs[] = array(
'title' => $menu[$currentPath]['title'],
'url' => CRM_Utils_System::url($currentPath,
$crumbs[] = array(
'title' => $menu[$currentPath]['title'],
'url' => CRM_Utils_System::url($currentPath,
static function buildReturnUrl(&$menu, $path) {
if (!isset($menu[$path]['return_url'])) {
list($menu[$path]['return_url'], $menu[$path]['return_url_args']) = self::getReturnUrl($menu, $path);
}
}
static function buildReturnUrl(&$menu, $path) {
if (!isset($menu[$path]['return_url'])) {
list($menu[$path]['return_url'], $menu[$path]['return_url_args']) = self::getReturnUrl($menu, $path);
}
}
static function getReturnUrl(&$menu, $path) {
if (!isset($menu[$path]['return_url'])) {
$pathElements = explode('/', $path);
static function getReturnUrl(&$menu, $path) {
if (!isset($menu[$path]['return_url'])) {
$pathElements = explode('/', $path);
static function get($path) {
// return null if menu rebuild
$config = CRM_Core_Config::singleton();
static function get($path) {
// return null if menu rebuild
$config = CRM_Core_Config::singleton();
$elements = explode(',', $pathArgs);
//CRM_Core_Error::debug( 'e', $elements );
foreach ($elements as $keyVal) {
$elements = explode(',', $pathArgs);
//CRM_Core_Error::debug( 'e', $elements );
foreach ($elements as $keyVal) {