Beispiel #1
0
 /**
  * Get the admin options
  */
 function getAiAdminOptions()
 {
     $iframeAdminOptions = advancediFrame::iframe_defaults();
     $devOptions = get_option("advancediFrameAdminOptions");
     if (!empty($devOptions)) {
         foreach ($devOptions as $key => $option) {
             $iframeAdminOptions[$key] = $option;
         }
     }
     update_option("advancediFrameAdminOptions", $iframeAdminOptions);
     return $iframeAdminOptions;
 }
             }
         }
         if ($item == 'id') {
             $devOptions[$item] = preg_replace("/\\W/", "_", $text);
         }
         // we check if we have an invalid configuration!
         if ($devOptions['shortcode_attributes'] === 'false' && $devOptions['use_shortcode_attributes_only'] === 'true') {
             $devOptions['use_shortcode_attributes_only'] = 'false';
             printError(__('You have set "Allow shortcode attributes" to "No" and "Use shortcode attributes only" to "Yes". This combination is not valid. "Use shortcode attributes only" was set to "No" and now only the settings from the administration is used. Please check if this is what you really want, as all iframes do have the same configuration than.', "advanced-iframe"));
             $scrollposition = 0;
         }
     }
 } else {
     $securityKey = $devOptions['securitykey'];
     $it = $devOptions['install_date'];
     $devOptions = advancediFrame::iframe_defaults();
     $devOptions['securitykey'] = $securityKey;
     $devOptions['install_date'] = $it;
 }
 if ($evanto && empty($devOptions['install_date'])) {
     $devOptions['install_date'] = time();
 }
 update_option($this->adminOptionsName, $devOptions);
 // create the external js file with the url of the wordpress installation
 $template_name = dirname(__FILE__) . '/js/ai_external.template.js';
 $jquery_path = site_url() . '/wp-includes/js/jquery/jquery.js';
 $resize_path = site_url() . '/wp-content/plugins/advanced-iframe/includes/scripts/jquery.ba-resize.min.js';
 $content = file_get_contents($template_name);
 $new_content = str_replace('WORDPRESS_SITE_URL', get_site_url(), $content);
 $new_content = str_replace('PARAM_ID', $devOptions['id'], $new_content);
 $new_content = str_replace('PARAM_IFRAME_HIDE_ELEMENTS', $devOptions['iframe_hide_elements'], $new_content);