fugue.php 953 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Plugin Icons: Fugue helper
  4. *
  5. * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
  6. * @author Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com>
  7. * @copyright (C) 2015-2018, Giuseppe Di Terlizzi
  8. */
  9. // must be run within Dokuwiki
  10. if(!defined('DOKU_INC')) die();
  11. require_once(dirname(__FILE__).'/icon.php');
  12. class syntax_plugin_icons_fugue extends syntax_plugin_icons_icon {
  13. const IS_ICON = true;
  14. const IS_FONT_ICON = false;
  15. protected $pattern = '{{fugue>.+?}}';
  16. public static function makePath($icon, $size, $base_url) {
  17. $sizes = array(16, 24, 32);
  18. $size = (($size > max($sizes)) ? max($sizes) : $size);
  19. switch ($size) {
  20. case 0:
  21. case 16:
  22. $size = 'icons'; break;
  23. case 24:
  24. $size = 'bonus/icons-24'; break;
  25. case 32:
  26. $size = 'bonus/icons-32'; break;
  27. default:
  28. $size = 'icons';
  29. }
  30. return "$base_url/$size/$icon.png";
  31. }
  32. }