<?php
/*======================================================================================
Module: Articles
======================================================================================*/

// Check authorisation
$errors = array();
if (!isset($gCms)) exit;
if ( !$this->CheckPermission('Modify Templates') ) {
	$errors[] = $this->Lang('needpermission', array($this->Lang('modarticles')));
} else {

	// Get POST data
	$tabto = isset($params['tabto']) ? preg_replace('/[^0-9a-zA-Z_-]/','',$params['tabto']) : '';
	$template = isset($params['template']) ? preg_replace('/[^0-9a-zA-Z_-]/','',$params['template']) : '';

	// Delete the template
	if ($template) $this->DeleteTemplate($template,$this->getName());

	// Redirect
	if (!$errors) $this->Redirect($id, 'defaultadmin', $returnid, array('tabto'=>$tabto, 'message' => $this->Lang('postdelete')));

}

// EOF