1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00
php-e107/e107_handlers/emailprint_class.php

91 lines
2.7 KiB
PHP
Raw Normal View History

2006-12-02 04:36:16 +00:00
<?php
/*
2009-11-12 15:11:17 +00:00
* e107 website system
*
2009-11-18 01:06:08 +00:00
* Copyright (C) 2008-2009 e107 Inc (e107.org)
2009-11-12 15:11:17 +00:00
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/emailprint_class.php,v $
2010-02-10 18:18:01 +00:00
* $Revision$
* $Date$
* $Author$
2009-11-12 15:11:17 +00:00
*/
2006-12-02 04:36:16 +00:00
if (!defined('e107_INIT')) { exit; }
2017-01-23 09:41:23 -08:00
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_print.php");
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_email.php");
2006-12-02 04:36:16 +00:00
class emailprint
{
static function render_emailprint($mode, $id, $look = 0,$parm=array())
{
2006-12-02 04:36:16 +00:00
// $look = 0 --->display all icons
// $look = 1 --->display email icon only
// $look = 2 --->display print icon only
$tp = e107::getParser();
2009-07-07 06:50:56 +00:00
2006-12-02 04:36:16 +00:00
$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")
{
2006-12-02 04:36:16 +00:00
$email = "news";
$print = "news";
}
else
{
2006-12-02 04:36:16 +00:00
//load the others from plugins
$handle = opendir(e_PLUGIN);
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && is_dir(e_PLUGIN.$file))
{
2006-12-02 04:36:16 +00:00
$plugin_handle = opendir(e_PLUGIN.$file."/");
while (false !== ($file2 = readdir($plugin_handle)))
{
if ($file2 == "e_emailprint.php")
{
2006-12-02 04:36:16 +00:00
require_once(e_PLUGIN.$file."/".$file2);
}
}
}
}
}
if(deftrue('BOOTSTRAP'))
{
$genericMail = $tp->toGlyph('fa-envelope',false); // "<i class='icon-envelope'></i>";
$genericPrint = $tp->toGlyph('fa-print',false); // "<i class='icon-print'></i>";
$class = varset($parm['class']) ? $parm['class'] : "";
}
else // BC
{
$genericMail = "<img src='".e_IMAGE_ABS."generic/email.png' alt='".LAN_EMAIL_7."' />";
$genericPrint = "<img src='".e_IMAGE_ABS."generic/printer.png' alt='".LAN_PRINT_1."' />";
$class = "";
}
2006-12-02 04:36:16 +00:00
if ($look == 0 || $look == 1)
{
$ico_mail = (defined("ICONMAIL") && file_exists(THEME."images/".ICONMAIL) ? "<img src='".THEME_ABS."images/".ICONMAIL."' alt='".LAN_EMAIL_7."' />" : $genericMail);
2009-07-25 07:54:36 +00:00
//TDOD CSS class
2016-01-17 16:52:00 -08:00
$text_emailprint .= "<a class='e-tip hidden-print".$class."' href='".e_HTTP."email.php?".$email.".".$id."' title='".LAN_EMAIL_7."'>".$ico_mail."</a> ";
2006-12-02 04:36:16 +00:00
}
if ($look == 0 || $look == 2)
{
$ico_print = (defined("ICONPRINT") && file_exists(THEME."images/".ICONPRINT) ? "<img src='".THEME_ABS."images/".ICONPRINT."' alt='".LAN_PRINT_1."' />" : $genericPrint);
2009-07-25 07:54:36 +00:00
//TODO CSS class
2016-01-17 16:52:00 -08:00
$text_emailprint .= "<a class='e-tip ".$class." hidden-print' href='".e_HTTP."print.php?".$print.".".$id."' title='".LAN_PRINT_1."'>".$ico_print."</a>";
2006-12-02 04:36:16 +00:00
}
return $text_emailprint;
}
}
?>