Skip to content

Commit

Permalink
Fix #1869
Browse files Browse the repository at this point in the history
  • Loading branch information
aembler committed Jan 30, 2015
1 parent 62536f0 commit 0a6c2cc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/concrete/blocks/image_slider/composer.php
@@ -1,3 +1,3 @@
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('form_setup_html.php', array('view' => $view));
$view->inc('form_setup_html.php', array('view' => $view));
5 changes: 5 additions & 0 deletions web/concrete/blocks/image_slider/controller.php
Expand Up @@ -60,6 +60,11 @@ public function edit()
$this->set('rows', $query);
}

public function composer()
{
$this->edit();
}

public function registerViewAssets()
{
$this->requireAsset('javascript', 'jquery');
Expand Down
17 changes: 14 additions & 3 deletions web/concrete/src/Page/Type/Composer/Control/BlockControl.php
Expand Up @@ -20,6 +20,7 @@ class BlockControl extends Control
protected $ptComposerControlTypeHandle = 'block';
protected $bt = false;
protected $b = false;
protected $controller;

public function setBlockTypeID($btID)
{
Expand Down Expand Up @@ -178,6 +179,15 @@ public function addToPageTypeComposerFormLayoutSet(PageTypeComposerFormLayoutSet
return $layoutSetControl;
}

protected function getController($obj)
{
if (!isset($this->controller)) {
$this->controller = $obj->getController();
$this->controller->setupAndRun('composer');
}
return $this->controller;
}

public function render($label, $customTemplate, $description)
{
$obj = $this->getPageTypeComposerControlDraftValue();
Expand All @@ -191,8 +201,7 @@ public function render($label, $customTemplate, $description)
$obj = $this->getBlockTypeObject();
}

$cnt = $obj->getController();
$cnt->setupAndRun('composer');
$this->getController($obj);

$env = Environment::get();
$form = Loader::helper('form');
Expand Down Expand Up @@ -224,7 +233,9 @@ public function inc($file, $args = array())
$obj = $this->getBlockTypeObject();
}
}
$controller = $obj->getController();

$controller = $this->getController($obj);

extract($controller->getSets());
extract($controller->getHelperObjects());
$label = $this->getPageTypeComposerFormLayoutSetControlObject()->getPageTypeComposerControlDisplayLabel();
Expand Down

0 comments on commit 0a6c2cc

Please sign in to comment.