Permalink
Browse files

Removed smarty from subscribers import page

  • Loading branch information...
1 parent cfddc3f commit 58f09198002914ccb0e2b53a268cf64227290207 @soonick committed Nov 26, 2011
View
@@ -1,41 +1,46 @@
<?php
/**
- * Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * Original Code Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * released originally under GPLV2
*
- * This file is part of poMMo (http://www.pommo.org)
+ * This file is part of poMMo.
+ *
+ * poMMo is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * poMMo is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Pommo. If not, see <http://www.gnu.org/licenses/>.
*
- * poMMo is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or any later version.
- *
- * poMMo is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with program; see the file docs/LICENSE. If not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * This fork is from https://github.com/soonick/poMMo
+ * Please see docs/contribs for Contributors
+ *
*/
/**********************************
INITIALIZATION METHODS
*********************************/
-require ('bootstrap.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Csv_Stream.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Subscribers.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Fields.php');
+require 'bootstrap.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Csv_Stream.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Subscribers.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Fields.php';
-Pommo::init(array('keep' => TRUE));
-$logger = & Pommo::$_logger;
-$dbo = & Pommo::$_dbo;
+Pommo::init(array ('keep' => TRUE));
+$logger = Pommo::$_logger;
+$dbo = Pommo::$_dbo;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
-require_once(Pommo::$_baseDir.'classes/Pommo_Template.php');
-$smarty = new Pommo_Template();
-$smarty->assign('returnStr',Pommo::_T('Import'));
+require_once Pommo::$_baseDir.'classes/Pommo_Template.php';
+$view = new Pommo_Template();
+$view->assign('returnStr', _('Import'));
$preview = Pommo::get('preview');
@@ -48,11 +53,10 @@
}
-$smarty->assign('excludeUnsubscribed',(isset($_REQUEST['excludeUnsubscribed'])?true:false));
-$smarty->assign('preview',$preview);
-$smarty->assign('colNum',$cols);
-$smarty->assign('fields',Pommo_Fields::get());
+$view->assign('excludeUnsubscribed',(isset($_REQUEST['excludeUnsubscribed'])?true:false));
+$view->assign('preview',$preview);
+$view->assign('colNum',$cols);
+$view->assign('fields',Pommo_Fields::get());
+
+$view->display('admin/subscribers/import_csv');
-$smarty->display('admin/subscribers/import_csv.tpl');
-Pommo::kill();
-?>
View
@@ -1,40 +1,45 @@
<?php
/**
- * Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * Original Code Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * released originally under GPLV2
*
- * This file is part of poMMo (http://www.pommo.org)
+ * This file is part of poMMo.
+ *
+ * poMMo is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * poMMo is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Pommo. If not, see <http://www.gnu.org/licenses/>.
*
- * poMMo is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or any later version.
- *
- * poMMo is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with program; see the file docs/LICENSE. If not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * This fork is from https://github.com/soonick/poMMo
+ * Please see docs/contribs for Contributors
+ *
*/
/**********************************
INITIALIZATION METHODS
*********************************/
-require ('bootstrap.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Csv_Stream.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Subscribers.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Validate.php');
+require 'bootstrap.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Csv_Stream.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Subscribers.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Validate.php';
Pommo::init(array('keep' => TRUE));
-$logger = & Pommo::$_logger;
-$dbo = & Pommo::$_dbo;
+$logger = Pommo::$_logger;
+$dbo = Pommo::$_dbo;
$dupes = $tally = $flagged = 0;
$dupe_emails = array();
$fp = fopen(Pommo::$_workDir.'/import.csv','r')
or die('Unable to open CSV file');
-
+
$includeUnsubscribed = isset($_REQUEST['excludeUnsubscribed']) ? false : true;
while (($row = fgetcsv($fp,2048,',','"')) !== FALSE) {
@@ -80,12 +85,19 @@
}
}
+
unlink(Pommo::$_workDir.'/import.csv');
-echo ('<div class="warn"><p>'.sprintf(Pommo::_T('%s subscribers imported! Of these, %s were flagged to update their records.'),$tally, $flagged).'<p>'.sprintf(Pommo::_T('%s duplicates encountered.'),$dupes).'</p></div>');
+echo '<div class="warn"><p>'.sprintf(_('%s subscribers imported! Of these, %s
+ were flagged to update their records.'), $tally, $flagged).'<p>'
+ .sprintf(_('%s duplicates encountered.'), $dupes).'</p></div>';
+
echo "<table>";
-foreach($dupe_emails as $de) {
- echo "<tr><td>$de</td></tr>";
+foreach($dupe_emails as $de)
+{
+ echo '<tr><td>'.$de.'</td></tr>';
}
echo "</table>";
-die(Pommo::_T('Complete!').' <a href="subscribers_import.php">'.Pommo::_T('Return to').' '.Pommo::_T('Import').'</a>');
-?>
+
+die(_('Complete!').' <a href="subscribers_import.php">'._('Return to').' '
+ ._('Import').'</a>');
+
View
@@ -1,49 +1,58 @@
<?php
/**
- * Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * Original Code Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * released originally under GPLV2
*
- * This file is part of poMMo (http://www.pommo.org)
+ * This file is part of poMMo.
+ *
+ * poMMo is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * poMMo is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Pommo. If not, see <http://www.gnu.org/licenses/>.
*
- * poMMo is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or any later version.
- *
- * poMMo is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with program; see the file docs/LICENSE. If not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * This fork is from https://github.com/soonick/poMMo
+ * Please see docs/contribs for Contributors
+ *
*/
-
+
/**********************************
INITIALIZATION METHODS
*********************************/
-require ('bootstrap.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Csv_Stream.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Subscribers.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Fields.php');
+require 'bootstrap.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Csv_Stream.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Subscribers.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Fields.php';
-Pommo::init(array('keep' => TRUE));
-$logger = & Pommo::$_logger;
-$dbo = & Pommo::$_dbo;
+Pommo::init(array ('keep' => TRUE));
+$logger = Pommo::$_logger;
+$dbo = Pommo::$_dbo;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
-require_once(Pommo::$_baseDir.'classes/Pommo_Template.php');
-$smarty = new Pommo_Template();
+require_once Pommo::$_baseDir.'classes/Pommo_Template.php';
+$view = new Pommo_Template();
-$emails =& Pommo::get('emails');
-$dupes =& Pommo::get('dupes');
-$fields =& Pommo_Fields::get();
+$emails = Pommo::get('emails');
+$dupes = Pommo::get('dupes');
+$fields = Pommo_Fields::get();
$flag = FALSE;
-foreach($fields as $field)
- if($field['required'] == 'on')
+foreach ($fields as $field)
+{
+ if ($field['required'] == 'on')
+ {
$flag = TRUE;
+ }
+}
if(isset($_GET['continue'])) {
foreach($emails as $email) {
@@ -64,10 +73,9 @@
die(Pommo::_T('Complete!').' <a href="subscribers_import.php">'.Pommo::_T('Return to').' '.Pommo::_T('Import').'</a>');
}
-$smarty->assign('flag',$flag);
-$smarty->assign('tally',count($emails));
-$smarty->assign('dupes',$dupes);
+$view->assign('flag',$flag);
+$view->assign('tally',count($emails));
+$view->assign('dupes',$dupes);
+
+$view->display('admin/subscribers/import_txt');
-$smarty->display('admin/subscribers/import_txt.tpl');
-Pommo::kill();
-?>
View
@@ -1,43 +1,47 @@
<?php
/**
- * Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * Original Code Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * released originally under GPLV2
*
- * This file is part of poMMo (http://www.pommo.org)
+ * This file is part of poMMo.
+ *
+ * poMMo is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * poMMo is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Pommo. If not, see <http://www.gnu.org/licenses/>.
*
- * poMMo is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or any later version.
- *
- * poMMo is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with program; see the file docs/LICENSE. If not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * This fork is from https://github.com/soonick/poMMo
+ * Please see docs/contribs for Contributors
+ *
*/
/**********************************
INITIALIZATION METHODS
*********************************/
-require ('bootstrap.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Csv_Stream.php');
+require 'bootstrap.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Csv_Stream.php';
Pommo::init();
-$logger = &Pommo::$_logger;
-$dbo = &Pommo::$_dbo;
+$logger = Pommo::$_logger;
+$dbo = Pommo::$_dbo;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
-require_once(Pommo::$_baseDir.'classes/Pommo_Template.php');
-$smarty = new Pommo_Template();
-
+require_once Pommo::$_baseDir.'classes/Pommo_Template.php';
+$view = new Pommo_Template();
// Maximum File Size (in MB)
$max_file_size = 2;
-$smarty->assign('maxSize', $max_file_size * 1024 * 1024);
+$view->assign('maxSize', $max_file_size * 1024 * 1024);
// Filename (in $_FILES array)
$fname = 'csvfile';
@@ -47,7 +51,7 @@
// POST exists -- set pointer to content
$fp = false;
$box = false;
-
+
if (!empty($_FILES[$fname]['tmp_name']))
{
$fp = &fopen($_FILES[$fname]['tmp_name'], 'r');
@@ -132,18 +136,18 @@
}
}
}
-
+
// Removes from the array E-mails that are already on the database
$includeUnsubscribed = isset($_REQUEST['excludeUnsubscribed']) ?
false : true;
$dupes = &Pommo_Helper::isDupe($a, $includeUnsubscribed);
-
+
if (!$dupes)
{
$dupes = array();
}
$emails = array_diff($a, $dupes);
-
+
// Saves emails in session and redirects to confirmation page
Pommo::set(array(
'emails' => $emails,
@@ -153,6 +157,5 @@
}
}
-$smarty->display('admin/subscribers/subscribers_import.tpl');
-Pommo::kill();
+$view->display('admin/subscribers/subscribers_import');
Oops, something went wrong.

0 comments on commit 58f0919

Please sign in to comment.