<?php
# ************** LICENCE ****************
/*
	Copyright (c) PORTANEO.
*/
# ***************************************
# POSH Admin mobile- update widget properties
#
# !! be careful, this file must be saved under uft8 format, and display an e accentuated here : é
# ***************************************

if (!isset($_POST["modid"])) exit();
if (!isset($_POST["picture"])) exit();
if (!isset($_POST["title"])) exit();
if (!isset($_POST["available"])) exit();
$modid = $_POST["modid"];
$picture = $_POST["picture"];
$title = $_POST["title"];
$available = $_POST["available"];

$folder="../includes/plugins/mobile/admin/";
$not_access=1;
$granted="A";
$pagename="../includes/plugins/mobile/admin/scr_update_widget_properties.php";

//includes
require('includes.php');
require_once('../../../../includes/xml.inc.php');

//control that the current administrator has access to the script
$grantedCalls = array("modulestab");
require('../../../../admin/adm_ctrl_access.php');

$file=new xmlFile();

$file->header();

$DB->execute($widgets_mob_updateWidgetProperties,$DB->quote($title),$DB->quote($picture),$DB->escape($available),$DB->escape($modid));
if ($DB->nbAffected()==0) $DB->execute($widgets_mob_addWidgetProperties,$DB->escape($modid),$DB->quote($title),$DB->quote($picture),$DB->escape($available));

$file->status(1);

$file->footer();
?>