2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM Community Edition is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Affero General Public License version 3 as published by the
9 * Free Software Foundation with the addition of the following permission added
10 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19 * You should have received a copy of the GNU Affero General Public License along with
20 * this program; if not, see http://www.gnu.org/licenses or write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27 * The interactive user interfaces in modified source and object code versions
28 * of this program must display Appropriate Legal Notices, as required under
29 * Section 5 of the GNU Affero General Public License version 3.
31 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32 * these Appropriate Legal Notices must retain the display of the "Powered by
33 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34 * technical reasons, the Appropriate Legal Notices must display the words
35 * "Powered by SugarCRM".
36 ********************************************************************************/
38 //Request object must have these property values:
39 // Module: module name, this module should have a file called TreeData.php
40 // Function: name of the function to be called in TreeData.php, the function will be called statically.
41 // PARAM prefixed properties: array of these property/values will be passed to the function as parameter.
47 $GLOBALS['log']->debug("TreeData:session started");
48 $current_language = $GLOBALS['current_language'];
50 //process request parameters. consider following parameters.
51 //function, and all parameters prefixed with PARAM.
52 //PARAMT_ are tree level parameters.
53 //PARAMN_ are node level parameters.
54 //module name and function name parameters are the only ones consumed
56 foreach ($_REQUEST as $key=>$value) {
61 case "call_back_function":
63 $params1['TREE']['function']=$value;
67 $pssplit=explode('_',$key);
68 if ($pssplit[0] =='PARAMT') {
70 $params1['TREE'][implode('_',$pssplit)]=$value;
72 if ($pssplit[0] =='PARAMN') {
73 $depth=$pssplit[count($pssplit)-1];
74 //parmeter is surrounded by PARAMN_ and depth info.
75 unset($pssplit[count($pssplit)-1]);unset($pssplit[0]);
76 $params1['NODES'][$depth][implode('_',$pssplit)]=$value;
79 if (!isset($params1['TREE']['module'])) {
80 $params1['TREE'][$key]=$value;
83 $params1['REQUEST'][$key]=$value;
89 $modulename=$params1['TREE']['module']; ///module is a required parameter for the tree.
90 require('include/modules.php');
91 if (!empty($modulename) && !empty($func_name) && isset($beanList[$modulename]) ) {
92 require_once('modules/'.$modulename.'/TreeData.php');
93 $TreeDataFunctions = array(
94 'ProductTemplates' => array('get_node_data'=>'','get_categories_and_products'=>''),
95 'ProductCategories' => array('get_node_data'=>'','get_product_categories'=>''),
99 'get_tags_nodes_cached'=>'',
101 'get_searched_tags_nodes'=>'',
105 'get_tags_modal_nodes'=>'',
106 'get_admin_browse_articles'=>'',
107 'tagged_documents_count'=>'',
109 'get_browse_documents'=>'',
110 'get_tag_nodes_for_browsing'=>'',
111 'create_browse_node'=>'',
112 'untagged_documents_count'=>'',
113 'check_tag_child_tags_for_articles'=>'',
114 'childTagsHaveArticles'=>'',
116 'KBDocuments' => array(
118 'get_category_nodes'=>'',
121 'Forecasts' => array(
124 'commit_forecast'=>'',
125 'save_worksheet'=>'',
127 'reset_worksheet'=>'',
130 'Documents' => array(
132 'get_category_nodes'=>'',
137 if (isset($TreeDataFunctions[$modulename][$func_name])) {
138 $ret=call_user_func($func_name,$params1);