| 1 |
<?php |
<?php |
| 2 |
// $Id: importexportapi_menu.inc,v 1.2 2006/08/19 15:58:53 jaza Exp $ |
// $Id: importexportapi_menu.inc,v 1.3 2006/09/19 02:41:58 jaza Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 14 |
|
|
| 15 |
$def = array( |
$def = array( |
| 16 |
'#type' => 'entity', |
'#type' => 'entity', |
| 17 |
'#title' => t('Menu item'), |
'#title' => t('Menu custom'), |
| 18 |
'#db_default_table' => 'menu', |
'#db_default_table' => 'menu_custom', |
| 19 |
'#xml_plural' => 'menu-items', |
'#xml_plural' => 'menu_custom_items', |
| 20 |
'#csv_plural' => 'menu-items' |
'#cvs_plural' => 'menu_custom_items', |
| 21 |
); |
); |
| 22 |
|
|
| 23 |
$def['mid'] = array( |
$def['menu_name'] = array( |
| 24 |
|
'#title' => t('Menu name'), |
| 25 |
|
'#key' => TRUE, |
| 26 |
|
'#db_uses_sequences' => FALSE, |
| 27 |
|
'#cvs_mapping' => 'menu_name', |
| 28 |
|
'#xml_mapping' => 'menu_name', |
| 29 |
|
'#xml_plural' => 'menu_name', |
| 30 |
|
); |
| 31 |
|
|
| 32 |
|
$def['title'] = array( |
| 33 |
|
'#title' => t('Title'), |
| 34 |
|
); |
| 35 |
|
|
| 36 |
|
$def['description'] = array( |
| 37 |
|
'#title' => t('Description'), |
| 38 |
|
); |
| 39 |
|
|
| 40 |
|
$defs['menu_custom'] = $def; |
| 41 |
|
|
| 42 |
|
$def = array( |
| 43 |
|
'#type' => 'entity', |
| 44 |
|
'#title' => t('Menu links'), |
| 45 |
|
'#db_default_table' => 'menu_links', |
| 46 |
|
'#xml_plural' => 'menu_link_items', |
| 47 |
|
'#cvs_plural' => 'menu_link_items', |
| 48 |
|
); |
| 49 |
|
|
| 50 |
|
$def['menu_name'] = array( |
| 51 |
|
'#title' => t('Menu name'), |
| 52 |
|
); |
| 53 |
|
|
| 54 |
|
$def['mlid'] = array( |
| 55 |
'#type' => 'int', |
'#type' => 'int', |
| 56 |
'#title' => t('Menu item ID'), |
'#title' => t('Menu link id'), |
| 57 |
'#key' => TRUE, |
'#key' => TRUE, |
| 58 |
'#db_uses_sequences' => TRUE |
'#db_uses_sequences' => TRUE, |
| 59 |
); |
); |
| 60 |
$def['pid'] = array( |
|
| 61 |
|
$def['plid'] = array( |
| 62 |
|
'#type' => 'int', |
| 63 |
|
'#title' => t('Parent link id'), |
| 64 |
|
'#reference_entity' => 'menu_links', |
| 65 |
|
'#reference_field' => array('mlid'), |
| 66 |
|
'#reference_parent' => FALSE, |
| 67 |
|
); |
| 68 |
|
|
| 69 |
|
$def['link_path'] = array( |
| 70 |
|
'#title' => t('Link path'), |
| 71 |
|
); |
| 72 |
|
|
| 73 |
|
$def['router_path'] = array( |
| 74 |
|
'#title' => t('Router path'), |
| 75 |
|
); |
| 76 |
|
|
| 77 |
|
$def['link_title'] = array( |
| 78 |
|
'#title' => t('Link title'), |
| 79 |
|
); |
| 80 |
|
|
| 81 |
|
$def['options'] = array( |
| 82 |
|
'#title' => t('Options'), |
| 83 |
|
); |
| 84 |
|
|
| 85 |
|
$def['module'] = array( |
| 86 |
|
'#title' => t('Module'), |
| 87 |
|
); |
| 88 |
|
|
| 89 |
|
$def['hidden'] = array( |
| 90 |
|
'#type' => 'int', |
| 91 |
|
'#title' => t('Hidden'), |
| 92 |
|
); |
| 93 |
|
|
| 94 |
|
$def['external'] = array( |
| 95 |
|
'#type' => 'int', |
| 96 |
|
'#title' => t('External'), |
| 97 |
|
); |
| 98 |
|
|
| 99 |
|
$def['has_children'] = array( |
| 100 |
|
'#type' => 'int', |
| 101 |
|
'#title' => t('Has children'), |
| 102 |
|
); |
| 103 |
|
|
| 104 |
|
$def['expanded'] = array( |
| 105 |
|
'#type' => 'int', |
| 106 |
|
'#title' => t('Expanded'), |
| 107 |
|
); |
| 108 |
|
|
| 109 |
|
$def['weight'] = array( |
| 110 |
|
'#type' => 'int', |
| 111 |
|
'#title' => t('Weight'), |
| 112 |
|
); |
| 113 |
|
|
| 114 |
|
$def['depth'] = array( |
| 115 |
|
'#type' => 'int', |
| 116 |
|
'#title' => t('Depth'), |
| 117 |
|
); |
| 118 |
|
|
| 119 |
|
$def['customized'] = array( |
| 120 |
|
'#type' => 'int', |
| 121 |
|
'#title' => t('Customized'), |
| 122 |
|
); |
| 123 |
|
|
| 124 |
|
$def['p1'] = array( |
| 125 |
|
'#type' => 'int', |
| 126 |
|
'#title' => t('P1'), |
| 127 |
|
); |
| 128 |
|
|
| 129 |
|
$def['p2'] = array( |
| 130 |
|
'#type' => 'int', |
| 131 |
|
'#title' => t('P2'), |
| 132 |
|
); |
| 133 |
|
|
| 134 |
|
$def['p3'] = array( |
| 135 |
|
'#type' => 'int', |
| 136 |
|
'#title' => t('P3'), |
| 137 |
|
); |
| 138 |
|
|
| 139 |
|
$def['p4'] = array( |
| 140 |
'#type' => 'int', |
'#type' => 'int', |
| 141 |
'#title' => t('Parent menu item ID'), |
'#title' => t('P4'), |
|
'#reference_entity' => 'menu_item', |
|
|
'#reference_field' => array('mid'), |
|
|
'#reference_parent' => FALSE |
|
| 142 |
); |
); |
| 143 |
|
|
| 144 |
|
$def['p5'] = array( |
| 145 |
|
'#type' => 'int', |
| 146 |
|
'#title' => t('P5'), |
| 147 |
|
); |
| 148 |
|
|
| 149 |
|
$def['p6'] = array( |
| 150 |
|
'#type' => 'int', |
| 151 |
|
'#title' => t('P6'), |
| 152 |
|
); |
| 153 |
|
|
| 154 |
|
$def['p7'] = array( |
| 155 |
|
'#type' => 'int', |
| 156 |
|
'#title' => t('P7'), |
| 157 |
|
); |
| 158 |
|
|
| 159 |
|
$def['p8'] = array( |
| 160 |
|
'#type' => 'int', |
| 161 |
|
'#title' => t('P8'), |
| 162 |
|
); |
| 163 |
|
|
| 164 |
|
$def['p9'] = array( |
| 165 |
|
'#type' => 'int', |
| 166 |
|
'#title' => t('P9'), |
| 167 |
|
); |
| 168 |
|
|
| 169 |
|
$def['updated'] = array( |
| 170 |
|
'#type' => 'int', |
| 171 |
|
'#title' => t('Updated'), |
| 172 |
|
); |
| 173 |
|
|
| 174 |
|
$defs['menu_links'] = $def; |
| 175 |
|
|
| 176 |
|
$def = array( |
| 177 |
|
'#type' => 'entity', |
| 178 |
|
'#title' => t('Menu router'), |
| 179 |
|
'#db_default_table' => 'menu_router', |
| 180 |
|
'#xml_plural' => 'menu_router_items', |
| 181 |
|
'#cvs_plural' => 'menu_router_items', |
| 182 |
|
); |
| 183 |
|
|
| 184 |
$def['path'] = array( |
$def['path'] = array( |
| 185 |
'#title' => t('System path'), |
'#title' => 'Path', |
| 186 |
'#xml_mapping' => 'system-path', |
'#key' => TRUE, |
| 187 |
'#csv_mapping' => 'system-path' |
'#db_uses_sequences' => FALSE, |
| 188 |
|
); |
| 189 |
|
|
| 190 |
|
$def['load_functions'] = array( |
| 191 |
|
'#title' => 'Load functions', |
| 192 |
|
); |
| 193 |
|
|
| 194 |
|
$def['to_arg_functions'] = array( |
| 195 |
|
'#title' => 'To arg functions', |
| 196 |
|
); |
| 197 |
|
|
| 198 |
|
$def['access_callback'] = array( |
| 199 |
|
'#title' => 'Access callback', |
| 200 |
|
); |
| 201 |
|
|
| 202 |
|
$def['access_arguments'] = array( |
| 203 |
|
'#type' => 'serialized', |
| 204 |
|
'#title' => 'Access arguments', |
| 205 |
|
); |
| 206 |
|
|
| 207 |
|
$def['fit'] = array( |
| 208 |
|
'#type' => 'int', |
| 209 |
|
'#title' => 'FIT', |
| 210 |
); |
); |
| 211 |
|
|
| 212 |
|
$def['number_parts'] = array( |
| 213 |
|
'#type' => 'int', |
| 214 |
|
'#title' => 'Number parts', |
| 215 |
|
); |
| 216 |
|
|
| 217 |
|
$def['tab_parent'] = array( |
| 218 |
|
'#title' => 'Tab parent', |
| 219 |
|
); |
| 220 |
|
|
| 221 |
|
$def['tab_root'] = array( |
| 222 |
|
'#title' => 'Tab root', |
| 223 |
|
); |
| 224 |
|
|
| 225 |
$def['title'] = array( |
$def['title'] = array( |
| 226 |
'#title' => t('Title') |
'#title' => 'Title', |
| 227 |
|
); |
| 228 |
|
|
| 229 |
|
$def['title_callback'] = array( |
| 230 |
|
'#title' => 'Title callback', |
| 231 |
|
); |
| 232 |
|
|
| 233 |
|
$def['title_arguments'] = array( |
| 234 |
|
'#title' => 'Title arguments', |
| 235 |
|
); |
| 236 |
|
|
| 237 |
|
$def['type'] = array( |
| 238 |
|
'#title' => 'Type', |
| 239 |
|
); |
| 240 |
|
|
| 241 |
|
$def['block_callback'] = array( |
| 242 |
|
'#title' => 'Block callback', |
| 243 |
); |
); |
| 244 |
|
|
| 245 |
$def['description'] = array( |
$def['description'] = array( |
| 246 |
'#title' => t('Description') |
'#title' => 'Description', |
| 247 |
|
); |
| 248 |
|
|
| 249 |
|
$def['position'] = array( |
| 250 |
|
'#title' => 'Position', |
| 251 |
); |
); |
| 252 |
|
|
| 253 |
$def['weight'] = array( |
$def['weight'] = array( |
| 254 |
'#type' => 'int', |
'#type' => 'int', |
| 255 |
'#title' => t('Weight') |
'#title' => 'Weight', |
| 256 |
); |
); |
| 257 |
$def['type'] = array( |
|
| 258 |
'#type' => 'int', |
$def['file'] = array( |
| 259 |
'#title' => t('Type') |
'#title' => 'File', |
| 260 |
); |
); |
| 261 |
|
|
| 262 |
$defs['menu_item'] = $def; |
$defs['menu_router'] = $def; |
| 263 |
|
|
| 264 |
return $defs; |
return $defs; |
| 265 |
} |
} |
| 270 |
function menu_db_def_tables() { |
function menu_db_def_tables() { |
| 271 |
$tables = array(); |
$tables = array(); |
| 272 |
|
|
| 273 |
$tables['menu'] = 'm'; |
$tables['menu_custom'] = 'mc'; |
| 274 |
|
$tables['menu_links'] = 'ml'; |
| 275 |
|
$tables['menu_router'] = 'mr'; |
| 276 |
|
|
| 277 |
return $tables; |
return $tables; |
| 278 |
} |
} |