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__ );
95 $Name = $Settings->get_setting(
'name' );
97 $Code =
'{checkbox_ex:self_class=_'.$Name.
'_header_checkbox;children_selector=._'.
98 $Name.
"_item_checkbox;name=$Name}";
102 catch( Exception $e )
134 $Name = $Settings->get_setting(
'name' );
135 $Id = $Settings->get_setting(
'id' );
137 $Code =
'{checkbox_ex:self_class=_'.$Name.
'_item_checkbox;parent_selector=._'.$Name.
138 "_header_checkbox;id=_id_$Id;name=_id_$Id}";
142 catch( Exception $e )
178 private function compile_checkboxes( $Cols , $Value , $Records )
184 foreach( $Records as $r )
186 if( $Counter == $Cols )
189 $Code .= $this->CachedMultyFS->get_template( __FILE__ ,
'checkbox_set_line_end.tpl' );
192 $Value = $this->Security->get_gp(
'_id_'.$r->id ,
'command' , $Value );
193 $Code .= $this->CachedMultyFS->get_template( __FILE__ ,
'checkbox_set_item.tpl' );
194 $PlaceHolders = array(
'{id}' ,
'{value}' ,
'{title}' );
195 $Data = array( $r->id , $Value , $r->title );
196 $Code = str_replace( $PlaceHolders , array( $r->id , $Value , $r->title ) , $Code );
202 catch( Exception $e )
238 private function compile_records( $Cols , $Value , $Records )
242 $Code = $this->CachedMultyFS->get_template( __FILE__ ,
'checkbox_set_start.tpl' );
244 $Code .= $this->compile_checkboxes( $Cols , $Value , $Records );
246 return( $Code .= $this->CachedMultyFS->get_template( __FILE__ ,
'checkbox_set_end.tpl' ) );
248 catch( Exception $e )
280 $Cols = $Settings->get_setting(
'cols' , 3 );
281 $Value = $Settings->get_setting(
'checked_all' ,
'0' ) ==
'0' ?
'off' :
'on';
282 $Query = $Settings->get_setting(
'query' );
284 $Records = $this->Database->query( $Query );
285 $Records = $this->Database->fetch_results( $Records );
287 $Code = $this->compile_records( $Cols , $Value , $Records );
291 catch( Exception $e )
323 $Settings->set_undefined(
'default' , 0 );
324 $Settings->set_undefined(
'id' , md5( microtime() ) );
325 $Settings->set_undefined(
'label' ,
'' );
327 $Type = $Settings->get_setting(
'type' ,
'double' );
329 $Code = $this->CachedMultyFS->get_template( __FILE__ , $Type.
'_state_checkbox.tpl' );
331 $Code = $this->String->print_record( $Code , $Settings->get_raw_settings() );
335 catch( Exception $e )
365 private function compile_selectors( &$Settings )
369 $SelfClass = $Settings->get_setting(
'self_class' ,
false );
370 $ParentSelector = $Settings->get_setting(
'parent_selector' ,
false );
371 $SiblingsSelector = $Settings->get_setting(
'siblings_selector' ,
'.'.$SelfClass );
372 $ChildrenSelector = $Settings->get_setting(
'children_selector' ,
false );
373 $Sel = $ParentSelector !==
false ?
" parent_selector='$ParentSelector'" :
'';
374 $Sel = $SiblingsSelector !==
false ? $Sel.
" siblings_selector='$SiblingsSelector'" : $Sel;
375 return( $ChildrenSelector !==
false ? $Sel.
" children_selector='$ChildrenSelector'" : $Sel );
377 catch( Exception $e )
409 $SelfClass = $Settings->get_setting(
'self_class' ,
false );
410 $Sel = $this->compile_selectors( $Settings );
412 $Id = $Settings->get_setting(
'id' ,
'' );
413 $Name = $Settings->get_setting(
'name' );
414 $Code = $this->CachedMultyFS->get_template( __FILE__ ,
'checkbox_ex.tpl' );
415 $PlaceHolders = array(
'{id}' ,
'{name}' ,
'{self_class}' ,
'{selector}' );
416 $Data = array( $Id , $Name , $SelfClass , $Sel );
417 $Code = str_replace( $PlaceHolders , $Data , $Code );
421 catch( Exception $e )