method addShortcut documentation in bbn\Appui\Menu
Adds an user'shortcut from a menu
function(string $id)
{
if (($bit = $this->pref->getBit($id, false))
&& ($id_option = $this->fromPath('shortcuts'))
&& ($c = $this->pref->getClassCfg())
) {
if ($id_menu = $this->pref->getByOption($id_option)) {
$id_menu = $id_menu[$c['arch']['user_options']['id']];
}
else {
$id_menu = $this->pref->add($id_option, [$c['arch']['user_options']['text'] => X::_('Shortcuts')]);
}
if (!empty($id_menu)
&& ($arch = $c['arch']['user_options_bits'])
) {
if (($bits = $this->pref->getBits($id_menu, false, false))
&& ( X::find($bits, [$arch['id_option'] => $bit[$arch['id_option']]]) !== null)
) {
return null;
}
return $this->pref->addBit(
$id_menu, [
$arch['id_option'] => $bit[$arch['id_option']],
$arch['text'] => $bit[$arch['text']],
$arch['cfg'] => $bit[$arch['cfg']],
$arch['num'] => $this->pref->nextBitNum($id_menu) ?: 1
]
);
}
}
return null;
}
Adds an user'shortcut from a menu BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2024
BBN Solutions