Exemple #1
0
 protected function process()
 {
     $this->_page_title = OSCOM::getDef('heading_title');
     if (isset($_GET['id']) && is_numeric($_GET['id'])) {
         $this->_page_contents = 'entries.php';
         $this->_page_title .= ': ' . Configuration::get($_GET['id'], 'configuration_group_title');
     }
 }
Exemple #2
0
 public static function execute(ApplicationAbstract $application)
 {
     if (Configuration::saveEntry($_POST['configuration'])) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     osc_redirect_admin(OSCOM::getLink(null, null, 'id=' . $_GET['id']));
 }
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('key' => key($_POST['configuration']), 'value' => $_POST['configuration'][key($_POST['configuration'])]);
     if (Configuration::saveEntry($data)) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     OSCOM::redirect(OSCOM::getLink(null, null, 'id=' . $_GET['id']));
 }
 public static function execute()
 {
     if (!isset($_GET['search'])) {
         $_GET['search'] = '';
     }
     if (!empty($_GET['search'])) {
         $result = Configuration::find($_GET['search']);
     } else {
         $result = Configuration::getAll();
     }
     $result['rpcStatus'] = RPC::STATUS_SUCCESS;
     echo json_encode($result);
 }
Exemple #5
0
 public static function execute(ApplicationAbstract $application)
 {
     $error = false;
     foreach ($_POST['configuration'] as $key => $param) {
         if (!Configuration::saveEntry(array($key => $param))) {
             $error = true;
             break;
         }
     }
     if ($error === false) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
     }
     osc_redirect_admin(OSCOM::getLink(null, null, 'id=' . $_GET['id']));
 }
 public static function execute($data)
 {
     $OSCOM_PDO = Registry::get('PDO');
     $result = array('entries' => array());
     $Qcfg = $OSCOM_PDO->prepare('select * from :table_configuration where configuration_group_id = :configuration_group_id order by sort_order, configuration_title');
     $Qcfg->bindInt(':configuration_group_id', $data['group_id']);
     $Qcfg->execute();
     while ($row = $Qcfg->fetch()) {
         $result['entries'][] = $row;
         if (!empty($row['use_function'])) {
             $result['entries'][count($result['entries']) - 1]['configuration_value'] = Configuration::callUserFunc($row['use_function'], $row['configuration_value']);
         }
     }
     $result['total'] = count($result['entries']);
     return $result;
 }
  <p><?php 
echo OSCOM::getDef('introduction_edit_payment_module');
?>
</p>

  <fieldset>

<?php 
$keys = '';
foreach ($OSCOM_ObjectInfo->get('keys') as $key) {
    $Qkey = $OSCOM_PDO->prepare('select configuration_title, configuration_value, configuration_description, use_function, set_function from :table_configuration where configuration_key = :configuration_key');
    $Qkey->bindValue(':configuration_key', $key);
    $Qkey->execute();
    $keys .= '<p><label for="' . $key . '">' . $Qkey->value('configuration_title') . '</label><br />' . $Qkey->value('configuration_description');
    if (strlen($Qkey->value('set_function')) > 0) {
        $keys .= Configuration::callUserFunc($Qkey->value('set_function'), $Qkey->value('configuration_value'), $key);
    } else {
        $keys .= HTML::inputField('configuration[' . $key . ']', $Qkey->value('configuration_value'));
    }
    $keys .= '</p>';
}
echo $keys;
?>

  </fieldset>

  <p><?php 
echo HTML::button(array('priority' => 'primary', 'icon' => 'check', 'title' => OSCOM::getDef('button_save'))) . ' ' . HTML::button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel')));
?>
</p>
?>
" method="post">

  <p><?php 
echo OSCOM::getDef('introduction_batch_edit_configuration_parameters');
?>
</p>

  <fieldset>

<?php 
$Qcfg = $OSCOM_PDO->query('select configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, use_function, set_function from :table_configuration where configuration_id in (' . implode(',', array_unique(array_filter($_POST['batch'], 'is_numeric'))) . ')');
$Qcfg->execute();
while ($Qcfg->fetch()) {
    if (strlen($Qcfg->value('set_function')) > 0) {
        $value_field = Configuration::callUserFunc($Qcfg->value('set_function'), $Qcfg->value('configuration_value'), $Qcfg->value('configuration_key'));
    } else {
        $value_field = HTML::inputField('configuration[' . $Qcfg->value('configuration_key') . ']', $Qcfg->value('configuration_value'));
    }
    ?>

    <p><label for="configuration[<?php 
    echo $Qcfg->valueProtected('configuration_key');
    ?>
]"><?php 
    echo $Qcfg->valueProtected('configuration_title');
    ?>
</label><?php 
    echo $value_field . HTML::hiddenField('batch[]', $Qcfg->valueInt('configuration_id'));
    ?>
</p>
<?php

/*
  osCommerce Online Merchant $osCommerce-SIG$
  Copyright (c) 2010 osCommerce (http://www.oscommerce.com)

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License v2 (1991)
  as published by the Free Software Foundation.
*/
use osCommerce\OM\Core\ObjectInfo;
use osCommerce\OM\Core\Site\Admin\Application\Configuration\Configuration;
use osCommerce\OM\Core\OSCOM;
$OSCOM_ObjectInfo = new ObjectInfo(Configuration::getEntry($_GET['pID']));
?>

<h1><?php 
echo $OSCOM_Template->getIcon(32) . osc_link_object(OSCOM::getLink(), $OSCOM_Template->getPageTitle());
?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    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'));
} else {
    $value_field = osc_draw_input_field('configuration[' . $OSCOM_ObjectInfo->get('configuration_key') . ']', $OSCOM_ObjectInfo->get('configuration_value'));
}
?>
Exemple #10
0
echo OSCOM::getLink(null, null, 'Save&Process&code=' . $OSCOM_ObjectInfo->get('code'));
?>
" method="post">

  <p><?php 
echo OSCOM::getDef('introduction_edit_service_module');
?>
</p>

<?php 
$keys = '';
foreach ($OSCOM_ObjectInfo->get('keys') as $key) {
    $key_data = OSCOM::callDB('Admin\\Configuration\\EntryGet', array('key' => $key));
    $keys .= '<b>' . $key_data['configuration_title'] . '</b><br />' . $key_data['configuration_description'] . '<br />';
    if (strlen($key_data['set_function']) > 0) {
        $keys .= Configuration::callUserFunc($key_data['set_function'], $key_data['configuration_value'], $key);
    } else {
        $keys .= HTML::inputField('configuration[' . $key . ']', $key_data['configuration_value']);
    }
    $keys .= '<br /><br />';
}
$keys = substr($keys, 0, strrpos($keys, '<br /><br />'));
?>

  <p><?php 
echo $keys;
?>
</p>

  <p><?php 
echo HTML::button(array('priority' => 'primary', 'icon' => 'check', 'title' => OSCOM::getDef('button_save'))) . ' ' . HTML::button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel')));