Jump to content

Edit History

Rijen

Rijen

v 1.7.2.4
I need reset for register new hooks in dev process. 
You can use this in your module: (maybe, it legacy variant)

	public function onclickOption($opt, $href)
	{
		if ($opt == 'reset') {
			return	$this->uninstall(false) && $this->install(false);
		}
	}

How it works? In classes/module/Module.php:1399 (vendor code)

$item->onclick_option = method_exists($module, 'onclickOption') ? true : false;

if ($item->onclick_option) {
	$href = Context::getContext()->link->getAdminLink('Module', true) . '&module_name=' . $tmp_module->name . '&tab_module=' . $tmp_module->tab;
	$item->onclick_option_content = array();
	$option_tab = array('desactive', 'reset', 'configure', 'delete');

	foreach ($option_tab as $opt) {
		$item->onclick_option_content[$opt] = $tmp_module->onclickOption($opt, $href);
	}
}


And you can use function reset();
 

 

Rijen

Rijen

v 1.7.2.4
I need reset for register new hooks in dev process. 
You can use this in your module:

	public function onclickOption($opt, $href)
	{
		if ($opt == 'reset') {
			return	$this->uninstall(false) && $this->install(false);
		}
	}

How it works? In classes/module/Module.php:1399 (vendor code)

$item->onclick_option = method_exists($module, 'onclickOption') ? true : false;

if ($item->onclick_option) {
	$href = Context::getContext()->link->getAdminLink('Module', true) . '&module_name=' . $tmp_module->name . '&tab_module=' . $tmp_module->tab;
	$item->onclick_option_content = array();
	$option_tab = array('desactive', 'reset', 'configure', 'delete');

	foreach ($option_tab as $opt) {
		$item->onclick_option_content[$opt] = $tmp_module->onclickOption($opt, $href);
	}
}


 

 

×
×
  • Create New...