Ejemplo n.º 1
0
            <!-- existing albums tab -->
            <div id="joms-js__select-album" class="joms-tab__content <?php 
    echo $isAlbumExist && $selectedAlbum ? '' : 'joms-popup__hide';
    ?>
">
                <div class="joms-form__group">
                    <span><?php 
    echo JText::_('COM_COMMUNITY_PHOTOS_ALBUM_NAME');
    ?>
</span>
                    <div class="joms-select--wrapper">
                        <select class="joms-select" name="album-id">
                            <?php 
    foreach ($allAlbums as $index => $album) {
        if (CAlbumsHelper::isFixedAlbum($album)) {
            continue;
        }
        ?>
                            <option value="<?php 
        echo $album->id;
        ?>
" <?php 
        echo $album->id == $selectedAlbum ? 'selected="selected"' : '';
        ?>
><?php 
        echo trim($album->name);
        ?>
</option>
                            <?php 
    }
Ejemplo n.º 2
0
</a></li>
                            <?php 
        if ($isAuthorized) {
            ?>
                            <li><a href="javascript:" onclick="joms.api.photoRemove('<?php 
            echo $row->id;
            ?>
');"><?php 
            echo JText::_('COM_COMMUNITY_PHOTOS_DELETE');
            ?>
</a></li>
                            <?php 
        }
        ?>
                            <?php 
        if ($isAuthorized && !CAlbumsHelper::isFixedAlbum($album)) {
            ?>
                            <li><a href="javascript:" onclick="joms.api.photoSetAlbum(['<?php 
            echo $row->id;
            ?>
'], '<?php 
            echo $groupId;
            ?>
');"><?php 
            echo JText::_('COM_COMMUNITY_MOVE_TO_ANOTHER_ALBUM');
            ?>
</a></li>
                            <?php 
        }
        ?>
                        </ul>
Ejemplo n.º 3
0
<?php

/**
 * @copyright (C) 2013 iJoomla, Inc. - All rights reserved.
 * @license GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author iJoomla.com <*****@*****.**>
 * @url https://www.jomsocial.com/license-agreement
 * The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0
 * More info at https://www.jomsocial.com/license-agreement
 */
defined('_JEXEC') or die;
$enableReporting = false;
if ($config->get('enablereporting') == 1 && ($my->id > 0 || $config->get('enableguestreporting') == 1)) {
    $enableReporting = true;
}
$canEdit = !CAlbumsHelper::isFixedAlbum($album) && (COwnerHelper::isCommunityAdmin() || $album->creator == $my->id || isset($groupId) && $groupId && $my->authorise('community.create', 'groups.photos.' . $groupId));
?>

<div class="joms-page">
    <div class="joms-js--photo-info">
        <div class="joms-stream__header" style="padding:0; visibility:hidden">
            <div class="joms-avatar--stream">
                <a href="javascript:"><img></a>
            </div>
            <div class="joms-stream__meta">
                <a class="joms-stream__user">&nbsp;</a>
                <span class="joms-stream__time">
                    <small>&nbsp;</small>
                    <svg viewBox="0 0 16 16" class="joms-icon">
                        <use xlink:href="#joms-icon-earth">
                    </svg>
Ejemplo n.º 4
0
 public function setSubmenus()
 {
     //CFactory::load( 'helpers' , 'group' );
     //CFactory::load( 'helpers' , 'owner' );
     $jinput = JFactory::getApplication()->input;
     $task = $userid = $jinput->get('task', '', 'WORD');
     //JRequest::getVar( 'task', '', 'GET' );
     $albumId = $userid = $jinput->get('albumid', 0, 'INT');
     //JRequest::getInt( 'albumid', 0 , 'REQUEST');
     $eventid = $userid = $jinput->get('eventid', 0, 'INT');
     //JRequest::getInt( 'eventid', '', 'REQUEST' );
     if (!empty($albumId)) {
         $album = JTable::getInstance('Album', 'CTable');
         $album->load($albumId);
         $eventid = $album->eventid;
     }
     $config = CFactory::getConfig();
     $event = JTable::getInstance('Event', 'CTable');
     $event->load($eventid);
     $my = CFactory::getUser();
     $albumId = $albumId != 0 ? $albumId : '';
     // Check if the current user is banned from this event
     $isBanned = false;
     $allowManagePhotos = CEventHelper::allowManagePhoto($this->eventid);
     if (($task == 'uploader' || $task == 'photo' || $task == 'album') && !empty($albumId)) {
         $this->view->addSubmenuItem('index.php?option=com_community&view=photos&eventid=' . $this->eventid . '&task=display&albumid=' . $albumId, JText::_('COM_COMMUNITY_PHOTOS_BACK_TO_ALBUM'));
     }
     if ($allowManagePhotos && $task != 'photo' && !$isBanned) {
         /* Event: Upload Photos */
         if ($task != 'newalbum' && $task != 'editAlbum') {
             //$this->view->addSubmenuItem('javascript:void(0);', JText::_('COM_COMMUNITY_PHOTOS_UPLOAD_PHOTOS'), 'joms.notifications.showUploadPhoto(\'' . $albumId . '\',' . $this->eventid . '); return false;', true, '', '');
         }
         if ($task == 'album' && ($my->id == $album->creator && $allowManagePhotos || $event->isAdmin($my->id) || COwnerHelper::isCommunityAdmin())) {
             if (!CAlbumsHelper::isFixedAlbum($album)) {
                 $this->view->addSubmenuItem('javascript:', JText::_('COM_COMMUNITY_PHOTOS_ALBUM_DELETE'), "joms.api.albumRemove('" . $album->id . "', '" . $task . "');", true);
                 $this->view->addSubmenuItem('index.php?option=com_community&view=photos&task=editAlbum&albumid=' . $album->id . '&eventid=' . $event->id . '&referrer=albumgrp', JText::_('COM_COMMUNITY_EDIT_ALBUM'), '', true);
             }
             //$this->view->addSubmenuItem('index.php?option=com_community&view=photos&task=group', JText::_('COM_COMMUNITY_PHOTOS_ALL_EVENT_PHOTOS'), '' , false , '' , 'joms-right');
             //$this->view->addSubmenuItem('index.php?option=com_community&view=photos&task=event', JText::_('COM_COMMUNITY_PHOTOS_ALL_EVENT_PHOTOS'), '' , false , '' , 'joms-right');
             //->view->addSubmenuItem('index.php?option=com_community&view=photos&task=display', JText::_('COM_COMMUNITY_PHOTOS_ALL_PHOTOS'), '' , false , '' , 'joms-right');
             if ($my->id != 0) {
                 //$this->view->addSubmenuItem('index.php?option=com_community&view=photos&task=myphotos&userid=' . $my->id, JText::_('COM_COMMUNITY_PHOTOS_MY_PHOTOS'), '' , false , '' , 'joms-right');
             }
         }
         //$this->view->addSubmenuItem('index.php?option=com_community&view=photos&task=newalbum&eventid=' . $this->eventid, JText::_('COM_COMMUNITY_PHOTOS_CREATE_PHOTO_ALBUM'), '', true, '', '');
     }
     if ($task == 'photo') {
         if ($album->hasAccess($my->id, 'deletephotos')) {
             $this->view->addSubmenuItem('', JText::_('COM_COMMUNITY_PHOTOS_DELETE'), "joms_delete_photo();", true);
         }
         if ($my->id == $album->creator) {
             $this->view->addSubmenuItem('', JText::_('COM_COMMUNITY_PHOTOS_SET_AVATAR'), "joms_set_as_profile_picture();", true);
         }
         if ($my->id == $album->creator && $allowManagePhotos || $event->isAdmin($my->id) || COwnerHelper::isCommunityAdmin()) {
             $this->view->addSubmenuItem('', JText::_('COM_COMMUNITY_PHOTOS_SET_AS_ALBUM_COVER'), "joms_set_as_album_cover();", true);
         }
         if (!$config->get('deleteoriginalphotos')) {
             $this->view->addSubmenuItem('', JText::_('COM_COMMUNITY_DOWNLOAD_IMAGE'), "joms_download_photo();", true);
         }
         if ($eventid != '' && $task == 'myphotos') {
             $this->view->addSubmenuItem('index.php?option=com_community&view=photos&task=newalbum&eventid=' . $eventid, JText::_('COM_COMMUNITY_PHOTOS_CREATE_PHOTO_ALBUM'), '', true);
         } elseif ($task == 'myphotos') {
             $this->view->addSubmenuItem('index.php?option=com_community&view=photos&task=newalbum&userid=' . $my->id, JText::_('COM_COMMUNITY_PHOTOS_CREATE_PHOTO_ALBUM'), '', true);
         }
     }
     if ($task == "display" && $task == 'myphotos') {
         $this->view->addSubmenuItem('index.php?option=com_community&view=photos&task=newalbum&eventid=' . $eventid, JText::_('COM_COMMUNITY_PHOTOS_CREATE_PHOTO_ALBUM'), '', true);
     }
     //$this->view->addSubmenuItem('index.php?option=com_community&view=groups&task=viewgroup&eventid=' . $this->eventid, JText::_('COM_COMMUNITY_EVENTS_BACK_TO_EVENT'));
 }
Ejemplo n.º 5
0
 /**
  * Get photo list by album.
  */
 public function ajaxGetPhotosByAlbum($albumId, $photoId)
 {
     $filter = JFilterInput::getInstance();
     $albumId = $filter->clean($albumId, 'int');
     $model = CFactory::getModel('photos');
     $photos = $model->getPhotos($albumId, 1000);
     $count = count($photos);
     $list = array();
     $index = 0;
     $my = CFactory::getUser();
     $config = CFactory::getConfig();
     $canEdit = false;
     $album = JTable::getInstance('Album', 'CTable');
     $album->load($albumId);
     if ($album->type == 'group' && !$my->authorise('community.view', 'photos.group.album.' . $album->groupid, $album)) {
         $json = array('title' => $album->name, 'error' => JText::_('COM_COMMUNITY_NOT_ALLOWED_TO_ACCESS_SECTION'));
         die(json_encode($json));
     }
     if ($album->type != 'group' && !$my->authorise('community.view', 'photos.user.album.' . $albumId)) {
         $json = array('title' => $album->name, 'error' => JText::_('COM_COMMUNITY_NOT_ALLOWED_TO_ACCESS_SECTION'));
         die(json_encode($json));
     }
     $canEdit = $album->hasAccess($my->id, 'upload');
     if (!($count > 0)) {
         $json = array('title' => $album->name, 'error' => JText::_('COM_COMMUNITY_PHOTOS_NO_PHOTOS_UPLOADED'));
         die(json_encode($json));
     }
     for ($i = 0; $i < $count; $i++) {
         $photo = $photos[$i];
         $list[$i] = array('id' => $photo->id, 'caption' => $photo->caption, 'thumbnail' => $photo->getThumbURI(), 'original' => $photo->getOriginalURI(), 'url' => $photo->getImageURI());
         if (!$index && $photo->id == $photoId) {
             $index = $i;
         }
     }
     $isTaggable = false;
     if (COwnerHelper::isMine($my->id, $album->creator) || CFriendsHelper::isConnected($my->id, $album->creator)) {
         $isTaggable = true;
     }
     $canMovePhoto = !CAlbumsHelper::isFixedAlbum($album) && (COwnerHelper::isCommunityAdmin() || $album->creator == $my->id || isset($groupId) && $my->authorise('community.create', 'groups.photos.' . $groupId) || isset($eventId) && $my->authorise('community.create', 'events.photos.' . $eventId));
     $json = array();
     $json['list'] = $list;
     $json['index'] = $index;
     $json['can_edit'] = $canEdit ? true : false;
     $json['can_tag'] = $isTaggable;
     $json['can_move_photo'] = $canMovePhoto;
     $json['album_name'] = $album->name;
     $json['album_url'] = CRoute::_('index.php?option=com_community&view=photos&task=album&albumid=' . $album->id . ($album->groupid > 0 ? '&groupid=' . $album->groupid : ''));
     $json['photo_url'] = CRoute::getExternalURL('index.php?option=com_community&view=photos&task=photo&albumid=' . $album->id . '&photoid=___photo_id___' . ($album->groupid > 0 ? '&groupid=' . $album->groupid : ''), false);
     $json['my_id'] = (int) $my->id;
     $json['owner_id'] = (int) $album->creator;
     $json['is_admin'] = (int) COwnerHelper::isCommunityAdmin();
     $json['deleteoriginalphotos'] = $config->get('deleteoriginalphotos');
     $json['enablereporting'] = $config->get('enablereporting');
     $json['enablesharing'] = $config->get('enablesharethis') == 1;
     $json['enablelike'] = $config->get('likes_photo') == 1;
     // Languages.
     $json['lang'] = array('comments' => JText::_('COM_COMMUNITY_COMMENTS'), 'tag_photo' => JText::_('COM_COMMUNITY_TAG_THIS_PHOTO'), 'done_tagging' => JText::_('COM_COMMUNITY_PHOTO_DONE_TAGGING'), 'options' => JText::_('COM_COMMUNITY_OPTIONS'), 'download' => JText::_('COM_COMMUNITY_DOWNLOAD_IMAGE'), 'set_as_album_cover' => JText::_('COM_COMMUNITY_PHOTOS_SET_AS_ALBUM_COVER'), 'set_as_profile_picture' => JText::_('COM_COMMUNITY_PHOTOS_SET_AVATAR'), 'delete_photo' => JText::_('COM_COMMUNITY_PHOTOS_DELETE'), 'rotate_left' => JText::_('COM_COMMUNITY_PHOTOS_ROTATE_LEFT'), 'rotate_right' => JText::_('COM_COMMUNITY_PHOTOS_ROTATE_RIGHT'), 'next' => JText::_('COM_COMMUNITY_NEXT'), 'prev' => JText::_('COM_COMMUNITY_PREV'), 'share' => JText::_('COM_COMMUNITY_SHARE'), 'report' => JText::_('COM_COMMUNITY_REPORT'), 'upload_photos' => JText::_('COM_COMMUNITY_PHOTOS_UPLOAD_PHOTOS'), 'view_album' => JText::_('COM_COMMUNITY_VIEW_ALBUM'), 'move_to_another_album' => JText::_('COM_COMMUNITY_MOVE_TO_ANOTHER_ALBUM'));
     die(json_encode($json));
 }