58 $this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
59 $this->Database =
get_package(
'database' ,
'last' , __FILE__ );
60 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
61 $this->String =
get_package(
'string' ,
'last' , __FILE__ );
87 private function prepare_textarea_settings( &$Settings )
91 $Settings->set_undefined(
'toolbar' ,
'ultimix_full' );
92 $Settings->set_undefined(
'name' ,
'editor');
93 $Settings->set_undefined(
'class' ,
'width_640 height_480' );
131 $Settings->set_setting(
'text' , $Data );
133 $this->prepare_textarea_settings( $Settings );
135 $SimpleEditor = $Settings->get_setting(
'simple_editor' , 0 );
136 $File = $SimpleEditor == 1 ?
'simple_editor.tpl' :
'editor.tpl';
137 $EditorTemplate = $this->CachedMultyFS->get_template( __FILE__ , $File );
138 $RawSettings = $Settings->get_raw_settings();
140 return( $this->String->print_record( $EditorTemplate , $RawSettings ) );
142 catch( Exception $e )
174 if( $Settings->get_setting(
'query' ,
false ) !== false )
176 $Query = $Settings->get_setting(
'query' );
178 $Records = $this->Database->query( $Query );
179 $Records = $this->Database->fetch_results( $Records );
185 $First = explode(
'|' , $Settings->get_setting(
'first' ,
false ) );
186 $Second = explode(
'|' , $Settings->get_setting(
'second' ,
false ) );
189 return( array( $First , $Second ) );
191 catch( Exception $e )
227 private function compile_select_options( $First , $Second , $SelectedId )
233 foreach( $First as $k => $v )
237 if( $SelectedId !==
false && $SelectedId == $v )
239 $Selected =
'selected ';
242 $PlaceHolders = array(
'{selected}' ,
'{value}' ,
'{title}' );
243 $Data = array( $Selected , $v , $Second[ $k ] );
244 $Code .= $this->CachedMultyFS->get_template( __FILE__ ,
'select_option.tpl' );
245 $Code = str_replace( $PlaceHolders , $Data , $Code );
250 catch( Exception $e )
282 $Name = $Settings->get_setting(
'name' );
283 $Class = $Settings->get_setting(
'class' ,
'width_320 flat' );
287 $SelectedId = $this->Security->get_gp(
288 $Name ,
'string' , $Settings->get_setting(
'value' ,
false )
291 $Code = $this->CachedMultyFS->get_template( __FILE__ ,
'select_start.tpl' );
292 $Code = str_replace( array(
'{name}' ,
'{class}' ) , array( $Name , $Class ) , $Code );
294 $Code .= $this->compile_select_options( $First , $Second , $SelectedId );
296 return( $Code.$this->CachedMultyFS->get_template( __FILE__ ,
'select_end.tpl' ) );
298 catch( Exception $e )
330 $From = $Settings->get_setting(
'from' , intval( date(
'Y' ) ) - 10 );
331 $To = $Settings->get_setting(
'to' , intval( date(
'Y' ) ) + 10 );
333 for( $i = $From ; $i <= $To ; $i++ )
337 $First = implode(
'|' , $First );
339 return(
"{select:first=$First;second=$First;".$Settings->get_raw_settings().
"}" );
341 catch( Exception $e )