From 546b73aebe709e6c29ee604a04376dab1d33c47c Mon Sep 17 00:00:00 2001 From: KarinG Date: Wed, 30 Apr 2014 08:38:04 -0700 Subject: [PATCH] CRM-14515 - Replace 360px PCP image restriction w/ CSS resizing. --- CRM/PCP/Form/Campaign.php | 6 ------ css/civicrm.css | 4 ++++ templates/CRM/Form/attachment.tpl | 2 +- templates/CRM/PCP/Page/PCPInfo.tpl | 1 + 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CRM/PCP/Form/Campaign.php b/CRM/PCP/Form/Campaign.php index a3058f8e84..8748975e03 100644 --- a/CRM/PCP/Form/Campaign.php +++ b/CRM/PCP/Form/Campaign.php @@ -165,12 +165,6 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form { if (strlen($fields['donate_link_text']) >= 64) { $errors['donate_link_text'] = ts('Button Text must be less than 64 characters.'); } - if (isset($files['attachFile_1']) && !empty($files['attachFile_1']['tmp_name'])) { - list($width, $height) = getimagesize($files['attachFile_1']['tmp_name']); - if ($width > 360 || $height > 360) { - $errors['attachFile_1'] = ts('Your picture or image file cannot be larger than 360 x 360 pixels in size.') . ' ' . ts("The dimensions of the image you have selected are %1 x %2.", array(1 => $width, 2 => $height)) . ' ' . ts('Please shrink or crop the file or find another smaller image and try again.'); - } - } return $errors; } diff --git a/css/civicrm.css b/css/civicrm.css index afc54b0fc3..71b93e97da 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -1454,6 +1454,10 @@ editor specific classes margin: 0 1em 1em 0; } +#crm-container .pcp-image img { + max-width: 360px; +} + #crm-container .ui-draggable { background: url("../i/draggable.png") no-repeat left 1px; float: left; diff --git a/templates/CRM/Form/attachment.tpl b/templates/CRM/Form/attachment.tpl index 97640108f5..5d8c1d7b67 100644 --- a/templates/CRM/Form/attachment.tpl +++ b/templates/CRM/Form/attachment.tpl @@ -59,7 +59,7 @@ {if $form.attachFile_1} {if $context EQ 'pcpCampaign'} -
{ts}You can upload a picture or image to include on your page. Your file should be in .jpg, .gif, or .png format. Recommended image size is 250 x 250 pixels. Maximum size is 360 x 360 pixels.{/ts}
+
{ts}You can upload a picture or image to include on your page. Your file should be in .jpg, .gif, or .png format. Recommended image size is 250 x 250 pixels. Images over 360 pixels wide will be automatically resized to fit.{/ts}
{/if} diff --git a/templates/CRM/PCP/Page/PCPInfo.tpl b/templates/CRM/PCP/Page/PCPInfo.tpl index 386fc61f49..f81bc10c82 100644 --- a/templates/CRM/PCP/Page/PCPInfo.tpl +++ b/templates/CRM/PCP/Page/PCPInfo.tpl @@ -29,6 +29,7 @@

{ts}Personal Campaign Preview{/ts} - {ts}This is a preview of your Personal Campaign Page in support of{/ts} {$pageName}.

{ts}The current status of your page is{/ts}: {$owner.status}. + {ts}The URL for this page is: {$contributeURL}{/ts} {if $pcp.status_id NEQ 2}
{ts}You will receive an email notification when your page is Approved and you can begin promoting your campaign.{/ts}{/if} {if $pcp.page_type EQ 'event'} {if $owner.registration_start_date}
{ts}People can register for this event starting on {/ts} {$owner.registration_start_date|truncate:10:''|crmDate}{if $owner.registration_end_date} {ts}until{/ts} {$owner.registration_end_date|truncate:10:''|crmDate}{/if}.{/if} -- 2.25.1
{$form.attachFile_1.label}