Roxen.git / server / modules / graphics / gbutton.pike

version» Context lines:

Roxen.git/server/modules/graphics/gbutton.pike:20:   // icon-data -- inline icon data   // align -- left|center|right text alignment   // align-icon -- left|center-before|center-after|right icon alignment   // valign-icon -- above|middle|below icon vertical alignment   // >Button text</gbutton>   //   // Alignment restriction: when text alignment is either left or right, icons   // must also be aligned left or right.       - constant cvs_version = "$Id: gbutton.pike,v 1.106 2003/12/29 09:53:28 grubba Exp $"; + constant cvs_version = "$Id: gbutton.pike,v 1.107 2004/02/16 13:43:29 jonasw Exp $";   constant thread_safe = 1;      #include <module.h>   inherit "module";      roxen.ImageCache button_cache;   int do_ext;      constant module_type = MODULE_TAG;   constant module_name = "Graphics: GButton";
Roxen.git/server/modules/graphics/gbutton.pike:377:    case "below":    text_height = middle - top;    break;    default:    case "middle":    text_height = bottom - top;    break;    }       // Get icon -  if (args->icn) -  icon = roxen.low_load_image(args->icn, id); -  else if (args->icd) +  if (args->icn) { +  // Pass error mapping to find out possible errors when loading icon +  mapping err = ([ ]); +  icon = roxen.low_load_image(args->icn, id, err); +  +  // If icon loading fails due to missing authentication we reject the +  // gbutton request so that the browser can re-request it with proper +  // authentication headers. +  if (!icon && err->error == 401) +  return err; +  } else if (args->icd)    icon = roxen.low_decode_image(args->icd);       int i_width = icon && icon->img->xsize();    int i_height = icon && icon->img->ysize();    int i_spc = i_width && sizeof(text) && 5;       // Generate text    if (sizeof(text))    {    int min_font_size = 0;