Add a menu link with dependency support.
763740
public function menuLinkDependency($title, $link, $translations, $destBid, $weight = 0, $menu = 'main') {
    $menu_link_content = $this->entityManager->getStorage('menu_link_content')->create([
      'title' => $title,
      'link' => ['uri' => 'internal:/node/' . $destBid[0]],
      'menu_name' => (!empty($translations)) ? $menu . '-fr' : $menu,
      'langcode' => (!empty($translations)) ? 'fr' : 'en',
      'parent' => $link,
      'weight' => $weight,
    ]);
    $menu_link_content->save();
    $this->database->update('menu_link_content_data')
      ->fields(['link__uri' => 'entity:node/' . $destBid[0]])
      ->condition('id', $menu_link_content->id())
      ->execute();
    return $menu_link_content;
  }
812965
def init_menu():
    """"""
    # Register breadcrumb root
    item = current_menu.submenu('breadcrumbs.settings')
    item.register('', _('Account'))
    item = current_menu.submenu('breadcrumbs.{0}'.format(
        current_app.config['SECURITY_BLUEPRINT_NAME']))

    if current_app.config.get('SECURITY_CHANGEABLE', True):
        item.register('', _('Change password'))

        # Register settings menu
        item = current_menu.submenu('settings.change_password')
        item.register(
            "{0}.change_password".format(
                current_app.config['SECURITY_BLUEPRINT_NAME']),
            # NOTE: Menu item text (icon replaced by a user icon).
            _('%(icon)s Change password',
                icon='<i class="fa fa-key fa-fw"></i>'),
            order=1)

        # Register breadcrumb
        item = current_menu.submenu('breadcrumbs.{0}.change_password'.format(
            current_app.config['SECURITY_BLUEPRINT_NAME']))
        item.register(
            "{0}.change_password".format(
                current_app.config['SECURITY_BLUEPRINT_NAME']),
            _("Change password"),
            order=0,
        )
195262
def add_dependency(self,my_dep):
        
        if self.dependency_layer is None:
            self.dependency_layer = Cdependencies()
            self.root.append(self.dependency_layer.get_node())
        self.dependency_layer.add_dependency(my_dep)
1083752
def update_menu(self):
        """"""
        self.menu.clear()
        add_actions(self.menu, self.create_context_menu_actions())
1178006
def add_resolved_links(store, drop_defaults):
    """"""
    for widget_id, widget in Widget.widgets.items(): # go over all widgets
        if isinstance(widget, Link) and widget_id not in store:
            if widget.source[0].model_id in store and widget.target[0].model_id in store:
                store[widget.model_id] = widget._get_embed_state(drop_defaults=drop_defaults)
850563
def add_link l
            l.door = @iotas[l.src]
            raise Edoors::Exception.new "Link source #{l.src} does not exist in #{path}" if l.door.nil?
            (@links[l.src] ||= [])<< l
        end
986378
private void addMenuItems(Menu mMenu, boolean subMenu) {
        int groupId = R.id.material_drawer_menu_default_group;
        for (int i = 0; i < mMenu.size(); i++) {
            MenuItem mMenuItem = mMenu.getItem(i);
            IDrawerItem iDrawerItem;
            if (!subMenu && mMenuItem.getGroupId() != groupId && mMenuItem.getGroupId() != 0) {
                groupId = mMenuItem.getGroupId();
                iDrawerItem = new DividerDrawerItem();
                getItemAdapter().add(iDrawerItem);
            }
            if (mMenuItem.hasSubMenu()) {
                iDrawerItem = new PrimaryDrawerItem()
                        .withName(mMenuItem.getTitle().toString())
                        .withIcon(mMenuItem.getIcon())
                        .withIdentifier(mMenuItem.getItemId())
                        .withEnabled(mMenuItem.isEnabled())
                        .withSelectable(false);
                getItemAdapter().add(iDrawerItem);
                addMenuItems(mMenuItem.getSubMenu(), true);
            } else if (mMenuItem.getGroupId() != 0 || subMenu) {
                iDrawerItem = new SecondaryDrawerItem()
                        .withName(mMenuItem.getTitle().toString())
                        .withIcon(mMenuItem.getIcon())
                        .withIdentifier(mMenuItem.getItemId())
                        .withEnabled(mMenuItem.isEnabled());
                getItemAdapter().add(iDrawerItem);
            } else {
                iDrawerItem = new PrimaryDrawerItem()
                        .withName(mMenuItem.getTitle().toString())
                        .withIcon(mMenuItem.getIcon())
                        .withIdentifier(mMenuItem.getItemId())
                        .withEnabled(mMenuItem.isEnabled());
                getItemAdapter().add(iDrawerItem);
            }
        }
    }
158236
def add_menu(self, name):
        
        if name in self._menus:
            raise exceptions.MenuAlreadyExists("Menu name {!r} already exists.".format(name))
        menu = self._menu.addMenu(name)
        self._menus[name] = menu
896400
public function add()
    {
        $this->request->allowMethod(['get', 'post']);

        $menu = $this->Menus->newEntity();
        if ($this->request->is('post') && !empty($this->request->data)) {
            $this->Menus->patchEntity($menu, $this->request->data);
            if ($this->Menus->save($menu)) {
                $this->Flash->success(__d('wasabi_core', 'The menu <strong>{0}</strong> has been created.', $this->request->data['name']));
                $this->redirect(['action' => 'index']);
                return;
            } else {
                $this->Flash->error($this->formErrorMessage);
            }
        }
        $this->set('menu', $menu);
    }
1234046
function installHookDependencies() {
		return Promise.all(hookDependencies.map(function (dependency) {
			return pify(npmi, Promise)({name: dependency, path: path.join(process.env.PWD, 'hooks')});
		}));
	}
511657
public function addMenu($url, $id, $class, $attributes, $menu1, $menu2 = 'geen', $menu3 = 'geen', $menu4 = 'geen', $menu5 = 'geen', $menu6 = 'geen')
    {
        $this->dataMenu[$menu1][$menu2][$menu3][$menu4][$menu5][$menu6]['url'] = $url;
        $this->dataMenu[$menu1][$menu2][$menu3][$menu4][$menu5][$menu6]['id'] = $id;
        $this->dataMenu[$menu1][$menu2][$menu3][$menu4][$menu5][$menu6]['class'] = $class;
        $this->dataMenu[$menu1][$menu2][$menu3][$menu4][$menu5][$menu6]['attrib'] = $attributes;
    }
1005069
def _append(self, menu):
        ''''''
        menu.Append(self.id(), self.name, self.description)
545663
function attachMenu(item) {
        var menuType = item.find('a').hasClass(FOLDER_TYPE) ? "folderMenu" : "itemMenu";
        item.contextMenu({
                menu:menuType
            },
            function (action, el, pos) {
                switch (action) {
                    case ADD_SUBFOLDER_MENU_COMMAND:
                        var parentFolderId = el.find('a').attr('id');
                        addFolder(parentFolderId);
                        break;
                    case DOWNLOAD_MENU_COMMAND:
                        download(el.find('a').attr('id'));
                        break;
                    case RENAME_MENU_COMMAND:
                        rename(el.find('a').attr('id'), true);
                        break;
                    case DELETE_MENU_COMMAND:
                        var link = el.find('a');
                        remove(link.attr('id'), link.hasClass(FOLDER_TYPE) ? FOLDER_TYPE : "");
                        break;
                    default:
                        alert("Todo: apply action '" + action + "' to node " + el);
                }
            });

    }
722596
public function addPage ()
    {
        add_menu_page($this->pageTitle, $this->menuTitle, $this->capability, $this->menuSlug, $this->getDisplayFunction(), $this->icon, $this->order);
    }
808300
def addRelation(self, link):
        '''
        
        '''
        if isinstance(link, Relation):
            self.internalLinks.append(link)
        else:
            raise TypeError(
                'link Type should be InternalLink, not %s' % type(link))
401008
def add_dependency(path, dependency)
      return if metadata[path].nil? || disabled

      unless metadata[path]["deps"].include? dependency
        metadata[path]["deps"] << dependency
        add(dependency) unless metadata.include?(dependency)
      end
      regenerate? dependency
    end
29935
def _insert_options(self, menu):
        """"""
        menu.append(Gtk.SeparatorMenuItem())
        menu.append(self._menuitem(
            _('Mount disc image'),
            self._icons.get_icon('losetup', Gtk.IconSize.MENU),
            run_bg(lambda _: self._losetup())
        ))
        menu.append(Gtk.SeparatorMenuItem())
        menu.append(self._menuitem(
            _("Enable automounting"),
            icon=None,
            onclick=lambda _: self._daemon.automounter.toggle_on(),
            checked=self._daemon.automounter.is_on(),
        ))
        menu.append(self._menuitem(
            _("Enable notifications"),
            icon=None,
            onclick=lambda _: self._daemon.notify.toggle(),
            checked=self._daemon.notify.active,
        ))
        # append menu item for closing the application
        if self._quit_action:
            menu.append(Gtk.SeparatorMenuItem())
            menu.append(self._menuitem(
                _('Quit'),
                self._icons.get_icon('quit', Gtk.IconSize.MENU),
                lambda _: self._quit_action()
            ))