[First Checkin tlack@modernmethod.com**20050601211818] [Scaffold better showColumns tlack@modernmethod.com**20050601214301] [Join support for Scaffold tlack@modernmethod.com**20050601215707] [Delete button, virtual columns, ScaledPhotos tlack@modernmethod.com**20050607115646 - Added getData() method to EditScaffold - Added a delete button to the default EditScaffold. Use these two variables to change the appearance and behavior: $this->delete_button_post_url = "${plural}.phtml"; $this->delete_button_label = ""; The first variable sets where the edit form will redirect after deletion; the second variable is the label of the delete button. Note: This does not yet hide records, it only physically deletes them. That's a major TODO item. - Added support for "virtual columns." These are columns that appear in $this->cols, and each has a data element whose behavior and usage is defined by the implementation of that type. The class must have defined support for that virtual column type before it can be added. See the next example to see how it works. - Added a "ScaledPhoto" virtual column type to EditScaffold. This is implemented in EditScaffold::renderVirtualScaledPhoto and EditScaffold::saveVirtualScaledPhoto. Here's an example of its use: $e = new EditScaffold("photo", "photos"); $e->setDataSource("m_news_photos"); // Set where we want the delete button to forward to (after it's done) $data = $e->getData(); $e->delete_button_post_url = "news_edit.php?nik=$data[news_item_key]"; // hide the underlying URLs -- we'll edit all of these at once with the // "upload_a_pic" ScaledPhoto virtual column. $e->hideColumns("news_item_key,thumb_url,small_url,large_url,xlarge_url"); // the output files will have "news-" prepended to their name. $e->scaled_photo_prefix = "news"; // add the virtual column; it's name is upload_a_pic, its type is // ScaledPhoto (which EditScaffold defined itself to support), and // the data is an array of fields and their corresponding sizes.. $e->addVirtualColumn("upload_a_pic", "ScaledPhoto", array( "large_url" => $uploaded_img_large, "small_url" => $uploaded_img_small, "thumb_url" => $uploaded_img_thumb, "xlarge_url" => $uploaded_img_xlarge)); // save any edit requests. $e->handleRequest(); // display the form as usual echo $e->render(); ] [Scaffold sorting tlack@modernmethod.com**20050607130804 Scaffolded columns are now resortable: $e = new ListScaffold("users", "user"); $e->setDataSource("m_users"); // method 1: $e->setColumnOrder("creation_dt,first_name,last_name,email_address"); // method 2: $e->setColumnOrder("last_name", 0); echo $e->render(); ] [Kat's fixes for Scaffold undefined variables and setSelect tlack@modernmethod.com**20050610145905] [First checkin of old templates tlack@modernmethod.com**20050610182829 It seems as though the templates were never checked into the darcs stdlib repo. I am adding some older ones here. ] [Newline removals mark@wwworldmedia.com**20050610204404 Removed stray newlines which start header output and screw up the login process when the login cookie is set. ] [Added sort_key move up and down plus ajax fixes mark@wwworldmedia.com**20050613184128] [tons of changes and fixes mark@wwworldmedia.com**20050614163720 image upload without scaling add_dt bug user edit cookie crumb added edit button graphic and up and down icons ] [Cookies support in misc.js and reformatting tlack@modernmethod.com**20050614185915 Support for var my_cookie = Cookies.get("blah"); Cookies.set("blah", "some_random_value"); and some minor reformatting/tab fixing ] [$msgs[] support for templates/admin_header.phtml tlack@modernmethod.com**20050610183420] [INSTALL.TXT inclusion tlack@modernmethod.com**20050614194358] [Improved NewRecord error checking tom@wwworldmedia.com**20050614192020] [Splitting Scaffold into five files tom@wwworldmedia.com**20050614192617 We have split the Scaffold into five files: incl_scaffold_base.phtml -> the base class incl_scaffold_edit.phtml -> the editing class incl_scaffold_list.phtml -> the list class incl_scaffold_new.phtml -> the 'new' class incl_scaffold.phtml -> includes all the others - Tom ] [Scaffold subclasses include base class tom@wwworldmedia.com**20050614192951] [Creation of tools/fix_permissions tom@wwworldmedia.com**20050614194614] [Oops, left debugging info on .. tom@wwworldmedia.com**20050614194922] [Improvements to Scaffold tom@wwworldmedia.com**20050615205425] [New features for misc.js: Select.get, .getIdx, .set, .add, .remove, .clear tom@wwworldmedia.com**20050615205456] [misc.js gets Select.clone tom@wwworldmedia.com**20050615210823] [First checkin of the Hierarchy tom@wwworldmedia.com**20050615211535 This thing rocks. ] [incl_dobject.phtml, Debuggable Object, support. tom@wwworldmedia.com**20050616131000] [Fixes to misc.js tom@wwworldmedia.com**20050623141549 - Used debug() instead of alert() when it's time to flip out - Select.getIdx() returns -1 if it can't find the item, because 0 (and anything > 0) is a valid index. ] [Beta-level calendar support tom@wwworldmedia.com**20050623142042] [Element.Class tom@wwworldmedia.com**20050623152211] [Fix for element.class typo tom@wwworldmedia.com**20050630164037] [Object.prototype.applyDefaults and Effect.pulsate tom@wwworldmedia.com**20050705175348] [Unordered list-based hierarchy tom@wwworldmedia.com**20050708160035] [misc.js: applyDefaults no longer an object method but instead a regular function tom@wwworldmedia.com**20050714142256 Having this as a method on every object was causing problems with iteration using the for (var i in obj) { .. } pattern. So I changed it to a regular function that doesn't override anything. ] [New functions: alz, empty, rand, Element.setValues, bug fixes for bindEvent and Element.getValue() when used on radio tom@wwworldmedia.com**20050721213140] [Fix in tools/fix_permissions tlack@modernmethod.com**20050726025928] [xupdate() for incl_db_mysql tlack@modernmethod.com**20050726042317] [Fixes to site.phtml tom@wwworldmedia.com**20050726195211 - Reorganized bottom of site.phtml that was an ugly mix of called code and functions - "unfck" (which made no sense) changed to addslashes_array() - Support for running in environments without register_globals ] [Bad call in misc.js corrected; Element.Class.remove() requires its first argument to be an element tom@wwworldmedia.com**20050727155737] [Misc fixes tom@wwworldmedia.com**20050727203858 - Superior get_repr() - Element.showBlock(ele) which fixes some cases when setting style.display = '' does nothing. - Better error checking in Element.Class.*(ele) - abort out if the element isn't found ] [Use clientHeight/Width vs. offsetHeight/Width tom@wwworldmedia.com**20050727231548] [Improvements to scaffold tom@wwworldmedia.com**20050801205417 - incl_scaffold_new.phtml was not being included by incl_scaffold.phtml - checkboxes were having their value shown -- this can be blank and should always be 1. - where clauses were not being properly built out in some scenarios ] [incl_scaffold_list.phtml: finally turning off that damn edit.gif tom@wwworldmedia.com**20050801210602] [Improvements to the scaffold tom@wwworldmedia.com**20050801211244 - Simple documentation cleanup - Improvements to the manner in which the scaffold modules include each other (using dirname()) ] [incl_scaffold_list.phtml: No Plural Found text was wrong tlack@modernmethod.com**20050809123431] [Distinct support for dates (as opposed to just datetimes) and xupdate() in incl_scaffold_list tlack@modernmethod.com**20050809124137] [Misc fixes: admin.css scaffold support, main.phtml users link goes to footer tlack@modernmethod.com**20050809124234] [Dynamic text sizing for incl_scaffold_edit texatareas tlack@modernmethod.com**20050809130845] [ListScaffold now trims cols to $max_col_length (default 50) and adds ellipsis if it's too long tlack@modernmethod.com**20050809130905] [Smarter labels - "url" becomes "Web URL" tlack@modernmethod.com**20050809131400] [Fixes for site.phtml:escape_js() tom@wwworldmedia.com**20050802220233] [Many, many scaffold improvements tom@wwworldmedia.com**20050808201606] [Foreign Key support and other small fixes tom@wwworldmedia.com**20050811175123] [dynamic text sizing tom@wwworldmedia.com**20050811175307] [bug fix for incl_scaffold_base.phtml: when adding virtual columns, be sure that loadColumns has been called in advance. tom@wwworldmedia.com**20050811175752] [Fixes for $singular - error_reporting(E_ALL) is my best friend tom@wwworldmedia.com**20050811180734] [$html was not initialized tom@wwworldmedia.com**20050811180829] [Deletion checkboxes, captions, and callbacks as a virtual column type for the list tom@wwworldmedia.com**20050811202353] [Fixes for the expanding textareas; column headings for virtual columns cannot be clicked tom@wwworldmedia.com**20050811203114] [We don't trim the output of Virtual Columns; that is the VC's job. tom@wwworldmedia.com**20050811204310] [Better raw query tom@wwworldmedia.com**20050819153005] [Slight improvements to incl_scaffold_edit.phtml tom@wwworldmedia.com**20050819175825] [Virtual data validation and ForeignKey virtual columns for incl_scaffold_list.phtml tlack@modernmethod.com**20050819210756 Validation -> Arguments given as data to a virtual column are validated by $this->validateVirtual[type]Data($data, &$error_text). This function, if you define it, should return false and set the contents of $error_text if the data isn't valid. Here's an example of such a function: function validateVirtualForeignKeyData($data, &$error_text) { if (! is_array($data)) { $error_text = "Data must be an array"; return false; } if (empty($data["foreign_table"])) { $error_text = "Missing \"foreign_table\" element"; return false; } return true; } Foreign Key virtual columns in ListScaffold -> Pretty straight forward. It will attempt to pull up the corresponding record in a table for each of a given key values and it will show the contents of a certain other column in that table as the description. In this case, m_cm_pages has a page_section_key column which corresponds to section_key in the m_cm_sections table. When a match is found, show section_title. $list = new ListScaffold("page", "pages"); $list->setDataSource("m_cm_pages"); $list->setWhere("page_is_active = 1"); $list->addVirtualColumn("page_section_key", "ForeignKey", array("foreign_table" => "m_cm_sections", "foreign_key" => "section_key", "foreign_desc" => "section_title")); $list->handleRequest(); ] [70+ patches! great improvements backported from push tlack@modernmethod.com**20050825172236] [Removed marketing window from stdlib tlack@modernmethod.com**20051013145421] [Removed refreshless stuff from stdlib tlack@modernmethod.com**20051013145948] [Scaffold tlack@modernmethod.com**20051013150124] [Fix for install process not saving hostname tlack@modernmethod.com**20051013150430] [Error checking improvements; incl_form_check.phtml and tests.. tlack@modernmethod.com**20051111171713]