'; if($firstNull) $str.=""; $count--; foreach($args['fields'] as $field) { $str .= ''; if (is_array($field)) { foreach($field as $f) $str .= $f."
"; } else { $str .= $field; } $str .= ''; } $str .= ''; $str .= 'Filtrovat'; $str .= 'Vymazat filtr'; $str .= $args['hidden']; $str .= ''; $str .= ''; /*$filtr = $args['filtr']; include_partial('global/filtr', array( 'fields' => $args['fields'], 'hidden' => $filtr->renderHiddenFields(), 'url' => $args['url']));*/ return $str; } function smartViewerHelper($args,$datas,$links = array(),$filtr = array(), $show_documents = false) { $str = ""; if(in_array("checkBox",$args[0])) $str .= "
"; $str .= ""; $str .= ""; if(!empty($filtr)) $str .= getFilter($filtr,((count($links)+count($args) - count($filtr['fields'])+1) ), in_array("checkBox",$args[0])); $str .= ""; $str .= getTitles($args,count($links),$datas[0]); $str .= ""; $str .= ""; $str .= ""; $x=0; foreach($datas as $data){ $check = $data->getId(); if(!empty($check)){ $str .=""; foreach($args as $arg){ if(!isset($arg['type'])){ if(count($arg['metoda'])>0){ foreach($arg['metoda'] as $metoda){ $view = ""; $view = sfContext::getInstance()->getUser()->getRightValue($metoda,$data); if($view !== false) break; } if($view !== false && stristr($metoda,"datum")) $view = format_date($view,"d"); if($view !== false){ $str .=""; $x++; if($show_documents) { $str .= get_component('saDocuments', 'tableSimpleList', array('object' => $data, 'colspan' => count($args)+count($links))); } } } if(in_array("checkBox",$args[0])){ $str .=""; $str .=''; $str .=""; $str .=""; } $str .= ""; $str .= "
"; } } } else { $str .= getCheckbox($data->getId(),$x,$arg); } } $str .= getButtons($links,&$data); $str .="
Označit/Odznačit vše".getActions($args[0]['actions'])."
"; if(in_array("checkBox",$args[0])) $str .= "
"; return $str; } function getActions($args){ $ret_arg = array(); foreach($args as $arg){ $ret_arg[] = ' '.$arg['title'].' '; } return implode(" | ",$ret_arg); } function getCheckbox($id,$x,$title){ return ""; } function getButtons($linkss,$data){ /* Whiski - tooltipy neřešíme. Zkouším tímto urychlit aplikaci. if(empty($toolTip)) $toolTip = sfYaml::load('../apps/zakaznik/config/toolTip.yml'); */ $str = ""; foreach($linkss as $links){ $str .= ""; foreach($links as $link){ $onClick = ""; if(!empty($link['onClick'])) $onClick = 'onclick="'.$link['onClick'].'"'; $lin = $link['url'].$data->getId(); $id = ""; if(isset($link['url_type']) && !empty($link['url_type'])) $id = $link['url_type'].$data->getId(); if(rules($link,&$data)) $str .= "".$link['title'].""; if(!rules($link,&$data)) $str .= "".$link['title'].""; /* Whiski - tooltipy neřešíme. Zkouším tímto urychlit aplikaci. if(!rules($link,&$data)) $str .= getJs($link,$toolTip,$data,$data->getId(),"_neaktivni"); if(rules($link,&$data)) $str .= getJs($link,$toolTip,$data,$data->getId(),""); */ // else $str .= $link['title']; } $str .= ""; } return $str; } function rules($link,$objekt){ if(isset($link['ruleNull']) && !empty($link['ruleNull'])){ $rule = $objekt->$link['ruleNull'](); return !empty($rule); } if(isset($link['ruleMethod']) && !empty($link['ruleMethod'])){ $rule = $objekt->$link['ruleMethod'](); return $rule; } return true; } function getTitles($args,$count,$object){ $str = ""; foreach($args as $arg){ if(!isset($arg['type'])){ foreach($arg['metoda'] as $metoda){ if(sfContext::getInstance()->getUser()->checkRight(get_class($object),$metoda) == true) $str.="".$arg['title'].""; } } else { $str .=""; } } for($i=0;$i<$count;$i++) $str .=""; return $str; } function getJs($link,$toolTip,$object,$id,$neaktivni){ $str = ""; $object = get_class($object); if(empty($link['url_type'])) $link['url_type'] = ""; if( isset($toolTip[$object][$link['url_type']]) && !empty($toolTip[$object][$link['url_type']])){ $str .= '"; } return $str; } /**/