iTx Technologies offre gratuitement
cet espace pour SugarCRM !

title

Body

[fermer]

/ -> TreeData.php (source)

   1  <?php
   2  if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
   3  /*********************************************************************************
   4   * SugarCRM is a customer relationship management program developed by
   5   * SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
   6   * 
   7   * This program is free software; you can redistribute it and/or modify it under
   8   * the terms of the GNU 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.
  13   * 
  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 General Public License for more
  17   * details.
  18   * 
  19   * You should have received a copy of the GNU 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
  22   * 02110-1301 USA.
  23   * 
  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.
  26   * 
  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 General Public License version 3.
  30   * 
  31   * In accordance with Section 7(b) of the GNU 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   ********************************************************************************/
  37   //Request object must have these property values:
  38   //        Module: module name, this module should have a file called TreeData.php
  39   //        Function: name of the function to be called in TreeData.php, the function will be called statically.
  40   //        PARAM prefixed properties: array of these property/values will be passed to the function as parameter.
  41  
  42  $ret=array();
  43  $params1=array();
  44  $nodes=array();
  45  
  46  $GLOBALS['log']->debug("TreeData:session started");
  47  $current_language = $GLOBALS['current_language'];
  48  
  49  //process request parameters. consider following parameters.
  50  //function, and all parameters prefixed with PARAM.
  51  //PARAMT_ are tree level parameters.
  52  //PARAMN_ are node level parameters.
  53  //module  name and function name parameters are the only ones consumed
  54  //by this file..
  55  foreach ($_REQUEST as $key=>$value) {
  56  
  57      switch ($key) {
  58      
  59          case "function":
  60          case "call_back_function":
  61              $func_name=$value;
  62              $params1['TREE']['function']=$value;
  63              break;
  64              
  65          default:
  66              $pssplit=explode('_',$key);
  67              if ($pssplit[0] =='PARAMT') {
  68                  unset($pssplit[0]);
  69                  $params1['TREE'][implode('_',$pssplit)]=$value;                
  70              } else {
  71                  if ($pssplit[0] =='PARAMN') {
  72                      $depth=$pssplit[count($pssplit)-1];
  73                      //parmeter is surrounded  by PARAMN_ and depth info.
  74                      unset($pssplit[count($pssplit)-1]);unset($pssplit[0]);    
  75                      $params1['NODES'][$depth][implode('_',$pssplit)]=$value;
  76                  } else {
  77                      if ($key=='module') {
  78                          if (!isset($params1['TREE']['module'])) {
  79                              $params1['TREE'][$key]=$value;    
  80                          }
  81                      } else {     
  82                          $params1['REQUEST'][$key]=$value;
  83                      }                    
  84                  }
  85              }
  86      }    
  87  }    
  88  $modulename=$params1['TREE']['module']; ///module is a required parameter for the tree.
  89  require ('include/modules.php');
  90  if (!empty($modulename) && !empty($func_name) && isset($beanList[$modulename]) ) {
  91      require_once('modules/'.$modulename.'/TreeData.php');
  92      $TreeDataFunctions = array(
  93          'ProductTemplates' => array('get_node_data'=>'','get_categories_and_products'=>''),
  94          'ProductCategories' => array('get_node_data'=>'','get_product_categories'=>''),
  95          'KBTags' => array(
  96              'get_node_data'=>'',
  97              'get_tags_nodes'=>'',
  98              'get_tags_nodes_cached'=>'',
  99              'childNodes'=>'',
 100              'get_searched_tags_nodes'=>'',
 101              'find_peers'=>'',
 102              'getRootNode'=>'',
 103              'getParentNode'=>'',
 104              'get_tags_modal_nodes'=>'',
 105              'get_admin_browse_articles'=>'',
 106              'tagged_documents_count'=>'',
 107              'tag_count'=>'',
 108              'get_browse_documents'=>'',
 109              'get_tag_nodes_for_browsing'=>'',
 110              'create_browse_node'=>'',
 111              'untagged_documents_count'=>'',
 112              'check_tag_child_tags_for_articles'=>'',
 113              'childTagsHaveArticles'=>'',
 114              ),
 115          'KBDocuments' => array(
 116              'get_node_data'=>'',
 117              'get_category_nodes'=>'',
 118              'get_documents'=>'',
 119              ),
 120          'Forecasts' => array(
 121              'get_node_data'=>'',
 122              'get_worksheet'=>'',
 123              'commit_forecast'=>'',
 124              'save_worksheet'=>'',
 125              'list_nav'=>'',
 126              'reset_worksheet'=>'',
 127              'get_chart'=>'',
 128              ),
 129          'Documents' => array(
 130              'get_node_data'=>'',
 131              'get_category_nodes'=>'',
 132              'get_documents'=>'',
 133              ),
 134          );
 135          
 136      if (isset($TreeDataFunctions[$modulename][$func_name])) {
 137          $ret=call_user_func($func_name,$params1);
 138      }
 139  }
 140  
 141  if (!empty($ret)) {
 142      echo $ret;
 143  }
 144  
 145  ?>


Generé en: Thu Mar 4 09:44:50 2010 | Cross-referenced par PHPXref 0.7