Changeset 13617

Show
Ignore:
Timestamp:
11/23/07 15:48:35 (1 year ago)
Author:
bergie
Message:

Make it possible to disable page attachment upload

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.helper.imagepopup/config/config.inc

    r3120 r13617  
    1  
    2 /* @TODO  
    3  * Have a table of allowed file types. 
    4  * Max number of mb uploadable 
    5 */ 
    6  
    7  
    8  
     1'enable_page' => true, 
  • trunk/midcom/midcom.helper.imagepopup/handler/list.php

    r12615 r13617  
    3434        parent::midcom_baseclasses_components_handler(); 
    3535    } 
     36     
     37    /** 
     38     * Load the schemadb and other midcom.admin.folder specific stuff 
     39     *  
     40     * @access public 
     41     */ 
     42    function _on_initialize() 
     43    { 
     44        $this->_config =& $GLOBALS['midcom_component_data']['midcom.helper.imagepopup']['config']; 
     45    } 
    3646 
    3747    function _prepare_request_data() 
     
    4555        $_MIDCOM->auth->require_valid_user(); 
    4656        $_MIDCOM->skip_page_style = true; 
     57 
     58        if (!$this->_config->get('enable_page')) 
     59        { 
     60            if ($handler_id == '____ais-imagepopup-list_object') 
     61            { 
     62                $_MIDCOM->relocate('__ais/imagepopup/folder/default/'); 
     63            } 
     64            elseif ($handler_id =='____ais-imagepopup-list_folder') 
     65            { 
     66                $_MIDCOM->relocate('__ais/imagepopup/folder/default/'); 
     67            } 
     68            elseif ($handler_id =='____ais-imagepopup-list_unified') 
     69            { 
     70                $_MIDCOM->relocate('__ais/imagepopup/unified/default/'); 
     71            } 
     72        } 
    4773         
    4874        $_MIDCOM->add_link_head 
     
    213239        $session =& $_MIDCOM->get_service('session'); 
    214240         
    215         if (!$session->exists('midcom.helper.datamanager2', $key)) 
    216         { 
    217             $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Could not find datamanager2 schema session with key: {$key}."); 
    218             // this exits. 
    219         } 
    220          
    221         $schema = $session->get('midcom.helper.datamanager2', $key); 
     241        if ($session->exists('midcom.helper.datamanager2', $key)) 
     242        { 
     243            $schema = $session->get('midcom.helper.datamanager2', $key); 
     244        } 
     245        else 
     246        { 
     247            $schema = array 
     248            ( 
     249                'description' => 'generated schema', 
     250                'fields' => array(), 
     251            ); 
     252        } 
    222253 
    223254        $imagetypes = array 
  • trunk/midcom/midcom.helper.imagepopup/viewer.php

    r6157 r13617  
    2323    function get_plugin_handlers() 
    2424    { 
    25      
    26         // Dumb $this on PHP5 workaround 
    27          
    28        $object =& $this; 
     25        $_MIDCOM->load_library('midcom.helper.imagepopup'); 
     26             
     27        // Dumb $this on PHP5 workaround 
     28        $object =& $this; 
    2929         
    3030        // Match /folder/<schema>/<object guid>