IMP_Compose::canHtmlCompose PHP Method

canHtmlCompose() public static method

Is the HTML editor available for compostion?
public static canHtmlCompose ( ) : boolean
return boolean True if HTML editor is available.
    public static function canHtmlCompose()
    {
        global $injector;
        return $injector->getInstance('Horde_Editor')->supportedByBrowser();
    }

Usage Example

示例#1
0
文件: Compose.php 项目: horde/horde
 /**
  * Constructor.
  */
 public function __construct()
 {
     global $page_output, $prefs, $registry;
     $this->_files[] = new Horde_Script_File_JsDir('compose.js', 'imp');
     $this->_files[] = new Horde_Script_File_JsDir('draghandler.js', 'imp');
     $this->_files[] = new Horde_Script_File_JsDir('editor.js', 'imp');
     $this->_files[] = new Horde_Script_File_JsDir('imp.js', 'imp');
     if (!$prefs->isLocked('default_encrypt') && (IMP_Pgp::enabled() || IMP_Smime::enabled())) {
         $page_output->addScriptPackage('Horde_Core_Script_Package_Dialog');
         $this->_files[] = new Horde_Script_File_JsDir('passphrase.js', 'imp');
     }
     if (!IMP_Compose::canHtmlCompose()) {
         return;
     }
     switch ($registry->getView()) {
         case $registry::VIEW_BASIC:
         case $registry::VIEW_DYNAMIC:
             $this->_files[] = new Horde_Script_File_JsDir('ckeditor/imageupload.js', 'imp');
             $this->_files[] = new Horde_Script_File_JsDir('ckeditor/images.js', 'imp');
             $page_output->addInlineJsVars(array('ImpCkeditorImgs.related_attr' => IMP_Compose::RELATED_ATTR));
             $js = new Horde_Script_File_JsDir('ckeditor/pasteattachment.js', 'imp');
             $upload_url = $registry->getServiceLink('ajax', 'imp')->url . 'addAttachmentCkeditor';
             $page_output->addInlineScript(array('if (window.CKEDITOR) { CKEDITOR.on("loaded", function(e) {' . 'CKEDITOR.plugins.addExternal("pasteattachment", "' . $js->url->url . '", "");' . 'CKEDITOR.config.filebrowserImageUploadUrl = "' . $upload_url . '";' . '}); };'), true);
             break;
     }
 }
All Usage Examples Of IMP_Compose::canHtmlCompose