Source for file data.googleviewer.php
Documentation is available at data.googleviewer.php
* @subpackage plugins_data
define( 'PLUGIN_GUID_DATAGOOGLEVIEWER', 'datagoogleviewer' );
'auto_activate' => FALSE,
'requires_pair' => FALSE,
'load_function' => 'data_googleviewer',
'title' => 'Google Viewer',
'help_page' => 'DataPluginGoogleviewer',
'description' => tra( "This plugin allows you to simply embed a PDF document in a page using the embeddable Google Viewer." ),
'help_function' => 'data_googleviewer_help',
'syntax' => "{googleviewer url=}",
* @return HTML help in a table
'<table class="data help">'
. '<th>' . tra( "Key" ) . '</th>'
. '<th>' . tra( "Type" ) . '</th>'
. '<th>' . tra( "Comments" ) . '</th>'
. '<td>' . tra( "string" ) . '<br />' . tra("(required)") . '</td>'
. '<td>' . tra( "URL of the PDF online" ) . '</td>'
. '<td>' . tra( "numeric" ) . '<br />' . tra( "(optional)" ) . '</td>'
. '<td>' . tra( "Alternate width of the Google Viewer box in pixels. Default is 100%." ) . '</td>'
. '<td>' . tra( "numeric" ) . '<br />' . tra("(optional)") . '</td>'
. '<td>' . tra( "Alternate height of the Google Viewer box in pixels. Default is 650." ) . '</td>'
. tra( "Example: " ) . '{googleviewer url=XXXXX width=425 height=355}';
* @return TRUE on success, FALSE on failure - mErrors will contain reason for failure
$width = ( !empty( $width ) ? $width : "100%" );
$height = ( !empty( $height ) ? $height : "650" );
return '<!--~np~--><iframe width="'. $width. '" height="'. $height. '" style="border:none;" src="http://docs.google.com/viewer?embedded=true&url='. urlencode($url). '"></iframe><!--~/np~-->';
return tra( 'No URL given' );
|