Skip to content
Snippets Groups Projects
Commit c210d82b authored by Demian Katz's avatar Demian Katz
Browse files

Finished elimination of closures from configs.

parent bafeec0e
Branches
Tags archive/issue/5404
No related merge requests found
...@@ -80,42 +80,23 @@ class Module ...@@ -80,42 +80,23 @@ class Module
*/ */
public function getViewHelperConfig() public function getViewHelperConfig()
{ {
// @codingStandardsIgnoreStart
return array( return array(
'factories' => array( 'factories' => array(
'headlink' => function ($sm) { 'headlink' =>
return new \VuFindTheme\View\Helper\HeadLink( array('VuFindTheme\View\Helper\Factory', 'getHeadLink'),
$sm->getServiceLocator()->get('VuFindTheme\ThemeInfo') 'headscript' =>
); array('VuFindTheme\View\Helper\Factory', 'getHeadScript'),
}, 'headthemeresources' => array(
'headscript' => function ($sm) { 'VuFindTheme\View\Helper\Factory', 'getHeadThemeResources'
return new \VuFindTheme\View\Helper\HeadScript( ),
$sm->getServiceLocator()->get('VuFindTheme\ThemeInfo') 'imagelink' =>
); array('VuFindTheme\View\Helper\Factory', 'getImageLink'),
}, 'inlinescript' =>
'headthemeresources' => function ($sm) { array('VuFindTheme\View\Helper\Factory', 'getInlineScript'),
return new \VuFindTheme\View\Helper\HeadThemeResources( 'mobileurl' =>
$sm->getServiceLocator()->get('VuFindTheme\ResourceContainer') array('VuFindTheme\View\Helper\Factory', 'getMobileUrl'),
);
},
'imagelink' => function ($sm) {
return new \VuFindTheme\View\Helper\ImageLink(
$sm->getServiceLocator()->get('VuFindTheme\ThemeInfo')
);
},
'inlinescript' => function ($sm) {
return new \VuFindTheme\View\Helper\InlineScript(
$sm->getServiceLocator()->get('VuFindTheme\ThemeInfo')
);
},
'mobileurl' => function ($sm) {
return new \VuFindTheme\View\Helper\MobileUrl(
$sm->getServiceLocator()->get('VuFindTheme\Mobile')
);
},
), ),
); );
// @codingStandardsIgnoreEnd
} }
/** /**
......
<?php
/**
* Factory for VuFindTheme view helpers.
*
* PHP version 5
*
* Copyright (C) Villanova University 2014.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @category VuFind2
* @package VuDL
* @author Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org/wiki/vufind2:developer_manual Wiki
*/
namespace VuFindTheme\View\Helper;
use Zend\ServiceManager\ServiceManager;
/**
* Factory for VuFindTheme view helpers.
*
* @category VuFind2
* @package VuDL
* @author Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org/wiki/vufind2:developer_manual Wiki
*/
class Factory
{
/**
* Construct the HeadLink helper.
*
* @param ServiceManager $sm Service manager.
*
* @return HeadLink
*/
public static function getHeadLink(ServiceManager $sm)
{
return new HeadLink(
$sm->getServiceLocator()->get('VuFindTheme\ThemeInfo')
);
}
/**
* Construct the HeadScript helper.
*
* @param ServiceManager $sm Service manager.
*
* @return HeadScript
*/
public static function getHeadScript(ServiceManager $sm)
{
return new HeadScript(
$sm->getServiceLocator()->get('VuFindTheme\ThemeInfo')
);
}
/**
* Construct the HeadThemeResources helper.
*
* @param ServiceManager $sm Service manager.
*
* @return HeadThemeResources
*/
public static function getHeadThemeResources(ServiceManager $sm)
{
return new HeadThemeResources(
$sm->getServiceLocator()->get('VuFindTheme\ResourceContainer')
);
}
/**
* Construct the ImageLink helper.
*
* @param ServiceManager $sm Service manager.
*
* @return ImageLink
*/
public static function getImageLink(ServiceManager $sm)
{
return new ImageLink(
$sm->getServiceLocator()->get('VuFindTheme\ThemeInfo')
);
}
/**
* Construct the InlineScript helper.
*
* @param ServiceManager $sm Service manager.
*
* @return InlineScript
*/
public static function getInlineScript(ServiceManager $sm)
{
return new InlineScript(
$sm->getServiceLocator()->get('VuFindTheme\ThemeInfo')
);
}
/**
* Construct the MobileUrl helper.
*
* @param ServiceManager $sm Service manager.
*
* @return MobileUrl
*/
public static function getMobileUrl(ServiceManager $sm)
{
return new MobileUrl(
$sm->getServiceLocator()->get('VuFindTheme\Mobile')
);
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment