Skip to content

Commit

Permalink
Add missed code of prevous version
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasites committed Apr 22, 2023
1 parent 9653cd7 commit fd37872
Show file tree
Hide file tree
Showing 9 changed files with 248 additions and 7 deletions.
51 changes: 50 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
_build/build.config.php
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore

# Node artifact files
node_modules/
dist/

# Compiled Java class files
*.class

# Compiled Python bytecode
*.py[cod]

# Log files
*.log

# Package files
*.jar

# Maven
target/
dist/

# JetBrains IDE
.idea/

# Unit test reports
TEST*.xml

# Generated by MacOS
.DS_Store

# Generated by Windows
Thumbs.db

# Applications
*.app
*.exe
*.war

# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv

2 changes: 1 addition & 1 deletion _build/ckeditor/build.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
define('PKG_NAME_LOWER', strtolower(PKG_NAME));

define('PKG_NAMESPACE','ckeditor');
define('PKG_VERSION','1.4.4');
define('PKG_VERSION','1.4.5');
define('PKG_RELEASE','pl');
if (isset($_SERVER['MODX_BASE_PATH'])) {
define('MODX_BASE_PATH', $_SERVER['MODX_BASE_PATH']);
Expand Down
18 changes: 17 additions & 1 deletion _build/ckeditor/build.transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,23 @@
} else {
$modx->log(xPDO::LOG_LEVEL_ERROR,'Could not package System Settings.');
}
unset($settings,$setting);
unset($settings, $setting, $attributes);
$su = include $sources['data'] . 'transport.settings_update.php';
if (!is_array($su)) {
$modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in settings for update.');
} else {
$attributes_u = array(
xPDOTransport::UNIQUE_KEY => 'key',
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => true,
);
foreach ($su as $setting_u) {
$vehicle = $builder->createVehicle($setting_u, $attributes_u);
$builder->putVehicle($vehicle);
}
$modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($su) . ' System Settings for update its values.');
}
unset($su, $setting_u, $attributes_u);


$modx->log(modX::LOG_LEVEL_INFO,'Adding package attributes and setup options...');
Expand Down
139 changes: 139 additions & 0 deletions _build/ckeditor/data/transport.settings_install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<?php
$settings = array();

$settings['ui_color']= $modx->newObject('modSystemSetting');
$settings['ui_color']->fromArray(array(
'key' => 'ckeditor.ui_color',
'xtype' => 'textfield',
'value' => '#DDDDDD',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['toolbar']= $modx->newObject('modSystemSetting');
$settings['toolbar']->fromArray(array(
'key' => 'ckeditor.toolbar',
'xtype' => 'textarea',
'value' => '',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['toolbar_groups']= $modx->newObject('modSystemSetting');
$settings['toolbar_groups']->fromArray(array(
'key' => 'ckeditor.toolbar_groups',
'xtype' => 'textarea',
'value' => '[{"name":"document","groups":["mode","document","doctools"]},{"name":"clipboard","groups":["clipboard","undo"]},{"name":"editing","groups":["find","selection","spellchecker"]},{"name":"links"},{"name":"insert"},{"name":"forms"},"/",{"name":"basicstyles","groups":["basicstyles","cleanup"]},{"name":"paragraph","groups":["list","indent","blocks","align","bidi"]},{"name":"styles"},{"name":"colors"},{"name":"tools"},{"name":"others"},{"name":"about"}]',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['format_tags']= $modx->newObject('modSystemSetting');
$settings['format_tags']->fromArray(array(
'key' => 'ckeditor.format_tags',
'xtype' => 'textfield',
'value' => 'p;h1;h2;h3;h4;h5;h6;pre;address;div',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['skin']= $modx->newObject('modSystemSetting');
$settings['skin']->fromArray(array(
'key' => 'ckeditor.skin',
'xtype' => 'textfield',
'value' => 'moono-lisa',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['extra_plugins']= $modx->newObject('modSystemSetting');
$settings['extra_plugins']->fromArray(array(
'key' => 'ckeditor.extra_plugins',
'xtype' => 'textfield',
'value' => '',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['object_resizing']= $modx->newObject('modSystemSetting');
$settings['object_resizing']->fromArray(array(
'key' => 'ckeditor.object_resizing',
'xtype' => 'combo-boolean',
'value' => '0',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['autocorrect_dash']= $modx->newObject('modSystemSetting');
$settings['autocorrect_dash']->fromArray(array(
'key' => 'ckeditor.autocorrect_dash',
'xtype' => 'textfield',
'value' => '',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['autocorrect_double_quotes']= $modx->newObject('modSystemSetting');
$settings['autocorrect_double_quotes']->fromArray(array(
'key' => 'ckeditor.autocorrect_double_quotes',
'xtype' => 'textfield',
'value' => '«»',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['autocorrect_single_quotes']= $modx->newObject('modSystemSetting');
$settings['autocorrect_single_quotes']->fromArray(array(
'key' => 'ckeditor.autocorrect_single_quotes',
'xtype' => 'textfield',
'value' => '„“',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['styles_set']= $modx->newObject('modSystemSetting');
$settings['styles_set']->fromArray(array(
'key' => 'ckeditor.styles_set',
'xtype' => 'textarea',
'value' => 'default',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['remove_plugins']= $modx->newObject('modSystemSetting');
$settings['remove_plugins']->fromArray(array(
'key' => 'ckeditor.remove_plugins',
'xtype' => 'textfield',
'value' => 'forms,smiley,autogrow,liststyle,justify,pagebreak,colorbutton,indentblock,font,newpage,print,save,language,bidi,selectall,preview',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['native_spellchecker']= $modx->newObject('modSystemSetting');
$settings['native_spellchecker']->fromArray(array(
'key' => 'ckeditor.native_spellchecker',
'xtype' => 'combo-boolean',
'value' => '1',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['resource_editor_height']= $modx->newObject('modSystemSetting');
$settings['resource_editor_height']->fromArray(array(
'key' => 'ckeditor.resource_editor_height',
'xtype' => 'textfield',
'value' => '600',
'namespace' => PKG_NAME_LOWER,
'area' => 'general'
),'',true,true);

$settings['version']= $modx->newObject('modSystemSetting');
$settings['version']->fromArray(array(
'key' => 'ckeditor.version',
'xtype' => 'textfield',
'value' => PKG_VERSION.'-'.PKG_RELEASE,
'namespace' => PKG_NAME_LOWER,
'area' => 'Other',
),'',true,true);

return $settings;
30 changes: 30 additions & 0 deletions _build/ckeditor/data/transport.settings_update.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/** @var modX $modx */
/** @var array $sources */

$settings = array();

$tmp = array(
'ckeditor.version' => array(
'xtype' => 'textfield',
'value' => PKG_VERSION.'-'.PKG_RELEASE,
'area' => 'Other',
),

);

foreach ($tmp as $k => $v) {
/** @var modSystemSetting $setting */
$setting = $modx->newObject('modSystemSetting');
$setting->fromArray(array_merge(
array(
'key' => $k,
'namespace' => PKG_NAME_LOWER,
), $v
), '', true, true);

$settings[] = $setting;
}
unset($tmp);

return $settings;
4 changes: 3 additions & 1 deletion core/components/ckeditor/lexicon/de/default.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@
$_lang['setting_ckeditor.autocorrect_double_quotes'] = 'Anführungszeichen';
$_lang['setting_ckeditor.autocorrect_double_quotes_desc'] = 'A pair of opening and closing marks to convert typewriter quotation marks to (smart quotes). In english writing “curly quotes” are used.';
$_lang['setting_ckeditor.autocorrect_single_quotes'] = 'einfache Anführungszeichen';
$_lang['setting_ckeditor.autocorrect_single_quotes_desc'] = 'A pair of opening and closing marks to convert typewriter apostrophes to (smart quotes). In english writing ‘curly quotes’ are used.';
$_lang['setting_ckeditor.autocorrect_single_quotes_desc'] = 'A pair of opening and closing marks to convert typewriter apostrophes to (smart quotes). In english writing ‘curly quotes’ are used.';
$_lang['setting_ckeditor.version'] = 'Paket version';
$_lang['setting_ckeditor.version_desc'] = 'Automatisch aktualisiert. wird für Manager Browser JS Cache Flush verwendet';
4 changes: 3 additions & 1 deletion core/components/ckeditor/lexicon/en/default.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@
$_lang['setting_ckeditor.native_spellchecker'] = 'Native spellchecker';
$_lang['setting_ckeditor.native_spellchecker_desc'] = 'Enables the built-in words spell checker if browser provides one.';
$_lang['setting_ckeditor.resource_editor_height'] = 'Resource editor height';
$_lang['setting_ckeditor.resource_editor_height_desc'] = 'Resource (document) content editor height adjustment';
$_lang['setting_ckeditor.resource_editor_height_desc'] = 'Resource (document) content editor height adjustment';
$_lang['setting_ckeditor.version'] = 'Package version';
$_lang['setting_ckeditor.version_desc'] = 'Updated automatically, used for manager browser JS cache flush';
2 changes: 2 additions & 0 deletions core/components/ckeditor/lexicon/ru/default.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@
$_lang['setting_ckeditor.native_spellchecker_desc'] = 'Включает встроенную в браузер проверку правописания (если она есть).';
$_lang['setting_ckeditor.resource_editor_height'] = 'Высота редактора ресурса';
$_lang['setting_ckeditor.resource_editor_height_desc'] = 'Настройка высоты редактора содержимого ресурса (документа)';
$_lang['setting_ckeditor.version'] = 'Версия пакета';
$_lang['setting_ckeditor.version_desc'] = 'Обновляется автоматически. Используется для очистки кэша JS браузера в админке';
5 changes: 3 additions & 2 deletions core/components/ckeditor/model/ckeditor/ckeditor.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function __construct(modX &$modx,array $config = array()) {
$this->config = array_merge(array(
'corePath' => $corePath,
'managerAssetsUrl' => $managerAssetsUrl,
'version' => $this->modx->getOption('ckeditor.version'),
), $config);

$this->modx->lexicon->load('ckeditor:default');
Expand All @@ -35,8 +36,8 @@ function __construct(modX &$modx,array $config = array()) {
public function initialize() {
if (!$this->assetsLoaded) {
$this->modx->controller->addLexiconTopic('ckeditor:default');
$this->modx->controller->addJavascript($this->config['managerAssetsUrl'].'modx.htmleditor.js');
$this->modx->controller->addJavascript($this->config['managerAssetsUrl'].'ckeditor/ckeditor.js');
$this->modx->controller->addJavascript($this->config['managerAssetsUrl'].'modx.htmleditor.js?v='.$this->config['version']);
$this->modx->controller->addJavascript($this->config['managerAssetsUrl'].'ckeditor/ckeditor.js?v='.$this->config['version']);
}
$this->assetsLoaded = true;
}
Expand Down

0 comments on commit fd37872

Please sign in to comment.