1. <?php
  2. # -- BEGIN LICENSE BLOCK ----------------------------------
  3. # This file is part of contactMe, a plugin for Dotclear 2.
  4. #
  5. # Copyright (c) Olivier Meunier and contributors
  6. #
  7. # Licensed under the GPL version 2.0 license.
  8. # A copy of this license is available in LICENSE file or at
  9. # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  10. # -- END LICENSE BLOCK ------------------------------------
  11. if (!defined('DC_RC_PATH')) { return; }
  12. global $core;
  13. $core->url->register('association','association','^association(?:/(.*))?$',array('assoURL','page'));
  14. class assoURL extends dcUrlHandlers
  15. {
  16. public static function page($args)
  17. {
  18. global $core;
  19. $core->tpl->setPath($core->tpl->getPath(),
  20. dirname(__FILE__).'/default-templates/');
  21. $_ctx =& $GLOBALS['_ctx'];
  22. # si l'URL est "association/projets"
  23. if ($args == 'projets')
  24. {
  25. $_ctx->assoPageName = __('Les projets soutenus par l\'association');
  26. self::serveDocument('association-projets.html','text/html');
  27. }
  28. # si l'URL est "association/membres"
  29. elseif ($args == 'membres')
  30. {
  31. $_ctx->assoPageName = __('Les membres de l\'association');
  32. self::serveDocument('association-membres.html','text/html');
  33. }
  34. # si l'URL est "association/membres/quelqun"
  35. elseif (preg_match("/^membres\/([^\/.]+)$/", $args))
  36. {
  37. preg_match_all("/^membres\/([^\/.]+)$/", $args, $membre);
  38. $_ctx->membreToShow = __($membre[1][0]);
  39. $_ctx->assoPageName = __($membre[1][0].', membre de l\'association');
  40. self::serveDocument('association-membre.html','text/html');
  41. }
  42. # si l'URL est "association"
  43. else
  44. {
  45. $_ctx->assoPageName = __('Association d\'artistes multi-disciplinaires');
  46. self::serveDocument('association.html','text/html');
  47. }
  48. }
  49. }
  50. //les paramètres
  51. $core->blog->settings->addNameSpace('assoValues');
  52. $core->blog->settings->addNameSpace('assoProjets');