-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddress_8php_source.html
98 lines (96 loc) · 16.6 KB
/
address_8php_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GravityView: address.php Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="custom-doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GravityView
 <span id="projectnumber">2.17</span>
</div>
<div id="projectbrief">The best, easiest way to display Gravity Forms entries on your website.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_096b0de097b3e98f91191e9d894d4363.html">templates</a></li><li class="navelem"><a class="el" href="dir_ec5b3714d0ece4d73a2deb1322dd37b1.html">deprecated</a></li><li class="navelem"><a class="el" href="dir_b0d46e1b4744c0c00581e2eaaee03bdd.html">fields</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">address.php</div> </div>
</div><!--header-->
<div class="contents">
<a href="address_8php.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <?php<span class="comment"></span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">/**</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * Address field output, with "Map It" link removed</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * @package GravityView</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * @subpackage GravityView/templates/fields</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> */</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> </div><div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="address_8php.html#add47a7f886e74847997a4044e9903a0a"> 10</a></span> <a class="code" href="address_8php.html#add47a7f886e74847997a4044e9903a0a">$gravityview_view</a> = <a class="code" href="class_gravity_view___view.html#a675d8b1454543d5bcef330c3686aff61">GravityView_View::getInstance</a>();</div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> extract( <a class="code" href="address_8php.html#add47a7f886e74847997a4044e9903a0a">$gravityview_view</a>->getCurrentField() );</div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// If it's the full address</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="keywordflow">if</span>( floor( <a class="code" href="time_8php.html#a391bb7936af986b27b996d1a6c2e142c">$field_id</a> ) === floatval( <a class="code" href="time_8php.html#a391bb7936af986b27b996d1a6c2e142c">$field_id</a> ) ) {</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"></span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> /**</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * Make sure we're only showing enabled inputs.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * @since 1.16.2</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> */</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  <span class="keywordflow">foreach</span>( <a class="code" href="search-field-chainedselect_8php.html#a83e4d6721f3491a4fd780dbd3ce1a3c0">$field</a>->inputs as $input ) {</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  <span class="keywordflow">if</span>( ! empty( $input[<span class="stringliteral">'isHidden'</span>] ) ) {</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  unset( <a class="code" href="search-field-date__range_8php.html#a4016dad482628807137e0d337ac1cbc4">$value</a>[<span class="stringliteral">"{$input['id']}"</span>] );</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  }</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  }</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment"></span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"> /** We shall output the map ourselves for now, suppress the output here. */</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  add_filter( <span class="stringliteral">'gform_disable_address_map_link'</span>, <span class="stringliteral">'__return_true'</span> );</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <span class="comment">// Use Gravity Forms' method to get the full address.</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  $value_with_newline = GFCommon::get_lead_field_display( <a class="code" href="search-field-chainedselect_8php.html#a83e4d6721f3491a4fd780dbd3ce1a3c0">$field</a>, <a class="code" href="search-field-date__range_8php.html#a4016dad482628807137e0d337ac1cbc4">$value</a>, <span class="stringliteral">""</span>, <span class="keyword">false</span>, <span class="stringliteral">'html'</span> );</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  remove_filter( <span class="stringliteral">'gform_disable_address_map_link'</span>, <span class="stringliteral">'__return_true'</span> );</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="keywordflow">if</span>( empty( $value_with_newline ) ) { <span class="keywordflow">return</span>; }</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <span class="comment">// Add map link if it's not set (default, back compat) or if it's set to yes</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <span class="keywordflow">if</span>( !isset( <a class="code" href="custom_8php.html#a925f4d60d2d907ebcc3f42e72d5356de">$field_settings</a>[<span class="stringliteral">'show_map_link'</span>] ) || !empty( <a class="code" href="custom_8php.html#a925f4d60d2d907ebcc3f42e72d5356de">$field_settings</a>[<span class="stringliteral">'show_map_link'</span>] ) ) {</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  $atts = array();</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="keywordflow">if</span> ( <a class="code" href="custom_8php.html#a925f4d60d2d907ebcc3f42e72d5356de">$field_settings</a>[<span class="stringliteral">'show_map_link_new_window'</span>] ) {</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  $atts[<span class="stringliteral">'target'</span>] = <span class="stringliteral">'_blank'</span>;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  }</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="comment">// Add the map link as another line</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  $value_with_newline .= <span class="stringliteral">"\n"</span> . <a class="code" href="class-api_8php.html#abf31ef0327f5befd010a147609963a3e">gravityview_get_map_link</a>( $value_with_newline, $atts );</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  }</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="comment">// Full address without the "Map It" link</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  echo str_replace(<span class="stringliteral">"\n"</span>, <span class="stringliteral">'<br />'</span>, $value_with_newline );</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="address_8php.html#abf1587eec3e668593f0b811050a678e3"> 52</a></span> } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  echo esc_html( <a class="code" href="class-api_8php.html#a023eaeb09f343deeb696cb198f1667dd">gravityview_get_field_value</a>( <a class="code" href="notes_8php.html#aa5233ed44daaa56d417d58cc4d8f64c2">$entry</a>, <a class="code" href="time_8php.html#a391bb7936af986b27b996d1a6c2e142c">$field_id</a>, <a class="code" href="field-address-csv_8php.html#a3bc46d9836191735ed5edee7c38b3722">$display_value</a> ) );</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> }</div><div class="ttc" id="class-api_8php_html_a023eaeb09f343deeb696cb198f1667dd"><div class="ttname"><a href="class-api_8php.html#a023eaeb09f343deeb696cb198f1667dd">gravityview_get_field_value</a></div><div class="ttdeci">gravityview_get_field_value( $entry, $field_id, $display_value)</div><div class="ttdoc">Handle getting values for complex Gravity Forms fields. </div><div class="ttdef"><b>Definition:</b> <a href="class-api_8php_source.html#l01034">class-api.php:1034</a></div></div>
<div class="ttc" id="class_gravity_view___view_html_a675d8b1454543d5bcef330c3686aff61"><div class="ttname"><a href="class_gravity_view___view.html#a675d8b1454543d5bcef330c3686aff61">GravityView_View\getInstance</a></div><div class="ttdeci">static getInstance( $passed_post=NULL)</div><div class="ttdef"><b>Definition:</b> <a href="class-template_8php_source.html#l00195">class-template.php:195</a></div></div>
<div class="ttc" id="field-address-csv_8php_html_a3bc46d9836191735ed5edee7c38b3722"><div class="ttname"><a href="field-address-csv_8php.html#a3bc46d9836191735ed5edee7c38b3722">$display_value</a></div><div class="ttdeci">$display_value</div><div class="ttdef"><b>Definition:</b> <a href="field-address-csv_8php_source.html#l00017">field-address-csv.php:17</a></div></div>
<div class="ttc" id="class-api_8php_html_abf31ef0327f5befd010a147609963a3e"><div class="ttname"><a href="class-api_8php.html#abf31ef0327f5befd010a147609963a3e">gravityview_get_map_link</a></div><div class="ttdeci">gravityview_get_map_link( $address, $atts=array())</div><div class="ttdoc">Generate a mapping link from an address. </div><div class="ttdef"><b>Definition:</b> <a href="class-api_8php_source.html#l01406">class-api.php:1406</a></div></div>
<div class="ttc" id="custom_8php_html_a925f4d60d2d907ebcc3f42e72d5356de"><div class="ttname"><a href="custom_8php.html#a925f4d60d2d907ebcc3f42e72d5356de">$field_settings</a></div><div class="ttdeci">$field_settings['content']</div><div class="ttdef"><b>Definition:</b> <a href="custom_8php_source.html#l00027">custom.php:27</a></div></div>
<div class="ttc" id="address_8php_html_add47a7f886e74847997a4044e9903a0a"><div class="ttname"><a href="address_8php.html#add47a7f886e74847997a4044e9903a0a">$gravityview_view</a></div><div class="ttdeci">$gravityview_view</div><div class="ttdef"><b>Definition:</b> <a href="address_8php_source.html#l00010">address.php:10</a></div></div>
<div class="ttc" id="search-field-chainedselect_8php_html_a83e4d6721f3491a4fd780dbd3ce1a3c0"><div class="ttname"><a href="search-field-chainedselect_8php.html#a83e4d6721f3491a4fd780dbd3ce1a3c0">$field</a></div><div class="ttdeci">$field</div><div class="ttdef"><b>Definition:</b> <a href="search-field-chainedselect_8php_source.html#l00029">search-field-chainedselect.php:29</a></div></div>
<div class="ttc" id="search-field-date__range_8php_html_a4016dad482628807137e0d337ac1cbc4"><div class="ttname"><a href="search-field-date__range_8php.html#a4016dad482628807137e0d337ac1cbc4">$value</a></div><div class="ttdeci">$value</div><div class="ttdef"><b>Definition:</b> <a href="search-field-date__range_8php_source.html#l00010">search-field-date_range.php:10</a></div></div>
<div class="ttc" id="notes_8php_html_aa5233ed44daaa56d417d58cc4d8f64c2"><div class="ttname"><a href="notes_8php.html#aa5233ed44daaa56d417d58cc4d8f64c2">$entry</a></div><div class="ttdeci">$entry</div><div class="ttdef"><b>Definition:</b> <a href="notes_8php_source.html#l00027">notes.php:27</a></div></div>
<div class="ttc" id="time_8php_html_a391bb7936af986b27b996d1a6c2e142c"><div class="ttname"><a href="time_8php.html#a391bb7936af986b27b996d1a6c2e142c">$field_id</a></div><div class="ttdeci">if(false !==strpos( $value, '00:00')) $field_id</div><div class="ttdoc">string $field_id ID of the field being displayed </div><div class="ttdef"><b>Definition:</b> <a href="time_8php_source.html#l00022">time.php:22</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/>
<script type="text/javascript">
jQuery( document ).ready( function( $ ) {
$( 'a.anchor[id^=_filters],a.anchor[id^=_actions]' ).each( function() {
$( this )
.text('#')
.attr( 'href', function() {
return '#' + $( this ).attr( 'id' );
}).prependTo( $( this ).parent('dt' ).next('dd') );
});
});
</script>
</body>
</html>