first commit
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
class cvIngBackendActions extends stActions
|
||||
{
|
||||
|
||||
public function executeConfig()
|
||||
{
|
||||
if($this->cfg->save()) {
|
||||
$this->setFlash('notice', 'Dane zostały zapisane.', 0);
|
||||
}
|
||||
}
|
||||
|
||||
public function validateConfig()
|
||||
{
|
||||
$this->cfg = new cvIngCfg('cvIngBackend', $this->getConfigFields());
|
||||
|
||||
return $this->cfg->validate();
|
||||
}
|
||||
|
||||
protected function getConfigFields()
|
||||
{
|
||||
sfLoader::loadHelpers(array(
|
||||
'Helper',
|
||||
'stUrl',
|
||||
));
|
||||
$i18n = $this->getContext()->getI18n();
|
||||
$params = array(
|
||||
'size' => 50,
|
||||
'required' => true,
|
||||
);
|
||||
$validate = array(
|
||||
'method' => 'isEmpty',
|
||||
'message' => $i18n->__('To pole nie może być puste'),
|
||||
);
|
||||
$configFields['Identyfikatory sklepu'] = array(
|
||||
'config' => array(
|
||||
'client_id' => array(
|
||||
'name' => $i18n->__('Identyfikator klienta'),
|
||||
'type' => 'input_tag',
|
||||
'params' => $params,
|
||||
'validate' => $validate,
|
||||
),
|
||||
'shop_id' => array(
|
||||
'name' => $i18n->__('Identyfikator sklepu'),
|
||||
'type' => 'input_tag',
|
||||
'params' => $params,
|
||||
'validate' => $validate,
|
||||
),
|
||||
'shop_key' => array(
|
||||
'name' => $i18n->__('Klucz sklepu'),
|
||||
'type' => 'input_tag',
|
||||
'params' => $params,
|
||||
'validate' => $validate,
|
||||
),
|
||||
),
|
||||
);
|
||||
$configFields['Tryb testowy'] = array(
|
||||
'config' => array(
|
||||
'test_mode_enabled' => array(
|
||||
'name' => $i18n->__('Używaj URL aplikacji sandbox'),
|
||||
'type' => 'checkbox_tag',
|
||||
'params' => array(),
|
||||
),
|
||||
'log_enabled' => array(
|
||||
'name' => $i18n->__('Loguj dane do pliku'),
|
||||
'type' => 'checkbox_tag',
|
||||
'params' => array(),
|
||||
),
|
||||
),
|
||||
);
|
||||
$configFields['Adres notyfikacji'] = array(
|
||||
'config' => array(
|
||||
'report_success' => array(
|
||||
'name' => $i18n->__('URL'),
|
||||
'type' => 'plain',
|
||||
'params' => array('value' => st_url_for('cv_ing_imoje/statusReport', true, 'frontend')),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return $configFields;
|
||||
}
|
||||
|
||||
public function handleErrorConfig()
|
||||
{
|
||||
$this->cfg = new cvIngCfg('cvIngBackend', $this->getConfigFields());
|
||||
|
||||
return sfView::SUCCESS;
|
||||
}
|
||||
|
||||
#TRANSLATIONS
|
||||
|
||||
public function executeTranslations()
|
||||
{
|
||||
if($this->cfg->save()) {
|
||||
$this->setFlash('notice', 'Dane zostały zapisane.', 0);
|
||||
}
|
||||
}
|
||||
|
||||
public function validateTranslations()
|
||||
{
|
||||
$tl = new cvIngTranslationCfg();
|
||||
$this->cfg = $tl->cfg;
|
||||
|
||||
return $this->cfg->validate();
|
||||
}
|
||||
|
||||
public function handleErrorTranslations()
|
||||
{
|
||||
$tl = new cvIngTranslationCfg();
|
||||
$this->cfg = $tl->cfg;
|
||||
|
||||
return sfView::SUCCESS;
|
||||
}
|
||||
|
||||
public function executeTlRestoreDefaults()
|
||||
{
|
||||
$tl = new cvIngTranslationCfg();
|
||||
$tl->cfg->createConfig();
|
||||
|
||||
return $this->renderText('Domyślne translacje przywrócone');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
echo link_to($params['txt'], $params['to']);
|
||||
@@ -0,0 +1,20 @@
|
||||
<div class="application-menu">
|
||||
<ul>
|
||||
<li class="<?php echo $sf_request->getParameter('action') == "config"
|
||||
? 'selected'
|
||||
: 'none'; ?>">
|
||||
<?php echo link_to(__('Konfiguracja'), 'cvIngBackend/config' . (isset($culture)
|
||||
? '?culture=' . $culture
|
||||
: '')) ?>
|
||||
</li>
|
||||
<li class="<?php echo $sf_request->getParameter('action') == "basketConfig"
|
||||
? 'selected'
|
||||
: 'none'; ?>">
|
||||
<?php echo link_to(__('Tłumaczenia'), 'cvIngBackend/translations' . (isset($culture)
|
||||
? '?culture=' . $culture
|
||||
: '')) ?>
|
||||
|
||||
<li class="clear_item"></li>
|
||||
</ul>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'VisualEffect', 'stAdminGenerator') ?>
|
||||
|
||||
<?php echo st_get_admin_head(
|
||||
array('@cvIngPlugin',
|
||||
__('ING Płatności online imoje').' - imoje',
|
||||
'/images/backend/main/icons/red/stPayment.png'),
|
||||
__('Konfiguracja'), array('shortcuts' => array (
|
||||
0 => 'stUser',
|
||||
), 'culture' => null, 'route' => $cfg->route)) ?>
|
||||
|
||||
|
||||
<div style="clear: both;"></div>
|
||||
<?php include_partial('menu', array('culture' => $cfg->culture)) ?>
|
||||
<div id="sf_admin_content">
|
||||
<?php st_include_partial('stAdminGenerator/message') ?>
|
||||
<?php echo form_tag('cvIngBackend/config', array('id' => 'sf_admin_config_form', 'class' => "admin_form")) ?>
|
||||
|
||||
<div class="content">
|
||||
<?php echo $cfg->getContent(); ?>
|
||||
</div>
|
||||
|
||||
<?php echo st_get_admin_actions_head() ?>
|
||||
<?php echo st_get_admin_action('save', __('Zapisz', null, 'stAdminGeneratorPlugin'), null, array('name' => 'save')) ?>
|
||||
<?php echo st_get_admin_actions_foot();?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
  wersja: <?php echo cvIngPlugin::$version ?>
|
||||
  kontakt z nami:   +48 32 319 35 70
|
||||
  kontakt.tech@imoje.pl
|
||||
<?php echo st_get_admin_foot() ?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'VisualEffect', 'stAdminGenerator') ?>
|
||||
|
||||
<?php echo st_get_admin_head(
|
||||
array($cfg->route,
|
||||
__('ING Płatności online imoje').' - imoje',
|
||||
'/images/backend/main/icons/red/stPayment.png'),
|
||||
__('Tłumaczenia'), array('shortcuts' => array (
|
||||
0 => 'stUser',
|
||||
), 'culture' => $cfg->culture, 'route' => $cfg->route)) ?>
|
||||
|
||||
|
||||
<div style="clear: both;"></div>
|
||||
<?php include_partial('menu', array('culture' => $cfg->culture)) ?>
|
||||
<div id="sf_admin_content">
|
||||
<?php st_include_partial('stAdminGenerator/message') ?>
|
||||
<?php echo form_tag($cfg->route.'?culture='.$cfg->culture, array('id' => 'sf_admin_config_form', 'class' => "admin_form")) ?>
|
||||
|
||||
<div class="content">
|
||||
<?php echo $cfg->getContent(); ?>
|
||||
</div>
|
||||
|
||||
<?php echo st_get_admin_actions_head() ?>
|
||||
<?php echo st_get_admin_action('save', __('Zapisz', null, 'stAdminGeneratorPlugin'), null, array('name' => 'save')) ?>
|
||||
<?php echo st_get_admin_actions_foot() ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
  wersja: <?php echo cvIngPlugin::$version ?>
|
||||
  kontakt z nami:   +48 32 319 35 70
|
||||
  kontakt.tech@imoje.pl
|
||||
<?php echo st_get_admin_foot() ?>
|
||||
Reference in New Issue
Block a user