From 41d340f901ed7b28ad5a44cbfac225f0104706c7 Mon Sep 17 00:00:00 2001 From: Clinton Graham Date: Tue, 3 Mar 2020 16:46:37 -0500 Subject: [PATCH] pkp/pkp-lib#5523, pkp/customBlockManager#17: refactor block names and settings, migrate block sidebar contexts --- CustomBlockManagerPlugin.inc.php | 80 ++++++++++++++++++- CustomBlockPlugin.inc.php | 8 +- README | 13 +-- .../grid/CustomBlockGridHandler.inc.php | 9 ++- controllers/grid/form/CustomBlockForm.inc.php | 17 ++-- locale/ar_IQ/locale.po | 3 - locale/bg_BG/locale.po | 3 - locale/cs_CZ/locale.po | 3 - locale/da_DK/locale.po | 5 -- locale/de_DE/locale.po | 3 - locale/el_GR/locale.po | 3 - locale/en_US/locale.po | 3 - locale/es_ES/locale.po | 3 - locale/fi_FI/locale.po | 3 - locale/fr_CA/locale.po | 3 - locale/hu_HU/locale.po | 3 - locale/id_ID/locale.po | 4 - locale/it_IT/locale.po | 3 - locale/pt_BR/locale.po | 3 - locale/pt_PT/locale.po | 3 - locale/ru_RU/locale.po | 3 - locale/sl_SI/locale.po | 3 - locale/sr_RS@latin/locale.po | 3 - locale/sv_SE/locale.po | 3 - locale/tr_TR/locale.po | 3 - locale/uk_UA/locale.po | 3 - templates/editCustomBlockForm.tpl | 3 +- version.xml | 4 +- 28 files changed, 110 insertions(+), 90 deletions(-) diff --git a/CustomBlockManagerPlugin.inc.php b/CustomBlockManagerPlugin.inc.php index ff9f027..12af83d 100644 --- a/CustomBlockManagerPlugin.inc.php +++ b/CustomBlockManagerPlugin.inc.php @@ -14,6 +14,12 @@ * */ +// No constant name in core 3.2 (!?!), per https://github.com/pkp/pkp-lib/commit/a76bac72ed068a1d1866398d20cdf28c4977249f#diff-70caff5ef9a513397af1833a3e2a3c7c +import('lib.pkp.classes.plugins.BlockPlugin'); +if (!defined('BLOCK_CONTEXT_SIDEBAR')) { + define('BLOCK_CONTEXT_SIDEBAR', 1); +} + import('lib.pkp.classes.plugins.GenericPlugin'); class CustomBlockManagerPlugin extends GenericPlugin { @@ -62,7 +68,7 @@ function register($category, $path, $mainContextId = null) { foreach ($blocks as $block) { PluginRegistry::register( 'blocks', - new CustomBlockPlugin($block, $this), + new CustomBlockPlugin($block, $this, $contextId), $this->getPluginPath() ); } @@ -146,4 +152,76 @@ function manage($args, $request) { function isSitePlugin() { return !Application::get()->getRequest()->getContext(); } + + /** + * Create a unique name for a child plugin + * + * @return string + */ + function createUniqueName() { + return str_replace('.', 'x', uniqid($this->getUniqueNamePrefix(), true)); + } + + /** + * Get the name prefix for a child plugin + * + * @return string + */ + function getUniqueNamePrefix() { + return $this->getName().'__'; + } + + /** + * We will need to modify data in certain upgrades. + * + * @param $hookName string + * @param $args array + * @return boolean + */ + function installFilters($hookName, $args) { + // There is no opportunity to hook the upgrade event before the new version is written to the versions table. + // The only function automatically called in installPluginVersion::execute() is installFilters(), so we hijack this. + // So, we need to look at the immediately preceeding version, and (re)apply fixes based on guesswork. + $versionDao = DAORegistry::getDAO('VersionDAO'); + $contextDao = Application::getContextDAO(); + $historicVersions = $versionDao->getVersionHistory('plugins.generic', 'customBlockManager'); + if (count($historicVersions) > 1 && $historicVersions[1]->compare('1.3.0') < 0) { + // The last installed version is prior to 1.3.0 + // We need up update the plugin_settings names and move any orphaned sidebar contexts + $contexts = $contextDao->getAll(); + while ($context = $contexts->next()) { + // Load the custom blocks we have created + $blocks = $this->getSetting($context->getId(), 'blocks'); + if (!is_array($blocks)) $blocks = array(); + $pluginSettingsDao = DAORegistry::getDAO('PluginSettingsDAO'); + $newBlocks = array(); + foreach ($blocks as $blockName) { + // Current block uses old naming + if (strpos($blockName, $this->getUniqueNamePrefix()) !== 0) { + $newBlockName = $this->createUniqueName(); + // Update plugin_settings + $settings = $pluginSettingsDao->getPluginSettings($context->getId(), $blockName); + foreach ($settings as $setting_name => $setting_value) { + switch ($setting_name) { + case 'context': + $setting_value = BLOCK_CONTEXT_SIDEBAR; + case 'blockContent': + case 'enabled': + case 'seq': + $pluginSettingsDao->deleteSetting($context->getId(), $blockName, $setting_name); + $pluginSettingsDao->updateSetting($context->getId(), $newBlockName, $setting_name, $setting_value); + break; + default: + error_log('found an unrecognized setting "'.$setting_name.'", in custom block "'.$blockName.'"'); + } + } + $pluginSettingsDao->updateSetting($context->getId(), $newBlockName, 'blockDisplayName', $blockName); + } + $newBlocks[] = $newBlockName; + } + $this->updateSetting($context->getId(), 'blocks', $newBlocks); + } + } + return parent::installFilters($hookName, $args); + } } diff --git a/CustomBlockPlugin.inc.php b/CustomBlockPlugin.inc.php index 0e86bf7..e09a63f 100644 --- a/CustomBlockPlugin.inc.php +++ b/CustomBlockPlugin.inc.php @@ -19,6 +19,8 @@ class CustomBlockPlugin extends BlockPlugin { /** @var string Name of this block plugin */ var $_blockName; + /** @var int Context ID */ + var $_contextId; /** @var CustomBlockManagerPlugin Parent plugin */ var $_parentPlugin; @@ -27,10 +29,12 @@ class CustomBlockPlugin extends BlockPlugin { * Constructor * @param $blockName string Name of this block plugin. * @param $parentPlugin CustomBlockManagerPlugin Custom block plugin management plugin. + * @param $contextId int The context in which this plugin lives */ - function __construct($blockName, $parentPlugin) { + function __construct($blockName, $parentPlugin, $contextId) { $this->_blockName = $blockName; $this->_parentPlugin = $parentPlugin; + $this->_contextId = $contextId; parent::__construct(); } @@ -84,7 +88,7 @@ function getEnabled($contextId = null) { * @copydoc Plugin::getDisplayName() */ function getDisplayName() { - return $this->_blockName . ' ' . __('plugins.generic.customBlock.nameSuffix'); + return $this->getSetting($this->_contextId, 'blockDisplayName') . ' ' . __('plugins.generic.customBlock.nameSuffix'); } /** diff --git a/README b/README index bedaa87..0ab9619 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ ============================================================= === Custom Block Manager Plugin -=== Version: 1.2 +=== Version: 1.3.1 === Author: Juan Pablo Alperin === Co-Author: Bozana Bokan ============================================================= @@ -18,16 +18,17 @@ LICENSE for the complete terms of this license. System Requirements ------------------- This plugin is compatible with... - - OJS 3.0.x - - OMP 1.2.x - - OMP 1.1.x + - OJS 3.2.x + - OMP 3.2.x + - OPS 3.2.x Installation ------------ -To install the plugin: +The Plugin Gallery is the recommended installation method. +To install the plugin manually: - Unpack the plugin tar.gz file to your plugins/generic directory - From your application's installation directory, run the upgrade script: - $ php tools/upgrade.php upgrade + $ php lib/pkp/tools/installPluginVersion.php plugins/generic/customBlockManager/version.xml (NOTE: It is recommended to back up your database first.) - Enable the plugin by going to: Management > Website Settings > Plugins > Generic Plugins diff --git a/controllers/grid/CustomBlockGridHandler.inc.php b/controllers/grid/CustomBlockGridHandler.inc.php index fd7b615..eb43122 100644 --- a/controllers/grid/CustomBlockGridHandler.inc.php +++ b/controllers/grid/CustomBlockGridHandler.inc.php @@ -68,8 +68,9 @@ function initialize($request, $args = null) { $blocks = $customBlockManagerPlugin->getSetting($contextId, 'blocks'); $gridData = array(); if (is_array($blocks)) foreach ($blocks as $block) { + $plugin = new CustomBlockPlugin($block, $customBlockManagerPlugin, $contextId); $gridData[$block] = array( - 'title' => $block + 'title' => $plugin->getSetting($contextId, 'blockDisplayName') ); } $this->setGridDataElements($gridData); @@ -134,7 +135,7 @@ function addCustomBlock($args, $request) { function editCustomBlock($args, $request) { $blockName = $request->getUserVar('blockName'); $context = $request->getContext(); - $contextId = $context ? $context->getId() : 0; + $contextId = $context ? $context->getId() : CONTEXT_ID_NONE; $this->setupTemplate($request); $customBlockPlugin = null; @@ -142,7 +143,7 @@ function editCustomBlock($args, $request) { if ($blockName) { // Create the custom block plugin import('plugins.generic.customBlockManager.CustomBlockPlugin'); - $customBlockPlugin = new CustomBlockPlugin($blockName, CUSTOMBLOCKMANAGER_PLUGIN_NAME); + $customBlockPlugin = new CustomBlockPlugin($blockName, $this->plugin, $contextId); } // Create and present the edit form @@ -171,7 +172,7 @@ function updateCustomBlock($args, $request) { if ($pluginName) { // Create the custom block plugin import('plugins.generic.customBlockManager.CustomBlockPlugin'); - $customBlockPlugin = new CustomBlockPlugin($pluginName, CUSTOMBLOCKMANAGER_PLUGIN_NAME); + $customBlockPlugin = new CustomBlockPlugin($pluginName, $this->plugin, $contextId); } // Create and populate the form diff --git a/controllers/grid/form/CustomBlockForm.inc.php b/controllers/grid/form/CustomBlockForm.inc.php index 4b13137..ad4dd1a 100644 --- a/controllers/grid/form/CustomBlockForm.inc.php +++ b/controllers/grid/form/CustomBlockForm.inc.php @@ -38,8 +38,7 @@ function __construct($template, $contextId, $plugin = null) { // Add form checks $this->addCheck(new FormValidatorPost($this)); $this->addCheck(new FormValidatorCSRF($this)); - $this->addCheck(new FormValidator($this, 'blockName', 'required', 'plugins.generic.customBlock.nameRequired')); - $this->addCheck(new FormValidatorRegExp($this, 'blockName', 'required', 'plugins.generic.customBlock.nameRegEx', '/^[a-zA-Z0-9_-]+$/')); + $this->addCheck(new FormValidator($this, 'blockDisplayName', 'required', 'plugins.generic.customBlock.nameRequired')); } /** @@ -49,23 +48,23 @@ function initData() { $contextId = $this->contextId; $plugin = $this->plugin; - $templateMgr = TemplateManager::getManager(); - $blockName = null; $blockContent = null; if ($plugin) { $blockName = $plugin->getName(); + $blockDisplayName = $plugin->getSetting($contextId, 'blockDisplayName'); $blockContent = $plugin->getSetting($contextId, 'blockContent'); } $this->setData('blockContent', $blockContent); $this->setData('blockName', $blockName); + $this->setData('blockDisplayName', $blockDisplayName); } /** * Assign form data to user-submitted data. */ function readInputData() { - $this->readUserVars(array('blockName', 'blockContent')); + $this->readUserVars(array('blockName', 'blockDisplayName', 'blockContent')); } /** @@ -74,11 +73,13 @@ function readInputData() { function execute(...$functionArgs) { $plugin = $this->plugin; $contextId = $this->contextId; + $blockName = $this->getData('blockName'); if (!$plugin) { // Create a new custom block plugin import('plugins.generic.customBlockManager.CustomBlockPlugin'); $customBlockManagerPlugin = PluginRegistry::getPlugin('generic', CUSTOMBLOCKMANAGER_PLUGIN_NAME); - $plugin = new CustomBlockPlugin($this->getData('blockName'), $customBlockManagerPlugin); + $blockName = $customBlockManagerPlugin->createUniqueName(); + $plugin = new CustomBlockPlugin($blockName, $customBlockManagerPlugin, $contextId); // Default the block to being enabled $plugin->setEnabled(true); @@ -87,13 +88,13 @@ function execute(...$functionArgs) { $blocks = $customBlockManagerPlugin->getSetting($contextId, 'blocks'); if (!isset($blocks)) $blocks = array(); - array_push($blocks, $this->getData('blockName')); + $blocks[] = $blockName; $customBlockManagerPlugin->updateSetting($contextId, 'blocks', $blocks); } // update custom block plugin content $plugin->updateSetting($contextId, 'blockContent', $this->getData('blockContent')); - + $plugin->updateSetting($contextId, 'blockDisplayName', $this->getData('blockDisplayName')); parent::execute(...$functionArgs); } } diff --git a/locale/ar_IQ/locale.po b/locale/ar_IQ/locale.po index 71e65f8..7ed5663 100644 --- a/locale/ar_IQ/locale.po +++ b/locale/ar_IQ/locale.po @@ -43,6 +43,3 @@ msgstr "هذه كتلة مولدة من قبل المستخدم." msgid "plugins.generic.customBlock.nameRequired" msgstr "اسم الكتلة المخصصة مطلوب حتماً." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "اسم الكتلة المخصصة يجب أن يقتصر على الحروف والأرقام وعلامة الطرح والخط التحتاني." diff --git a/locale/bg_BG/locale.po b/locale/bg_BG/locale.po index e3b3288..7147e6c 100644 --- a/locale/bg_BG/locale.po +++ b/locale/bg_BG/locale.po @@ -43,6 +43,3 @@ msgstr "Това е егенериран от потребителя блок." msgid "plugins.generic.customBlock.nameRequired" msgstr "Изисква се име за потребителския блок." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Името на потребителския блок трябва да съдърожа само букви, цифри и долно тире." diff --git a/locale/cs_CZ/locale.po b/locale/cs_CZ/locale.po index 0267e67..3c58e85 100644 --- a/locale/cs_CZ/locale.po +++ b/locale/cs_CZ/locale.po @@ -43,6 +43,3 @@ msgstr "Tento plugin vám umožňuje spravovat (přidávat, upravovat a odstraň msgid "plugins.generic.customBlock.nameRequired" msgstr "Je třeba zadat jméno uživatelského bloku." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Název uživatelského bloku musí obsahovat pouze písmena, čísla a pomlčky/podtržítka." diff --git a/locale/da_DK/locale.po b/locale/da_DK/locale.po index b295742..72edcd8 100644 --- a/locale/da_DK/locale.po +++ b/locale/da_DK/locale.po @@ -46,8 +46,3 @@ msgstr "Dette er et brugerdefineret blok." msgid "plugins.generic.customBlock.nameRequired" msgstr "Et brugerdefineret blok-navn er påkrævet." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "" -"Det brugerdefinerede blok-navn må kun indeholde bogstaver, numre og " -"bindestreg/understregning." diff --git a/locale/de_DE/locale.po b/locale/de_DE/locale.po index 2bff299..b53d143 100644 --- a/locale/de_DE/locale.po +++ b/locale/de_DE/locale.po @@ -43,6 +43,3 @@ msgstr "Dies ist ein selbst angelegter Block." msgid "plugins.generic.customBlock.nameRequired" msgstr "Der Name des benutzerdefinierten Blocks wird benötigt." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Der Name des benutzerdefinierten Blocks darf nur Buchstaben, Ziffern und Bindestriche/Unterstriche enthalten." diff --git a/locale/el_GR/locale.po b/locale/el_GR/locale.po index 7003100..a4779fa 100644 --- a/locale/el_GR/locale.po +++ b/locale/el_GR/locale.po @@ -43,6 +43,3 @@ msgstr "Αυτό είναι δομικό στοιχείο δημιουργημέ msgid "plugins.generic.customBlock.nameRequired" msgstr "Το όνομα του δομικού στοιχείου είναι απαραίτητο." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Το όνομα του δομικού στοιχείου πρέπει να περιλαμβάνει μόνο γράμματα, αριθμούς και παύλες/κάτω παύλες." diff --git a/locale/en_US/locale.po b/locale/en_US/locale.po index a59587f..1c3177c 100644 --- a/locale/en_US/locale.po +++ b/locale/en_US/locale.po @@ -43,6 +43,3 @@ msgstr "This is a user-generated block." msgid "plugins.generic.customBlock.nameRequired" msgstr "The custom block name is required." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "The custom block name must contain only letters, numbers, and hyphens/underscores." diff --git a/locale/es_ES/locale.po b/locale/es_ES/locale.po index 7323c75..394325d 100644 --- a/locale/es_ES/locale.po +++ b/locale/es_ES/locale.po @@ -43,6 +43,3 @@ msgstr "Este es un Bloque generado por el usuario." msgid "plugins.generic.customBlock.nameRequired" msgstr "Se requiere el nombre del bloque personalizado." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "El nombre del bloque personalizado sólo debe contener letras, números y guiones/guiones bajos." diff --git a/locale/fi_FI/locale.po b/locale/fi_FI/locale.po index 9aad689..a5cb337 100644 --- a/locale/fi_FI/locale.po +++ b/locale/fi_FI/locale.po @@ -43,6 +43,3 @@ msgstr "Tämä on käyttäjän luoma lohko." msgid "plugins.generic.customBlock.nameRequired" msgstr "Mukautetun lohkon nimi vaaditaan." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Mukautetun lohkon nimi voi sisältää vain kirjaimia, numeroita ja yhdysmerkkejä/alaviivoja." diff --git a/locale/fr_CA/locale.po b/locale/fr_CA/locale.po index 6f16c37..77ae884 100644 --- a/locale/fr_CA/locale.po +++ b/locale/fr_CA/locale.po @@ -43,6 +43,3 @@ msgstr "Aucun bloc personnalisé n'a été créé." msgid "plugins.generic.customBlock.nameRequired" msgstr "Le nom du bloc personnalisé est requis." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Le nom du bloc personnalisé ne doit contenir que des lettres, des chiffres, des tirets et/ou des traits de soulignement." diff --git a/locale/hu_HU/locale.po b/locale/hu_HU/locale.po index 92a7436..f1d20dd 100644 --- a/locale/hu_HU/locale.po +++ b/locale/hu_HU/locale.po @@ -46,6 +46,3 @@ msgstr "Ez egy felhasználó által generált blokk." msgid "plugins.generic.customBlock.nameRequired" msgstr "Egyéni blokknév kötelező." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Az egyéni blokknév csak betűket, számokat és kötőjeleket/alulhúzásokat tartalmazhat." diff --git a/locale/id_ID/locale.po b/locale/id_ID/locale.po index 6006798..69eea9a 100644 --- a/locale/id_ID/locale.po +++ b/locale/id_ID/locale.po @@ -32,10 +32,6 @@ msgstr "(Plugin Custom Block)" msgid "plugins.generic.customBlock.description" msgstr "Ini adalah user-generated block." -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "" -"Nama blok baru hanya boleh mengandung huruf, angka, hyphens/underscores." - msgid "plugins.generic.customBlock.nameRequired" msgstr "Nama blok baru wajib diisi." diff --git a/locale/it_IT/locale.po b/locale/it_IT/locale.po index b03d7b8..ae5d817 100644 --- a/locale/it_IT/locale.po +++ b/locale/it_IT/locale.po @@ -46,6 +46,3 @@ msgstr "Questo è un blocco generato dall'utente." msgid "plugins.generic.customBlock.nameRequired" msgstr "Inserire il nome del blocco personalizzato." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Il nome del blocco personalizzato può contenere solo lettere, numeri e trattini alti o bassi." diff --git a/locale/pt_BR/locale.po b/locale/pt_BR/locale.po index c7f5131..78866e9 100644 --- a/locale/pt_BR/locale.po +++ b/locale/pt_BR/locale.po @@ -43,6 +43,3 @@ msgstr "Não há blocos personalizados criados." msgid "plugins.generic.customBlock.nameRequired" msgstr "O nome do bloco personalizado é necessário." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "O nome do bloco personalizado deve conter apenas letras, números e hífens / sublinhados." diff --git a/locale/pt_PT/locale.po b/locale/pt_PT/locale.po index a6cfea9..9917ee4 100644 --- a/locale/pt_PT/locale.po +++ b/locale/pt_PT/locale.po @@ -43,6 +43,3 @@ msgstr "Nenhum bloco personalizado criado." msgid "plugins.generic.customBlock.nameRequired" msgstr "O nome do bloco personalizado é obrigatório." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "O nome do bloco personalizado só pode conter letras, números e hífenes ou sublinhados." diff --git a/locale/ru_RU/locale.po b/locale/ru_RU/locale.po index 05e68d7..2c7c860 100644 --- a/locale/ru_RU/locale.po +++ b/locale/ru_RU/locale.po @@ -43,6 +43,3 @@ msgstr "Это пользовательский блок." msgid "plugins.generic.customBlock.nameRequired" msgstr "Имя пользовательского блока обязательно." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Имя пользовательского блока должно содержать только буквы, цифры, дефисы и подчеркивания." diff --git a/locale/sl_SI/locale.po b/locale/sl_SI/locale.po index 84ab4e1..96b909f 100644 --- a/locale/sl_SI/locale.po +++ b/locale/sl_SI/locale.po @@ -43,6 +43,3 @@ msgstr "To blok, ki ga je ustvaril uporabnik." msgid "plugins.generic.customBlock.nameRequired" msgstr "Ime bloka je obvezno." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Ime bloka lahko vsebuje le črke, številke in pomišljaj/podčrtaj." diff --git a/locale/sr_RS@latin/locale.po b/locale/sr_RS@latin/locale.po index 7f28355..245609a 100644 --- a/locale/sr_RS@latin/locale.po +++ b/locale/sr_RS@latin/locale.po @@ -43,6 +43,3 @@ msgstr "Nema prilagođenih blokova." msgid "plugins.generic.customBlock.nameRequired" msgstr "Ime bloka je oavezno." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Ime bloka može sadržati samo slova, brojeve, crte i podvlake." diff --git a/locale/sv_SE/locale.po b/locale/sv_SE/locale.po index cf87440..84e55e1 100644 --- a/locale/sv_SE/locale.po +++ b/locale/sv_SE/locale.po @@ -43,6 +43,3 @@ msgstr "Det här är ett användargenererat block." msgid "plugins.generic.customBlock.nameRequired" msgstr "Ett namn på det anpassade blocket krävs." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Det anpassade blockets namn får bara innehålla bokstäver, siffror och bindestreck/understreck." diff --git a/locale/tr_TR/locale.po b/locale/tr_TR/locale.po index 084edee..06daa3d 100644 --- a/locale/tr_TR/locale.po +++ b/locale/tr_TR/locale.po @@ -43,6 +43,3 @@ msgstr "Özel blok oluşturulmadı." msgid "plugins.generic.customBlock.nameRequired" msgstr "Özel blok adı gerekli." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Özel blok adı sadece harf, sayı ve kısa çizgi / alt çizgi içermelidir." diff --git a/locale/uk_UA/locale.po b/locale/uk_UA/locale.po index d2567db..57a98e4 100644 --- a/locale/uk_UA/locale.po +++ b/locale/uk_UA/locale.po @@ -43,6 +43,3 @@ msgstr "Це створений користувачем блок." msgid "plugins.generic.customBlock.nameRequired" msgstr "Назва власного блоку обов'язкова." - -msgid "plugins.generic.customBlock.nameRegEx" -msgstr "Назва власного блоку повинна містити лише літери, цифри, дефіс та підкреслювання." diff --git a/templates/editCustomBlockForm.tpl b/templates/editCustomBlockForm.tpl index ddcdba1..ef9d63e 100644 --- a/templates/editCustomBlockForm.tpl +++ b/templates/editCustomBlockForm.tpl @@ -19,7 +19,8 @@ {csrf} {fbvFormArea id="customBlocksFormArea" class="border"} {fbvFormSection} - {fbvElement type="text" label="plugins.generic.customBlockManager.blockName" id="blockName" value=$blockName maxlength="40" inline=true size=$fbvStyles.size.MEDIUM} + {fbvElement type="hidden" id="blockName" value=$blockName} + {fbvElement type="text" label="plugins.generic.customBlockManager.blockName" id="blockDisplayName" value=$blockDisplayName maxlength="40" inline=true size=$fbvStyles.size.MEDIUM} {/fbvFormSection} {fbvFormSection label="plugins.generic.customBlock.content" for="blockContent"} {fbvElement type="textarea" multilingual=true name="blockContent" id="blockContent" value=$blockContent rich=true height=$fbvStyles.height.TALL} diff --git a/version.xml b/version.xml index 623e9cf..85c3065 100644 --- a/version.xml +++ b/version.xml @@ -13,8 +13,8 @@ customBlockManager plugins.generic - 1.2.0.0 - 2014-09-19 + 1.3.1.0 + 2020-03-03 1 CustomBlockManagerPlugin