Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix Configuration Edit for cfg_parameters

Signed-off-by: Gergely <t-gely@freemail.hu>
  • Loading branch information...
commit eb4bdbe47cfe29b269866cb9ea94bb622eff37f7 1 parent 43f728e
@tgely authored
View
19 osCommerce/OM/Core/Site/Admin/Application/Configuration/pages/entries_edit.php
@@ -11,8 +11,8 @@
use osCommerce\OM\Core\ObjectInfo;
use osCommerce\OM\Core\Site\Admin\Application\Configuration\Configuration;
use osCommerce\OM\Core\OSCOM;
+ use osCommerce\OM\Core\Registry;
- $OSCOM_ObjectInfo = new ObjectInfo(Configuration::getEntry($_GET['pID']));
?>
<h1><?php echo $OSCOM_Template->getIcon(32) . osc_link_object(OSCOM::getLink(), $OSCOM_Template->getPageTitle()); ?></h1>
@@ -22,23 +22,28 @@
echo $OSCOM_MessageStack->get();
}
- if ( !osc_empty($OSCOM_ObjectInfo->get('set_function')) ) {
- $value_field = osc_call_user_func($OSCOM_ObjectInfo->get('set_function'), $OSCOM_ObjectInfo->get('configuration_value'), $osC_ObjectInfo->get('configuration_key'));
+ $Qcfg = Registry::get('Database')->query('select configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, use_function, set_function from :table_configuration where configuration_id in (:configuration_id)');
+ $Qcfg->bindRaw(':configuration_id', $_GET['pID']);
+ $Qcfg->execute();
+
+ if ( !osc_empty($Qcfg->value('set_function')) ) {
+ $value_field = osc_call_user_func($Qcfg->value('set_function'), $Qcfg->value('configuration_value'), $Qcfg->value('configuration_key'));
} else {
- $value_field = osc_draw_input_field('configuration[' . $OSCOM_ObjectInfo->get('configuration_key') . ']', $OSCOM_ObjectInfo->get('configuration_value'));
+ $value_field = osc_draw_input_field('configuration[' . $Qcfg->value('configuration_key') . ']', $Qcfg->value('configuration_value'));
}
+
?>
<div class="infoBox">
- <h3><?php echo osc_icon('edit.png') . ' ' . $OSCOM_ObjectInfo->getProtected('configuration_title'); ?></h3>
+ <h3><?php echo osc_icon('edit.png') . ' ' . $Qcfg->valueProtected('configuration_title'); ?></h3>
<form name="cEdit" class="dataForm" action="<?php echo OSCOM::getLink(null, null, 'EntrySave&Process&id=' . $_GET['id']); ?>" method="post">
<p><?php echo OSCOM::getDef('introduction_edit_parameter'); ?></p>
<fieldset>
- <p><label for="configuration[<?php echo $OSCOM_ObjectInfo->get('configuration_key'); ?>]"><?php echo $OSCOM_ObjectInfo->getProtected('configuration_title'); ?></label><?php echo $value_field; ?></p>
- <p><?php echo $OSCOM_ObjectInfo->get('configuration_description'); ?></p>
+ <p><label for="configuration[<?php echo $Qcfg->valueProtected('configuration_key'); ?>]"><?php echo $Qcfg->valueProtected('configuration_title'); ?></label><?php echo $value_field; ?></p>
+ <p><?php echo $Qcfg->value('configuration_description'); ?></p>
</fieldset>
<p><?php echo osc_draw_button(array('priority' => 'primary', 'icon' => 'check', 'title' => OSCOM::getDef('button_save'))) . ' ' . osc_draw_button(array('href' => OSCOM::getLink(null, null, 'id=' . $_GET['id']), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))); ?></p>
Please sign in to comment.
Something went wrong with that request. Please try again.