本文整理汇总了PHP中Default_Model_Menu::getgroup_formenu方法的典型用法代码示例。如果您正苦于以下问题:PHP Default_Model_Menu::getgroup_formenu方法的具体用法?PHP Default_Model_Menu::getgroup_formenu怎么用?PHP Default_Model_Menu::getgroup_formenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Default_Model_Menu
的用法示例。
在下文中一共展示了Default_Model_Menu::getgroup_formenu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: menubuilder
/**
** 1. gets menudata from database
** 2. prepares the first and second level menuids array
** 3. builds the menu tree html
** 4. con = settings for settings menu
**/
public function menubuilder($con = "", $userRole = 2, $flag = "", $usergroup)
{
$uploadPath = BASE_URL . '/public/media/images/menuIcons/';
$menuheightclass = '';
$groupbasedclass = '';
$ulclass = '';
if ($usergroup == '' || $usergroup == MANAGEMENT_GROUP) {
$menuheightclass = '';
$groupbasedclass = '';
} else {
$menuheightclass = 'menuheight';
$groupbasedclass = '-common';
$ulclass = 'new-roles';
}
$menu_model = new Default_Model_Menu();
$marr = $menu_model->getgroup_formenu($usergroup, $userRole, '');
$menuarr = $marr['tmpArr'];
$parent_menu_class = array(SITECONFIGURATION => 'site-configuration', EMPLOYEECONFIGURATION => "employee-configuration", SITEPREFERENCE => "site-preferences", ORGANIZATION => "organization-menu", USERMANAGEMENT => "user-management", HUMANRESOURCE => "hr-module", RESOURCEREQUISITION => "req-module", EMPLOYEESELFSERVICE => "ess-module", BGCHECKS => "bg-module", REPORTS => "report-module", MANAGEMODULE => "manage-module", SERVICEDESK => 'service-desk', PERFORMANCEAPPRAISAL => "perf-app", FEED_FORWARD => "feed-forward", DASHBOARD_MENU => "dashboard");
$parent_menu_selected_class = array(SITECONFIGURATION => 'sitec-selected', EMPLOYEECONFIGURATION => "employeec-selected", SITEPREFERENCE => "sitep-selected", ORGANIZATION => "organization-selected", USERMANAGEMENT => "user-selected", HUMANRESOURCE => "hr-selected", RESOURCEREQUISITION => "req-selected", EMPLOYEESELFSERVICE => "ess-selected", BGCHECKS => "bg-selected", REPORTS => "report-selected", MANAGEMODULE => "manage-selected", SERVICEDESK => 'service-selected', PERFORMANCEAPPRAISAL => "perf-app-selected", FEED_FORWARD => 'feed-forward-selected', DASHBOARD_MENU => "dashboard-selected");
$tour_menu_class = array(SITECONFIGURATION => 'tour_siteconfiguration', EMPLOYEECONFIGURATION => "tour_employeeconfigurations", SITEPREFERENCE => "tour_sitepreferences", ORGANIZATION => "tour_organization", USERMANAGEMENT => "tour_usermanagement", HUMANRESOURCE => "tour_humanresource", RESOURCEREQUISITION => "tour_requisition", EMPLOYEESELFSERVICE => "tour_employeeselfservice", BGCHECKS => "tour_backgroundchecks", REPORTS => "tour_reports", MANAGEMODULE => "tour_managemodules", SERVICEDESK => 'tour_service', PERFORMANCEAPPRAISAL => "tour_performanceappraisal", FEED_FORWARD => 'tour_feedforward', DASHBOARD_MENU => "tour_dashboard");
$childs_menu = "";
$parent_menu = "<div class='home_menu'><div class='menu-head " . $menuheightclass . "' id='menu-shadow' style='display:none;'>\n\t\t\t\t<ul id='scroller' class='" . $ulclass . "'>";
$clas_drag = $con == 'settings' ? ' draggable-reports-li ' : '';
// Add draggable class for dashbord
$parent_menu .= "<li id='main_parent_" . DASHBOARD_MENU . "' super-parent = 'main_parent_" . DASHBOARD_MENU . "' class = '" . $clas_drag . "clickable_menu " . $parent_menu_selected_class[DASHBOARD_MENU] . "-main " . $tour_menu_class[DASHBOARD_MENU] . "' menu-url ='" . BASE_URL . "/welcome' selected-class = '" . $parent_menu_selected_class[DASHBOARD_MENU] . "' > <a id='" . DASHBOARD_MENU . "' ><span class='scroll-menu dashboard dashboard-selected-common super_selected'></span><b>Dashboard</b></a></li>";
foreach ($menuarr as $menuid => $data) {
$for_childs_str = "";
$parent_url = BASE_URL . $data['url'];
if (isset($data['childs']) && count($data['childs']) > 0) {
$for_childs_str = "div_mchilds_" . $menuid;
$parent_url = "";
$childs_menu .= "<div class='side-menu " . $for_childs_str . "' style='display:none;'>\n\t\t\t\t\t\t\t\t\t<ul>";
foreach ($data['childs'] as $ch_menu_id => $ch_menu_data) {
if (isset($ch_menu_data['childs']) && count($ch_menu_data['childs']) > 0) {
$childs_menu .= "<li class='acc_li'><span class='acc_li_toggle' id='acc_li_toggle_" . $ch_menu_data['id'] . "' onclick='togglesubmenus(" . $ch_menu_data['id'] . ");'><b>" . $ch_menu_data['menuName'] . "</b></span><ul>";
foreach ($ch_menu_data['childs'] as $ch2_menu_id => $ch2_menu_data) {
if ($con == 'settings') {
$childs_menu .= "<li class = 'clickable_menu' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . BASE_URL . $ch2_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch2_menu_data['id'] . " href='javascript:void(0);'>" . $ch2_menu_data['menuName'] . "</a></li>";
} else {
$childs_menu .= "<li class = 'clickable_menu' primary_parent = '" . $ch2_menu_data['parent'] . "' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . BASE_URL . $ch2_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch2_menu_data['id'] . " href='" . BASE_URL . $ch2_menu_data['url'] . "/'>" . $ch2_menu_data['menuName'] . "</a></li>";
}
}
$childs_menu .= "</ul></li>";
} else {
if ($con == 'settings') {
if ($menuid == SERVICEDESK && $ch_menu_id == SD_TRANS) {
$storage = new Zend_Auth_Storage_Session();
$sess_data = $storage->read();
$childs_menu .= sapp_Helper::service_header($sess_data, 'menusettings');
} else {
$childs_menu .= "<li class = 'clickable_menu single-menu' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . BASE_URL . $ch_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch_menu_data['id'] . " href='javascript:void(0);'>" . $ch_menu_data['menuName'] . "</a></li>";
}
} else {
if ($menuid == SERVICEDESK && $ch_menu_id == SD_TRANS) {
$storage = new Zend_Auth_Storage_Session();
$sess_data = $storage->read();
$childs_menu .= sapp_Helper::service_header($sess_data, 'menu');
} else {
$condition = $ch_menu_data['id'] == 168 ? "<span class='beta_menu'></span>" : "";
$childs_menu .= "<li class = 'clickable_menu single-menu' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . BASE_URL . $ch_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch_menu_data['id'] . " href='" . BASE_URL . $ch_menu_data['url'] . "/'>" . $ch_menu_data['menuName'] . $condition . "</a></li>";
}
}
}
}
$childs_menu .= "</ul></div>";
}
$super_str = "";
$dummy_parent_div = "";
if ($menuid == SITEPREFERENCE) {
$super_str = " super-parent = 'main_parent_" . $menuid . "' ";
$dummy_parent_div = "parent-div = 'dummy'";
}
if ($con == 'settings') {
$parent_menu .= "<li id='main_parent_" . $menuid . "' " . $dummy_parent_div . " " . $super_str . " super-parent = 'main_parent_" . $menuid . "' class = 'draggable-reports-li clickable_menu " . $parent_menu_selected_class[$menuid] . ($groupbasedclass != '' ? "-main-common " : "-main ") . $tour_menu_class[$menuid] . "' menu-url ='" . $parent_url . "' for-childs = '" . $for_childs_str . "' selected-class = '" . ($groupbasedclass != '' ? $parent_menu_selected_class[$menuid] . "-common" : $parent_menu_selected_class[$menuid]) . "'><a id='" . $menuid . "'><span class='scroll-menu " . ($groupbasedclass != '' ? $parent_menu_class[$menuid] . "-common" : $parent_menu_class[$menuid]) . "'></span><b>" . $data['menuName'] . "</b></a></li>";
} else {
$groupclass = "";
$parent_menu .= "<li id='main_parent_" . $menuid . "' " . $dummy_parent_div . " " . $super_str . " super-parent = 'main_parent_" . $menuid . "' class = 'clickable_menu " . $parent_menu_selected_class[$menuid] . ($groupbasedclass != '' ? "-main-common " : "-main ") . $tour_menu_class[$menuid] . "' menu-url ='" . $parent_url . "' for-childs = '" . $for_childs_str . "' selected-class = '" . ($groupbasedclass != '' ? $parent_menu_selected_class[$menuid] . "-common" : $parent_menu_selected_class[$menuid]) . "'><a id='" . $menuid . "'><span class='scroll-menu " . ($groupbasedclass != '' ? $parent_menu_class[$menuid] . "-common" : $parent_menu_class[$menuid]) . "'></span><b>" . $data['menuName'] . "</b></a></li>";
}
}
//end of for loop
if (($userRole == SUPERADMIN || $usergroup == MANAGEMENT_GROUP) && $con != 'settings') {
$parent_menu .= "<li selected-class='log-selected' id='main_parent_logs' class='clickable_menu log-selected-main tour_logs' menu-url='' for-childs = 'div_mchilds_logs'><span class='scroll-menu log-module'></span><b>Logs</b></li>";
$childs_menu .= "<div class='side-menu div_mchilds_logs' style='display:none;'>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t<li super-parent = 'main_parent_logs' parent-div='div_mchilds_logs' class = 'clickable_menu single-menu' menu-url = '" . BASE_URL . "/logmanager'><a href='" . BASE_URL . "/logmanager'>Activity Log</a></li>\n\t\t\t\t\t\t\t\t<li super-parent = 'main_parent_logs' parent-div='div_mchilds_logs' class = 'clickable_menu single-menu' menu-url = '" . BASE_URL . "/userloginlog'><a href='" . BASE_URL . "/userloginlog'>User Log</a></li>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t </div>";
}
$parent_menu .= " </ul>\n\t\t\t </div></div>\n\t\t";
return array('parent_menu' => $parent_menu, 'childs_menu' => $childs_menu);
}
示例2: menubuilder
/**
** 1. gets menudata from database
** 2. prepares the first and second level menuids array
** 3. builds the menu tree html
** 4. con = settings for settings menu
**/
public function menubuilder($con = "", $userRole = 2, $flag = "", $usergroup)
{
$uploadPath = BASE_URL . 'public/media/images/menuIcons/';
$menuheightclass = '';
$groupbasedclass = '';
$ulclass = '';
if ($usergroup == '' || $usergroup == MANAGEMENT_GROUP) {
$menuheightclass = '';
$groupbasedclass = '';
} else {
$menuheightclass = 'menuheight';
$groupbasedclass = '-common';
$ulclass = 'new-roles';
}
$menu_model = new Default_Model_Menu();
$marr = $menu_model->getgroup_formenu($usergroup, $userRole, '');
$active_menus = $menu_model->getisactivemenus();
$act_menus = array();
if (!empty($active_menus)) {
foreach ($active_menus as $act) {
$act_menus[$act['id']] = $act;
}
}
$menuarr = $marr['tmpArr'];
/*** removing icons in the menu 07-08-2015 - START - ***
$parent_menu_class = array(SITECONFIGURATION => 'site-configuration',EMPLOYEECONFIGURATION => "employee-configuration",
SITEPREFERENCE => "site-preferences",ORGANIZATION => "organization-menu",
USERMANAGEMENT => "user-management",HUMANRESOURCE => "hr-module",RESOURCEREQUISITION => "req-module",
EMPLOYEESELFSERVICE => "ess-module",BGCHECKS => "bg-module",
REPORTS => "report-module",MANAGEMODULE => "manage-module",SERVICEDESK => 'service-desk',
PERFORMANCEAPPRAISAL => "perf-app",FEED_FORWARD => "feed-forward",DASHBOARD_MENU => "dashboard",ANNOUNCEMENTS => ""
);
$parent_menu_selected_class = array(
SITECONFIGURATION => 'sitec-selected',EMPLOYEECONFIGURATION => "employeec-selected",
SITEPREFERENCE => "sitep-selected",ORGANIZATION => "organization-selected",
USERMANAGEMENT => "user-selected",HUMANRESOURCE => "hr-selected",RESOURCEREQUISITION => "req-selected",
EMPLOYEESELFSERVICE => "ess-selected",BGCHECKS => "bg-selected",
REPORTS => "report-selected",MANAGEMODULE => "manage-selected",
SERVICEDESK => 'service-selected',PERFORMANCEAPPRAISAL => "perf-app-selected",FEED_FORWARD => 'feed-forward-selected',DASHBOARD_MENU => "dashboard-selected",ANNOUNCEMENTS => ""
);
$tour_menu_class = array(SITECONFIGURATION => 'tour_siteconfiguration',
EMPLOYEECONFIGURATION => "tour_employeeconfigurations",
SITEPREFERENCE => "tour_sitepreferences",ORGANIZATION => "tour_organization",
USERMANAGEMENT => "tour_usermanagement",HUMANRESOURCE => "tour_humanresource",
RESOURCEREQUISITION => "tour_requisition",EMPLOYEESELFSERVICE => "tour_employeeselfservice",
BGCHECKS => "tour_backgroundchecks",REPORTS => "tour_reports",
MANAGEMODULE =>"tour_managemodules",SERVICEDESK => 'tour_service',PERFORMANCEAPPRAISAL => "tour_performanceappraisal",
FEED_FORWARD => 'tour_feedforward',DASHBOARD_MENU => "tour_dashboard" ,ANNOUNCEMENTS => "tour_dashboard"
);
******* removing icons in the menu 07-08-2015 - END - ***/
$parent_menu_class = array(SITECONFIGURATION => '', EMPLOYEECONFIGURATION => "", SITEPREFERENCE => "", ORGANIZATION => "", USERMANAGEMENT => "", HUMANRESOURCE => "", RESOURCEREQUISITION => "", EMPLOYEESELFSERVICE => "", BGCHECKS => "", REPORTS => "", MANAGEMODULE => "", SERVICEDESK => '', PERFORMANCEAPPRAISAL => "", FEED_FORWARD => "", DASHBOARD_MENU => "", ANNOUNCEMENTS => "", TIMEMANAGEMENT => "");
$parent_menu_selected_class = array(SITECONFIGURATION => '', EMPLOYEECONFIGURATION => "", SITEPREFERENCE => "", ORGANIZATION => "", USERMANAGEMENT => "", HUMANRESOURCE => "", RESOURCEREQUISITION => "", EMPLOYEESELFSERVICE => "", BGCHECKS => "", REPORTS => "", MANAGEMODULE => "", SERVICEDESK => '', PERFORMANCEAPPRAISAL => "", FEED_FORWARD => '', DASHBOARD_MENU => "", ANNOUNCEMENTS => "", TIMEMANAGEMENT => "");
$tour_menu_class = array(SITECONFIGURATION => 'tour_siteconfiguration', EMPLOYEECONFIGURATION => "tour_employeeconfigurations", SITEPREFERENCE => "tour_sitepreferences", ORGANIZATION => "tour_organization", USERMANAGEMENT => "tour_usermanagement", HUMANRESOURCE => "tour_humanresource", RESOURCEREQUISITION => "tour_requisition", EMPLOYEESELFSERVICE => "tour_employeeselfservice", BGCHECKS => "tour_backgroundchecks", REPORTS => "tour_reports", MANAGEMODULE => "tour_managemodules", SERVICEDESK => 'tour_service', PERFORMANCEAPPRAISAL => "tour_performanceappraisal", FEED_FORWARD => 'tour_feedforward', DASHBOARD_MENU => "tour_dashboard", ANNOUNCEMENTS => "tour_dashboard", TIMEMANAGEMENT => "tour_timemanagement");
$childs_menu = "";
$parent_menu = "<div class='home_menu'><div role='main' class='menu-head main" . $menuheightclass . "' id='menu-shadow' style='display:none;'>\n\t\t\t\t<ul id='main_ul' class='menu flex'>";
$clas_drag = $con == 'settings' ? ' draggable-reports-li ' : '';
// Add draggable class for dashbord
/*** commented to remove menu icon 07-08-2015 - START - ***
$parent_menu .= "<li id='main_parent_".DASHBOARD_MENU."' super-parent = 'main_parent_".DASHBOARD_MENU."' class = '".$clas_drag."clickable_menu ".$parent_menu_selected_class[DASHBOARD_MENU]."-main ".$tour_menu_class[DASHBOARD_MENU]."' menu-url ='".BASE_URL."welcome' selected-class = '".$parent_menu_selected_class[DASHBOARD_MENU]."' > <a id='".DASHBOARD_MENU."' ><span class='scroll-menu dashboard dashboard-selected-common super_selected'></span><b>Dashboard</b></a></li>";
*** commented to remove menu icon 07-08-2015 - END - ***/
$parent_menu .= "<li id='main_parent_" . DASHBOARD_MENU . "' super-parent = 'main_parent_" . DASHBOARD_MENU . "' class = '" . $clas_drag . "clickable_menu " . $parent_menu_selected_class[DASHBOARD_MENU] . "-main " . $tour_menu_class[DASHBOARD_MENU] . "' menu-url ='" . BASE_URL . "welcome' selected-class = '" . $parent_menu_selected_class[DASHBOARD_MENU] . "' > <a id='" . DASHBOARD_MENU . "' ><b>Dashboard</b></a></li>";
foreach ($menuarr as $menuid => $data) {
$for_childs_str = "";
$parent_url = rtrim(BASE_URL, "/") . $data['url'];
if (isset($data['childs']) && count($data['childs']) > 0) {
$for_childs_str = "div_mchilds_" . $menuid;
$parent_url = "";
$childs_menu .= "<div class='side-menu " . $for_childs_str . "' style='display:none;'>\n\t\t\t\t\t\t\t\t\t<ul>";
foreach ($data['childs'] as $ch_menu_id => $ch_menu_data) {
if (isset($ch_menu_data['childs']) && count($ch_menu_data['childs']) > 0) {
$childs_menu .= "<li class='acc_li'><span class='acc_li_toggle' id='acc_li_toggle_" . $ch_menu_data['id'] . "' onclick='togglesubmenus(" . $ch_menu_data['id'] . ");'><b>" . $ch_menu_data['menuName'] . "</b></span><ul>";
foreach ($ch_menu_data['childs'] as $ch2_menu_id => $ch2_menu_data) {
if ($con == 'settings') {
if ($ch2_menu_id == MANAGE_POLICY_DOCS) {
/** policy document categories is not built as menu items
** for settings page
**/
} else {
$childs_menu .= "<li class = 'clickable_menu' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . rtrim(BASE_URL, "/") . $ch2_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch2_menu_data['id'] . "\t\thref='javascript:void(0);'>" . $ch2_menu_data['menuName'] . "</a></li>";
}
} else {
if ($ch2_menu_id == MANAGE_POLICY_DOCS) {
/** to build policy document categories as menu items **/
$childs_menu .= sapp_Helper::viewPolicyDocuments('menu');
} else {
$childs_menu .= "<li class = 'clickable_menu' primary_parent = '" . $ch2_menu_data['parent'] . "' super-parent = 'main_parent_" . $menuid . "' menu-url = '" . rtrim(BASE_URL, "/") . $ch2_menu_data['url'] . "' parent-div = '" . $for_childs_str . "'><a id=" . $ch2_menu_data['id'] . " href='" . rtrim(BASE_URL, "/") . $ch2_menu_data['url'] . "/'>" . $ch2_menu_data['menuName'] . "</a></li>";
}
}
}
$childs_menu .= "</ul></li>";
} else {
//.........这里部分代码省略.........