<?php

require_once dirname(dirname(dirname(__FILE__))) . '/class/core/ActionBase.class.php';

class Xoonips_PolicyItemMenuAction extends Xoonips_ActionBase {

	protected function doInit(&$request, &$response) {

		// breadcrumbs
		$breadcrumbs = array(
  		array(
		    'name' => _AM_XOONIPS_TITLE,
		    'url' => XOOPS_URL.'/modules/'.$this->dirname.'/admin/index.php',
  		),
		array(
		   	'name' => _AM_XOONIPS_POLICY_TITLE,
		    'url' => XOOPS_URL.'/modules/'.$this->dirname.'/admin/policy.php',
		),
		array(
		    'name' => _AM_XOONIPS_POLICY_ITEM_TITLE,
		),
		);

		// menu
		$menu = array(
		  	array(
    			'label' => _AM_XOONIPS_POLICY_ITEMTYPE_TITLE,
    			'url' => XOOPS_URL.'/modules/'.$this->dirname.'/admin/policy_itemtype.php',
  			),
  			array(
		   	'label' => _AM_XOONIPS_POLICY_ITEMFIELDGROUP_TITLE,
    			'url' => XOOPS_URL.'/modules/'.$this->dirname.'/admin/policy_itemgroup.php',
  			),
		  	array(
		   	'label' => _AM_XOONIPS_POLICY_ITEMFIELD_TITLE,
    			'url' => XOOPS_URL.'/modules/'.$this->dirname.'/admin/policy_itemfield.php',
  			),
		  	array(
		    	'label' => _AM_XOONIPS_POLICY_ITEM_PUBLIC_TITLE,
		    	'url' => XOOPS_URL.'/modules/'.$this->dirname.'/admin/policy_item_public.php',
		  	),
		  	array(
		    	'label' => _AM_XOONIPS_POLICY_ITEMSORT_LIST_TITLE,
		    	'url' => XOOPS_URL.'/modules/'.$this->dirname.'/admin/policy_itemsort.php',
		  	),
  			array(
    			'label' => _AM_XOONIPS_POLICY_QUICKSEARCH_TITLE,
    			'url' => XOOPS_URL.'/modules/'.$this->dirname.'/admin/policy_quicksearch.php',
  			),
		);

		// get common viewdata
		$viewData = array();

		$viewData['menu'] = $menu;
		$viewData['breadcrumbs'] = $breadcrumbs;

		$response->setViewData($viewData);
		$response->setForward('init_success');

		return true;
	}
}

