Skip to content
Snippets Groups Projects
Commit 8a178b42 authored by lobo's avatar lobo
Browse files

Merge pull request #1891 from colemanw/css

CRM-12578 - Add option to disable civicrm.css
parents db82fce5 95c0a77c
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@
class CRM_Admin_Form_Setting_Url extends CRM_Admin_Form_Setting {
protected $_settings = array(
'cvv_backoffice_required' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
'disable_core_css' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
);
/**
* Function to build the form
......@@ -55,7 +56,7 @@ class CRM_Admin_Form_Setting_Url extends CRM_Admin_Form_Setting {
$this->addElement('text', 'userFrameworkResourceURL', ts('CiviCRM Resource URL'));
$this->addElement('text', 'imageUploadURL', ts('Image Upload URL'));
$this->addElement('text', 'customCSSURL', ts('Custom CiviCRM CSS URL'));
$this->addElement('text', 'customCSSURL', ts('Custom css URL'));
$this->addElement('text', 'extensionsURL', ts('Extension Resource URL'));
$this->addYesNo('enableSSL', ts('Force Secure URLs (SSL)'));
$this->addYesNo('verifySSL', ts('Verify SSL Certs'));
......
......@@ -493,8 +493,9 @@ class CRM_Core_Resources {
if (!empty($config->customCSSURL)) {
$this->addStyleUrl($config->customCSSURL, -99, $region);
}
else {
if (!CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'disable_core_css')) {
$this->addStyleFile('civicrm', 'css/civicrm.css', -99, $region);
// extras.css is deprecated. Don't use it.
$this->addStyleFile('civicrm', 'css/extras.css', -98, $region);
}
}
......
......@@ -104,6 +104,7 @@ class CRM_Upgrade_Incremental_php_FourFour {
}
function upgrade_4_4_1($rev) {
$config = CRM_Core_Config::singleton();
// CRM-13327 upgrade handling for the newly added name badges
$ogID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'name_badge', 'id', 'name');
$nameBadges = array_flip(array_values(CRM_Core_BAO_OptionValue::getOptionValuesAssocArrayFromName('name_badge')));
......@@ -140,6 +141,13 @@ class CRM_Upgrade_Incremental_php_FourFour {
}
}
// CRM-12578 - Prior to this version a CSS file under drupal would disable core css
if (!empty($config->customCSSURL) && strpos($config->userFramework, 'Drupal') === 0) {
// The new setting doesn't exist yet - need to create it first
CRM_Core_BAO_Setting::updateSettingsFromMetaData();
CRM_Core_BAO_Setting::setItem('1', CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'disable_core_css');
}
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.4.1')), 'task_4_4_x_runSql', $rev);
$this->addTask('Patch word-replacement schema', 'wordReplacements_patch', $rev);
}
......
/* $Id$ */
/*
** Put your local CSS modifications in this file
** if you don't want to modify system provided
** civicrm.css.
*/
/**
* @deprecated
* This file is deprecated and support will be removed for it in version 4.5
* Don't use it. Instead configure a custom css url at /civicrm/admin/setting/url?reset=1
*/
......@@ -627,4 +627,19 @@ When enabled, statistics about your CiviCRM installation are reported anonymousl
'description' => null,
'help_text' => null,
),
'disable_core_css' => array(
'group_name' => 'CiviCRM Preferences',
'group' => 'core',
'name' => 'disable_core_css',
'type' => 'Boolean',
'quick_form_type' => 'YesNo',
'default' => '0',
'add' => '4.4',
'title' => 'Disable CiviCRM css',
'is_domain' => 1,
'is_contact' => 0,
'description' => 'Prevent the stylesheet "civicrm.css" from being loaded.',
'help_text' => NULL,
),
);
......@@ -37,8 +37,8 @@
*/
return array (
'userFrameworkResourceURL' => array(
'group' => 'UrlPreferences',
'group_name' => 'url',
'group' => 'url',
'group_name' => 'URL Preferences',
'name' => 'userFrameworkResourceURL',
'type' => 'String',
'default' => null,
......@@ -51,8 +51,8 @@ return array (
'validate_callback' => 'CRM_Utils_Rule::url',
),
'imageUploadURL' => array(
'group' => 'UrlPreferences',
'group_name' => 'url',
'group' => 'url',
'group_name' => 'URL Preferences',
'name' => 'imageUploadURL',
'type' => 'String',
'default' => null,
......@@ -65,8 +65,8 @@ return array (
'validate_callback' => 'CRM_Utils_Rule::url',
),
'customCSSURL' => array(
'group' => 'UrlPreferences',
'group_name' => 'url',
'group' => 'url',
'group_name' => 'URL Preferences',
'name' => 'customCSSURL',
'type' => 'String',
'default' => null,
......@@ -79,5 +79,4 @@ return array (
'validate_callback' => 'CRM_Utils_Rule::url',
),
);
);
This diff is collapsed.
......@@ -80,9 +80,8 @@
{/htxt}
{htxt id='id-css_url-title'}
{ts}Custom CSS{/ts}
{ts}Customizing CSS{/ts}
{/htxt}
{htxt id='id-css_url'}
<p>{ts}If you want to modify the look and feel of CiviCRM screens beyond what your CMS theme does, you can replace CiviCRM's primary CSS file (css/civicrm.css) with a customized version. Use this field to specify the URL of the replacement CSS file.{/ts}</p>
<p>{ts}You can also define additional CSS styles to be applied to all or specific page elements by adding CSS styles to the 'extra CSS' file: <em>css/extras.css</em>. This file is included in the downloaded codebase, but is empty by default. If you can accomplish required theming results with this approach, you can avoid the work of merging your custom CSS file changes with upgraded versions.{/ts}</p>
<p>{ts}You can modify the look and feel of CiviCRM by adding your own stylesheet. For small to medium sized modifications, use your css file to override some of the styles in civicrm.css. Or if you need to make drastic changes, you can choose to disable civicrm.css completely.{/ts}</p>
{/htxt}
......@@ -31,50 +31,59 @@
<table class="form-layout">
<tr class="crm-url-form-block-userFrameworkResourceURL">
<td class="label">
{$form.userFrameworkResourceURL.label}
{$form.userFrameworkResourceURL.label} {help id='id-resource_url'}
</td>
<td>
{$form.userFrameworkResourceURL.html|crmAddClass:'huge40'} {help id='id-resource_url'}
{$form.userFrameworkResourceURL.html|crmAddClass:'huge40'}
</td>
</tr>
<tr class="crm-url-form-block-imageUploadURL">
<td class="label">
{$form.imageUploadURL.label}
{$form.imageUploadURL.label} {help id='id-image_url'}
</td>
<td>
{$form.imageUploadURL.html|crmAddClass:'huge40'} {help id='id-image_url'}
{$form.imageUploadURL.html|crmAddClass:'huge40'}
</td>
</tr>
<tr class="crm-url-form-block-customCSSURL">
<td class="label">
{$form.customCSSURL.label}
{$form.customCSSURL.label} {help id='id-css_url'}
</td>
<td>
{$form.customCSSURL.html|crmAddClass:'huge40'} {help id='id-css_url'}
{$form.customCSSURL.html|crmAddClass:'huge40'}
</td>
</tr>
<tr class="crm-url-form-block-disable_core_css">
<td class="label">
{$form.disable_core_css.label} {help id='id-css_url'}
</td>
<td>
{$form.disable_core_css.html}<br />
<p class="description">{ts}{$disable_core_css_description}{/ts}</p>
</td>
</tr>
<tr class="crm-url-form-block-extensionsURL">
<td class="label">
{$form.extensionsURL.label}
{$form.extensionsURL.label} {help id='id-extensions_url'}
</td>
<td>
{$form.extensionsURL.html|crmAddClass:'huge40'} {help id='id-extensions_url'}
{$form.extensionsURL.html|crmAddClass:'huge40'}
</td>
</tr>
<tr class="crm-url-form-block-enableSSL">
<td class="label">
{$form.enableSSL.label}
{$form.enableSSL.label} {help id='id-enable_ssl'}
</td>
<td>
{$form.enableSSL.html} {help id='id-enable_ssl'}
{$form.enableSSL.html}
</td>
</tr>
<tr class="crm-url-form-block-verifySSL">
<td class="label">
{$form.verifySSL.label}
{$form.verifySSL.label} {help id='id-verify_ssl'}
</td>
<td>
{$form.verifySSL.html} {help id='id-verify_ssl'}<br/>
{$form.verifySSL.html}<br/>
<p class="description font-red">{ts}{$verifySSL_description}{/ts}</p>
</td>
</tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment