public function getContents($foldersOnly = false, $paginated = false) { $folderName = $this->getTitle(); $uri = $this->baseURI . '/' . ltrim($folderName, '/\\'); $relativePath = $this->getRelativePath(); $media = new EasyBlogMediaManager(); $contents = $media->getItems($this->file, $uri, $relativePath, $this->includeVariation, false, array('index.html', '.svn', 'CVS', '.DS_Store', '__MACOSX'), $foldersOnly, $this->place, $paginated)->toArray(); return $contents; }
/** * Returns a list of JomSocial albums and photos * * @access public * @param null * @return null */ public function listFlickrItems() { $ajax = EasyBlogHelper::getHelper('Ajax'); $cfg = EasyBlogHelper::getConfig(); $my = JFactory::getUser(); $profile = EasyBlogHelper::getTable('Profile'); $profile->load($my->id); // Show an error message if someone tries to force their way in. if (!$cfg->get('layout_media_flickr')) { return $ajax->fail(JText::_('COM_EASYBLOG_THIS_FEATURED_IS_DISABLED')); } // @rule: Test if the user is really logged in or not. if ($my->id <= 0) { return $ajax->fail(JText::_('COM_EASYBLOG_THIS_FEATURED_IS_DISABLED')); } // @rule: Test if the user is already associated with Flickr $oauth = EasyBlogHelper::getTable('Oauth'); $associated = $oauth->loadByUser($my->id, EBLOG_OAUTH_FLICKR); if (!$associated) { return $ajax->fail(JText::_('Please associate your account with Flickr first.')); } $path = str_ireplace(array('/', '\\'), '', JRequest::getVar('path')); // If fromPath is passed in the query, we know that the user is querying an item instead. if (!empty($path)) { $media = new EasyBlogMediaManager(EBLOG_MEDIA_SOURCE_FLICKR); $item = $media->getItem($path, '')->toArray(); return $ajax->success($item); } $media = new EasyBlogMediaManager(EBLOG_MEDIA_SOURCE_FLICKR); $items = $media->getItems('', '')->toArray(); return $ajax->success($items); }