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


PHP Backend::getTinyMceLanguage方法代码示例

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


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

示例1: row


//.........这里部分代码省略.........
            // Support single fields as well (see #5240)
            $strKey = $arrData['eval']['multiple'] ? $this->strField . '_0' : $this->strField;
            $wizard .= ' ' . \Image::getHtml('pickcolor.gif', $GLOBALS['TL_LANG']['MSC']['colorpicker'], 'style="vertical-align:top;cursor:pointer" title="' . specialchars($GLOBALS['TL_LANG']['MSC']['colorpicker']) . '" id="moo_' . $this->strField . '"') . '
  <script>
    window.addEvent("domready", function() {
      new MooRainbow("moo_' . $this->strField . '", {
        id: "ctrl_' . $strKey . '",
        startColor: ((cl = $("ctrl_' . $strKey . '").value.hexToRgb(true)) ? cl : [255, 0, 0]),
        imgPath: "assets/mootools/colorpicker/' . $GLOBALS['TL_ASSETS']['COLORPICKER'] . '/images/",
        onComplete: function(color) {
          $("ctrl_' . $strKey . '").value = color.hex.replace("#", "");
        }
      });
    });
  </script>';
        }
        // Add a custom wizard
        if (is_array($arrData['wizard'])) {
            foreach ($arrData['wizard'] as $callback) {
                if (is_array($callback)) {
                    $this->import($callback[0]);
                    $wizard .= $this->{$callback}[0]->{$callback}[1]($this);
                } elseif (is_callable($callback)) {
                    $wizard .= $callback($this);
                }
            }
        }
        $objWidget->wizard = $wizard;
        // Set correct form enctype
        if ($objWidget instanceof \uploadable) {
            $this->blnUploadable = true;
        }
        // Mark floated single checkboxes
        if ($arrData['inputType'] == 'checkbox' && !$arrData['eval']['multiple'] && strpos($arrData['eval']['tl_class'], 'w50') !== false) {
            $arrData['eval']['tl_class'] .= ' cbx';
        } elseif ($arrData['inputType'] == 'text' && $arrData['eval']['multiple'] && strpos($arrData['eval']['tl_class'], 'wizard') !== false) {
            $arrData['eval']['tl_class'] .= ' inline';
        }
        // No 2-column layout in "edit all" mode
        if (\Input::get('act') == 'editAll' || \Input::get('act') == 'overrideAll') {
            $arrData['eval']['tl_class'] = str_replace(array('w50', 'clr', 'wizard', 'long', 'm12', 'cbx'), '', $arrData['eval']['tl_class']);
        }
        $updateMode = '';
        // Replace the textarea with an RTE instance
        if (!empty($arrData['eval']['rte'])) {
            list($file, $type) = explode('|', $arrData['eval']['rte'], 2);
            if (!file_exists(TL_ROOT . '/system/config/' . $file . '.php')) {
                throw new \Exception(sprintf('Cannot find editor configuration file "%s.php"', $file));
            }
            $selector = 'ctrl_' . $this->strInputName;
            $language = \Backend::getTinyMceLanguage();
            // backwards compatibility
            ob_start();
            include TL_ROOT . '/system/config/' . $file . '.php';
            $updateMode = ob_get_contents();
            ob_end_clean();
            unset($file, $type, $language, $selector);
        } elseif (\Input::get('act') == 'overrideAll' && ($arrData['inputType'] == 'checkbox' || $arrData['inputType'] == 'checkboxWizard') && $arrData['eval']['multiple']) {
            $updateMode = '
</div>
<div>
  <fieldset class="tl_radio_container">
  <legend>' . $GLOBALS['TL_LANG']['MSC']['updateMode'] . '</legend>
    <input type="radio" name="' . $this->strInputName . '_update" id="opt_' . $this->strInputName . '_update_1" class="tl_radio" value="add" onfocus="Backend.getScrollOffset()"> <label for="opt_' . $this->strInputName . '_update_1">' . $GLOBALS['TL_LANG']['MSC']['updateAdd'] . '</label><br>
    <input type="radio" name="' . $this->strInputName . '_update" id="opt_' . $this->strInputName . '_update_2" class="tl_radio" value="remove" onfocus="Backend.getScrollOffset()"> <label for="opt_' . $this->strInputName . '_update_2">' . $GLOBALS['TL_LANG']['MSC']['updateRemove'] . '</label><br>
    <input type="radio" name="' . $this->strInputName . '_update" id="opt_' . $this->strInputName . '_update_0" class="tl_radio" value="replace" checked="checked" onfocus="Backend.getScrollOffset()"> <label for="opt_' . $this->strInputName . '_update_0">' . $GLOBALS['TL_LANG']['MSC']['updateReplace'] . '</label>
  </fieldset>';
        }
        $strPreview = '';
        // Show a preview image (see #4948)
        if ($this->strTable == 'tl_files' && $this->strField == 'name' && $this->objActiveRecord !== null && $this->objActiveRecord->type == 'file') {
            $objFile = new \File($this->objActiveRecord->path, true);
            if ($objFile->isImage) {
                $image = 'placeholder.png';
                if ($objFile->isSvgImage || $objFile->height <= \Config::get('gdMaxImgHeight') && $objFile->width <= \Config::get('gdMaxImgWidth')) {
                    if ($objFile->width > 699 || $objFile->height > 524) {
                        $image = \Image::get($objFile->path, 699, 524, 'box');
                    } else {
                        $image = $objFile->path;
                    }
                }
                $ctrl = 'ctrl_preview_' . substr(md5($image), 0, 8);
                $strPreview = '

<div id="' . $ctrl . '" class="tl_edit_preview" data-original-width="' . $objFile->width . '" data-original-height="' . $objFile->height . '">
' . \Image::getHtml($image) . '
</div>';
                // Add the script to mark the important part
                if ($image !== 'placeholder.png') {
                    $strPreview .= '<script>Backend.editPreviewWizard($(\'' . $ctrl . '\'));</script>';
                    if (\Config::get('showHelp')) {
                        $strPreview .= '<p class="tl_help tl_tip">' . $GLOBALS['TL_LANG'][$this->strTable]['edit_preview_help'] . '</p>';
                    }
                }
            }
        }
        return $strPreview . '
<div' . ($arrData['eval']['tl_class'] ? ' class="' . $arrData['eval']['tl_class'] . '"' : '') . '>' . $objWidget->parse() . $updateMode . (!$objWidget->hasErrors() ? $this->help($strHelpClass) : '') . '
</div>';
    }
开发者ID:Tastaturberuf,项目名称:core,代码行数:101,代码来源:DataContainer.php

示例2: function

 */
if ($GLOBALS['TL_CONFIG']['useRTE']) {
    ?>
<script>window.tinymce || document.write('<script src="<?php 
    echo TL_ASSETS_URL;
    ?>
assets/tinymce4/tinymce.gzip.js">\x3C/script>')</script>
<script>
window.tinymce && tinymce.init({
  skin: 'contao',
  selector: '#<?php 
    echo $selector;
    ?>
',
  language: '<?php 
    echo Backend::getTinyMceLanguage();
    ?>
',
  element_format: 'html',
  forced_root_block: false,
  document_base_url: '<?php 
    echo Environment::get('base');
    ?>
',
  entities: '160,nbsp,60,lt,62,gt,173,shy',
  setup: function(editor) {
    editor.getElement().removeAttribute('required');
  },
  init_instance_callback: function(editor) {
    editor.on('focus', function() { Backend.getScrollOffset(); });
  },
开发者ID:bytehead,项目名称:contao-core,代码行数:31,代码来源:tinyFlash.php

示例3: preLoadRichTextEditor

 /**
  * Function for pre-loading the tiny mce.
  *
  * @return void
  *
  * @throws \Exception When the rich text editor config file can not be found.
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  * @SuppressWarnings(PHPMD.CamelCaseVariableName)
  */
 public function preLoadRichTextEditor()
 {
     foreach ($this->getEnvironment()->getDataDefinition()->getPropertiesDefinition()->getProperties() as $property) {
         /** @var PropertyInterface $property */
         $extra = $property->getExtra();
         if (!isset($extra['rte'])) {
             continue;
         }
         if (strncmp($extra['rte'], 'tiny', 4) !== 0 && strncmp($extra['rte'], 'ace', 3) !== 0) {
             continue;
         }
         list($file, $type) = explode('|', $extra['rte']);
         $selector = 'ctrl_' . $property->getName();
         if (version_compare(VERSION, '3.3', '<')) {
             $GLOBALS['TL_RTE'][$file][$selector] = array('id' => $selector, 'file' => $file, 'type' => $type);
         } else {
             if (!file_exists(TL_ROOT . '/system/config/' . $file . '.php')) {
                 throw new \Exception(sprintf('Cannot find editor configuration file "%s.php"', $file));
             }
             if (strncmp($extra['rte'], 'tiny', 4) !== 0) {
                 // Backwards compatibility
                 $language = \Backend::getTinyMceLanguage();
             }
             ob_start();
             include TL_ROOT . '/system/config/' . $file . '.php';
             $updateMode = ob_get_contents();
             ob_end_clean();
             $GLOBALS['TL_MOOTOOLS'][] = $updateMode;
         }
     }
 }
开发者ID:zonky2,项目名称:dc-general,代码行数:41,代码来源:ContaoWidgetManager.php


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