vchamilo_plugin.class.php 1.6 KB

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