ultimix
video_markup.php
Go to the documentation of this file.
1 <?php
2 
3  /*
4  * This source code is a part of the Ultimix Project.
5  * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6  * it's own license wich could be found from the corresponding files or sources.
7  * This source code is provided "as is" without any warranties or garanties.
8  *
9  * Have a nice day!
10  *
11  * @url http://ultimix.sorceforge.net
12  *
13  * @author Alexey "gdever" Dodonov
14  */
15 
27  {
38  var $CachedMultyFS = false;
39 
50  function __construct()
51  {
52  try
53  {
54  $this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
55  }
56  catch( Exception $e )
57  {
58  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
59  }
60  }
61 
88  private function compile_template( &$Settings , $TemplateName )
89  {
90  try
91  {
92  $Hash = $Settings->get_setting( 'hash' );
93  $Width = $Settings->get_setting( 'width' , '640' );
94  $Height = $Settings->get_setting( 'height' , '480' );
95  $Autoplay = $Settings->get_setting( 'autoplay' , '0' );
96 
97  $Code = $this->CachedMultyFS->get_template( __FILE__ , $TemplateName );
98 
99  $Code = str_replace(
100  array( '{hash}' , '{width}' , '{height}' , '{autoplay}' ) ,
101  array( $Hash , $Width , $Height , $Autoplay ) , $Code
102  );
103 
104  return( $Code );
105  }
106  catch( Exception $e )
107  {
108  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
109  }
110  }
111 
134  function compile_rutube( &$Settings )
135  {
136  try
137  {
138  return( $this->compile_template( $Settings , 'rutube.tpl' ) );
139  }
140  catch( Exception $e )
141  {
142  $Args = func_get_args();_throw_exception_object( __METHOD__ , $Args , $e );
143  }
144  }
145 
168  function compile_youtube( &$Settings )
169  {
170  try
171  {
172  return( $this->compile_template( $Settings , 'youtube.tpl' ) );
173  }
174  catch( Exception $e )
175  {
176  $Args = func_get_args();_throw_exception_object( __METHOD__ , $Args , $e );
177  }
178  }
179  }
180 
181 ?>