本文整理汇总了PHP中CRM_Core_SelectValues::contributionTokens方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_SelectValues::contributionTokens方法的具体用法?PHP CRM_Core_SelectValues::contributionTokens怎么用?PHP CRM_Core_SelectValues::contributionTokens使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_SelectValues
的用法示例。
在下文中一共展示了CRM_Core_SelectValues::contributionTokens方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: commonLetterCompose
/**
* Function to build the compose PDF letter form
*
* @param $form
*
* @return None
* @access public
*/
public static function commonLetterCompose(&$form)
{
//get the tokens.
$tokens = CRM_Core_SelectValues::contactTokens();
if (CRM_Utils_System::getClassName($form) == 'CRM_Mailing_Form_Upload') {
$tokens = array_merge(CRM_Core_SelectValues::mailingTokens(), $tokens);
}
//@todo move this fn onto the form
if (CRM_Utils_System::getClassName($form) == 'CRM_Contribute_Form_Task_PDFLetter') {
$tokens = array_merge(CRM_Core_SelectValues::contributionTokens(), $tokens);
}
if (method_exists($form, 'listTokens')) {
$tokens = array_merge($form->listTokens(), $tokens);
}
//sorted in ascending order tokens by ignoring word case
natcasesort($tokens);
$form->assign('tokens', json_encode($tokens));
$form->add('select', 'token1', ts('Insert Tokens'), $tokens, FALSE, array('size' => "5", 'multiple' => TRUE, 'onchange' => "return tokenReplHtml(this);"));
$form->_templates = CRM_Core_BAO_MessageTemplate::getMessageTemplates(FALSE);
if (!empty($form->_templates)) {
$form->assign('templates', TRUE);
$form->add('select', 'template', ts('Select Template'), array('' => ts('- select -')) + $form->_templates, FALSE, array('onChange' => "selectValue( this.value );"));
$form->add('checkbox', 'updateTemplate', ts('Update Template'), NULL);
}
$form->add('checkbox', 'saveTemplate', ts('Save As New Template'), NULL, FALSE, array('onclick' => "showSaveDetails(this);"));
$form->add('text', 'saveTemplateName', ts('Template Title'));
$form->addWysiwyg('html_message', ts('Your Letter'), array('cols' => '80', 'rows' => '8', 'onkeyup' => "return verify(this)"));
$action = CRM_Utils_Request::retrieve('action', 'String', $form, FALSE);
if (CRM_Utils_System::getClassName($form) == 'CRM_Contact_Form_Task_PDF' && $action == CRM_Core_Action::VIEW) {
$form->freeze('html_message');
}
}
示例2: listTokens
/**
* List available tokens for this form.
*
* @return array
*/
public function listTokens()
{
$tokens = CRM_Core_SelectValues::contactTokens();
$tokens = array_merge(CRM_Core_SelectValues::activityTokens(), $tokens);
$tokens = array_merge(CRM_Core_SelectValues::eventTokens(), $tokens);
$tokens = array_merge(CRM_Core_SelectValues::membershipTokens(), $tokens);
$tokens = array_merge(CRM_Core_SelectValues::contributionTokens(), $tokens);
return $tokens;
}
示例3: listTokens
/**
* List available tokens for this form.
*
* @return array
*/
public function listTokens()
{
$tokens = CRM_Core_SelectValues::contactTokens();
$tokens = array_merge(CRM_Core_SelectValues::contributionTokens(), $tokens);
return $tokens;
}