Turn the QR Code extension into a SimpleExtension, trim the boilerplate

This commit is contained in:
Shish
2010-01-26 13:38:08 +00:00
parent 4ad7232abd
commit 5ddaed8e28
2 changed files with 7 additions and 34 deletions

View File

@@ -1,12 +1,10 @@
<?php
class QRImageTheme extends Themelet {
public function links_block(Page $page, $data) {
$image_src = $data['image_src'];
global $config, $user;
$base_href = $config->get_string('base_href');
$data_href = get_base_href();
public function links_block($link) {
global $page;
$base_href = get_base_href();
$page->add_block( new Block(
"QR Code","<img src='".$data_href."/ext/qr_code/qr_img.php?d=".$image_src."&s=3' />","left",50));
"QR Code","<img src='$base_href/ext/qr_code/qr_img.php?d=$link&s=3' />","left",50));
}
}
?>