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


PHP WFModelEditor::getEditorSettings方法代码示例

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


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

示例1: elseif

 /**
  * Text area with WYSIWYG
  * 
  * @param type $element
  * 
  * @return type
  */
 static function tiny_mce($element)
 {
     // Load js and style sheet for frontend
     $base = JUri::root();
     $jCfg = JFactory::getConfig();
     $language = JFactory::getLanguage();
     $text_direction = 'data-direction="ltr"';
     if ($language->isRTL()) {
         $text_direction = 'data-direction="rtl"';
     }
     $urlbase = 'data-url=' . $base;
     if (file_exists(JPATH_ROOT . "/media/editors/tinymce/langs/" . $language->getTag() . ".js")) {
         $langPrefix = $language->getTag();
     } elseif (file_exists(JPATH_ROOT . "/media/editors/tinymce/langs/" . substr($language->getTag(), 0, strpos($language->getTag(), '-')) . ".js")) {
         $langPrefix = substr($language->getTag(), 0, strpos($language->getTag(), '-'));
     } else {
         $langPrefix = "en";
     }
     $langPrefix = "data-lang=" . $langPrefix;
     $jceData = "";
     if (file_exists(JPATH_ROOT . '/media/editors/tinymce/tinymce.min.js') && $jCfg->get('editor') != 'jce') {
         if ($jCfg->get('editor') != 'tinymce') {
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/tinymce.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/table/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/link/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/image/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/code/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/hr/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/charmap/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/autolink/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/lists/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/importcss/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/themes/modern/theme.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/content.inline.min.css', 'css');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/content.min.css', 'css');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/skin.min.css', 'css');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/skin.ie7.min.css', 'css');
         }
         $editor = 'tinymce';
     } elseif ($jCfg->get('editor') == 'jce') {
         include_once JPATH_ROOT . "/administrator/components/com_jce/includes/loader.php";
         include_once JPATH_ROOT . "/administrator/components/com_jce/models/editor.php";
         include_once JPATH_ROOT . "/components/com_jce/editor/libraries/classes/token.php";
         // create token
         $token = WFToken::getToken();
         $jceData .= " data-token=" . $token;
         // etag - version
         $editor = new WFModelEditor();
         $setting = $editor->getEditorSettings();
         $etag = $setting['etag'];
         $jceData .= " data-etag=" . $etag;
         // get current component
         $option = JFactory::getApplication()->input->get('option');
         $component = WFExtensionHelper::getComponent(null, $option);
         // set default component id
         $component_id = 0;
         $component_id = isset($component->extension_id) ? $component->extension_id : ($component->id ? $component->id : 0);
         $jceData .= " data-component_id=" . $component_id;
         $editor = 'jce';
     } else {
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.css', 'css');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg-0.9.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg-0.9.css', 'css');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.colorpicker.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.table.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.cssWrap.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.image.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'administrator/components/com_pagebuilder/assets/js/jquery-jwysiwyg/controls/wysiwyg.link.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ASSETS_URL . 'css/jwysiwyg.css', 'css');
     }
     $element = self::get_extra_info($element);
     $label = self::get_label($element);
     $type = !empty($element["input-type"]) ? $element["input-type"] : "text";
     $role = isset($element['role']) ? "role_{$element['role']}" : '';
     $role2 = isset($element['role_2']) ? 'data-role="title"' : '';
     $output = "<textarea type='{$type}' class='{$element['class']} jsn_tiny_mce {$role} {$editor}' id='{$element['id']}' name='{$element['id']}' {$role2} {$text_direction} {$urlbase} {$langPrefix} {$jceData} DATA_INFO>{$element['std']}</textarea>";
     return self::final_element($element, $output, $label);
 }
开发者ID:jovielarmario,项目名称:albay_cms,代码行数:86,代码来源:html.php


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