From 880e33cdbe9a17e3abed956c92d627ba2a76cb1a Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 17 Dec 2013 15:47:22 -0800 Subject: [PATCH] CRM-12578 - Cleanup duplicated stylesheets in standalone forms --- CRM/UF/Page/Group.php | 8 +++--- CRM/Utils/String.php | 13 --------- templates/CRM/common/commonCSS.tpl | 42 ------------------------------ 3 files changed, 4 insertions(+), 59 deletions(-) delete mode 100644 templates/CRM/common/commonCSS.tpl diff --git a/CRM/UF/Page/Group.php b/CRM/UF/Page/Group.php index 833ef07905..6494f3ea56 100644 --- a/CRM/UF/Page/Group.php +++ b/CRM/UF/Page/Group.php @@ -225,8 +225,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page { $template = CRM_Core_Smarty::singleton(); $template->assign('gid', $gid); $template->assign('tplFile', 'CRM/Profile/Form/Edit.tpl'); - $profile = trim($template->fetch('CRM/common/commonCSS.tpl')); - $profile .= trim($template->fetch('CRM/Form/default.tpl')); + $profile = trim($template->fetch('CRM/Form/default.tpl')); // not sure how to circumvent our own navigation system to generate the right form url $urlReplaceWith = 'civicrm/profile/create&gid=' . $gid . '&reset=1'; @@ -244,8 +243,9 @@ class CRM_UF_Page_Group extends CRM_Core_Page { $profile = str_replace('/wp-admin/admin.php', '/index.php', $profile); } - // add jquery files - $profile = CRM_Utils_String::addJqueryFiles($profile); + // add header files + CRM_Core_Resources::singleton()->addCoreResources('html-header'); + $profile = CRM_Core_Region::instance('html-header')->render('', FALSE) . $profile; $this->assign('profile', htmlentities($profile, ENT_NOQUOTES, 'UTF-8')); //get the title of uf group diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index eaae593b46..0c023c714d 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -481,19 +481,6 @@ class CRM_Utils_String { return $result; } - /** - * Function to add include files needed for jquery - * - * This appears to be used in cases where the normal html-header - * provided by CRM_Core_Resources can't be used (e.g. when outputting in - * "print" mode, the execution will short-circuit without allowing the - * CMS to output JS/CSS tags). - */ - static function addJqueryFiles(&$html) { - CRM_Core_Resources::singleton()->addCoreResources('html-header'); - return CRM_Core_Region::instance('html-header')->render('', FALSE) . $html; - } - /** * Given an ezComponents-parsed representation of * a text with alternatives return only the first one diff --git a/templates/CRM/common/commonCSS.tpl b/templates/CRM/common/commonCSS.tpl deleted file mode 100644 index 697cc91ab6..0000000000 --- a/templates/CRM/common/commonCSS.tpl +++ /dev/null @@ -1,42 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.4 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2013 | - +--------------------------------------------------------------------+ - | This file is a part of CiviCRM. | - | | - | CiviCRM is free software; you can copy, modify, and distribute it | - | under the terms of the GNU Affero General Public License | - | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | - | | - | CiviCRM 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 Affero General Public License for more details. | - | | - | You should have received a copy of the GNU Affero General Public | - | License and the CiviCRM Licensing Exception along | - | with this program; if not, contact CiviCRM LLC | - | at info[AT]civicrm[DOT]org. If you have questions about the | - | GNU Affero General Public License or the licensing of CiviCRM, | - | see the CiviCRM license FAQ at http://civicrm.org/licensing | - +--------------------------------------------------------------------+ -*} -{if $config->userSystem->is_drupal eq '1'} - {if $config->customCSSURL} - - {else} - - {/if} -{elseif $config->userFramework eq 'Joomla'} - - {if !$config->userFrameworkFrontend} - - {else} - - {/if} - {if $config->customCSSURL} - - {/if} -{/if} -- 2.25.1