Приветствую!
Прошу посильной помощи в адаптации модуля с 2.3 на 2.1.
Вот часть кода, которую не могу адаптировать:
<file path="admin/controller/startup/startup.php">
<operation info="Add Shortcodes to admin $registry">
<search><![CDATA[$this->registry->set('encryption']]></search>
<add position="after"><![CDATA[
// OpenCart Shortcodes
$this->registry->set('shortcodes', new Shortcodes($this->registry));
]]></add>
</operation>
</file>
<file path="catalog/controller/startup/startup.php">
<operation info="Add Shortcodes to front $registry">
<search><![CDATA[$this->registry->set('encryption']]></search>
<add position="after"><![CDATA[
// OpenCart Shortcodes
$this->registry->set('shortcodes', new Shortcodes($this->registry));
]]></add>
</operation>
</file>
<file path="catalog/controller/startup/maintenance.php">
<operation>
<search><![CDATA[function index()]]></search>
<add position="after"><![CDATA[
//========= OpenCart Shortcodes
//=== Default shortcodes
$this->load->helper('shortcodes_default');
$class = new ShortcodesDefault($this->registry);
$scDefaults = get_class_methods($class);
foreach ($scDefaults as $shortcode) {
$this->shortcodes->add_shortcode($shortcode, $class);
}
//=== Extensions shortcodes : for extensions developer
$files = glob(DIR_APPLICATION . '/view/shortcodes/*.php');
if ($files) {
foreach ($files as $file) {
require_once($file);
$file = basename($file, ".php");
$extClass = 'Shortcodes' . preg_replace('/[^a-zA-Z0-9]/', '', $file);
$class = new $extClass($this->registry);
$scExtensions = get_class_methods($class);
foreach ($scExtensions as $shortcode) {
$this->shortcodes->add_shortcode($shortcode, $class);
}
}
}
//--------------- OLD theme OpenCart 2 compatible
$theme = $this->config->get('config_theme');
if ($this->config->get('config_theme') == 'theme_default') {
$theme = $this->config->get('theme_default_directory');
}
//=== Themes shortcodes : for theme developer
$file = DIR_TEMPLATE . $theme . '/shortcodes_theme.php';
if (file_exists($file)) {
require_once($file);
$class = new ShortcodesTheme($this->registry);
$scThemes = get_class_methods($class);
foreach ($scThemes as $shortcode) {
$this->shortcodes->add_shortcode($shortcode, $class);
}
}
$this->event->trigger('shortcodes/themes/after', array(&$data));
//=== Custom shortcodes : user power!
$file = DIR_TEMPLATE . $theme . '/shortcodes_custom.php';
if (file_exists($file)) {
require_once($file);
$class = new ShortcodesCustom($this->registry);
$scCustom = get_class_methods($class);
foreach ($scCustom as $shortcode) {
$this->shortcodes->add_shortcode($shortcode, $class);
}
}
//========= End:: OpenCart Shortcodes
]]></add>
</operation>
</file>
В 2.1 нет startup