Cancel button not working

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Gjjansen
New Member
New Member
Posts: 2
Joined: Tue Apr 29, 2014 5:39 pm

Cancel button not working

Post by Gjjansen »

Hello,

I started developing a simple module, everythings goes well, but now i stuck with the 'cancel' button in the admin part..

I create the cancel button this way:

Code: Select all

<?php
if  (!isset($gCms))  exit;
	
	if (isset($params['cancel']))
	{
		$this->Redirect($id, 'defaultadmin', $returnid);
	}

$smarty->assign('cancel', $this->CreateInputSubmit($id, 'cancel', lang('cancel')));
	$smarty->assign('submit', $this->CreateInputSubmit($id, 'submit', lang('submit')));
    $smarty->assign('startform', $this->CreateFormStart ($id, 'orderview', $returnid));
    $smarty->assign('enform',$this->CreateFormEnd());
	
	echo  $this->ProcessTemplate('vieworder.tpl');

?>
And in the template i call it this way:

Code: Select all

{$startform}
<div class="pageoverflow">
	<p class="pagetext">&nbsp;</p>
	<p class="pageinput">{$submit}{$cancel}</p>
</div>
{$endform}
When i now click the cancel or submit button, it returns to admin/moduleinterface.php

What do i do wrong...

Kind regards,
Gjjansen
Gjjansen
New Member
New Member
Posts: 2
Joined: Tue Apr 29, 2014 5:39 pm

Re: Cancel button not working

Post by Gjjansen »

I already found my stupid mistake that made my hours of searching..

I had to change

Code: Select all

$smarty->assign('startform', $this->CreateFormStart ($id, 'orderview', $returnid));
to:

Code: Select all

$smarty->assign('startform', $this->CreateFormStart ($id, 'admin_view_order', $returnid));


Kind regards,
Gjjansen
Post Reply

Return to “Developers Discussion”