当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Core_SelectValues::eventTokens方法代码示例

本文整理汇总了PHP中CRM_Core_SelectValues::eventTokens方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_SelectValues::eventTokens方法的具体用法?PHP CRM_Core_SelectValues::eventTokens怎么用?PHP CRM_Core_SelectValues::eventTokens使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Core_SelectValues的用法示例。


在下文中一共展示了CRM_Core_SelectValues::eventTokens方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: commonCompose

 /**
  * Function to build the  compose mail form
  *
  * @param   $form
  *
  * @return None
  * @access public
  */
 public static function commonCompose(&$form)
 {
     //get the tokens.
     $tokens = CRM_Core_SelectValues::contactTokens();
     //token selector for subject
     //CRM-5058
     $form->add('select', 'token3', ts('Insert Token'), $tokens, FALSE, array('size' => "5", 'multiple' => TRUE, 'onclick' => "return tokenReplText(this);"));
     $className = CRM_Utils_System::getClassName($form);
     if ($className == 'CRM_Mailing_Form_Upload') {
         $tokens = array_merge(CRM_Core_SelectValues::mailingTokens(), $tokens);
     } elseif ($className == 'CRM_Admin_Form_ScheduleReminders') {
         $tokens = array_merge(CRM_Core_SelectValues::activityTokens(), $tokens);
         $tokens = array_merge(CRM_Core_SelectValues::eventTokens(), $tokens);
         $tokens = array_merge(CRM_Core_SelectValues::membershipTokens(), $tokens);
     } elseif ($className == 'CRM_Event_Form_ManageEvent_ScheduleReminders') {
         $tokens = array_merge(CRM_Core_SelectValues::eventTokens(), $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, 'onclick' => "return tokenReplText(this);"));
     $form->add('select', 'token2', ts('Insert Tokens'), $tokens, FALSE, array('size' => "5", 'multiple' => TRUE, 'onclick' => "return tokenReplHtml(this);"));
     $form->_templates = CRM_Core_BAO_MessageTemplate::getMessageTemplates(FALSE);
     if (!empty($form->_templates)) {
         $form->assign('templates', TRUE);
         $form->add('select', 'template', ts('Use 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'));
     //insert message Text by selecting "Select Template option"
     $form->add('textarea', 'text_message', ts('Plain-text format'), array('cols' => '80', 'rows' => '8', 'onkeyup' => "return verify(this)"));
     if ($className != 'CRM_SMS_Form_Upload' && $className != 'CRM_Contact_Form_Task_SMS' && $className != 'CRM_Contact_Form_Task_SMS') {
         $form->addWysiwyg('html_message', ts('HTML format'), array('cols' => '80', 'rows' => '8', 'onkeyup' => "return verify(this)"));
     }
 }
开发者ID:TheCraftyCanvas,项目名称:aegir-platforms,代码行数:44,代码来源:Mailing.php

示例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;
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:14,代码来源:ScheduleReminders.php

示例3: commonCompose

 /**
  * Build the  compose mail form.
  *
  * @param CRM_Core_Form $form
  *
  * @return void
  */
 public static function commonCompose(&$form)
 {
     //get the tokens.
     $tokens = CRM_Core_SelectValues::contactTokens();
     $className = CRM_Utils_System::getClassName($form);
     if ($className == 'CRM_Mailing_Form_Upload') {
         $tokens = array_merge(CRM_Core_SelectValues::mailingTokens(), $tokens);
     } elseif ($className == 'CRM_Admin_Form_ScheduleReminders') {
         $tokens = array_merge(CRM_Core_SelectValues::activityTokens(), $tokens);
         $tokens = array_merge(CRM_Core_SelectValues::eventTokens(), $tokens);
         $tokens = array_merge(CRM_Core_SelectValues::membershipTokens(), $tokens);
     } elseif ($className == 'CRM_Event_Form_ManageEvent_ScheduleReminders') {
         $tokens = array_merge(CRM_Core_SelectValues::eventTokens(), $tokens);
     }
     //sorted in ascending order tokens by ignoring word case
     $form->assign('tokens', CRM_Utils_Token::formatTokensForDisplay($tokens));
     $templates = array();
     $textFields = array('text_message' => ts('HTML Format'), 'sms_text_message' => ts('SMS Message'));
     $modePrefixes = array('Mail' => NULL, 'SMS' => 'SMS');
     if ($className != 'CRM_SMS_Form_Upload' && $className != 'CRM_Contact_Form_Task_SMS' && $className != 'CRM_Contact_Form_Task_SMS') {
         $form->addWysiwyg('html_message', ts('HTML Format'), array('cols' => '80', 'rows' => '8', 'onkeyup' => "return verify(this)"));
         if ($className != 'CRM_Admin_Form_ScheduleReminders') {
             unset($modePrefixes['SMS']);
         }
     } else {
         unset($textFields['text_message']);
         unset($modePrefixes['Mail']);
     }
     //insert message Text by selecting "Select Template option"
     foreach ($textFields as $id => $label) {
         $prefix = NULL;
         if ($id == 'sms_text_message') {
             $prefix = "SMS";
             $form->assign('max_sms_length', CRM_SMS_Provider::MAX_SMS_CHAR);
         }
         $form->add('textarea', $id, $label, array('cols' => '80', 'rows' => '8', 'onkeyup' => "return verify(this, '{$prefix}')"));
     }
     foreach ($modePrefixes as $prefix) {
         if ($prefix == 'SMS') {
             $templates[$prefix] = CRM_Core_BAO_MessageTemplate::getMessageTemplates(FALSE, TRUE);
         } else {
             $templates[$prefix] = CRM_Core_BAO_MessageTemplate::getMessageTemplates(FALSE);
         }
         if (!empty($templates[$prefix])) {
             $form->assign('templates', TRUE);
             $form->add('select', "{$prefix}template", ts('Use Template'), array('' => ts('- select -')) + $templates[$prefix], FALSE, array('onChange' => "selectValue( this.value, '{$prefix}');"));
         }
         $form->add('checkbox', "{$prefix}updateTemplate", ts('Update Template'), NULL);
         $form->add('checkbox', "{$prefix}saveTemplate", ts('Save As New Template'), NULL, FALSE, array('onclick' => "showSaveDetails(this, '{$prefix}');"));
         $form->add('text', "{$prefix}saveTemplateName", ts('Template Title'));
     }
 }
开发者ID:JSProffitt,项目名称:civicrm-website-org,代码行数:59,代码来源:Mailing.php


注:本文中的CRM_Core_SelectValues::eventTokens方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。