Skip to content

Commit

Permalink
Merge branch 'w43_MDL-29283_m22_tcpdf' of git://github.com/skodak/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Nov 1, 2011
2 parents 302f45e + d0a0db4 commit e686d11
Show file tree
Hide file tree
Showing 81 changed files with 41,920 additions and 19,945 deletions.
10 changes: 5 additions & 5 deletions admin/tool/unittest/other/pdflibtestpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function _getfontpath() {

$c = '<h3>General information</h3>';
$c .= 'Moodle release: ' . $CFG->release . '<br />';
$c .= 'PDF producer: ' . PDF_PRODUCER . '<br />';
$c .= 'PDF producer: TCPDF ' . $doc->getTCPDFVersion() . ' (http://www.tcpdf.org) <br />';
$c .= 'Font of this test page: ' . $fontfamily . '<br />';

$c .= '<h3>Current settings</h3>';
Expand All @@ -105,10 +105,10 @@ public function _getfontpath() {
$c .= '<h3>Installed languages and their alphabets</h3>';
$languages = array();
$langdirs = get_list_of_plugins('lang', '', $CFG->dataroot);
array_unshift($langdirs, 'Moodle core English');
array_unshift($langdirs, 'en');
foreach ($langdirs as $langdir) {
if ('Moodle core English' == $langdir) {
$langconfig = $CFG->dirroot . '/lang/en_utf8/langconfig.php';
if ('en' == $langdir) {
$langconfig = $CFG->dirroot . '/lang/en/langconfig.php';
} else {
$langconfig = $CFG->dataroot . '/lang/' . $langdir . '/langconfig.php';
}
Expand All @@ -124,7 +124,7 @@ public function _getfontpath() {
$c .= '<dl>';
foreach ($languages as $langcode => $language) {
$c .= '<dt>' . $language->langname . ' (' . $langcode . ')</dt>';
$c .= '<dd>' . $language->alphabet . '</dd>';
$c .= '<dd>"' . $language->alphabet . '"</dd>';
}
$c .= '</dl>';

Expand Down
17 changes: 17 additions & 0 deletions lib/pdflib.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,23 @@ public function __construct($orientation='P', $unit='mm', $format='A4', $unicode
$this->l['a_meta_dir'] = get_string('thisdirection', 'langconfig');
}

/**
* Send the document to a given destination: string, local file or browser.
* In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.<br />
* The method first calls Close() if necessary to terminate the document.
* @param $name (string) The name of the file when saved. Note that special characters are removed and blanks characters are replaced with the underscore character.
* @param $dest (string) Destination where to send the document. It can take one of the following values:<ul><li>I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.</li><li>D: send to the browser and force a file download with the name given by name.</li><li>F: save to a local server file with the name given by name.</li><li>S: return the document as a string (name is ignored).</li><li>FI: equivalent to F + I option</li><li>FD: equivalent to F + D option</li><li>E: return the document as base64 mime multi-part email attachment (RFC 2045)</li></ul>
* @public
* @since 1.0
* @see Close()
*/
public function Output($name='doc.pdf', $dest='I') {
$olddebug = error_reporting(0);
$result = parent::output($name, $dest);
error_reporting($olddebug);
return $result;
}

/**
* Return fonts path
* Overriding TCPDF::_getfontpath()
Expand Down
Loading

0 comments on commit e686d11

Please sign in to comment.