111 $this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
113 'gui::context_set::context_set_utilities' ,
'last' , __FILE__
115 $this->Search =
get_package(
'search' ,
'last' , __FILE__ );
116 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
120 catch( Exception $e )
156 catch( Exception $e )
192 if( $Options->get_setting(
'get_post_extraction_script' ,
false ) )
194 $ExtractionScript = $Options->get_setting(
'get_post_extraction_script' );
195 $SecurityParser =
get_package(
'security::security_utilities' ,
'last' , __FILE__ );
196 $Record = $SecurityParser->parse_http_parameters( $ExtractionScript );
197 $Form = $this->String->print_record( $Form , $Record );
202 catch( Exception $e )
226 private function compile_query_string( $CommonStateConfigPath )
230 $Conf = $this->CachedMultyFS->file_get_contents( $CommonStateConfigPath );
231 $Conf = str_replace(
'{prefix}' , $this->Prefix , $Conf );
232 $this->Settings->load_settings( $Conf );
233 $Fields = $this->Settings->get_setting(
'search_fields' ,
false );
235 if( $Fields !==
false )
237 $Fields = explode(
',' , $Fields );
239 $this->QueryString = $this->Search->build_query_string( $Fields );
242 catch( Exception $e )
266 private function build_query_string( $Options )
270 $this->QueryString =
'1 = 1';
271 $SearchString = $this->Security->get_gp(
'search_string' ,
'string' ,
'' );
273 if( strlen( $SearchString ) )
275 $CommonStateConfigFileName = $Options->get_setting(
276 'common_state_config_search_form' ,
'cfcxs_search_form'
279 $ComponentPath = dirname( $Options->get_setting(
'file_path' ) );
281 $CommonStateConfigPath =
"$ComponentPath/conf/$CommonStateConfigFileName";
283 if( $this->CachedMultyFS->file_exists( $CommonStateConfigPath ) )
285 $this->compile_query_string( $CommonStateConfigPath );
289 catch( Exception $e )
329 if( $IdList !==
false )
331 $Record = $this->ContextSetUtilities->get_data_record( $Options , $IdList );
333 $Record = $this->ContextSetUtilities->extract_data_from_request(
334 $Options , $Record ,
'get_post_extraction_script' , $this->Prefix
337 $Form = $this->ContextSetUtilities->set_form_data( $Form , $Record );
340 if( strpos( $Form ,
'{prefix}' ) !==
false )
342 $Form = str_replace(
'{prefix}' , $this->Prefix , $Form );
346 $Form = $this->ContextSet->compile_special_macro( $Options , $Form , $Changed );
350 catch( Exception $e )
378 private function set_paging_templates( &$Options , &$Paging )
382 $this->ContextSetUtilities->set_header_template( $Options , $Paging , $this->Prefix );
383 $this->ContextSetUtilities->set_item_template( $Options , $Paging , $this->Prefix );
384 $this->ContextSetUtilities->set_no_data_found_message( $Options , $Paging );
385 $this->ContextSetUtilities->set_footer_template( $Options , $Paging , $this->Prefix );
386 $this->ContextSetUtilities->set_main_settings( $Options , $Paging );
387 $this->ContextSetUtilities->set_grid_data( $Options , $Paging , $this->QueryString );
389 catch( Exception $e )
422 $Paging->set(
'FormId' , $this->Prefix.
'_form' );
423 $Paging->set(
'Prefix' , $this->Prefix );
427 '<input type="hidden" name="{prefix}_context_action" id="{prefix}_context_action" value="">
428 <input type="hidden" name="{prefix}_action" id="{prefix}_action" value="">
429 <input type="hidden" name="{prefix}_record_id" id="{prefix}_record_id" value="">';
431 $Paging->set(
'CustomButtons' , $HeaderFields );
433 $this->build_query_string( $Options );
435 $this->set_paging_templates( $Options , $Paging );
437 catch( Exception $e )
473 $Template = $Options->get_setting( $TemplateName ,
'' );
475 if( $Template !==
'' )
477 $Template = dirname( $Options->get_setting(
'file_path' ) ).
"/res/templates/$TemplateName.tpl";
479 $Template = $this->CachedMultyFS->file_get_contents( $Template );
484 catch( Exception $e )