UI system for rapid adding/editing of any number of (sub-)records
This is the code documentation for the SproutCMS project
Search documentation |
class MultiEditUI system for rapid adding/editing of any number of (sub-)records
Example$images = MultiEdit::load('gallery_images', ['gallery_id' => $gallery_id], 'record_order'); MultiEdit::itemName('Image'); MultiEdit::reorder(); MultiEdit::setPostAddJavaScriptFunc('load_thumbnails'); MultiEdit::display('images', $images, @$_SESSION['gallery']['field_errors']['multiedit_images']); Variables
Functions
public displayvoid MultiEdit::display ( string $key , array|null $data , array $errors ); Displays a multiedit field public itemNamevoid MultiEdit::itemName ( mixed $item_name ); Set the item name for a multiedit. e.g. 'image' public loadarray MultiEdit::load ( string $table , array $where [, string|array $order ] ); Returns an array of data, which should be put into a view, and passed into MultiEdit::display. public recordEmptyboolean MultiEdit::recordEmpty ( array $record , array $defaults ); Returns true if the multiedit record is empty, false otherwise public reordervoid MultiEdit::reorder ( ); Enable multiedit reordering public setPostAddJavaScriptFuncvoid MultiEdit::setPostAddJavaScriptFunc ( string $function_name ); Set the name of a javascript function to call after each multiedit item is added The JavaScript function is called with the following arguments: $div jQuery element for the outer div data Array of field data OR null for a new record idx The record index |
Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Monday, 3rd April, 2023 at 02:59 pm |