_config.php file which holds options used by the tcpdf. */ // function _loadConfig(&$sugarpdf, $type){ //// $sugarpdf_config_custom = array(); //// $sugarpdf_config_module = array(); //// $sugarpdf_config_root_cstm = array(); //// $sugarpdf_config_root = array(); //// $sugarpdf_config_app = array(); // $config_file_name = 'sugarpdf.'.$type.'.config.php'; // //echo '
'.$config_file_name.'
'; // //$sugarpdf_config = sugar_cache_retrieve("SUGARPDF_CONFIG_FILE_".$sugarpdf->module."_TYPE_".$type); // if(!$sugarpdf_config){ // if(file_exists('custom/modules/'.$sugarpdf->module.'/sugarpdf/'.$config_file_name)){ // require_once('custom/modules/'.$sugarpdf->module.'/sugarpdf/'.$config_file_name); // } // if(file_exists('modules/'.$sugarpdf->module.'/sugarpdf/'.$config_file_name)){ // require_once('modules/'.$sugarpdf->module.'/sugarpdf/'.$config_file_name); // } // if(file_exists('custom/include/Sugarpdf/sugarpdf/'.$config_file_name)){ // require_once('custom/include/Sugarpdf/sugarpdf/'.$config_file_name); // } // if(file_exists('include/Sugarpdf/sugarpdf/'.$config_file_name)){ // require_once('include/Sugarpdf/sugarpdf/'.$config_file_name); // } // if(file_exists('include/Sugarpdf/sugarpdf/sugarpdf.config.php')){ // require_once('include/Sugarpdf/sugarpdf/sugarpdf.config.php'); // } // } // // } /** * This is a private function which just helps the getSugarpdf function generate the * proper Tcpdf object * * @return a valid Sugarpdf */ function _buildFromFile($file, &$bean, $sugarpdf_object_map, $type, $module){ require_once($file); //try ModuleSugarpdfType first then try SugarpdfType if that fails then use Sugarpdf $class = ucfirst($module).'Sugarpdf'.ucfirst($type); if(!class_exists($class)){ $class = 'Sugarpdf'.ucfirst($type); if(!class_exists($class)){ return new Sugarpdf($bean, $sugarpdf_object_map); } } return SugarpdfFactory::_buildClass($class, $bean, $sugarpdf_object_map); } /** * instantiate the correct Tcpdf and call init to pass on any obejcts we need to * from the controller. * * @param string class - the name of the class to instantiate * @param object bean = the bean to pass to the Sugarpdf * @param array Sugarpdf_object_map - the array which holds obejcts to pass between the * controller and the tcpdf. * * @return Sugarpdf */ function _buildClass($class, &$bean, $sugarpdf_object_map){ $sugarpdf = new $class($bean, $sugarpdf_object_map); //$sugarpdf->init($bean, $sugarpdf_object_map); if($sugarpdf instanceof Sugarpdf){ return $sugarpdf; }else return new Sugarpdf($bean, $sugarpdf_object_map); } } ?>