/** * Constructor (must stay old-named for compatibility with CBSubs GPL 3.0.0) * * @param Registry $pluginParams The parameters of the plugin * @param SimpleXMLElement $types The types definitions in XML * @param SimpleXMLElement $actions The actions definitions in XML * @param SimpleXMLElement $views The views definitions in XML * @param PluginTable $pluginObject The plugin object * @param int $tabId The tab id (if there is one) */ public function cbEditRowView($pluginParams, $types, $actions, $views, $pluginObject, $tabId = null) { global $_CB_database; $input = Application::Input(); /** @noinspection PhpDeprecationInspection */ if ($pluginParams instanceof cbParamsBase) { // Backwards-compatibility: /** @noinspection PhpDeprecationInspection */ $pluginParams = new Registry($pluginParams->toParamsArray()); } $this->registryEditView = new RegistryEditView($input, $_CB_database, $pluginParams, $types, $actions, $views, $pluginObject, $tabId); foreach (array_keys(get_object_vars($this->registryEditView)) as $k) { $this->{$k} =& $this->registryEditView->{$k}; } }
/** * loads a plugins params into memory * * @param null|int $pluginId * @param null|Registry|string $extraParams */ public function _loadParams($pluginId, $extraParams = null) { if ($pluginId === null) { $pluginId = $this->getPluginId(); } else { $pluginId = (int) $pluginId; } $plugin = $this->getPluginObject($pluginId); if ($plugin === null) { return; } $paramsBase = $this->_getPluginParamsFromTable($plugin); if ($extraParams) { if (!$extraParams instanceof Registry) { /** @noinspection PhpDeprecationInspection */ if ($extraParams instanceof cbParamsBase) { /** @noinspection PhpDeprecationInspection */ $extraParams = new Registry($extraParams->toParamsArray()); } else { $extraParams = new Registry($extraParams); } } $extraArray = $extraParams->asArray(); foreach ($extraArray as $k => $v) { $paramsBase->set($k, $v); } } $this->params = $paramsBase; }