Esempio n. 1
0
  */
 $json_columns =& $json['columns'];
 /**
  * This will translate a column identifier, to the key used in `$json_row`.
  * @var string[]
  */
 $names_xlat = array();
 // Prepare arguments to be passed to the "before" filter
 // ====================================================================
 $table_key = strval(@$_POST['table_key']);
 // New browseStorage\TableClass object
 $tab_obj = new TableClass($table_key);
 $tab =& $tab_obj->tab;
 // shortcut
 // Get configured table primary keys (IDs)
 $config_ids = $tab_obj->config_ids();
 // Retrieve IDs from $_POST into array(column_id => value)
 $req_ids = $tab_obj->req_ids($config_ids);
 $no_req_ids = count($req_ids) <= 0;
 // Setup common `$json` properties
 $json['can_edit'] = intval(@$tab['editable']) & (TableClass::NOT_EDITABLE | TableClass::EDITABLE_ON_REQUEST | TableClass::EDITABLE_IMMEDIATELY);
 $json['can_insert'] = (intval(@$tab['editable']) & TableClass::CAN_INSERT) != 0;
 $json['can_delete'] = (intval(@$tab['editable']) & TableClass::CAN_DELETE) != 0;
 // Get configured table column names
 $config_names = $tab_obj->config_names();
 $auto_cols = count($config_names) <= 0;
 // Retrieve columns names into `$json['columns']`, and setup $options_pending_sql
 $options_pending_sql = array();
 foreach ($config_names as $col => $a) {
     if (!is_array($a)) {
         $a = array($a);