customfooter_plugin.class.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. /**
  12. *
  13. * @return CustomFooterPlugin
  14. */
  15. public static function create()
  16. {
  17. static $result = null;
  18. return $result ? $result : $result = new self();
  19. }
  20. public function get_name()
  21. {
  22. return 'customfooter';
  23. }
  24. protected function __construct()
  25. {
  26. parent::__construct('1.1', 'Valery Fremaux');
  27. }
  28. public function pix_url($pixname, $size = 16)
  29. {
  30. global $_configuration;
  31. if (file_exists(
  32. $_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.png'
  33. )) {
  34. return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.png';
  35. }
  36. if (file_exists(
  37. $_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.jpg'
  38. )) {
  39. return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.jpg';
  40. }
  41. if (file_exists(
  42. $_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.gif'
  43. )) {
  44. return $_configuration['root_web'].'/plugin/customplugin/pix/'.$pixname.'.gif';
  45. }
  46. return $_configuration['root_web'].'/main/img/icons/'.$size.'/'.$pixname.'.png';
  47. }
  48. }