Active
Project:
Image Assist
Version:
6.x-2.0-alpha4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2010 at 23:37 UTC
Updated:
30 Sep 2010 at 23:37 UTC
Thanks for for the great work, maintainer(s)!
In the image browser pop-up, I would prefer that after I upload an image I am redirected to the image properties form within the frameset, rather than the node view (which is awkward within the pop-up). Below is how I fudged it... wondering if you'd consider this behaviour as a future fix? Also open to suggestions if there's a better way to do it.
I have a module that I use exclusively for admin customizations. It's where I included this code:
function mymodule_form_alter(&$form, $form_state, $form_id) {
if (module_exists('image') && $form_id == 'image_node_form') {
// This sets a variable for hook_nodeapi(), telling it to redirect to
// image properties instead of the node view. We check the referrer
// to restrict this behaviour to the image browser pop-up.
if (strpos(referer_uri(), 'img_assist/load') !== FALSE) {
$form['image_redirect'] = array('#type' => 'hidden', '#default_value' => 1);
}
}
}
function mymodule_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'insert':
case 'update':
if ($node->type == 'image' && isset($node->image_redirect)) {
drupal_goto('img_assist/properties/'. $node->nid);
}
break;
}
}
Cheers -