Hi (and sorry for the crossposting),
We are trying to access some midcom objects from within HTMLArea, to no avail. The idea is to replace the insert_image function (already tried the insert_image_from_gallery, but it's too cumbersome for end users). So we want to provide the end user (in midcom AIS) with a list of images to select from.
We'd like to be able to do something like this:
global $midgard; $attachments = mgd_fetch_to_array($this->_topic->listattachments());
if (!$attachments) { print "No attachments in this topic. Please create some!\n"; } else { foreach ($attachments as $id) { $view = mgd_get_attachment ($id); $guid = $view->guid(); print "<img src=\"" . $midgard->self . "midcom-serveattachment-"; print "$view->id/$view->name\" "; print "alt=\"$view->title\" /><br>\n"; } }
The above code goes together with the relevant changes to the widget_html/config snippet, pointing to a newly created insert_image.php instead of insert_image.html
To this point, we were able to register the button properly, call the popup and do some trivial PHP in it.
The problem is that we cannot access any midcom objects. The above code works just fine in an article... We've tried looking at the $GLOBALS array and there's nothing useful there.
Is there a way we can achieve this? If so, how?
Any help will be greatly appreciated with virtual beer...
Thanks!
Nico Halpern
-- Marcelo N. Halpern, your favourite daemon. UNIX Systems Administrator - Ramapo College TEL: +1.201.684.6821 FAX: +1.201.684.7961
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]