本文整理汇总了PHP中mosAdminMenus::Category方法的典型用法代码示例。如果您正苦于以下问题:PHP mosAdminMenus::Category方法的具体用法?PHP mosAdminMenus::Category怎么用?PHP mosAdminMenus::Category使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mosAdminMenus
的用法示例。
在下文中一共展示了mosAdminMenus::Category方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editCategory
/**
* @param database A database connector object
* @param integer The unique id of the category to edit (0 if new)
*/
function editCategory($uid, $menutype, $option)
{
global $database, $my, $mainframe;
$menu = new mosMenu($database);
$menu->load((int) $uid);
// fail if checked out not by 'me'
if ($menu->checked_out && $menu->checked_out != $my->id) {
mosErrorAlert("O módulo " . $menu->title . " está sendo editado atualmente por outro administrador");
}
if ($uid) {
$menu->checkout($my->id);
} else {
$menu->type = 'content_archive_category';
$menu->menutype = $menutype;
$menu->ordering = 9999;
$menu->parent = intval(mosGetParam($_POST, 'parent', 0));
$menu->published = 1;
}
// build the html select list for category
$lists['componentid'] = mosAdminMenus::Category($menu, $uid);
// build the html select list for ordering
$lists['ordering'] = mosAdminMenus::Ordering($menu, $uid);
// build the html select list for the group access
$lists['access'] = mosAdminMenus::Access($menu);
// build the html select list for paraent item
$lists['parent'] = mosAdminMenus::Parent($menu);
// build published button option
$lists['published'] = mosAdminMenus::Published($menu);
// build the url link output
$lists['link'] = mosAdminMenus::Link($menu, $uid);
// get params definitions
$params = new mosParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'menu');
content_archive_category_menu_html::editCategory($menu, $lists, $params, $option);
}
示例2: editCategory
/**
* @param database A database connector object
* @param integer The unique id of the category to edit (0 if new)
*/
function editCategory($uid, $menutype, $option)
{
global $database, $my, $mainframe;
global $mosConfig_absolute_path;
$menu = new mosMenu($database);
$menu->load($uid);
// fail if checked out not by 'me'
if ($menu->checked_out && $menu->checked_out != $my->id) {
echo "<script>alert('The module {$menu->title} is currently being edited by another administrator'); document.location.href='index2.php?option={$option}'</script>\n";
exit(0);
}
if ($uid) {
$menu->checkout($my->id);
} else {
$menu->type = 'content_category';
$menu->menutype = $menutype;
$menu->ordering = 9999;
$menu->parent = intval(mosGetParam($_POST, 'parent', 0));
$menu->published = 1;
}
// build the html select list for category
$lists['componentid'] = mosAdminMenus::Category($menu, $uid);
// build the html select list for ordering
$lists['ordering'] = mosAdminMenus::Ordering($menu, $uid);
// build the html select list for the group access
$lists['access'] = mosAdminMenus::Access($menu);
// build the html select list for paraent item
$lists['parent'] = mosAdminMenus::Parent($menu);
// build published button option
$lists['published'] = mosAdminMenus::Published($menu);
// build the url link output
$lists['link'] = mosAdminMenus::Link($menu, $uid);
// get params definitions
$params =& new mosParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'component');
content_category_menu_html::editCategory($menu, $lists, $params, $option);
}