本文整理汇总了PHP中CRM_Utils_System::accessCiviContribute方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_System::accessCiviContribute方法的具体用法?PHP CRM_Utils_System::accessCiviContribute怎么用?PHP CRM_Utils_System::accessCiviContribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_System
的用法示例。
在下文中一共展示了CRM_Utils_System::accessCiviContribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setShowHide
/**
* Fix what blocks to show/hide based on the default values set
*
* @param array array of Group Titles
* @param array array of Group Collapse Display
*
* @return
*
* @access protected
*/
function setShowHide(&$groupTitle)
{
if (empty($groupTitle)) {
return;
}
$showHide =& new CRM_Core_ShowHideBlocks('', '');
foreach ($groupTitle as $key => $title) {
$showBlocks = $title . '[show]';
$hideBlocks = $title;
$showHide->addHide($hideBlocks);
$showHide->addShow($showBlocks);
}
if (CRM_Utils_System::accessCiviContribute()) {
$showHide->addHide('contributeForm');
$showHide->addShow('contributeForm[show]');
}
$showHide->addToTemplate();
}
示例2: setShowHide
/**
* Show hide blocks based on default values.
*
* @param array (reference) $defaults
* @return void
* @access public
*/
function setShowHide(&$defaults)
{
require_once 'CRM/Core/ShowHideBlocks.php';
$showHide =& new CRM_Core_ShowHideBlocks(array('commPrefs' => 1, 'notes[show]' => 1, 'relationships[show]' => 1, 'groups[show]' => 1, 'openActivities[show]' => 1, 'activityHx[show]' => 1), array('notes' => 1, 'commPrefs[show]' => 1, 'relationships' => 1, 'groups' => 1, 'openActivities' => 1, 'activityHx' => 1));
$config =& CRM_Core_Config::singleton();
if (CRM_Utils_System::accessCiviContribute()) {
$showHide->addShow('contributions[show]');
$showHide->addHide('contributions');
}
if ($defaults['contact_type'] == 'Individual') {
// is there any demographics data?
if (CRM_Utils_Array::value('gender_id', $defaults) || CRM_Utils_Array::value('is_deceased', $defaults) || CRM_Utils_Array::value('birth_date', $defaults)) {
$showHide->addShow('demographics');
$showHide->addHide('demographics[show]');
} else {
$showHide->addShow('demographics[show]');
$showHide->addHide('demographics');
}
}
if (array_key_exists('location', $defaults)) {
$numLocations = count($defaults['location']);
if ($numLocations > 0) {
$showHide->addShow('location[1]');
$showHide->addHide('location[1][show]');
}
for ($i = 1; $i < $numLocations; $i++) {
$locationIndex = $i + 1;
$showHide->addShow("location[{$locationIndex}][show]");
$showHide->addHide("location[{$locationIndex}]");
}
}
$showHide->addToTemplate();
}