Changeset 3034 for plugins/contribute/inc/lib.contribute.php
- Timestamp:
- 05/14/11 23:43:45 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/contribute/inc/lib.contribute.php
r2940 r3034 87 87 if (!is_array($mymeta_values)) {$mymeta_values = array();} 88 88 89 if (version_compare(DC_VERSION,'2.2-alpha1','>='))89 foreach ($mymeta->getAll() as $meta) 90 90 { 91 foreach ($mymeta->getAll() as $meta) 91 # section 92 if ($meta instanceof myMetaSection) 92 93 { 93 # section 94 if ($meta instanceof myMetaSection) 94 $active = in_array($meta->id,$mymeta_values); 95 96 $array[] = array( 97 'id' => $meta->id, 98 'type' => 'section', 99 'prompt' => $meta->prompt, 100 'active' => $active 101 ); 102 } 103 elseif ($meta->enabled) 104 { 105 $active = in_array($meta->id,$mymeta_values); 106 107 if ($meta->getMetaTypeId() == 'list') 95 108 { 96 $active = in_array($meta->id,$mymeta_values); 97 109 $values = $meta->values; 110 } 111 else 112 { 113 $values = ''; 114 } 115 116 if ($all || $active) 117 { 98 118 $array[] = array( 99 119 'id' => $meta->id, 100 'type' => 'section',120 'type' => $meta->getMetaTypeId(), 101 121 'prompt' => $meta->prompt, 122 'default' => $meta->default, 123 'values' => $values, 102 124 'active' => $active 103 125 ); 104 126 } 105 elseif ($meta->enabled)106 {107 $active = in_array($meta->id,$mymeta_values);108 109 if ($meta->getMetaTypeId() == 'list')110 {111 $values = $meta->values;112 }113 else114 {115 $values = '';116 }117 118 if ($all || $active)119 {120 $array[] = array(121 'id' => $meta->id,122 'type' => $meta->getMetaTypeId(),123 'prompt' => $meta->prompt,124 'default' => $meta->default,125 'values' => $values,126 'active' => $active127 );128 }129 }130 127 } 131 128 } 132 else 133 { 134 foreach ($mymeta->getAll() as $k => $v) 135 { 136 if ($v->enabled) 137 { 138 $active = in_array($k,$mymeta_values); 139 if ($all || $active) 140 { 141 $array[] = array( 142 'id' => $k, 143 'type' => $v->type, 144 'prompt' => $v->prompt, 145 'values' => $v->values, 146 'active' => $active 147 ); 148 } 149 } 150 } 151 } 152 129 153 130 return(staticRecord::newFromArray($array)); 154 131 }
Note: See TracChangeset
for help on using the changeset viewer.