You are here

function _power_menu_replace_tid_in_path in Power Menu 7

Same name and namespace in other branches
  1. 6 power_menu.module \_power_menu_replace_tid_in_path()

It's possible for the user to write a path like news/[tid] [tid] is like a token, that will be replaced by the either newly created term id ($tid) or the linked term id.

Parameters

int $tid:

int $mlid:

String $link_path:

1 call to _power_menu_replace_tid_in_path()
_power_menu_form_menu_edit_item_submit in ./power_menu.forms.inc
Callback function when menu_edit_item form is being submitted

File

./power_menu.module, line 83
This module provides some additional menu features. The features are not actually new, but are part of other modules. it's though very cumbersome to creating a new menu item, because one has to go to all the different places to configure these…

Code

function _power_menu_replace_tid_in_path($tid, $mlid, $link_path) {
  $ar = array(
    'mlid' => $mlid,
    'link_path' => str_replace("[tid]", $tid, $link_path),
  );
  drupal_write_record('menu_links', $ar, array(
    'mlid',
  ));
}