Skip to content
Snippets Groups Projects
Commit 46312a4d authored by totten's avatar totten
Browse files

CRM-12865 - Define regions and CSS classes for profile forms

With this revision, the following can be used:

 * civicrm/profile
   * CSS: form#Search .crm-profile-name-{NAME}
   * Region: profile-search-{NAME}
 * civicrm/profile/create:
   * CSS: form#Edit .crm-profile-name-{NAME}
   * Region: profile-form-{NAME}
 * civicrm/profile/edit:
   * CSS: form#Edit .crm-profile-name-{NAME}
   * Region: profile-form-{NAME}
 * civicrm/profile/view:
   * CSS: .crm-profile-view .crm-profile-name-{NAME}
   * Region: profile-view-{NAME}
 * civicrm/event/register:
   * CSS: .crm-event-register-form-block .crm-profile-name-{NAME}
 * civicrm/contribute/transact:
   * CSS: .crm-contribution-main-form-block .crm-profile-name-{NAME}

----------------------------------------
* CRM-12865: Define hook/CSS/region names for profile forms
  http://issues.civicrm.org/jira/browse/CRM-12865
parent 38eb6956
Branches
Tags
No related merge requests found
......@@ -256,13 +256,17 @@ class CRM_Profile_Form extends CRM_Core_Form {
}
$this->_isContactActivityProfile = CRM_Core_BAO_UFField::checkContactActivityProfileType($this->_gid);
//get values for captch and dupe update.
//get values for ufGroupName, captch and dupe update.
$this->assign('ufGroupName', 'unknown'); // override later (if possible)
if ($this->_gid) {
$dao = new CRM_Core_DAO_UFGroup();
$dao->id = $this->_gid;
if ($dao->find(TRUE)) {
$this->_isUpdateDupe = $dao->is_update_dupe;
$this->_isAddCaptcha = $dao->add_captcha;
if (!empty($dao->name)) {
$this->assign('ufGroupName', $dao->name);
}
}
$dao->free();
}
......
......@@ -333,6 +333,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page {
}
$name = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $this->_gid, 'name');
$this->assign('ufGroupName', $name);
if (strtolower($name) == 'summary_overlay') {
$template->assign('overlayProfile', TRUE);
......
......@@ -283,6 +283,7 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page {
$this->preProcess();
$this->assign('recentlyViewed', FALSE);
$this->assign('ufGroupName', 'unknown'); // override later (if possible)
if ($this->_gid) {
$ufgroupDAO = new CRM_Core_DAO_UFGroup();
......@@ -297,6 +298,9 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page {
if ($ufgroupDAO->title) {
CRM_Utils_System::setTitle($ufgroupDAO->title);
}
if ($ufgroupDAO->name) {
$this->assign('ufGroupName', $ufgroupDAO->name);
}
}
$this->assign('isReset', TRUE);
......
......@@ -23,6 +23,9 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
<div class="crm-profile-name-{$ufGroupName}">
{crmRegion name=profile-form-`$ufGroupName`}
{* Profile forms when embedded in CMS account create (mode=1) or
cms account edit (mode=8) or civicrm/profile (mode=4) pages *}
{if ($context eq 'multiProfileDialog')}
......@@ -374,3 +377,5 @@ cj(document).ready(function(){
</script>
{/literal}
{/crmRegion}
</div> {* end crm-profile-NAME *}
......@@ -29,6 +29,8 @@
{include file="CRM/Profile/Page/Overlay.tpl"}
{else}
<div id="crm-container" class="crm-container" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">
<div class="crm-profile-name-{$ufGroupName}">
{crmRegion name=profile-view-`$ufGroupName`}
{foreach from=$profileFields item=field key=rowName}
<div id="row-{$rowName}" class="crm-section {$rowName}-section">
<div class="label">
......@@ -40,6 +42,8 @@
<div class="clear"></div>
</div>
{/foreach}
{/crmRegion}
</div>
</div>
{/if}
{/if}
......
......@@ -23,6 +23,10 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
<div class="crm-profile-name-{$ufGroupName}">
{crmRegion name=profile-search-`$ufGroupName`}
{* make sure there are some fields in the selector *}
{if ! empty( $columnHeaders ) || $isReset }
......@@ -89,4 +93,7 @@
{ts}No fields in this Profile have been configured to display as a result column in the search results table. Ask the site administrator to check the Profile setup.{/ts}
</div>
{/if}
</div>
\ No newline at end of file
</div>
{/crmRegion}
</div>{* crm-profile-name-NAME *}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment