diff --git a/e107_plugins/pdf/admin_pdf_config.php b/e107_plugins/pdf/admin_pdf_config.php
index 91f6a1e9b..d933cf01e 100644
--- a/e107_plugins/pdf/admin_pdf_config.php
+++ b/e107_plugins/pdf/admin_pdf_config.php
@@ -1,76 +1,91 @@
$v){
- if(strpos($k, "pdf_") === 0){
+
+function updatePDFPrefs()
+{
+ global $sql, $eArrayStorage, $tp, $admin_log;
+ while(list($key, $value) = each($_POST))
+ {
+ foreach($_POST as $k => $v)
+ {
+ if(strpos($k, 'pdf_') === 0)
+ {
$pdfpref[$k] = $tp->toDB($v);
}
}
}
+ //create new array of preferences
$tmp = $eArrayStorage->WriteArray($pdfpref);
- $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='pdf' ");
-
+ $sql -> db_Update("core", "e107_value='{$tmp}' WHERE e107_name='pdf' ");
+ $admin_log->logArrayAll('PDF_01',$pdfpref);
$message = PDF_LAN_18;
return $message;
}
-function getDefaultPDFPrefs(){
- $pdfpref['pdf_margin_left'] = '25';
- $pdfpref['pdf_margin_right'] = '15';
- $pdfpref['pdf_margin_top'] = '15';
- $pdfpref['pdf_font_family'] = 'arial';
- $pdfpref['pdf_font_size'] = '8';
- $pdfpref['pdf_font_size_sitename'] = '14';
- $pdfpref['pdf_font_size_page_url'] = '8';
- $pdfpref['pdf_font_size_page_number'] = '8';
- $pdfpref['pdf_show_logo'] = true;
- $pdfpref['pdf_show_sitename'] = false;
- $pdfpref['pdf_show_page_url'] = true;
- $pdfpref['pdf_show_page_number'] = true;
- $pdfpref['pdf_error_reporting'] = true;
- return $pdfpref;
+
+function getDefaultPDFPrefs()
+{
+ $pdfpref['pdf_margin_left'] = '25';
+ $pdfpref['pdf_margin_right'] = '15';
+ $pdfpref['pdf_margin_top'] = '15';
+ $pdfpref['pdf_font_family'] = 'arial';
+ $pdfpref['pdf_font_size'] = '8';
+ $pdfpref['pdf_font_size_sitename'] = '14';
+ $pdfpref['pdf_font_size_page_url'] = '8';
+ $pdfpref['pdf_font_size_page_number'] = '8';
+ $pdfpref['pdf_show_logo'] = true;
+ $pdfpref['pdf_show_sitename'] = false;
+ $pdfpref['pdf_show_page_url'] = true;
+ $pdfpref['pdf_show_page_number'] = true;
+ $pdfpref['pdf_error_reporting'] = true;
+ return $pdfpref;
}
-function getPDFPrefs(){
+
+
+function getPDFPrefs()
+{
global $sql, $eArrayStorage;
if(!is_object($sql)){ $sql = new db; }
$num_rows = $sql -> db_Select("core", "*", "e107_name='pdf' ");
- if($num_rows == 0){
+ if($num_rows == 0)
+ {
$tmp = getDefaultPDFPrefs();
$tmp2 = $eArrayStorage->WriteArray($tmp);
$sql -> db_Insert("core", "'pdf', '".$tmp2."' ");
@@ -81,7 +96,9 @@ function getPDFPrefs(){
return $pdfpref;
}
-if(isset($message)){
+
+if(isset($message))
+{
$caption = PDF_LAN_1;
$ns -> tablerender($caption, $message);
}
@@ -97,15 +114,15 @@ $text = "
-
+
-
+
-
+
";
$fontlist=array("arial","times","courier","helvetica","symbol");
@@ -123,19 +140,19 @@ $text .= "
-
+
-
+
-
+
-
+
diff --git a/e107_plugins/pdf/e107pdf.php b/e107_plugins/pdf/e107pdf.php
index a2e4e9b55..8953caaa1 100644
--- a/e107_plugins/pdf/e107pdf.php
+++ b/e107_plugins/pdf/e107pdf.php
@@ -1,21 +1,20 @@
\ No newline at end of file
diff --git a/e107_plugins/pdf/pdf.php b/e107_plugins/pdf/pdf.php
index 8ec4451c8..40c41e0e1 100644
--- a/e107_plugins/pdf/pdf.php
+++ b/e107_plugins/pdf/pdf.php
@@ -1,36 +1,34 @@
db_Select("news", "*", "news_id='".intval($parms)."'");
$row = $sql->db_Fetch();
$news_body = $tp->toHTML($row['news_body'], TRUE);
$news_extended = $tp->toHTML($row['news_extended'], TRUE);
- if ($row['news_author'] == 0){
+ if ($row['news_author'] == 0)
+ {
$a_name = "e107";
$category_name = "e107 welcome message";
- }else{
+ }
+ else
+ {
$sql->db_Select("news_category", "category_id, category_name", "category_id='".intval($row['news_category'])."'");
list($category_id, $category_name) = $sql->db_Fetch();
$sql->db_Select("user", "user_id, user_name", "user_id='".intval($row['news_author'])."'");
@@ -110,9 +112,7 @@ else
//always return an array with the following data:
$text = array($text, $creator, $author, $title, $subject, $keywords, $url);
$pdf->makePDF($text);
-
}
-
}
?>
\ No newline at end of file
diff --git a/e107_plugins/pdf/pdf.sc b/e107_plugins/pdf/pdf.sc
index bc4ed13b8..58686d7ac 100644
--- a/e107_plugins/pdf/pdf.sc
+++ b/e107_plugins/pdf/pdf.sc
@@ -1,8 +1,13 @@
/*
- * e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
- * $Id: pdf.sc,v 1.2 2008-09-04 20:07:34 e107steved Exp $
+ * e107 website system Copyright (C) 2001-2008 e107 Inc (e107.org)
+ * $Id: pdf.sc,v 1.3 2008-12-21 12:03:28 e107steved Exp $
*/
+if (!plugInstalled('pdf'))
+{
+ return;
+}
+
if (defined("ICONPRINTPDF") && file_exists(THEME."images/".ICONPRINTPDF))
{
$icon = THEME_ABS."images/".ICONPRINTPDF;
@@ -12,8 +17,4 @@ else
$icon = e_PLUGIN_ABS."pdf/images/pdf_16.png";
}
$parms = explode("^",$parm);
-
-//core //return "
";
-//plugin //return "
";
-
return "
";
diff --git a/e107_plugins/pdf/plugin.php b/e107_plugins/pdf/plugin.php
deleted file mode 100644
index ef418c3c1..000000000
--- a/e107_plugins/pdf/plugin.php
+++ /dev/null
@@ -1,69 +0,0 @@
-
\ No newline at end of file
diff --git a/e107_plugins/pdf/plugin.xml b/e107_plugins/pdf/plugin.xml
new file mode 100644
index 000000000..4723c5afb
--- /dev/null
+++ b/e107_plugins/pdf/plugin.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ PDF_PLUGIN_LAN_2
+ pdf
+ Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)
+
+
+ admin_pdf_config.php
+ images/pdf_32.png
+ images/pdf_16.png
+ PDF
+ PDF_PLUGIN_LAN_4
+
+
+
+
\ No newline at end of file
diff --git a/e107_plugins/pdf/ufpdf.php b/e107_plugins/pdf/ufpdf.php
index facd71835..3e29679f2 100644
--- a/e107_plugins/pdf/ufpdf.php
+++ b/e107_plugins/pdf/ufpdf.php
@@ -1,4 +1,20 @@