Exemplo n.º 1
0
/**
 * Set document protection (available are: copy, print, modify, annot-forms. Seperate with a coma) 
 */
defineFromConfig("PDF_PROTECTION", $sugarpdf_default["PDF_PROTECTION"]);
/**
 * User password to view the document. If empty no password
 */
defineFromConfig("PDF_USER_PASSWORD", $sugarpdf_default["PDF_USER_PASSWORD"]);
/**
 * master password to get full access.
 */
defineFromConfig("PDF_OWNER_PASSWORD", $sugarpdf_default["PDF_OWNER_PASSWORD"]);
/**
 * Default ACL access value for the generation of a PDF (detail, list, edit, export)
 */
defineFromConfig("PDF_ACL_ACCESS", $sugarpdf_default["PDF_ACL_ACCESS"]);
/**
 * Available encoding tables when adding a new font
 */
define("PDF_ENCODING_TABLE_LIST", $sugarpdf_default["PDF_ENCODING_TABLE_LIST"]);
/**
 * Available encoding tables when adding a new font (Label)
 */
define("PDF_ENCODING_TABLE_LABEL_LIST", $sugarpdf_default["PDF_ENCODING_TABLE_LABEL_LIST"]);
if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
    define("K_TCPDF_EXTERNAL_CONFIG", true);
}
/**
 * Function to define a sugarpdf seeting from the admin application settings (config table).
 * This function use the default value if there is nothing in the table.
 * @param $value    settings to search
/**
 * 
 */
defineFromConfig("PDF_PROTECTION", "");
/**
 * 
 */
defineFromConfig("PDF_USER_PASSWORD", "");
/**
 * 
 */
defineFromConfig("PDF_OWNER_PASSWORD", "");
/**
 * 
 */
defineFromConfig("PDF_ACL_ACCESS", "detail");
define("K_TCPDF_EXTERNAL_CONFIG", true);
/**
 * Function to define a sugarpdf seeting from the admin application settings (config table).
 * This function use the default value if there is nothing in the table.
 * @param $value    settings to search
 * @param $default  default value
 */
function defineFromConfig($value, $default)
{
    $lowerValue = strtolower($value);
    require_once "modules/Administration/Administration.php";
    $focus = new Administration();
    $focus->retrieveSettings();
    if (isset($focus->settings["sugarpdf_" . $lowerValue])) {
        define($value, $focus->settings["sugarpdf_" . $lowerValue]);