In the interest of releasing something, I am not going to use ajax here
for now. Goal is to have this view behave similar to the original Events
view in the original skin. Currently you can:
* Paginate events
* Filter events using the sidebar
Bug: Filter elements are unset when paginating.
The log functionality is similar to that of the classic skin, though
with fewer options. Initial filtering support is for only component type.
Also displays a fixed last 100 log events, sorted by TimeKey ascending.
I am keying the input type off of the 'Hint' and 'Type' columns
in the Config table. It would be easier if I just added an 'inputtype'
column to the Config table, and I might do that later, but I don't want to
mess with the database right now.
Still a lot of work to do such as displaying the proper input
type based on option, however basic tabbing and saving works,
as does the on-hover tooltip (I think I put that in this commit).
The EventsController calls createListThumbnail() to build a list
of thumbnail data which is then passed to the view to be looped though.
Also had to change how I loop through $events so that I can match up the
indexes in $events with the indexes in $thumbData
This function determines the scaled width and height of the image for the
thumbnail, as well as other information relating to the frame with the
highest score in this event.
A lot of this code was re-worked from the original includes/functions.php
file found in the classic zoneminder skin to work with CakePHP.
Function seems to work, but looks like it could use some serious re-factoring.
First I tell extractNamedParams() which params I care about (ignore the rest),
then I loop through the returned results and build my query via named params.
Finally I pass the named params into the $conditions array for paginate to use.
Added a method that processes named parameters and ensures all mandatory ones
exist and substitutes missing optional ones with default values. This makes
named parameters strongly defined and easier to read.
Thanks to http://developinginthedark.com/posts/cakephp-tip-1-named-parameters
for the idea.