/** * Expand all folder aliases and return a usable URL. * @param string $url * @param boolean $root_override Overrides {@link $resolve_to_root} if set to * {@link Force_root_on}. * @return string */ public function resolve_file($url, $root_override = null) { $att_link_key = '{att_link}'; $att_thumb_key = '{att_thumb}'; if (strpos($url, $att_link_key) !== false) { $key = $att_link_key; } else { if (strpos($url, $att_thumb_key) !== false) { $key = $att_thumb_key; } } if (isset($key)) { $history_item = $this->handler_for(Handler_history_item); $url = new URL(substr($url, strlen($key))); $url->prepend('{' . Folder_name_attachments . '}/' . $history_item->object_type . '/' . $this->id . '/'); if ($key == $att_thumb_key) { $url->append_to_name('_tn'); } $url = $url->as_text(); } return parent::resolve_file($url, $root_override); }