Gino Multimedia  0.1
Modulo di gestione di contenuti multimediali per Gino CMS
 Tutto Strutture dati File Funzioni Variabili Gruppi Pagine
class.multimediaVideo.php
Vai alla documentazione di questo file.
1 <?php
29 
30  function __construct($id, $instance) {
31 
32  parent::__construct($id, $instance);
33 
34  }
35 
43  public function structure($id) {
44 
45  $structure = parent::structure($id);
46 
47  $structure['type'] = new hiddenField(array(
48  'name'=>'type',
49  'required'=>true,
50  'label'=>$this->_fields_label['type'],
51  'value'=>VIDEO_CHOICE
52  ));
53 
54  $base_path = $this->_controller->getBaseAbsPath('video');
55 
56  $structure['video_platform'] = new foreignKeyField(array(
57  'name'=>'video_platform',
58  'value'=>$this->video_platform,
59  'label'=>$this->_fields_label['video_platform'],
60  'lenght'=>11,
62  'fkey_id'=>'id',
63  'fkey_field'=>'name',
64  'fkey_where'=>'instance=\''.$this->_controller->getInstance().'\'',
65  'fkey_order'=>'name'
66 
67  ));
68 
69  return $structure;
70  }
71 
78  public function thumbPath($controller) {
79 
80  if($this->thumb) {
81  return $controller->getBasePath('thumb').'/'.$this->thumb;
82  }
83  else {
84  return $controller->defaultVideoThumbPath();
85  }
86 
87  }
88 
96  public function getMoogalleryListJs($controller, $media_base_url) {
97 
98  $name = "<a href=\"".$media_base_url.'/'.$this->id."\">".$this->name."</a>";
99 
100  $description = $this->description;
101  if($this->tags) {
102  $description .= "<p>"._('Tag:').' '.$this->tags."</p>";
103  }
104 
105  $credits = $this->credits;
106  if($this->license) {
107  $license = new multimediaLicense($this->license, $controller);
108  $credits .= "<br />"._("Licenza: ")."<a href=\"".$license->url."\" target=\"_blank\">".$license->name."</a>";
109  }
110 
111  $video_platform = new multimediaVideoPlatform($this->video_platform, $controller);
112 
113  $js = "{
114  thumb: '".$this->thumbPath($controller)."',
115  ".$video_platform->name.": '".$this->video_code."',
116  video_width: ".$this->video_width.",
117  video_height: ".$this->video_height.",
118  title: '".jsVar($name)."',
119  description: '".jsVar($description)."',
120  credits: '".jsVar($credits)."'
121  }";
122 
123  return $js;
124 
125  }
126 
133  public function show($controller) {
134 
135  $video_platform = new multimediaVideoPlatform($this->video_platform, $controller);
136 
137  $buffer = "<iframe frameborder=\"0\" width=\"".$this->video_width."\" height=\"".$this->video_height."\" src=\"".$video_platform->base_url.$this->video_code."\">";
138  $buffer .= _("Il tuo browser non supporta gli iframe");
139  $buffer .= "</iframe>";
140 
141  return $buffer;
142 
143  }
144 }
145 
146 ?>