To use the ADFO class write admin_form\ADFO::function_name(); or
use admin_form\ADFO as ADFO; ADFO::function_name();
Load a list from an id and return the html. Pretty much the same thing that the shortcode does!
Html
Returns the html of a single record.
Html
Load a list from an id and return the html defined in the frontend view
Int | -1 if he fails to count
Load all dbp lists
Array
Estrae l'elenco delle colonne di una lista.
ADFO_list_setting[]|array
Returns the list of primary keys of a list. The extracted fields are the aliases!
@return array [table=>primary_name, ...]
Return the data or the model of a list
The difference between $return = "raw" and $raw_data = true is that with $return = $raw all the data from the tables concerned are extracted, while with $raw_data = true the raw data is always extracted, but only from columns extracted from the query.
Mixed
Returns the data of a single record unchanged from the list settings. This data can be passed to save_data after being modified to be saved.
Edit a record
use admin_form\ADFO as ADFO; $list_id = 'insert_the_id_of_your_list'; $record_id = 'insert_the_id_of_a_record'; $item = ADFO::get_detail($list_id, $record_id); $item->my_column = "new_value"; $ris = ADFO::save_data($list_id, $item);
\stdClass|false
Returns the data of a single record unchanged from the list settings. This data can be passed to save_data after being modified to generate a new record from data in another record. Unlike get_detail, clone_detail removes any primary keys and calculated fields from the extracted results.
Clone a record
use admin_form\ADFO as ADFO; $list_id = 'insert_the_id_of_your_list'; $record_id = 'insert_the_id_of_a_record'; $item = ADFO::get_clone_detail($list_id, $record_id); $ris = ADFO::save_data($list_id, $item);
\stdClass|false
Save the data of one or more lines in a list.
Create a new record
use admin_form\ADFO as ADFO; $list_id = 'insert_the_id_of_your_list'; $item = (object)['my_column'=>'val']; $ris = ADFO::save_data($list_id, $item);
If all fields are empty (and they are all configured) remove the record
use admin_form\ADFO as ADFO;
$item = ADFO::get_detail('77', 5);
foreach ($item as $k=>&$i) {
// if primary key == "dbp_id"
if ($k == "dbp_id") continue;
$i = '';
}
// remove record 5
$ris = ADFO::save_data('77', $item);
array
Restituisce la classe ADFO_render_list
ADFO_render_list
$list = admin_form\ADFO::render(6, 'get'); // ($list_id:int, $mode:string); $mode is optional
$list->set_color('pink'); // Change the color of the list from the one you choose
$list->table("", false); // (custom_class:string, table_sort:bool)
$list->search(false); // optional (show_button:bool)
$list->single_field_search('column_name'); // Adds a text field to search in a single column
$list->submit(); // Adds buttons for search
$list->pagination('select');
$list->end(); // Required!
Print a link to export data
Void
// Print the link to download the $id list.
ADFO::draw_export_btn($dbp_id);
Given a row in a list of data ($row) returns the id(s) to extract the details of the record. The string version is used in links.
Mixed
// Generate the link for a popup
$id = ADFO::get_ids_value_from_list($dbp_id, $row);
popup link'); ?>
<?php
PinaCode::set_var("myvar","foobar");
echo PinaCode::get_var("myvar","default");
?>
<?php
PinaCode::execute_shortcode('...');
?>
<?php
PinaCode::math_and_logic('3 > 6');
?>
function pinacode_fn_hello_world($short_code_name, $attributes) {
return 'HELLO WORLD';
}
pinacode_set_functions('hello_world', 'pinacode_fn_hello_world');
function pinacode_attr_fn_new_upper($gvalue, $param, $shortcode_obj) {
if (is_string($gvalue)) {
$gvalue = strtoupper($gvalue);
}
return $gvalue;
}
pinacode_set_attribute(['new_upper'], 'pinacode_attr_fn_new_upper');