<commit_before><?php
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

class Services_Menu_Controller
{

	function action_get_menu($input)
	{
		$menuId = $input->menuId->int();
		return TikiLib::lib('menu')->get_menu($menuId);
	}

	function action_manage_menu ($input)
	{
		//check permissions
		$perms = Perms::get('menu');
		if (! $perms->tiki_p_edit_menu) {
			throw new Services_Exception_Denied(tr("You don't have permission to edit menus (tiki_p_edit_menu)"));
		}
		
		//get menu details
		$menuId = $input->menuId->int();
		$info = TikiLib::lib('menu')->get_menu($menuId);
		$symbol = Tiki_Profile::getObjectSymbolDetails('menu', $menuId);
			
		//execute menu insert/update
		$confirm = $input->confirm->int();
		if ($confirm) {
			$menuId = $input->menuId->int();
			$name = $input->name->text();
			$description = $input->description->text();
			$type = $input->type->text();
			$icon = $input->icon->text(); 
			$use_items_icons = $input->use_items_icons->int() ? 'y' : 'n';
			$parse = $input->parse->int() ? 'y' : 'n';
			<commit_msg>[REF] menu: update function for new ticket system so use of smarty function {ticket} will still work after it was updated<commit_after><?php
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

class Services_Menu_Controller
{

	function action_get_menu($input)
	{
		$menuId = $input->menuId->int();
		return TikiLib::lib('menu')->get_menu($menuId);
	}

	function action_manage_menu ($input)
	{
		//check permissions
		$perms = Perms::get('menu');
		if (! $perms->tiki_p_edit_menu) {
			throw new Services_Exception_Denied(tr("You don't have permission to edit menus (tiki_p_edit_menu)"));
		}
		$util = new Services_Utilities();
		$util->checkTicket();

		//get menu details
		$menuId = $input->menuId->int();
		$info = TikiLib::lib('menu')->get_menu($menuId);
		$symbol = Tiki_Profile::getObjectSymbolDetails('menu', $menuId);
			
		//execute menu insert/update
		$confirm = $input->confirm->int();
		if ($confirm && $util->access->ticketMatch()) {
			$menuId = $input->menuId->int();
			$name = $input->name->text();
			$description = $input->description->text();
			$type = $input->type->text();
			$icon = $input->icon->text(); 
			$use_items_icons = $input->use_items_icons->int() ? 'y' : 'n';
			$parse = $input->parse->int() ? 'y' : 'n';
			
{'fraction_non_alphanumeric': 0.17341678939617083, 'fraction_numerical': 0.005891016200294551, 'mean_word_length': 4.1555977229601515, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 52, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '805972', 'n_tokens_mistral': 1008, 'n_tokens_neox': 898, 'n_words': 227}