/** * Called on a fully-resolved URL before returning it. * If {@link $prefer_relative_urls} is True, the URL is made relative to the * current page. * @param string $url * @param boolean $root_override Overrides {@link $resolve_to_root} if set to {@link Force_root_on}. * @return string * @access private */ protected function _finalize_url($url, $root_override) { $Result = parent::_finalize_url($url, $root_override); if ($this->prefer_relative_urls && $this->root_url && !$this->_needs_root($Result, $root_override)) { $Result = path_between($this->root_url, $Result, global_url_options()); if ($Result == '') { $Result = '.'; } } return $Result; }
/** * Set the path for an alias. * If this changes the appliction path, then recalculate the offset url for accessing that * path from this location. If this location is not on the same server (or is command-line), * use the entire URL. If this location is a sub-folder of the application root, use a * relative offset (../../). If this location is somewhere else on the same server, use the * absolute root to the application. * @param string $alias Can be {@link Folder_name_application}, {@link Folder_name_attachments}, {@link Folder_name_resources}, {@link Folder_name_pages}, {@link Folder_name_icons}, {@link Folder_name_scripts} or {$link Folder_name_styles}. * @param string $path */ public function set_path($alias, $path) { parent::set_path($alias, $path); switch ($alias) { case Folder_name_application: $this->restore_root_behavior(); break; } }