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

// Check authorisation
if (!isset($gCms)) exit;
if ( !$this->CheckPermission('Articles: modify settings') ) exit;

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

// Set preferences
$this->SetPreference('returnid',(int)$params['returnid']);
$this->SetPreference('mode_categories',$params['mode_categories']);
$this->SetPreference('mode_articles',$params['mode_articles']);
$this->SetPreference('mode_article',$params['mode_article']);
$this->SetPreference('mode_cart',$params['mode_cart']);
$this->SetPreference('mode_cartsnippet',$params['mode_cartsnippet']);
$this->SetPreference('mode_form',$params['mode_form']);
$this->SetPreference('mode_summary',$params['mode_summary']);
$this->SetPreference('mode_ack',$params['mode_ack']);
$this->SetPreference('longdesc_use',(int)$params['longdesc_use']);
$this->SetPreference('image_use',(int)$params['image_use']);
$this->SetPreference('order_use',(int)$params['order_use']);
$this->SetPreference('url_use',(int)$params['url_use']);
$this->SetPreference('detailpage_use',(int)$params['detailpage_use']);
$this->SetPreference('dates_use',(int)$params['dates_use']);
$this->SetPreference('availibility_use',(int)$params['availibility_use']);
$this->SetPreference('availibility_count',(int)$params['availibility_count']);
$this->SetPreference('availibility_show',(int)$params['availibility_show']);
$this->SetPreference('deliverytime_use',(int)$params['deliverytime_use']);
$this->SetPreference('shippingcosts_use',(int)$params['shippingcosts_use']);
$this->SetPreference('price_use',(int)$params['price_use']);
$this->SetPreference('vat_use',(int)$params['vat_use']);
$this->SetPreference('vat_standard',$params['vat_standard']);
$this->SetPreference('cart_use',(int)$params['cart_use']);
$this->SetPreference('currency',$params['currency']);
$this->SetPreference('cash_on_delivery',$params['cash_on_delivery']);
$this->SetPreference('emails',$params['emails']);
$this->SetPreference('subject_owner',$params['subject_owner']);
$this->SetPreference('subject_customer',$params['subject_customer']);
$this->SetPreference('date_format',$params['date_format']);
$this->SetPreference('seo_use',(int)$params['seo_use']);
$this->SetPreference('countries',$params['countries']);
$this->SetPreference('use_gallery',$params['gallery_use']);
//trigger_error("GetPreference('use_gallery') is ".$this->GetPreference('use_gallery'));

// Redirect
$this->Redirect($id, 'defaultadmin', $returnid, array( 'tabto'=>$tabto ));

// EOF