customfooter_plugin.class.php 1.4 KB

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