public
Description: Midgard Components Framework 3rd generation
Homepage: http://www.midgard-project.org
Clone URL: git://github.com/bergie/midcom.git
Initial variants serving support
bergie (author)
Tue Jul 08 00:59:39 -0700 2008
commit  06d056e5e58cf483e0af303d4472e27f1751d053
tree    03ae9f7ea209c590c389b4ddd839f85d678df4af
parent  c5611bbbb695237eeba4a22734f7d25270c18a3d
...
64
65
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
68
69
...
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
0
@@ -64,6 +64,22 @@ class midcom_core_controllers_page extends midcom_core_controllers_baseclasses_m
0
         {
0
             switch ($this->dispatcher->request_method)
0
             {
0
+ case 'GET':
0
+ // Get variant of the page
0
+ $variant = $args['variant']['variant'];
0
+ if (!isset($data['datamanager']->types->$variant))
0
+ {
0
+ throw new midcom_exception_notfound("{$args['variant']['variant']} not available");
0
+ }
0
+
0
+ $type_field = "as_{$args['variant']['type']}";
0
+ if (!isset($data['datamanager']->types->$variant->$type_field))
0
+ {
0
+ throw new midcom_exception_notfound("Type {$args['variant']['type']} of {$args['variant']['variant']} not available");
0
+ }
0
+
0
+ echo $data['datamanager']->types->$variant->$type_field;
0
+ die();
0
                 case 'MKCOL':
0
                     // Create subpage
0
                     $_MIDCOM->authorization->require_do('midgard:create', $data['object']);

Comments

    No one has commented yet.