Ignore:
Timestamp:
Jan 24, 2007, 6:07:08 AM (17 years ago)
Author:
rvelices
Message:
  • plugins with own independent scripts work now (cookie_path and url root are

correct)

  • prepare a bit some url functions so that later we can fully embed pwg in

scripts located outside pwg

  • remove some unnecessary language strings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_url.inc.php

    r1722 r1750  
    3939  }
    4040  else
    41   {
     41  {// TODO - add HERE the possibility to call PWG functions from external scripts
    4242    $root_url = PHPWG_ROOT_PATH;
    4343  }
     
    5353
    5454/**
    55  * returns the url of the current host (e.g. http://www.toto.com )
    56  * TODO: if required by someone, treat https case
    57  */
    58 function get_host_url()
    59 {
    60   $url = "http://";
    61   $url .= $_SERVER['HTTP_HOST'];
    62   if ($_SERVER['SERVER_PORT']!=80)
    63   {
    64     $url .= ':'.$_SERVER['SERVER_PORT'];
    65   }
     55 * returns the absolute url to the root of PWG
     56 * @param boolean with_scheme if false - does not add http://toto.com
     57 */
     58function get_absolute_root_url($with_scheme=true)
     59{
     60  // TODO - add HERE the possibility to call PWG functions from external scripts
     61  $url = '';
     62  if ($with_scheme)
     63  {
     64    $url .= 'http://'.$_SERVER['HTTP_HOST'];
     65    if ($_SERVER['SERVER_PORT']!=80)
     66    {
     67      $url .= ':'.$_SERVER['SERVER_PORT'];
     68    }
     69  }
     70  $url .= cookie_path();
    6671  return $url;
    6772}
     
    420425    }
    421426    $page['save_root_path']['count'] = 1;
    422     $page['root_path'] = get_host_url().cookie_path();
     427    $page['root_path'] = get_absolute_root_url();
    423428  }
    424429  else
Note: See TracChangeset for help on using the changeset viewer.