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
No related merge requests found
......@@ -80,42 +80,23 @@ class Module
*/
public function getViewHelperConfig()
{
// @codingStandardsIgnoreStart
return array(
'factories' => array(
'headlink' => function ($sm) {
return new \VuFindTheme\View\Helper\HeadLink(
$sm->getServiceLocator()->get('VuFindTheme\ThemeInfo')
);
},
'headscript' => function ($sm) {
return new \VuFindTheme\View\Helper\HeadScript(
$sm->getServiceLocator()->get('VuFindTheme\ThemeInfo')
);
},
'headthemeresources' => function ($sm) {
return new \VuFindTheme\View\Helper\HeadThemeResources(
$sm->getServiceLocator()->get('VuFindTheme\ResourceContainer')
);
},
'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')
);
},
'headlink' =>
array('VuFindTheme\View\Helper\Factory', 'getHeadLink'),
'headscript' =>
array('VuFindTheme\View\Helper\Factory', 'getHeadScript'),
'headthemeresources' => array(
'VuFindTheme\View\Helper\Factory', 'getHeadThemeResources'
),
'imagelink' =>
array('VuFindTheme\View\Helper\Factory', 'getImageLink'),
'inlinescript' =>
array('VuFindTheme\View\Helper\Factory', 'getInlineScript'),
'mobileurl' =>
array('VuFindTheme\View\Helper\Factory', 'getMobileUrl'),
),
);
// @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