function setDefault() { global $toC_Json, $osC_Language; $osC_Image = new osC_Image_Admin(); if ($osC_Image->setAsDefault($_REQUEST['image'])) { $response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed')); } else { $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed')); } echo $toC_Json->encode($response); }
function setDefault() { global $toC_Json, $osC_Language; $error = false; $osC_Image = new osC_Image_Admin(); if (isset($_REQUEST['image']) && is_numeric($_REQUEST['image'])) { if (!$osC_Image->setAsDefault($_REQUEST['image'])) { $error = true; } } else { $_SESSION['default_images'] = basename($_REQUEST['image']); } if ($error === false) { $response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed')); } else { $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed')); } echo $toC_Json->encode($response); }
public static function setDefaultImage() { $osC_Image = new osC_Image_Admin(); if (isset($_GET['image'])) { $osC_Image->setAsDefault($_GET['image']); } $result = array('result' => 1, 'rpcStatus' => RPC_STATUS_SUCCESS); echo json_encode($result); }