A_NextGen_Basic_TagCloud_Urls

Class A_NextGen_Basic_TagCloud_Urls.

Defined (1)

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

/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/package.module.nextgen_basic_tagcloud.php  
  1. class A_NextGen_Basic_TagCloud_Urls extends Mixin 
  2. public function create_parameter_segment($key, $value, $id, $use_prefix) 
  3. if ($key == 'gallerytag') { 
  4. return 'tags/' . $value; 
  5. } else { 
  6. return $this->call_parent('create_parameter_segment', $key, $value, $id, $use_prefix); 
  7. public function set_parameter_value($key, $value, $id = NULL, $use_prefix = FALSE, $url = FALSE) 
  8. $retval = $this->call_parent('set_parameter_value', $key, $value, $id, $use_prefix, $url); 
  9. return $this->_set_tag_cloud_parameters($retval, $key, $id); 
  10. public function remove_parameter($key, $id = NULL, $url = FALSE) 
  11. $retval = $this->call_parent('remove_parameter', $key, $id, $url); 
  12. $retval = $this->_set_tag_cloud_parameters($retval, $key, $id); 
  13. return $retval; 
  14. public function _set_tag_cloud_parameters($retval, $key, $id = NULL) 
  15. // Get the settings manager 
  16. $settings = C_NextGen_Settings::get_instance(); 
  17. // Create the regex pattern 
  18. $sep = preg_quote($settings->router_param_separator, '#'); 
  19. if ($id) { 
  20. $id = preg_quote($id, '#') . $sep; 
  21. $prefix = preg_quote($settings->router_param_prefix, '#'); 
  22. $regex = implode('', array('#//?', $id ? "({$id})?" : "(\\w+{$sep})?", "({$prefix})?gallerytag{$sep}([\\w-_]+)/?#")); 
  23. // Replace any page parameters with the ngglegacy equivalent 
  24. if (preg_match($regex, $retval, $matches)) { 
  25. $retval = rtrim(str_replace($matches[0], "/tags/{$matches[3]}/", $retval), '/'); 
  26. return $retval;