sidebar.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php
  2. /**
  3. * Sidebar view
  4. */
  5. $current_user_guid = elgg_get_logged_in_user_guid();
  6. $base = elgg_get_site_url() . 'photos/';
  7. elgg_register_menu_item('page', array('name' => 'A10_tiypics_siteimages',
  8. 'text' => elgg_echo('tidypics:siteimagesall'),
  9. 'href' => $base . 'siteimagesall',
  10. 'section' => 'A'));
  11. elgg_register_menu_item('page', array('name' => 'A20_tiypics_albums',
  12. 'text' => elgg_echo('album:all'),
  13. 'href' => $base . 'all',
  14. 'section' => 'A'));
  15. $page = elgg_extract('page', $vars);
  16. $image = elgg_extract('image', $vars);
  17. if ($page == 'upload') {
  18. if (elgg_get_plugin_setting('quota', 'tidypics')) {
  19. echo elgg_view('photos/sidebar/quota', $vars);
  20. }
  21. } else if (($page == 'all') || ($page == 'owner') || ($page == 'friends')) {
  22. elgg_register_menu_item('page', array('name' => 'A30_tiypics_recentlyviewed',
  23. 'text' => elgg_echo('tidypics:recentlyviewed'),
  24. 'href' => $base . 'recentlyviewed',
  25. 'section' => 'A'));
  26. elgg_register_menu_item('page', array('name' => 'A40_tiypics_recentlycommented',
  27. 'text' => elgg_echo('tidypics:recentlycommented'),
  28. 'href' => $base . 'recentlycommented',
  29. 'section' => 'A'));
  30. elgg_register_menu_item('page', array('name' => 'B10_tiypics_mostviewed',
  31. 'text' => elgg_echo('tidypics:mostviewed'),
  32. 'href' => $base . 'mostviewed',
  33. 'section' => 'B'));
  34. elgg_register_menu_item('page', array('name' => 'B20_tiypics_mostviewedtoday',
  35. 'text' => elgg_echo('tidypics:mostviewedtoday'),
  36. 'href' => $base . 'mostviewedtoday',
  37. 'section' => 'B'));
  38. elgg_register_menu_item('page', array('name' => 'B30_tiypics_mostviewedthismonth',
  39. 'text' => elgg_echo('tidypics:mostviewedthismonth'),
  40. 'href' => $base . 'mostviewedthismonth',
  41. 'section' => 'B'));
  42. elgg_register_menu_item('page', array('name' => 'B40_tiypics_mostviewedlastmonth',
  43. 'text' => elgg_echo('tidypics:mostviewedlastmonth'),
  44. 'href' => $base . 'mostviewedlastmonth',
  45. 'section' => 'B'));
  46. elgg_register_menu_item('page', array('name' => 'B50_tiypics_mostviewedthisyear',
  47. 'text' => elgg_echo('tidypics:mostviewedthisyear'),
  48. 'href' => $base . 'mostviewedthisyear',
  49. 'section' => 'B'));
  50. elgg_register_menu_item('page', array('name' => 'C10_tidypics_mostcommented',
  51. 'text' => elgg_echo('tidypics:mostcommented'),
  52. 'href' => $base . 'mostcommented',
  53. 'section' => 'C'));
  54. elgg_register_menu_item('page', array('name' => 'C20_tidypics_mostcommentedtoday',
  55. 'text' => elgg_echo('tidypics:mostcommentedtoday'),
  56. 'href' => $base . 'mostcommentedtoday',
  57. 'section' => 'C'));
  58. elgg_register_menu_item('page', array('name' => 'C30_tidypics_mostcommentedthismonth',
  59. 'text' => elgg_echo('tidypics:mostcommentedthismonth'),
  60. 'href' => $base . 'mostcommentedthismonth',
  61. 'section' => 'C'));
  62. elgg_register_menu_item('page', array('name' => 'C40_tidypics_mostcommentedlastmonth',
  63. 'text' => elgg_echo('tidypics:mostcommentedlastmonth'),
  64. 'href' => $base . 'mostcommentedlastmonth',
  65. 'section' => 'C'));
  66. elgg_register_menu_item('page', array('name' => 'C50_tidypics_mostcommentedthisyear',
  67. 'text' => elgg_echo('tidypics:mostcommentedthisyear'),
  68. 'href' => $base . 'mostcommentedthisyear',
  69. 'section' => 'C'));
  70. if(elgg_is_active_plugin('elggx_fivestar')) {
  71. elgg_register_menu_item('page', array('name' => 'D10_tidypics_highestrated',
  72. 'text' => elgg_echo('tidypics:highestrated'),
  73. 'href' => $base . 'highestrated',
  74. 'section' => 'D'));
  75. elgg_register_menu_item('page', array('name' => 'D20_tidypics_highestvotecount',
  76. 'text' => elgg_echo('tidypics:highestvotecount'),
  77. 'href' => $base . 'highestvotecount',
  78. 'section' => 'D'));
  79. elgg_register_menu_item('page', array('name' => 'D30_tidypics_recentvotes',
  80. 'text' => elgg_echo('tidypics:recentlyvoted'),
  81. 'href' => $base . 'recentvotes',
  82. 'section' => 'D'));
  83. }
  84. // if(elgg_is_logged_in()) {
  85. // elgg_register_menu_item('page', array('name' => 'E10_tidypics_usertagged',
  86. // 'text' => elgg_echo('tidypics:usertagged'),
  87. // 'href' => $base . "tagged?guid=$current_user_guid",
  88. // 'section' => 'E'));
  89. // }
  90. } else if ($image && $page == 'tp_view') {
  91. if (elgg_get_plugin_setting('exif', 'tidypics')) {
  92. echo elgg_view('photos/sidebar/exif', $vars);
  93. }
  94. // list of tagged members in an image (code from Tagged people plugin by Kevin Jardine)
  95. if (elgg_get_plugin_setting('tagging', 'tidypics')) {
  96. $body = elgg_list_entities_from_relationship(array(
  97. 'relationship' => 'phototag',
  98. 'relationship_guid' => $image->guid,
  99. 'inverse_relationship' => true,
  100. 'type' => 'user',
  101. 'limit' => 15,
  102. 'list_type' => 'gallery',
  103. 'gallery_class' => 'elgg-gallery-users',
  104. 'pagination' => false
  105. ));
  106. if ($body) {
  107. $title = elgg_echo('tidypics_tagged_members');
  108. echo elgg_view_module('aside', $title, $body);
  109. }
  110. }
  111. }