本文整理汇总了PHP中CRM_Core_PseudoConstant::wysiwygEditor方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_PseudoConstant::wysiwygEditor方法的具体用法?PHP CRM_Core_PseudoConstant::wysiwygEditor怎么用?PHP CRM_Core_PseudoConstant::wysiwygEditor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_PseudoConstant
的用法示例。
在下文中一共展示了CRM_Core_PseudoConstant::wysiwygEditor方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Function to build the form
*
* @return None
* @access public
*/
public function buildQuickForm()
{
$drupal_wysiwyg = FALSE;
$wysiwyg_options = array('' => ts('Textarea')) + CRM_Core_PseudoConstant::wysiwygEditor();
$config = CRM_Core_Config::singleton();
$extra = array();
//if not using Joomla, remove Joomla default editor option
if ($config->userFramework != 'Joomla') {
unset($wysiwyg_options[3]);
}
$drupal_wysiwyg = FALSE;
if (!$config->userSystem->is_drupal || !module_exists("wysiwyg")) {
unset($wysiwyg_options[4]);
} else {
$extra['onchange'] = 'if (this.value==4) { cj("#crm-preferences-display-form-block-wysiwyg_input_format").show(); } else { cj("#crm-preferences-display-form-block-wysiwyg_input_format").hide() }';
$formats = filter_formats();
$format_options = array();
foreach ($formats as $id => $format) {
$format_options[$id] = $format->name;
}
$drupal_wysiwyg = TRUE;
}
$this->addElement('select', 'editor_id', ts('WYSIWYG Editor'), $wysiwyg_options, $extra);
if ($drupal_wysiwyg) {
$this->addElement('select', 'wysiwyg_input_format', ts('Input Format'), $format_options, NULL);
}
$editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0');
$this->assign('editOptions', $editOptions);
$contactBlocks = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 1');
$this->assign('contactBlocks', $contactBlocks);
$this->addElement('hidden', 'contact_edit_preferences', NULL, array('id' => 'contact_edit_preferences'));
parent::buildQuickForm();
}
示例2: buildQuickForm
/**
* Function to build the form
*
* @return None
* @access public
*/
public function buildQuickForm()
{
$wysiwyg_options = array('' => ts('Textarea')) + CRM_Core_PseudoConstant::wysiwygEditor();
$config =& CRM_Core_Config::singleton();
//if not using Joomla, remove Joomla default editor option
if ($config->userFramework != 'Joomla') {
unset($wysiwyg_options[3]);
}
$this->addElement('select', 'wysiwyg_editor', ts('WYSIWYG Editor'), $wysiwyg_options, null);
$this->addElement('textarea', 'display_name_format', ts('Individual Display Name Format'));
$this->addElement('textarea', 'sort_name_format', ts('Individual Sort Name Format'));
require_once 'CRM/Core/OptionGroup.php';
$editOptions = CRM_Core_OptionGroup::values('contact_edit_options', false, false, false, 'AND v.filter = 0');
$this->assign('editOptions', $editOptions);
$contactBlocks = CRM_Core_OptionGroup::values('contact_edit_options', false, false, false, 'AND v.filter = 1');
$this->assign('contactBlocks', $contactBlocks);
$this->addElement('hidden', 'contact_edit_prefences', null, array('id' => 'contact_edit_prefences'));
parent::buildQuickForm();
}
示例3:
/**
* Get all WYSIWYG Editors.
*
* The static array wysiwygEditor is returned
*
* @access public
* @static
* @return array - array reference of all wysiwygEditors
*/
public static function &wysiwygEditor()
{
if (!self::$wysiwygEditor) {
require_once 'CRM/Core/OptionGroup.php';
self::$wysiwygEditor = CRM_Core_OptionGroup::values('wysiwyg_editor');
}
return self::$wysiwygEditor;
}
示例4: addWysiwyg
function addWysiwyg($name, $label, $attributes, $forceTextarea = false)
{
// 1. Get configuration option for editor (tinymce, ckeditor, pure textarea)
// 2. Based on the option, initialise proper editor
require_once 'CRM/Core/BAO/Preferences.php';
$editor = strtolower(CRM_Utils_Array::value(CRM_Core_BAO_Preferences::value('editor_id'), CRM_Core_PseudoConstant::wysiwygEditor()));
if (!$editor || $forceTextarea) {
$editor = 'textarea';
}
if ($editor == 'joomla default editor') {
$editor = 'joomlaeditor';
}
$this->addElement($editor, $name, $label, $attributes);
$this->assign('editor', $editor);
}
示例5:
/**
* Get all WYSIWYG Editors.
*
* The static array wysiwygEditor is returned
*
* @access public
* @static
*
* @return array - array reference of all wysiwygEditors
*/
public static function &wysiwygEditor()
{
if (!self::$wysiwygEditor) {
self::$wysiwygEditor = CRM_Core_OptionGroup::values('wysiwyg_editor');
}
return self::$wysiwygEditor;
}
示例6: buildQuickForm
/**
* Function to build the form
*
* @return None
* @access public
*/
public function buildQuickForm()
{
$this->addElement('select', 'wysiwyg_editor', ts('WYSIWYG Editor'), array('' => ts('Textarea')) + CRM_Core_PseudoConstant::wysiwygEditor(), null);
parent::buildQuickForm();
}
示例7: addWysiwyg
function addWysiwyg($name, $label, $attributes, $forceTextarea = FALSE)
{
// 1. Get configuration option for editor (tinymce, ckeditor, pure textarea)
// 2. Based on the option, initialise proper editor
$editorID = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'editor_id');
$editor = strtolower(CRM_Utils_Array::value($editorID, CRM_Core_PseudoConstant::wysiwygEditor()));
if (!$editor || $forceTextarea) {
$editor = 'textarea';
}
if ($editor == 'joomla default editor') {
$editor = 'joomlaeditor';
}
if ($editor == 'drupal default editor') {
$editor = 'drupalwysiwyg';
}
//lets add the editor as a attribute
$attributes['editor'] = $editor;
$this->addElement($editor, $name, $label, $attributes);
$this->assign('editor', $editor);
// include wysiwyg editor js files
$includeWysiwygEditor = FALSE;
$includeWysiwygEditor = $this->get('includeWysiwygEditor');
if (!$includeWysiwygEditor) {
$includeWysiwygEditor = TRUE;
$this->set('includeWysiwygEditor', $includeWysiwygEditor);
}
$this->assign('includeWysiwygEditor', $includeWysiwygEditor);
}