|
|
@@ -23,11 +23,21 @@ class BxAlbumsModule extends BxBaseModTextModule
|
|
|
parent::__construct($aModule);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Display form for adding media to the album.
|
|
|
+ * @param $iContentId album content id where media will be added, if it's not provided then it's determined from 'id' GET variable
|
|
|
+ * @return HTML string with form, all necessary CSS and JS files are automatically added to the HEAD section of the site HTML. On error false or empty string is returned.
|
|
|
+ */
|
|
|
public function serviceEntityAddFiles ($iContentId = 0)
|
|
|
{
|
|
|
return $this->_serviceEntityForm ('editDataForm', $iContentId, 'bx_albums_entry_add_images');
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Delete file and album association, also file views, votes, comments, meta data are also deleted
|
|
|
+ * @param $iFileId file ID
|
|
|
+ * @return true on success of false on error
|
|
|
+ */
|
|
|
public function serviceDeleteFileAssociations($iFileId)
|
|
|
{
|
|
|
$CNF = &$this->_oConfig->CNF;
|
|
|
@@ -66,21 +76,41 @@ class BxAlbumsModule extends BxBaseModTextModule
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Display media EXIF information.
|
|
|
+ * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
|
|
|
+ * @return HTML string with EXIF info. On error empty string is returned.
|
|
|
+ */
|
|
|
public function serviceMediaExif ($iMediaId = 0)
|
|
|
{
|
|
|
return $this->_serviceTemplateFunc ('mediaExif', $iMediaId, 'getMediaInfoById');
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Display media comments block.
|
|
|
+ * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
|
|
|
+ * @return HTML string with comments. On error false or empty string is returned.
|
|
|
+ */
|
|
|
public function serviceMediaComments ($iMediaId = 0)
|
|
|
{
|
|
|
return $this->_entityComments($this->_oConfig->CNF['OBJECT_COMMENTS_MEDIA'], $iMediaId);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Display media author block.
|
|
|
+ * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
|
|
|
+ * @return HTML string with block content. On error false or empty string is returned.
|
|
|
+ */
|
|
|
public function serviceMediaAuthor ($iMediaId = 0)
|
|
|
{
|
|
|
return $this->_serviceTemplateFunc ('mediaAuthor', $iMediaId, 'getMediaInfoById');
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Display media social sharing buttons block.
|
|
|
+ * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
|
|
|
+ * @return HTML string with block content. On error false or empty string is returned.
|
|
|
+ */
|
|
|
public function serviceMediaSocialSharing ($iMediaId = 0, $bEnableCommentsBtn = false, $bEnableSocialSharing = true)
|
|
|
{
|
|
|
if (!$iMediaId)
|
|
|
@@ -108,6 +138,12 @@ class BxAlbumsModule extends BxBaseModTextModule
|
|
|
));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Display media preview block.
|
|
|
+ * @param $iMediaId media ID, if it's omitted then it's taken from 'id' GET variable.
|
|
|
+ * @param $mixedContext current context to navigate to next and previous file, possible values: popular, public, author. If omitted then value from 'context' GTE variable is taken. Default context is 'album' - when nothin is specified.
|
|
|
+ * @return HTML string with block content. On error false or empty string is returned.
|
|
|
+ */
|
|
|
public function serviceMediaView ($iMediaId = 0, $mixedContext = false)
|
|
|
{
|
|
|
if (!$iMediaId)
|
|
|
@@ -129,21 +165,41 @@ class BxAlbumsModule extends BxBaseModTextModule
|
|
|
return CHECK_ACTION_RESULT_NOT_ALLOWED;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Display block for browsing recently uploaded media files.
|
|
|
+ * @param $sUnitView unit view mode: gallery
|
|
|
+ * @param $bDisplayEmptyMsg display 'empty' message when nothing to browse, or return empty string.
|
|
|
+ * @param $bAjaxPaginate use AJAX or regular paginate.
|
|
|
+ * @return HTML string with block content. On error false or empty string is returned.
|
|
|
+ */
|
|
|
public function serviceBrowseRecentMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
|
|
|
{
|
|
|
return $this->_serviceBrowse ('recent', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Display featured media.
|
|
|
+ * For the list of params @see BxAlbumsModule::serviceBrowseRecentMedia
|
|
|
+ */
|
|
|
public function serviceBrowseFeaturedMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
|
|
|
{
|
|
|
return $this->_serviceBrowse ('featured', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Display popular media.
|
|
|
+ * For the list of params @see BxAlbumsModule::serviceBrowseRecentMedia
|
|
|
+ */
|
|
|
public function serviceBrowsePopularMedia ($sUnitView = false, $bDisplayEmptyMsg = true, $bAjaxPaginate = true)
|
|
|
{
|
|
|
return $this->_serviceBrowse ('popular', array('unit_view' => $sUnitView), BX_DB_PADDING_DEF, $bDisplayEmptyMsg, $bAjaxPaginate, 'SearchResultMedia');
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Display favorite media for particular profile.
|
|
|
+ * @param $iProfileId profile ID, if omitted then 'profile_id' GET variable is used
|
|
|
+ * @param $aParams additional params for browsing such as 'unit_view'
|
|
|
+ */
|
|
|
public function serviceBrowseFavoriteMedia ($iProfileId = 0, $aParams = array())
|
|
|
{
|
|
|
$oProfile = null;
|