From 51d42a85dc2275809c20fb9100ab678b00939593 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Thu, 28 Feb 2013 10:22:50 -0500 Subject: [PATCH] More configuration decoupling. --- .../View/Helper/Root/AbstractSyndetics.php | 6 +++-- themes/root/theme.config.php | 24 +++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/module/VuFind/src/VuFind/View/Helper/Root/AbstractSyndetics.php b/module/VuFind/src/VuFind/View/Helper/Root/AbstractSyndetics.php index 6f7be7f91bf..0d1711aed8e 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/AbstractSyndetics.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/AbstractSyndetics.php @@ -63,10 +63,12 @@ abstract class AbstractSyndetics extends AbstractHelper /** * Constructor + * + * @param \Zend\Config\Config $config VuFind configuration */ - public function __construct() + public function __construct(\Zend\Config\Config $config) { - $this->config = \VuFind\Config\Reader::getConfig(); + $this->config = $config; } /** diff --git a/themes/root/theme.config.php b/themes/root/theme.config.php index 0934d858f03..30803512ce4 100644 --- a/themes/root/theme.config.php +++ b/themes/root/theme.config.php @@ -14,6 +14,11 @@ return array( $sm->getServiceLocator()->get('VuFind\AuthManager') ); }, + 'authornotes' => function ($sm) { + return new \VuFind\View\Helper\Root\AuthorNotes( + $sm->getServiceLocator()->get('VuFind\Config')->get('config') + ); + }, 'cart' => function ($sm) { return new \VuFind\View\Helper\Root\Cart( $sm->getServiceLocator()->get('VuFind\Cart') @@ -34,6 +39,11 @@ return array( $sm->getServiceLocator()->get('VuFind\Translator') ); }, + 'excerpt' => function ($sm) { + return new \VuFind\View\Helper\Root\Excerpt( + $sm->getServiceLocator()->get('VuFind\Config')->get('config') + ); + }, 'export' => function ($sm) { return new \VuFind\View\Helper\Root\Export( $sm->getServiceLocator()->get('VuFind\Export') @@ -71,6 +81,11 @@ return array( $sm->getServiceLocator()->get('VuFind\RecordRouter') ); }, + 'reviews' => function ($sm) { + return new \VuFind\View\Helper\Root\Reviews( + $sm->getServiceLocator()->get('VuFind\Config')->get('config') + ); + }, 'searchoptions' => function ($sm) { return new VuFind\View\Helper\Root\SearchOptions( $sm->getServiceLocator()->get('SearchManager') @@ -88,14 +103,17 @@ return array( isset($config->Site->email) ? $config->Site->email : '' ); }, + 'videoclips' => function ($sm) { + return new \VuFind\View\Helper\Root\VideoClips( + $sm->getServiceLocator()->get('VuFind\Config')->get('config') + ); + }, ), 'invokables' => array( 'addellipsis' => 'VuFind\View\Helper\Root\AddEllipsis', - 'authornotes' => 'VuFind\View\Helper\Root\AuthorNotes', 'browse' => 'VuFind\View\Helper\Root\Browse', 'context' => 'VuFind\View\Helper\Root\Context', 'currentpath' => 'VuFind\View\Helper\Root\CurrentPath', - 'excerpt' => 'VuFind\View\Helper\Root\Excerpt', 'getlastsearchlink' => 'VuFind\View\Helper\Root\GetLastSearchLink', 'highlight' => 'VuFind\View\Helper\Root\Highlight', 'jqueryvalidation' => 'VuFind\View\Helper\Root\JqueryValidation', @@ -104,7 +122,6 @@ return array( 'related' => 'VuFind\View\Helper\Root\Related', 'renderarray' => 'VuFind\View\Helper\Root\RenderArray', 'resultfeed' => 'VuFind\View\Helper\Root\ResultFeed', - 'reviews' => 'VuFind\View\Helper\Root\Reviews', 'safemoneyformat' => 'VuFind\View\Helper\Root\SafeMoneyFormat', 'sortfacetlist' => 'VuFind\View\Helper\Root\SortFacetList', 'summon' => 'VuFind\View\Helper\Root\Summon', @@ -112,7 +129,6 @@ return array( 'translate' => 'VuFind\View\Helper\Root\Translate', 'truncate' => 'VuFind\View\Helper\Root\Truncate', 'userlist' => 'VuFind\View\Helper\Root\UserList', - 'videoclips' => 'VuFind\View\Helper\Root\VideoClips', ) ), ); -- GitLab