Commit 56a22645 authored by mcrider's avatar mcrider
Browse files

#3977# Behaviour after enabling plugins is inconsistent and lacking in information

parent ff7bf5cb
......@@ -213,10 +213,14 @@ class ThesisPlugin extends GenericPlugin {
return false;
}
/**
* Perform management functions
*/
function manage($verb, $args) {
/*
* Execute a management verb on this plugin
* @param $verb string
* @param $args array
* @param $message string Location for the plugin to put a result msg
* @return boolean
*/
function manage($verb, $args, &$message) {
$templateMgr = &TemplateManager::getManager();
$templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
$journal = &Request::getJournal();
......@@ -225,10 +229,12 @@ class ThesisPlugin extends GenericPlugin {
switch ($verb) {
case 'enable':
$this->setEnabled(true);
$message = Locale::translate('plugins.generic.thesis.enabled');
$returner = false;
break;
case 'disable':
$this->setEnabled(false);
$message = Locale::translate('plugins.generic.thesis.disabled');
$returner = false;
break;
case 'settings':
......
......@@ -204,4 +204,6 @@
<message key="plugins.generic.thesis.form.supervisorEmail">Supervisor email</message>
<message key="plugins.generic.thesis.form.supervisorEmailValid">A valid supervisor's email is required.</message>
<message key="plugins.generic.thesis.enabled">The Thesis Plugin has been enabled.</message>
<message key="plugins.generic.thesis.disabled">The Thesis Plugin has been disabled.</message>
</locale>
......@@ -138,10 +138,14 @@ class ThesisFeedPlugin extends GenericPlugin {
return $verbs;
}
/**
* Perform management functions
*/
function manage($verb, $args) {
/*
* Execute a management verb on this plugin
* @param $verb string
* @param $args array
* @param $message string Location for the plugin to put a result msg
* @return boolean
*/
function manage($verb, $args, &$message) {
$returner = true;
$journal =& Request::getJournal();
......@@ -169,10 +173,12 @@ class ThesisFeedPlugin extends GenericPlugin {
break;
case 'enable':
$this->updateSetting($journal->getJournalId(), 'enabled', true);
$message = Locale::translate('plugins.generic.thesisFeed.enabled');
$returner = false;
break;
case 'disable':
$this->updateSetting($journal->getJournalId(), 'enabled', false);
$message = Locale::translate('plugins.generic.thesisFeed.disabled');
$returner = false;
break;
}
......
......@@ -15,6 +15,8 @@
<locale name="en_US" full_name="U.S. English">
<message key="plugins.generic.thesisfeed.displayName">Thesis Abstracts Feed Plugin</message>
<message key="plugins.generic.thesisfeed.description">This plugin produces RSS/Atom web syndication feeds for thesis abstracts.</message>
<message key="plugins.generic.thesisfeed.enabled">The Thesis Abstracts Feed Plugin has been enabled.</message>
<message key="plugins.generic.thesisfeed.disabled">The Thesis Abstracts Feed Plugin has been disabled.</message>
<message key="plugins.generic.thesisfeed.settings">Settings</message>
<message key="plugins.generic.thesisfeed.settings.all">Display feed links on all journal pages.</message>
......
......@@ -367,21 +367,24 @@ class TinyMCEPlugin extends GenericPlugin {
return $verbs;
}
/**
* Execute a management verb on this plugin
* @param $verb string
* @param $args array
* @return boolean
*/
function manage($verb, $args) {
/*
* Execute a management verb on this plugin
* @param $verb string
* @param $args array
* @param $message string Location for the plugin to put a result msg
* @return boolean
*/
function manage($verb, $args, &$message) {
$journal =& Request::getJournal();
$journalId = $journal?$journal->getJournalId():0;
switch ($verb) {
case 'enable':
$this->updateSetting($journalId, 'enabled', true);
$message = Locale::translate('plugins.generic.tinymce.enabled');
break;
case 'disable':
$this->updateSetting($journalId, 'enabled', false);
$message = Locale::translate('plugins.generic.tinymce.disabled');
break;
}
return false;
......
......@@ -16,6 +16,7 @@
<message key="plugins.generic.tinymce.name">TinyMCE Plugin</message>
<message key="plugins.generic.tinymce.description"><![CDATA[This plugin enables WYSIWYG editing of OJS textareas using the <a href="http://tinymce.moxiecode.com" target="_new">TinyMCE</a> content editor.]]></message>
<message key="plugins.generic.tinymce.descriptionDisabled"><![CDATA[This plugin enables WYSIWYG editing of OJS textareas using the <a href="http://tinymce.moxiecode.com" target="_new">TinyMCE</a> content editor. <strong>TinyMCE is not currently installed; please install it in {$tinyMcePath}.</strong>]]></message>
<message key="plugins.generic.tinymce.enabled">The TinyMCE Plugin has been enabled.</message>
<message key="plugins.generic.tinymce.disabled">The TinyMCE Plugin has been disabled.</message>
<message key="plugins.generic.tinymce.settings">Settings</message>
</locale>
......@@ -73,15 +73,24 @@ class TranslatorPlugin extends GenericPlugin {
return $verbs;
}
function manage($verb, $args) {
/*
* Execute a management verb on this plugin
* @param $verb string
* @param $args array
* @param $message string Location for the plugin to put a result msg
* @return boolean
*/
function manage($verb, $args, &$message) {
if (!Validation::isSiteAdmin()) return false;
switch ($verb) {
case 'enable':
$this->updateSetting(0, 'enabled', true);
$message = Locale::translate('plugins.generic.translator.enabled');
break;
case 'disable':
$this->updateSetting(0, 'enabled', false);
$message = Locale::translate('plugins.generic.translator.disabled');
break;
case 'translate':
Request::redirect('index', 'translate');
......
......@@ -17,7 +17,9 @@
<message key="plugins.generic.translator.description">This plugin allows web-based maintenance of translation files.</message>
<message key="plugins.generic.translator.longdescription">This area allows the Site Administrator to build, modify and check translations of OJS. This is site-wide and should not be used to customize a single OJS journal. If you correct or create a translation, please consider submitting it to the Public Knowledge Project for distribution with future releases.</message>
<message key="plugins.generic.translator.localeDescription">This page lists all components of an OJS translation and provides the translator with the opportunity to edit each. A full translation of a translation should contain complete translations of all components.</message>
<message key="plugins.generic.translator.enabled">The Translator Plugin has been enabled.</message>
<message key="plugins.generic.translator.disabled">The Translator Plugin has been disabled.</message>
<message key="plugins.generic.translator.localeName">Locale Name</message>
<message key="plugins.generic.translator.localeKey">Key</message>
<message key="plugins.generic.translator.localeKey.description">Enter an entire locale key to search for.</message>
......
......@@ -170,10 +170,14 @@ class WebFeedPlugin extends GenericPlugin {
return $verbs;
}
/**
* Perform management functions
*/
function manage($verb, $args) {
/*
* Execute a management verb on this plugin
* @param $verb string
* @param $args array
* @param $message string Location for the plugin to put a result msg
* @return boolean
*/
function manage($verb, $args, &$message) {
$returner = true;
$journal =& Request::getJournal();
......@@ -201,10 +205,12 @@ class WebFeedPlugin extends GenericPlugin {
break;
case 'enable':
$this->updateSetting($journal->getJournalId(), 'enabled', true);
$message = Locale::translate('plugins.generic.webfeed.enabled');
$returner = false;
break;
case 'disable':
$this->updateSetting($journal->getJournalId(), 'enabled', false);
$message = Locale::translate('plugins.generic.webfeed.disabled');
$returner = false;
break;
}
......
......@@ -15,6 +15,8 @@
<locale name="en_US" full_name="U.S. English">
<message key="plugins.generic.webfeed.displayName">Web Feed Plugin</message>
<message key="plugins.generic.webfeed.description">This plugin produces RSS/Atom web syndication feeds for the current issue.</message>
<message key="plugins.generic.webfeed.enabled">The Web Feed Plugin has been enabled.</message>
<message key="plugins.generic.webfeed.disabled">The Web Feed Plugin has been disabled.</message>
<message key="plugins.generic.webfeed.settings">Settings</message>
<message key="plugins.generic.webfeed.settings.issue">Display web feed links on issue pages only.</message>
......
......@@ -203,10 +203,14 @@ class XMLGalleyPlugin extends GenericPlugin {
return false;
}
/**
* Perform management functions
*/
function manage($verb, $args) {
/*
* Execute a management verb on this plugin
* @param $verb string
* @param $args array
* @param $message string Location for the plugin to put a result msg
* @return boolean
*/
function manage($verb, $args, &$message) {
$journal =& Request::getJournal();
$templateMgr = &TemplateManager::getManager();
......@@ -320,9 +324,11 @@ class XMLGalleyPlugin extends GenericPlugin {
return true;
case 'enable':
$this->setEnabled(true);
$message = Locale::translate('plugins.generic.xmlGalley.enabled');
return false;
case 'disable':
$this->setEnabled(false);
$message = Locale::translate('plugins.generic.xmlGalley.disabled');
return false;
}
}
......
......@@ -15,6 +15,8 @@
<locale name="en_US" full_name="U.S. English">
<message key="plugins.generic.xmlGalley.displayName">XML Galley Plugin</message>
<message key="plugins.generic.xmlGalley.description">This plugin generates XHTML galleys from an XML article using XSLT.</message>
<message key="plugins.generic.xmlGalley.enabled">The XML Galley Plugin has been enabled.</message>
<message key="plugins.generic.xmlGalley.disabled">The XML Galley Plugin has been disabled.</message>
<message key="plugins.generic.xmlGalley.manager.settings">Settings</message>
......
......@@ -721,6 +721,10 @@ ul.filter li {
display: inline;
}
li.pluginManaged {
color: green;
}
div.separator {
width: 100%;
margin-top: 1em;
......
......@@ -35,6 +35,13 @@
{/if}
{/foreach}
{if $message}
<ul>
<li class="pluginManaged">{$message}</li>
</ul>
{/if}
<ul class="plain">
{foreach from=$plugins item=plugin}
{if $plugin->getCategory() != $category}
......
Supports Markdown
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