diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/DateTime.php b/module/VuFind/src/VuFind/Theme/Root/Helper/DateTime.php index 9212c55c9f70dc935efe6460aecea473a37cf410..4ccaf2dd2fce27bdb793fec3bb8706ba96d86079 100644 --- a/module/VuFind/src/VuFind/Theme/Root/Helper/DateTime.php +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/DateTime.php @@ -66,4 +66,23 @@ class DateTime extends AbstractHelper return false; } } + + /** + * Builds an alphabetical help string based on the default display date format. + * + * @return string + */ + public function getDisplayDateFormat() + { + $dueDateHelpString + = $this->converter->convertToDisplayDate("m-d-y", "11-22-3333"); + $search = array("1", "2", "3"); + $replace = array( + $this->view->translate("date_month_placeholder"), + $this->view->translate("date_day_placeholder"), + $this->view->translate("date_year_placeholder") + ); + + return str_replace($search, $replace, $dueDateHelpString); + } } \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/DisplayDateFormat.php b/module/VuFind/src/VuFind/Theme/Root/Helper/DisplayDateFormat.php deleted file mode 100644 index 817f43cdb900da61a77577ced560a37b3f9d91c3..0000000000000000000000000000000000000000 --- a/module/VuFind/src/VuFind/Theme/Root/Helper/DisplayDateFormat.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * Date format display view helper -- build a language-appropriate format key for - * entering dates. - * - * PHP version 5 - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @category VuFind2 - * @package View_Helpers - * @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/building_a_recommendations_module Wiki - */ -namespace VuFind\Theme\Root\Helper; -use VuFind\Date\Converter as DateConverter, Zend\View\Helper\AbstractHelper; - -/** - * Date format display view helper - * - * @category VuFind2 - * @package View_Helpers - * @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/building_a_recommendations_module Wiki - */ -class DisplayDateFormat extends AbstractHelper -{ - /** - * Builds an alphabetical help string based on the default display date format. - * - * @return string - */ - public function __invoke() - { - $dateFormat = new DateConverter(); - $dueDateHelpString - = $dateFormat->convertToDisplayDate("m-d-y", "11-22-3333"); - $search = array("1", "2", "3"); - $replace = array( - $this->view->translate("date_month_placeholder"), - $this->view->translate("date_day_placeholder"), - $this->view->translate("date_year_placeholder") - ); - - return str_replace($search, $replace, $dueDateHelpString); - } -} \ No newline at end of file diff --git a/themes/blueprint/templates/record/hold.phtml b/themes/blueprint/templates/record/hold.phtml index d6d45a19c25b271a58d4ec7ee3e79694462f490c..70ecaf3ec7d3a06db2f940c83e21b0303201ddcb 100644 --- a/themes/blueprint/templates/record/hold.phtml +++ b/themes/blueprint/templates/record/hold.phtml @@ -22,7 +22,7 @@ <? if (in_array("requiredByDate", $this->extraHoldFields)): ?> <div> <strong><?=$this->transEsc("hold_required_by")?>: </strong> - <div id="requiredByHolder"><input id="requiredByDate" type="text" name="gatheredDetails[requiredBy]" value="<?=(isset($this->gatheredDetails['requiredBy']) && !empty($this->gatheredDetails['requiredBy'])) ? $this->escapeHtml($this->gatheredDetails['requiredBy']) : $this->escapeHtml($this->defaultRequiredDate)?>" size="8" /> <strong>(<?=$this->displayDateFormat()?>)</strong></div> + <div id="requiredByHolder"><input id="requiredByDate" type="text" name="gatheredDetails[requiredBy]" value="<?=(isset($this->gatheredDetails['requiredBy']) && !empty($this->gatheredDetails['requiredBy'])) ? $this->escapeHtml($this->gatheredDetails['requiredBy']) : $this->escapeHtml($this->defaultRequiredDate)?>" size="8" /> <strong>(<?=$this->dateTime()->getDisplayDateFormat()?>)</strong></div> </div> <? endif; ?> diff --git a/themes/jquerymobile/templates/record/hold.phtml b/themes/jquerymobile/templates/record/hold.phtml index 31cd4c7f1579d57c4d8c155b5112cb4d32b75e2a..9f8cdee8896cff60f6dc716e1166f3dd33943feb 100644 --- a/themes/jquerymobile/templates/record/hold.phtml +++ b/themes/jquerymobile/templates/record/hold.phtml @@ -21,7 +21,7 @@ <? if (in_array("requiredByDate", $this->extraHoldFields)): ?> <div> <strong><?=$this->transEsc("hold_required_by")?>: </strong> - <div id="requiredByHolder"><input id="requiredByDate" type="text" name="gatheredDetails[requiredBy]" value="<?=(isset($this->gatheredDetails['requiredBy']) && !empty($this->gatheredDetails['requiredBy'])) ? $this->escapeHtml($this->gatheredDetails['requiredBy']) : $this->escapeHtml($this->defaultRequiredDate)?>" size="8" /> <strong>(<?=$this->displayDateFormat()?>)</strong></div> + <div id="requiredByHolder"><input id="requiredByDate" type="text" name="gatheredDetails[requiredBy]" value="<?=(isset($this->gatheredDetails['requiredBy']) && !empty($this->gatheredDetails['requiredBy'])) ? $this->escapeHtml($this->gatheredDetails['requiredBy']) : $this->escapeHtml($this->defaultRequiredDate)?>" size="8" /> <strong>(<?=$this->dateTime()->getDisplayDateFormat()?>)</strong></div> </div> <? endif; ?> diff --git a/themes/root/theme.ini b/themes/root/theme.ini index 4eecd26456366c4596224a47c3378590dfcd67eb..97d6acb6184933b2fa820d9a730ae805102fb9c4 100644 --- a/themes/root/theme.ini +++ b/themes/root/theme.ini @@ -11,7 +11,6 @@ helpers_to_register[] = "Citation" helpers_to_register[] = "Context" helpers_to_register[] = "CurrentPath" helpers_to_register[] = "DateTime" -helpers_to_register[] = "DisplayDateFormat" helpers_to_register[] = "DisplayLanguageOption" helpers_to_register[] = "Excerpt" helpers_to_register[] = "Flashmessages"