Undefined index php code
Posted: Tue Jun 12, 2012 1:44 am
I have a CMS and I'm trying to run an extension based on php. I just get this error
Notice: Undefined index: in apps_server_local screenshots () (line 23 of / web / htdocs / http://www.wite.it / home / drupal / sites / all / modules / apps / apps.manifest.inc).
I tried to control the sheet of php and line 23 is
But I can not understand the problem.
I pass the entire function so that they understand better
Thanks for any help that you give me
Notice: Undefined index: in apps_server_local screenshots () (line 23 of / web / htdocs / http://www.wite.it / home / drupal / sites / all / modules / apps / apps.manifest.inc).
I tried to control the sheet of php and line 23 is
Code: Select all
foreach ($ app ['screenshots'] as $ id => $ image) {I pass the entire function so that they understand better
Code: Select all
define("APPS_ENABLED", 1);
define("APPS_DISABLED", 0);
define("APPS_INCOMPATIBLE", -1);
define("APPS_INSTALLABLE", 2);
function apps_server_local($server) {
$apps = array();
$infos = system_rebuild_module_data();
foreach($infos as $module => $info) {
if(isset($info->info['apps']['server'])) {
if($info->info['apps']['server'] = $server['name']) {
foreach($info->info['apps']['manifests'] as $mfile) {
$mfile = drupal_get_path("module", $module) . "/" .$mfile;
$app = drupal_parse_info_file($mfile);
foreach($app['screenshots'] as $id=>$image) {
$app['screenshots'][$id] = url(dirname($mfile) . "/" . $image);
}
$app['logo'] = url(dirname($mfile) . "/" . $app['logo']);
$apps[] = $app;
}
}
}
}
return $apps;
}