From cb0864f8fd88bb4562b9c2135387ba0c4825fd06 Mon Sep 17 00:00:00 2001 From: Olivier PEREZ <olivier@olivierperez.fr> Date: Fri, 29 May 2015 18:11:12 +0200 Subject: [PATCH] Fix a lot of things --- admin/purge.php | 1 - app/classes/Framadate/Form.php | 2 -- create_classic_poll.php | 10 +++++----- create_date_poll.php | 2 +- exportcsv.php | 3 --- index.php | 2 -- studs.php | 2 +- 7 files changed, 7 insertions(+), 15 deletions(-) diff --git a/admin/purge.php b/admin/purge.php index 5a8e2687..fb817f1a 100644 --- a/admin/purge.php +++ b/admin/purge.php @@ -21,7 +21,6 @@ use Framadate\Services\InputService; use Framadate\Services\LogService; use Framadate\Services\PurgeService; use Framadate\Services\SecurityService; -use Framadate\Utils; include_once __DIR__ . '/../app/inc/init.php'; include_once __DIR__ . '/../bandeaux.php'; diff --git a/app/classes/Framadate/Form.php b/app/classes/Framadate/Form.php index ce802bad..f73cd9e0 100644 --- a/app/classes/Framadate/Form.php +++ b/app/classes/Framadate/Form.php @@ -18,8 +18,6 @@ */ namespace Framadate; -use Framadate\Editable; - class Form { diff --git a/create_classic_poll.php b/create_classic_poll.php index 1b989e81..21c652be 100644 --- a/create_classic_poll.php +++ b/create_classic_poll.php @@ -41,13 +41,13 @@ if (file_exists('bandeaux_local.php')) { // Step 1/4 : error if $_SESSION from info_sondage are not valid if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || (($config['use_smtp']) ? empty($_SESSION['form']->admin_mail) : false)) { - Utils::print_header(__("Error!")); - bandeau_titre(__("Error!")); + Utils::print_header(__('Error', 'Error!')); + bandeau_titre(__('Error', 'Error!')); echo ' <div class="alert alert-danger"> - <h3>' . __('You haven\'t filled the first section of the poll creation.') . ' !</h3> - <p>' . __('Back to the homepage of') . ' <a href="' . Utils::get_server_name() . '"> ' . NOMAPPLICATION . '</a></p> + <h3>' . __('Error', 'You haven\'t filled the first section of the poll creation.') . ' !</h3> + <p>' . __('Generic', 'Back to the homepage of') . ' <a href="' . Utils::get_server_name() . '"> ' . NOMAPPLICATION . '</a></p> </div>' . "\n"; bandeau_pied(); @@ -149,7 +149,7 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || ( // Summary $summary = '<ol>'; - foreach ($_SESSION['form']->getChoices() as $choice) { + foreach ($_SESSION['form']->getChoices() as $i=>$choice) { preg_match_all('/\[!\[(.*?)\]\((.*?)\)\]\((.*?)\)/', $choice->getName(), $md_a_img); // Markdown [](href) preg_match_all('/!\[(.*?)\]\((.*?)\)/', $choice->getName(), $md_img); // Markdown  diff --git a/create_date_poll.php b/create_date_poll.php index aec2a266..f170b5b0 100644 --- a/create_date_poll.php +++ b/create_date_poll.php @@ -194,7 +194,7 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) || <div class="col-sm-6"> <div class="input-group date"> <span class="input-group-addon"><i class="glyphicon glyphicon-calendar text-info"></i></span> - <input type="text" class="form-control" id="enddate" data-date-format="'. __('Date', 'dd/mm/yyyy') .'" aria-describedby="dateformat" name="enddate" value="'.$end_date_str.'" size="10" maxlength="10" placeholder="'. __('dd/mm/yyyy') .'" /> + <input type="text" class="form-control" id="enddate" data-date-format="'. __('Date', 'dd/mm/yyyy') .'" aria-describedby="dateformat" name="enddate" value="'.$end_date_str.'" size="10" maxlength="10" placeholder="'. __('Date', 'dd/mm/yyyy') .'" /> </div> </div> <span id="dateformat" class="sr-only">('. __('Date', 'dd/mm/yyyy') .')</span> diff --git a/exportcsv.php b/exportcsv.php index f5b5d0b3..6197cfb2 100644 --- a/exportcsv.php +++ b/exportcsv.php @@ -18,9 +18,6 @@ */ use Framadate\Services\LogService; use Framadate\Services\PollService; -use Framadate\Services\InputService; -use Framadate\Services\MailService; -use Framadate\Message; use Framadate\Utils; include_once __DIR__ . '/app/inc/init.php'; diff --git a/index.php b/index.php index e7560763..364c90c3 100644 --- a/index.php +++ b/index.php @@ -17,9 +17,7 @@ * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) */ -use Framadate\Services\LogService; use Framadate\Services\PollService; -use Framadate\Utils; include_once __DIR__ . '/app/inc/init.php'; diff --git a/studs.php b/studs.php index 0ebdd0ff..9448297b 100644 --- a/studs.php +++ b/studs.php @@ -151,7 +151,7 @@ if (!empty($_POST['save'])) { // Save edition of an old vote $message = new Message('danger', __('Error', 'The name is invalid.')); } if (count($choices) != count($_POST['choices'])) { - $message = new Message('danger', __('There is a problem with your choices')); + $message = new Message('danger', __('Error', 'There is a problem with your choices')); } if ($message == null) { -- GitLab