mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 18:02:18 +00:00
- Better code in NavigationMenuWidget::printNavItem
- Custom filters are now loaded in InfoCenter - filter_kurzbz is automatically generated - Now is saved the filter description - filter description is the same for every language - Added method getCustomFiltersList to system/Filters_model.php
This commit is contained in:
@@ -816,10 +816,17 @@ class FilterWidget extends Widget
|
||||
}
|
||||
}
|
||||
|
||||
$desc = $_POST['customFilterDescription'];
|
||||
$descPGArray = '{"'.$desc.'", "'.$desc.'", "'.$desc.'", "'.$desc.'"}';
|
||||
|
||||
$resultBenutzer = $this->BenutzerModel->load(getAuthUID());
|
||||
$personId = $resultBenutzer->retval[0]->person_id;
|
||||
|
||||
$result = $this->FiltersModel->loadWhere(array(
|
||||
'app' => $this->app,
|
||||
'dataset_name' => $this->datasetName,
|
||||
'filter_kurzbz' => $_POST['customFilterKurzbz']
|
||||
'description' => $descPGArray,
|
||||
'person_id' => $personId
|
||||
));
|
||||
|
||||
if (hasData($result))
|
||||
@@ -828,35 +835,27 @@ class FilterWidget extends Widget
|
||||
array(
|
||||
'app' => $this->app,
|
||||
'dataset_name' => $this->datasetName,
|
||||
'filter_kurzbz' => $_POST['customFilterKurzbz']
|
||||
'description' => $descPGArray,
|
||||
'person_id' => $personId
|
||||
),
|
||||
array(
|
||||
'description' => '{}',
|
||||
'sort' => null,
|
||||
'default_filter' => false,
|
||||
'filter' => json_encode($objToBeSaved),
|
||||
'oe_kurzbz' => null
|
||||
'filter' => json_encode($objToBeSaved)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->BenutzerModel->load(getAuthUID());
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->FiltersModel->insert(array(
|
||||
'app' => $this->app,
|
||||
'dataset_name' => $this->datasetName,
|
||||
'filter_kurzbz' => $_POST['customFilterKurzbz'],
|
||||
'person_id' => $result->retval[0]->person_id,
|
||||
'description' => '{}',
|
||||
'sort' => null,
|
||||
'default_filter' => false,
|
||||
'filter' => json_encode($objToBeSaved),
|
||||
'oe_kurzbz' => null
|
||||
));
|
||||
}
|
||||
$this->FiltersModel->insert(array(
|
||||
'app' => $this->app,
|
||||
'dataset_name' => $this->datasetName,
|
||||
'filter_kurzbz' => uniqid($personId, true),
|
||||
'person_id' => $personId,
|
||||
'description' => $descPGArray,
|
||||
'sort' => null,
|
||||
'default_filter' => false,
|
||||
'filter' => json_encode($objToBeSaved),
|
||||
'oe_kurzbz' => null
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,26 @@ class NavigationMenuWidget extends Widget
|
||||
public static function printNavItem($item, $depth = 1)
|
||||
{
|
||||
$expanded = isset($item['expand']) && $item['expand'] === true ? ' active' : '';
|
||||
echo '<li class="'.$expanded.'">
|
||||
<a href="'.$item['link'].'"'.$expanded.'>'.(isset($item['icon']) ? '<i class="fa fa-'.$item['icon'].' fa-fw"></i> ' : '').$item['description'].(!empty($item['children']) ? '<span class="fa arrow"></span>':'').'</a>';
|
||||
|
||||
echo '<li class="'.$expanded.'">';
|
||||
|
||||
echo '<a href="'.$item['link'].'"'.$expanded.'>';
|
||||
|
||||
if (isset($item['icon']))
|
||||
{
|
||||
echo '<i class="fa fa-'.$item['icon'].' fa-fw"></i> ';
|
||||
}
|
||||
|
||||
// echo '<span>'.$item['description'].'</span>'.'<span style="">test</span>';
|
||||
echo $item['description'];
|
||||
|
||||
if (!empty($item['children']))
|
||||
{
|
||||
echo '<span class="fa arrow"></span>';
|
||||
}
|
||||
|
||||
echo '</a>';
|
||||
|
||||
if (!empty($item['children']))
|
||||
{
|
||||
$level = '';
|
||||
@@ -53,6 +71,7 @@ class NavigationMenuWidget extends Widget
|
||||
self::printNavItem($child, ++$depth);
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
echo '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user