mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
This commit is contained in:
10
e107_core/templates/print_template.php
Normal file
10
e107_core/templates/print_template.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
$PRINT_TEMPLATE['default'] = '<div style="background-color:white">
|
||||||
|
<div style="text-align:{ALIGN}">{LOGO: h=100}</div>
|
||||||
|
<hr />
|
||||||
|
<div style="text-align:{ALIGN}; margin-bottom:50px">{TEXT}</div>
|
||||||
|
<div class="hidden-print" style="text-align:center">{BUTTON}</div>
|
||||||
|
</div>';
|
||||||
|
|
@@ -46,8 +46,8 @@ class e_plugin
|
|||||||
'e_linkgen',
|
'e_linkgen',
|
||||||
'e_list',
|
'e_list',
|
||||||
|
|
||||||
'e_meta', // @Deprecated
|
'e_meta', // @deprecated
|
||||||
'e_emailprint',
|
'e_emailprint', /* @deprecated - see e_print */
|
||||||
'e_print', // new v2.2
|
'e_print', // new v2.2
|
||||||
'e_frontpage',
|
'e_frontpage',
|
||||||
'e_latest', /* @deprecated - see e_dashboard */
|
'e_latest', /* @deprecated - see e_dashboard */
|
||||||
@@ -71,6 +71,7 @@ class e_plugin
|
|||||||
'e_tohtml', /* @deprecated - use e_parse */
|
'e_tohtml', /* @deprecated - use e_parse */
|
||||||
'e_featurebox',
|
'e_featurebox',
|
||||||
'e_parse',
|
'e_parse',
|
||||||
|
'e_print', // new v2.3.1
|
||||||
'e_related',
|
'e_related',
|
||||||
'e_rss',
|
'e_rss',
|
||||||
'e_upload',
|
'e_upload',
|
||||||
|
15
e107_plugins/forum/e_print.php
Normal file
15
e107_plugins/forum/e_print.php
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
class forum_print // plugin-folder + '_print'
|
||||||
|
{
|
||||||
|
|
||||||
|
public function render($parm)
|
||||||
|
{
|
||||||
|
// var_dump($parm);
|
||||||
|
return "TODO!";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
47
print.php
47
print.php
@@ -51,14 +51,18 @@ e107::css('inline',$CSS);
|
|||||||
define('e_IFRAME', true);
|
define('e_IFRAME', true);
|
||||||
|
|
||||||
$source = preg_replace('/[^\w\d_\:]/',"", $qs[0]);
|
$source = preg_replace('/[^\w\d_\:]/',"", $qs[0]);
|
||||||
$parms = varset($qs[1],'');
|
$parms = varset($qs[1]);
|
||||||
unset($qs);
|
unset($qs);
|
||||||
|
|
||||||
if(strpos($source,'plugin:') !== FALSE)
|
if(strpos($source,'plugin:') !== false)
|
||||||
{
|
{
|
||||||
$plugin = substr($source, 7);
|
$plugin = substr($source, 7);
|
||||||
|
|
||||||
if(file_exists(e_PLUGIN.$plugin."/e_emailprint.php"))
|
if($obj = e107::getAddon($plugin, 'e_print'))
|
||||||
|
{
|
||||||
|
$print_text = e107::callMethod($obj,'render', $parms);
|
||||||
|
}
|
||||||
|
elseif(file_exists(e_PLUGIN.$plugin."/e_emailprint.php"))
|
||||||
{
|
{
|
||||||
include_once(e_PLUGIN.$plugin."/e_emailprint.php");
|
include_once(e_PLUGIN.$plugin."/e_emailprint.php");
|
||||||
$print_text = print_item($parms);
|
$print_text = print_item($parms);
|
||||||
@@ -70,7 +74,7 @@ if(strpos($source,'plugin:') !== FALSE)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else // @todo move to e107_plugins/news/e_print.php
|
||||||
{
|
{
|
||||||
//$con = new convert;
|
//$con = new convert;
|
||||||
// $id = intval($parms);
|
// $id = intval($parms);
|
||||||
@@ -88,8 +92,9 @@ else
|
|||||||
$tmp = e107::getTemplate('news', 'news_view', $newsViewTemplate);
|
$tmp = e107::getTemplate('news', 'news_view', $newsViewTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = $tp->toText($row['news_title']);
|
$title = e107::getParser()->toText($row['news_title']);
|
||||||
define('e_PAGETITLE', '[print] '. $title);
|
// define('e_PAGETITLE', '[print] '. $title);
|
||||||
|
e107::title('[print] '. $title);
|
||||||
e107::meta('robots', 'noindex');
|
e107::meta('robots', 'noindex');
|
||||||
|
|
||||||
$template = $tmp['item'];
|
$template = $tmp['item'];
|
||||||
@@ -112,29 +117,37 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(defined("TEXTDIRECTION") && TEXTDIRECTION == "rtl"){
|
if(defined("TEXTDIRECTION") && TEXTDIRECTION === "rtl")
|
||||||
|
{
|
||||||
$align = 'right';
|
$align = 'right';
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$align = 'left';
|
$align = 'left';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header down here to give us a chance to set a page title
|
// Header down here to give us a chance to set a page title
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
|
|
||||||
//temporary solution - object of future cahges
|
|
||||||
if(is_readable(THEME.'print_template.php'))
|
if(is_readable(THEME.'print_template.php')) // legacy location.
|
||||||
{
|
{
|
||||||
$PRINT_TEMPLATE = '';
|
$PRINT_TEMPLATE = '';
|
||||||
include_once(THEME.'print_template.php');
|
include_once(THEME.'print_template.php');
|
||||||
echo $tp->parseTemplate($PRINT_TEMPLATE);
|
echo e107::getParser()->parseTemplate($PRINT_TEMPLATE);
|
||||||
}
|
}
|
||||||
else
|
else // v2.3.1+
|
||||||
{
|
{
|
||||||
echo "
|
$PRINT_TEMPLATE = e107::getCoreTemplate('print', 'default');
|
||||||
<div style='background-color:white'>
|
|
||||||
<div style='text-align:".$align."'>".$tp->parseTemplate("{LOGO: h=100}", TRUE)."</div><hr />
|
$vars = array(
|
||||||
<div style='text-align:".$align."'>".$print_text."</div><br /><br />
|
'TEXT' => $print_text,
|
||||||
<form action='#'><div class='hidden-print' style='text-align:center'><input class='btn btn-primary ' type='button' value='".LAN_PRINT_307."' onclick='window.print()' /></div></form></div>";
|
'ALIGN' => $align,
|
||||||
|
'BUTTON' => "<button class='btn btn-primary ' type='button' onclick='window.print()' />".LAN_PRINT_307."</button>"
|
||||||
|
);
|
||||||
|
|
||||||
|
echo e107::getParser()->parseTemplate($PRINT_TEMPLATE, true, $vars);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once(FOOTERF);
|
require_once(FOOTERF);
|
||||||
|
Reference in New Issue
Block a user