' . __('Gallery2 API located in G2 Path?', 'wpg2') . ' ';
if (file_exists( $g2_option['g2_filepath'].'embed.php' ) )
$environment_html .= '' . __('Success', 'wpg2');
else {
$environment_html .= '' . __('Failed', 'wpg2');
$validate_err=1;
}
$environment_html .= " ";
// g2image installed?
// $environment_html .= '
' . __('G2Image located in TinyMCE plugins folder?', 'wpg2') . ' ';
// if (file_exists('../wp-includes/js/tinymce/plugins/g2image/g2image.php' ) )
// $environment_html .= '' . __('Success', 'wpg2');
// else {
// $environment_html .= '' . __('Failed', 'wpg2');
// $validate_err=1;
// }
// $environment_html .= " ";
// Validate G2 Plug-In
if (!$validate_err) {
$g2_option['g2_validated'] = "Yes";
update_option('g2_options', $g2_option);
}
// Test Initialise G2
$environment_html .='
' . __('Gallery2 init?', 'wpg2') . ' ';
if (!$validate_err) {
if (!defined('G2INIT')) {
$ret = g2_init();
if (!$ret)
$environment_html .= '' . __('Success', 'wpg2') . ' ';
else {
$environment_html .= '' . __('Failed', 'wpg2') . '->' . $ret->getAsHtml();
$validate_err=1;
}
} else
$environment_html .= '' . __('Success', 'wpg2') . ' ';
} else $environment_html .= '' . __('Skipped Due to Previous Error', 'wpg2') . '';
$environment_html .= " ";
// Test G2 API Version
$environment_html .= '
' . __('Gallery2 Version Compatible?' , 'wpg2') . ' ';
if (!$validate_err) {
$ret = GalleryEmbed::isCompatibleWithEmbedApi($g2_option['g2_apiversion']);
if ($ret)
$environment_html .= '' . __('Success', 'wpg2') . ' ';
else {
$environment_html .= '' . __('Failed', 'wpg2') . ' ';
$validate_err=1;
}
} else $environment_html .= '' . __('Skipped Due to Previous Error', 'wpg2') . '';
$environment_html .= " ";
// Test Wordpress Version
global $wp_version;
$environment_html .= '
' . __('Wordpress Version Compatible?' , 'wpg2') . ' ';
if (!$validate_err) {
if ($wp_version >=$g2_option['g2_wpversion_low'] && $wp_version <=$g2_option['g2_wpversion_high'])
$environment_html .= '' . __('Success', 'wpg2') . ' ';
else {
$environment_html .= '' . __('Failed', 'wpg2') . ' ';
$validate_err=1;
}
} else $environment_html .= '' . __('Skipped Due to Previous Error', 'wpg2') . '';
$environment_html .= " ";
// ImageBlock Active?
$environment_html .= '
' . __('Gallery2 Module: ImageBlock Active?' , 'wpg2') . ' ';
if (!$validate_err) {
$g2_image_block_active = 0;
$g2_moduleid = 'imageblock';
list ($ret, $g2_modulestatus ) = GalleryCoreApi::fetchPluginStatus('module');
if (!$ret) {
if (isset($g2_modulestatus[$g2_moduleid]) && !empty($g2_modulestatus[$g2_moduleid]['active']) && $g2_modulestatus[$g2_moduleid]['active'])
$environment_html .= '' . __('Success', 'wpg2') . ' ';
else {
$environment_html .= '' . __('Failed', 'wpg2') . ' ';
$validate_err=1;
}
}
} else $environment_html .= '' . __('Skipped Due to Previous Error', 'wpg2') . '';
$environment_html .= " ";
// ImageFrame Active?
$environment_html .= '
' . __('Gallery2 Module: ImageFrame Active?' , 'wpg2') . ' ';
if (!$validate_err) {
$g2_image_block_active = 0;
$g2_moduleid = 'imageframe';
list ($ret, $g2_modulestatus ) = GalleryCoreApi::fetchPluginStatus('module');
if (!$ret) {
if (isset($g2_modulestatus[$g2_moduleid]) && !empty($g2_modulestatus[$g2_moduleid]['active']) && $g2_modulestatus[$g2_moduleid]['active'])
$environment_html .= '' . __('Success', 'wpg2') . ' ';
else {
$environment_html .= '' . __('Failed', 'wpg2') . ' ';
$validate_err=1;
}
}
} else $environment_html .= '' . __('Skipped Due to Previous Error', 'wpg2') . '';
$environment_html .= " ";
// Start Rewrite Module Testing
$environment_html .= '
' . __('Gallery2 Module: Rewrite Active?' , 'wpg2') . ' ';
if (!$validate_err) {
list ($ret, $rewriteApi) = GalleryCoreApi::newFactoryInstance('RewriteApi');
if ($rewriteApi) { // Module Active
$environment_html .= '' . __('Success', 'wpg2') . ' ';
} else $environment_html .= '' . __('Not Active', 'wpg2') . ' ';
} else $environment_html .= '' . __('Skipped Due to Previous Error', 'wpg2') . '';
$environment_html .= '' . __('Gallery2 URL Rewrite Rules Updated?' , 'wpg2') . ' ';
if (!$validate_err) {
if ($rewriteApi) {
$required = array(1, 0);
list ($ret, $iscompatible) = $rewriteApi->isCompatibleWithApi($required);
if ($iscompatible) { // API OK
$errstr = g2_configurerewrites(); // Call the Auto-configuration Function
if (empty($errstr)) {
list ($ret, $configrequired) = $rewriteApi->needsEmbedConfig();
if ($configrequired) {
$environment_html .= '' . __('Failed with Incomplete Configuration', 'wpg2') . ' ';
$validate_err=1;
} else
$environment_html .= '' . __('Success', 'wpg2') . ' ';
} else {
$environment_html .= '' . sprintf(__('Active But Config Failed with error: %s', 'wpg2'), $errstr) . ' ';
$validate_err=1;
}
} else $environment_html .= '' . __('Skipped Config cannot be Verified', 'wpg2') . ' ';
} else $environment_html .= '' . __('Not Active', 'wpg2') . ' ';
} else $environment_html .= '' . __('Skipped Due to Previous Error', 'wpg2') . '';
// Custom Header?
if ( file_exists( TEMPLATEPATH . '/wpg2header.php') ) {
$environment_html .= '' . __('Using External Header?', 'wpg2') . ' ';
$environment_html .= '' . __('Success', 'wpg2');
$g2_option['g2_externalheader'] = "Yes";
} else {
$environment_html .= '' . __('Using Simple Header?', 'wpg2') . ' ';
$environment_html .= '' . __('Success', 'wpg2');
$g2_option['g2_externalheader'] = "No";
}
$environment_html .= " ";
// Custom Footer?
if ( file_exists( TEMPLATEPATH . '/wpg2footer.php') ) {
$environment_html .= '' . __('Using External Footer?', 'wpg2') . ' ';
$environment_html .= '' . __('Success', 'wpg2');
$g2_option['g2_externalfooter'] = "Yes";
} else {
$environment_html .= '' . __('Using Simple Footer?', 'wpg2') . ' ';
$environment_html .= '' . __('Success', 'wpg2');
$g2_option['g2_externalfooter'] = "No";
}
$environment_html .= " ";
$environment_html .= " ";
if ($validate_err) {
// Make sure the Plug In Validation Status is Not Validated.
if ( $g2_option['g2_validated'] = "Yes" ) {
$g2_option['g2_validated'] = "No";
}
}
// Update the Options
update_option('g2_options', $g2_option);
?>
' . __('WPG2 Plugin ', 'wpg2') . '
' . __('Validation Failed', 'wpg2') . '';
echo '' . __('Please see "WPG2 Environment Status" below for reasons.', 'wpg2') . ' ';
echo '
';
} else {
echo '
' . __('WPG2 Plugin ', 'wpg2') . '' . __('Validated Successfully', 'wpg2') . ' ';
echo '
' . __('Show/Hide Auto Configuration Form » ', 'wpg2') . ' ';
echo __('Your configuration is valid.', 'wpg2') . '
';
echo __('You should only need to use auto configuration again if you are moving your Gallery to a new location.', 'wpg2') . '
';
echo '
' . __('WPG2 Environment Status', 'wpg2') . '';
echo "
";
echo $environment_html;
?>