$successMsgArray = array('image' => array('add_album' => "Album: \"$album\" has been created",
'edit_album' => "Information for album \"$album\" has been changed",
'delete_album' => "Album: \"$album\", along with any metadata, has been deleted",
'upload' => "Successful uploading of \"$locationPath/$fileName\"",
'download_image_email' => "We have successfully emailed \"$locationPath/$image_name\" to \"$download_sender_email\"",
'download_image_url' => "The URL for \"$image_name\" has been sent to \"$download_sender_email\"",
'download_all' => 'All ' . ucfirst($section) . "s in \"$locationPath\" have been sent as ZIP to \"$download_sender_email\"",
'download_select' => 'Select ' . 'ucfirst($section)' . "s in \"$locationPath\" sent as ZIP to \"$download_sender_email\"",
'resize' => "Successful resizing of \"$locationPath/$fileName\"",
'edit' => "Information for $section: \"$fileName\" has been changed",
'remove' => "All information for $section: \"$fileName\" has been deleted - $section remains",
'delete_image' => "All information for $section: \"$fileName\" has been deleted - $section also deleted",
'delete_all_images' => "All ${section}s in \"$locationPath\" have been deleted along with any metadata",
'delete_select' => "Select ${section}s in \"$locationPath\" have been deleted along with any metadata",
'move_images' => "All ${section}s have been moved to \"$album\"",
'move_nonimages' => "This was a video at \"$locationPath\" that has been moved to a video location"),
'video' => array(),
'person' => array(),
'keyword' => array(),
'event' => array(),
'placement' => array()
);
Ok I did that. Here is the class and method:
class MethodGeneratorForActionPerformer [
// MORE STUFF
function &getSuccessMsg() { // STATIC STRING METHOD
global $section, $action, ${$section . 'LocationPath'}, $successMsgArray;
if (is_array($_POST) && @sizeof($_POST) > 0) foreach ($_POST as $key => $val) if (!isset(${$key})) ${$key} = $val;
$locationPath = ($album) ? "${$section . 'LocationPath'}/$album" : ${$section . 'LocationPath'};
$this->fileName = ($image_name) ? $image_name : $this->fileName;
$fileName = $this->fileName; // FOR REASSIGNMENT INTO GLOBALIZED 2-DIM ARRAY FROM PROCEDURAL GLOBAL LIBRARY project_globals.inc.php
return $successMsgArray[$section][$action];
}
}
Now, if $successMsgArray[$section][$action] is called where $section = 'image' and $action = 'edit', THIS is what you see:
Information for image: "" has been changed
That is what I feared. Setting to double quotes is useless in this case because while $section is available, $fileName is not.
Phil