-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
632a1c8
commit bdb7afb
Showing
77 changed files
with
8,763 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
/** | ||
* Template for code module for storing local overrides. | ||
* | ||
* PHP version 7 | ||
* | ||
* Copyright (C) Villanova University 2010. | ||
* | ||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
* @category VuFind | ||
* @package Module | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development | ||
*/ | ||
namespace HeadTitle; | ||
|
||
use Laminas\ModuleManager\ModuleManager; | ||
use Laminas\Mvc\MvcEvent; | ||
|
||
/** | ||
* Template for code module for storing local overrides. | ||
* | ||
* @category VuFind | ||
* @package Module | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development | ||
*/ | ||
class Module | ||
{ | ||
/** | ||
* Get module configuration | ||
* | ||
* @return array | ||
*/ | ||
public function getConfig() | ||
{ | ||
return include __DIR__ . '/config/module.config.php'; | ||
} | ||
|
||
/** | ||
* Get autoloader configuration | ||
* | ||
* @return array | ||
*/ | ||
public function getAutoloaderConfig() | ||
{ | ||
return [ | ||
'Laminas\Loader\StandardAutoloader' => [ | ||
'namespaces' => [ | ||
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, | ||
], | ||
], | ||
]; | ||
} | ||
|
||
/** | ||
* Initialize the module | ||
* | ||
* @param ModuleManager $m Module manager | ||
* | ||
* @return void | ||
* | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function init(ModuleManager $m) | ||
{ | ||
} | ||
|
||
/** | ||
* Bootstrap the module | ||
* | ||
* @param MvcEvent $e Event | ||
* | ||
* @return void | ||
* | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function onBootstrap(MvcEvent $e) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
return []; |
41 changes: 41 additions & 0 deletions
41
module/HeadTitle/src/HeadTitle/View/Helper/Root/HeadTitle.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/** | ||
* @see https://github.com/laminas/laminas-view for the canonical source repository | ||
* @copyright https://github.com/laminas/laminas-view/blob/master/COPYRIGHT.md | ||
* @license https://github.com/laminas/laminas-view/blob/master/LICENSE.md New BSD License | ||
*/ | ||
|
||
namespace HeadTitle\View\Helper\Root; | ||
|
||
use Laminas\View\Exception; | ||
|
||
/** | ||
* Helper for setting and retrieving title element for HTML head. | ||
* | ||
* Duck-types against Laminas\I18n\Translator\TranslatorAwareInterface. | ||
*/ | ||
class HeadTitle extends \Laminas\View\Helper\HeadTitle | ||
{ | ||
private $headTitleConfig; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
if ($configFile = realpath(getenv('VUFIND_LOCAL_DIR') . '/config/vufind/HeadTitle.ini')) { | ||
$this->headTitleConfig = parse_ini_file($configFile, true); | ||
} | ||
} | ||
|
||
public function renderTitle() | ||
{ | ||
return $this->getTitlePrefix().parent::renderTitle(); | ||
} | ||
|
||
private function getTitlePrefix () { | ||
if ($this->headTitleConfig && isset($this->headTitleConfig['title_prefix'])) { | ||
return $this->headTitleConfig['title_prefix']; | ||
} | ||
return ''; | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
module/HeadTitle/src/HeadTitle/View/Helper/Root/HeadTitleFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
/** | ||
* HeadTitle helper factory. | ||
* | ||
* PHP version 7 | ||
* | ||
* Copyright (C) Villanova University 2021. | ||
* | ||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
* @category VuFind | ||
* @package View_Helpers | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development Wiki | ||
*/ | ||
namespace HeadTitle\View\Helper\Root; | ||
|
||
use Interop\Container\ContainerInterface; | ||
use Interop\Container\Exception\ContainerException; | ||
use Laminas\ServiceManager\Exception\ServiceNotCreatedException; | ||
use Laminas\ServiceManager\Exception\ServiceNotFoundException; | ||
use Laminas\ServiceManager\Factory\FactoryInterface; | ||
use Laminas\View\Helper\Placeholder\Container\AbstractContainer; | ||
|
||
/** | ||
* HeadTitle helper factory. | ||
* | ||
* @category VuFind | ||
* @package View_Helpers | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development Wiki | ||
*/ | ||
class HeadTitleFactory implements FactoryInterface | ||
{ | ||
/** | ||
* Create an object | ||
* | ||
* @param ContainerInterface $container Service manager | ||
* @param string $requestedName Service being created | ||
* @param null|array $options Extra options (optional) | ||
* | ||
* @return object | ||
* | ||
* @throws ServiceNotFoundException if unable to resolve the service. | ||
* @throws ServiceNotCreatedException if an exception is raised when | ||
* creating a service. | ||
* @throws ContainerException&\Throwable if any other error occurs | ||
*/ | ||
public function __invoke( | ||
ContainerInterface $container, | ||
$requestedName, | ||
array $options = null | ||
) { | ||
if (!empty($options)) { | ||
throw new \Exception('Unexpected options sent to factory.'); | ||
} | ||
$helper = new $requestedName(); | ||
// In VuFind, we always want to set, not append, titles: | ||
$helper->setDefaultAttachOrder(AbstractContainer::SET); | ||
return $helper; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
/** | ||
* Code module for the core of the VuFind application | ||
* | ||
* PHP version 7 | ||
* | ||
* Copyright (C) Villanova University 2010. | ||
* | ||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
* @category VuFind | ||
* @package Module | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org | ||
*/ | ||
namespace UISettings; | ||
|
||
use Laminas\Mvc\MvcEvent; | ||
|
||
/** | ||
* Code module for the core of the VuFind application | ||
* | ||
* @category VuFind | ||
* @package Module | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org | ||
*/ | ||
class Module | ||
{ | ||
/** | ||
* Get module configuration | ||
* | ||
* @return array | ||
*/ | ||
public function getConfig() | ||
{ | ||
return include __DIR__ . '/config/module.config.php'; | ||
} | ||
|
||
/** | ||
* Get autoloader configuration | ||
* | ||
* @return array | ||
*/ | ||
public function getAutoloaderConfig() | ||
{ | ||
return [ | ||
'Laminas\Loader\StandardAutoloader' => [ | ||
'namespaces' => [ | ||
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, | ||
], | ||
], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
$config = [ | ||
'vufind' => [ | ||
'plugin_managers' => [ | ||
'ajaxhandler' => [ | ||
'factories' => [ | ||
'UISettings\AjaxHandler\SetUISettings' => 'UISettings\AjaxHandler\SetUISettingsFactory', | ||
], | ||
'aliases' => [ | ||
'setUISettings' => 'UISettings\AjaxHandler\SetUISettings', | ||
], | ||
], | ||
], | ||
], | ||
]; | ||
|
||
return $config; |
Oops, something went wrong.