function _context_addassets_admin_path in Context Add Assets 7
Pull the url of the admin
Future proofing the admin url and theming functions
Return value
string the path for context add assets admin page
1 call to _context_addassets_admin_path()
- context_reaction_addassets_base::options_form in plugins/
context_reaction_addassets_base.inc - Prepare formatted form array showing grouped assets grouped by location and show as checkboxes
File
- ./
context_addassets.module, line 11
Code
function _context_addassets_admin_path() {
if (module_exists('context_ui')) {
$core_context_items = context_ui_menu();
foreach ($core_context_items as $path => $item) {
if (stripos($path, 'context/settings') != false) {
$addassets_admin_path = str_replace('/settings', '', $path) . '/add-assets';
break;
}
}
if (!isset($addassets_admin_path) or !trim($addassets_admin_path)) {
$addassets_admin_path = 'admin/structure/context/add-assets';
}
return $addassets_admin_path;
}
else {
return;
}
}