how retrieve the cvalID (collectionVersionAreaLayout) from a view

Permalink
Hi,

Is it possible to have the cvalID from a block controller or block view to know witch class is the parent div wrapper (ccm-layout-wrapper-5)

I see in the layout.php:
//position and cvalID are properties of the collectionVersionAreaLayout join, set when being loaded for an area, not with layout object itself


I think that a need to take first the blockID to have the layoutID to finnally take the collectionLayoutVersionID ?

Thanks a lot.

Seb

sebastienj
 
sebastienj replied on at Permalink Reply
sebastienj
Anybody ?

I think that i need to :

$page = Page::getCurrentPage();
$thisArHandle = How can i retrieve it?
$a = Area::get($page, $thisArHandle);
.. and after find the $layoutPreset to find the Collection Version Area Layout ?

I'm swimming..
sebastienj replied on at Permalink Reply
sebastienj
From a blockView i have :
$this->area is the area object. But i really don't find how retrieve the layout object !
synlag replied on at Permalink Reply
synlag
just took a quick look.

should work with model custom_style.php
sebastienj replied on at Permalink Reply
sebastienj
I don't find there any things about layout.

I want to create a db query..
i have :
- arHandle
- cID
- cvID

but i miss :

- layoutID

mmm
synlag replied on at Permalink Reply
synlag
Loader::model('layout');
$layouts = LayoutPresets::getList();
$layoutIDs = array();
foreach($layouts as $layout) $layoutIDs[$layout->getLayoutPresetName()] = $layout->getLayoutID();


this might be a start...

btw, pls make more use of phpDOCS, thx
sebastienj replied on at Permalink Reply
sebastienj
I has and i'm searching in the docs!.. since yesterday morning..

I try your way since a blockView but a var_dump($layouts); return a array(0) { }

and when i try to edit the layout i have a fatal error :

Fatal error: Call to a member function getAreaHandle() on a non-object in /Applications/MAMP/htdocs/geomedia/concrete/tools/edit_area_popup.php on line 27

i'm really sorry for that.
synlag replied on at Permalink Reply
synlag
the phpDOCS was meant to the core php models, sry
synlag replied on at Permalink Reply
synlag
for an area there exists

$area_layouts = myarea->getAreaLayouts(Page::getCurrentPage());
sebastienj replied on at Permalink Reply
sebastienj
already tested the
var_dump($this->area->getAreaLayouts(Page::getCurrentPage()) );
but
array(0) { } too

cause
the function need the strict arHandle name ('Main') and not 'Main : Layout 1 : Cell 1'.

So i can clean the arHandle with a pregMatch or other but it's not a strong way..
sebastienj replied on at Permalink Reply
sebastienj
From a blockView this code can take all the layout from this area.

$ar = $this->area->getAreaHandle();
if ( ($areaN = strpos($ar,' :')) !== false) {
   $areaHandle =  substr($ar, 0, $areaN);   
} else {
   $areaHandle = $ar;
}
$db = Loader::db();
$vals = array( intval($this->c->cID), $this->c->getVersionID(), $areaHandle );
$sql = 'SELECT * FROM CollectionVersionAreaLayouts WHERE cID=? AND cvID=? AND arHandle=? ORDER BY position ASC, cvalID ASC';
$CollectionVersionAreaLayouts = $db->getArray($sql,$vals);


So now, impossible to retrieve the position or the areaNameNumber !

I think that nobody need that, so it's only for information.
sebastienj replied on at Permalink Reply
sebastienj
I think it's now impossible to know the cvalID from a blockView.

Is the core can confirm that ?