Guest User

Untitled

a guest
Jun 19th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. <?php
  2.  
  3. function ProcessSubPanelListView($xTemplatePath, &$mod_strings)
  4. {
  5.  
  6. global $app_strings;
  7. global $image_path;
  8. global $current_user;
  9. global $sugar_config;
  10.  
  11. if(isset($this->listview)){
  12. $ListView =& $this->listview;
  13. }else{
  14. $ListView = new ListView();
  15. }
  16. $ListView->initNewXTemplate($xTemplatePath,$this->subpanel_defs->mod_strings);
  17. $ListView->xTemplateAssign("RETURN_URL", "&return_module=".$this->parent_module."&return_action=DetailView&return_id=".$this->parent_bean->id);
  18. $ListView->xTemplateAssign("RELATED_MODULE", $this->parent_module); // TODO: what about unions?
  19. $ListView->xTemplateAssign("RECORD_ID", $this->parent_bean->id);
  20. $ListView->xTemplateAssign("EDIT_INLINE_PNG", get_image($image_path.'edit_inline','align="absmiddle" alt="'.$app_strings['LNK_EDIT'].'" border="0"'));
  21. $ListView->xTemplateAssign("DELETE_INLINE_PNG", get_image($image_path.'delete_inline','align="absmiddle" alt="'.$app_strings['LNK_DELETE'].'" border="0"'));
  22. $ListView->xTemplateAssign("REMOVE_INLINE_PNG", get_image($image_path.'delete_inline','align="absmiddle" alt="'.$app_strings['LNK_REMOVE'].'" border="0"'));
  23. $header_text= '';
  24.  
  25. if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace']))
  26. {
  27. $exploded = explode('/', $xTemplatePath);
  28. $file_name = $exploded[sizeof($exploded) - 1];
  29. $mod_name = $exploded[sizeof($exploded) - 2];
  30. $header_text= "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action=$file_name&from_module=$mod_name&mod_lang="
  31. .$_REQUEST['module']."'>".get_image($image_path."EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>";
  32. }
  33. $ListView->setHeaderTitle('');
  34. $ListView->setHeaderText('');
  35.  
  36. ob_start();
  37.  
  38. $ListView->is_dynamic = true;
  39. $ListView->records_per_page = $sugar_config['list_max_entries_per_subpanel'] + 0;
  40. $ListView->start_link_wrapper = "javascript:showSubPanel('".$this->subpanel_id."','";
  41. $ListView->subpanel_id = $this->subpanel_id;
  42. $ListView->end_link_wrapper = "',true);";
  43.  
  44. $where = '';
  45. $ListView->setQuery($where, '', '', '');
  46. $ListView->show_export_button = false;
  47.  
  48. //function returns the query that was used to populate sub-panel data.
  49. $query=$ListView->process_dynamic_listview($this->parent_module, $this->parent_bean,$this->subpanel_defs);
  50. $this->subpanel_query=$query;
  51. $ob_contents = ob_get_contents();
  52. ob_end_clean();
  53. return $ob_contents;
  54. }
  55.  
  56. ?>
Add Comment
Please, Sign In to add comment