Changeset 16420

Show
Ignore:
Timestamp:
05/21/08 11:34:41 (5 months ago)
Author:
rambo
Message:

definition hp 3.1 gives notices when using config aliases, vain attempt to get it to believe that we really do want to use our specific config dir

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/MidCOM_2_8/midcom.helper.datamanager2/config/config.inc

    r14808 r16420  
    2222         */  
    2323        'DefinitionID' => 'DM2 Default definition set',  
    24         'DefinitionRev' => 1
     24        'DefinitionRev' => 2
    2525        /* NOTE: You must use transitional doctype if you want to use <a name> (see html_purify_HTMLDefinition below) */ 
    2626        'Doctype' => 'XHTML 1.0 Transitional', 
    2727        'TidyLevel' => 'light', 
    28         'EnableAttrID' => true, 
    2928    ), 
    3029    'Attr' => array 
     
    3736            '_top', 
    3837        ), 
     38        'EnableID' => true, 
    3939    ), 
    4040    'Cache' => array 
    4141    ( 
    4242        'SerializerPath' => $GLOBALS['midcom_config']['cache_base_directory'] . 'htmlpurifier', 
     43        /* Disable cache while testing 
     44        'DefinitionImpl' => null, 
     45        */ 
    4346    ), 
    44     /* do not cache definitions while testing 
    45     'Core' => array 
    46     ( 
    47         'DefinitionCache' => null, 
    48     ), 
    49     */ 
    5047), 
    5148'html_purify_HTMLDefinition' => array 
  • branches/MidCOM_2_8/midcom.helper.datamanager2/type/text.php

    r16399 r16420  
    9999    function purify_content() 
    100100    { 
    101         if (isset($this->purify_config['Cache']['SerializerPath'])  
     101        if (   isset($this->purify_config['Cache']['SerializerPath'])  
    102102            && !file_exists($this->purify_config['Cache']['SerializerPath'])) 
    103103        { 
     
    109109        error_reporting(E_ALL); 
    110110 
    111         $purifier = new HTMLPurifier($this->purify_config); 
    112          
     111        $pufifier_config_object = HTMLPurifier_Config::createDefault(); 
     112        $pufifier_config_object->loadArray($this->purify_config); 
     113 
    113114        // Set local IDPrefix to field name... 
    114         $purifier->config->set('Attr', 'IDPrefixLocal', "{$this->name}_"); 
     115        $pufifier_config_object->set('Attr', 'IDPrefixLocal', "{$this->name}_"); 
    115116 
    116117        // Load custom element/attribute definitions 
     
    119120            && !empty($config_defs)) 
    120121        { 
    121             $def =& $purifier->config->getHTMLDefinition(true); 
     122            $def =& $pufifier_config_object->getHTMLDefinition(true); 
    122123            if (   isset($config_defs['addAttribute']) 
    123124                && is_array($config_defs['addAttribute']) 
     
    148149        } 
    149150 
     151        $purifier = new HTMLPurifier($pufifier_config_object); 
     152 
    150153        /* 
    151154        echo "DEBUG: value before\n<pre>\n"; 
     
    154157        */ 
    155158 
     159        // FIXME figure out why this always tries to put something to the default cache dir (it does put stuff to the defined one as well) 
    156160        $this->value = $purifier->purify($this->value); 
    157161