function tb_megamenu_export_identifier_to_mlid in The Better Mega Menu 7
Convert a menu item identifier back to the respective item's mlid.
Parameters
string $identifier: Menu item identifier based on the item's title and path.
string $menu_name: Name of the menu item's menu.
Return value
mixed Matching mlid or FALSE if none could be determined.
See also
tb_megamenu_export_mlid_to_identifier()
2 calls to tb_megamenu_export_identifier_to_mlid()
- tb_megamenu_export_convert_identifiers in ./
tb_megamenu.features.inc - Converts the identifier fields back to their respective "mlid".
- tb_megamenu_features_rebuild in ./
tb_megamenu.features.inc - Implements hook_features_rebuild().
File
- ./
tb_megamenu.features.inc, line 233 - Features related functions.
Code
function tb_megamenu_export_identifier_to_mlid($identifier, $menu_name) {
list($title, $path) = explode(':', $identifier);
$title = urldecode($title);
$path = urldecode($path);
$query = db_select('menu_links', 'ml');
$query
->fields('ml');
$query
->addField('ml', 'mlid');
$query
->condition('ml.link_path', $path);
$query
->condition('ml.link_title', $title);
$query
->condition('ml.menu_name', $menu_name);
if ($item = $query
->execute()
->fetchAssoc()) {
return $item['mlid'];
}
return FALSE;
}