AAAAcomponents/com_chronoforms/form_actions/db_multi_record_loader/db_multi_record_loader.ctp 0000604 00000031311 15140257434 0034733 0 ustar 00 home/academiac/www/administrator
Header(array('basic' => 'Basic', 'advanced' => 'Advanced', 'displayer' => 'Data Displayer', 'help' => 'Help'), 'db_multi_record_loader_config_{n}'); ?>
tabStart('basic'); ?>
input('action_db_multi_record_loader_{n}_dbfield_config', array('type' => 'text', 'label' => "DB Field", 'class' => 'medium_input', 'value' => '', 'smalldesc' => "The field name which will be used to query the table record, if left empty then all records will be loaded.")); ?>
getTableList();
$options = array();
foreach($tables as $table){
$options[$table] = $table;
}
?>
input('action_db_multi_record_loader_{n}_table_name_config', array('type' => 'select', 'label' => 'Table', 'options' => $options, 'empty' => " - ", 'class' => 'medium_input', 'smalldesc' => "The table name to load the data from.")); ?>
input('action_db_multi_record_loader_{n}_request_param_config', array('type' => 'text', 'label' => "Request Param", 'class' => 'medium_input', 'value' => '', 'smalldesc' => "The param name which will exist in the request url to the form, its value will be used to load the target db records, if the value of this parameter is an array then the array values will be used inside 'IN' statement.")); ?>
input('action_db_multi_record_loader_{n}_model_id_config', array('type' => 'text', 'label' => "Model ID", 'class' => 'medium_input', 'value' => '', 'smalldesc' => "The key under which the loaded record data will be stored in the form->data array.
this is obligatory, if left empty then a camilized version of the table name will be used, e.g: jos_my_table = JosMyTable")); ?>
input('action_db_multi_record_loader_{n}_fields_config', array('type' => 'text', 'label' => "Fields", 'class' => 'big_input', 'label_over' => true, 'smalldesc' => "List of comma separated fields names to load from this table (field_name1,field_name2..etc), leave empty to load all fields.")); ?>
tabEnd(); ?>
tabStart('advanced'); ?>
input('action_db_multi_record_loader_{n}_load_data_config', array('type' => 'select', 'label' => 'Load Data', 'options' => array(0 => 'No', 1 => 'Yes'), 'class' => 'medium_input', 'smalldesc' => "Do you want to load the data of this model OR just use it in the models associations ?")); ?>
input('action_db_multi_record_loader_{n}_load_type_config', array('type' => 'select', 'label' => 'Data Load Type', 'options' => array('all' => 'ALL', 'first' => 'First Record'), 'smalldesc' => "Which data to load ? All data (normal behavior) OR first record only (similar to the Record Loader Action).")); ?>
input('action_db_multi_record_loader_{n}_enable_association_config', array('type' => 'select', 'label' => 'Enable Associations', 'options' => array(0 => 'No', 1 => 'Yes'), 'class' => 'medium_input', 'smalldesc' => "Do you want to enable the associations for this model ? this will allow you to load data from multiple tables and have them associated together.")); ?>
input('action_db_multi_record_loader_{n}_join_type_config', array('type' => 'select', 'label' => 'JOIN Type', 'options' => array('INNER' => 'INNER', 'LEFT' => 'LEFT', 'RIGHT' => 'RIGHT'), 'smalldesc' => "The JOIN type used in case of an association.")); ?>
input('action_db_multi_record_loader_{n}_join_rule_config', array('type' => 'text', 'label' => 'JOIN Rule', 'class' => 'big_input', 'smalldesc' => "The JOIN rule used in case of an association, example: MODEL_ID1.field1=MODEL_ID2.field2")); ?>
input('action_db_multi_record_loader_{n}_associated_models_config', array('type' => 'text', 'label' => "Associated Models", 'class' => 'big_input', 'label_over' => true, 'smalldesc' => "list of models ids to associate this one with, comma separated, exactly as they are in other 'Multi DB Record Loader' configs.")); ?>
input('action_db_multi_record_loader_{n}_group_model_data_config', array('type' => 'select', 'label' => 'Group Model Data', 'options' => array(0 => 'No', 1 => 'Yes'), 'class' => 'medium_input', 'smalldesc' => "This will add a bit of overhead on the server, but will remove any duplicates from the results and will group any associated models data under the same item.")); ?>
input('action_db_multi_record_loader_{n}_content1_config', array('type' => 'textarea', 'label' => 'WHERE statement', 'rows' => 10, 'cols' => 50, 'smalldesc' => "The code used for the WHERE statement, some notes:
1 - leave empty to use the default request param with column name formula (associations not enabled), OR to load ALL records (associations enabled).
2 - don't use the WHERE word.
3 - in case of associations, pay attention to write the join rule, e.g: `User`.`id` = `Profile`.`user_id`
4 - in case of associations, if other associated models have WHERE statements then all the WHERE data will be appended using AND.
5 - You can use PHP code with tags.
")); ?>
tabEnd(); ?>
tabStart('displayer'); ?>
input('action_db_multi_record_loader_{n}_enable_data_displayer_config', array('type' => 'select', 'label' => 'Enable Data Displayer', 'options' => array(0 => 'No', 1 => 'Yes'), 'class' => 'medium_input', 'smalldesc' => "Do you want to enable the generic data displayer ?")); ?>
input('action_db_multi_record_loader_{n}_data_display_fields_config', array('type' => 'text', 'label' => "Display Fields", 'class' => 'big_input', 'smalldesc' => "Enter comma separated list of fields and titles in this format:
field_name:Field_Title
e.g:field1:Name,field2:Company")); ?>
input('action_db_multi_record_loader_{n}_data_order_fields_config', array('type' => 'text', 'label' => "Order Fields", 'class' => 'big_input', 'smalldesc' => "Enter comma separated list of fields names to be sortable.")); ?>
input('action_db_multi_record_loader_{n}_enable_pagination_config', array('type' => 'select', 'label' => 'Enable Pagination', 'options' => array(0 => 'No', 1 => 'Top', 2 => 'Bottom'), 'class' => 'medium_input', 'smalldesc' => "Do you want to enable the pagination feature for the records returned ? if so, where do you want it displayed ?")); ?>
input('action_db_multi_record_loader_{n}_pagination_limit_config', array('type' => 'text', 'label' => "Limit", 'class' => 'small_input', 'smalldesc' => "The number of records per page.")); ?>
tabEnd(); ?>
tabStart('help'); ?>
- Select the table name to load the data from
- Your table must have a primary key.
- Please give your table a unique model id, e.g: jos_content can have "Article".
- If you disable "Load Data" then no db query will run for this model, this is useful when you only need to create an association with another model loading the data.
- If you enable the associations then your model will check for any associated models to load the data from.
- Associated models should have a list of models connected to the current model somehow, these models should be loaded through similar actions in the same form event.
- Grouping model data is useful when you have lots of duplicated records in the data returned, this is usually the case when you have 1 or more models associated.
- You may enable data pagination under the pagination tab, please use this variable to show the pagination limit boxes or links:
$form->paginatior_footer
tabEnd(); ?>