本文整理汇总了PHP中linked_install_process_menu_items函数的典型用法代码示例。如果您正苦于以下问题:PHP linked_install_process_menu_items函数的具体用法?PHP linked_install_process_menu_items怎么用?PHP linked_install_process_menu_items使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了linked_install_process_menu_items函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install_menu_lang_export
public function install_menu_lang_export($langs_ids)
{
if (empty($langs_ids)) {
return false;
}
$this->CI->load->helper('menu');
$return = array();
foreach ($this->menu as $gid => $menu_data) {
$temp = linked_install_process_menu_items($this->menu, 'export', $gid, 0, $this->menu[$gid]["items"], $gid, $langs_ids);
$return = array_merge($return, $temp);
}
return array("menu" => $return);
}
示例2: install_menu_lang_export
public function install_menu_lang_export($langs_ids)
{
if (empty($langs_ids)) {
return false;
}
$this->CI->load->helper('menu');
$return = array();
foreach (array_keys($this->_menu) as $gid) {
$temp = linked_install_process_menu_items($this->_menu, 'export', $gid, 0, $this->_menu[$gid]['items'], $gid, $langs_ids);
$return = array_merge($return, $temp);
}
return array('menu' => $return);
}
示例3: linked_install_process_menu_items
function linked_install_process_menu_items(&$structure, $process_type, $menu_gid, $parent_id, &$items, $lang_prefix = "", $lang_data = array(), $lang_tooltip_data = array())
{
$menu_data = $structure[$menu_gid];
if (empty($menu_data["id"])) {
$menu_data["id"] = $structure[$menu_gid]["id"] = linked_install_set_menu($menu_gid, "none");
}
if (empty($menu_data["id"])) {
return array();
}
if ($process_type == "export") {
$return = array();
}
if (!empty($items)) {
foreach ($items as $item_gid => $item_data) {
if ($process_type == "create") {
if (!isset($item_data["action"])) {
$item_data["action"] = '';
}
if (!isset($item_data["link"])) {
$item_data["link"] = '/';
}
if (!isset($item_data["icon"])) {
$item_data["icon"] = '';
}
if (!isset($item_data["status"])) {
$item_data["status"] = 0;
}
if (!isset($item_data["sorter"])) {
$item_data["sorter"] = 0;
}
if (!isset($item_data["indicator_gid"])) {
$item_data["indicator_gid"] = '';
}
$items[$item_gid]["id"] = linked_install_set_menu_item($item_gid, $menu_data['id'], $item_data["action"], $parent_id, $item_data["link"], $item_data['icon'], $item_data["status"], $item_data["sorter"], $item_data["indicator_gid"]);
if (!empty($items[$item_gid]["items"])) {
linked_install_process_menu_items($structure, $process_type, $menu_gid, (int) $items[$item_gid]["id"], $items[$item_gid]["items"]);
}
} elseif ($process_type == "update") {
$new_prefix = $lang_prefix . '_' . $item_gid;
$new_prefix_tooltip = $lang_prefix . '_' . $item_gid . "_tooltip";
if (!empty($lang_data[$new_prefix])) {
$item_lang_data = $lang_data[$new_prefix];
} else {
$item_lang_data = null;
}
if (!empty($lang_data[$new_prefix_tooltip])) {
$item_lang_tooltip_data = $lang_data[$new_prefix_tooltip];
} else {
$item_lang_tooltip_data = null;
}
$item_id = $items[$item_gid]["id"];
if (!$item_id) {
$items[$item_gid]["id"] = $item_id = linked_install_set_menu_item($item_gid, $menu_data["id"], "none");
}
linked_install_set_menu_item_lang($item_id, $menu_data["id"], "update", $item_lang_data, $item_lang_tooltip_data);
if (!empty($items[$item_gid]["items"])) {
linked_install_process_menu_items($structure, $process_type, $menu_gid, $item_id, $items[$item_gid]["items"], $new_prefix, $lang_data, $lang_tooltip_data);
}
} elseif ($process_type == "export") {
$new_prefix = $lang_prefix . '_' . $item_gid;
$new_prefix_tooltip = $lang_prefix . '_' . $item_gid . "_tooltip";
$item_id = $items[$item_gid]["id"];
if (!$item_id) {
$items[$item_gid]["id"] = $item_id = linked_install_set_menu_item($item_gid, $menu_data["id"], "none");
}
if ('create' == $items[$item_gid]["action"]) {
$return[$new_prefix] = linked_install_set_menu_item_lang($item_id, $menu_data["id"], "export", $lang_data);
$return[$new_prefix_tooltip] = linked_install_set_menu_item_lang($item_id, $menu_data["id"], "export", $lang_data, array(), 'tooltip');
}
if (!empty($items[$item_gid]["items"])) {
$temp = linked_install_process_menu_items($structure, $process_type, $menu_gid, $item_id, $items[$item_gid]["items"], $new_prefix, $lang_data);
$return = array_merge($return, $temp);
}
}
}
}
if ($process_type == "export") {
return $return;
} else {
return;
}
}