acympluginHelper = acym_get('helper.plugin');
$this->pluginsPath = acym_getPluginsPath(__FILE__, __DIR__);
}
protected function getFilteringZone($categoryFilter = true)
{
$result = '
';
if ($categoryFilter) $result .= $this->getCategoryFilter();
$result .= '
';
return $result;
}
protected function getCategoryFilter()
{
$filter_cat = acym_getVar('int', 'plugin_category', 0);
$this->cats = [];
if (!empty($this->categories)) {
foreach ($this->categories as $oneCat) {
$this->cats[$oneCat->parent_id][] = $oneCat;
}
}
$this->catvalues = [];
$this->catvalues[] = acym_selectOption(0, acym_translation('ACYM_ALL'));
$this->handleChildrenCategories($this->rootCategoryId);
return acym_select($this->catvalues, 'plugin_category', intval($filter_cat), 'class="plugin_category_select"', 'value', 'text');
}
protected function handleChildrenCategories($parent_id, $level = 0)
{
if (empty($this->cats[$parent_id])) return;
foreach ($this->cats[$parent_id] as $cat) {
$this->catvalues[] = acym_selectOption($cat->id, str_repeat(" - - ", $level).$cat->title);
$this->handleChildrenCategories($cat->id, $level + 1);
}
}
protected function getElementsListing($options)
{
$listing = '';
return $listing;
}
protected function getCategoryListing()
{
$listing = '';
if (empty($this->catvalues)) return $listing;
$listing .= '';
return $listing;
}
protected function finalizeCategoryFormat($name, $elements, $parameter)
{
if (empty($elements)) return '';
$customLayout = ACYM_MEDIA.'plugins'.DS.$name.'_auto.php';
if (file_exists($customLayout)) {
ob_start();
require $customLayout;
return ob_get_clean();
}
$arrayElements = [];
unset($parameter->id);
foreach ($elements as $oneElementId) {
$args = [];
$args[] = $name.':'.$oneElementId;
foreach ($parameter as $oneParam => $val) {
if (is_bool($val)) {
$args[] = $oneParam;
} else {
$args[] = $oneParam.':'.$val;
}
}
$arrayElements[] = '{'.implode('|', $args).'}';
}
return $this->acympluginHelper->getFormattedResult($arrayElements, $parameter);
}
protected function finalizeElementFormat($name, $result, $options, $data)
{
if (file_exists(ACYM_MEDIA.'plugins'.DS.$name.'.php')) {
ob_start();
require(ACYM_MEDIA.'plugins'.DS.$name.'.php');
$result = ob_get_clean();
$result = str_replace(array_keys($data), $data, $result);
}
return $this->acympluginHelper->managePicts($options, $result);
}
}