diff --git a/assets/plugins/systemField.js.inc b/assets/plugins/systemField.js.inc new file mode 100644 index 0000000..10df3af --- /dev/null +++ b/assets/plugins/systemField.js.inc @@ -0,0 +1,108 @@ + + + diff --git a/install/assets/plugins/systemField_plugin.tpl b/install/assets/plugins/systemField_plugin.tpl index 20af548..caf83b1 100644 --- a/install/assets/plugins/systemField_plugin.tpl +++ b/install/assets/plugins/systemField_plugin.tpl @@ -24,130 +24,22 @@ Configurtion: */ defined('IN_MANAGER_MODE') or die(); +if ($modx->event->name !== 'OnDocFormRender') return; if(empty($separator)) $separator = ''; if(empty($open_text)) $open_text = 'system content'; -if(empty($position)) $position = 'after'; - -$get_action = isset($_GET['a']) ? $_GET['a'] : 27; - -$e = &$modx->Event; - -if ($e->name == 'OnDocFormRender') { - -$output = <<< OUT - - - - - -OUT; - -$e->output($output); - +if(empty($position)) $position = 'after'; + +$ph['separator'] = $separator; +$ph['open_text'] = $open_text; +$ph['position'] = $position; +$ph['get_action'] = isset($_GET['a']) ? $_GET['a'] : 27;; +$output = file_get_contents(MODX_BASE_PATH . 'assets/plugins/systemField/systemField.js.inc'); + +foreach($ph as $k=>$v) +{ + $k = "[+{$k}+]"; + $output = str_replace($k,$v,$output); } + +$modx->event->output($output);