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


PHP WFModelEditor::getEditorFonts方法代码示例

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


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

示例1: getConfig

 public static function getConfig(&$settings)
 {
     $wf = WFEditor::getInstance();
     $model = new WFModelEditor();
     $doctypes = array('XHTML 1.0 Transitional' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', 'XHTML 1.0 Frameset' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">', 'XHTML 1.0 Strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', 'XHTML 1.1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', 'HTML 4.01 Transitional' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', 'HTML 4.01 Strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">', 'HTML 4.01 Frameset' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">', 'HTML 5' => '<!DOCTYPE HTML>');
     $doctype = $wf->getParam('fullpage.default_doctype', 'HTML 4.01 Transitional', 'HTML 4.01 Transitional');
     $settings['fullpage_fonts'] = $model->getEditorFonts();
     $settings['fullpage_fontsizes'] = $wf->getParam('editor.theme_advanced_font_sizes', '8pt,10pt,12pt,14pt,18pt,24pt,36pt');
     $settings['fullpage_default_doctype'] = isset($doctypes[$doctype]) ? addslashes($doctypes[$doctype]) : '';
     $settings['fullpage_hide_in_source_view'] = $wf->getParam('fullpage.hide_in_source_view', 0, 0);
     $settings['fullpage_default_encoding'] = $wf->getParam('fullpage.default_encoding');
     $settings['fullpage_default_xml_pi'] = $wf->getParam('fullpage.default_xml_pi', 0, 0);
     $settings['fullpage_default_font_family'] = $wf->getParam('fullpage.default_font_family');
     $settings['fullpage_default_title'] = $wf->getParam('fullpage.default_title', 'Untitled Document', 'Untitled Document');
     $settings['fullpage_default_font_size'] = $wf->getParam('fullpage.default_font_size');
     $settings['fullpage_default_text_color'] = $wf->getParam('fullpage.default_text_color');
     $model->removeKeys($settings['invalid_elements'], array('html', 'head', 'meta', 'title', 'body', 'link'));
 }
开发者ID:adjaika,项目名称:J3Base,代码行数:18,代码来源:config.php

示例2: getConfig

 public static function getConfig(&$settings)
 {
     wfimport('admin.models.editor');
     $model = new WFModelEditor();
     $wf = WFEditor::getInstance();
     // Add format plugin to plugins list
     if (!in_array('format', $settings['plugins'])) {
         $settings['plugins'][] = 'format';
     }
     $settings['inline_styles'] = $wf->getParam('editor.inline_styles', 1, 1);
     // Paragraph handling
     $settings['forced_root_block'] = $wf->getParam('editor.forced_root_block', 'p');
     // set as boolean if disabled
     if (is_numeric($settings['forced_root_block'])) {
         $settings['forced_root_block'] = (bool) $settings['forced_root_block'];
         if ($wf->getParam('editor.force_br_newlines', 0, 0, 'boolean') === false) {
             // legacy
             $settings['force_p_newlines'] = $wf->getParam('editor.force_p_newlines', 1, 0, 'boolean');
         }
     }
     if (strpos($settings['forced_root_block'], '|') !== false) {
         // multiple values
         $values = explode('|', $settings['forced_root_block']);
         foreach ($values as $value) {
             $kv = explode(':', $value);
             if (count($kv) == 2) {
                 $settings[$kv[0]] = (bool) $kv[1];
             } else {
                 $settings['forced_root_block'] = (bool) $kv[0];
             }
         }
     }
     $settings['removeformat_selector'] = $wf->getParam('editor.removeformat_selector', 'span,b,strong,em,i,font,u,strike', 'span,b,strong,em,i,font,u,strike');
     $formats = array('p' => 'advanced.paragraph', 'address' => 'advanced.address', 'pre' => 'advanced.pre', 'h1' => 'advanced.h1', 'h2' => 'advanced.h2', 'h3' => 'advanced.h3', 'h4' => 'advanced.h4', 'h5' => 'advanced.h5', 'h6' => 'advanced.h6', 'div' => 'advanced.div', 'blockquote' => 'advanced.blockquote', 'code' => 'advanced.code', 'samp' => 'advanced.samp', 'span' => 'advanced.span', 'section' => 'advanced.section', 'article' => 'advanced.article', 'hgroup' => 'advanced.hgroup', 'aside' => 'advanced.aside', 'figure' => 'advanced.figure', 'dt' => 'advanced.dt', 'dd' => 'advanced.dd', 'div_container' => 'advanced.div_container');
     $html5 = array('section', 'article', 'hgroup', 'aside', 'figure');
     $schema = $wf->getParam('editor.schema', 'html4');
     $verify = (bool) $wf->getParam('editor.verify_html', 0);
     $tmpblocks = $wf->getParam('editor.theme_advanced_blockformats', 'p,div,address,pre,h1,h2,h3,h4,h5,h6,code,samp,span,section,article,hgroup,aside,figure,dt,dd', 'p,address,pre,h1,h2,h3,h4,h5,h6');
     $list = array();
     $blocks = array();
     // make an array
     if (is_string($tmpblocks)) {
         $tmpblocks = explode(',', $tmpblocks);
     }
     foreach ($tmpblocks as $v) {
         $key = $formats[$v];
         // skip html5 blocks for html4 schema
         if ($verify && $schema == 'html4' && in_array($v, $html5)) {
             continue;
         }
         if ($key) {
             $list[$key] = $v;
         }
         $blocks[] = $v;
         if ($v == 'div') {
             $list['advanced.div_container'] = 'div_container';
         }
     }
     $selector = $settings['removeformat_selector'] == '' ? 'span,b,strong,em,i,font,u,strike' : $settings['removeformat_selector'];
     $selector = explode(',', $selector);
     // set the root block
     $rootblock = !$settings['forced_root_block'] ? 'p' : $settings['forced_root_block'];
     if ($k = array_search($rootblock, $blocks) !== false) {
         unset($blocks[$k]);
     }
     // remove format selector
     $settings['removeformat_selector'] = implode(',', array_unique(array_merge($blocks, $selector)));
     // Format list / Remove Format
     $settings['theme_advanced_blockformats'] = json_encode($list);
     // Relative urls
     $settings['relative_urls'] = $wf->getParam('editor.relative_urls', 1, 1, 'boolean');
     if ($settings['relative_urls'] == 0) {
         $settings['remove_script_host'] = false;
     }
     // Fonts
     $settings['theme_advanced_fonts'] = $model->getEditorFonts($wf->getParam('editor.theme_advanced_fonts_add', ''), $wf->getParam('editor.theme_advanced_fonts_remove', ''));
     $settings['theme_advanced_font_sizes'] = $wf->getParam('editor.theme_advanced_font_sizes', '8pt,10pt,12pt,14pt,18pt,24pt,36pt');
     //$settings['theme_advanced_default_foreground_color'] = $wf->getParam('editor.theme_advanced_default_foreground_color', '#000000');
     //$settings['theme_advanced_default_background_color'] = $wf->getParam('editor.theme_advanced_default_background_color', '#FFFF00');
     // colour picker custom colours
     $settings['custom_colors'] = $wf->getParam('editor.custom_colors', '', '');
     // Styles list
     $styles = $wf->getParam('editor.theme_advanced_styles', '');
     if ($styles) {
         $settings['theme_advanced_styles'] = implode(';', explode(',', $styles));
     }
 }
开发者ID:acculitx,项目名称:fleetmatrixsite,代码行数:87,代码来源:config.php


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