Branch: Tag:

2001-08-23

2001-08-23 16:42:47 by Per Hedbor <ph@opera.com>

[docs] Added the 'locate' argument to <insert> and <use>. Works more or less like the .htaccess file finding. Uses VFS.find_above

Rev: server/modules/tags/rxmltags.pike:1.279

7:   #define _rettext RXML_CONTEXT->misc[" _rettext"]   #define _ok RXML_CONTEXT->misc[" _ok"]    - constant cvs_version = "$Id: rxmltags.pike,v 1.278 2001/08/22 21:26:53 mast Exp $"; + constant cvs_version = "$Id: rxmltags.pike,v 1.279 2001/08/23 16:42:47 per Exp $";   constant thread_safe = 1;   constant language = roxen->language;   
909:    }   }    + class TagInsertLocate { +  inherit RXML.Tag; +  constant name= "insert"; +  constant plugin_name = "locate"; +  +  RXML.Type get_type( mapping args ) +  { +  if (args->quote=="html") +  return RXML.t_text; +  return RXML.t_xml; +  } +  +  string get_data(string var, mapping args, RequestID id) +  { +  array(string) result; +  +  result = VFS.find_above_read( id->not_query, var, id ); +  +  if( !result ) +  RXML.run_error("Cannot locate any file named "+var+".\n"); +  +  return result[1]; +  } + } +    class TagInsertFile {    inherit RXML.Tag;    constant name = "insert";
2249:    filename = Roxen.fix_relative(args->file, id);    name = id->conf->get_config_id() + "|" + filename;    } +  else if( args->locate ) +  { +  filename = VFS.find_above( id->not_query, args->locate, id, "locate" ); +  name = id->conf->get_config_id() + "|" + filename; +  }    else -  +  {    name = "|" + args->package; -  +  }    RXML.Context ctx = RXML_CONTEXT;       if(args->info || id->pragma["no-cache"] ||