Commit fc8c18e1 authored by Nigel McNie's avatar Nigel McNie
Browse files

Add $viewconfig parameter to import_create_blockinstance, rename the other parameter.



We pass through the view config as well so that the importing methods
can look at the view owner, among other things it might want to look at.
Signed-off-by: default avatarNigel McNie <nigel@catalyst.net.nz>
parent 4b7e07bb
......@@ -314,26 +314,19 @@ abstract class PluginBlocktype extends Plugin {
/**
* Creates a block instance from a given configuration.
*
* The configuration is whatever was generated by {@link
* export_blockinstance_config()}. This method doesn't have to worry about
* The configuration is whatever was generated by {@link
* export_blockinstance_config()}. This method doesn't have to worry about
* setting the block title, or the position in the View.
*
* @param array $config The config to use to create the blockinstance
* @param array $biconfig The config to use to create the blockinstance
* @param array $viewconfig The configuration for the view being imported
* @return BlockInstance The new block instance
*/
public static function import_create_blockinstance(array $config) {
// TODO: a default implementation might just create a new blockinstance
// with the config shunted into configdata - but with artefactids
// replaced with new ones
//
// TODO: unsetting these for now, will want them to be references to
// artefacts in the export
unset($config['config']['artefactid']);
if (isset($config['config']['artefactids'])) $config['config']['artefactids'] = array();
public static function import_create_blockinstance(array $biconfig, array $viewconfig) {
$bi = new BlockInstance(0,
array(
'blocktype' => $config['type'],
'configdata' => $config['config'],
'blocktype' => $biconfig['type'],
'configdata' => $biconfig['config'],
)
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment