Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(accessibility/misc-core-fixes/issues/3) Remove CMS specific print header templates that share same code #11944

Merged
merged 1 commit into from
May 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions templates/CRM/common/CMSPrint.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{*
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| 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->debug}
{include file="CRM/common/debug.tpl"}
{/if}

<div id="crm-container" class="crm-container{if $urlIsPublic} crm-public{/if}" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">

{crmNavigationMenu is_default=1}

{if $breadcrumb}
<div class="breadcrumb">
{foreach from=$breadcrumb item=crumb key=key}
{if $key != 0}
&raquo;
{/if}
{$crumb}
{/foreach}
</div>
{/if}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton thanks for notifying it, restored the breadcrumb block and ensure that this variable is exclusively available for wordpress as per

$ grep -irn "('breadcrumb'" CRM
CRM/Utils/System/Joomla.php:187:    $bc = $template->get_template_vars('breadcrumb');
CRM/Utils/System/Joomla.php:205:    $template->assign_by_ref('breadcrumb', $bc);
CRM/Utils/System/WordPress.php:147:    $template->assign_by_ref('breadcrumb', $breadCrumb);


{if isset($browserPrint) and $browserPrint}
{* Javascript window.print link. Used for public pages where we can't do printer-friendly view. *}
<div id="printer-friendly">
<a href="#" onclick="window.print(); return false;" title="{ts}Print this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{else}
{* Printer friendly link/icon. *}
<div id="printer-friendly">
<a href="{$printerFriendly}" target='_blank' title="{ts}Printer-friendly view of this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{/if}

{if $pageTitle}
<div class="crm-title">
<h1 class="title">{if $isDeleted}<del>{/if}{$pageTitle}{if $isDeleted}</del>{/if}</h1>
</div>
{/if}

{crmRegion name='page-header'}
{/crmRegion}
<div class="clear"></div>

{if isset($localTasks) and $localTasks}
{include file="CRM/common/localNav.tpl"}
{/if}
<div id="crm-main-content-wrapper">
{include file="CRM/common/status.tpl"}
{crmRegion name='page-body'}
{if isset($isForm) and $isForm and isset($formTpl)}
{include file="CRM/Form/$formTpl.tpl"}
{else}
{include file=$tplFile}
{/if}
{/crmRegion}
</div>

{crmRegion name='page-footer'}
{if $urlIsPublic}
{include file="CRM/common/publicFooter.tpl"}
{else}
{include file="CRM/common/footer.tpl"}
{/if}
{/crmRegion}

</div> {* end crm-container div *}
54 changes: 1 addition & 53 deletions templates/CRM/common/backdrop.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,56 +23,4 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if $config->debug}
{include file="CRM/common/debug.tpl"}
{/if}

<div id="crm-container" class="crm-container{if $urlIsPublic} crm-public{/if}" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">


{crmNavigationMenu is_default=1}

{if isset($browserPrint) and $browserPrint}
{* Javascript window.print link. Used for public pages where we can't do printer-friendly view. *}
<div id="printer-friendly">
<a href="#" onclick="window.print(); return false;" title="{ts}Print this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{else}
{* Printer friendly link/icon. *}
<div id="printer-friendly">
<a href="{$printerFriendly}" target='_blank' title="{ts}Printer-friendly view of this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{/if}

{crmRegion name='page-header'}
{/crmRegion}
<div class="clear"></div>

{if isset($localTasks) and $localTasks}
{include file="CRM/common/localNav.tpl"}
{/if}
<div id="crm-main-content-wrapper">
{include file="CRM/common/status.tpl"}
{crmRegion name='page-body'}
{if isset($isForm) and $isForm and isset($formTpl)}
{include file="CRM/Form/$formTpl.tpl"}
{else}
{include file=$tplFile}
{/if}
{/crmRegion}
</div>

{crmRegion name='page-footer'}
{if $urlIsPublic}
{include file="CRM/common/publicFooter.tpl"}
{else}
{include file="CRM/common/footer.tpl"}
{/if}
{/crmRegion}


</div> {* end crm-container div *}
{include file="CRM/common/CMSPrint.tpl"}
54 changes: 1 addition & 53 deletions templates/CRM/common/drupal.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,56 +23,4 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if $config->debug}
{include file="CRM/common/debug.tpl"}
{/if}

<div id="crm-container" class="crm-container{if $urlIsPublic} crm-public{/if}" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">


{crmNavigationMenu is_default=1}

{if isset($browserPrint) and $browserPrint}
{* Javascript window.print link. Used for public pages where we can't do printer-friendly view. *}
<div id="printer-friendly">
<a href="#" onclick="window.print(); return false;" title="{ts}Print this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{else}
{* Printer friendly link/icon. *}
<div id="printer-friendly">
<a href="{$printerFriendly}" target='_blank' title="{ts}Printer-friendly view of this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{/if}

{crmRegion name='page-header'}
{/crmRegion}
<div class="clear"></div>

{if isset($localTasks) and $localTasks}
{include file="CRM/common/localNav.tpl"}
{/if}
<div id="crm-main-content-wrapper">
{include file="CRM/common/status.tpl"}
{crmRegion name='page-body'}
{if isset($isForm) and $isForm and isset($formTpl)}
{include file="CRM/Form/$formTpl.tpl"}
{else}
{include file=$tplFile}
{/if}
{/crmRegion}
</div>

{crmRegion name='page-footer'}
{if $urlIsPublic}
{include file="CRM/common/publicFooter.tpl"}
{else}
{include file="CRM/common/footer.tpl"}
{/if}
{/crmRegion}


</div> {* end crm-container div *}
{include file="CRM/common/CMSPrint.tpl"}
55 changes: 1 addition & 54 deletions templates/CRM/common/drupal6.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,57 +23,4 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if $config->debug}
{include file="CRM/common/debug.tpl"}
{/if}

<div id="crm-container" class="crm-container{if $urlIsPublic} crm-public{/if}" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">

{crmNavigationMenu is_default=1}

{if isset($browserPrint) and $browserPrint}
{* Javascript window.print link. Used for public pages where we can't do printer-friendly view. *}
<div id="printer-friendly">
<a href="#" onclick="window.print(); return false;" title="{ts}Print this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{else}
{* Printer friendly link/icon. *}
<div id="printer-friendly">
<a href="{$printerFriendly}" target='_blank' title="{ts}Printer-friendly view of this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{/if}

{*{include file="CRM/common/langSwitch.tpl"}*}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this line is removed from the final tpl - but as it is commented out that seems fine


{crmRegion name='page-header'}
{/crmRegion}
<div class="clear"></div>

{if isset($localTasks) and $localTasks}
{include file="CRM/common/localNav.tpl"}
{/if}

<div id="crm-main-content-wrapper">
{include file="CRM/common/status.tpl"}
{crmRegion name='page-body'}
{if isset($isForm) and $isForm and isset($formTpl)}
{include file="CRM/Form/$formTpl.tpl"}
{else}
{include file=$tplFile}
{/if}
{/crmRegion}
</div>

{crmRegion name='page-footer'}
{if $urlIsPublic}
{include file="CRM/common/publicFooter.tpl"}
{else}
{include file="CRM/common/footer.tpl"}
{/if}
{/crmRegion}

</div> {* end crm-container div *}
{include file="CRM/common/CMSPrint.tpl"}
54 changes: 1 addition & 53 deletions templates/CRM/common/drupal8.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,56 +23,4 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if $config->debug}
{include file="CRM/common/debug.tpl"}
{/if}

<div id="crm-container" class="crm-container{if $urlIsPublic} crm-public{/if}" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">


{crmNavigationMenu is_default=1}

{if isset($browserPrint) and $browserPrint}
{* Javascript window.print link. Used for public pages where we can't do printer-friendly view. *}
<div id="printer-friendly">
<a href="#" onclick="window.print(); return false;" title="{ts}Print this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{else}
{* Printer friendly link/icon. *}
<div id="printer-friendly">
<a href="{$printerFriendly}" target='_blank' title="{ts}Printer-friendly view of this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{/if}

{crmRegion name='page-header'}
{/crmRegion}
<div class="clear"></div>

{if isset($localTasks) and $localTasks}
{include file="CRM/common/localNav.tpl"}
{/if}
<div id="crm-main-content-wrapper">
{include file="CRM/common/status.tpl"}
{crmRegion name='page-body'}
{if isset($isForm) and $isForm and isset($formTpl)}
{include file="CRM/Form/$formTpl.tpl"}
{else}
{include file=$tplFile}
{/if}
{/crmRegion}
</div>

{crmRegion name='page-footer'}
{if $urlIsPublic}
{include file="CRM/common/publicFooter.tpl"}
{else}
{include file="CRM/common/footer.tpl"}
{/if}
{/crmRegion}


</div> {* end crm-container div *}
{include file="CRM/common/CMSPrint.tpl"}
54 changes: 1 addition & 53 deletions templates/CRM/common/unittests.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,56 +23,4 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if $config->debug}
{include file="CRM/common/debug.tpl"}
{/if}

<div id="crm-container" class="crm-container{if $urlIsPublic} crm-public{/if}" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">


{crmNavigationMenu is_default=1}

{if isset($browserPrint) and $browserPrint}
{* Javascript window.print link. Used for public pages where we can't do printer-friendly view. *}
<div id="printer-friendly">
<a href="#" onclick="window.print(); return false;" title="{ts}Print this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{else}
{* Printer friendly link/icon. *}
<div id="printer-friendly">
<a href="{$printerFriendly}" target='_blank' title="{ts}Printer-friendly view of this page.{/ts}">
<i class="crm-i fa-print"></i>
</a>
</div>
{/if}

{crmRegion name='page-header'}
{/crmRegion}
<div class="clear"></div>

{if isset($localTasks) and $localTasks}
{include file="CRM/common/localNav.tpl"}
{/if}
<div id="crm-main-content-wrapper">
{include file="CRM/common/status.tpl"}
{crmRegion name='page-body'}
{if isset($isForm) and $isForm and isset($formTpl)}
{include file="CRM/Form/$formTpl.tpl"}
{else}
{include file=$tplFile}
{/if}
{/crmRegion}
</div>

{crmRegion name='page-footer'}
{if $urlIsPublic}
{include file="CRM/common/publicFooter.tpl"}
{else}
{include file="CRM/common/footer.tpl"}
{/if}
{/crmRegion}


</div> {* end crm-container div *}
{include file="CRM/common/CMSPrint.tpl"}
Loading