<?php
class links_admin_permission
{
	var $mydirname;
	var $controller_name;
	var $Links;
	var $constprefMI;

	var $image_path;

	/** Constructor
	 *
	**/
	function __construct($mydirname)
	{
		$this->mydirname = $mydirname;
		$this->controller_name = str_replace('links_', '', get_class($this));
		$this->Links = links_Base::getInstance($this->mydirname);
		$this->Links->setControllerName($this->controller_name);
		$this->Links->breadcrumbs();

		$this->constprefMI = '_MI_' . $this->mydirname;
	}

	function index()
	{
		require_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php';

		// for mymenu.php
		$xoopsModule    = $this->Links->getXoopsModule();
		$mydirname      = $this->mydirname;
		$mytrustdirname = $this->Links->mytrustdirname;

		icms_cp_header() ;
		include 'mymenu.php';

		echo "<h3 style='text-align:left;'>". $this->Links->module_name ." - ". constant($this->constprefMI.'_ADMENU2') ."</h3>\n";
		echo _MD_A_LINKS_GP_NOTE;

		$module_id = $this->Links->module_id;
		$form = new icms_form_Groupperm('', $module_id, 'links_perm', '', 'admin/index.php?c=permission');
		$form->addItem( 1, _MD_A_LINKS_GP_PERM_TO_POST );
		$form->addItem( 2, _MD_A_LINKS_GP_PERM_TO_P_APPROVE );
		$form->addItem( 3, _MD_A_LINKS_GP_PERM_TO_EDIT );
		$form->addItem( 4, _MD_A_LINKS_GP_PERM_TO_E_APPROVE );
		$form->addItem( 5, _MD_A_LINKS_GP_PERM_TO_DELETE );
		$form->addItem( 6, _MD_A_LINKS_GP_PERM_TO_D_APPROVE );

		echo $form->render();
		icms_cp_footer();
	}



}
