Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function ProcessSubPanelListView($xTemplatePath, &$mod_strings)
- {
- global $app_strings;
- global $image_path;
- global $current_user;
- global $sugar_config;
- if(isset($this->listview)){
- $ListView =& $this->listview;
- }else{
- $ListView = new ListView();
- }
- $ListView->initNewXTemplate($xTemplatePath,$this->subpanel_defs->mod_strings);
- $ListView->xTemplateAssign("RETURN_URL", "&return_module=".$this->parent_module."&return_action=DetailView&return_id=".$this->parent_bean->id);
- $ListView->xTemplateAssign("RELATED_MODULE", $this->parent_module); // TODO: what about unions?
- $ListView->xTemplateAssign("RECORD_ID", $this->parent_bean->id);
- $ListView->xTemplateAssign("EDIT_INLINE_PNG", get_image($image_path.'edit_inline','align="absmiddle" alt="'.$app_strings['LNK_EDIT'].'" border="0"'));
- $ListView->xTemplateAssign("DELETE_INLINE_PNG", get_image($image_path.'delete_inline','align="absmiddle" alt="'.$app_strings['LNK_DELETE'].'" border="0"'));
- $ListView->xTemplateAssign("REMOVE_INLINE_PNG", get_image($image_path.'delete_inline','align="absmiddle" alt="'.$app_strings['LNK_REMOVE'].'" border="0"'));
- $header_text= '';
- if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace']))
- {
- $exploded = explode('/', $xTemplatePath);
- $file_name = $exploded[sizeof($exploded) - 1];
- $mod_name = $exploded[sizeof($exploded) - 2];
- $header_text= " <a href='index.php?action=index&module=DynamicLayout&from_action=$file_name&from_module=$mod_name&mod_lang="
- .$_REQUEST['module']."'>".get_image($image_path."EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>";
- }
- $ListView->setHeaderTitle('');
- $ListView->setHeaderText('');
- ob_start();
- $ListView->is_dynamic = true;
- $ListView->records_per_page = $sugar_config['list_max_entries_per_subpanel'] + 0;
- $ListView->start_link_wrapper = "javascript:showSubPanel('".$this->subpanel_id."','";
- $ListView->subpanel_id = $this->subpanel_id;
- $ListView->end_link_wrapper = "',true);";
- $where = '';
- $ListView->setQuery($where, '', '', '');
- $ListView->show_export_button = false;
- //function returns the query that was used to populate sub-panel data.
- $query=$ListView->process_dynamic_listview($this->parent_module, $this->parent_bean,$this->subpanel_defs);
- $this->subpanel_query=$query;
- $ob_contents = ob_get_contents();
- ob_end_clean();
- return $ob_contents;
- }
- ?>
Add Comment
Please, Sign In to add comment