check if attributes in url are set

This commit is contained in:
Uwe Steinmann 2023-05-02 15:57:13 +02:00
parent d48ece4a43
commit 8b7eae47d3

View File

@ -1145,15 +1145,17 @@ $(document).ready(function() {
* This currently just workѕ for attributes
*/
$allparams = $request->query->all();
foreach($allparams['attributes'] as $an=>$av) {
if(is_string($av) && $av == '__notset__') {
$tmp = explode('_', $an);
if($attrdef = $dms->getAttributeDefinition($tmp[1])) {
$dispname = $attrdef->getName();
unset($allparams['attributes'][$an]);
$newrequest = Symfony\Component\HttpFoundation\Request::create($request->getBaseUrl(), 'GET', $allparams);
$menuitems[] = array('label'=>'<i class="fa fa-remove"></i> '.$dispname.' is not set', 'link'=>$newrequest->getRequestUri(), 'attributes'=>[['title', 'Click to remove']], '_badge'=>'x');
echo '<input type="hidden" name="attributes['.$an.']" value="__notset__" />';
if(isset($allparams['attributes'])) {
foreach($allparams['attributes'] as $an=>$av) {
if(is_string($av) && $av == '__notset__') {
$tmp = explode('_', $an);
if($attrdef = $dms->getAttributeDefinition($tmp[1])) {
$dispname = $attrdef->getName();
unset($allparams['attributes'][$an]);
$newrequest = Symfony\Component\HttpFoundation\Request::create($request->getBaseUrl(), 'GET', $allparams);
$menuitems[] = array('label'=>'<i class="fa fa-remove"></i> '.$dispname.' is not set', 'link'=>$newrequest->getRequestUri(), 'attributes'=>[['title', 'Click to remove']], '_badge'=>'x');
echo '<input type="hidden" name="attributes['.$an.']" value="__notset__" />';
}
}
}
}