A_WordPress_Base_Url

Class A_WordPress_Base_Url.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/wordpress_routing/package.module.wordpress_routing.php  
  1. class A_WordPress_Base_Url extends Mixin 
  2. function _add_index_dot_php_to_url($url) 
  3. if (strpos($url, '/index.php') === FALSE) { 
  4. $pattern = get_option('permalink_structure'); 
  5. if (!$pattern or strpos($pattern, '/index.php') !== FALSE) { 
  6. $url = $this->object->join_paths($url, '/index.php'); 
  7. return $url; 
  8. function get_base_url($site_url = FALSE) 
  9. $retval = NULL; 
  10. $add_index_dot_php = TRUE; 
  11. if (in_array($site_url, array(TRUE, 'site'), TRUE)) { 
  12. $retval = site_url(); 
  13. } elseif (in_array($site_url, array(FALSE, 'home'), TRUE)) { 
  14. $retval = home_url(); 
  15. } elseif (in_array($site_url, array('plugins', 'plugin'), TRUE)) { 
  16. $retval = plugins_url(); 
  17. $add_index_dot_php = FALSE; 
  18. } elseif (in_array($site_url, array('plugins_mu', 'plugin_mu'), TRUE)) { 
  19. $retval = WPMU_PLUGIN_URL; 
  20. $retval = set_url_scheme($retval); 
  21. $retval = apply_filters('plugins_url', $retval, '', ''); 
  22. $add_index_dot_php = FALSE; 
  23. } elseif (in_array($site_url, array('templates', 'template', 'themes', 'theme'), TRUE)) { 
  24. $retval = get_template_directory_uri(); 
  25. $add_index_dot_php = FALSE; 
  26. } elseif (in_array($site_url, array('styles', 'style', 'stylesheets', 'stylesheet'), TRUE)) { 
  27. $retval = get_stylesheet_directory_uri(); 
  28. $add_index_dot_php = FALSE; 
  29. } elseif (in_array($site_url, array('content'), TRUE)) { 
  30. $retval = content_url(); 
  31. $add_index_dot_php = FALSE; 
  32. } elseif (in_array($site_url, array('root'), TRUE)) { 
  33. $retval = get_option('home'); 
  34. if (is_ssl()) { 
  35. $scheme = 'https'; 
  36. } else { 
  37. $scheme = parse_url($retval, PHP_URL_SCHEME); 
  38. $retval = set_url_scheme($retval, $scheme); 
  39. } elseif (in_array($site_url, array('gallery', 'galleries'), TRUE)) { 
  40. $root_type = defined('NGG_GALLERY_ROOT_TYPE') ? NGG_GALLERY_ROOT_TYPE : 'site'; 
  41. $add_index_dot_php = FALSE; 
  42. if ($root_type === 'content') { 
  43. $retval = content_url(); 
  44. } else { 
  45. $retval = site_url(); 
  46. } else { 
  47. $retval = site_url(); 
  48. if ($add_index_dot_php) { 
  49. $retval = $this->_add_index_dot_php_to_url($retval); 
  50. if ($this->object->is_https()) { 
  51. $retval = preg_replace('/^http:\\/\\//i', 'https://', $retval, 1); 
  52. return $retval;