Advanced iFrame - Version 1.3

Version Description

Fix: content_id,content_styles,hide_elements was always used from the config even when a shortcode was given. Now the shortcode is used as well.

Download this release

Release Info

Developer mdempfle
Plugin Icon 128x128 Advanced iFrame
Version 1.3
Comparing to
See all releases

Version 1.3

advanced-iframe-admin-page.php ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Advanced iframe
4
+ http://www.tinywebgallery.com/blog/advanced-iframe
5
+ Michael Dempfle
6
+
7
+ Administration include
8
+
9
+ */
10
+ ?>
11
+ <script>
12
+ function checkInputNumber(intputField) {
13
+ intputField.value = intputField.value.split(' ').join('');
14
+ var f = intputField.value;
15
+ if (intputField.value == '') return;
16
+ var match = f.match(/^(\-){0,1}(\d+)(px|%|em|pt)?$/);
17
+ if (!match) {
18
+ alert("<?php _e("Please check the value you have entered. Only numbers with an optional px, %, em or pt are allowed", "advanced-iframe");?>");
19
+ }
20
+ }
21
+ </script>
22
+ <?php
23
+ if (is_user_logged_in() && is_admin()) {
24
+
25
+ $devOptions = $this->getAdminOptions();
26
+ // print_r($devOptions);
27
+ if (isset($_POST['update_iframe-loader'])) { //save option changes
28
+ $adminSettings = array('securitykey', 'src', 'width', 'height', 'scrolling',
29
+ 'marginwidth', 'marginheight', 'frameborder', 'transparency',
30
+ 'content_id', 'content_styles', 'hide_elements', 'class',
31
+ 'shortcode_attributes', 'url_forward_parameter');
32
+
33
+ if (!wp_verify_nonce($_POST['twg-options'], 'twg-options')) die('Sorry, your nonce did not verify.');
34
+
35
+ foreach ($adminSettings as $item) {
36
+ $devOptions[$item] = trim($_POST[$item]);
37
+ }
38
+ update_option($this->adminOptionsName, $devOptions);
39
+ ?>
40
+ <div class="updated">
41
+ <p><strong><?php _e("Settings Updated.", "advanced-iframe");?></strong>
42
+ </p>
43
+ </div>
44
+ <?php
45
+ }
46
+ ?>
47
+ <style type="text/css">
48
+ table th {
49
+ text-align: left;
50
+ }
51
+ </style>
52
+ <div class="wrap">
53
+ <form method="post" action="options-general.php?page=advanced-iframe.php">
54
+ <?php wp_nonce_field('twg-options', 'twg-options'); ?>
55
+
56
+ <div id="icon-options-general" class="icon_jfu">
57
+ <br>
58
+ </div>
59
+ <h2>
60
+ <?php _e('Advanced iframe default settings', 'advanced-iframe'); ?></h2>
61
+
62
+ <p>
63
+ <?php _e('This plugin will include any content an advanced iframe. Please enter the url and the size you want to include your page. You have a couple of additional default options which help to integrate your site better into your template. You can overwrite all of these settings by specifying the parameter in the shortcode. Please read the documentation after each field about the parameter you have to use.', 'advanced-iframe'); ?>
64
+ </p>
65
+
66
+ <p>
67
+ <?php _e('Please use the following shortcode to include a page to your page: ', 'advanced-iframe'); ?>
68
+ <strong>[advanced_iframe securitykey="<?php echo $devOptions['securitykey']; ?>"]</strong>
69
+ </p>
70
+ <table class="form-table">
71
+ <?php
72
+ printTextInput($devOptions, __('Security key', 'advanced-iframe'), 'securitykey', __('This is the security key which has to be used in the shorttag. This is mandatory because otherwise anyone who can create an article can insert a gallery as well. The default security key was randomly generated during installation. Please change the key if you like. You should use this in combination with e.g. Page security to make sure that only the users you define can modify pages.', 'advanced-iframe'));
73
+ printTrueFalse($devOptions, __('Allow shortcode attributes', 'advanced-iframe'), 'shortcode_attributes', __('Allow to set attributes in the shortcode. All of the attributes can be overwritten in the shortcode if you set \'Yes\'. Otherwise the settings you specify here are used.', 'advanced-iframe'));
74
+ printTextInput($devOptions, __('Url', 'advanced-iframe'), 'src', __('Enter the full URL to your page. e.g. http://www.tinywebgallery.com. Shortcode attribute: src=""', 'advanced-iframe'));
75
+ printNumberInput($devOptions, __('Width', 'advanced-iframe'), 'width', __('The width of the iframe. You can specify the value in px or in %. If you don\'t specify anything px is assumed. Shortcode attribute: width=""', 'advanced-iframe'));
76
+ printNumberInput($devOptions, __('Height', 'advanced-iframe'), 'height', __('The height of the iframe. You can specify the value in px or in %. If you don\'t specify anything px is assumed. Shortcode attribute: height=""', 'advanced-iframe'));
77
+ printAutoNo($devOptions, __('Scrolling', 'advanced-iframe'), 'scrolling', __('Defines if scrollbars are shown if the page is too big for your iframe. Please note: If you select \'Yes\' IE does always show scrollbars on many pages! So only use this if needed. Shortcode attribute: scrolling="auto" or scrolling="no"', 'advanced-iframe'));
78
+ printNumberInput($devOptions, __('Margin width', 'advanced-iframe'), 'marginwidth', __('The margin width of the iframe. You can specify the value in px. If you don\'t specify anything px is assumed. Shortcode attribute: marginwidth=""', 'advanced-iframe'));
79
+ printNumberInput($devOptions, __('Margin height', 'advanced-iframe'), 'marginheight', __('The margin height of the iframe. You can specify the value in px. If you don\'t specify anything px is assumed. Shortcode attribute: marginheight=""', 'advanced-iframe'));
80
+ printNumberInput($devOptions, __('Frame border', 'advanced-iframe'), 'frameborder', __('The frame border of the iframe. You can specify the value in px. If you don\'t specify anything px is assumed. Shortcode attribute: frameborder=""', 'advanced-iframe'));
81
+ printTrueFalse($devOptions, __('Transparency', 'advanced-iframe'), 'transparency', __('If you like that the iframe is transparent and your background is shown you should set this to \'Yes\'. If this value is not set then the iframe is transparent in IE but transparent in e.g. Firefox. So by default you should leave this to \'Yes\'. Shortcode attribute: transparency="true" or transparency="false" ', 'advanced-iframe'));
82
+ printTextInput($devOptions, __('Class', 'advanced-iframe'), 'class', __('You can define a class for the iframe if you like. Shortcode attribute: class=""', 'advanced-iframe'));
83
+ printTextInput($devOptions, __('URL forward parameters', 'advanced-iframe'), 'url_forward_parameter', __('Define the parameters that should be passed from the browser url to the iframe url. Please separate the parameters by \',\'. In e.g. TinyWebGallery this enables you to jump directly to an album or image although TinyWebGallery is included in an iframe. Shortcode attribute: url_forward_parameter=""', 'advanced-iframe'));
84
+ ?>
85
+ </table>
86
+ <p>
87
+ <input class="button-primary" type="submit" name="update_iframe-loader"
88
+ value="<?php _e('Update Settings', 'advanced-iframe') ?>"/>
89
+ </p>
90
+
91
+ <h3><?php _e('Advanced options', 'advanced-iframe') ?></h3>
92
+
93
+ <p>
94
+ <?php _e('With the following options you can modify your template on the fly to give the iframe more space! At most templates you would have to create a page template with a special css and this is quite complicated. By using the options below your template is modified on the fly by jQuery. Please look at the screenshots to make these options more clear. The options are very useful for templates that have a top navigation because otherwise your menu is gone! If you still want to do this you should add a back link to the page. The examples below are for Twenty Ten, iNove and the default Wordpress theme.', 'advanced-iframe'); ?>
95
+ </p>
96
+ <table class="form-table">
97
+ <?php
98
+ printTextInput($devOptions, __('Content id', 'advanced-iframe'), 'content_id', __('Some templates do not use the full width for their content and even most \'One column, no sidebar Page Template\' templates only remove the sidebar but do not change the content width. Please set the id of the div starting with a hash (#) that defines the content. In the field below you then define the style you want to overwrite. For Twenty Ten and WordPress Default the id is #content, for iNove it is #main. You can also define more than one element. Please separate them by | and provide the styles below. Please read the note below how to find this id for other templates. #content|h2 means that you want to set a new style for the div content and the heading h2 below. Shortcode attribute: content_styles=""', 'advanced-iframe'));
99
+ printTextInput($devOptions, __('Content styles', 'advanced-iframe'), 'content_styles', __('Define the styles that have to be overwritten to enable the full width. Most of the time have to modify some of the following attributes: width, margin-left, margin-right, padding-left. Please use ; as separator between styles. If you have defined more than one element above (Content id) please separate the different style sets with |. The default values are: Wordpress default: \'width:450px;padding-left:45px;\'. Twenty Ten: \'margin-left:20px;margin-right:240px\'. iNove: \'width:605px\'. Please read the note below how to find this styles for other templates. If you have defined #content|h2 at the Content id you can e.g. set \'width:650px;padding-left:25px;|padding-left:15px;\'. Shortcode attribute: content_styles=""', 'advanced-iframe'));
100
+ printTextInput($devOptions, __('Hide elements', 'advanced-iframe'), 'hide_elements', __('This setting allows to hide elements when the iframe is shown. This can be used to hide the sidebar or the heading. Usage: If you want to hide a div you have to enter a hash (#) followed by the id e.g. #sidebar. If you want to hide a heading which is a &lt;h2&gt; you have to enter h2. You can define several elements separated by , e.g. #sidebar,h2. This gives you a lot more space to show the content of the iframe. To get the id of the sidebar go to Appearance -> Editor -> Click on \'Sidebar\' on the right side. Then look for the first \'div\' you find. The id of this div is the one you need. For some common templates the id is e.g. #menu, #sidebar, or #primary. For Twenty Ten and iNove you can remove the sidebar directly: Page attributes -> Template -> no sidebar. Wordpress default: \'#sidebar\'. I recommend to use firebug (see below) to find the elements and ids. You can use any valid jQuery selector pattern here! Shortcode attribute: hide_elements=""', 'advanced-iframe'));
101
+ ?>
102
+ </table>
103
+ <p>
104
+ <?php _e('<strong>How to find the id and the attributes:</strong><ol><li>Manually: Go to Appearance -> Editor and select the page template. The you have to look with div elements are defined. e.g. container, content, main. Also classes can be defined here. Then you have to select the style sheet below and search for this ids and classes and look which one does define the width of you content.</li><li>Firebug: For Firefox you can use the plugin firebug to select the content element directly in the page. On the right side the styles are always shown. Look for the styles that set the width or any bigger margins. This are the values you can then overwrite by the settings above.</li></ol>', 'advanced-iframe'); ?>
105
+ </p>
106
+
107
+ <p>
108
+ <input class="button-primary" type="submit" name="update_iframe-loader"
109
+ value="<?php _e('Update Settings', 'advanced-iframe') ?>"/>
110
+ </p>
111
+
112
+ <div id="icon-options-general" class="icon_jfu">
113
+ <br>
114
+ </div>
115
+
116
+ </form>
117
+
118
+ <h2>
119
+ <?php _e('Wordpress Flash Uploader, TinyWebGallery, Joomla Flash Uploader', 'advanced-iframe'); ?></h2>
120
+ <p>
121
+ <?php _e('This plugin is the extract for the iframe wrapper which was written for the TinyWebGallery. I needed an iframe wrapper that could do more then simply include a page. It needed to pass parameters to the iframe and modify the template on the fly to get more space for TWG. If you want to integrate TWG please use the "TinyWebGallery wrapper". It offers specific features only needed for the gallery. I hope this standalone wrapper is useful for other Wordpress users as well.', 'advanced-iframe'); ?>
122
+ </p>
123
+ <p>
124
+ <?php _e('Please take a look at my other projects: Wordpress Flash Uploader, TinyWebGallery, Joomla Flash Uploader or TWG Flash Uploader. If you like TWG or one of my other projects like JFU, WFU or TFU you should consider to register because you can use all products with one single license and get all features of the gallery and a complete upload solution as well.', 'advanced-iframe'); ?>
125
+ </p>
126
+ <p>
127
+ <?php _e('Please go <a href="http://www.tinywebgallery.com" target="_blank">www.tinywebgallery.com</a> for details.', 'advanced-iframe'); ?>
128
+ </p>
129
+ <br>
130
+ <?php
131
+ }
132
+ function printTrueFalse($options, $label, $id, $description) {
133
+ echo '
134
+ <tr valign="top">
135
+ <th scope="row">' . $label . '</th>
136
+ <td>
137
+ ';
138
+ echo '<input type="radio" id="' . $id . '" name="' . $id . '" value="true" ';
139
+ if ($options[$id] == "true") {
140
+ echo 'checked="checked"';
141
+ }
142
+ echo ' /> ' . __('Yes', 'advanced-iframe') . '&nbsp;&nbsp;<input type="radio" id="' . $id . '" name="' . $id . '" value="false" ';
143
+ if ($options[$id] == "false") {
144
+ echo 'checked="checked"';
145
+ }
146
+ echo '/> ' . __('No', 'advanced-iframe') . '<br>
147
+ <em>' . $description . '</em></td>
148
+ </tr>
149
+ ';
150
+ }
151
+
152
+ function printAutoNo($options, $label, $id, $description) {
153
+ echo '
154
+ <tr valign="top">
155
+ <th scope="row">' . $label . '</th>
156
+ <td>
157
+ ';
158
+ echo '<input type="radio" id="' . $id . '" name="' . $id . '" value="auto" ';
159
+ if ($options[$id] == "auto") {
160
+ echo 'checked="checked"';
161
+ }
162
+ echo ' /> ' . __('Yes', 'advanced-iframe') . '&nbsp;&nbsp;<input type="radio" id="' . $id . '" name="' . $id . '" value="no" ';
163
+ if ($options[$id] == "no") {
164
+ echo 'checked="checked"';
165
+ }
166
+ echo '/> ' . __('No', 'advanced-iframe') . '<br>
167
+ <em>' . $description . '</em></td>
168
+ </tr>
169
+ ';
170
+ }
171
+
172
+ function printTextInput($options, $label, $id, $description, $type = 'text') {
173
+ echo '
174
+ <tr valign="top">
175
+ <th scope="row">' . $label . '</th>
176
+ <td>
177
+ <input name="' . $id . '" type="' . $type . '" size="70" id="' . $id . '" value="' . $options[$id] . '" /><br>
178
+ <em>' . $description . '</em></td>
179
+ </tr>
180
+ ';
181
+ }
182
+
183
+ function printNumberInput($options, $label, $id, $description, $type = 'text') {
184
+ echo '
185
+ <tr valign="top">
186
+ <th scope="row">' . $label . '</th>
187
+ <td>
188
+ <input name="' . $id . '" type="' . $type . '" size="70" id="' . $id . '" onblur="checkInputNumber(this)" value="' . $options[$id] . '" /><br>
189
+ <em>' . $description . '</em></td>
190
+ </tr>
191
+ ';
192
+ }
193
+ ?>
advanced-iframe.php ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Advanced iframe
4
+ Plugin URI: http://www.tinywebgallery.com/blog/advanced-iframe
5
+ Version: 1.3
6
+ Author: Michael Dempfle
7
+ Author URI: http://www.tinywebgallery.com
8
+ Description: This plugin includes any webpage as shortcode in an advanced iframe.
9
+ This program is free software; you can redistribute it and/or modify
10
+ it under the terms of the GNU General Public License as published by
11
+ the Free Software Foundation; either version 2 of the License, or
12
+ (at your option) any later version.
13
+ This program is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program; if not, write to the Free Software
19
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
+ */
21
+ if (!class_exists("advancediFrame")) {
22
+ class advancediFrame {
23
+ var $adminOptionsName = "advancediFrameAdminOptions";
24
+
25
+ //
26
+ // class constructor
27
+ //
28
+ function advancediFrame() {
29
+ }
30
+
31
+ function init() {
32
+ $this->getAdminOptions();
33
+ }
34
+
35
+ function activate() {
36
+ $this->getAdminOptions();
37
+ }
38
+
39
+ function iframe_defaults() {
40
+ $iframeAdminOptions = array(
41
+ 'securitykey' => sha1(session_id()),
42
+ 'src' => 'http://www.tinywebgallery.com', 'width' => '100%',
43
+ 'height' => '600', 'scrolling' => 'no', 'marginwidth' => '0', 'marginheight' => '0',
44
+ 'frameborder' => '0', 'transparency' => 'true', 'content_id' => '', 'content_styles' => '',
45
+ 'hide_elements' => '', 'class' => '', 'shortcode_attributes' => 'true', 'url_forward_parameter' => '');
46
+ return $iframeAdminOptions;
47
+ }
48
+
49
+ function getAdminOptions() {
50
+ $iframeAdminOptions = advancediFrame::iframe_defaults();
51
+ $devOptions = get_option("advancediFrameAdminOptions");
52
+ if (!empty($devOptions)) {
53
+ foreach ($devOptions as $key => $option)
54
+ $iframeAdminOptions[$key] = $option;
55
+ }
56
+ update_option("advancediFrameAdminOptions", $iframeAdminOptions);
57
+ return $iframeAdminOptions;
58
+ }
59
+
60
+ function loadLanguage() {
61
+ load_plugin_textdomain('advanced-iframe', false, dirname(plugin_basename(__FILE__)) . '/languages/');
62
+ wp_enqueue_script('jquery');
63
+ }
64
+
65
+ /* CSS for the admin area */
66
+ function addAdminHeaderCode() {
67
+ echo '<link type="text/css" rel="stylesheet" href="' . get_bloginfo('wpurl') . '/wp-content/plugins/advanced-iframe/css/twg.css" />' . "\n";
68
+
69
+ }
70
+
71
+ function param($param, $content = null) {
72
+ $value = isset($_GET[$param]) ? $_GET[$param] : '';
73
+ return esc_html($value);
74
+ }
75
+
76
+ function do_iframe_script($atts) {
77
+ $options = get_option("advancediFrameAdminOptions");
78
+ // defaults
79
+ extract(array('securitykey' => 'not set',
80
+ 'src' => $options['src'], 'height' => $options['height'], 'width' => $options['width'], 'frameborder' => $options['frameborder'],
81
+ 'scrolling' => $options['scrolling'], 'marginheight' => $options['marginheight'], 'marginwidth' => $options['marginwidth'],
82
+ 'transparency' => $options['transparency'], 'content_id' => $options['content_id'],
83
+ 'content_styles' => $options['content_styles'], 'hide_elements' => $options['hide_elements'],
84
+ 'class' => $options['class'], 'url_forward_parameter' => $options['url_forward_parameter'], $atts));
85
+ // read the shortcode attributes
86
+ if ($options['shortcode_attributes'] == 'true') {
87
+ extract(shortcode_atts(array('securitykey' => 'not set',
88
+ 'src' => $options['src'], 'height' => $options['height'], 'width' => $options['width'], 'frameborder' => $options['frameborder'],
89
+ 'scrolling' => $options['scrolling'], 'marginheight' => $options['marginheight'], 'marginwidth' => $options['marginwidth'],
90
+ 'transparency' => $options['transparency'], 'content_id' => $options['content_id'],
91
+ 'content_styles' => $options['content_styles'], 'hide_elements' => $options['hide_elements'],
92
+ 'class' => $options['class'], 'url_forward_parameter' => $options['url_forward_parameter']), $atts));
93
+ } else {
94
+
95
+ // only the secrity key is read.
96
+ extract(shortcode_atts(array('securitykey' => 'not set'), $atts));
97
+ }
98
+
99
+ echo '<link type="text/css" rel="stylesheet" href="' . get_bloginfo('wpurl') . '/wp-content/plugins/advanced-iframe/css/ai.css" />' . "\n";
100
+ if ($options['securitykey'] != $securitykey) {
101
+ echo '<div class="errordiv">' . __('An invalid security key was specified. Please use at least the following shortcode:<br>[advanced_iframe securitykey="&lt;your security key - see settings&gt;"]', 'advanced-iframe') . '</div>';
102
+ return;
103
+ } else {
104
+
105
+ // add parameters
106
+ if ($url_forward_parameter != '') {
107
+ $sep = "&amp;";
108
+ if (strpos($src, '?') === false) {
109
+ $sep = '?';
110
+ }
111
+ $parameters = explode(",", $url_forward_parameter);
112
+ foreach ($parameters as $parameter) {
113
+ $read_param_esc = $this->param($parameter);
114
+ if ($read_param_esc != '') {
115
+ $src .= $sep . $parameter . "=" . $read_param_esc;
116
+ $sep = "&amp;";
117
+ }
118
+ }
119
+ }
120
+
121
+ $html = '';
122
+
123
+ if ((!empty($content_id) && !empty($content_styles))
124
+ || !empty($hide_elements)) {
125
+ $html .= "<script>
126
+ jQuery(document).ready(function() {";
127
+ if (!empty($hide_elements)) {
128
+ $html .= "jQuery('" . esc_html($hide_elements) . "').css('display', 'none');";
129
+ }
130
+ if (!empty($content_id)) {
131
+ $elements = esc_html($content_id); // this field should not have a problem if they are encoded.
132
+ $values = esc_html($content_styles); // this field style should not have a problem if they are encoded.
133
+ $elementArray = explode("|", $elements);
134
+ $valuesArray = explode("|", $values);
135
+ if (count($elementArray) != count($valuesArray)) {
136
+ echo '<div class="errordiv">' . __('Configuration error: The attributes content_id and content_styles have to have the amount of value sets separated by |.', 'advanced-iframe') . '</div>';
137
+ return;
138
+ } else {
139
+ for ($x = 0; $x < count($elementArray); ++$x) {
140
+ $valuesArrayPairs = explode(";", trim($valuesArray[$x], " ;:"));
141
+ for ($y = 0; $y < count($valuesArrayPairs); ++$y) {
142
+ $elements = explode(":", $valuesArrayPairs[$y]);
143
+ $html .= "jQuery('" . $elementArray[$x] . "').css('" . $elements[0] . "', '" . $elements[1] . "');";
144
+ }
145
+ }
146
+ }
147
+ }
148
+ $html .= " });
149
+ </script>";
150
+ }
151
+ $html .= "<iframe id='advanced_iframe' src='" . $src . "' width='" . esc_html($width) . "' height='" . esc_html($height) . "' scrolling='" . esc_html($scrolling) . "' ";
152
+ if (!empty ($marginwidth)) {
153
+ $html .= " marginwidth='" . esc_html($marginwidth) . "' ";
154
+ }
155
+ if (!empty ($marginheight)) {
156
+ $html .= " marginheight='" . esc_html($marginheight) . "' ";
157
+ }
158
+ if ($frameborder != '') {
159
+ $html .= " frameborder='" . esc_html($frameborder) . "' ";
160
+ }
161
+ if (!empty ($transparency)) {
162
+ $html .= " allowtransparency='" . esc_html($transparency) . "' ";
163
+ }
164
+ if (!empty ($class)) {
165
+ $html .= " class='" . esc_html($class) . "' ";
166
+ }
167
+
168
+ $html .= "></iframe>\n ";
169
+ }
170
+ return $html;
171
+ }
172
+
173
+ function printAdminPage() {
174
+ require_once('advanced-iframe-admin-page.php');
175
+ }
176
+ }
177
+ }
178
+ // setup new instance of plugin
179
+ if (class_exists("advancediFrame")) {
180
+ $cons_advancediFrame = new advancediFrame();
181
+ }
182
+ //Actions and Filters
183
+ if (isset($cons_advancediFrame)) {
184
+ //Initialize the admin panel
185
+ if (!function_exists("advancediFrame_ap")) {
186
+ function advancediFrame_ap() {
187
+ global $cons_advancediFrame;
188
+ if (!isset($cons_advancediFrame)) {
189
+ return;
190
+ }
191
+ $options = $cons_advancediFrame->getAdminOptions();
192
+ if (function_exists('add_options_page')) {
193
+ add_options_page('Advanced iFrame', 'Advanced iFrame', 'manage_options', basename(__FILE__), array(&$cons_advancediFrame, 'printAdminPage'));
194
+ }
195
+ }
196
+ }
197
+ add_action('admin_menu', 'advancediFrame_ap', 1); //admin page
198
+ add_action('init', array(&$cons_advancediFrame, 'loadLanguage'), 1); // add languages
199
+ add_action('admin_head', array(&$cons_advancediFrame, 'addAdminHeaderCode'), 99); // load css
200
+ add_shortcode('advanced_iframe', array(&$cons_advancediFrame, 'do_iframe_script'), 1); // setup shortcode [twg]
201
+ register_activation_hook(__FILE__, array(&$cons_advancediFrame, 'activate'));
202
+ }
203
+ ?>
css/ai.css ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .errordiv { padding:10px; margin:10px; border: 1px solid #555555;color: #000000;background-color: #f8f8f8; text-align:center; width:360px; }
2
+
3
+ #im_test .text, #im_test img {
4
+ vertical-align: middle;
5
+ }
6
+
7
+ .linepad p {
8
+ line-height: 1.3em;
9
+ }
10
+
11
+ .updated p, .error p {
12
+ line-height: 1.1;
13
+ }
14
+
15
+ .icon_jfu {
16
+ float: left;
17
+ height: 36px;
18
+ margin-top: 14px;
19
+ margin-right: 6px;
20
+ margin-bottom: 0pt;
21
+ margin-left: 0pt;
22
+ width: 36px;
23
+ background-image: url(../img/jfu_logo_32x32.png) !important;
24
+ background-position: -0px -0px !important;
25
+ }
img/jfu_logo_32x32.png ADDED
Binary file
img/logo.png ADDED
Binary file
languages/default.mo ADDED
Binary file
languages/default.po ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Advanced iframe\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-07-23 01:49+0100\n"
6
+ "PO-Revision-Date: 2011-07-23 01:49+0100\n"
7
+ "Last-Translator: Michael Dempfle <tinywebgallery@mdempfle.de>\n"
8
+ "Language-Team: TinyWebGallery <tinywebgallery@mdempfle.de>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e\n"
13
+ "X-Poedit-Basepath: C:\\software\\xampp\\htdocs\\wordpress29\\wp-content\\plugins\n"
14
+ "X-Poedit-Language: English\n"
15
+ "X-Poedit-Country: UNITED STATES\n"
16
+ "X-Poedit-SourceCharset: utf-8\n"
17
+ "X-Poedit-SearchPath-0: advanced-iframe\n"
18
+
19
+ #: advanced-iframe/advanced-iframe-admin-page.php:18
20
+ msgid "Please check the value you have entered. Only numbers with an optional px, %, em or pt are allowed"
21
+ msgstr ""
22
+
23
+ #: advanced-iframe/advanced-iframe-admin-page.php:41
24
+ msgid "Settings Updated."
25
+ msgstr ""
26
+
27
+ #: advanced-iframe/advanced-iframe-admin-page.php:60
28
+ msgid "Advanced iframe default settings"
29
+ msgstr ""
30
+
31
+ #: advanced-iframe/advanced-iframe-admin-page.php:63
32
+ msgid "This plugin will include any content an advanced iframe. Please enter the url and the size you want to include your page. You have a couple of additional default options which help to integrate your site better into your template. You can overwrite all of these settings by specifying the parameter in the shortcode. Please read the documentation after each field about the parameter you have to use."
33
+ msgstr ""
34
+
35
+ #: advanced-iframe/advanced-iframe-admin-page.php:67
36
+ msgid "Please use the following shortcode to include a page to your page: "
37
+ msgstr ""
38
+
39
+ #: advanced-iframe/advanced-iframe-admin-page.php:72
40
+ msgid "Security key"
41
+ msgstr ""
42
+
43
+ #: advanced-iframe/advanced-iframe-admin-page.php:72
44
+ msgid "This is the security key which has to be used in the shorttag. This is mandatory because otherwise anyone who can create an article can insert a gallery as well. The default security key was randomly generated during installation. Please change the key if you like. You should use this in combination with e.g. Page security to make sure that only the users you define can modify pages."
45
+ msgstr ""
46
+
47
+ #: advanced-iframe/advanced-iframe-admin-page.php:73
48
+ msgid "Allow shortcode attributes"
49
+ msgstr ""
50
+
51
+ #: advanced-iframe/advanced-iframe-admin-page.php:73
52
+ msgid "Allow to set attributes in the shortcode. All of the attributes can be overwritten in the shortcode if you set 'Yes'. Otherwise the settings you specify here are used."
53
+ msgstr ""
54
+
55
+ #: advanced-iframe/advanced-iframe-admin-page.php:74
56
+ msgid "Url"
57
+ msgstr ""
58
+
59
+ #: advanced-iframe/advanced-iframe-admin-page.php:74
60
+ msgid "Enter the full URL to your page. e.g. http://www.tinywebgallery.com. Shortcode attribute: src=\"\""
61
+ msgstr ""
62
+
63
+ #: advanced-iframe/advanced-iframe-admin-page.php:75
64
+ msgid "Width"
65
+ msgstr ""
66
+
67
+ #: advanced-iframe/advanced-iframe-admin-page.php:75
68
+ msgid "The width of the iframe. You can specify the value in px or in %. If you don't specify anything px is assumed. Shortcode attribute: width=\"\""
69
+ msgstr ""
70
+
71
+ #: advanced-iframe/advanced-iframe-admin-page.php:76
72
+ msgid "Height"
73
+ msgstr ""
74
+
75
+ #: advanced-iframe/advanced-iframe-admin-page.php:76
76
+ msgid "The height of the iframe. You can specify the value in px or in %. If you don't specify anything px is assumed. Shortcode attribute: height=\"\""
77
+ msgstr ""
78
+
79
+ #: advanced-iframe/advanced-iframe-admin-page.php:77
80
+ msgid "Scrolling"
81
+ msgstr ""
82
+
83
+ #: advanced-iframe/advanced-iframe-admin-page.php:77
84
+ msgid "Defines if scrollbars are shown if the page is too big for your iframe. Please note: If you select 'Yes' IE does always show scrollbars on many pages! So only use this if needed. Shortcode attribute: scrolling=\"auto\" or scrolling=\"no\""
85
+ msgstr ""
86
+
87
+ #: advanced-iframe/advanced-iframe-admin-page.php:78
88
+ msgid "Margin width"
89
+ msgstr ""
90
+
91
+ #: advanced-iframe/advanced-iframe-admin-page.php:78
92
+ msgid "The margin width of the iframe. You can specify the value in px. If you don't specify anything px is assumed. Shortcode attribute: marginwidth=\"\""
93
+ msgstr ""
94
+
95
+ #: advanced-iframe/advanced-iframe-admin-page.php:79
96
+ msgid "Margin height"
97
+ msgstr ""
98
+
99
+ #: advanced-iframe/advanced-iframe-admin-page.php:79
100
+ msgid "The margin height of the iframe. You can specify the value in px. If you don't specify anything px is assumed. Shortcode attribute: marginheight=\"\""
101
+ msgstr ""
102
+
103
+ #: advanced-iframe/advanced-iframe-admin-page.php:80
104
+ msgid "Frame border"
105
+ msgstr ""
106
+
107
+ #: advanced-iframe/advanced-iframe-admin-page.php:80
108
+ msgid "The frame border of the iframe. You can specify the value in px. If you don't specify anything px is assumed. Shortcode attribute: frameborder=\"\""
109
+ msgstr ""
110
+
111
+ #: advanced-iframe/advanced-iframe-admin-page.php:81
112
+ msgid "Transparency"
113
+ msgstr ""
114
+
115
+ #: advanced-iframe/advanced-iframe-admin-page.php:81
116
+ msgid "If you like that the iframe is transparent and your background is shown you should set this to 'Yes'. If this value is not set then the iframe is transparent in IE but transparent in e.g. Firefox. So by default you should leave this to 'Yes'. Shortcode attribute: transparency=\"true\" or transparency=\"false\" "
117
+ msgstr ""
118
+
119
+ #: advanced-iframe/advanced-iframe-admin-page.php:82
120
+ msgid "Class"
121
+ msgstr ""
122
+
123
+ #: advanced-iframe/advanced-iframe-admin-page.php:82
124
+ msgid "You can define a class for the iframe if you like. Shortcode attribute: class=\"\""
125
+ msgstr ""
126
+
127
+ #: advanced-iframe/advanced-iframe-admin-page.php:83
128
+ msgid "URL forward parameters"
129
+ msgstr ""
130
+
131
+ #: advanced-iframe/advanced-iframe-admin-page.php:83
132
+ msgid "Define the parameters that should be passed from the browser url to the iframe url. Please separate the parameters by ','. In e.g. TinyWebGallery this enables you to jump directly to an album or image although TinyWebGallery is included in an iframe. Shortcode attribute: url_forward_parameter=\"\""
133
+ msgstr ""
134
+
135
+ #: advanced-iframe/advanced-iframe-admin-page.php:88
136
+ #: advanced-iframe/advanced-iframe-admin-page.php:110
137
+ msgid "Update Settings"
138
+ msgstr ""
139
+
140
+ #: advanced-iframe/advanced-iframe-admin-page.php:91
141
+ msgid "Advanced options"
142
+ msgstr ""
143
+
144
+ #: advanced-iframe/advanced-iframe-admin-page.php:94
145
+ msgid "With the following options you can modify your template on the fly to give the iframe more space! At most templates you would have to create a page template with a special css and this is quite complicated. By using the options below your template is modified on the fly by jQuery. Please look at the screenshots to make these options more clear. The options are very useful for templates that have a top navigation because otherwise your menu is gone! If you still want to do this you should add a back link to the page. The examples below are for Twenty Ten, iNove and the default Wordpress theme."
146
+ msgstr ""
147
+
148
+ #: advanced-iframe/advanced-iframe-admin-page.php:98
149
+ msgid "Content id"
150
+ msgstr ""
151
+
152
+ #: advanced-iframe/advanced-iframe-admin-page.php:98
153
+ msgid "Some templates do not use the full width for their content and even most 'One column, no sidebar Page Template' templates only remove the sidebar but do not change the content width. Please set the id of the div starting with a hash (#) that defines the content. In the field below you then define the style you want to overwrite. For Twenty Ten and WordPress Default the id is #content, for iNove it is #main. You can also define more than one element. Please separate them by | and provide the styles below. Please read the note below how to find this id for other templates. #content|h2 means that you want to set a new style for the div content and the heading h2 below. Shortcode attribute: content_styles=\"\""
154
+ msgstr ""
155
+
156
+ #: advanced-iframe/advanced-iframe-admin-page.php:99
157
+ msgid "Content styles"
158
+ msgstr ""
159
+
160
+ #: advanced-iframe/advanced-iframe-admin-page.php:99
161
+ msgid "Define the styles that have to be overwritten to enable the full width. Most of the time have to modify some of the following attributes: width, margin-left, margin-right, padding-left. Please use ; as separator between styles. If you have defined more than one element above (Content id) please separate the different style sets with |. The default values are: Wordpress default: 'width:450px;padding-left:45px;'. Twenty Ten: 'margin-left:20px;margin-right:240px'. iNove: 'width:605px'. Please read the note below how to find this styles for other templates. If you have defined #content|h2 at the Content id you can e.g. set 'width:650px;padding-left:25px;|padding-left:15px;'. Shortcode attribute: content_styles=\"\""
162
+ msgstr ""
163
+
164
+ #: advanced-iframe/advanced-iframe-admin-page.php:101
165
+ msgid "Hide elements"
166
+ msgstr ""
167
+
168
+ #: advanced-iframe/advanced-iframe-admin-page.php:101
169
+ msgid "This setting allows to hide elements when the iframe is shown. This can be used to hide the sidebar or the heading. Usage: If you want to hide a div you have to enter a hash (#) followed by the id e.g. #sidebar. If you want to hide a heading which is a &lt;h2&gt; you have to enter h2. You can define several elements separated by , e.g. #sidebar,h2. This gives you a lot more space to show the content of the iframe. To get the id of the sidebar go to Appearance -> Editor -> Click on 'Sidebar' on the right side. Then look for the first 'div' you find. The id of this div is the one you need. For some common templates the id is e.g. #menu, #sidebar, or #primary. For Twenty Ten and iNove you can remove the sidebar directly: Page attributes -> Template -> no sidebar. Wordpress default: '#sidebar'. I recommend to use firebug (see below) to find the elements and ids. You can use any valid jQuery selector pattern here! Shortcode attribute: hide_sidebar=\"\""
170
+ msgstr ""
171
+
172
+ #: advanced-iframe/advanced-iframe-admin-page.php:105
173
+ msgid "<strong>How to find the id and the attributes:</strong><ol><li>Manually: Go to Appearance -> Editor and select the page template. The you have to look with div elements are defined. e.g. container, content, main. Also classes can be defined here. Then you have to select the style sheet below and search for this ids and classes and look which one does define the width of you content.</li><li>Firebug: For Firefox you can use the plugin firebug to select the content element directly in the page. On the right side the styles are always shown. Look for the styles that set the width or any bigger margins. This are the values you can then overwrite by the settings above.</li></ol>"
174
+ msgstr ""
175
+
176
+ #: advanced-iframe/advanced-iframe-admin-page.php:120
177
+ msgid "Wordpress Flash Uploader, TinyWebGallery, Joomla Flash Uploader"
178
+ msgstr ""
179
+
180
+ #: advanced-iframe/advanced-iframe-admin-page.php:122
181
+ msgid "This plugin is the extract for the iframe wrapper which was written for the TinyWebGallery. I needed an iframe wrapper that could do more then simply include a page. It needed to pass parameters to the iframe and modify the template on the fly to get more space for TWG. If you want to integrate TWG please use the \"TinyWebGallery wrapper\". It offers specific features only needed for the gallery. I hope this standalone wrapper is useful for other Wordpress users as well."
182
+ msgstr ""
183
+
184
+ #: advanced-iframe/advanced-iframe-admin-page.php:125
185
+ msgid "Please take a look at my other projects: Wordpress Flash Uploader, TinyWebGallery, Joomla Flash Uploader or TWG Flash Uploader. If you like TWG or one of my other projects like JFU, WFU or TFU you should consider to register because you can use all products with one single license and get all features of the gallery and a complete upload solution as well."
186
+ msgstr ""
187
+
188
+ #: advanced-iframe/advanced-iframe-admin-page.php:128
189
+ msgid "Please go <a href=\"http://www.tinywebgallery.com\" target=\"_blank\">www.tinywebgallery.com</a> for details."
190
+ msgstr ""
191
+
192
+ #: advanced-iframe/advanced-iframe-admin-page.php:143
193
+ #: advanced-iframe/advanced-iframe-admin-page.php:163
194
+ msgid "Yes"
195
+ msgstr ""
196
+
197
+ #: advanced-iframe/advanced-iframe-admin-page.php:147
198
+ #: advanced-iframe/advanced-iframe-admin-page.php:167
199
+ msgid "No"
200
+ msgstr ""
201
+
202
+ #: advanced-iframe/advanced-iframe.php:100
203
+ msgid "An invalid security key was specified. Please use at least the following shortcode:<br>[advanced_iframe securitykey=\"&lt;your security key - see settings&gt;\"]"
204
+ msgstr ""
205
+
206
+ #: advanced-iframe/advanced-iframe.php:135
207
+ msgid "Configuration error: The attributes content_id and content_styles have to have the amount of value sets separated by |."
208
+ msgstr ""
209
+
readme.txt ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Plugin Name ===
2
+ Contributors: mdempfle, Michael Dempfle
3
+ Donate link: http://www.tinywebgallery.com
4
+ Tags: iframe, advanced, shortcode, widget
5
+ Requires at least: 2.8.6
6
+ Tested up to: 3.2.1
7
+ Stable tag: 1.3
8
+
9
+ This plugin includes any webpage as shortcode in an advanced iframe.
10
+
11
+ == Description ==
12
+
13
+ This plugin includes any webpage as shortcode in an advanced iframe.
14
+
15
+ = Shortcode for advanced iframe =
16
+ By entering the shortcode '[advanced_iframe secuitykey=""]' you can include any webpage to any page or article.
17
+ The following differences to a normal iframe are implemented:
18
+
19
+ - Security code: You can only insert the shortcode with a valid security code from the administration.
20
+ - Enable/disable the overwrite of default short code settings
21
+ - Hide areas of the layout to give the iframe more space (see screenshot)
22
+ - Modify css styles to e.g. change the width of the content area (see screenshot)
23
+ - Forward parameters to the iframe
24
+
25
+ The following shortcode attributes can be used. Please go to the administration for details:
26
+ [twg secuitykey="" src="" width="" height="" scrolling="" marginwidth="" marginheight=""
27
+ frameborder="" content_id="" content_styles="" hide_elements="" class="" url_forward_parameter=""]
28
+
29
+ = Aministration =
30
+ * See Settings -> Advanced iframe
31
+ * Enables the configuration of the defaults for the iframe and the modifications on the template.
32
+
33
+ == Installation ==
34
+ There are 2 ways to install the advanced iframe
35
+
36
+ *Using the Wordpress Admin screen*
37
+
38
+ 1. Click Plugins, Add New
39
+ 1. Search for advanced iframe
40
+ 1. Install and Activate it
41
+ 1. Place '[advanced_iframe secuitykey=""]' in your pages or posts. the security key can be found at Settings -> Advanced iframe
42
+
43
+ *Using FTP*
44
+
45
+ 1. Upload 'advanced-iframe' to the '/wp-content/plugins/' directory
46
+ 1. Activate the plugin through the 'Plugins' menu in WordPress
47
+ 1. Place '[advanced_iframe secuitykey=""]' in your pages or posts. the security key can be found at Settings -> Advanced iframe
48
+
49
+ == Screenshots ==
50
+ 1. Comparison between normal iframe and advanced iframe wrapper. The red areas are modified by the advanced iframe to display the content better.
51
+ 2. This image shows the difference with an url forward parameter. In the advanced iframe a sub album is shown while the normal iframe still shows the entry screen.
52
+ 3. The basic admin screen to enable standard settings
53
+ 4. The advanced admin screen to enable advanced settings like html and css changes
54
+
55
+ == Frequently Asked Questions ==
56
+ Please read the instructions in the administration careful.
57
+
58
+ == Upgrade Notice ==
59
+ = 1.0 =
60
+ First version.
61
+
62
+ == Changelog ==
63
+ = 1.3 =
64
+ Fix: content_id,content_styles,hide_elements was always used from the config even when a shortcode was given. Now the shortcode is used as well.
65
+
66
+ = 1.2 =
67
+ Fix: The src was not working in the shortcode. I missed to rename this parameter when making this plugin more generic.
68
+
69
+ = 1.1 =
70
+ Fix: The iframe was always printed first. Now it is printed exacly where the shortcode is inserted.
71
+
72
+ = 1.0 =
73
+ First version.
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file