|
From: <os...@us...> - 2011-11-20 22:08:59
|
Revision: 3894
http://oscss.svn.sourceforge.net/oscss/?rev=3894&view=rev
Author: oscim
Date: 2011-11-20 22:08:51 +0000 (Sun, 20 Nov 2011)
Log Message:
-----------
reecriture du process de commande, et basculement des etape en module
Modified Paths:
--------------
trunk/catalog/includes/classes/core_page/checkout.php
trunk/catalog/includes/classes/order_total.php
trunk/catalog/includes/classes/page.php
trunk/catalog/includes/classes/payment.php
trunk/catalog/includes/content/checkout_confirmation.php
trunk/catalog/includes/content/checkout_payment.php
trunk/catalog/includes/content/shopping_cart.php
trunk/catalog/includes/js/checkout.js.php
trunk/catalog/includes/languages/fr_FR/modules/payment/moneyorder.txt
trunk/catalog/includes/modules/checkout/PrCgu.php
trunk/catalog/includes/modules/payment/moneyorder.php
trunk/catalog/includes/modules/shipping/item.php
trunk/catalog/includes/modules/shipping/spu.php
Added Paths:
-----------
trunk/catalog/includes/content/checkout_cgu.php
trunk/catalog/includes/modules/checkout/PrConfirmation.php
trunk/catalog/includes/modules/checkout/PrPayment.php
trunk/catalog/includes/modules/checkout/PrShipping.php
Modified: trunk/catalog/includes/classes/core_page/checkout.php
===================================================================
--- trunk/catalog/includes/classes/core_page/checkout.php 2011-11-20 22:04:33 UTC (rev 3893)
+++ trunk/catalog/includes/classes/core_page/checkout.php 2011-11-20 22:08:51 UTC (rev 3894)
@@ -1,12 +1,12 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- \licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- \portion code Copyright (c) 2002 osCommerce
- \package osCSS-2 <www http://www.oscss.org>
- \version 2.1.0
- \date 29/11/10, 11:33
- \author oscim <mail aur...@os...> <www http://www.oscim.fr>
- \encode UTF-8
+ @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 20/11/11, 22:46
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
\class home
\brief prend en charge les modules de types home.
@@ -22,7 +22,7 @@
/**
Charge les module aca specifique au porduits
*/
- function __construct() {
+ function __construct($step=false) {
global $language, $page;
$this->name='checkout';
@@ -33,30 +33,54 @@
foreach(parent::initialise_type('MODULE_CHECKOUT_PROCESS_INSTALLED','checkout') as $class){
$cl[$class]=new $class ();
$list_mod[$class] = $cl[$class]->sort_order;
- asort($list_mod);
- foreach($list_mod as $class=>$s){
- $this->modules[$class] =$cl[$class];
+
+
+ }
+
+ asort($list_mod);
+ foreach($list_mod as $class=>$s){
+ $this->modules[$class] =$cl[$class];
+ }
+ unset($cl);unset($list_mod);
+
+
+ if($step !=false) {
+ if($step == 'init'){
+ var_dump($step);
+ $this->ResetProcess();
}
- unset($cl);unset($list_mod);
+ elseif(isset($this->modules['Pr'.$step])){
+// var_dump('Pr'.$step);
+ $this->modules['Pr'.$step]->ResetProcess();
+// exit;
+ }
}
+// var_dump( $this->etape);
+// var_dump( $this->process);
+ $etape = $this->ChkBeforeProcess();
- /**
- Preparation des etape disponible
- */
-// $BeforeProcess=$this->ChkBeforeProcess();
-// if(in_array(false,array_values($BeforeProcess)) )
-// $this->etape[1] = 'before' ;
-//
-// if(tep_count_shipping_modules() > 0)
-// $this->etape[2] = 'shipping' ;
-//
-// $this->etape[3] = 'payment' ;
-//
-// $this->etape[4] = 'confirmation' ;
-//
-// $this->etape[5] = 'process' ;
+ /// force add etape confirmation and success
+// $etape['PrConfirmation'] = true ;
+// $etape['PrSuccess'] = true ;
+
+// var_dump($etape);
+
+ $i = 0;
+ foreach($etape as $key=>$row)
+ $this->etape[$i++] = $key;
+
+ $i = 0;
+ foreach($etape as $key=>$row)
+ if($this->modules[$key]->step)
+ $this->process[$i++] = false;
+ else
+ $this->process[$i++] = $row;
+
+// var_dump( $this->etape);
+// var_dump( $this->process);
+
}
public static function getInstance($full=false) {
@@ -71,8 +95,24 @@
+ /**
+ @brief retrun id current etape
+ @param $key string name etape current
+ */
+ public function GetCurrentEtape($key=''){
+ foreach($this->process as $k=>$row)
+ if($row)
+ return $this->etape[$k];
+// var_dump( $this->etape);
+// var_dump( $this->process);
+ // if not found force reload step 0
+// return $this->etape[0];
+ tep_redirect(tep_href_link('checkout.php'/*FILENAME_CHECKOUT_PAYMENT*/, 'step=init', 'SSL'));
+ }
+
+
/** Obligatoire depend AbstractAcaModule */
/**
Modified: trunk/catalog/includes/classes/order_total.php
===================================================================
--- trunk/catalog/includes/classes/order_total.php 2011-11-20 22:04:33 UTC (rev 3893)
+++ trunk/catalog/includes/classes/order_total.php 2011-11-20 22:08:51 UTC (rev 3894)
@@ -21,7 +21,7 @@
/**
Constructor
*/
- function order_total() {
+ function __construct() {
global $language,$customer_id, $page, $cart;
$this->modules=array();
$this->list_mod=array();
Modified: trunk/catalog/includes/classes/page.php
===================================================================
--- trunk/catalog/includes/classes/page.php 2011-11-20 22:04:33 UTC (rev 3893)
+++ trunk/catalog/includes/classes/page.php 2011-11-20 22:08:51 UTC (rev 3894)
@@ -119,7 +119,7 @@
Page necessitant une identifcation obligatoire
*/
/* Noyau */
- $this->file_registered=$ContentRegistered;
+ $this->file_registered=$FileRegistered;
/**
Page de devant pas être indéxe dans le fils d'arianne (breadcrumb)
*/
Modified: trunk/catalog/includes/classes/payment.php
===================================================================
--- trunk/catalog/includes/classes/payment.php 2011-11-20 22:04:33 UTC (rev 3893)
+++ trunk/catalog/includes/classes/payment.php 2011-11-20 22:08:51 UTC (rev 3894)
@@ -1,39 +1,56 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- \licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- \portion code Copyright (c) 2002 osCommerce
- \package osCSS-2 <www http://www.oscss.org>
- \version 2.1.0
- \date 29/11/10, 11:33
- \author oscim <mail aur...@os...> <www http://www.oscim.fr>
- \encode UTF-8
+ @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 20/11/11, 22:45
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
\class payment
- \file
+ \file
\dir includes/classes/
-
- \brief appel et init des modules de paiement
+
+ \brief appel et init des modules de paiement
*/
-class payment extends AbstractAcaModule{
- var $modules=array();
- var $selected_module;
+class payment
+ extends AbstractAcaModule{
+ /**
+ @var
+ */
+ public $mod=array();
+ /**
+ @var
+ */
+ public $modules=array();
+ /**
+ @var
+ */
+ public static $selected_module = '';
+ /**
+ @var
+ */
protected static $_instance;
+
+ /**
+ @brief constructor
+ @param $module specific load module
+ */
function __construct($module='') {
self::initialise($module);
}
- public static function getInstance($module='')
- {
- if(self::$_instance == null) {
- self::$_instance = new self($module);
- }
- return self::$_instance;
+ public static function getInstance($module=''){
+ if(self::$_instance == null || ( !empty($module) && empty(self::$selected_module) )) {
+ self::$_instance = new self($module);
+ }
+ return self::$_instance;
}
- public static function resetInstance()
- {
+ public static function resetInstance(){
self::$_instance = null;
return self::getInstance();
}
@@ -48,7 +65,7 @@
$include_modules = array();
if (tep_not_null($module)) {
- $this->selected_module = $module;
+ self::$selected_module = $module;
foreach(parent::initialise_type('MODULE_PAYMENT_INSTALLED','payment') as $class){
if($class == $module) $include_modules[] = array('class' => $class, 'file' => $class . '.php');
}
@@ -68,8 +85,8 @@
foreach($include_modules as $imod){
if( ( count($temp_payment_array)==0 || in_array($imod['file'], $temp_payment_array ) ) ){
if(!class_exists($imod['class'])) break;
- $GLOBALS[$imod['class']] = new $imod['class'];
- $this->modules[]=$imod['class'];
+ $this->modules[$imod['class']]=$GLOBALS[$imod['class']] = new $imod['class'];
+ $this->mod[]=$imod['class'];
}
}
@@ -77,10 +94,10 @@
// checkout_confirmation.php the $payment variable is being assigned the
// $_POST['payment'] value which will be empty (no radio button selection possible)
if ( (tep_count_payment_modules() == 1) && (!isset($GLOBALS[$payment]) || (isset($GLOBALS[$payment]) && !is_object($GLOBALS[$payment]))) ) {
- /*$this->selected_module=*/$payment = $include_modules[0]['class'];
+ /*self::$selected_module=*/$payment = $include_modules[0]['class'];
}
- if ( (tep_not_null($module)) && (in_array($module, $this->modules)) && (isset($GLOBALS[$module]->form_action_url)) ) {
+ if ( (tep_not_null($module)) && (in_array($module, $this->mod)) && (isset($GLOBALS[$module]->form_action_url)) ) {
$this->form_action_url = $GLOBALS[$module]->form_action_url;
}
@@ -88,7 +105,7 @@
/**
\ref catalog/checkout_confirmation.php
- \brief
+ \brief
The following method is needed in the checkout_confirmation.php page
due to a chicken and egg problem with the payment class and order class.
The payment modules needs the order destination data for the dynamic status
@@ -98,10 +115,10 @@
section. This should be looked into again post 2.2.
*/
public function update_status() {
- if (is_array($this->modules)) {
- if (is_object($GLOBALS[$this->selected_module])) {
- if (method_exists($GLOBALS[$this->selected_module], 'update_status')) {
- $GLOBALS[$this->selected_module]->update_status();
+ if (is_array($this->mod)) {
+ if (is_object($GLOBALS[self::$selected_module])) {
+ if (method_exists($GLOBALS[self::$selected_module], 'update_status')) {
+ $GLOBALS[self::$selected_module]->update_status();
}
}
}
@@ -110,7 +127,7 @@
public function javascript_validation() {
global $page;
$js = '';
- if (is_array($this->modules)) {
+ if (is_array($this->mod)) {
$js = '<script type="text/javascript"><!-- ' . "\n" .
'function check_form() {' . "\n" .
' var error = 0;' . "\n" .
@@ -128,8 +145,8 @@
' payment_value = document.getElementById("checkout_payment").payment.value;' . "\n" .
' }' . "\n\n";
- reset($this->modules);
- foreach($this->modules as $class){
+ reset($this->mod);
+ foreach($this->mod as $class){
if (isset($GLOBALS[$class]) &&$GLOBALS[$class]->enabled) $js .= $GLOBALS[$class]->javascript_validation();
}
@@ -158,16 +175,18 @@
/**
\ref catalog/checkout_payment.php
+ @return array
*/
public function selection() {
$selection_array = array();
- if (is_array($this->modules)) {
- reset($this->modules);
- foreach($this->modules as $class){
+ if (is_array($this->mod)) {
+ reset($this->mod);
+ foreach($this->mod as $class){
if (isset($GLOBALS[$class]) && $GLOBALS[$class]->enabled) {
$selection = $GLOBALS[$class]->selection();
- if (is_array($selection)) $selection_array[] = $selection;
+ if (is_array($selection))
+ $selection_array[] = $selection;
}
}
}
@@ -178,54 +197,54 @@
\ref catalog/checkout_payment.php
*/
public function pre_confirmation_check() {
- if (is_array($this->modules)) {
- if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) && method_exists($GLOBALS[$this->selected_module], 'pre_confirmation_check') ) {
- $GLOBALS[$this->selected_module]->pre_confirmation_check();
+ if (is_array($this->mod)) {
+ if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled) && method_exists($GLOBALS[self::$selected_module], 'pre_confirmation_check') ) {
+ $GLOBALS[self::$selected_module]->pre_confirmation_check();
}
}
}
-
+
/**
\ref catalog/checkout_confirmation.php
*/
public function confirmation() {
- if (is_array($this->modules)) {
- if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) && method_exists($GLOBALS[$this->selected_module], 'confirmation') ) {
- return $GLOBALS[$this->selected_module]->confirmation();
+ if (is_array($this->mod)) {
+ if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled) && method_exists($GLOBALS[self::$selected_module], 'confirmation') ) {
+ return $GLOBALS[self::$selected_module]->confirmation();
}
}
}
-
+
/**
\ref catalog/checkout_confirmation.php
*/
public function process_button() {
- if (is_array($this->modules)) {
- if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled)&& method_exists($GLOBALS[$this->selected_module], 'process_button') ) {
- return $GLOBALS[$this->selected_module]->process_button();
+ if (is_array($this->mod)) {
+ if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled)&& method_exists($GLOBALS[self::$selected_module], 'process_button') ) {
+ return $GLOBALS[self::$selected_module]->process_button();
}
}
}
-
+
/**
\ref catalog/checkout_process.php
*/
function before_process() {
- if (is_array($this->modules)) {
- if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled)&& method_exists($GLOBALS[$this->selected_module], 'before_process') ) {
- return $GLOBALS[$this->selected_module]->before_process();
+ if (is_array($this->mod)) {
+ if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled)&& method_exists($GLOBALS[self::$selected_module], 'before_process') ) {
+ return $GLOBALS[self::$selected_module]->before_process();
}
}
}
-
+
/**
\ref catalog/checkout_process.php
*/
public function after_process() {
- if (is_array($this->modules)) {
- if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled)&& method_exists($GLOBALS[$this->selected_module], 'after_process') ) {
- return $GLOBALS[$this->selected_module]->after_process();
+ if (is_array($this->mod)) {
+ if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled)&& method_exists($GLOBALS[self::$selected_module], 'after_process') ) {
+ return $GLOBALS[self::$selected_module]->after_process();
}
}
}
@@ -234,17 +253,17 @@
\ref catalog/checkout_success.php
*/
function payment_succes() {
- if (is_array($this->modules)) {
- if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled)&& method_exists($GLOBALS[$this->selected_module], 'payment_succes') ) {
- return $GLOBALS[$this->selected_module]->payment_succes();
+ if (is_array($this->mod)) {
+ if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled)&& method_exists($GLOBALS[self::$selected_module], 'payment_succes') ) {
+ return $GLOBALS[self::$selected_module]->payment_succes();
}
}
}
public function get_error() {
- if (is_array($this->modules)) {
- if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled)&& method_exists($GLOBALS[$this->selected_module], 'pre_confirmation_check') ) {
- return $GLOBALS[$this->selected_module]->get_error();
+ if (is_array($this->mod)) {
+ if (is_object($GLOBALS[self::$selected_module]) && ($GLOBALS[self::$selected_module]->enabled)&& method_exists($GLOBALS[self::$selected_module], 'pre_confirmation_check') ) {
+ return $GLOBALS[self::$selected_module]->get_error();
}
}
}
Added: trunk/catalog/includes/content/checkout_cgu.php
===================================================================
--- trunk/catalog/includes/content/checkout_cgu.php (rev 0)
+++ trunk/catalog/includes/content/checkout_cgu.php 2011-11-20 22:08:51 UTC (rev 3894)
@@ -0,0 +1,46 @@
+<?php
+/**
+ @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 09/09/11, 22:30
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<div id="checkout">
+
+ <?php /** call and draw boxes */ ?>
+ <?php $boxe =$page->oscss_boxes->_return('checkout_progressbar'); ?>
+ <?php echo unhtmlentities($boxe->content) ?>
+
+ <?php echo tep_draw_form('checkout_before', tep_href_link('checkout.php' /*FILENAME_CHECKOUT*/, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?>
+
+ <?php foreach($display_view as $row): ?>
+
+ <h3><?php echo unhtmlentities($row->title) ?></h3>
+
+
+ <div>
+ <?php echo unhtmlentities($row->content) ?>
+ </div>
+
+ <?php endforeach; ?>
+
+ <fieldset>
+ <legend><?php echo CHECKOUT_CGV ;?></legend>
+
+ <label for="conditions"><?php printf(TEXT_CONDITIONS , tep_href_link(FILENAME_CONDITIONS, 'origin=checkout_payment') );?></label>
+ <input name="conditions" id="conditions" type="checkbox" <?php echo isset($_GET['consult_conditions']) ? 'checked="checked"' : '' ;?> />
+ </fieldset>
+
+ <p class="formBt ieExtractFieldset">
+ <?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE ;?>
+ <input type="submit" class="submitBt" value="<?php echo IMAGE_BUTTON_CONTINUE; ?>" />
+ </p>
+
+ </form>
+
+
+</div>
\ No newline at end of file
Modified: trunk/catalog/includes/content/checkout_confirmation.php
===================================================================
--- trunk/catalog/includes/content/checkout_confirmation.php 2011-11-20 22:04:33 UTC (rev 3893)
+++ trunk/catalog/includes/content/checkout_confirmation.php 2011-11-20 22:08:51 UTC (rev 3894)
@@ -1,14 +1,24 @@
<?php
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 18/11/10, 21:53
+ @version 2.1.1
+ @date 20/11/11, 22:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
+
+/**
+ @var object order total
+*/
+$ACA_ot=$page->return_object('order_total_modules');
+/**
+ @var array result order totals
+*/
$order_totals=$page->the_var('order_totals');
+
+// var_dump($ACA_ot);
?>
<div id="checkoutConfirmation">
<?php $boxe =$page->oscss_boxes->_return('checkout_progressbar'); ?>
@@ -65,7 +75,7 @@
<table class="invoice invoiceTotal" cellspacing="0">
<tbody>
- <?php print $order_total_modules->output("<tr>%s</tr>", '<td class="otTtitle">%s</td><td class="otText totht">%s</td><td class="otText totttc">%s</td>'); ?>
+ <?php print $ACA_ot->output("<tr>%s</tr>", '<td class="otTtitle">%s</td><td class="otText totht">%s</td><td class="otText totttc">%s</td>'); ?>
</tbody>
</table>
Modified: trunk/catalog/includes/content/checkout_payment.php
===================================================================
--- trunk/catalog/includes/content/checkout_payment.php 2011-11-20 22:04:33 UTC (rev 3893)
+++ trunk/catalog/includes/content/checkout_payment.php 2011-11-20 22:08:51 UTC (rev 3894)
@@ -17,7 +17,7 @@
<h2 class="content title <?php echo $language ;?>"><?php echo HEADING_TITLE; ?></h2>
- <?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?>
+ <?php echo tep_draw_form('checkout_payment', tep_href_link('checkout.php'/*FILENAME_CHECKOUT_CONFIRMATION*/, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?>
<?php /** Retour des erreurs */
if (isset($_GET['payment_error']) && is_object(${$_GET['payment_error']}) && ($error = ${$_GET['payment_error']}->get_error())) { ?>
@@ -104,12 +104,12 @@
<p id="checkoutcouponerror" class="warning"><?php if(isset($_GET['error_message'])) echo $_GET['error_message'] ?></p>
<?php } ?>
- <fieldset>
- <legend><?php echo CHECKOUT_CGV ;?></legend>
+<!-- <fieldset>
+ <legend><?php //echo CHECKOUT_CGV ;?></legend>
- <label for="conditions"><?php printf(TEXT_CONDITIONS , tep_href_link(FILENAME_CONDITIONS, 'origin=checkout_payment') );?></label>
- <input name="conditions" id="conditions" type="checkbox" <?php echo isset($_GET['consult_conditions']) ? 'checked="checked"' : '' ;?> />
- </fieldset>
+ <label for="conditions"><?php //printf(TEXT_CONDITIONS , tep_href_link(FILENAME_CONDITIONS, 'origin=checkout_payment') );?></label>
+ <input name="conditions" id="conditions" type="checkbox" <?php //echo isset($_GET['consult_conditions']) ? 'checked="checked"' : '' ;?> />
+ </fieldset>-->
<p class="formBt ieExtractFieldset">
<?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE ;?>
Modified: trunk/catalog/includes/content/shopping_cart.php
===================================================================
--- trunk/catalog/includes/content/shopping_cart.php 2011-11-20 22:04:33 UTC (rev 3893)
+++ trunk/catalog/includes/content/shopping_cart.php 2011-11-20 22:08:51 UTC (rev 3894)
@@ -77,12 +77,16 @@
<div class="SubTotal">
<ul id="TotCart">
- <?php foreach($cart->show_list_total() as $i=>$tot): ?>
- <li><?php printf('<span>%s </span> %s' ,$tot->text, $currencies->format($tot->value)); ?></li>
- <?php endforeach; ?>
- <li id="ajaxcartWeight" class="cartWeight">
- <?php echo '<span>' . SUB_TITLE_WEIGHT_TOTAL .'</span>' . $cart->show_weight().' '.UNIT_WEIGHT_NAME; ?>
- </li>
+ <?php foreach($cart->show_list_total() as $i=>$tot): ?>
+ <li><?php printf('<span>%s </span> %s' ,$tot->text, $currencies->format($tot->value)); ?></li>
+ <?php endforeach; ?>
+
+ <?php if($cart->get_content_type() !='virtual'): ?>
+ <li id="ajaxcartWeight" class="cartWeight">
+ <?php echo '<span>' . SUB_TITLE_WEIGHT_TOTAL .'</span>' . $cart->show_weight().' '.UNIT_WEIGHT_NAME; ?>
+ </li>
+ <?php endif; ?>
+
</ul>
</div>
@@ -106,7 +110,7 @@
$back = sizeof($navigation->path)-2;
if (isset($navigation->path[$back])) echo '<a class="Bt navBt link" href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . IMAGE_BUTTON_CONTINUE_SHOPPING . '</a>';
else echo '<a class="Bt navBt link" href="javascript:history.go(-1)">' . IMAGE_BUTTON_BACK . '</a>'; ?>
- <?php echo '<a class="Bt navBt link" href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . IMAGE_BUTTON_CHECKOUT . '</a>'; ?>
+ <?php echo '<a class="Bt navBt link" href="' . tep_href_link('checkout.php'/*FILENAME_CHECKOUT_SHIPPING*/, 'step=init', 'SSL') . '">' . IMAGE_BUTTON_CHECKOUT . '</a>'; ?>
</div>
Modified: trunk/catalog/includes/js/checkout.js.php
===================================================================
--- trunk/catalog/includes/js/checkout.js.php 2011-11-20 22:04:33 UTC (rev 3893)
+++ trunk/catalog/includes/js/checkout.js.php 2011-11-20 22:08:51 UTC (rev 3894)
@@ -1,4 +1,4 @@
-<?php error_reporting(E_ALL);;?>
+
<script language="javascript"><!--
function CVVPopUpWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=600,height=233,screenX=150,screenY=150,top=150,left=150')
@@ -8,333 +8,5 @@
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=600,height=510,screenX=150,screenY=150,top=150,left=150')
}
-// function init_go (){
- var onePage = checkout;//document.getElementById('checkout');
- onePage.initializing = true;
- onePage.ajaxCharset = '<?php echo CHARSET;?>';
- onePage.loggedIn = <?php echo (isset($customer_id) ? 'true' : 'false');?>;
- onePage.ccgvInstalled = <?php echo (_cst_bool('MODULE_ORDER_TOTAL_COUPON_STATUS') ? 'true' : 'false');?>;
- //BOF KGT
- onePage.kgtInstalled = <?php echo (_cst_bool('MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS') ? 'true' : 'false');?>;
- //EOF KGT
- onePage.shippingEnabled = <?php echo (@$onepage['shippingEnabled'] === true ? 'true' : 'false');?>;
- onePage.pageLinks = {
- checkout: '<?php echo fixSeoLink(tep_href_link(FILENAME_CHECKOUT, session_name() . '=' . session_id() . '&rType=ajax', (_cst_bool('ENABLE_SSL')? 'SSL':'NONSSL') ));?>',
- shoppingCart: '<?php echo fixSeoLink(tep_href_link(FILENAME_SHOPPING_CART));?>'
- }
-// }
- function getFieldErrorCheck($element){
- var rObj = {};
- switch($element.attr('name')){
- case 'billing_firstname':
- case 'shipping_firstname':
- rObj.minLength = <?php echo addslashes(ENTRY_FIRST_NAME_MIN_LENGTH);?>;
- rObj.errMsg = '<?php echo addslashes(ENTRY_FIRST_NAME_ERROR);?>';
- break;
- case 'billing_lastname':
- case 'shipping_lastname':
- rObj.minLength = <?php echo addslashes(ENTRY_LAST_NAME_MIN_LENGTH);?>;
- rObj.errMsg = '<?php echo addslashes(ENTRY_LAST_NAME_ERROR);?>';
- break;
- case 'billing_email_address':
- rObj.minLength = <?php echo addslashes(ENTRY_EMAIL_ADDRESS_MIN_LENGTH);?>;
- rObj.errMsg = '<?php echo addslashes(ENTRY_EMAIL_ADDRESS_ERROR);?>';
- break;
- case 'billing_street_address':
- case 'shipping_street_address':
- rObj.minLength = <?php echo addslashes(ENTRY_STREET_ADDRESS_MIN_LENGTH);?>;
- rObj.errMsg = '<?php echo addslashes(ENTRY_STREET_ADDRESS_ERROR);?>';
- break;
- case 'billing_zipcode':
- case 'shipping_zipcode':
- rObj.minLength = <?php echo addslashes(ENTRY_POSTCODE_MIN_LENGTH);?>;
- rObj.errMsg = '<?php echo addslashes(ENTRY_POST_CODE_ERROR);?>';
- break;
- case 'billing_city':
- case 'shipping_city':
- rObj.minLength = <?php echo addslashes(ENTRY_CITY_MIN_LENGTH);?>;
- rObj.errMsg = '<?php echo addslashes(ENTRY_CITY_ERROR);?>';
- break;
- case 'billing_dob':
- rObj.minLength = <?php echo addslashes(ENTRY_DOB_MIN_LENGTH);?>;
- rObj.errMsg = '<?php echo addslashes(ENTRY_DATE_OF_BIRTH_ERROR);?>';
- break;
- case 'billing_telephone':
- rObj.minLength = <?php echo addslashes(ENTRY_TELEPHONE_MIN_LENGTH);?>;
- rObj.errMsg = '<?php echo addslashes(ENTRY_TELEPHONE_NUMBER_ERROR);?>';
- break;
- case 'billing_country':
- case 'shipping_country':
- rObj.errMsg = '<?php echo addslashes(ENTRY_COUNTRY_ERROR);?>';
- break;
- case 'billing_state':
- case 'shipping_state':
- rObj.minLength = <?php echo addslashes(ENTRY_STATE_MIN_LENGTH);?>;
- rObj.errMsg = '<?php echo addslashes(ENTRY_STATE_ERROR);?>';
- break;
- case 'password':
- case 'confirmation':
- rObj.minLength = <?php echo addslashes(ENTRY_PASSWORD_MIN_LENGTH);?>;
- rObj.errMsg = '<?php echo addslashes(ENTRY_PASSWORD_ERROR);?>';
- break;
- }
- return rObj;
- }
-
-$(document).ready(function (){
- $('#pageContentContainer').show();
- var loginBoxOpened = false;
- $('#loginButton').click(function (){
- if (loginBoxOpened){
- $('#loginBox').dialog('open');
- return false;
- }
- $('#loginBox').dialog({
- resizable: false,
- shadow: false,
- open: function (){
- var $dialog = this;
- $('input', $dialog).keypress(function (e){
- if (e.which == 13){
- $('#loginWindowSubmit', $dialog).click();
- }
- });
-
- $('#loginWindowSubmit', $dialog).hover(function (){
- this.style.cursor = 'pointer';
- }, function (){
- this.style.cursor = 'default';
- }).click(function (){
- var $this = $(this);
- $this.hide();
- var email = $('input[name="email_address"]', $dialog).val();
- var pass = $('input[name="password"]', $dialog).val();
- onePage.queueAjaxRequest({
- url: onePage.pageLinks.checkout,
- data: 'action=processLogin&email=' + email + '&pass=' + pass,
- dataType: 'json',
- type: 'post',
- beforeSend: function (){
- onePage.showAjaxMessage('Refreshing Shopping Cart');
- if ($('#loginStatus', $this.parent()).size() <= 0){
- $('<div>')
- .attr('id', 'loginStatus')
- .html('Processing Login')
- .attr('align', 'center')
- .insertAfter($this);
- }
- },
- success: function (data){
- if (data.success == true){
- $('#loginStatus', $dialog).html(data.msg);
- $('#logInRow').hide();
-
- $('#changeBillingAddressTable').show();
- $('#changeShippingAddressTable').show();
- $('#newAccountEmail').remove();
- $('#diffShipping').parent().parent().parent().remove();
-
- onePage.updateAddressHTML('billing');
- onePage.updateAddressHTML('shipping');
-
- $('#shippingAddress').show();
-
- var updateTotals = true;
- onePage.updateCartView();
- onePage.updateFinalProductListing();
- onePage.updatePaymentMethods();
- if ($(':radio[name="payment"]:checked').size() > 0){
- onePage.setPaymentMethod($(':radio[name="payment"]:checked'));
- updateTotals = false;
- }
- onePage.updateShippingMethods();
- if ($(':radio[name="shipping"]:checked').size() > 0){
- //onePage.setShippingMethod($(':r...
[truncated message content] |
|
From: <os...@us...> - 2011-12-16 08:40:30
|
Revision: 3957
http://oscss.svn.sourceforge.net/oscss/?rev=3957&view=rev
Author: oscim
Date: 2011-12-16 08:40:20 +0000 (Fri, 16 Dec 2011)
Log Message:
-----------
FS#919
bug money order info page checkout success et saut de ligne
Modified Paths:
--------------
trunk/catalog/includes/languages/fr_FR/modules/payment/moneyorder.txt
trunk/catalog/includes/modules/payment/moneyorder.php
Modified: trunk/catalog/includes/languages/fr_FR/modules/payment/moneyorder.txt
===================================================================
--- trunk/catalog/includes/languages/fr_FR/modules/payment/moneyorder.txt 2011-12-15 19:51:25 UTC (rev 3956)
+++ trunk/catalog/includes/languages/fr_FR/modules/payment/moneyorder.txt 2011-12-16 08:40:20 UTC (rev 3957)
@@ -14,7 +14,7 @@
$lang['module payment moneyorder text title']="Paiement par chèque" ;
$lang['module payment moneyorder text description']="Etablir le chèque à l'ordre de : " . MODULE_PAYMENT_MONEYORDER_PAYTO . "<br /><br />Envoyer à :<br />" . nl2br(STORE_NAME_ADDRESS) . "<br /><br /> Votre commande ne sera finalisée qu'à réception du règlement." ;
/* Etape succes, rappel des info pour paiement */
-$lang['note succes monyeyorder']="<h4>Vous venez d'effectuer un achat par chèque</h4><p> Envoyer à :<br /><strong>" . nl2br(STORE_NAME_ADDRESS)."</strong> </p>" ;
+$lang['note succes monyeyorder %s']="<h4>Vous venez d'effectuer un achat par chèque</h4><p> Envoyer à :<br /><strong>%s</strong> </p>" ;
$lang['link succes monyeyorder']="<p>préciser au dos de celui-ci le numéro suivant <strong>BC-%s</strong></p>" ;
/** Les saut de ligne sont volontaire */
Modified: trunk/catalog/includes/modules/payment/moneyorder.php
===================================================================
--- trunk/catalog/includes/modules/payment/moneyorder.php 2011-12-15 19:51:25 UTC (rev 3956)
+++ trunk/catalog/includes/modules/payment/moneyorder.php 2011-12-16 08:40:20 UTC (rev 3957)
@@ -9,10 +9,18 @@
@encode UTF-8
*/
-class moneyorder implements InterfaceModule,InterfaceAcaPayment{
- var $code, $title, $description, $enabled;
+class moneyorder
+ implements
+ InterfaceModule,
+ InterfaceAcaPayment
+ {
+ public $code;
+ public $title;
+ public $description;
+ public $enabled;
+
public function __construct() {
global $order;
@@ -75,7 +83,9 @@
Retour des éléments de num order, de order de cheque, et des liens vers account
*/
public function payment_succes() {
- $s=__('note succes monyeyorder');
+
+ $s=sprintf(__('note succes monyeyorder %s'),str_replace(array('\r\n', '\n', '\r'),array('<br />'), STORE_NAME_ADDRESS ) );
+
if(tep_session_is_registered('the_order_formated')) $s.=sprintf(__('link succes monyeyorder'),$_SESSION['the_order_formated']);
elseif(tep_session_is_registered('the_order_id')) $s.=sprintf(__('link succes monyeyorder'),$_SESSION['the_order_id']);
return $s;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-03-16 12:20:20
|
Revision: 4083
http://oscss.svn.sourceforge.net/oscss/?rev=4083&view=rev
Author: oscim
Date: 2012-03-16 12:20:09 +0000 (Fri, 16 Mar 2012)
Log Message:
-----------
correction
Modified Paths:
--------------
trunk/catalog/includes/classes/AbstractAcaModule.php
trunk/catalog/includes/classes/core_page/generic.php
trunk/catalog/includes/database_tables.php
Modified: trunk/catalog/includes/classes/AbstractAcaModule.php
===================================================================
--- trunk/catalog/includes/classes/AbstractAcaModule.php 2012-03-15 19:40:40 UTC (rev 4082)
+++ trunk/catalog/includes/classes/AbstractAcaModule.php 2012-03-16 12:20:09 UTC (rev 4083)
@@ -4,7 +4,7 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 01/01/2012, 18:17
+ @date 14/03/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
\file AbstractAcaModule.php
@@ -111,8 +111,9 @@
$list_mod=array();
if(defined($cst)){
-// var_dump($cst);
- $files_array=explode (';',str_replace(';;',';',constant($cst)));
+ $clean = str_replace(';;',';',constant($cst));
+ if(substr($clean, 0,1) ==';') $clean = substr($clean, 1);
+ $files_array=explode (';',$clean);
if (tep_not_null($files_array[0])) {
reset ($files_array);
while (list ($key, $file) = each ($files_array)) {
Modified: trunk/catalog/includes/classes/core_page/generic.php
===================================================================
--- trunk/catalog/includes/classes/core_page/generic.php 2012-03-15 19:40:40 UTC (rev 4082)
+++ trunk/catalog/includes/classes/core_page/generic.php 2012-03-16 12:20:09 UTC (rev 4083)
@@ -1,10 +1,10 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 23/09/10, 21:46
+ @version 2.1.1
+ @date 14/03/2012, 21:46
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class generic
@@ -33,16 +33,18 @@
foreach(parent::initialise_type('MODULE_GENERIC_INSTALLED','generic') as $class){
$cl[$class]=new $class ();
$list_mod[$class] = $cl[$class]->sort_order;
- asort($list_mod);
- foreach($list_mod as $class=>$s){
- $this->modules[$class] =$cl[$class];
- }
- unset($cl);unset($list_mod);
}
+
+ asort($list_mod);
+ foreach($list_mod as $class=>$s){
+ $this->modules[$class] =$cl[$class];
+ }
+ unset($cl);unset($list_mod);
+
}
/**
- * \fn getInstance($full=false)
+ * \fn getInstance($full=false)
* @param $full
*/
public static function getInstance($full=false) {
@@ -61,11 +63,11 @@
/**
* \fn display_view($pID,$class='')
- * \brief
+ * \brief
Affiche module elemennt html
Block principal d'affichage, liste ou vue des élément. Block principal de page
-
+
* @param $pID int le Id du produits
* @param $class string le nom de la class appelé, ou vide pour toutes les class enfants
*/
@@ -120,7 +122,7 @@
/**
* \fn display_titre($cID,$format='$s')
* \brief Affiche bock titre client notifié
- * @param $cID int
+ * @param $cID int
* @param $format string for sprintf
*/
public function display_titre($cID,$format='$s'){
Modified: trunk/catalog/includes/database_tables.php
===================================================================
--- trunk/catalog/includes/database_tables.php 2012-03-15 19:40:40 UTC (rev 4082)
+++ trunk/catalog/includes/database_tables.php 2012-03-16 12:20:09 UTC (rev 4083)
@@ -94,13 +94,13 @@
define('TABLE_PRODUCTS_OPTIONS_VALUES', DB_TABLE_PREFIX . 'products_options_values');
define('TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS', DB_TABLE_PREFIX . 'products_options_values_to_products_options');
define('TABLE_PRODUCTS_STOCK', DB_TABLE_PREFIX .'products_stock');
- define('TABLE_PRODUCTS_PRICE', DB_TABLE_PREFIX .'products_price');
+// define('TABLE_PRODUCTS_PRICE', DB_TABLE_PREFIX .'products_price');
define('TABLE_PRODUCTS_EXTRA_FIELDS', DB_TABLE_PREFIX .'products_extra_fields');
define('TABLE_PRODUCTS_EXTRA_FIELDS_LABELS', DB_TABLE_PREFIX .'products_extra_fields_labels');
define('TABLE_PRODUCTS_EXTRA_FIELDS_VALUES', DB_TABLE_PREFIX .'products_extra_fields_values');
define('TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS', DB_TABLE_PREFIX .'products_to_products_extra_fields');
define('TABLE_PRODUCTS_TO_CATEGORIES', DB_TABLE_PREFIX . 'products_to_categories');
- define('TABLE_PRODUCTS_VIRTUAL', DB_TABLE_PREFIX .'products_virtual');
+// define('TABLE_PRODUCTS_VIRTUAL', DB_TABLE_PREFIX .'products_virtual');
define('TABLE_SEO_CACHE', DB_TABLE_PREFIX . 'seo_cache');
define('TABLE_STATUS',DB_TABLE_PREFIX.'status');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-04-18 14:02:00
|
Revision: 4264
http://oscss.svn.sourceforge.net/oscss/?rev=4264&view=rev
Author: oscim
Date: 2012-04-18 14:01:49 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
Ajustement des chemi npour deport de dossier dans le template par defaut
Modified Paths:
--------------
trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php
trunk/catalog/includes/functions/general.php
Modified: trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php
===================================================================
--- trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php 2012-04-18 12:39:32 UTC (rev 4263)
+++ trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php 2012-04-18 14:01:49 UTC (rev 4264)
@@ -120,7 +120,6 @@
$page->page['type']='none';
-// var_dump(DataTypes::is_type('listing'));
/// obtain type pre-selected by index.php page (Childs datatype_drivers)
if( ($type = DataTypes::GetTypePage()) && $type !=NULL)
@@ -130,33 +129,15 @@
else{
if (isset($_GET['popup'])){
$page->page['type']='popup';
- }/*elseif ($page->page['content']=='index.php' ||$page->page['content']=='home.php' && (empty($_SERVER['QUERY_STRING']) || (isset($_GET['osCsid']) || isset($_GET['divers']) ) )) {
- $page->page['type']='home';
- }*//*elseif ( (!empty($_SERVER['QUERY_STRING']) && isset($_GET['customers_id']) )) {
- $page->page['type']='member';
- $page->page['class']='single';
- }*/elseif (in_array(substr($page->page['content'],0,7), array('account','address')) || in_array(substr(basename($_SERVER['SCRIPT_NAME']),0,-4), array('account','address')) ) {
+ }elseif (in_array(substr($page->page['content'],0,7), array('account','address')) || in_array(substr(basename($_SERVER['SCRIPT_NAME']),0,-4), array('account','address')) ) {
$page->page['type']='account';
}elseif (substr($page->page['content'],0,8) =='checkout') {
$page->page['type']='checkout';
- }/*elseif (substr($page->page['content'],0,7) =='product') {
- $page->page['type']='product';
- $page->page['class']='single';
- }*/elseif (in_array(substr($page->page['content'],0,6) , array('shoppi'))) {
+ }elseif (in_array(substr($page->page['content'],0,6) , array('shoppi'))) {
$page->page['type']='cart';
}elseif (substr($page->page['content'],0,9) =='index_cat') {
$page->page['type']='listing_cat';
- }/*elseif (in_array(substr($page->page['content'],0,6) , array('listin','index_','index.'))) {
- $page->page['type']='listing';
-
- if(isset($page->page['var']['manufacturers']))$page->page['class']='manufactuers';
- elseif(!empty($page->page['var']['cPath'])) $page->page['class']='categories';
- else $page->page['class']='listing';
-
- }*//*elseif (in_array(substr($page->page['content'],0,7) , array('content')) && isset($_GET['content']) ) {
- $page->page['type']='content';
- $page->page['class']='single';
- }*/
+ }
}
parent::$GlobalCache['type_content']=$page->page['type'];
@@ -171,11 +152,11 @@
protected static function GetPageContent() {
global $page;
- $filename = $page->getPathTemplate() . '/includes/content/'. $page->page['content'];
+ $filename = $page->getPathTemplate() . DIR_WS_INCLUDES . '/content/'. $page->page['content'];
if (parent::TestFile($filename)) $page->page['path_content'] = (DIR_WS_TEMPLATES . $page->page['template'] . '/includes/content/'. $page->page['content']);
- elseif (parent::TestFile(DIR_WS_INCLUDES.'content/' . $page->page['content'])) $page->page['path_content'] = (DIR_WS_INCLUDES.'content/' . $page->page['content']);
- else $page->page['path_content'] = (DIR_WS_INCLUDES.'content/404.php' );
+ elseif (parent::TestFile(DIR_WS_TEMPLATES . DEFAULT_TEMPLATE_NAME. '/' . DIR_WS_INCLUDES.'content/' . $page->page['content'])) $page->page['path_content'] = (DIR_WS_TEMPLATES . DEFAULT_TEMPLATE_NAME. '/' . DIR_WS_INCLUDES.'content/' . $page->page['content']);
+ else $page->page['path_content'] = (DIR_WS_TEMPLATES . DEFAULT_TEMPLATE_NAME. '/' . DIR_WS_INCLUDES.'content/404.php' );
return($page->page['path_content']);
}
Modified: trunk/catalog/includes/functions/general.php
===================================================================
--- trunk/catalog/includes/functions/general.php 2012-04-18 12:39:32 UTC (rev 4263)
+++ trunk/catalog/includes/functions/general.php 2012-04-18 14:01:49 UTC (rev 4264)
@@ -1044,7 +1044,7 @@
*/
function tep_get_include_contents($filename) {
global $page;
- if ( ($file=page::fix_file(DIR_FS_CATALOG.DIR_WS_INCLUDES.'gabarit/'.$filename.'.gab')) != false){
+ if ( ($file=page::fix_file(DIR_FS_CATALOG. DIR_WS_TEMPLATES . DEFAULT_TEMPLATE_NAME. '/'. DIR_WS_INCLUDES.'gabarit/'.$filename.'.gab')) != false){
ob_start();
include $file;
$contents = ob_get_contents();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-04-18 14:03:00
|
Revision: 4265
http://oscss.svn.sourceforge.net/oscss/?rev=4265&view=rev
Author: oscim
Date: 2012-04-18 14:02:49 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
deport des dossier content et gabarit ds le template defaut
Removed Paths:
-------------
trunk/catalog/includes/content/
trunk/catalog/includes/gabarit/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-04-18 15:24:56
|
Revision: 4268
http://oscss.svn.sourceforge.net/oscss/?rev=4268&view=rev
Author: oscim
Date: 2012-04-18 15:24:45 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
correction gestion des paths
Modified Paths:
--------------
trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php
trunk/catalog/includes/functions/general.php
Modified: trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php
===================================================================
--- trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php 2012-04-18 14:19:30 UTC (rev 4267)
+++ trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php 2012-04-18 15:24:45 UTC (rev 4268)
@@ -1,10 +1,10 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 18/12/11, 15:06
+ @date 18/04/2012, 15:06
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
\class oscss_boxes
@@ -98,10 +98,14 @@
$filename = DIR_WS_TEMPLATES . $page->page['template'] .'/' . DIR_WS_INCLUDES. '%s'. $name_clean.$page->ext;
- if (page::TestFile(sprintf($filename,'plugins/'))) $path =sprintf($filename,'plugins/');
- elseif (page::TestFile(sprintf($filename,'boxes/'))) $path =sprintf($filename,'boxes/');
- elseif (page::TestFile(DIR_WS_TEMPLATES . DEFAULT_TEMPLATE_NAME. '/'.DIR_WS_BOXES . $name_clean.$page->ext)) $path = (DIR_WS_TEMPLATES . DEFAULT_TEMPLATE_NAME .'/'. DIR_WS_BOXES . $name_clean.$page->ext);
- else return false;
+ if (page::TestFile(sprintf($filename,'plugins/')))
+ $path =sprintf($filename,'plugins/');
+ elseif (page::TestFile(sprintf($filename,'boxes/')))
+ $path =sprintf($filename,'boxes/');
+ elseif (page::TestFile(DIR_WS_TEMPLATES . DEFAULT_TEMPLATE_NAME. '/'.DIR_WS_BOXES . $name_clean.$page->ext))
+ $path = (DIR_WS_TEMPLATES . DEFAULT_TEMPLATE_NAME .'/'. DIR_WS_BOXES . $name_clean.$page->ext);
+ else
+ return false;
if(($path_lg=$page->fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/boxes/' . $name_clean.$page->ext,true)) !=false) $page->pile_file_lang($path_lg);
Modified: trunk/catalog/includes/functions/general.php
===================================================================
--- trunk/catalog/includes/functions/general.php 2012-04-18 14:19:30 UTC (rev 4267)
+++ trunk/catalog/includes/functions/general.php 2012-04-18 15:24:45 UTC (rev 4268)
@@ -1044,7 +1044,7 @@
*/
function tep_get_include_contents($filename) {
global $page;
- if ( ($file=page::fix_file(DIR_FS_CATALOG. DIR_WS_TEMPLATES . DEFAULT_TEMPLATE_NAME. '/'. DIR_WS_INCLUDES.'gabarit/'.$filename.'.gab')) != false){
+ if ( ($file=page::fix_file(DIR_WS_INCLUDES.'gabarit/'.$filename.'.gab')) != false){
ob_start();
include $file;
$contents = ob_get_contents();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2013-09-16 06:39:15
|
Revision: 4831
http://sourceforge.net/p/oscss/svn/4831
Author: oscim
Date: 2013-09-16 06:39:12 +0000 (Mon, 16 Sep 2013)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/includes/classes/page.php
trunk/catalog/includes/languages/fr_FR/fr_FR.php
Modified: trunk/catalog/includes/classes/page.php
===================================================================
--- trunk/catalog/includes/classes/page.php 2013-09-14 08:39:55 UTC (rev 4830)
+++ trunk/catalog/includes/classes/page.php 2013-09-16 06:39:12 UTC (rev 4831)
@@ -428,6 +428,7 @@
if(count($meta)<=3)
$this->page['seo_url']['error'] = true;
+ $meta['description']=$meta['desc'];
$this->page['meta'] = $meta;
// log
$this->page['seo_url']['result'] = $this->page['meta'];
Modified: trunk/catalog/includes/languages/fr_FR/fr_FR.php
===================================================================
--- trunk/catalog/includes/languages/fr_FR/fr_FR.php 2013-09-14 08:39:55 UTC (rev 4830)
+++ trunk/catalog/includes/languages/fr_FR/fr_FR.php 2013-09-16 06:39:12 UTC (rev 4831)
@@ -97,7 +97,7 @@
define('NOTAX_SYMBOL',"HT" );
// Define your email address to appear on all pages
-define('HEAD_REPLY_TAG_ALL',"TORE_OWNER_EMAIL_ADDRES" );
+define('HEAD_REPLY_TAG_ALL',STORE_OWNER_EMAIL_ADDRESS );
// header text in includes/header.php
define('HEADER_TITLE_CREATE_ACCOUNT',"Créer un compte" );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hom...@us...> - 2014-09-02 16:13:06
|
Revision: 5225
http://sourceforge.net/p/oscss/svn/5225
Author: homer8173
Date: 2014-09-02 16:12:58 +0000 (Tue, 02 Sep 2014)
Log Message:
-----------
Modification de la pagination pour utiliser la pr?\195?\169sentation bootstrap :
http://getbootstrap.com/components/#pagination
Modified Paths:
--------------
trunk/catalog/includes/classes/split_page_results.php
trunk/catalog/includes/languages/fr_FR/initial.php
Modified: trunk/catalog/includes/classes/split_page_results.php
===================================================================
--- trunk/catalog/includes/classes/split_page_results.php 2014-09-02 12:20:33 UTC (rev 5224)
+++ trunk/catalog/includes/classes/split_page_results.php 2014-09-02 16:12:58 UTC (rev 5225)
@@ -22,13 +22,20 @@
/**
@var string format link
*/
- public $format_link = '<a class="btn btn-default" href="%s" title=" %s ">%s</a>';
+ public $format_link = '<a href="%s" title=" %s ">%s</a>';
/**
@var string format link parent encapusation
*/
- public $format_link_p = '<div class="btn-group btn-group-xs">%s</div>';
+ public $format_link_p = '<li>%s</li>';
+ public $format_link_p_active = '<li class="active">%s</li>';
+ /**
+ * @var string format main container
+ */
+ // small version
+ // public $format_main_container = '<ul class="pagination pagination-sm">%s</ul>';
+ public $format_main_container = '<ul class="pagination">%s</ul>';
-/* class constructor */
+ /* class constructor */
function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page') {
global $_GET, $_POST;
@@ -101,6 +108,7 @@
$basename = basename($_SERVER['SCRIPT_FILENAME']);
$display_links_string = '';
$link = sprintf( $this->format_link_p, $this->format_link);
+ $link_active = sprintf( $this->format_link_p_active, $this->format_link);
if (tep_not_null($parameters) && (substr($parameters, -1) != '&')) $parameters .= '&';
@@ -130,11 +138,12 @@
// page nn button
for ($jump_to_page = 1 + (($cur_window_num - 1) * $max_page_links); ($jump_to_page <= ($cur_window_num * $max_page_links)) && ($jump_to_page <= $this->number_of_pages); $jump_to_page++) {
if ($jump_to_page == $this->current_page_number) {
- $display_links_string .= sprintf( $link,
+ // active link
+ $display_links_string .= sprintf( $link_active,
tep_href_link($basename, $parameters . 'page=' . $this->current_page_number , $request_type) ,
$jump_to_page ,
$jump_to_page
- );
+ );
}
else {
@@ -162,7 +171,7 @@
PREVNEXT_BUTTON_NEXT
);
- return $display_links_string;
+ return sprintf($this->format_main_container,$display_links_string);
}
// display number of total products found
Modified: trunk/catalog/includes/languages/fr_FR/initial.php
===================================================================
--- trunk/catalog/includes/languages/fr_FR/initial.php 2014-09-02 12:20:33 UTC (rev 5224)
+++ trunk/catalog/includes/languages/fr_FR/initial.php 2014-09-02 16:12:58 UTC (rev 5225)
@@ -140,10 +140,10 @@
define('PREVNEXT_TITLE_PAGE_NO',"Page %d" );
define('PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE',"Ensemble précédent de %d pages" );
define('PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE',"Ensemble suivant de %d pages" );
-define('PREVNEXT_BUTTON_FIRST',"<<PREMIER" );
-define('PREVNEXT_BUTTON_PREV',"[<< Préc.]" );
-define('PREVNEXT_BUTTON_NEXT',"[Suiv. >>]" );
-define('PREVNEXT_BUTTON_LAST',"DERNIER>>" );
+define('PREVNEXT_BUTTON_FIRST',"«" );
+define('PREVNEXT_BUTTON_PREV',"‹" );
+define('PREVNEXT_BUTTON_NEXT',"›" );
+define('PREVNEXT_BUTTON_LAST',"»" );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hom...@us...> - 2014-09-18 22:21:36
|
Revision: 5236
http://sourceforge.net/p/oscss/svn/5236
Author: homer8173
Date: 2014-09-18 22:21:22 +0000 (Thu, 18 Sep 2014)
Log Message:
-----------
Debuger : kint to replace var_dump
usage : d($myvar);
Modified Paths:
--------------
trunk/catalog/includes/application_top.php
Added Paths:
-----------
trunk/catalog/includes/kint/
trunk/catalog/includes/kint/Kint.class.php
trunk/catalog/includes/kint/LICENCE
trunk/catalog/includes/kint/README.md
trunk/catalog/includes/kint/composer.json
trunk/catalog/includes/kint/config.default.php
trunk/catalog/includes/kint/decorators/
trunk/catalog/includes/kint/decorators/concise.php
trunk/catalog/includes/kint/decorators/plain.php
trunk/catalog/includes/kint/decorators/rich.php
trunk/catalog/includes/kint/parsers/
trunk/catalog/includes/kint/parsers/custom/
trunk/catalog/includes/kint/parsers/custom/arrayobject.php
trunk/catalog/includes/kint/parsers/custom/classmethods.php
trunk/catalog/includes/kint/parsers/custom/classstatics.php
trunk/catalog/includes/kint/parsers/custom/color.php
trunk/catalog/includes/kint/parsers/custom/json.php
trunk/catalog/includes/kint/parsers/custom/microtime.php
trunk/catalog/includes/kint/parsers/custom/splfileinfo.php
trunk/catalog/includes/kint/parsers/custom/splobjectstorage.php
trunk/catalog/includes/kint/parsers/custom/timestamp.php
trunk/catalog/includes/kint/parsers/custom/xml.php
trunk/catalog/includes/kint/parsers/parser.class.php
trunk/catalog/includes/kint/scripts/
trunk/catalog/includes/kint/scripts/source.reg
trunk/catalog/includes/kint/scripts/source.vbs
trunk/catalog/includes/kint/view/
trunk/catalog/includes/kint/view/inc/
trunk/catalog/includes/kint/view/inc/kint.js
trunk/catalog/includes/kint/view/inc/original.css
trunk/catalog/includes/kint/view/inc/solarized-dark.css
trunk/catalog/includes/kint/view/inc/solarized.css
trunk/catalog/includes/kint/view/js/
trunk/catalog/includes/kint/view/js/_kint.js
trunk/catalog/includes/kint/view/less/
trunk/catalog/includes/kint/view/less/_kint.less
trunk/catalog/includes/kint/view/less/original.less
trunk/catalog/includes/kint/view/less/solarized-dark.less
trunk/catalog/includes/kint/view/less/solarized.less
trunk/catalog/includes/kint/view/trace.phtml
Modified: trunk/catalog/includes/application_top.php
===================================================================
--- trunk/catalog/includes/application_top.php 2014-09-17 14:11:50 UTC (rev 5235)
+++ trunk/catalog/includes/application_top.php 2014-09-18 22:21:22 UTC (rev 5236)
@@ -16,6 +16,9 @@
/// start the timer for the page parse time log
define('PAGE_PARSE_START_TIME', microtime());
+// debug tool to replace dump_var
+// usage : d($page);
+require_once 'includes/kint/Kint.class.php';
/// Set the local configuration parameters - mainly for developers
if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');
Added: trunk/catalog/includes/kint/Kint.class.php
===================================================================
--- trunk/catalog/includes/kint/Kint.class.php (rev 0)
+++ trunk/catalog/includes/kint/Kint.class.php 2014-09-18 22:21:22 UTC (rev 5236)
@@ -0,0 +1,742 @@
+<?php
+/**
+ * Kint is a zero-setup debugging tool to output information about variables and stack traces prettily and comfortably.
+ *
+ * https://github.com/raveren/kint
+ */
+define( 'KINT_DIR', dirname( __FILE__ ) . '/' );
+require KINT_DIR . 'config.default.php';
+require KINT_DIR . 'parsers/parser.class.php';
+
+if ( is_readable( KINT_DIR . 'config.php' ) ) {
+ require KINT_DIR . 'config.php';
+}
+
+class Kint
+{
+ // these are all public and 1:1 config array keys so you can switch them easily
+ public static $traceCleanupCallback;
+ public static $fileLinkFormat;
+ public static $hideSequentialKeys;
+ public static $showClassConstants;
+ public static $keyFilterCallback;
+ public static $displayCalledFrom;
+ public static $charEncodings;
+ public static $maxStrLength;
+ public static $appRootDirs;
+ public static $maxLevels;
+ public static $enabled;
+ public static $theme;
+ public static $expandedByDefault;
+ public static $devel; # todo remove
+
+ protected static $_firstRun = true;
+
+ # non-standard function calls
+ protected static $_statements = array( 'include', 'include_once', 'require', 'require_once' );
+
+ /**
+ * getter/setter for the enabled parameter, called at the beginning of every public function as getter, also
+ * initializes the settings if te first time it's run.
+ *
+ * @param null $value
+ *
+ * @return void|bool
+ */
+ public static function enabled( $value = null )
+ {
+ # act both as a setter...
+ if ( func_num_args() > 0 ) {
+ self::$enabled = $value;
+ return;
+ }
+
+ # ...and a getter
+ return self::$enabled;
+ }
+
+ public static function _init()
+ {
+ # init settings
+ if ( isset( $GLOBALS['_kint_settings'] ) ) {
+ foreach ( $GLOBALS['_kint_settings'] as $key => $val ) {
+ self::$$key = $val;
+ }
+ }
+
+ require KINT_DIR . 'decorators/rich.php';
+ require KINT_DIR . 'decorators/concise.php';
+ }
+
+ /**
+ * Prints a debug backtrace
+ *
+ * @param array $trace [OPTIONAL] you can pass your own trace, otherwise, `debug_backtrace` will be called
+ *
+ * @return void
+ */
+ public static function trace( $trace = null )
+ {
+ if ( !Kint::enabled() ) return;
+
+ echo Kint_Decorators_Rich::_css();
+
+ isset( $trace ) or $trace = debug_backtrace( true );
+
+ $output = array();
+ foreach ( $trace as $step ) {
+ self::$traceCleanupCallback and $step = call_user_func( self::$traceCleanupCallback, $step );
+
+ # if the user defined trace cleanup function returns null, skip this line
+ if ( $step === null ) {
+ continue;
+ }
+
+ if ( !isset( $step['function'] ) ) {
+ # invalid trace step
+ continue;
+ }
+
+ if ( isset( $step['file'] ) AND isset( $step['line'] ) ) {
+ # include the source of this step
+ $source = self::_showSource( $step['file'], $step['line'] );
+ }
+
+ if ( isset( $step['file'] ) ) {
+ $file = $step['file'];
+
+ if ( isset( $step['line'] ) ) {
+ $line = $step['line'];
+ }
+ }
+
+
+ $function = $step['function'];
+
+ if ( in_array( $step['function'], self::$_statements ) ) {
+ if ( empty( $step['args'] ) ) {
+ # no arguments
+ $args = array();
+ } else {
+ # sanitize the file path
+ $args = array( self::shortenPath( $step['args'][0] ) );
+ }
+ } elseif ( isset( $step['args'] ) ) {
+ if ( empty( $step['class'] ) && !function_exists( $step['function'] ) ) {
+ # introspection on closures or language constructs in a stack trace is impossible before PHP 5.3
+ $params = null;
+ } else {
+ try {
+ if ( isset( $step['class'] ) ) {
+ if ( method_exists( $step['class'], $step['function'] ) ) {
+ $reflection = new ReflectionMethod( $step['class'], $step['function'] );
+ } else if ( isset( $step['type'] ) && $step['type'] == '::' ) {
+ $reflection = new ReflectionMethod( $step['class'], '__callStatic' );
+ } else {
+ $reflection = new ReflectionMethod( $step['class'], '__call' );
+ }
+ } else {
+ $reflection = new ReflectionFunction( $step['function'] );
+ }
+
+ # get the function parameters
+ $params = $reflection->getParameters();
+ } catch ( Exception $e ) {
+ $params = null; # avoid various PHP version incompatibilities
+ }
+ }
+
+ $args = array();
+ foreach ( $step['args'] as $i => $arg ) {
+ if ( isset( $params[$i] ) ) {
+ # assign the argument by the parameter name
+ $args[$params[$i]->name] = $arg;
+ } else {
+ # assign the argument by number
+ $args[$i] = $arg;
+ }
+ }
+ }
+
+ if ( isset( $step['class'] ) ) {
+ # Class->method() or Class::method()
+ $function = $step['class'] . $step['type'] . $step['function'];
+ }
+
+ if ( isset( $step['object'] ) ) {
+ $function = $step['class'] . $step['type'] . $step['function'];
+ }
+
+ $output[] = array(
+ 'function' => $function,
+ 'args' => isset( $args ) ? $args : null,
+ 'file' => isset( $file ) ? $file : null,
+ 'line' => isset( $line ) ? $line : null,
+ 'source' => isset( $source ) ? $source : null,
+ 'object' => isset( $step['object'] ) ? $step['object'] : null,
+ );
+
+ unset( $function, $args, $file, $line, $source );
+ }
+
+ require KINT_DIR . 'view/trace.phtml';
+ }
+
+ /**
+ * dump information about variables
+ *
+ * @param mixed $data
+ *
+ * @return void|string
+ */
+ public static function dump( $data = null )
+ {
+ if ( !Kint::enabled() ) return;
+
+ # find caller information
+ $trace = debug_backtrace();
+ list( $names, $modifier, $callee, $previousCaller ) = self::_getPassedNames( $trace );
+ if ( $names === array( null ) && func_num_args() === 1 && $data === 1 ) {
+ $call = reset( $trace );
+ if ( !isset( $call['file'] ) && isset( $call['class'] ) && $call['class'] === __CLASS__ ) {
+ array_shift( $trace );
+ $call = reset( $trace );
+ }
+
+ while ( isset( $call['file'] ) && $call['file'] === __FILE__ ) {
+ array_shift( $trace );
+ $call = reset( $trace );
+ }
+
+ self::trace( $trace );
+ return;
+ }
+
+ # process modifiers: @, + and -
+ switch ( $modifier ) {
+ case '-':
+ self::$_firstRun = true;
+ while ( ob_get_level() ) {
+ ob_end_clean();
+ }
+ break;
+
+ case '!':
+ self::$expandedByDefault = true;
+ break;
+ case '+':
+ $maxLevelsOldValue = self::$maxLevels;
+ self::$maxLevels = false;
+ break;
+ case '@':
+ $firstRunOldValue = self::$_firstRun;
+ self::$_firstRun = true;
+ break;
+ }
+
+
+ $data = func_num_args() === 0
+ ? array( "[[no arguments passed]]" )
+ : func_get_args();
+
+
+ $output = Kint_Decorators_Rich::_css();
+ $output .= Kint_Decorators_Rich::_wrapStart( $callee );
+
+ foreach ( $data as $k => $argument ) {
+ $output .= self::_dump( $argument, $names[$k] );
+ }
+ $output .= Kint_Decorators_Rich::_wrapEnd( $callee, $previousCaller );
+
+ self::$_firstRun = false;
+
+ switch ( $modifier ) {
+ case '+':
+ self::$maxLevels = $maxLevelsOldValue;
+ echo $output;
+ break;
+ case '@':
+ self::$_firstRun = $firstRunOldValue;
+ return $output;
+ break;
+ default:
+ echo $output;
+ break;
+ }
+
+ return '';
+ }
+
+ protected static function _dump( $var, $name = '' )
+ {
+ kintParser::reset();
+ return Kint_Decorators_Rich::decorate(
+ kintParser::factory( $var, $name )
+ );
+ }
+
+
+ /**
+ * generic path display callback, can be configured in the settings
+ *
+ * @param string $file
+ * @param int $line [OPTIONAL]
+ *
+ * @return string
+ */
+ public static function shortenPath( $file, $line = null )
+ {
+ $file = str_replace( '\\', '/', $file );
+ $shortenedName = $file;
+ foreach ( self::$appRootDirs as $path => $replaceString ) {
+ $path = str_replace( '\\', '/', $path );
+
+ if ( strpos( $file, $path ) === 0 ) {
+ $shortenedName = $replaceString . substr( $file, strlen( $path ) );
+ break;
+ }
+ }
+
+
+ if ( !$line ) { # means this is called from resource type dump
+ return $shortenedName;
+ }
+
+ if ( !self::$fileLinkFormat ) {
+ return "{$shortenedName} line <i>{$line}</i>";
+ }
+
+ $url = str_replace( array( '%f', '%l' ), array( $file, $line ), self::$fileLinkFormat );
+ $class = ( strpos( $url, 'http://' ) === 0 ) ? 'class="kint-ide-link"' : '';
+
+ return "<u><a {$class} href=\"{$url}\">{$shortenedName}</a></u> line <i>{$line}</i>";
+ }
+
+
+ /**
+ * trace helper, shows the place in code inline
+ *
+ * @param string $file full path to file
+ * @param int $lineNumber the line to display
+ * @param int $padding surrounding lines to show besides the main one
+ *
+ * @return bool|string
+ */
+ private static function _showSource( $file, $lineNumber, $padding = 7 )
+ {
+ if ( !$file OR !is_readable( $file ) ) {
+ # continuing will cause errors
+ return false;
+ }
+
+ # open the file and set the line position
+ $file = fopen( $file, 'r' );
+ $line = 0;
+
+ # Set the reading range
+ $range = array(
+ 'start' => $lineNumber - $padding,
+ 'end' => $lineNumber + $padding
+ );
+
+ # set the zero-padding amount for line numbers
+ $format = '% ' . strlen( $range['end'] ) . 'd';
+
+ $source = '';
+ while ( ( $row = fgets( $file ) ) !== false ) {
+ # increment the line number
+ if ( ++$line > $range['end'] ) {
+ break;
+ }
+
+ if ( $line >= $range['start'] ) {
+ # make the row safe for output
+ $row = htmlspecialchars( $row, ENT_NOQUOTES );
+
+ # trim whitespace and sanitize the row
+ $row = '<span>' . sprintf( $format, $line ) . '</span> ' . $row;
+
+ if ( $line === $lineNumber ) {
+ # apply highlighting to this row
+ $row = '<div class="kint-highlight">' . $row . '</div>';
+ } else {
+ $row = '<div>' . $row . '</div>';
+ }
+
+ # add to the captured source
+ $source .= $row;
+ }
+ }
+
+ # close the file
+ fclose( $file );
+
+ return $source;
+ }
+
+
+ /**
+ * returns parameter names that the function was passed, as well as any predefined symbols before function
+ * call (modifiers)
+ *
+ * @param array $trace
+ *
+ * @return array( $parameters, $modifier, $callee, $previousCaller )
+ */
+ private static function _getPassedNames( $trace )
+ {
+ $previousCaller = array();
+ while ( $callee = array_pop( $trace ) ) {
+ if ( strtolower( $callee['function'] ) === 'd' ||
+ strtolower( $callee['function'] ) === 'dd' ||
+ ( isset( $callee['class'] ) && strtolower( $callee['class'] ) === strtolower( __CLASS__ )
+ && strtolower( $callee['function'] ) === 'dump' )
+ ) {
+ break;
+ } else {
+ $previousCaller = $callee;
+ }
+ }
+
+ if ( !isset( $callee['file'] ) || !is_readable( $callee['file'] ) ) {
+ return false;
+ }
+
+ # open the file and read it up to the position where the function call expression ended
+ $file = fopen( $callee['file'], 'r' );
+ $line = 0;
+ $source = '';
+ while ( ( $row = fgets( $file ) ) !== false ) {
+ if ( ++$line > $callee['line'] ) break;
+ $source .= $row;
+ }
+ fclose( $file );
+ $source = self::_removeAllButCode( $source );
+
+
+ $codePattern = empty( $callee['class'] )
+ ? $callee['function']
+ : $callee['class'] . "\x07*" . $callee['type'] . "\x07*" . $callee['function'];
+ # get the position of the last call to the function
+ preg_match_all( "#[\x07{(](\\+|-|!|@)?{$codePattern}\x07*(\\()#i", $source, $matches, PREG_OFFSET_CAPTURE );
+ $match = end( $matches[2] );
+ $modifier = end( $matches[1] );
+ $modifier = $modifier[0];
+
+ $passedParameters = str_replace( "\x07", '', substr( $source, $match[1] + 1 ) );
+ # we now have a string like this:
+ # <parameters passed>); <the rest of the last read line>
+
+ # remove everything in brackets and quotes, we don't need nested statements nor literal strings which would
+ # only complicate separating individual arguments
+ $c = strlen( $passedParameters );
+ $inString = $escaped = false;
+ $i = 0;
+ $inBrackets = 0;
+ while ( $i < $c ) {
+ $letter = $passedParameters[$i];
+ if ( $inString === false ) {
+ if ( $letter === '\'' || $letter === '"' ) {
+ $inString = $letter;
+ } elseif ( $letter === '(' ) {
+ $inBrackets++;
+ } elseif ( $letter === ')' ) {
+ $inBrackets--;
+ if ( $inBrackets === -1 ) { # this means we are out of the brackets that denote passed parameters
+ $passedParameters = substr( $passedParameters, 0, $i );
+ break;
+ }
+ }
+ } elseif ( $letter === $inString && !$escaped ) {
+ $inString = false;
+ }
+
+ # place an untype-able character instead of whatever was inside quotes or brackets, we don't
+ # need that info. We'll later replace it with '...'
+ if ( $inBrackets > 0 ) {
+ if ( $inBrackets > 1 || $letter !== '(' ) {
+ $passedParameters[$i] = "\x07";
+ }
+ }
+ if ( $inString !== false ) {
+ if ( $letter !== $inString || $escaped ) {
+ $passedParameters[$i] = "\x07";
+ }
+ }
+
+ $escaped = !$escaped && ( $letter === '\\' );
+ $i++;
+ }
+
+ # by now we have an unnested arguments list, lets make it to an array for processing further
+ $arguments = explode( ',', preg_replace( "#\x07+#", '...', $passedParameters ) );
+
+ # test each argument whether it was passed literary or was it an expression or a variable name
+ $parameters = array();
+ $blacklist = array( 'null', 'true', 'false', 'array(...)', 'array()', '"..."', 'b"..."', );
+ foreach ( $arguments as $argument ) {
+
+ if ( is_numeric( $argument )
+ || in_array( str_replace( "'", '"', strtolower( $argument ) ), $blacklist, true )
+ ) {
+ $parameters[] = null;
+ } else {
+ $parameters[] = trim( $argument );
+ }
+ }
+
+ return array( $parameters, $modifier, $callee, $previousCaller );
+ }
+
+ /**
+ * removes comments and zaps whitespace & <?php tags from php code, makes for easier further parsing
+ *
+ * @param string $source
+ *
+ * @return string
+ */
+ private static function _removeAllButCode( $source )
+ {
+ $newStr = '';
+ $tokens = token_get_all( $source );
+ $commentTokens = array( T_COMMENT => true, T_INLINE_HTML => true, T_DOC_COMMENT => true );
+
+ defined( 'T_NS_SEPARATOR' ) or define( 'T_NS_SEPARATOR', 380 );
+
+ $whiteSpaceTokens = array(
+ T_WHITESPACE => true, T_CLOSE_TAG => true,
+ T_OPEN_TAG => true, T_OPEN_TAG_WITH_ECHO => true,
+ );
+
+ foreach ( $tokens as $token ) {
+ if ( is_array( $token ) ) {
+ if ( isset( $commentTokens[$token[0]] ) ) continue;
+
+ if ( $token[0] === T_NEW ) {
+ $token = 'new ';
+ } elseif ( $token[0] === T_NS_SEPARATOR ) {
+ $token = "\\\x07";
+ } elseif ( isset( $whiteSpaceTokens[$token[0]] ) ) {
+ $token = "\x07";
+ } else {
+ $token = $token[1];
+ }
+ } elseif ( $token === ';' ) {
+ $token = "\x07";
+ }
+
+ $newStr .= $token;
+ }
+ return $newStr;
+ }
+}
+
+
+if ( !function_exists( 'd' ) ) {
+ /**
+ * Alias of Kint::dump()
+ *
+ * @return string
+ */
+ function d()
+ {
+ if ( !Kint::enabled() ) return null;
+
+ $args = func_get_args();
+ return call_user_func_array( array( 'Kint', 'dump' ), $args );
+ }
+}
+
+if ( !function_exists( 'dd' ) ) {
+ /**
+ * Alias of Kint::dump()
+ * [!!!] IMPORTANT: execution will halt after call to this function
+ *
+ * @return string
+ */
+ function dd()
+ {
+ if ( !Kint::enabled() ) return;
+
+ $args = func_get_args();
+ call_user_func_array( array( 'Kint', 'dump' ), $args );
+ die;
+ }
+}
+
+if ( !function_exists( 's' ) ) {
+
+ /**
+ * Alias of kintLite()
+ *
+ * @return string
+ */
+ function s()
+ {
+ if ( !Kint::enabled() ) return;
+
+ $argv = func_get_args();
+ echo '<pre>';
+ foreach ( $argv as $k => $v ) {
+ $k && print( "\n\n" );
+ echo kintLite( $v );
+ }
+ echo '</pre>' . "\n";
+ }
+
+ /**
+ * Alias of kintLite()
+ * [!!!] IMPORTANT: execution will halt after call to this function
+ *
+ * @return string
+ */
+ function sd()
+ {
+ if ( !Kint::enabled() ) return;
+
+ echo '<pre>';
+ foreach ( func_get_args() as $k => $v ) {
+ $k && print( "\n\n" );
+ echo kintLite( $v );
+ }
+ echo '</pre>';
+ die;
+
+ }
+
+}
+
+
+/**
+ * lightweight version of Kint::dump(). Uses whitespace for formatting instead of html
+ * sadly not DRY yet
+ *
+ * @param $var
+ * @param int $level
+ *
+ * @return string
+ */
+function kintLite( &$var, $level = 0 )
+{
+
+ // initialize function names into variables for prettier string output (html and implode are also DRY)
+ $html = "htmlspecialchars";
+ $implode = "implode";
+ $strlen = "strlen";
+ $count = "count";
+ $getClass = "get_class";
+
+
+ if ( $var === null ) {
+ return 'NULL';
+ } elseif ( is_bool( $var ) ) {
+ return 'bool ' . ( $var ? 'TRUE' : 'FALSE' );
+ } elseif ( is_float( $var ) ) {
+ return 'float ' . $var;
+ } elseif ( is_int( $var ) ) {
+ return 'integer ' . $var;
+ } elseif ( is_resource( $var ) ) {
+ if ( ( $type = get_resource_type( $var ) ) === 'stream' AND $meta = stream_get_meta_data( $var ) ) {
+
+ if ( isset( $meta['uri'] ) ) {
+ $file = $meta['uri'];
+
+ return "resource ({$type}) {$html( $file, 0 )}";
+ } else {
+ return "resource ({$type})";
+ }
+ } else {
+ return "resource ({$type})";
+ }
+ } elseif ( is_string( $var ) ) {
+ return "string ({$strlen( $var )}) \"{$html( $var )}\"";
+ } elseif ( is_array( $var ) ) {
+ $output = array();
+ $space = str_repeat( $s = ' ', $level );
+
+ static $marker;
+
+ if ( $marker === null ) {
+ // Make a unique marker
+ $marker = uniqid( "\x00" );
+ }
+
+ if ( empty( $var ) ) {
+ return "array()";
+ } elseif ( isset( $var[$marker] ) ) {
+ $output[] = "[\n$space$s*RECURSION*\n$space]";
+ } elseif ( $level < 7 ) {
+ $isSeq = array_keys( $var ) === range( 0, count( $var ) - 1 );
+
+ $output[] = "[";
+
+ $var[$marker] = true;
+
+
+ foreach ( $var as $key => &$val ) {
+ if ( $key === $marker ) continue;
+
+ $key = $space . $s . ( $isSeq ? "" : "'{$html( $key, 0 )}' => " );
+
+ $dump = kintLite( $val, $level + 1 );
+ $output[] = "{$key}{$dump}";
+ }
+
+ unset( $var[$marker] );
+ $output[] = "$space]";
+
+ } else {
+ $output[] = "[\n$space$s*depth too great*\n$space]";
+ }
+ return "array({$count( $var )}) {$implode( "\n", $output )}";
+ } elseif ( is_object( $var ) ) {
+ if ( $var instanceof SplFileInfo ) {
+ return "object SplFileInfo " . $var->getRealPath();
+ }
+
+ // Copy the object as an array
+ $array = (array)$var;
+
+ $output = array();
+ $space = str_repeat( $s = ' ', $level );
+
+ $hash = spl_object_hash( $var );
+
+ // Objects that are being dumped
+ static $objects = array();
+
+ if ( empty( $array ) ) {
+ return "object {$getClass( $var )} {}";
+ } elseif ( isset( $objects[$hash] ) ) {
+ $output[] = "{\n$space$s*RECURSION*\n$space}";
+ } elseif ( $level < 7 ) {
+ $output[] = "{";
+ $objects[$hash] = true;
+
+ foreach ( $array as $key => & $val ) {
+ if ( $key[0] === "\x00" ) {
+
+ $access = $key[1] === "*" ? "protected" : "private";
+
+ // Remove the access level from the variable name
+ $key = substr( $key, strrpos( $key, "\x00" ) + 1 );
+ } else {
+ $access = "public";
+ }
+
+ $output[] = "$space$s$access $key -> " . kintLite( $val, $level + 1 );
+ }
+ unset( $objects[$hash] );
+ $output[] = "$space}";
+
+ } else {
+ $output[] = "{\n$space$s*depth too great*\n$space}";
+ }
+
+ return "object {$getClass( $var )} ({$count( $array )}) {$implode( "\n", $output )}";
+ } else {
+ return gettype( $var ) . htmlspecialchars( var_export( $var, true ), ENT_NOQUOTES );
+ }
+}
+
+Kint::_init();
Added: trunk/catalog/includes/kint/LICENCE
===================================================================
--- trunk/catalog/includes/kint/LICENCE (rev 0)
+++ trunk/catalog/includes/kint/LICENCE 2014-09-18 22:21:22 UTC (rev 5236)
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Rokas Šleinius (ra...@gm...)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
Added: trunk/catalog/includes/kint/README.md
===================================================================
--- trunk/catalog/includes/kint/README.md (rev 0)
+++ trunk/catalog/includes/kint/README.md 2014-09-18 22:21:22 UTC (rev 5236)
@@ -0,0 +1,62 @@
+# Kint - debugging helper for PHP developers
+
+[](https://packagist.org/packages/raveren/kint)
+
+http://raveren.github.com/kint/
+
+
+
+Kint for PHP is a powerful and modern, zero-setup replacement for **[var_dump()](http://php.net/manual/en/function.var-dump.php)**, **[print_r()](http://php.net/manual/en/function.print-r.php)** and **[debug_backtrace()](http://php.net/manual/en/function.debug-backtrace.php)**. You'll wonder how you developed without it.
+
+
+----
+
+
+## Installation and usage
+```php
+<?php
+require '/kint/Kint.class.php';
+
+########## DUMP VARIABLE ###########################
+Kint::dump($GLOBALS, $_SERVER); // any nuber of parameters
+// or simply use d() as a shorthand:
+d($_SERVER);
+
+
+########## DEBUG BACKTRACE #########################
+Kint::trace();
+// or via shorthand:
+d(1);
+
+
+########## TEXT-ONLY OUTPUT ########################
+s($GLOBALS);
+
+
+########## MISCELLANEOUS ###########################
+// to disable all output
+Kint::enabled(false);
+// further calls, this one included, will not yield any output
+d('Get off my lawn!'); // no effect
+
+```
+
+### Furthermore
+
+* `sd()` and `dd()` are shorthands for `s();die;` and `d();die;` respectively.
+* `!Kint::dump()` and `!dd()` will display the dump expanded by default.
+
+----
+
+
+[Visit the project page](http://raveren.github.com/kint/) for documentation, configuration, and more advanced usage examples.
+
+### Author
+
+**Rokas Šleinius** (Raveren)
+
+
+
+### License
+
+Licensed under the MIT License
\ No newline at end of file
Added: trunk/catalog/includes/kint/composer.json
===================================================================
--- trunk/catalog/includes/kint/composer.json (rev 0)
+++ trunk/catalog/includes/kint/composer.json 2014-09-18 22:21:22 UTC (rev 5236)
@@ -0,0 +1,24 @@
+{
+ "name": "raveren/kint",
+ "description": "Kint - debugging helper for PHP developers",
+ "keywords": ["kint", "php", "debug"],
+ "type": "library",
+ "homepage": "https://github.com/raveren/kint",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Rokas Šleinius",
+ "homepage": "https://github.com/raveren"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/raveren/kint/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=5.2.0"
+ },
+ "autoload": {
+ "files": ["Kint.class.php"]
+ }
+}
\ No newline at end of file
Added: trunk/catalog/includes/kint/config.default.php
===================================================================
--- trunk/catalog/includes/kint/config.default.php (rev 0)
+++ trunk/catalog/includes/kint/config.default.php 2014-09-18 22:21:22 UTC (rev 5236)
@@ -0,0 +1,130 @@
+<?php
+isset( $GLOBALS['_kint_settings'] ) or $GLOBALS['_kint_settings'] = array();
+$_kintSettings = &$GLOBALS['_kint_settings'];
+
+
+/** @var bool if set to false, kint will become silent, same as Kint::enabled(false) or Kint::$enabled = false */
+$_kintSettings['enabled'] = true;
+
+
+/**
+ * @var bool whether to display where kint was called from
+ */
+$_kintSettings['displayCalledFrom'] = true;
+
+
+/**
+ * @var string format of the link to the source file in trace entries. Use %f for file path, %l for line number.
+ * Defaults to xdebug.file_link_format if not set.
+ *
+ * [!] EXAMPLE (works with for phpStorm and RemoteCall Plugin):
+ *
+ * $_kintSettings['fileLinkFormat'] = 'http://localhost:8091/?message=%f:%l';
+ *
+ */
+$_kintSettings['fileLinkFormat'] = ini_get( 'xdebug.file_link_format' );
+
+
+/**
+ * @var array base directories of your application that will be displayed instead of the full path. Keys are paths,
+ * values are replacement strings
+ *
+ * Defaults to array( $_SERVER['DOCUMENT_ROOT'] => '<ROOT>' )
+ *
+ * [!] EXAMPLE (for Kohana framework):
+ *
+ * $_kintSettings['appRootDirs'] = array(
+ * APPPATH => 'APPPATH', // make sure the constants are already defined at the time of including this config file
+ * SYSPATH => 'SYSPATH',
+ * MODPATH => 'MODPATH',
+ * DOCROOT => 'DOCROOT',
+ * );
+ *
+ * [!] EXAMPLE #2 (for a semi-universal approach)
+ *
+ * $_kintSettings['appRootDirs'] = array(
+ * realpath( __DIR__ . '/../../..' ) => 'ROOT', // go up as many levels as needed in the realpath() param
+ * );
+ *
+ * $_kintSettings['fileLinkFormat'] = 'http://localhost:8091/?message=%f:%l';
+ *
+ */
+$_kintSettings['appRootDirs'] = array(
+ $_SERVER['DOCUMENT_ROOT'] => '<ROOT>'
+);
+
+
+/**
+ * @var callable|null
+ *
+ * @param array $step each step of the backtrace is passed to this callback to clean it up or skip it entirely
+ *
+ * @return array|null you can return null if you want to bypass outputting this step
+ *
+ * [!] EXAMPLE:
+ *
+ * $_kintSettings['traceCleanupCallback'] = function( $traceStep ) {
+ * if ( isset( $traceStep['class'] ) && strtolower( $traceStep['class'] ) === 'errorHandler' ) {
+ * return null;
+ * }
+ *
+ * if ( isset( $traceStep['function'] ) && strtolower( $traceStep['function'] ) === '__tostring' ) {
+ * $traceStep['function'] = "[object converted to string]";
+ * }
+ *
+ * return $traceStep;
+ * };
+ */
+$_kintSettings['traceCleanupCallback'] = null;
+
+
+/** @var int max length of string before it is truncated and displayed separately in full. Z...
[truncated message content] |