Beispiel #1
0
 function format_image_view($content, $img_viewer_attributes, $img_attributes)
 {
     $img_content = self::$img_dir . $content;
     $img_attributes["src"] = $img_content;
     $img_start = BuildHTML::start_element(self::$div, $img_viewer_attributes);
     $img = BuildHTML::start_element(self::$img, $img_attributes);
     $img_end = BuildHTML::end_element(self::$div);
     self::$viewer_content = $img_start . $img . $img_end;
 }
 /**
  * function getMediaLink
  *
  * @param  $media_data -
  * @return string      - the html string containing the appropriate link for the given media
  */
 public function getMediaLink($media_data = array())
 {
     $media_type = $media_data[1];
     if (isset($media_data['type'])) {
         $media_type = $media_data['type'];
     }
     $media_value = $media_data[2];
     if (isset($media_data['value'])) {
         $media_value = $media_data['value'];
     }
     $media_real_file_name = $media_data[3];
     $path_to_media = $media_data[4];
     $media_title = isset($media_data[5]) ? $media_data[5] : null;
     if (isset($media_data['title'])) {
         $media_title = $media_data['title'];
     }
     if ($media_type === _IMAGE || $media_type === _MONTESSORI) {
         $viewing_prefs = isset($this->viewing_preferences[_IMAGE]) ? $this->viewing_preferences[_IMAGE] : null;
         return ImageViewer::link($this->media_path, $media_value, $media_real_file_name, $path_to_media, $viewing_prefs, $media_title, $media_type);
     } else {
         if ($media_type === _SOUND || $media_type === _PRONOUNCE) {
             $viewing_prefs = isset($this->viewing_preferences[_SOUND]) ? $this->viewing_preferences[_SOUND] : null;
             return AudioPlayer::link($this->media_path, $media_value, $media_real_file_name, $path_to_media, $viewing_prefs, $media_title, $media_type);
         } else {
             if ($media_type === _VIDEO || $media_type === _LABIALE || $media_type === _LIS || $media_type === _FINGER_SPELLING) {
                 $viewing_prefs = isset($this->viewing_preferences[_VIDEO]) ? $this->viewing_preferences[_VIDEO] : null;
                 return VideoPlayer::link($this->media_path, $media_value, $media_real_file_name, $path_to_media, $viewing_prefs, $media_title, $media_type);
             } else {
                 if ($media_type === _DOC) {
                     $viewing_prefs = isset($this->viewing_preferences[_DOC]) ? $this->viewing_preferences[_DOC] : null;
                     return DocumentViewer::link($this->media_path, $media_value, $media_real_file_name, $path_to_media, $viewing_prefs, $media_title);
                 } else {
                     if ($media_type === _LINK) {
                         $viewing_prefs = isset($this->viewing_preferences[_LINK]) ? $this->viewing_preferences[_LINK] : null;
                         return ExternalLinkViewer::view($this->media_path, $media_value, $viewing_prefs);
                     } else {
                         return '';
                     }
                 }
             }
         }
     }
 }