customfooter_plugin.class.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Description of Custom Footer.
  4. *
  5. * @copyright (c) 2014 VF Consulting
  6. * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
  7. * @author Valery Fremaux <valery.fremaux@gmail.com>
  8. */
  9. class CustomFooterPlugin extends Plugin
  10. {
  11. protected function __construct()
  12. {
  13. parent::__construct('1.1', 'Valery Fremaux');
  14. }
  15. /**
  16. * @return CustomFooterPlugin
  17. */
  18. public static function create()
  19. {
  20. static $result = null;
  21. return $result ? $result : $result = new self();
  22. }
  23. public function get_name()
  24. {
  25. return 'customfooter';
  26. }
  27. public function pix_url($pixname, $size = 16)
  28. {
  29. global $_configuration;
  30. if (file_exists(
  31. $_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.png'
  32. )) {
  33. return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.png';
  34. }
  35. if (file_exists(
  36. $_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.jpg'
  37. )) {
  38. return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.jpg';
  39. }
  40. if (file_exists(
  41. $_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.gif'
  42. )) {
  43. return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.gif';
  44. }
  45. return $_configuration['root_web'].'/main/img/icons/'.$size.'/'.$pixname.'.png';
  46. }
  47. }