/
MultilingualProcessorTarget.php
44 lines (36 loc) · 1.13 KB
/
MultilingualProcessorTarget.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace Concrete\Core\Multilingual\Page\Section\Processor;
use Concrete\Core\Foundation\Processor\TargetInterface;
use Concrete\Core\Multilingual\Page\Section\Section;
use Concrete\Core\Page\Stack\StackList;
defined('C5_EXECUTE') or die("Access Denied.");
class MultilingualProcessorTarget implements TargetInterface
{
protected $section;
public function __construct(Section $section)
{
$this->section = $section;
}
/**
* @return Section
*/
public function getSection()
{
return $this->section;
}
public function getItems()
{
$pages = $this->section->populateRecursivePages(array(), array(
'cID' => $this->section->getCollectionID(), ),
$this->section->getCollectionParentID(), 0, false
);
// Add in all the stack pages found for the current locale.
$list = new StackList();
$list->filterByLanguageSection($this->getSection());
$results = $list->get();
foreach ($results as $result) {
$pages[] = array('cID' => $result->getCollectionID());
}
return $pages;
}
}