コード例 #1
0
 /**
  * Returns an HTML tag for a media version in a media field. 
  *
  * @param string $ps_field The field to fetch media from
  * @param string $ps_version The media version to fetch
  * @param array $pa_options Optional array of options. Options are passed through to the media plugin htmlTag() method for rendering. In addition 
  *					getMediaTag() also implements the following options:
  *						page = the page to return a tag for in a multipage document.
  *						index = if media repeats, indicates the position of the value to return. The index is zero-based.
  *						checkAccess = array of access values to restrict returned values to.
  */
 public function getMediaTag($ps_field, $ps_version, $pa_options = null)
 {
     $va_tmp = explode('.', $ps_field);
     $va_check_access = isset($pa_options['checkAccess']) ? $pa_options['checkAccess'] : null;
     if ($va_tmp[0] === 'ca_object_representations' && $va_tmp[1] !== 'access') {
         if (!$this->_haveAccessToRepresentation($va_check_access)) {
             return null;
         }
     }
     return parent::getMediaTag($ps_field, $ps_version, isset($pa_options['index']) ? $pa_options['index'] : 0, $pa_options);
 }