Differences

This shows you the differences between two versions of the page.

dev:location_handler [2007/02/10 11:55]
fran
dev:location_handler [2009/07/06 20:36] (current)
Line 23: Line 23:
location id of USA as $parent. location id of USA as $parent.
  * In $extra_opts you can specify whether you want to display location unknown check box   * In $extra_opts you can specify whether you want to display location unknown check box
-and whether you want to display camps ,organizations alongside the locations. +and whether you want to display camps, organizations alongside the locations. 
-for example if you want to show camps ,then pass $extra_opts["camps"]=true;+for example if you want to show camps, then pass $extra_opts["camps"]=true;
Line 37: Line 37:
this will create 4 select boxes from level 1 to level 4 this will create 4 select boxes from level 1 to level 4
-remember in the database in field_options ,we define the levels.+remember in the database in field_options, we define the levels.
In addition this will generate a select box to select camps. In addition this will generate a select box to select camps.
Line 45: Line 45:
</code> </code>
-Then once the form is submitted ,there will a POST variable per each level +Then once the form is submitted ,there will a POST variable for each level. 
-name of the variable will be the level no.+Name of the variable will be the level number.
Note: You can display both camps and organizations at the same time with locations. Note: You can display both camps and organizations at the same time with locations.
-it will be extended to display Inventories as well.+It will be extended to display Inventories as well.
<code php> <code php>
Line 56: Line 56:
</code> </code>
-above code will produce two radio buttons and a set of location select+Above code will produce two radio buttons and a set of location select
boxes. boxes.
-when you select the "camp" radio button , a select box will appear with+When you select the "camp" radio button , a select box will appear with
the camps. the camps.
-when you select a camp ,through AJAX, location details of the +When you select a camp, through AJAX, location details of the 
-camp(country,city,state,ect) will be retrieved and the location boxes+camp (country,city,state,etc) will be retrieved and the location boxes
will get populated with those. will get populated with those.
-similar functionality can be seen when you select the "organization" +Similar functionality can be seen when you select the "organization"
radio button. radio button.
Line 75: Line 75:
This function will start from the lowest level of the select boxes (say city) and goes up This function will start from the lowest level of the select boxes (say city) and goes up
-the select boxes till it finds a location selected and return it.+the select boxes till it finds a location selected and returns it.
e.g e.g
Line 86: Line 86:
    }     }
</code> </code>
 +
Line 93: Line 94:
</code> </code>
-Returns true if the location does not have any children+Returns true if the location does not have any children.
<code php> <code php>
Line 99: Line 100:
</code> </code>
-Returns an array of descendants of a location+Returns an array of descendants of a location.
<code php> <code php>
Line 105: Line 106:
</code> </code>
-Displays the full range of location levels for the user+Displays the full range of location levels for the user.
<code php> <code php>
Line 112: Line 113:
 Returns the list of parents of the location. Starting from the location to  Returns the list of parents of the location. Starting from the location to
- the parent,grand parent,ect. For each level the name and location id is returned.+ the parent, grand parent,etc. For each level the name and location id is returned.
<code php> <code php>
Line 118: Line 119:
</code> </code>
-Returns the level of the location +Returns the level of the location.
<code php> <code php>
Line 124: Line 125:
</code> </code>
-Returns whether the location is in the last level or not+Returns whether the location is in the last level or not.
<code php> <code php>
Line 130: Line 131:
</code> </code>
-Returns the last location level avaliable +Returns the last location level available.
<code php> <code php>
Line 136: Line 137:
</code> </code>
-Returns the range of levels avaliable +Returns the range of levels available. 

Navigation
  • Navigate