modified: local/modules/Colissimo/AdminIncludes/module_configuration.html modified: local/modules/Colissimo/Colissimo.php modified: local/modules/Colissimo/Config/config.xml modified: local/modules/Colissimo/Config/module.xml modified: local/modules/Colissimo/Config/prices.json new file: local/modules/Colissimo/Config/routing.xml modified: local/modules/Colissimo/Config/thelia.sql new file: local/modules/Colissimo/Controller/EditPrices.php new file: local/modules/Colissimo/I18n/en_US.php new file: local/modules/Colissimo/I18n/fr_FR.php modified: local/modules/Colissimo/Listener/SendMail.php new file: local/modules/Colissimo/Loop/CheckRightsLoop.php modified: local/modules/Colissimo/Loop/Price.php modified: local/modules/Colissimo/documentation/TarifsAvril2013.pdf modified: local/modules/Colissimo/documentation/readme.txt
83 lines
3.8 KiB
PHP
Executable File
83 lines
3.8 KiB
PHP
Executable File
<?php
|
|
/*************************************************************************************/
|
|
/* */
|
|
/* Thelia */
|
|
/* */
|
|
/* Copyright (c) OpenStudio */
|
|
/* email : info@thelia.net */
|
|
/* web : http://www.thelia.net */
|
|
/* */
|
|
/* This program 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 */
|
|
/* */
|
|
/* This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
/* */
|
|
/*************************************************************************************/
|
|
|
|
namespace Colissimo\Loop;
|
|
|
|
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
|
|
use Thelia\Core\Template\Element\BaseLoop;
|
|
use Thelia\Core\Template\Element\LoopResultRow;
|
|
use Thelia\Core\Template\Element\LoopResult;
|
|
use Thelia\Core\Template\Element\ArraySearchLoopInterface;
|
|
use Thelia\Core\Translation\Translator;
|
|
|
|
/**
|
|
* Class CheckRightsLoop
|
|
* @package Colissimo\Looop
|
|
* @author Thelia <info@thelia.net>
|
|
*/
|
|
|
|
class CheckRightsLoop extends BaseLoop implements ArraySearchLoopInterface
|
|
{
|
|
protected function getArgDefinitions()
|
|
{
|
|
return new ArgumentCollection();
|
|
}
|
|
|
|
public function buildArray()
|
|
{
|
|
$ret = array();
|
|
$dir = __DIR__."/../Config/";
|
|
if (!is_readable($dir)) {
|
|
$ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't read Config directory"), "ERRFILE"=>"");
|
|
}
|
|
if (!is_writable($dir)) {
|
|
$ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't write Config directory"), "ERRFILE"=>"");
|
|
}
|
|
if ($handle = opendir($dir)) {
|
|
while (false !== ($file = readdir($handle))) {
|
|
if (strlen($file) > 5 && substr($file, -5) === ".json") {
|
|
if (!is_readable($dir.$file)) {
|
|
$ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't read file"), "ERRFILE"=>"Colissimo/Config/".$file);
|
|
}
|
|
if (!is_writable($dir.$file)) {
|
|
$ret[] = array("ERRMES"=>Translator::getInstance()->trans("Can't write file"), "ERRFILE"=>"Colissimo/Config/".$file);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return $ret;
|
|
}
|
|
public function parseResults(LoopResult $loopResult)
|
|
{
|
|
foreach ($loopResult->getResultDataCollection() as $arr) {
|
|
$loopResultRow = new LoopResultRow();
|
|
$loopResultRow->set("ERRMES", $arr["ERRMES"])
|
|
->set("ERRFILE", $arr["ERRFILE"]);
|
|
$loopResult->addRow($loopResultRow);
|
|
}
|
|
|
|
return $loopResult;
|
|
}
|
|
}
|