Post by ogun » Sat Mar 14, 2015 1:05 am

It's happened to me a few times now, I've clumsily clicked the 'remove' button on an item in the 'welcome' module and had to cancel away from the page to avoid losing whatever I'd accidentally deleted.

This mod adds a confirmation dialog before a 'welcome' module item is deleted.

Code: Select all

<modification>
	<id>Welcome - Confirm Delete</id>
	<version>1.0.0</version>
	<vqmver>2.3.0</vqmver>
	<author>Ogun</author>
	<description>Adds a confirmation check to deleting welcome messages.</description>
	<file name="admin/view/template/module/welcome.tpl">
		<operation>
			<search position="replace"><![CDATA[<a href="#tab-module-<?php echo $module_row; ?>" id="module-<?php echo $module_row; ?>"><?php echo $tab_module . ' ' . $module_row; ?>&nbsp;<img src="view/image/delete.png" alt="" onclick="$('.vtabs a:first').trigger('click'); $('#module-<?php echo $module_row; ?>').remove(); $('#tab-module-<?php echo $module_row; ?>').remove(); return false;" /></a>]]></search>
			<add><![CDATA[<a href="#tab-module-<?php echo $module_row; ?>" id="module-<?php echo $module_row; ?>"><?php echo $tab_module . ' ' . $module_row; ?>&nbsp;<img src="view/image/delete.png" alt="" onclick="if(window.confirm('Are you sure?')){$('.vtabs a:first').trigger('click');$('#module-<?php echo $module_row; ?>').remove();$('#tab-module-<?php echo $module_row; ?>').remove();return false;}" /></a>		
			]]></add>
		</operation>
		<operation>
			<search position="replace"><![CDATA[$('#module-add').before('<a href="#tab-module-' + module_row + '" id="module-' + module_row + '"><?php echo $tab_module; ?> ' + module_row + '&nbsp;<img src="view/image/delete.png" alt="" onclick="$(\'.vtabs a:first\').trigger(\'click\'); $(\'#module-' + module_row + '\').remove(); $(\'#tab-module-' + module_row + '\').remove(); return false;" /></a>');]]></search>
			<add><![CDATA[$('#module-add').before('<a href="#tab-module-' + module_row + '" id="module-' + module_row + '"><?php echo $tab_module; ?> ' + module_row + '&nbsp;<img src="view/image/delete.png" alt="" onclick="if(window.confirm(\'Are you sure?\')){$(\'.vtabs a:first\').trigger(\'click\');$(\'#module-' + module_row + '\').remove();$(\'#tab-module-' + module_row + '\').remove();return false;}" /></a>');]]></add>
		</operation>	
	</file>
</modification>

Active Member

Posts

Joined
Tue Aug 14, 2007 6:04 am
Who is online

Users browsing this forum: No registered users and 4 guests