| | 12 | } |
|---|
| | 13 | |
|---|
| | 14 | function thickbox_inline($name = '', $inline_id = '', $options = array(), $thickbox_options = array()) |
|---|
| | 15 | { |
|---|
| | 16 | _add_resources(); |
|---|
| | 17 | $options = _parse_attributes($options); |
|---|
| | 18 | $thickbox_options = _parse_attributes($thickbox_options); |
|---|
| | 19 | |
|---|
| | 20 | if (array_key_exists('size', $thickbox_options)) |
|---|
| | 21 | { |
|---|
| | 22 | list($thickbox_options['width'], $thickbox_options['height']) = explode('x',$thickbox_options['size']); |
|---|
| | 23 | unset($thickbox_options['size']); |
|---|
| | 24 | } |
|---|
| | 25 | |
|---|
| | 26 | $options['class'] = isset($options['class']) ? $options['class'] : 'thickbox'; |
|---|
| | 27 | $thickbox_options['inlineId'] = $inline_id; |
|---|
| | 28 | |
|---|
| | 29 | if (isset($options['query_string'])) |
|---|
| | 30 | { |
|---|
| | 31 | $options['query_string'] .= '&' . http_build_query($thickbox_options); |
|---|
| | 32 | } |
|---|
| | 33 | else |
|---|
| | 34 | { |
|---|
| | 35 | $options['query_string'] = http_build_query($thickbox_options); |
|---|
| | 36 | } |
|---|
| | 37 | |
|---|
| | 38 | return link_to($name, '#TB_inline', $options); |
|---|
| | 73 | if (array_key_exists('size', $thickbox_options)) |
|---|
| | 74 | { |
|---|
| | 75 | list($thickbox_options['width'], $thickbox_options['height']) = explode('x',$thickbox_options['size']); |
|---|
| | 76 | unset($thickbox_options['size']); |
|---|
| | 77 | } |
|---|
| | 78 | |
|---|
| | 79 | if (!array_key_exists('width', $thickbox_options) && !array_key_exists('height', $thickbox_options)) |
|---|
| | 80 | { |
|---|
| | 81 | $thickbox_options['width'] = 400; |
|---|
| | 82 | $thickbox_options['height'] = 300; |
|---|
| | 83 | } |
|---|
| | 84 | |
|---|
| | 85 | $options['class'] = isset($options['class']) ? $options['class'] : 'thickbox'; |
|---|
| | 86 | |
|---|
| | 87 | if (isset($options['query_string'])) |
|---|
| | 88 | { |
|---|
| | 89 | $options['query_string'] .= '&' . http_build_query($thickbox_options); |
|---|
| | 90 | } |
|---|
| | 91 | else |
|---|
| | 92 | { |
|---|
| | 93 | $options['query_string'] = http_build_query($thickbox_options); |
|---|
| | 94 | } |
|---|
| | 95 | |
|---|
| | 96 | return link_to($name, $internal_uri, $options); |
|---|