Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#3594 Support new schemas and Vue.js forms #42

Merged
merged 2 commits into from
Jan 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions StaticPagesHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ function view($args, $request) {

$vars = array();
if ($context) $vars = array(
'{$contactName}' => $context->getSetting('contactName'),
'{$contactEmail}' => $context->getSetting('contactEmail'),
'{$supportName}' => $context->getSetting('supportName'),
'{$supportPhone}' => $context->getSetting('supportPhone'),
'{$supportEmail}' => $context->getSetting('supportEmail'),
'{$contactName}' => $context->getData('contactName'),
'{$contactEmail}' => $context->getData('contactEmail'),
'{$supportName}' => $context->getData('supportName'),
'{$supportPhone}' => $context->getData('supportPhone'),
'{$supportEmail}' => $context->getData('supportEmail'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place I can think of in the code where variables get wrapped individually in {$ ... } -- maybe make that programmatic a little lower in the stack?

);
$templateMgr->assign('content', strtr(self::$staticPage->getLocalizedContent(), $vars));

Expand Down
7 changes: 3 additions & 4 deletions StaticPagesPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function register($category, $path, $mainContextId = null) {
$staticPagesDao = new StaticPagesDAO();
DAORegistry::registerDAO('StaticPagesDAO', $staticPagesDao);

HookRegistry::register('Templates::Management::Settings::website', array($this, 'callbackShowWebsiteSettingsTabs'));
HookRegistry::register('Template::Settings::website', array($this, 'callbackShowWebsiteSettingsTabs'));

// Intercept the LoadHandler hook to present
// static pages when requested.
Expand All @@ -75,12 +75,12 @@ function register($category, $path, $mainContextId = null) {
* @return boolean Hook handling status
*/
function callbackShowWebsiteSettingsTabs($hookName, $args) {
$templateMgr = $args[1];
$output =& $args[2];
$request =& Registry::get('request');
$dispatcher = $request->getDispatcher();

// Add a new tab for static pages
$output .= '<li><a name="staticPages" href="' . $dispatcher->url($request, ROUTE_COMPONENT, null, 'plugins.generic.staticPages.controllers.grid.StaticPageGridHandler', 'index') . '">' . __('plugins.generic.staticPages.staticPages') . '</a></li>';
$output .= $templateMgr->fetch($this->getTemplateResource('staticPagesTab.tpl'));

// Permit other plugins to continue interacting with this hook
return false;
Expand Down Expand Up @@ -194,4 +194,3 @@ function getJavaScriptURL($request) {
return $request->getBaseUrl() . '/' . $this->getPluginPath() . '/js';
}
}

10 changes: 5 additions & 5 deletions controllers/grid/form/StaticPageForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ function fetch($request, $template = null, $display = false) {
));

if ($context = $request->getContext()) $templateMgr->assign('allowedVariables', array(
'contactName' => __('plugins.generic.tinymce.variables.principalContactName', array('value' => $context->getSetting('contactName'))),
'contactEmail' => __('plugins.generic.tinymce.variables.principalContactEmail', array('value' => $context->getSetting('contactEmail'))),
'supportName' => __('plugins.generic.tinymce.variables.supportContactName', array('value' => $context->getSetting('supportName'))),
'supportPhone' => __('plugins.generic.tinymce.variables.supportContactPhone', array('value' => $context->getSetting('supportPhone'))),
'supportEmail' => __('plugins.generic.tinymce.variables.supportContactEmail', array('value' => $context->getSetting('supportEmail'))),
'contactName' => __('plugins.generic.tinymce.variables.principalContactName', array('value' => $context->getData('contactName'))),
'contactEmail' => __('plugins.generic.tinymce.variables.principalContactEmail', array('value' => $context->getData('contactEmail'))),
'supportName' => __('plugins.generic.tinymce.variables.supportContactName', array('value' => $context->getData('supportName'))),
'supportPhone' => __('plugins.generic.tinymce.variables.supportContactPhone', array('value' => $context->getData('supportPhone'))),
'supportEmail' => __('plugins.generic.tinymce.variables.supportContactEmail', array('value' => $context->getData('supportEmail'))),
));

return parent::fetch($request, $template, $display);
Expand Down
13 changes: 13 additions & 0 deletions templates/staticPagesTab.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{**
* templates/staticPages.tpl
*
* Copyright (c) 2014-2018 Simon Fraser University
* Copyright (c) 2003-2018 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Static pages plugin -- displays the StaticPagesGrid.
*}
<tab name="{translate key="plugins.generic.staticPages.staticPages"}">
{capture assign=staticPageGridUrl}{url router=$smarty.const.ROUTE_COMPONENT component="plugins.generic.staticPages.controllers.grid.StaticPageGridHandler" op="fetchGrid" escape=false}{/capture}
{load_url_in_div id="staticPageGridContainer" url=$staticPageGridUrl}
</tab>