Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/apps/backend/modules/config/actions/actions.class.php b/apps/backend/modules/config/actions/actions.class.php
- index 91a7a97..94cacda 100644
- --- a/apps/backend/modules/config/actions/actions.class.php
- +++ b/apps/backend/modules/config/actions/actions.class.php
- @@ -4,11 +4,31 @@ class configActions extends sfActions
- {
- public function executeIndex(sfWebRequest $request)
- {
- + $c = new Criteria;
- + $c->add(ConfigurationPeer::NAME, "dealbox");
- + $this->dealbox = ConfigurationPeer::doSelectOne($c);
- +
- + $c = new Criteria;
- + $c->add(ConfigurationPeer::NAME, "wallet");
- + $this->wallet = ConfigurationPeer::doSelectOne($c);
- +
- if ($request->isMethod('post'))
- {
- if ($request->hasParameter("pap_auto"))
- PapConfig::setAuto($request->getParameter("pap_auto"));
- + if ($request->hasParameter("dealbox"))
- + {
- + $this->dealbox->setValue($request->getParameter("dealbox"));
- + $this->dealbox->save();
- + }
- +
- + if ($request->hasParameter("wallet"))
- + {
- + $this->wallet->setValue($request->getParameter("wallet"));
- + $this->wallet->save();
- + }
- +
- $this->redirect("config/index");
- }
- diff --git a/apps/backend/modules/config/templates/indexSuccess.php b/apps/backend/modules/config/templates/indexSuccess.php
- index fda2424..5376066 100644
- --- a/apps/backend/modules/config/templates/indexSuccess.php
- +++ b/apps/backend/modules/config/templates/indexSuccess.php
- @@ -8,4 +8,24 @@ PAP automagic:
- <?php echo __("off") ?> [<?php echo link_to(__("turn on"), "config/index?pap_auto=1", "post=true class=link"); ?>]
- <?php endif; ?>
- </h2>
- +
- +<h2>
- +Dealbox:
- +<?php if ($dealbox->getValue() == "1"): ?>
- +<?php echo __("on") ?> [<?php echo link_to(__("turn off"), "config/index?dealbox=0", "post=true class=link"); ?>]
- +<?php else: ?>
- +<?php echo __("off") ?> [<?php echo link_to(__("turn on"), "config/index?dealbox=1", "post=true class=link"); ?>]
- +<?php endif; ?>
- +</h2>
- +
- +<h2>
- +Portfel:
- +<?php if ($wallet->getValue() == "1"): ?>
- +<?php echo __("on") ?> [<?php echo link_to(__("turn off"), "config/index?wallet=0", "post=true class=link"); ?>]
- +<?php else: ?>
- +<?php echo __("off") ?> [<?php echo link_to(__("turn on"), "config/index?wallet=1", "post=true class=link"); ?>]
- +<?php endif; ?>
- +</h2>
- +
- +
- <?php nice_box_end(); ?>
- diff --git a/apps/frontend/modules/news/actions/actions.class.php b/apps/frontend/modules/news/actions/actions.class.php
- index d125adb..57afaf8 100644
- --- a/apps/frontend/modules/news/actions/actions.class.php
- +++ b/apps/frontend/modules/news/actions/actions.class.php
- @@ -92,6 +92,14 @@ class newsActions extends SectionActions
- $c = new Criteria;
- $c->add(TrainingAppointmentPeer::HOMEPAGE, true);
- $this->appointments = TrainingAppointmentPeer::cleverRetrieve($c);
- +
- + $c = new Criteria;
- + $c->add(ConfigurationPeer::NAME, "dealbox");
- + $this->conf_dealbox = ConfigurationPeer::doSelectOne($c);
- +
- + $c = new Criteria;
- + $c->add(ConfigurationPeer::NAME, "wallet");
- + $this->conf_wallet = ConfigurationPeer::doSelectOne($c);
- }
- public function executeRecommend(sfWebRequest $request)
- diff --git a/apps/frontend/modules/news/templates/homepageSuccess.php b/apps/frontend/modules/news/templates/homepageSuccess.php
- index b7d394e..82f67ad 100644
- --- a/apps/frontend/modules/news/templates/homepageSuccess.php
- +++ b/apps/frontend/modules/news/templates/homepageSuccess.php
- @@ -129,7 +129,7 @@
- </div>
- <?php endif; ?>
- - <?php if ($wallet_piece): ?>
- + <?php if ($wallet_piece and $conf_wallet->getValue() == "1"): ?>
- <?php nice_box("PORTFEL"); ?>
- <ul><li>
- <?php echo link_to($wallet_piece->getName(), $wallet_piece->toUrl(), 'class=title'); ?>
- @@ -204,7 +204,7 @@
- <?php end_slot() ?>
- <?php slot('rightbar_middle_top'); ?>
- - <?php if ($hindsights): ?>
- + <?php if ($hindsights and $conf_dealbox->getValue() == "1"): ?>
- <?php nice_box_newsroom("DEALBOX", true) ?>
- <?php include_partial("analyses/dealbox", array('hindsights' => $hindsights)); ?>
- <div style="text-align: right; margin-bottom: 5px;">
- diff --git a/config/schema.yml b/config/schema.yml
- index 314edb9..c86b10e 100644
- --- a/config/schema.yml
- +++ b/config/schema.yml
- @@ -440,3 +440,10 @@ main:
- url: { type: varchar(300) }
- begin: { type: timestamp, required: true }
- end: { type: timestamp, required: true }
- +
- + configurations:
- + _attributes: { phpName: Configuration }
- + id:
- + name: { type: varchar(100), required: true }
- + value: { type: varchar(100) }
- +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement