$this->href= $f3->get('SITE_URL').str_replace($f3->get('CONTENT'),"",$this->config['path']); | $this->href= $f3->get('SITE_URL').str_replace($f3->get('CONTENT'),"",$this->config['path']); | ||||
foreach ($this->keys as $k=>$v) { | foreach ($this->keys as $k=>$v) { | ||||
$this->values[$v] = $keys[$k]; | |||||
if (array_key_exists($k, $keys)) { | |||||
$this->values[$v] = $keys[$k]; | |||||
} else { | |||||
$this->values[$v] = ''; | |||||
} | |||||
} | } | ||||
$ke = explode("/",$this->config['path']); | $ke = explode("/",$this->config['path']); |
} | } | ||||
break; | break; | ||||
case 'CE': | |||||
switch($request[1]) { | |||||
case 'publication': | |||||
$CE = new \Modules\CPublication($this->config,['path'=>$this->folder]); | |||||
if(count($request)>2) { | |||||
$CE->set_layout($request[2]); | |||||
} | |||||
$new = $CE; | |||||
break; | |||||
} | |||||
break; | |||||
case 'TOC': | case 'TOC': | ||||
// throw away TOC part of request, we don't need it | // throw away TOC part of request, we don't need it | ||||
array_shift($request); | array_shift($request); | ||||
$toc = new \Modules\TOC($request,$this->folder,$body); | $toc = new \Modules\TOC($request,$this->folder,$body); | ||||
$toc->dispatch(); | $toc->dispatch(); | ||||
$new=sprintf("<div class=\"TOC %s\">%s</div>", | $new=sprintf("<div class=\"TOC %s\">%s</div>", | ||||
array_shift($request), | array_shift($request), | ||||
$toc); | $toc); |
case 'concerts': | case 'concerts': | ||||
$this->load('\Modules\CConcert'); | $this->load('\Modules\CConcert'); | ||||
break; | break; | ||||
case 'publication': | |||||
case 'publications': | |||||
$this->load('\Modules\CPublication'); | |||||
break; | |||||
} | } | ||||
} | } | ||||
function apply_filters() { | function apply_filters() { | ||||
foreach($this->elements as $k=>$v) { | foreach($this->elements as $k=>$v) { | ||||
$show = true; | $show = true; | ||||
if (count($this->filters['must_have'])) { | |||||
if (array_key_exists('must_have', $this->filters) && count($this->filters['must_have'])) { | |||||
$show = false; | $show = false; | ||||
foreach ($this->filters['must_have'] as $l=>$w) { | foreach ($this->filters['must_have'] as $l=>$w) { | ||||
$ke = array_keys($w); | $ke = array_keys($w); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (count($this->filters['must_not_have'])) { | |||||
if (array_key_exists('must_not_have', $this->filters) && count($this->filters['must_not_have'])) { | |||||
foreach ($this->filters['must_not_have'] as $l=>$w) { | foreach ($this->filters['must_not_have'] as $l=>$w) { | ||||
$ke = array_keys($w); | $ke = array_keys($w); | ||||
$key = $ke[0]; | $key = $ke[0]; |
</div> | </div> | ||||
</check> | </check> | ||||
<check if="{{ @logo }}"> | |||||
<check if="{{ isset(@logo) }}"> | |||||
<true> | <true> | ||||
<a href="{{ @SITE_URL }}/"><h1> | <a href="{{ @SITE_URL }}/"><h1> | ||||
<img src="/{{ @logo }}" alt="{{ @title }}" /> | <img src="/{{ @logo }}" alt="{{ @title }}" /> |