Skip to content

Commit 25b24f2

Browse files
committed
Fixes to get it working in SS4, is very much a bodge
1 parent 493abe4 commit 25b24f2

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

_config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
$htmlEditorNames = Config::inst()->get('Shortcodable', 'htmleditor_names');
1616
if (is_array($htmlEditorNames)) {
1717
foreach ($htmlEditorNames as $htmlEditorName) {
18-
HtmlEditorConfig::get($htmlEditorName)->enablePlugins(array(
19-
'shortcodable' => sprintf('../../../%s/javascript/editor_plugin.js', SHORTCODABLE_DIR)
20-
));
18+
// HtmlEditorConfig::get($htmlEditorName)->enablePlugins(array(
19+
// 'shortcodable' => sprintf('/resources/%s/javascript/editor_plugin.js', SHORTCODABLE_DIR)
20+
// ));
2121
HtmlEditorConfig::get($htmlEditorName)->addButtonsToLine(1, 'shortcodable');
2222
}
2323
}

_config/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
Name: shortcodable
33
After:
44
- framework/*
5-
- cms/*
5+
# - cms/*
66
---
77

88
LeftAndMain:
99
extra_requirements_javascript:
10-
- 'shortcodable/javascript/editor_plugin.js'
11-
- 'shortcodable/javascript/shortcodable.js'
10+
- 'resources/shortcodable/javascript/editor_plugin.js'
11+
- 'resources/shortcodable/javascript/shortcodable.js'
1212
extra_requirements_css:
1313
- 'shortcodable/css/shortcodable.css'
1414

src/Extensions/ShortcodableParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
namespace Silverstripe\Shortcodable;
44

5-
use SilverStripe\Core\Object;
5+
use SilverStripe\View\ViewableData;
66

77
/**
88
* ShortcodableParser - temporary measure, based on wordpress parser
99
* This parser is only used to parse tags in the html editor field for editing in the popup window.
1010
*
1111
* @todo update SS ShortcodeParser to offer a public api for converting a shortcode to a data array, and use that instead.
1212
*/
13-
class ShortcodableParser extends Object
13+
class ShortcodableParser extends ViewableData
1414
{
1515
/**
1616
* @var array

src/Shortcodable.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
namespace Silverstripe;
44

5-
use SilverStripe\Core\Object;
5+
use SilverStripe\View\ViewableData;
66
use SilverStripe\View\Parsers\ShortcodeParser;
77
use SilverStripe\Core\Config\Config;
8+
use Silverstripe\Shortcodable\ShortcodableParser;
89

910
/**
1011
* Shortcodable
1112
* Manages shortcodable configuration and register shortcodable objects
1213
*
1314
* @author shea@livesource.co.nz
1415
**/
15-
class Shortcodable extends Object
16+
class Shortcodable extends ViewableData
1617
{
1718
private static $shortcodable_classes = array();
1819

@@ -32,7 +33,7 @@ public static function register_class($class)
3233
user_error("Failed to register \"$class\" with shortcodable. $class must have the method parse_shortcode(). See /shortcodable/README.md", E_USER_ERROR);
3334
}
3435
ShortcodeParser::get('default')->register($class, array($class, 'parse_shortcode'));
35-
singleton('ShortcodableParser')->register($class);
36+
singleton(ShortcodableParser::class)->register($class);
3637
}
3738
}
3839

0 commit comments

Comments
 (0)