Developer Console v1.04 and Grey Hidden Records v1.01 Released!
4 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: August 31, 2016 (RSS)
By Daryl - May 9, 2016
Hi all,
We've just released new version of the following plugins:
Developer Console v1.04
http://www.interactivetools.com/add-ons/developer-console/
- Fixed issue where console wouldn't work if admin script wasn't named admin.php
- Pressing "enter" will now execute the shell command
- Added "User Features" setting: If enabled, pressing ctrl + ` will open a new MySql Console tab
Grey Hidden Records v1.01
http://www.interactivetools.com/add-ons/grey-hidden-records/
- Added option to add specific fields with custom conditions for greying out records
Please feel free to post any questions/feedback.
Thanks,
PHP Programmer - interactivetools.com
Great to see these developed further. The customization options are really appreciated!
This new greyHiddenRecords only works for CMSBuilder v.3+. For those of us still working with some v.2 sites, is there a way to limit the styling to a particular table? I've tried variations on the following with no luck:
// register callbacks
addFilter('listRow_trStyle', 'style_certain_records_listRow_trStyle', null, 3);
// **** KEY LINE FOLLOWS ****
function style_certain_records_listRow_trStyle($trStyle, $tableName = "cms_sc_orders", $record) {
if (!@$record['hidden']) { // All non-hidden records are scanned for new rules.
// Not locked, but no other checks - should highlight odd situations.
if(!@$record['locked'] AND !@$record['paid'] AND @$record['order_id'])
{ return "color: rgb(200,200,200);".$trStyle; }
// pale grey, Order_ID added only to limit styling to Orders table.
} // end rules for non-hidden fields
return "color: #CCC;"; // default hidden style
}
and...
function style_certain_records_listRow_trStyle($trStyle, "cms_sc_orders", $record) {
if (!@$record['hidden']) { // All non-hidden records are scanned for new rules.
// ... styling rules here...
}
return "color: #CCC;"; // default hidden style
}
In both these cases we're trying to limit these styling rules to affect only the _sc_orders table.
Any ideas?
Jayme
By Daryl - August 30, 2016
Hi Jayme,
The 'listRow_trStyle' filter passes the table name of the section to $tableName variable.
You can use that to check if the current table is _sc_orders, if not, return the tr style without any changes.
For example:
function grey_hidden_records_listRow_trStyle($trStyle, $tableName, $record) {
if ($tableName != '_sc_orders') { return $trStyle; } // change nothing if this is not the orders table
if (!@$record['hidden']) { return $trStyle; } // skip if record either doesn't have a hidden field or the hidden field isn't checked
return "color: #CCC;";
}
Cheers,
PHP Programmer - interactivetools.com