HomeHelpTrac

Changeset 15973


Ignore:
Timestamp:
02/10/12 22:38:54 (4 months ago)
Author:
Alexander Trofimov
Message:

Editor object + new WYSIWYG editor

Location:
trunk
Files:
96 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/classes/BxDolForm.php

    r15907 r15973  
    113113 * - html - display visual editor of certain type, for textarea field type only. 
    114114 *      - 0 - no visual editor, leave textarea field as it is. 
    115  *      - 1 - micro visual editor. 
    116  *      - 2 - default visual editor. 
    117  *      - 3 - mini visual editor. 
     115 *      - 1 - standard(default) visual editor, see @BxDolEditor. 
     116 *      - 2 - full visual editor, see @BxDolEditor. 
     117 *      - 3 - mini visual editor, see @BxDolEditor. 
    118118 * - attrs - serialized array of additional input attributes. 
    119119 * - attrs_tr - serialized array of additional attributes for the whole input row. 
     
    218218 *      - html - use visual editor or not. 
    219219 *          - 0 - no visual editor, leave textarea field as it is. 
    220  *          - 1 - micro visual editor. 
    221  *          - 2 - default visual editor. 
    222  *          - 3 - mini visual editor. 
     220 *          - 1 - standard(default) visual editor, see @BxDolEditor. 
     221 *          - 2 - full visual editor, see @BxDolEditor. 
     222 *          - 3 - mini visual editor, see @BxDolEditor. 
    223223 *      - checker_func 
    224224 *          Can be used here: Length, Preg, Avail  
  • trunk/inc/classes/BxDolLanguages.php

    r15818 r15973  
    8080 
    8181        return (int)$iId; 
     82    } 
     83 
     84    /** 
     85     * It tries to match current language with provided languages array, if nothing is found $sFallbackLanguage is returned. 
     86     * @param $aLangs - array of languages, example: array('ru' => 1, 'kg' => 1); 
     87     * @param $sFallbackLanguage - language to return of nothis is found 
     88     * @return language code string 
     89     */ 
     90    function detectLanguageFromArray($aLangs, $sFallbackLanguage = 'en') { 
     91        return isset($aLangs[$GLOBALS['sCurrentLanguage']]) ? $GLOBALS['sCurrentLanguage'] : $sFallbackLanguage; 
    8292    } 
    8393 
  • trunk/inc/utils.inc.php

    r15887 r15973  
    10351035    if (BX_ESCAPE_STR_APOS == $iQuoteType) { 
    10361036        $aUnits["'"] = "\\'"; 
     1037        $aUnits['<script'] = "<scr' + 'ipt"; 
     1038        $aUnits['</script>'] = "</scr' + 'ipt>"; 
    10371039    } elseif (BX_ESCAPE_STR_QUOTE == $iQuoteType) { 
    10381040        $aUnits['"'] = '\\"'; 
     1041        $aUnits['<script'] = '<scr" + "ipt'; 
     1042        $aUnits['</script>'] = '</scr" + "ipt>'; 
    10391043    } else { 
    10401044        $aUnits['"'] = '&quote;'; 
    10411045        $aUnits["'"] = '&apos;'; 
     1046        $aUnits["<"] = '&lt;'; 
     1047        $aUnits[">"] = '&gt;'; 
    10421048    } 
    10431049    return str_replace(array_keys($aUnits), array_values($aUnits), $mixedInput); 
  • trunk/install/sql/v70.sql

    r15971 r15973  
    66 
    77SET NAMES 'utf8'; 
    8 DROP TABLE IF EXISTS `sys_admin_ban_list`, `sys_block_list`, `sys_categories`, `sys_objects_categories`, `sys_objects_cmts`, `sys_email_templates`, `sys_friend_list`, `sys_options`, `sys_options_cats`, `sys_ip_list`, `sys_ip_members_visits`, `sys_localization_categories`, `sys_localization_keys`, `sys_localization_languages`, `sys_localization_string_params`, `sys_localization_strings`, `sys_acl_actions`, `sys_acl_actions_track`, `sys_acl_matrix`, `sys_acl_level_prices`, `sys_acl_levels`, `sys_sessions`, `sys_acl_levels_members`, `sys_objects_search`, `sys_stat_site`, `sys_alerts`, `sys_alerts_handlers`, `sys_injections`, `sys_injections_admin`, `sys_modules`, `sys_modules_file_tracks`, `sys_permalinks`, `sys_privacy_actions`, `sys_privacy_defaults`, `sys_privacy_groups`, `sys_privacy_members`, `sys_tags`, `sys_objects_tag`, `sys_transactions`, `sys_objects_auths`, `sys_objects_vote`, `sys_objects_views`, `sys_cron_jobs`, `sys_dnsbl_rules`, `sys_dnsbl_block_log`, `sys_dnsbluri_zones`, `sys_menu_mobile`, `sys_menu_mobile_pages`, `sys_objects_storage`, `sys_storage_user_quotas`, `sys_storage_tokens`, `sys_storage_ghosts`, `sys_storage_mime_types`, `sys_objects_transcoder_images`, `sys_transcoder_images_files`, `sys_transcoder_images_filters`,`sys_accounts`,`sys_profiles`; 
     8DROP TABLE IF EXISTS `sys_admin_ban_list`, `sys_block_list`, `sys_categories`, `sys_objects_editor`, `sys_objects_categories`, `sys_objects_cmts`, `sys_email_templates`, `sys_friend_list`, `sys_options`, `sys_options_cats`, `sys_ip_list`, `sys_ip_members_visits`, `sys_localization_categories`, `sys_localization_keys`, `sys_localization_languages`, `sys_localization_string_params`, `sys_localization_strings`, `sys_acl_actions`, `sys_acl_actions_track`, `sys_acl_matrix`, `sys_acl_level_prices`, `sys_acl_levels`, `sys_sessions`, `sys_acl_levels_members`, `sys_objects_search`, `sys_stat_site`, `sys_alerts`, `sys_alerts_handlers`, `sys_injections`, `sys_injections_admin`, `sys_modules`, `sys_modules_file_tracks`, `sys_permalinks`, `sys_privacy_actions`, `sys_privacy_defaults`, `sys_privacy_groups`, `sys_privacy_members`, `sys_tags`, `sys_objects_tag`, `sys_transactions`, `sys_objects_auths`, `sys_objects_vote`, `sys_objects_views`, `sys_cron_jobs`, `sys_dnsbl_rules`, `sys_dnsbl_block_log`, `sys_dnsbluri_zones`, `sys_menu_mobile`, `sys_menu_mobile_pages`, `sys_objects_storage`, `sys_storage_user_quotas`, `sys_storage_tokens`, `sys_storage_ghosts`, `sys_storage_mime_types`, `sys_objects_transcoder_images`, `sys_transcoder_images_files`, `sys_transcoder_images_filters`,`sys_accounts`,`sys_profiles`; 
    99ALTER DATABASE DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; 
    1010 
     
    1212-- -------------------------------------------------------- 
    1313 
    14 -- 
    15 -- Table structure for table `sys_admin_ban_list` 
    16 -- 
    1714 
    1815CREATE TABLE `sys_admin_ban_list` ( 
     
    2320) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    2421 
    25 -- -------------------------------------------------------- 
    26  
    27 -- 
    28 -- Table structure for table `sys_block_list` 
    29 -- 
     22 
     23-- -------------------------------------------------------- 
     24 
    3025 
    3126CREATE TABLE `sys_block_list` ( 
     
    3833) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    3934 
    40 -- -------------------------------------------------------- 
    41  
    42 -- 
    43 -- Table structure for table `sys_categories` 
    44 -- 
     35 
     36-- -------------------------------------------------------- 
     37 
    4538 
    4639CREATE TABLE `sys_categories` ( 
     
    5447) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    5548 
    56 -- -------------------------------------------------------- 
    57  
    58 -- 
    59 -- Table structure for table `sys_objects_auths` 
    60 -- 
     49 
     50-- -------------------------------------------------------- 
     51 
     52 
     53CREATE TABLE `sys_objects_editor` ( 
     54  `id` int(11) NOT NULL AUTO_INCREMENT, 
     55  `object` varchar(32) NOT NULL, 
     56  `title` varchar(255) NOT NULL, 
     57  `override_class_name` varchar(255) NOT NULL, 
     58  `override_class_file` varchar(255) NOT NULL, 
     59  PRIMARY KEY (`id`), 
     60  UNIQUE KEY `object` (`object`) 
     61) ENGINE=MyISAM  DEFAULT CHARSET=utf8; 
     62 
     63 
     64-- -------------------------------------------------------- 
     65 
    6166 
    6267CREATE TABLE `sys_objects_auths` ( 
     
    218223 
    219224-- 
    220 -- Dumping data for tables `sys_options` and `sys_options_categories` 
     225-- CATEGORY: system 
    221226-- 
    222227INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'system', '_adm_stg_cpt_category_system', 1, 1); 
     
    240245 
    241246 
     247-- 
     248-- CATEGORY: other 
     249-- 
    242250INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'other', '_adm_stg_cpt_category_other', 0, 4); 
    243251SET @iCategoryId = LAST_INSERT_ID(); 
    244252 
    245253INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES 
    246 (@iCategoryId, 'member_online_time', 'Time period in minutes within which a member is considered to be online', '1', 'digit', '', '', '', 4), 
    247 (@iCategoryId, 'enable_tiny_in_comments', 'Enable TinyMCE in comments', '', 'checkbox', '', '', '', 6), 
    248 (@iCategoryId, 'enable_cache_system', 'Enable caching system to store profiles information', 'on', 'checkbox', '', '', '', 7), 
    249 (@iCategoryId, 'sys_ftp_login', 'FTP server login', '', 'digit', '', '', '', 15), 
    250 (@iCategoryId, 'sys_ftp_password', 'FTP server password', '', 'digit', '', '', '', 16), 
    251 (@iCategoryId, 'sys_ftp_dir', 'Path to Dolphin on FTP server', '', 'digit', '', '', '', 17), 
     254(@iCategoryId, 'member_online_time', 'Time period in minutes within which a member is considered to be online', '1', 'digit', '', '', '', 1), 
     255(@iCategoryId, 'enable_tiny_in_comments', 'Enable TinyMCE in comments', '', 'checkbox', '', '', '', 2), 
     256(@iCategoryId, 'sys_editor_default', 'Default HTML editor', 'sys_wymeditor', 'digit', '', '', '', 3), 
     257(@iCategoryId, 'sys_ftp_login', 'FTP server login', '', 'digit', '', '', '', 10), 
     258(@iCategoryId, 'sys_ftp_password', 'FTP server password', '', 'digit', '', '', '', 11), 
     259(@iCategoryId, 'sys_ftp_dir', 'Path to Dolphin on FTP server', '', 'digit', '', '', '', 12), 
     260(@iCategoryId, 'enable_cache_system', 'Enable caching system to store profiles information', 'on', 'checkbox', '', '', '', 18), 
    252261(@iCategoryId, 'sys_db_cache_enable', 'Enable DB cache', '', 'checkbox', '', '', '', 19), 
    253262(@iCategoryId, 'sys_db_cache_engine', 'DB cache engine (other than File option may require custom server setup)', 'File', 'select', 'File,EAccelerator,Memcache,APC,XCache', '', '', 20), 
     
    261270 
    262271 
     272-- 
     273-- CATEGORY: emails 
     274-- 
    263275INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'emails', '_adm_stg_cpt_category_emails', 0, 5); 
    264276SET @iCategoryId = LAST_INSERT_ID(); 
     
    268280 
    269281 
     282-- 
     283-- CATEGORY: memberships 
     284-- 
    270285INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'memberships', '_adm_stg_cpt_category_memberships', 0, 6); 
    271286SET @iCategoryId = LAST_INSERT_ID(); 
     
    278293 
    279294 
     295-- 
     296-- CATEGORY: site settings 
     297-- 
    280298INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'site_settings','_adm_stg_cpt_category_site_settings', 0, 8); 
    281299SET @iCategoryId = LAST_INSERT_ID(); 
     
    287305 
    288306 
     307-- 
     308-- CATEGORY: database pruning 
     309-- 
    289310INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'pruning', '_adm_stg_cpt_category_pruning', 0, 11); 
    290311SET @iCategoryId = LAST_INSERT_ID(); 
     
    294315 
    295316 
     317-- 
     318-- CATEGORY: security 
     319-- 
    296320INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'security', '_adm_stg_cpt_category_security', 0, 14); 
    297321SET @iCategoryId = LAST_INSERT_ID(); 
     
    313337 
    314338 
     339-- 
     340-- CATEGORY: variable 
     341-- 
    315342INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'variables', '_adm_stg_cpt_category_variables', 0, 15); 
    316343SET @iCategoryId = LAST_INSERT_ID(); 
     
    333360 
    334361 
     362-- 
     363-- CATEGORY: watermark 
     364-- 
    335365INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'watermarks', '_adm_stg_cpt_category_watermarks', 0, 16); 
    336366SET @iCategoryId = LAST_INSERT_ID(); 
     
    342372 
    343373 
     374-- 
     375-- CATEGORY: tags 
     376-- 
    344377INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'tags', '_adm_stg_cpt_category_tags', 0, 19); 
    345378SET @iCategoryId = LAST_INSERT_ID(); 
     
    352385 
    353386 
     387-- 
     388-- CATEGORY: permalinks 
     389-- 
    354390INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'permalinks', '_adm_stg_cpt_category_permalinks', 0, 20); 
    355391SET @iCategoryId = LAST_INSERT_ID(); 
    356392 
     393-- 
     394-- CATEGORY: categories 
     395-- 
    357396INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'categories', '_adm_stg_cpt_category_categories', 0, 21); 
    358397SET @iCategoryId = LAST_INSERT_ID(); 
     
    364403 
    365404 
     405-- 
     406-- CATEGORY: storage 
     407-- 
    366408INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'storage', '_adm_stg_cpt_category_storage', 0, 22); 
    367409SET @iCategoryId = LAST_INSERT_ID(); 
     
    375417 
    376418 
     419-- 
     420-- CATEGORY: languages 
     421-- 
    377422INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'languages', '_adm_stg_cpt_category_languages', 1, 23); 
    378423SET @iCategoryId = LAST_INSERT_ID(); 
     
    383428 
    384429 
     430-- 
     431-- CATEGORY: templates 
     432-- 
    385433INSERT INTO `sys_options_categories`(`type_id`, `name`, `caption`, `hidden`, `order`) VALUES (@iTypeId, 'templates', '_adm_stg_cpt_category_templates', 1, 13); 
    386434SET @iCategoryId = LAST_INSERT_ID(); 
  • trunk/studio/templates/base/scripts/BxBaseStudioBuilderPage.php

    r15969 r15973  
    10711071        $sContent = BxTemplStudioFunctions::getInstance()->popupBox($this->aHtmlIds['edit_block_popup_id'], _t('_adm_bp_txt_edit_block_popup', _t($aBlock['title'])), $oTemplate->parseHtmlByName('bp_add_block.html', array( 
    10721072            'form_id' => $aForm['form_attrs']['id'], 
    1073             'form' => $oForm->getCode() 
     1073            'form' => $oForm->getCode(true) 
    10741074        ))); 
    10751075 
  • trunk/templates/base/scripts/BxBaseConfig.php

    r15338 r15973  
    5454    var $iTagsMaxFontSize                        = 30; //Maximal font size of tag 
    5555 
    56     var $sTinyMceEditorJS; 
    5756    //var $sCalendarCss; 
    5857 
     
    6160    var $bAllowUnicodeInPreg = false; // allow unicode in regular expressions 
    6261 
    63     var $aTinyMceSelectors = array(); 
    6462 
    6563 
     
    6765        parent::BxDol(); 
    6866 
    69         $anon_mode = getParam('anon_mode'); 
    70  
    71         $this -> bAnonymousMode = $anon_mode; 
    72  
    73         $this -> aTinyMceSelectors = array('group_edit_html', 'story_edit_area', 'classfiedsTextArea', 'blogText', 'comment_textarea', 'form_input_html'); 
    74         $sSelectors = implode('|', $this -> aTinyMceSelectors); 
    75  
    76         $this -> iTinyMceEditorWidthJS = '630px'; 
    77         $this -> sTinyMceEditorJS = ' 
    78 <!-- tinyMCE gz --> 
    79 <script type="text/javascript" src="' . BX_DOL_URL_PLUGINS . 'tiny_mce/tiny_mce_gzip.js"></script> 
    80 <script type="text/javascript"> 
    81     tinyMCE_GZ.init({ 
    82         plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,media,searchreplace,directionality,fullscreen", 
    83         themes : "advanced", 
    84         languages : "en", 
    85         disk_cache : true, 
    86         debug : false 
    87     }); 
    88  
    89     if (window.attachEvent) 
    90         window.attachEvent( "onload", InitTiny ); 
    91     else 
    92         window.addEventListener( "load", InitTiny, false); 
    93  
    94     function InitTiny() { 
    95         // Notice: The simple theme does not use all options some of them are limited to the advanced theme 
    96         tinyMCE.init({ 
    97             convert_urls : false, 
    98             mode : "specific_textareas", 
    99             theme : "advanced", 
    100  
    101             editor_selector : /(' . $sSelectors . ')/, 
    102  
    103             plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,directionality,fullscreen", 
    104  
    105             theme_advanced_buttons1_add : "fontselect,fontsizeselect", 
    106             theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,image,separator,search,replace,separator", 
    107             theme_advanced_buttons2_add : "separator,insertdate,inserttime,separator,forecolor,backcolor", 
    108             theme_advanced_buttons3_add : "emotions", 
    109             theme_advanced_toolbar_location : "top", 
    110             theme_advanced_toolbar_align : "left", 
    111             theme_advanced_statusbar_location : "bottom", 
    112  
    113             plugi2n_insertdate_dateFormat : "%Y-%m-%d", 
    114             plugi2n_insertdate_timeFormat : "%H:%M:%S", 
    115             theme_advanced_resizing : false, 
    116             theme_advanced_resize_horizontal : false, 
    117  
    118             entity_encoding : "raw", 
    119  
    120             paste_use_dialog : false, 
    121             paste_auto_cleanup_on_paste : true, 
    122             paste_convert_headers_to_strong : false, 
    123             paste_strip_class_attributes : "all", 
    124             paste_remove_spans : false, 
    125             paste_remove_styles : false 
    126         }); 
    127     } 
    128 </script> 
    129 <!-- /tinyMCE -->'; 
    130  
    131         $this -> sTinyMceEditorCompactJS = ' 
    132 <!-- tinyMCE gz --> 
    133 <script type="text/javascript" src="' . BX_DOL_URL_PLUGINS . 'tiny_mce/tiny_mce_gzip.js"></script> 
    134 <script type="text/javascript"> 
    135     tinyMCE_GZ.init({ 
    136         themes : "advanced", 
    137         plugins : "style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,media,searchreplace,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras", 
    138         languages : "en", 
    139         disk_cache : true, 
    140         debug : false 
    141     }); 
    142  
    143     if (window.attachEvent) 
    144         window.attachEvent( "onload", InitTiny ); 
    145     else 
    146         window.addEventListener( "load", InitTiny, false); 
    147  
    148     function InitTiny() { 
    149         tinyMCE.init({ 
    150             convert_urls : false, 
    151             mode : "specific_textareas", 
    152             theme : "advanced", 
    153             plugins : "style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras", 
    154  
    155             delta_height: -9, // just for correct sizing 
    156  
    157             editor_selector : /(' . $sSelectors . ')/, 
    158  
    159             theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect", 
    160             theme_advanced_buttons2 : "forecolor,backcolor,|,bullist,numlist,|,outdent,indent,|,link,unlink,image,hr,|,sub,sup,|,insertdate,inserttime,|,styleprops", 
    161             theme_advanced_buttons3 : "charmap,emotions,|,cite,abbr,acronym,attribs,|,preview,removeformat", 
    162             theme_advanced_toolbar_location : "top", 
    163             theme_advanced_toolbar_align : "center", 
    164             extended_valid_elements : "a[name|href|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", 
    165  
    166             entity_encoding : "raw", 
    167  
    168             paste_use_dialog : false, 
    169             paste_auto_cleanup_on_paste : true, 
    170             paste_convert_headers_to_strong : false, 
    171             paste_strip_class_attributes : "all", 
    172             paste_remove_spans : false, 
    173             paste_remove_styles : false 
    174         }); 
    175     } 
    176 </script>'; 
    177  
    178         $this -> iTinyMceEditorWidthMiniJS = '270px'; 
    179         $this -> sTinyMceEditorMiniJS = ' 
    180 <!-- tinyMCE gz --> 
    181 <script type="text/javascript" src="' . BX_DOL_URL_PLUGINS . 'tiny_mce/tiny_mce_gzip.js"></script> 
    182 <script type="text/javascript"> 
    183     tinyMCE_GZ.init({ 
    184         plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,media,searchreplace,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras", 
    185         themes : "advanced", 
    186         languages : "en", 
    187         disk_cache : true, 
    188         debug : false 
    189     }); 
    190  
    191     if (window.attachEvent) 
    192         window.attachEvent( "onload", InitTiny ); 
    193     else 
    194         window.addEventListener( "load", InitTiny, false); 
    195  
    196     function InitTiny() { 
    197         // Notice: The simple theme does not use all options some of them are limited to the advanced theme 
    198         tinyMCE.init({ 
    199             convert_urls : false, 
    200             mode : "specific_textareas", 
    201             theme : "advanced", 
    202  
    203             editor_selector : /(' . $sSelectors . ')/, 
    204  
    205             plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,directionality,fullscreen,visualchars,xhtmlxtras", 
    206  
    207             theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor", 
    208             theme_advanced_buttons2 : "link,unlink,image,hr,insertdate,inserttime,|,charmap,emotions,|,cite,preview,removeformat", 
    209             theme_advanced_buttons3 : "", 
    210             theme_advanced_toolbar_location : "top", 
    211             theme_advanced_toolbar_align : "left", 
    212             theme_advanced_statusbar_location : "bottom", 
    213             theme_advanced_disable : "insertanchor,image,help,anchor,code,styleselect", 
    214             plugi2n_insertdate_dateFormat : "%Y-%m-%d", 
    215             plugi2n_insertdate_timeFormat : "%H:%M:%S", 
    216             theme_advanced_resizing : false, 
    217             theme_advanced_resize_horizontal : false, 
    218  
    219             entity_encoding : "raw", 
    220  
    221             paste_use_dialog : false, 
    222             paste_auto_cleanup_on_paste : true, 
    223             paste_convert_headers_to_strong : false, 
    224             paste_strip_class_attributes : "all", 
    225             paste_remove_spans : false, 
    226             paste_remove_styles : false 
    227         }); 
    228     } 
    229 </script> 
    230 <!-- /tinyMCE -->'; 
    231  
    232         $this -> sTinyMceEditorMicroJS = ' 
    233 <!-- tinyMCE gz --> 
    234 <script type="text/javascript" src="' . BX_DOL_URL_PLUGINS . 'tiny_mce/tiny_mce_gzip.js"></script> 
    235 <script type="text/javascript"> 
    236     tinyMCE_GZ.init({ 
    237         themes : "advanced", 
    238         plugins: "emotions", 
    239         languages : "en", 
    240         disk_cache : true, 
    241         debug : false 
    242         /* , suffix: "_src" //for development only */ 
    243     }); 
    244  
    245     if (window.attachEvent) 
    246         window.attachEvent( "onload", InitTiny ); 
    247     else 
    248         window.addEventListener( "load", InitTiny, false); 
    249  
    250     function InitTiny() { 
    251         tinyMCE.init({ 
    252             convert_urls : false, 
    253             mode : "specific_textareas", 
    254             theme : "advanced", 
    255             plugins: "emotions", 
    256  
    257             delta_height: -9, // just for correct sizing 
    258  
    259             editor_selector : /(' . $sSelectors . ')/, 
    260  
    261             theme_advanced_buttons1 : "bold,italic,underline,strikethrough,link,unlink", 
    262             theme_advanced_buttons2 : "justifyleft,justifycenter,justifyright,justifyfull,emotions", 
    263             theme_advanced_buttons3 : "", 
    264             theme_advanced_toolbar_location : "top", 
    265             theme_advanced_toolbar_align : "center", 
    266  
    267             entity_encoding : "raw", 
    268  
    269             paste_use_dialog : false, 
    270             paste_auto_cleanup_on_paste : true, 
    271             paste_convert_headers_to_strong : false, 
    272             paste_strip_class_attributes : "all", 
    273             paste_remove_spans : false, 
    274             paste_remove_styles : false 
    275         }); 
    276     } 
    277 </script> 
    278 <!-- /tinyMCE -->'; 
     67        $this -> bAnonymousMode = getParam('anon_mode');; 
    27968    } 
    28069 
  • trunk/templates/base/scripts/BxBaseFormView.php

    r15947 r15973  
    6060 
    6161    /** 
     62     * Form is added dynamically. 
     63     * @var boolean 
     64     */ 
     65    var $_bDynamicMode = false; 
     66 
     67    /** 
    6268     * Constructor 
    6369     * 
     
    7985     * @return string 
    8086     */ 
    81     function getCode() { 
     87    function getCode($bDynamicMode = false) { 
     88        $this->_bDynamicMode = $bDynamicMode; 
    8289        $this->addCssJs (); 
    8390        return ($this->sCode = $this->genForm()); 
     
    642649    } 
    643650 
    644     function addHtmlEditor($iTinyNum, &$aInput) { 
    645         bx_import('BxTemplConfig'); 
    646         $oTemplConfig = BxTemplConfig::getInstance(); 
    647  
    648         //--- Add TinyMCE initialization code 
    649         if (!$this->_bHtmlEditorAdded && $iTinyNum) { 
    650             switch($iTinyNum) { 
    651                 case 3: 
    652                     $this->_sCodeAdd .= $oTemplConfig->sTinyMceEditorMiniJS; 
    653                     break; 
    654                 case 2: 
    655                     $this->_sCodeAdd .= $oTemplConfig->sTinyMceEditorJS; 
    656                     break; 
    657                 case 1: 
    658                 case true: 
    659                     $this->_sCodeAdd .= $oTemplConfig->sTinyMceEditorMicroJS; 
    660                     break; 
    661             } 
    662             $this->_bHtmlEditorAdded = true; 
    663         } 
    664  
    665         //--- Update HTML wrapper width 
    666         if (is_int($iTinyNum)) 
    667             switch($iTinyNum) { 
    668                 case 2: 
    669                     $aInput['attrs_wrapper']['style'] = 'width:' . $oTemplConfig->iTinyMceEditorWidthJS . ';'; 
    670                 break; 
    671                 case 3: 
    672                     $aInput['attrs_wrapper']['style'] = 'width:' . $oTemplConfig->iTinyMceEditorWidthMiniJS . ';'; 
    673                 break; 
    674             } 
     651    function addHtmlEditor($iViewMode, &$aInput) { 
     652 
     653        bx_import('BxDolEditor'); 
     654        $oEditor = BxDolEditor::getObjectInstance(); 
     655        if (!$oEditor) 
     656            return false;   
     657 
     658        $this->_sCodeAdd .= $oEditor->attachEditor ('#' . $this->aFormAttrs['id'] . ' [name='.$aInput['name'].']', $iViewMode, $this->_bDynamicMode); 
    675659 
    676660        return true; 
     
    10421026        $aUiLangs = array ('af' => 1, 'ar-DZ' => 1, 'ar' => 1, 'az' => 1, 'bg' => 1, 'bs' => 1, 'ca' => 1, 'cs' => 1, 'da' => 1, 'de' => 1, 'el' => 1, 'en-AU' => 1, 'en-GB' => 1, 'en-NZ' => 1, 'eo' => 1, 'es' => 1, 'et' => 1, 'eu' => 1, 'fa' => 1, 'fi' => 1, 'fo' => 1, 'fr-CH' => 1, 'fr' => 1, 'gl' => 1, 'he' => 1, 'hr' => 1, 'hu' => 1, 'hy' => 1, 'id' => 1, 'is' => 1, 'it' => 1, 'ja' => 1, 'ko' => 1, 'kz' => 1, 'lt' => 1, 'lv' => 1, 'ml' => 1, 'ms' => 1, 'nl' => 1, 'no' => 1, 'pl' => 1, 'pt-BR' => 1, 'pt' => 1, 'rm' => 1, 'ro' => 1, 'ru' => 1, 'sk' => 1, 'sl' => 1, 'sq' => 1, 'sr-SR' => 1, 'sr' => 1, 'sv' => 1, 'ta' => 1, 'th' => 1, 'tj' => 1, 'tr' => 1, 'uk' => 1, 'vi' => 1, 'zh-CN' => 1, 'zh-HK' => 1, 'zh-TW' => 1); 
    10431027 
    1044         $sCalendarLang = isset($aCalendarLangs[$GLOBALS['sCurrentLanguage']]) ? $GLOBALS['sCurrentLanguage'] : 'en'; 
    1045         $sUiLang = isset($aUiLangs[$GLOBALS['sCurrentLanguage']]) ? $GLOBALS['sCurrentLanguage'] : 'en'; 
     1028        bx_import('BxDolLanguages'); 
     1029        $sCalendarLang = BxDolLanguages::getInstance()->detectLanguageFromArray ($aCalendarLangs); 
     1030        $sUiLang = BxDolLanguages::getInstance()->detectLanguageFromArray ($aUiLangs); 
    10461031 
    10471032        $aJs = array( 
Note: See TracChangeset for help on using the changeset viewer.