Пример #1
0
 case 'default':
     // Liste des passerelles de paiement installés
     // ****************************************************************************************************************
     xoops_cp_header();
     oledrion_adminMenu(12);
     global $xoopsConfig;
     oledrion_utils::htitle(_AM_OLEDRION_INSTALLED_GATEWAYS, 4);
     if (file_exists(OLEDRION_GATEWAY_LOG_PATH)) {
         echo "<a href='" . $baseurl . "?op=gateways&action=seelog'>" . _AM_OLEDRION_GATEWAYS_SEELOG . "</a><br />";
     }
     $currentGateway = oledrion_gateways::getCurrentGateway();
     $class = '';
     echo "<form method='post' action='" . $baseurl . "'><input type='hidden' name='op' id='op' value='gateways' /><input type='hidden' name='action' id='action' value='setDefaultGateway' />";
     echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>\n";
     echo "<tr><th align='center'>" . _AM_OLEDRION_GATEWAYS_NAME . "</th><th align='center'>" . _AM_OLEDRION_GATEWAYS_VERSION . "</th><th align='center'>" . _AM_OLEDRION_GATEWAYS_DESCRIPTION . "</th><th align='center'>" . _AM_OLEDRION_GATEWAYS_AUTHOR . "</th><th align='center'>" . _AM_OLEDRION_GATEWAYS_DATE . "</th><th align='center'>" . _AM_OLEDRION_GATEWAYS_USED . "</th></tr>\n";
     $installedGateways = oledrion_gateways::getInstalledGatewaysList();
     $gatewaysCount = 0;
     foreach ($installedGateways as $installedGateway) {
         if (oledrion_gateways::gatewayClassFileExists($installedGateway)) {
             // Il y a une classe donc c'est bon
             if (!oledrion_gateways::loadGatewaysLanguageDefines($installedGateway)) {
                 // On n'a pas réussi à charger le fichier de traduction
                 continue;
             }
             oledrion_gateways::includeGatewayClass($installedGateway);
             // Chargement du fichier de la classe
             if (oledrion_gateways::gatewayClassExists($installedGateway)) {
                 $gatewayClassName = oledrion_gateways::gatewayClassName($installedGateway);
                 $temporaryGateway = new $gatewayClassName();
                 if (is_object($temporaryGateway)) {
                     $gatewaysCount++;
Пример #2
0
 if (!empty($id)) {
     $edit = true;
     $item = $h_oledrion_payment->get($id);
     if (!is_object($item)) {
         oledrion_utils::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5);
     }
     $item->unsetNew();
 } else {
     $item = $h_oledrion_payment->create(true);
 }
 $opRedirect = 'payment';
 $item->setVars($_POST);
 if ($_POST['payment_type'] == 'offline') {
     $item->setVar('payment_gateway', 'offline');
 }
 if ($_POST['payment_type'] == 'online' && !in_array($_POST['payment_gateway'], oledrion_gateways::getInstalledGatewaysList())) {
     $item->setVar('payment_gateway', oledrion_gateways::getDefaultGateway());
 }
 if (isset($_POST['delpicture']) && intval($_POST['delpicture']) == 1) {
     $item->deletePicture();
 }
 $destname = '';
 $res1 = oledrion_utils::uploadFile(0, OLEDRION_PICTURES_PATH);
 if ($res1) {
     if (oledrion_utils::getModuleOption('resize_others')) {
         // Eventuellement on redimensionne l'image
         oledrion_utils::resizePicture(OLEDRION_PICTURES_PATH . DIRECTORY_SEPARATOR . $destname, OLEDRION_PICTURES_PATH . DIRECTORY_SEPARATOR . $destname, oledrion_utils::getModuleOption('images_width'), oledrion_utils::getModuleOption('images_height'), true);
     }
     $item->setVar('payment_image', basename($destname));
 } else {
     if ($res1 !== false) {