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 10// must be run within Dokuwiki 11if(!defined('DOKU_INC')) die(); 12 13require_once(dirname(__FILE__).'/icon.php'); 14 15class syntax_plugin_icons_fugue extends syntax_plugin_icons_icon { 16 17 const IS_ICON = true; 18 const IS_FONT_ICON = false; 19 20 protected $pattern = '{{fugue>.+?}}'; 21 22 public static function makePath($icon, $size, $base_url) { 23 24 $sizes = array(16, 24, 32); 25 $size = (($size > max($sizes)) ? max($sizes) : $size); 26 27 switch ($size) { 28 case 0: 29 case 16: 30 $size = 'icons'; break; 31 case 24: 32 $size = 'bonus/icons-24'; break; 33 case 32: 34 $size = 'bonus/icons-32'; break; 35 default: 36 $size = 'icons'; 37 } 38 39 return "$base_url/$size/$icon.png"; 40 41 } 42 43} 44