1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00
php-e107/e107_handlers/emailprint_class.php
marj 3420b193ab Language selection simplification
switch to include_lan for the time being

work in progress
2009-08-15 11:55:30 +00:00

78 lines
2.3 KiB
PHP

<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| ©Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/emailprint_class.php,v $
| $Revision: 1.7 $
| $Date: 2009-08-15 11:55:30 $
| $Author: marj_nl_fr $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_print.php");
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_email.php");
class emailprint
{
function render_emailprint($mode, $id, $look = 0)
{
// $look = 0 --->display all icons
// $look = 1 --->display email icon only
// $look = 2 --->display print icon only
$text_emailprint = "";
//new method emailprint_class : (only news is core, rest is plugin: searched for e_emailprint.php which should hold $email and $print values)
if($mode == "news")
{
$email = "news";
$print = "news";
}
else
{
//load the others from plugins
$handle = opendir(e_PLUGIN);
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && is_dir(e_PLUGIN.$file))
{
$plugin_handle = opendir(e_PLUGIN.$file."/");
while (false !== ($file2 = readdir($plugin_handle)))
{
if ($file2 == "e_emailprint.php")
{
require_once(e_PLUGIN.$file."/".$file2);
}
}
}
}
}
if ($look == 0 || $look == 1)
{
$ico_mail = (defined("ICONMAIL") && file_exists(THEME."images/".ICONMAIL) ? THEME_ABS."images/".ICONMAIL : e_IMAGE_ABS."generic/email.png");
//TDOD CSS class
$text_emailprint .= "<a href='".e_HTTP."email.php?".$email.".".$id."'><img src='".$ico_mail."' alt='".LAN_EMAIL_7."' title='".LAN_EMAIL_7."' /></a> ";
}
if ($look == 0 || $look == 2)
{
$ico_print = (defined("ICONPRINT") && file_exists(THEME."images/".ICONPRINT) ? THEME_ABS."images/".ICONPRINT : e_IMAGE_ABS."generic/printer.png");
//TODO CSS class
$text_emailprint .= "<a href='".e_HTTP."print.php?".$print.".".$id."'><img src='".$ico_print."' alt='".LAN_PRINT_1."' title='".LAN_PRINT_1."' /></a>";
}
return $text_emailprint;
}
}
?>