From f640e46c0cd1cc97d9e46115f6ff3179106a39e1 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sat, 30 May 2015 06:23:53 +0200 Subject: [PATCH] CRM-16590 - Admin/Extensions - Fix regression When installing a new extension, it raises an exception because it cannot display the pretty name of the extension. Moreover, it handles localization inappropriately. This is a follow-up to 17d48d22. --- CRM/Admin/Form/Extensions.php | 25 +++++++++++-------- templates/CRM/Admin/Page/ExtensionDetails.tpl | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CRM/Admin/Form/Extensions.php b/CRM/Admin/Form/Extensions.php index 9ef0612f61..fcd7f1ce3c 100644 --- a/CRM/Admin/Form/Extensions.php +++ b/CRM/Admin/Form/Extensions.php @@ -100,35 +100,40 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form { * @return void */ public function buildQuickForm() { - - $info = CRM_Extension_System::singleton()->getMapper()->keyToInfo($this->_key); - $extInfo = CRM_Admin_Page_Extensions::createExtendedInfo($info); - $extName = $extInfo['name']; - switch ($this->_action) { case CRM_Core_Action::ADD: $buttonName = ts('Install'); - $title = ts('Install ' . $extName . '?'); + $title = ts('Install "%1"?', array( + 1 => $this->_key, + )); break; case CRM_Core_Action::UPDATE: $buttonName = ts('Download and Install'); - $title = ts('Download and Install ' . $extName . '?'); + $title = ts('Download and Install "%1"?', array( + 1 => $this->_key, + )); break; case CRM_Core_Action::DELETE: $buttonName = ts('Uninstall'); - $title = ts('Uninstall ' . $extName . '?'); + $title = ts('Uninstall "%1"?', array( + 1 => $this->_key, + )); break; case CRM_Core_Action::ENABLE: $buttonName = ts('Enable'); - $title = ts('Enable ' . $extName . '?'); + $title = ts('Enable "%1"?', array( + 1 => $this->_key, + )); break; case CRM_Core_Action::DISABLE: $buttonName = ts('Disable'); - $title = ts('Disable ' . $extName . '?'); + $title = ts('Disable "%1"?', array( + 1 => $this->_key, + )); break; } diff --git a/templates/CRM/Admin/Page/ExtensionDetails.tpl b/templates/CRM/Admin/Page/ExtensionDetails.tpl index 0e3c9eb74d..3b883fd756 100644 --- a/templates/CRM/Admin/Page/ExtensionDetails.tpl +++ b/templates/CRM/Admin/Page/ExtensionDetails.tpl @@ -1,5 +1,5 @@ - {if $action EQ 1} + {if $extension.name} -- 2.25.1
{ts}Name (key){/ts}{$extension.name} ({$extension.key})