Skip to content

Commit

Permalink
Add print button.
Browse files Browse the repository at this point in the history
  • Loading branch information
dthies committed Feb 16, 2016
1 parent 281ca60 commit 02932af
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
7 changes: 5 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
2015090100 Add abiltity to request filtered document using post method. This allows the preview to work on texts
that are larger than the server's maximum url size setting.
2016021600 Add a button to print the contents of the editor.

2015090100 Add abiltity to request filtered document using post
method. This allows the preview to work on texts that are larger than
the server's maximum url size setting.
1 change: 1 addition & 0 deletions lang/en/atto_preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@
$string['settings'] = 'Preview settings';
$string['layout'] = 'Page layout';
$string['layout_desc'] = 'Choose the page layout that works best with the theme and purpose of the site.';
$string['printcontent'] = 'Print contents';
8 changes: 7 additions & 1 deletion preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@

print $OUTPUT->header();

// Print dialog link a la book print tool.
$printtext = get_string('printcontent', 'atto_preview');
$printicon = $OUTPUT->pix_icon('book', $printtext, 'booktool_print', array('class' => 'icon'));
$printlinkatt = array('onclick' => 'window.print();return false;', 'class' => 'hidden-print');
$printbutton = html_writer::link('#', $printicon.$printtext, $printlinkatt);

// Output filtered content.
$content = format_text($content, FORMAT_HTML, array('context' => $contextid));
$content = preg_replace('/brokenfile.php#/', 'draftfile.php', $content);
print $OUTPUT->container($content, 'atto-preview-content');
print $printbutton . $OUTPUT->container($content, 'atto-preview-content');

print $OUTPUT->footer();
6 changes: 3 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
* Atto text editor preview version file.
*
* @package atto_preview
* @copyright 2015 Daniel Thies <[email protected]>
* @copyright 2015 onward Daniel Thies <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2015010305; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2016021500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2014051200; // Requires this Moodle version.
$plugin->component = 'atto_preview'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE; // Maturity level.
$plugin->release = 2015090100;
$plugin->release = 2016021500;

0 comments on commit 02932af

Please sign in to comment.