public function __construct($modx, $tv) { $this->modx = $modx; $this->tv = $tv; $this->DLTemplate = \DLTemplate::getInstance($modx); $this->fs = \Helpers\FS::getInstance(); $this->assets = \AssetsHelper::getInstance($modx); }
/** * @param $modx * @param string $lang_attribute * @param bool $debug */ public function __construct($modx, $lang_attribute = 'en', $debug = false) { $this->modx = $modx; $this->_table = $modx->getFullTableName($this->table); $this->lang_attribute = $lang_attribute; $this->params = $modx->event->params; if ($this->checkTemplate && !isset($this->params['template']) && $modx->event->name != 'OnEmptyTrash') { $this->params['template'] = array_pop($modx->getDocument($this->params['id'], 'template', 'all', 'all')); } //overload plugin and class properties $_params = $modx->parseProperties('&template=;;' . $this->params['template'] . ' &id=;;' . $this->params['id'], $modx->event->activePlugin, 'plugin'); foreach ($_params as $key => $value) { if (property_exists($this, $key)) { $this->{$key} = $value; } } $this->params = array_merge($this->params, $_params); $modx->event->_output = ""; $this->DLTemplate = \DLTemplate::getInstance($this->modx); $this->fs = \Helpers\FS::getInstance(); $this->assets = \AssetsHelper::getInstance($modx); }