Changeset 16181

Show
Ignore:
Timestamp:
04/21/08 21:42:11 (6 months ago)
Author:
piotras
Message:

Do not add pages array to $_MIDGARD.
Set current style id.
Explicitly set current connection's rcfg

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midgard/apis/php5/midgard.c

    r16169 r16181  
    452452                return; 
    453453         
    454         /* rcfg is already associated with midgard_connection */ 
    455454        MidgardRequestConfig *rcfg = midgard_http_host_get_request_config(http_host); 
     455        if(!midgard_connection_set_request_config(mgd_handle(), rcfg)) 
     456                g_warning("Couldn't set request configuration for current connection"); 
    456457 
    457458        return; 
     
    598599    php_printf("This program makes use of the Midgard Content Management engine:<br />"); 
    599600    php_printf("&copy; 1998-2001 The Midgard Project Ry - 2000-2001 Aurora Linux<br />\n"); 
    600     php_printf("&copy; 2002-2007 The Midgard Community<br />\n"); 
     601    php_printf("&copy; 2002-2008 The Midgard Community<br />\n"); 
    601602    php_info_print_box_end(); 
    602603 
     
    832833                                midgard_connection_get_sitegroup_id(mgd)); 
    833834 
    834                 /* PAGES */ 
    835                 i = 0; 
    836                  
    837                 zval *pages; 
    838                 MAKE_STD_ZVAL(pages); 
    839                 array_init(pages); 
    840  
    841                 if(rcfg->pages != NULL) { 
    842                  
    843                         array = rcfg->pages; 
    844                          
    845                         for(i = 0; i < array->n_values; i++) { 
    846                          
    847                                 GValue *oval = g_value_array_get_nth(array, i); 
    848                                 GObject *object = g_value_get_object(oval); 
    849  
    850                                 zval *zobject = NULL; 
    851                                 MAKE_STD_ZVAL(zobject); 
    852                                 php_midgard_gobject_init(zobject,  
    853                                                 G_OBJECT_TYPE_NAME(object), 
    854                                                 object, FALSE); 
    855  
    856                                 zend_hash_next_index_insert( 
    857                                                 HASH_OF(pages),  
    858                                                 &zobject, sizeof(zval *), NULL);                 
    859                         } 
    860                 } 
    861                  
    862                 add_assoc_zval(mgd_php_globals, "pages", pages); 
    863  
    864835                guint id = 0; 
    865  
    866836                /* PAGE ID */ 
    867837                if(rcfg->page)   
     
    883853                add_assoc_bool(mgd_php_globals, "auth", rcfg->auth_required); 
    884854 
    885                 /* PREFIX */ 
     855                /* STYLE */ 
     856                id = 0; 
     857                if(rcfg->style) 
     858                        g_object_get(G_OBJECT(rcfg->style), "id", &id, NULL); 
     859                add_assoc_long(mgd_php_globals, "style", id); 
    886860                 
    887861        }