HomeHelpTrac

Changeset 15974


Ignore:
Timestamp:
02/11/12 00:06:46 (4 months ago)
Author:
Alexander Trofimov
Message:

Editor object - another new WYSIWYG editor

Location:
trunk
Files:
9 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/install/sql/v70.sql

    r15973 r15974  
    5555  `object` varchar(32) NOT NULL, 
    5656  `title` varchar(255) NOT NULL, 
     57  `skin` varchar(255) NOT NULL, 
    5758  `override_class_name` varchar(255) NOT NULL, 
    5859  `override_class_file` varchar(255) NOT NULL, 
     
    6061  UNIQUE KEY `object` (`object`) 
    6162) ENGINE=MyISAM  DEFAULT CHARSET=utf8; 
     63 
     64 
     65INSERT INTO `sys_objects_editor` (`object`, `title`, `skin`, `override_class_name`, `override_class_file`) VALUES 
     66('sys_wymeditor', 'WYMeditor', 'compact', 'BxTemplEditorWYMeditor', ''), 
     67('sys_cleditor', 'CLEditor', '', 'BxTemplEditorCLEditor', ''); 
    6268 
    6369 
     
    254260(@iCategoryId, 'member_online_time', 'Time period in minutes within which a member is considered to be online', '1', 'digit', '', '', '', 1), 
    255261(@iCategoryId, 'enable_tiny_in_comments', 'Enable TinyMCE in comments', '', 'checkbox', '', '', '', 2), 
    256 (@iCategoryId, 'sys_editor_default', 'Default HTML editor', 'sys_wymeditor', 'digit', '', '', '', 3), 
     262(@iCategoryId, 'sys_editor_default', 'Default HTML editor', 'sys_cleditor', 'digit', '', '', '', 3), 
    257263(@iCategoryId, 'sys_ftp_login', 'FTP server login', '', 'digit', '', '', '', 10), 
    258264(@iCategoryId, 'sys_ftp_password', 'FTP server password', '', 'digit', '', '', '', 11), 
  • trunk/samples/editor.php

    r15973 r15974  
    4646    $oEditor = BxDolEditor::getObjectInstance(); // get default editor object instance 
    4747    if ($oEditor) // check if editor is available for using 
    48         echo $oEditor->attachEditor ('#my_textarea', BX_EDITOR_STANDARD); // output HTML which will automatically apply editor to textarea element by its id     
     48        echo $oEditor->attachEditor ('#my_textarea'); // output HTML which will automatically apply editor to textarea element by its id     
     49 
     50 
     51    // print all available editors and editors view modes below 
     52     
     53    echo '<hr class="bx-def-hr" />'; 
     54 
     55    $aEditors = array('sys_cleditor', 'sys_wymeditor'); 
     56    $aViewModes = array(BX_EDITOR_MINI => 'Mini', BX_EDITOR_STANDARD => 'Standard', BX_EDITOR_FULL => 'Full'); 
     57    foreach ($aViewModes as $iViewMode => $sViewModeHeader) { 
     58        echo "<h1>$sViewModeHeader</h1>"; 
     59        foreach ($aEditors as $sEditor) { 
     60            $sId = 'textarea_' . $sEditor . '_' . $iViewMode; 
     61            echo '<textarea id="' . $sId . '" name="my_textarea" rows="20" cols="80">some text here</textarea>';  
     62            $oEditor = BxDolEditor::getObjectInstance($sEditor);  
     63            if (!$oEditor)  
     64                continue; 
     65            echo $oEditor->attachEditor ('#' . $sId, $iViewMode);  
     66            echo '<hr class="bx-def-hr" />'; 
     67        } 
     68    } 
     69     
    4970 
    5071    return DesignBoxContent("Visual editor", ob_get_clean(), BX_DB_PADDING_DEF); 
Note: See TracChangeset for help on using the changeset viewer.