hierarchical-select

POST response from Firebug Console

  1. <!-- Using Krumo Skin: skins/orange/skin.css -->
  2. <style type="text/css">
  3. <!--/**/
  4. /**
  5. * Krumo "Orange" Skin
  6. *
  7. * @version $Id: skin.css,v 1.1.2.2 2008/06/03 20:36:05 weitzman Exp $
  8. * @author Kal

Fix for Fix for jQuery Form Plugin's POST is incorrect

  1. // $_POST after browser form submit:
  2.  
  3. Array
  4. (
  5.     [title] =>
  6.     [taxonomy] => Array
  7.         (
  8.             [1] => Array
  9.                 (
  10.                     [hierarchical_select] => Array

Fix for jQuery Form Plugin's POST is incorrect

  1. // $_POST after browser form submit:
  2.  
  3. Array
  4. (
  5.     [title] =>
  6.     [taxonomy] => Array
  7.         (
  8.             [1] => Array
  9.                 (
  10.                     [hierarchical_select] => Array

Fix for AHAH callback in Drupal 5

  1. <?php
  2. /**
  3.  * Menu callback; format=text/json; generates and outputs the appropriate HTML.
  4.  */
  5. function hierarchical_select_json() {
  6.   // We are returning Javascript, so tell the browser.

Initial code for new HS implementation: hs_smallhierarchy (or has somebody got a better name?)

  1. /**
  2.  * Automatically transform a given hierarchy with this format:
  3.  * array(
  4.  *   'win' => array(
  5.  *     'label' => 'Windows',
  6.  *     'children' => array(

Code

  1. /**
  2.  * Helper function to reconstruct the lineages given a set of selected items
  3.  * and the fact that the "save lineage" setting is enabled.
  4.  *

The Most Monstrous Function Ever

  1. /**
  2.  * Hierarchical select form element type #process callback.
  3.  */
  4. function hierarchical_select_process($element) {
  5.   static $hsid;
  6.  
  7.   if (!isset($hsid)) {
  8.     $hsid = 0;
  9.   }
  10.   else {

HS demo cleanup

  1. /**
  2.  * Implementation of hook_cron().
  3.  */
  4. function hsdemo_cron() {
  5.   $last_cleanup = variable_get('hsdemo_last_cleanup', 0);
  6.  
  7.   $delta = 7200; // 2 hours.

With inline comments this time!

  1. /**
  2.  * Definition of our hierarchy.
  3.  */
  4. function hs_tutorial_hierarchy() {
  5.   static $internal_hierarchy;
  6.  
  7.   // The user-visible hierarchy. Only defines labels. Has 3 levels.

Code

  1. /**
  2.  * Definition of our hierarchy.
  3.  */
  4. function hs_tutorial_hierarchy() {
  5.   static $internal_hierarchy;
  6.  
  7.   // The user-visible hierarchy. Only defines labels. Has 3 levels.
Syndicate content