|
From: <os...@us...> - 2011-12-18 21:41:16
|
Revision: 3973
http://oscss.svn.sourceforge.net/oscss/?rev=3973&view=rev
Author: oscim
Date: 2011-12-18 21:41:08 +0000 (Sun, 18 Dec 2011)
Log Message:
-----------
Suite correction et report utilisation valeur pre calcul?\195?\169 dans les class et module
Suite am?\195?\169lioration gestion du block de develop
Mise a niveau de tous les module non typ?\195?\169 pour une utilisation syst?\195?\169matique des drivers de data
Ajout d'une information sur le type de donn?\195?\169es que retourne le module
Correction ds drivers de data
Force activation du block develop lors de l'installation d'un template pre-installl?\195?\169
Modified Paths:
--------------
trunk/catalog/includes/classes/category_tree.php
trunk/catalog/includes/classes/core_page/develop.php
trunk/catalog/includes/classes/drivers/data/categorie.php
trunk/catalog/includes/classes/drivers/data/content.php
trunk/catalog/includes/classes/drivers/data/product.php
trunk/catalog/includes/classes/messageStack.php
trunk/catalog/includes/classes/page.php
trunk/catalog/includes/modules/also_purchased_products.php
trunk/catalog/includes/modules/listing_cat.php
trunk/catalog/includes/modules/listing_manufacturer_products.php
trunk/catalog/includes/modules/listing_pages.php
trunk/catalog/includes/modules/new_products.php
trunk/catalog/includes/modules/product_listing.php
trunk/catalog/includes/modules/upcoming_products.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/Childs_tpl/module.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/cfg/init.php
trunk/catalog/install/data/templates/appareil_photo/electronix/cfg/init.php
Modified: trunk/catalog/includes/classes/category_tree.php
===================================================================
--- trunk/catalog/includes/classes/category_tree.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/classes/category_tree.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -3,8 +3,8 @@
*\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 28/11/10, 08:18
+ *\version 2.1.1
+ *\date 18/12/11, 08:18
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\group boxes
@@ -14,7 +14,7 @@
Menu des catégories
- add NOT_RECUP_CASSE_IN_TXT_CATEGORIES Actif par defaut @a Hors-constructeur
-
+
TODO: End comment code / oscim 30//11/2010
*/
@@ -62,7 +62,7 @@
categorie::add_where_query(" and c.categories_hidden='1' ");
$list = categorie::get_query('','','',array('limit'=>0));
foreach($list as $categories)
- $this->data[$categories->parent_id][$categories->categories_id] = array('name' => $categories->categories_name, 'count' => 0);
+ $this->data[$categories->parent_id][$categories->categories_id] = array('href' => $categories->href, 'name' => $categories->categories_name, 'count' => 0);
if ($this->show_category_product_count === true) $this->calculateCategoryProductCount();
@@ -105,7 +105,7 @@
if ($level == 0 ||(isset($this->data[$category_id]) ) ) $result .= sprintf($this->root_start_string,' class="cat'.$parent_id.'_'.$category_id.'" ') ;
else $result .= $this->child_start_string ;
- $result .= str_repeat($this->spacer_string, $this->spacer_multiplier * $level) . '<a title="'. $category['name'] .'" href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link ) . '">';
+ $result .= str_repeat($this->spacer_string, $this->spacer_multiplier * $level) . '<a title="'. $category['name'] .'" href="' . $category['href'] . '">';
if ($this->follow_cpath === true) {
if (in_array($category_id, $this->cpath_array)) $result .= $this->cpath_start_string . $category['name'] . $this->cpath_end_string;
@@ -177,7 +177,7 @@
/**
* \fn buildBreadcrumb($category_id, $level = 0)
- * @param $category_id int
+ * @param $category_id int
* @param $level int
*/
private function buildBreadcrumb($category_id, $level = 0) {
@@ -277,8 +277,8 @@
/**
* \brief Encapsulation item Root
- * @param $parent_start_string string
- * @param $parent_end_string string
+ * @param $parent_start_string string
+ * @param $parent_end_string string
*/
public function setParentString($parent_start_string, $parent_end_string) {
$this->parent_start_string = $parent_start_string;
@@ -288,7 +288,7 @@
/**
* \brief Encapsulation Parent
* @param $parent_group_start_string string
- * @param $parent_group_end_string string
+ * @param $parent_group_end_string string
*/
public function setParentGroupString($parent_group_start_string, $parent_group_end_string) {
$this->parent_group_start_string = $parent_group_start_string;
@@ -296,12 +296,12 @@
}
/**
-
+
*/
/**
* \brief Encapsulation item parent
* @param $child_start_string string
- * @param $child_end_string string
+ * @param $child_end_string string
*/
public function setChildString($child_start_string, $child_end_string) {
$this->child_start_string = $child_start_string;
@@ -309,7 +309,7 @@
}
/**
- * \fn setBreadcrumbSeparator($breadcrumb_separator)
+ * \fn setBreadcrumbSeparator($breadcrumb_separator)
* @param $breadcrumb_separator string
*/
public function setBreadcrumbSeparator($breadcrumb_separator) {
@@ -317,7 +317,7 @@
}
/**
- * \fn setBreadcrumbUsage($breadcrumb_usage)
+ * \fn setBreadcrumbUsage($breadcrumb_usage)
* @param $breadcrumb_usage
*/
public function setBreadcrumbUsage($breadcrumb_usage) {
Modified: trunk/catalog/includes/classes/core_page/develop.php
===================================================================
--- trunk/catalog/includes/classes/core_page/develop.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/classes/core_page/develop.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -42,27 +42,69 @@
}
$li.='</ul>';
+// print_r($page->oscss_plugins);
/// list all plugins
$p_li='This list load plugins in current page'.
- '<ul>';
+ '<ul><li><h4> type generic </h4>';
reset($page->page['plugins']);
- if(isset($page->page['plugins']['actif']) && is_array($page->page['plugins']['actif']))
- while($r=each($page->page['plugins']['actif'])){
- $p_li .='<li><h5>'.$r['value'].'</h5>'
- .'</li>';
- }
- $p_li.='';
+ if(isset($page->page['plugins']['present']) && is_array($page->page['plugins']['present'])) {
+ // for type generic plugins auto load
+ $p_li.='<ul>';
+ foreach($page->page['plugins']['present'] as $row) {
+ if($row)
+ $p_li .='<li><h5>'.$row.'</h5>'
+ .(in_array($row,$page->page['plugins']['actif'])? 'actived' : 'not actived')
+ .'</li>';
+ }
+ $p_li.='</ul>';
+ }
+ $p_li.='</li>';
+ // for type page plugins auto load
+ $p_li.='<li><h4> type '.$page->page['type'].'</h4>';
+ if(isset($page->page['plugins']['type']) && is_array($page->page['plugins']['type'])){
+ $p_li.='<ul>';
+ foreach($page->page['plugins']['type'] as $row) {
+ if($row)
+ $p_li .='<li><h5>'.$row.'</h5>'
+ .(in_array($row,$page->page['plugins']['actif'])? 'actived' : 'not actived')
+ .'</li>';
+ }
+ $p_li.='</ul>';
+ }
+ $p_li.='</li>';
+ $p_li.='</ul>';
+
+
+ /// SEO alert
+ $seo = 'This list load current page detect meta'.
+ '<ul>';
+ $seo.='<li><h5> script content </h5> '.$page->page['seo_url']['path'].'</li>';
+ $seo.='<li><h5> script query_string </h5> '.$page->page['seo_url']['query_string'].'</li>';
+
+ if(count($page->page['seo_url']['result']) > 0 )
+ foreach($page->page['seo_url']['result'] as $key=>$row){
+ $seo .='<li><h5>'.$key.'</h5> '.$row.'</li>';
+ }
+ $seo.='<li><h5> meta and title no found </h5></li>';
+ $seo.='</ul>';
+
+
+// print_r($page->page['seo_url']);
+
/// list all boxes
reset($page->page['boxes']);
$c_li='This list load boxes in current page'.
'<ul>';
- while($r=each($page->page['boxes'])){
- $b=each($r['value']);
- $c_li .='<li><h5>'.$b['key'].'</h5>'
+// while($r=each($page->page['boxes']['list'])){
+foreach($page->page['boxes']['list'] as $key=>$row){
+// $b=each($row['value']);
+ $c_li .='<li><h5>'.$key.'</h5>'
.'<ul>'
- .'<li>-- class de boite:'.$r['key'].'</li>'
+// .'<li>-- class box : '.$row['key'].'</li>'
+ .'<li>-- name :'.$row->name.'</li>'
+ .'<li>-- path file:'.$row->path.'</li>'
.'</ul></li>';
}
$c_li.='</ul>';
@@ -73,11 +115,12 @@
reset($page->page['file_gabarits']);
if(isset($page->page['file_gabarits']))
foreach($page->page['file_gabarits'] as $value){
- $gabartis_li .='<li><h5>'.$value.'</h5>'
+ $gabartis_li .='<li><h5>'.str_replace(DIR_FS_CATALOG,'',$value).'</h5>'
.'</li>';
}
$gabartis_li.='</ul>';
+ /// garbage collector
$phperrors ='This list php errors in current page. this errors is not visible and is for debugg solution'.
'<table>';
if(OSCSS_GARBAGE_ERROR == true)
@@ -88,64 +131,74 @@
}
$phperrors.='</table>';
+ /// Master menu popup
+ $MenuBox ='<ul>'.
+ '<li><a href="#" onclick="ViewData(\'NormalInfo\');return false; " > Normal Info </a></li>'.
+// '<li><a href="#" onclick="ViewData(\'SEO\');return false; " > Seo </a></li>'.
+ '<li><a href="#" onclick="ViewData(\'ModNoType\');return false; " > Module No type </a></li>'.
+ '<li><a href="#" onclick="ViewData(\'BoxAll\');return false; " > Boxes </a></li>'.
+ '<li><a href="#" onclick="ViewData(\'Gabartis\');return false; " > Files (.gab) </a></li>'.
+ '<li><a href="#" onclick="ViewData(\'Plugins\');return false; " > Plugins </a></li>'.
+// '<li><a href="#" onclick="ViewData(\'Errors\');return false; " > Errors </a></li>'.
+ '<li><a href="#" onclick="ViewData(\'CoreAlert\');return false; " > Core Alerts </a></li>'.
- $MenuBox ='<ul>'.
-'<li><a href="#" onclick="ViewData(\'NormalInfo\');return false; " > Normal Info </a></li>'.
-'<li><a href="#" onclick="ViewData(\'ModNoType\');return false; " > Module No type </a></li>'.
-'<li><a href="#" onclick="ViewData(\'BoxAll\');return false; " > Boxes </a></li>'.
-'<li><a href="#" onclick="ViewData(\'Gabartis\');return false; " > Files (.gab) </a></li>'.
-'<li><a href="#" onclick="ViewData(\'Plugins\');return false; " > Plugins </a></li>'.
-'<li><a href="#" onclick="ViewData(\'Errors\');return false; " > Errors </a></li>'.
-'<li><a href="#" onclick="ViewData(\'CoreAlert\');return false; " > Core Alerts </a></li>'.
-'</ul>';
+ '</ul>';
-$InfoBox .=''
- . '<p><span style="font-weight:bold;">Current language :</span> '.$page->page['language'].'</p>'
- .'<p><span style="font-weight:bold;">Current type page :</span> '.$page->page['type'].'</p>'
- .'<p><span style="font-weight:bold;">Current type classes page :</span> '.$page->page['class'].'</p>'
-.'';
+ /// Normal Info
+ $InfoBox .=''
+ . '<p><span style="font-weight:bold;">Current language :</span> '.$page->page['language'].'</p>'
+ .'<p><span style="font-weight:bold;">Current type page :</span> '.$page->page['type'].'</p>'
+ .'<p><span style="font-weight:bold;">Current type classes page :</span> '.$page->page['class'].'</p>'
+ .'';
+ /// PRINT block menu One
print '<div id="develop" class="develop">'.
'<h4>Frontend Develop Menu - <a href="#" onclick="ViewData(\'Help\');return false; " title="view detail">(help)</a></h4>'.
- '<p> <a href="#" onclick="ViewData(\'NormalInfo\');return false; " title="view detail"> Box Dev Info </a> '.
- ( ( ($val = $mock->is_count()) >0 )? '<a style="color:red" href="#" onclick="ViewData(\'Errors\');return false; " title="View Error"> php ('.$val.') </a>' : '' ).
+ '<p> <a href="#" onclick="ViewData(\'NormalInfo\');return false; " title="view detail"> Popup Dev Info </a> '.
+
'</p>'.
'<p><span style="font-weight:bold;">Theme: </span>'.$page->page['template'].'</p>'.
'<p><span style="font-weight:bold;">Script : <a href="#" title="page racine">(i)</a></span> '.$page->page['script'].'</p>'.
'<p><span style="font-weight:bold;">Content: <a href="#" title="le contenu principal de la page ne cours">(i)</a></span> <a href="#" title="'.@$page->page['path_content'].'">(i)</a>'.@$page->page['content'].'</p>'.
'<p><span style="font-weight:bold;">Gabarit:</span> '. $page->page['gabarit'].'</p>'.
-
+'<ul>'.
+( ( ($val = $mock->is_count()) >0 )? '<li><a style="color:red" href="#" onclick="ViewData(\'Errors\');return false; " title="View Php Error">php('.$val.')</a></li>' : '' ).
+( ( ($val2 = $page->messageStack->size()) >0 )? '<li><a style="color:red" href="#" onclick="ViewData(\'CoreAlert\');return false; " title="View Core Alert">Core('.$val2.')</a></li>' : '' ).
+( ( ( count($page->page['seo_url']['result']) )<3 )? '<li><a style="color:red" href="#" onclick="ViewData(\'SEO\');return false; " title="View Core Alert">SEO ('.(3 - count($page->page['seo_url']['result']) ) .')</a></li>' : '' ).
+'</ul>'.
''
;
print '</div>';
-
/// box block use js for draw
print '<div id="view-box" class="develop">'.
' <div id="DevTopbar" class="DevBar">Develop Box infos <a href="#" onclick="CloseBoxDev(); return false;">X</a></div>'.
' <div id="DevBottombar" class="DevBar">'.$MenuBox .'</div>'.
- ' <div id="NormalInfo" class="TextDevelop">'.$InfoBox.'</div>'.
- ' <div id="ModNoType" class="TextDevelop">'.$li .'</div>'.
- ' <div id="BoxAll" class="TextDevelop">'.$c_li .'</div>'.
- ' <div id="Plugins" class="TextDevelop">'.$p_li .'</div>'.
- ' <div id="Gabartis" class="TextDevelop">'.$gabartis_li .'</div>'.
+ ' <div id="DevContent" >'.
+ ' <div id="NormalInfo" class="TextDevelop">'.$InfoBox.'</div>'.
+ ' <div id="ModNoType" class="TextDevelop">'.$li .'</div>'.
+ ' <div id="BoxAll" class="TextDevelop">'.$c_li .'</div>'.
+ ' <div id="Plugins" class="TextDevelop">'.$p_li .'</div>'.
+ ' <div id="Gabartis" class="TextDevelop">'.$gabartis_li .'</div>'.
+ ' <div id="SEO" class="TextDevelop">'.$seo.'</div>'.
- ' <div id="CoreAlert" class="TextDevelop"> This list message not called and generated by core '.$page->messageStack->_draw() .'</div>'.
- ' <div id="Errors" class="TextDevelop">'.$phperrors .'</div>'.
+ ' <div id="CoreAlert" class="TextDevelop"> This list message not called and generated by core '.$page->messageStack->_draw() .'</div>'.
+ ' <div id="Errors" class="TextDevelop">'.$phperrors .'</div>'.
- ' <div id="Help" class="TextDevelop">
-<h5>Help this block develop</h5>
-<p> If you\'r closed this block (and block menu in left window),
-go in file and edit cfg/init.php <br />
+ ' <div id="Help" class="TextDevelop">
+ <h5>Help this block develop</h5>
+ <p> If you\'r closed this block (and block menu in left window),
+ go in file and edit cfg/init.php <br />
-search and replace "true" by "false"
-<pre>$this->add_var_page(\'develop\',\'false\');</pre>
-<br />
+ search and replace "true" by "false"
+ <pre>$this->add_var_page(\'develop\',\'false\');</pre>
+ <br />
-</p>
- </div>'.
+ </p>
+ </div>'.
+ '</div>'.
'</div>';
@@ -154,18 +207,25 @@
/* DEB Block debugg public template */
#develop{
- opacity:0.4;
- filter:alpha(opacity=40); /* For IE8 and earlier */
+ opacity:0.5;
+ filter:alpha(opacity=50); /* For IE8 and earlier */
color:black;
line-height:17px;
- background:white none repeat scroll 0 0
- ; border:1px solid black;
+ background:white none repeat scroll 0 0;
+ border:1px solid black;
padding:1em;
position:fixed;
right:0;
top:0;
+ font-size:14px;
+ padding:3px; margin:0;
}
#develop p {padding:0; margin:0;}
+ #develop a {font-size:13px}
+ #develop a:hover{
+ opacity:0.8;
+ filter:alpha(opacity=80); /* For IE8 and earlier */
+ }
#view-box {
position:absolute;
@@ -176,6 +236,7 @@
background:white;
border:2px solid black;
}
+ #DevContent{clear:both;display:block;position:relative;width:100%;min-height:250px;height:100%;overflow:auto;}
#view-box .DevBar {width:100%; height:25px; text-align:center; background:black; color:white;}
#view-box .DevBar ul *{display:inline-block;}
#view-box #DevTopbar a{text-align:right; font-size:20px; color:white; float: right;padding:2px 5px;}
@@ -183,9 +244,12 @@
#view-box #DevBottombar {position:relative; bottom:0; }
#view-box #DevBottombar ul li {padding:2px 5px; border-left: 1px solid white}
- #view-box #DevBottombar a {color:white;}
+ #view-box #DevBottombar a {color:white; font-size:13px;}
#view-box #DevBottombar a:hover {color:gray;}
- #view-box .TextDevelop {padding:1em;overflow:auto;}
+ #view-box .TextDevelop {min-height: 300px;height: 300px;
+ overflow: auto;
+ padding: 1em;
+ position: relative;}
/* END Block debugg public template */
</style>
Modified: trunk/catalog/includes/classes/drivers/data/categorie.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/categorie.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/classes/drivers/data/categorie.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -4,7 +4,7 @@
\portion code Copyright (c) 2002 osCommerce
\package osCSS-2 <www http://www.oscss.org>
\version 2.1.1
- \date 29/11/11, 11:33
+ \date 18/12/11, 11:33
\author oscim <mail aur...@os...> <www http://www.oscim.fr>
\encode UTF-8
@@ -59,7 +59,7 @@
public static function get_count_products_in_category($category_id, $include_inactive = false){ return categorieData::get_count_products_in_category($category_id,$include_inactive); }
public static function get_count_content_in_category($category_id){ return categorieData::get_count_content_in_category($category_id); }
public static function get_has_category_subcategories($category_id){ return categorieData::get_has_category_subcategories($category_id); }
- public static function get_parent_categories(&$categories, $categories_id) { return categorieData::get_parent_categories($categories, $categories_id); }
+ public static function get_parent_categories($categories, $categories_id) { return categorieData::get_parent_categories($categories, $categories_id); }
public static function get_subcategories(&$subcategories_array, $parent_id = 0){ return categorieData::get_subcategories($subcategories_array, $parent_id); }
public static function get_categories($categories_array = '', $parent_id = '0', $indent = '') { return categorieData::get_categories($categories_array , $parent_id, $indent); }
@@ -164,7 +164,7 @@
if(count(self::$cache)>0 && in_array($content['categories_id'],self::$cache) ) $tabl[$content['categories_id']]=self::$object_data[$content['categories_id']];
elseif (!in_array($content['categories_name'],$exclude)) {
$res=$content;
- $res['href']=tep_href_link(FILENAME_PRODUCT_INFO,'categories_id=' . $content['categories_id'] );
+ $res['href']=tep_href_link(FILENAME_DEFAULT,'cPath=' . $content['categories_id'] );
$res['key']=$content['categories_id'];
$res['id']=$content['categories_id'];
$res['title']=$content['categories_name'];
@@ -269,7 +269,7 @@
if (tep_not_null($current_category_id)) {
// $cPath_array = array();
- $cPath_array = self::get_parent_categories($cPath_array, $current_category_id) ;
+ $cPath_array = self::get_parent_categories(array(), $current_category_id) ;
$cPath_array[] = $current_category_id;
$cPath_new = implode('_', $cPath_array);
}
@@ -366,7 +366,8 @@
if(!isset(self::$object_data[$categories_id]->parent_array)) {
$db_list=self::get_query((int)$categories_id);
foreach($db_list as $cats) {
- if ($cats->parent_id == 0) return true;
+ if ($cats->parent_id == 0)
+ return array();
$categories[sizeof($categories)] = $cats->parent_id;
if ($cats->parent_id != $categories_id) {
$categories = self::get_parent_categories($categories, $cats->parent_id);
Modified: trunk/catalog/includes/classes/drivers/data/content.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/content.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/classes/drivers/data/content.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -177,6 +177,7 @@
while ($content = $content_query->fetchAssoc()) {
if (!in_array($content['name'],$exclude)) {
$res=$content;
+
$res['href']=tep_href_link(FILENAME_CONTENT,'content=' . $content['id']);
$res['key']=$content['name'];
$res['original']=$content['text'];
@@ -368,11 +369,8 @@
if (tep_db_num_rows($category_query)) {
$category = tep_db_fetch_array($category_query);
-// $categories = array();
- $categories = tep_get_parent_categories($categories, $category['categories_id']);
-
+ $categories = tep_get_parent_categories(array(), $category['categories_id']);
$categories = array_reverse($categories);
-
$cPath = implode('_', $categories);
if (tep_not_null($cPath)) $cPath .= '_';
Modified: trunk/catalog/includes/classes/drivers/data/product.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/product.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/classes/drivers/data/product.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -428,8 +428,8 @@
$cPath = '';
if((int)$products_id ==0 )return false;
if( ($category=self::get_item($products_id)) == false) return false;
-// $categories = array();
- $categories =tep_get_parent_categories($categories, $category->categories_id);
+
+ $categories =tep_get_parent_categories(array(), $category->categories_id);
$categories = array_reverse($categories);
$cPath = implode('_', $categories);
Modified: trunk/catalog/includes/classes/messageStack.php
===================================================================
--- trunk/catalog/includes/classes/messageStack.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/classes/messageStack.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -96,17 +96,18 @@
}
/**
- Calcul présence des erreurs
+ @brief Calcul présence des erreurs
*/
- /*private*/ function size($class) {
+ /*private*/ function size($class='') {
$count = 0;
+ if($class=='') return count($this->messages);
+ else
+ for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) {
+ if ($this->messages[$i]['class'] == $class) {
+ $count++;
+ }
+ }
- for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) {
- if ($this->messages[$i]['class'] == $class) {
- $count++;
- }
- }
-
return $count;
}
@@ -120,9 +121,11 @@
/**
@brief Draw erreur
*/
- public function _draw($type){
- if ($this->size($type) > 0)
+ public function _draw($type=''){
+ if ($type!='' && $this->size($type) > 0)
echo '<div id="retour_erreur" class="messageStack">'. $this->output($type) . '</div>';
+ elseif($type=='')
+ return $this->output() ;
}
/**
Modified: trunk/catalog/includes/classes/page.php
===================================================================
--- trunk/catalog/includes/classes/page.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/classes/page.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -409,7 +409,14 @@
$seo_urls=seo_url::getInstance($languages_id);
$seo_urls->header_tags($here, $_SERVER['QUERY_STRING']);
- $the_title= $seo_urls->header_tag['title'];
+ if(count($seo_urls->header_tag)<=3)
+ $this->page['seo_url']['error'] = true;
+
+ $this->page['seo_url']['result'] = $seo_urls->header_tag;
+ $this->page['seo_url']['path'] = $here;
+ $this->page['seo_url']['query_string'] = $_SERVER['QUERY_STRING'];
+
+ $the_title= $seo_urls->header_tag['title'];
$the_desc= $seo_urls->header_tag['desc'];
$the_key_words= $seo_urls->header_tag['keywords'];
}
Modified: trunk/catalog/includes/modules/also_purchased_products.php
===================================================================
--- trunk/catalog/includes/modules/also_purchased_products.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/modules/also_purchased_products.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -3,8 +3,8 @@
@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.0.9
- @date 16/06/10, 10:48
+ @version 2.1.1
+ @date 17/12/11, 10:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -15,7 +15,7 @@
$languages_id=$page->the_var('languages_id');
if (isset($_GET['products_id'])) {
- $orders_query = $DB->query($sql="SELECT op2.products_id, p2.products_image, d.products_name, p2.products_quantity, p2.products_price, p2.products_tax_class_id ".
+ $orders_query = $DB->query($sql="SELECT op2.products_id ".
"FROM " . TABLE_ORDERS_PRODUCTS . " op1 ".
"INNER JOIN " . TABLE_ORDERS_PRODUCTS . " op2
ON op2.orders_id = op1.orders_id ".
@@ -49,10 +49,11 @@
while ($new_products = $res->fetchAssoc() ){
$pd=product::get_item($new_products['products_id']);
$pd->aca=$aca_listing->return_db_min($new_products['products_id']);
+ $pd->type = 'product';
$p[]=$pd;
}
- return new objectInfo(array('title'=>TEXT_ALSO_PURCHASED_PRODUCTS_LIST, 'content'=>$p ));
+ return new objectInfo(array('title'=>TEXT_ALSO_PURCHASED_PRODUCTS_LIST, 'content'=>$p , 'type'=>'product' ));
}
Modified: trunk/catalog/includes/modules/listing_cat.php
===================================================================
--- trunk/catalog/includes/modules/listing_cat.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/modules/listing_cat.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -3,8 +3,8 @@
@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 16/09/10, 22:19
+ @version 2.1.1
+ @date 17/12/11, 10:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -55,10 +55,13 @@
$p=array();
if( ($res=$page->oscss_modules->_resultsql('listing_cat')) ==false ) return null;
while ($ele_db = tep_db_fetch_array($res)){
- $p[]=new objectInfo(array_merge($ele_db,array('cPath'=>tep_get_path($ele_db['categories_id'])) ) );
+ $pd=categorie::get_item($ele_db['categories_id']);
+ $pd->type = 'categorie';
+// print_r($pd);
+ $p[]= $pd; //new objectInfo(array_merge($ele_db,array('cPath'=>tep_get_path($ele_db['categories_id'])) ) );
}
- return new objectInfo(array('title'=>HEADING_CHILD_CAT, 'content'=>$p ));
+ return new objectInfo(array('title'=>HEADING_CHILD_CAT, 'content'=>$p, 'type'=>'categorie' ));
}
Modified: trunk/catalog/includes/modules/listing_manufacturer_products.php
===================================================================
--- trunk/catalog/includes/modules/listing_manufacturer_products.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/modules/listing_manufacturer_products.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -4,7 +4,7 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 12/09/11, 10:00
+ @date 17/12/11, 10:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief module base new products
@@ -62,10 +62,11 @@
while ($listing_manufacturer_products = $res->fetchAssoc()){
$pd=product::get_item($listing_manufacturer_products['products_id']);
$pd->aca=$aca_listing->return_db_min($listing_manufacturer_products['products_id']);
+ $pd->type = 'product';
$p[]=$pd;
}
- return new objectInfo(array('title'=>__('table heading manufacturers products') , 'content'=>$p ));
+ return new objectInfo(array('title'=>__('table heading manufacturers products') , 'content'=>$p, 'type'=>'product' ));
}
Modified: trunk/catalog/includes/modules/listing_pages.php
===================================================================
--- trunk/catalog/includes/modules/listing_pages.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/modules/listing_pages.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -2,8 +2,8 @@
/**
@licence GPL 2005-2009 The osCSS developers - osCSS Open Source E-commerce
@package oscss-2 <www http://www.oscss.org>
- @version Rc-3
- @date 14/03/10, 21:15
+ @version 2.1.1
+ @date 17/12/11, 10:48
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -22,11 +22,16 @@
if(is_string($listing_query))$listing_query=tep_db_query($listing_query);
while ($listing = tep_db_fetch_array($listing_query)){
- $p[]=new objectInfo(array_merge($listing,array('aca'=>$aca_listing->return_db_min($listing['content_id'])) ) );
+
+ $pd=content::get_item($listing['content_id']);
+// print_r(new objectInfo(array_merge($listing,array('aca'=>$aca_listing->return_db_min($listing['content_id'])) ) ));
+// print_r($pd);
+ $pd->type = 'content';
+ $p[]=$pd; //new objectInfo(array_merge($listing,array('aca'=>$aca_listing->return_db_min($listing['content_id'])) ) );
}
- return new objectInfo(array('title'=>'', 'content'=>$p, 'split'=> $listing_split ));
+ return new objectInfo(array('title'=>'', 'content'=>$p, 'split'=> $listing_split , 'type'=>'content' ));
}
Modified: trunk/catalog/includes/modules/new_products.php
===================================================================
--- trunk/catalog/includes/modules/new_products.php 2011-12-18 18:03:39 UTC (rev 3972)
+++ trunk/catalog/includes/modules/new_products.php 2011-12-18 21:41:08 UTC (rev 3973)
@@ -55,10 +55,11...
[truncated message content] |
|
From: <os...@us...> - 2011-12-18 22:31:43
|
Revision: 3974
http://oscss.svn.sourceforge.net/oscss/?rev=3974&view=rev
Author: oscim
Date: 2011-12-18 22:31:37 +0000 (Sun, 18 Dec 2011)
Log Message:
-----------
ajout fonction de calcul au driversData de categorie pour detreminer status categories. Si aucun enfants (cat, cms, produ) status off.
Report d'une 404 lors incoherance dans le switch de l'index
Modified Paths:
--------------
trunk/catalog/includes/classes/category_tree.php
trunk/catalog/includes/classes/drivers/data/categorie.php
trunk/catalog/index.php
Modified: trunk/catalog/includes/classes/category_tree.php
===================================================================
--- trunk/catalog/includes/classes/category_tree.php 2011-12-18 21:41:08 UTC (rev 3973)
+++ trunk/catalog/includes/classes/category_tree.php 2011-12-18 22:31:37 UTC (rev 3974)
@@ -62,7 +62,7 @@
categorie::add_where_query(" and c.categories_hidden='1' ");
$list = categorie::get_query('','','',array('limit'=>0));
foreach($list as $categories)
- $this->data[$categories->parent_id][$categories->categories_id] = array('href' => $categories->href, 'name' => $categories->categories_name, 'count' => 0);
+ if( (bool)$categories->status) $this->data[$categories->parent_id][$categories->categories_id] = array('href' => $categories->href, 'name' => $categories->categories_name, 'count' => 0);
if ($this->show_category_product_count === true) $this->calculateCategoryProductCount();
Modified: trunk/catalog/includes/classes/drivers/data/categorie.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/categorie.php 2011-12-18 21:41:08 UTC (rev 3973)
+++ trunk/catalog/includes/classes/drivers/data/categorie.php 2011-12-18 22:31:37 UTC (rev 3974)
@@ -169,7 +169,7 @@
$res['id']=$content['categories_id'];
$res['title']=$content['categories_name'];
$res['name']=$content['categories_name'];
-
+ $res['status']=self::countChidlsAll($content['categories_id']);
$res=categorie::get_option_data($res);
self::$object_data[$content['categories_id']]=$tabl[$content['categories_id']]=new objectInfo($res);
@@ -282,7 +282,35 @@
else return $cPath_new;
}
+ /**
+ @brief Adjust status active by childs item
+ */
+ private function countChidlsAll($category_id){
+ $DB=Database::getInstance();
+ $sql =
+ " SELECT c.categories_id, count(c.categories_id) as total, count(c2c.categories_id) , count(p2c.categories_id) FROM " . TABLE_CATEGORIES . " c ".
+ // " LEFT JOIN " . TABLE_CATEGORIES . " c1 ON (c1.parent_id = c.categories_id) ".
+ " LEFT JOIN " . TABLE_CONTENT_TO_CATEGORIES . " c2c ON (c.categories_id = c2c.categories_id) ".
+ " LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ON (c.categories_id = p2c.categories_id) ".
+ " , " . TABLE_PRODUCTS . " p ".
+ " , " . TABLE_CONTENT . " ct ".
+ " , " . TABLE_CATEGORIES . " c1 ".
+ " WHERE c.categories_id = '" . (int)$category_id . "' ".
+ " AND( ( ct.content_id = c2c.content_id AND ct.content_status='1' )".
+ " OR ( p.products_id = p2c.products_id AND p.products_status = '1' ) ".
+ " OR (c1.parent_id = c.categories_id) ) ".
+ " GROUP BY ct.content_id, p2c.categories_id,c.categories_id ".
+ "";
+ $products_query = $DB->query($sql);
+
+ if($products_query->__get('numRows')>0 ) {
+ $products = $products_query->fetchAssoc();
+ return $products['total'];
+ }
+ else return 0;
+ }
+
/**
* \brief Return the number of products and category child in a category
// TABLES: products, products_to_categories, categories
@@ -316,6 +344,8 @@
return $products_count;
}
+
+
/**
* \brief Return the number of products and category child in a category
// TABLES: products, products_to_categories, categories
Modified: trunk/catalog/index.php
===================================================================
--- trunk/catalog/index.php 2011-12-18 21:41:08 UTC (rev 3973)
+++ trunk/catalog/index.php 2011-12-18 22:31:37 UTC (rev 3974)
@@ -154,13 +154,18 @@
}
/** HOME */
- else {
+ elseif( ! isset($cPath) ) {
$page->init('home.php',$language);
$breadcrumb=$page->return_object('breadcrumb');
// $page->force_content('home.php');
}
+ else {
+ header("Status: 404 Not Found");
+ header("HTTP/1.0 301 Moved Permanently");
+ tep_redirect(tep_href_link('error/404.html'));
+ }
unset($category_cfils,$category_pfils,$category_parent);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2011-12-19 00:57:00
|
Revision: 3975
http://oscss.svn.sourceforge.net/oscss/?rev=3975&view=rev
Author: oscim
Date: 2011-12-19 00:56:52 +0000 (Mon, 19 Dec 2011)
Log Message:
-----------
Dernier ajustement suite nombreuse modification des ces derniers jours
correction coquille notice php
Debug et stabilisation seo
Modified Paths:
--------------
trunk/catalog/common/classes/seo_url.php
trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php
trunk/catalog/includes/classes/core_page/overlay/oscss_modules.php
trunk/catalog/includes/classes/drivers/data/categorie.php
trunk/catalog/includes/classes/page.php
trunk/catalog/includes/filenames.php
trunk/catalog/index.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php
Modified: trunk/catalog/common/classes/seo_url.php
===================================================================
--- trunk/catalog/common/classes/seo_url.php 2011-12-18 22:31:37 UTC (rev 3974)
+++ trunk/catalog/common/classes/seo_url.php 2011-12-19 00:56:52 UTC (rev 3975)
@@ -5,7 +5,7 @@
@link http://www.oscommerce-freelancers.com/ osCommerce-Freelancers
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 22/08/2011, 18:17
+ @date 18/12/2011, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class seo_url
@@ -338,7 +338,7 @@
$this->performance['TOTAL_TIME'] += $time;
switch($this->attributes['SEO_URLS_USE_W3C_VALID']){
case ('true'):
- if (!isset($_SESSION['customer_id']) && _cst_bool('ENABLE_PAGE_CACHE') && class_exists('page_cache')) return $link;
+ if (!isset($_SESSION['customer_id']) && _cst_bool('ENABLE_PAGE_CACHE')) return $link;
else {
return htmlentities($link);
}
@@ -360,9 +360,9 @@
$link = $connection == 'NONSSL' ? self::$base_url : self::$base_url_ssl;
$separator = '?';
self::$htexe = true;
-
+// var_dump($page, $parameters);
$this->parse_parameters($page, $parameters ,$connection , $separator);
-
+// var_dump($this->header_tag);
self::$htexe = false;
}
@@ -466,16 +466,21 @@
krsort($p);
$container = array();
- // preparation array key/value
- foreach ($p as $index => $valuepair)
+ // preparation array key/value
+ foreach ($p as $index => $valuepair)
if(!empty($valuepair) || $index !=0) {
- $p2 = @explode('=', $valuepair);
+ $p2 = @explode('=', $valuepair);
- $p3[$p2[0]]=$p2[1];
+ if($p2[0] =='d' && substr($p2[1],-3) =='php')
+ $p2[1] = substr($p2[1],0,-4);
+ $p3[$p2[0]]=$p2[1];
+
}
- $check=array_keys($this->reg_anchors);
+ $check=array_values($this->reg_anchors);
+ $check0=array_keys($this->reg_anchors);
+ $arflip = array_flip($this->reg_anchors);
if(count($p3)==0)
if($page ==FILENAME_HOME)
@@ -486,15 +491,23 @@
$url='';
switch ($key){
+
+ case (in_array($key, $check0)):
+ $key = $this->reg_anchors[$key];
case (in_array($key, $check)):
+ $function = 'GetName_'.$key;
- $Rkey=$this->reg_anchors[$key];
- $function = 'GetName_'.$Rkey;
-
if(method_exists($this,$function)) {
- $url = $this->make_url($page, $this->$function($value), $key, $value, $separator);
- $this->ValidateName($url, $Rkey, $value, $connection, $separator);
+ $resultarray = $this->$function($value);
+
+ if(self::$htexe)
+ $this->transph_header_tag($resultarray);
+
+
+ $url = $this->make_url($page, $resultarray['tName'], $arflip[$key], $value, $separator);
+
+ $this->ValidateName($url, $arflip[$key], $value, $connection, $separator);
}
break;
@@ -532,7 +545,7 @@
$separator = '&';
}
}
-
+// var_dump($url);s
return $url;
}
@@ -562,6 +575,7 @@
else
$cpath = '';
+// var_dump($anchor_type);
return sprintf(
$this->reg_mask[self::$SEO_REWRITE_TYPE],
$key,
@@ -619,36 +633,30 @@
* @return string Stripped anchor text
*/
protected function GetName_d($pID){
-// private function get_divers_name($pID){
-
-// var_dump(self::$htexe);
-// exit;
-// var_dump($pID);
-// var_dump(self::$htexe);
switch(true){
case (_test_bool(self::$USE_SEO_CACHE_GLOBAL) && isset($this->cache['DIVERS'][$pID])):
- $this->performance['CACHE_QUERY_SAVINGS']++;
- $result = $this->get_cache_id($pID,'','DIVERS');
-// var_dump(self::$htexe,$result);
- $return = (isset($result['tName'])? $this->strip($result['tName']): $this->strip($pID));
- if(self::$htexe)
- $this->transph_header_tag($result);
+ $this->performance['CACHE_QUERY_SAVINGS']++;
+ $result = $this->get_cache_id($pID,'','DIVERS');
+
+ $result['tName'] = (isset($result['tName'])? $this->strip($result['tName']): $this->strip($pID));
break;
+
default:
- $this->performance['NUMBER_QUERIES']++;
- $sql = "select head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='page' and ft.page_id = '" . basename($pID). "' and ftd.language_id = '" . (int)$this->languages_id. "' Limit 1";
- $query=$this->DB->query( $sql );
- if ($query->__get('numRows')>0) $result =$query->fetchAssoc();
- else $result['tName'] = $this->strip($pID);
- $this->get_cache_id($pID,'','DIVERS');
- $this->performance['QUERIES']['DIVERS'][] = $sql;
+ $this->performance['NUMBER_QUERIES']++;
+ $sql = "select head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='page' and ft.page_id = '" . basename($pID). "' and ftd.language_id = '" . (int)$this->languages_id. "' Limit 1";
+ $query=$this->DB->query( $sql );
- if(self::$htexe)
- $this->transph_header_tag($result);
- $return = $result['tName'];
- break;
+ if ($query->__get('numRows')>0) $result =$query->fetchAssoc();
+ else $result['tName'] = $this->strip($pID);
+
+ $this->get_cache_id($pID,'','DIVERS');
+ $this->performance['QUERIES']['DIVERS'][] = $sql;
+
+ break;
}
- return $return;
+
+
+ return $result;
}
/**
@@ -670,26 +678,25 @@
* @return string Stripped anchor text
*/
private function GetName_l($pID){
-// private function get_links_name($pID){
switch(true){
case (_test_bool(self::$USE_SEO_CACHE_GLOBAL) && isset($this->cache['LINKS'][$pID]) ):
- $this->performance['CACHE_QUERY_SAVINGS']++;
- $result = $this->get_cache_id($pID,'','LINKS');
- $return = (isset($result['tName'])? $this->strip($result['tName']): $this->strip($pID));
- if(self::$htexe) $this->transph_header_tag($result);
+ $this->performance['CACHE_QUERY_SAVINGS']++;
+ $result = $this->get_cache_id($pID,'','LINKS');
+ $result['tName'] = (isset($result['tName'])? $this->strip($result['tName']): $this->strip($pID));
break;
default:
- $this->performance['NUMBER_QUERIES']++;
- $query=$this->DB->query( "select nav_name as tName, l.nav_link_id as ID from " . TABLE_NAVIGATION_LINKS . " l, " . TABLE_NAVIGATION_LINKS_DESCRIPTION . " ld where l.nav_link_id=ld.nav_link_id l.nav_link_id = '" . $pID. "' and ld.language_id = '" . (int)$this->languages_id. "' Limit 1" );
- if ($query->__get('numRows')>0) $result =$query->fetchAssoc();
- else $result['tName'] = $this->strip($pID);
- $this->get_cache_id($pID,'','LINKS');
- $this->performance['QUERIES']['LINKS'][] = $query;
- if(self::$htexe) $this->transph_header_tag($result);
- $return = $result['tName'];
- break;
+ $this->performance['NUMBER_QUERIES']++;
+ $query=$this->DB->query( "select nav_name as tName, l.nav_link_id as ID from " . TABLE_NAVIGATION_LINKS . " l, " . TABLE_NAVIGATION_LINKS_DESCRIPTION . " ld where l.nav_link_id=ld.nav_link_id l.nav_link_id = '" . $pID. "' and ld.language_id = '" . (int)$this->languages_id. "' Limit 1" );
+ if ($query->__get('numRows')>0) $result =$query->fetchAssoc();
+ else $result['tName'] = $this->strip($pID);
+ $this->get_cache_id($pID,'','LINKS');
+ $this->performance['QUERIES']['LINKS'][] = $query;
+
+ break;
}
- return $return;
+
+
+ return $result;
}
@@ -720,7 +727,6 @@
* @return string Stripped anchor text
*/
private function GetName_p($pID){
-// private function get_product_name($pID){
switch(true){
// case (_test_bool(self::$USE_SEO_CACHE_GLOBAL) && isset($this->cache['PRODUCTS'][$pID]) ):
// $this->performance['CACHE_QUERY_SAVINGS']++;
@@ -729,33 +735,34 @@
// if(self::$htexe) $this->transph_header_tag($result);
// break;
default:
- $this->performance['NUMBER_QUERIES']++;
- switch(true){
- case (_test_bool($this->attributes['SEO_ADD_CAT_PARENT'])):
+ $this->performance['NUMBER_QUERIES']++;
+ switch(true){
+ case (_test_bool($this->attributes['SEO_ADD_CAT_PARENT'])):
- $rsql = $this->DB->query("SELECT products_name as tName, categories_name as cName FROM ".TABLE_PRODUCTS_DESCRIPTION." p LEFT JOIN ".TABLE_PRODUCTS_TO_CATEGORIES." cd2 ON p.products_id=cd2.products_id JOIN ".TABLE_CATEGORIES_DESCRIPTION." cd ON cd.categories_id = cd2.categories_id AND cd.language_id='".(int)$this->languages_id."' WHERE p.products_id='".(int)$pID."' AND p.language_id='".(int)$this->languages_id."' LIMIT 1");
- $result = $rsql->fetchAssoc();
- $cName = $result['cName'];
+ $rsql = $this->DB->query("SELECT products_name as tName, categories_name as cName FROM ".TABLE_PRODUCTS_DESCRIPTION." p LEFT JOIN ".TABLE_PRODUCTS_TO_CATEGORIES." cd2 ON p.products_id=cd2.products_id JOIN ".TABLE_CATEGORIES_DESCRIPTION." cd ON cd.categories_id = cd2.categories_id AND cd.language_id='".(int)$this->languages_id."' WHERE p.products_id='".(int)$pID."' AND p.language_id='".(int)$this->languages_id."' LIMIT 1");
+ $result = $rsql->fetchAssoc();
+ $cName = $result['cName'];
- $result['tName']=$result['cName'].'-'.$result['tName'];
- break;
- default:
- $rsql = $this->DB->query("SELECT products_name as tName FROM ".TABLE_PRODUCTS_DESCRIPTION." WHERE products_id='".(int)$pID."' AND language_id='".(int)$this->languages_id."' LIMIT 1");
- $result = $rsql->fetchAssoc();
- $cName = $result['tName'];
- break;
- }
- /*if(!defined('TABLE_FULL_TAG'))*/
- // else $sql = "select head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='product' and ft.page_id = '" . (int)$pID. "' and ftd.language_id = '" . (int)$this->languages_id. "' Limit 1";
-// $result = $this->DB->FetchArray( $this->DB->Query( $sql ) );
- $this->get_cache_id($pID,$result,'PRODUCTS');
- $this->performance['QUERIES']['PRODUCTS'][] = $rsql;
- if(self::$htexe) $this->transph_header_tag($result);
- $return = $this->strip( $result['tName'] );
- break;
+ $result['tName']=$result['cName'].'-'.$result['tName'];
+ break;
+ default:
+ $rsql = $this->DB->query("SELECT products_name as tName FROM ".TABLE_PRODUCTS_DESCRIPTION." WHERE products_id='".(int)$pID."' AND language_id='".(int)$this->languages_id."' LIMIT 1");
+ $result = $rsql->fetchAssoc();
+ $cName = $result['tName'];
+ break;
+ }
+ $this->get_cache_id($pID,$result,'PRODUCTS');
+ $this->performance['QUERIES']['PRODUCTS'][] = $rsql;
+
+ $result['tName'] = $this->strip( $result['tName'] );
+ break;
}
- return $return;
+
+ if(self::$htexe)
+ $this->transph_header_tag($result);
+
+ return $result;
}
/**
@@ -793,7 +800,7 @@
$path .= $this->GetName_c($row).'-';
}
- $result['path']= $path . ((isset($result['url']) && !empty($result['url']) )? $result['url'] : $result['tName']) ;
+ $result['path']= $path . ((isset($result['url']) && !empty($result['url']) )? $result['url'] : $result['tName']) ;
$this->get_cache_id($result['ID'],$result,'PRODUCTS');
@@ -814,40 +821,41 @@
$ID=(is_numeric($ID) ?$ID : $this->get_full_cPath($cID, $single_cID));
switch(true){
case (_test_bool(self::$USE_SEO_CACHE_GLOBAL) && isset($this->cache['CATEGORIES'][$ID]) ):
- $this->performance['CACHE_QUERY_SAVINGS']++;
- $result = $this->get_cache_id($ID,'','CATEGORIES');;
- $return = (isset($result['tName'])? $this->strip($result['tName']): '');
- if(self::$htexe) $this->transph_header_tag($result);
+ $this->performance['CACHE_QUERY_SAVINGS']++;
+ $result = $this->get_cache_id($ID,'','CATEGORIES');;
+ $result['tName']= (isset($result['tName'])? $this->strip($result['tName']): '');
+
break;
default:
- $this->performance['NUMBER_QUERIES']++;
- switch(true){
- case (_test_bool($this->attributes['SEO_ADD_CAT_PARENT'])):
- $rsql = $this->DB->query("SELECT c.categories_id as ID, c.parent_id, cd.categories_name as tName, cd2.categories_name as pName
- FROM ".TABLE_CATEGORIES." c
- JOIN ".TABLE_CATEGORIES_DESCRIPTION." cd
- ON c.categories_id = cd.categories_id AND cd.language_id='".(int)$this->languages_id."'
- LEFT JOIN ".TABLE_CATEGORIES_DESCRIPTION." cd2
- ON c.parent_id=cd2.categories_id AND cd2.language_id='".(int)$this->languages_id."'
- WHERE c.categories_id='".(int)$ID."'
- LIMIT 1");
- $result = $rsql->fetchAssoc();
- $result['tName']=$cName = $this->not_null($result['pName']) ? $this->strip($result['pName'] . ' ' . $result['tName']) : $this->strip($result['tName']);
- break;
- default:
- $rsql = $this->DB->query("SELECT categories_id as ID, categories_name as tName FROM ".TABLE_CATEGORIES_DESCRIPTION." WHERE categories_id='".(int)$ID."' AND language_id='".(int)$this->languages_id."' LIMIT 1");
- $result = $rsql->fetchAssoc();
- $cName = $result['tName'];
- break;
- $this->performance['QUERIES']['CATEGORIES'][] = $rsql;
- }
- $cName = $this->strip($cName);
- $this->get_cache_id($ID,$result,'CATEGORIES');
- if(self::$htexe) $this->transph_header_tag($result);
- $return = $cName;
+ $this->performance['NUMBER_QUERIES']++;
+ switch(true){
+ case (_test_bool($this->attributes['SEO_ADD_CAT_PARENT'])):
+ $rsql = $this->DB->query("SELECT c.categories_id as ID, c.parent_id, cd.categories_name as tName, cd2.categories_name as pName
+ FROM ".TABLE_CATEGORIES." c
+ JOIN ".TABLE_CATEGORIES_DESCRIPTION." cd
+ ON c.categories_id = cd.categories_id AND cd.language_id='".(int)$this->languages_id."'
+ LEFT JOIN ".TABLE_CATEGORIES_DESCRIPTION." cd2
+ ON c.parent_id=cd2.categories_id AND cd2.language_id='".(int)$this->languages_id."'
+ WHERE c.categories_id='".(int)$ID."'
+ LIMIT 1");
+ $result = $rsql->fetchAssoc();
+ $result['tName']=$cName = $this->not_null($result['pName']) ? $this->strip($result['pName'] . ' ' . $result['tName']) : $this->strip($result['tName']);
+ break;
+ default:
+ $rsql = $this->DB->query("SELECT categories_id as ID, categories_name as tName FROM ".TABLE_CATEGORIES_DESCRIPTION." WHERE categories_id='".(int)$ID."' AND language_id='".(int)$this->languages_id."' LIMIT 1");
+ $result = $rsql->fetchAssoc();
+ $cName = $result['tName'];
+ break;
+ $this->performance['QUERIES']['CATEGORIES'][] = $rsql;
+ }
+ $cName = $this->strip($cName);
+ $this->get_cache_id($ID,$result,'CATEGORIES');
+
+ $result['tName']=$cName;
break;
}
- return $return;
+
+ return $result;
}
/**
@@ -870,27 +878,27 @@
* @param $mID integer
* @return string
*/
-// private function get_manufacturer_name($mID){
private function GetName_m($mID){
switch(true){
case (_test_bool(self::$USE_SEO_CACHE_GLOBAL) && isset($this->cache['MANUFACTURERS'][$mID])):
- $this->performance['CACHE_QUERY_SAVINGS']++;
- $result = $this->cache['MANUFACTURERS'][$mID];
- $return = (isset($result['tName'])? $result['tName']: '');
- if(self::$htexe) $this->transph_header_tag($result);
+ $this->performance['CACHE_QUERY_SAVINGS']++;
+ $result = $this->cache['MANUFACTURERS'][$mID];
+ $result['tName'] = (isset($result['tName'])? $result['tName']: '');
break;
default:
- $this->performance['NUMBER_QUERIES']++;
- $rsql = $this->DB->query("SELECT manufacturers_name as tName FROM ".TABLE_MANUFACTURERS." WHERE manufacturers_id='".(int)$mID."' LIMIT 1");
- $result = $rsql->fetchAssoc(); // $this->DB->FetchArray( $this->DB->Query( $sql ) );
- $mName = $this->strip( $result['tName'] );
- $this->cache['MANUFACTURERS'][$mID] = $result;
- $this->performance['QUERIES']['MANUFACTURERS'][] = $rsql;
- if(self::$htexe) $this->transph_header_tag($result);
- $return = $mName;
+ $this->performance['NUMBER_QUERIES']++;
+ $rsql = $this->DB->query("SELECT manufacturers_name as tName FROM ".TABLE_MANUFACTURERS." WHERE manufacturers_id='".(int)$mID."' LIMIT 1");
+ $result = $rsql->fetchAssoc(); // $this->DB->FetchArray( $this->DB->Query( $sql ) );
+ $mName = $this->strip( $result['tName'] );
+ $this->cache['MANUFACTURERS'][$mID] = $result;
+ $this->performance['QUERIES']['MANUFACTURERS'][] = $rsql;
+
+ $result['tName']= $mName;
break;
}
- return $return;
+
+
+ return $result;
}
@@ -902,28 +910,25 @@
* @return string
*/
private function GetName_t($tID){
-// private function get_topic_name($tID){
switch(true){
case (_test_bool(self::$USE_SEO_CACHE_GLOBAL) && isset($this->cache['TOPICS'][$tID]) ):
- $this->performance['CACHE_QUERY_SAVINGS']++;
- $result = $this->cache['TOPICS'][$tID];
- $return = (isset($result['tName'])? $this->strip($result['tName']): '');
- if(self::$htexe) $this->transph_header_tag($result);
- break;
+ $this->performance['CACHE_QUERY_SAVINGS']++;
+ $result = $this->cache['TOPICS'][$tID];
+ $result['tName'] = (isset($result['tName'])? $this->strip($result['tName']): '');
+ break;
default:
- $this->performance['NUMBER_QUERIES']++;
- $sql = "select content_title as tName from " . TABLE_CONTENT . " c, " . TABLE_CONTENT_DESCRIPTION . " cd where c.content_status = '1' and c.content_id=cd.content_id and c.content_id='".(int)$tID."' and cd.language_id='".(int)$this->languages_id."' Limit 1";
- $rsql=$this->DB->query($sql);
-// else $sql = "select head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='content' and ft.page_id = '" . (int)$tID. "' and ftd.language_id = '" . (int)$this->languages_id. "' Limit 1";
- $result = $rsql->fetchAssoc(); //$this->DB->FetchArray( $this->DB->query( $sql ) );
- $tName = $this->strip( $result['tName'] );
- $this->cache['ARTICLES'][$tID] = $result;
- $this->performance['QUERIES']['TOPICS'][] = $sql;
- if(self::$htexe) $this->transph_header_tag($result);
- $return = $tName;
- break;
+ $this->performance['NUMBER_QUERIES']++;
+ $sql = "select content_title as tName from " . TABLE_CONTENT . " c, " . TABLE_CONTENT_DESCRIPTION . " cd where c.content_status = '1' and c.content_id=cd.content_id and c.content_id='".(int)$tID."' and cd.language_id='".(int)$this->languages_id."' Limit 1";
+ $rsql=$this->DB->query($sql);
+ $result = $rsql->fetchAssoc();
+ $tName = $this->strip( $result['tName'] );
+ $this->cache['ARTICLES'][$tID] = $result;
+ $this->performance['QUERIES']['TOPICS'][] = $sql;
+ $result['tName'] = $tName;
+ break;
}
- return $return;
+
+ return $result;
}
@@ -935,8 +940,6 @@
*/
private function generate_topics_cache(){
-
-
if(! _test_bool($this->attributes['SEO_ADD_CAT_PARENT']) )
// $res=$this->DB->query( "select ft.page_id as ID , head_title_tag as tName, head_desc_tag, head_keywords_tag, head_url as url from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='product' and ftd.language_id = '" . (int)$this->languages_id. "'" );
$res=$this->DB->query( "select ft.page_id as ID, head_title_tag as tName, head_desc_tag, head_keywords_tag from " . TABLE_FULL_TAG . " ft, " . TABLE_FULL_TAG_DESCRIPTION . " ftd where ft.tag_id=ftd.tag_id and ft.page_type='content' and ftd.language_id = '" . (int)$this->languages_id. "'" );
@@ -946,7 +949,6 @@
while ($result =$res->fetchAssoc()){
-
$path = '';
if(isset($result['categories_cpath']) && !empty($result['categories_cpath'])) {
@@ -956,7 +958,7 @@
$path .= $this->GetName_c($row).'-';
}
- $result['path']= $path . ((isset($result['url']) && !empty($result['url']) )? $result['url'] : $result['tName']) ;
+ $result['path']= $path . ((isset($result['url']) && !empty($result['url']) )? $result['url'] : $result['tName']) ;
$this->get_cache_id($result['ID'],$result,'TOPICS');
}
Modified: trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php
===================================================================
--- trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php 2011-12-18 22:31:37 UTC (rev 3974)
+++ trunk/catalog/includes/classes/core_page/overlay/oscss_boxes.php 2011-12-19 00:56:52 UTC (rev 3975)
@@ -3,8 +3,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.0
- @date 12/02/11, 15:06
+ @version 2.1.1
+ @date 18/12/11, 15:06
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
\class oscss_boxes
@@ -192,7 +192,14 @@
*/
private function ret_boxes($key){
global $page;
- if(!empty($key) && isset($page->page['boxes']['list'][$key]))return $page->page['boxes']['list'][$key];
+ if(empty($key))
+ return false;
+
+ if(isset($page->page['boxes']['list'][$key]))
+ return $page->page['boxes']['list'][$key];
+
+ trigger_error(sprintf(__FILE__.'::'.__LINE__.' Error Call boxes :( %s) no found ', $key ) , E_USER_ERROR);
+
return false;
}
Modified: trunk/catalog/includes/classes/core_page/overlay/oscss_modules.php
===================================================================
--- trunk/catalog/includes/classes/core_page/overlay/oscss_modules.php 2011-12-18 22:31:37 UTC (rev 3974)
+++ trunk/catalog/includes/classes/core_page/overlay/oscss_modules.php 2011-12-19 00:56:52 UTC (rev 3975)
@@ -144,7 +144,9 @@
$page->page['modules']['list'][$key]=array_merge( $page->page['modules']['list'][$key],$this->temp['list'][$key]);
/** Verif etat et exe */
- if($page->page['modules'][$type][$key] !='false'){
+ if(
+ ( @$page->page['modules'][$type][$key] !='false' )
+ ) {
$mod=$this->ret_modules($key);
// $file=$mod['dir_lang'] . $mod['name'] ;
$function='sql_'.$mod['name_clean'];
@@ -160,7 +162,7 @@
if(($path_lg=$page->fix_file($mod['dir_lang'] . $mod['name'],true)) !=false) $page->pile_file_lang($path_lg);
// if (page::TestFile($file)) require_once($file);
- $this->modules_chargee[$key]=$page->page['modules'][$type][$key];
+ $this->modules_chargee[$key]=@$page->page['modules'][$type][$key];
$page->page['modules']['list'][$key]['result_sql']=$res;
}
else{
Modified: trunk/catalog/includes/classes/drivers/data/categorie.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/categorie.php 2011-12-18 22:31:37 UTC (rev 3974)
+++ trunk/catalog/includes/classes/drivers/data/categorie.php 2011-12-19 00:56:52 UTC (rev 3975)
@@ -268,7 +268,6 @@
if (tep_not_null($current_category_id)) {
-// $cPath_array = array();
$cPath_array = self::get_parent_categories(array(), $current_category_id) ;
$cPath_array[] = $current_category_id;
$cPath_new = implode('_', $cPath_array);
@@ -285,7 +284,7 @@
/**
@brief Adjust status active by childs item
*/
- private function countChidlsAll($category_id){
+ private static function countChidlsAll($category_id){
$DB=Database::getInstance();
$sql =
" SELECT c.categories_id, count(c.categories_id) as total, count(c2c.categories_id) , count(p2c.categories_id) FROM " . TABLE_CATEGORIES . " c ".
Modified: trunk/catalog/includes/classes/page.php
===================================================================
--- trunk/catalog/includes/classes/page.php 2011-12-18 22:31:37 UTC (rev 3974)
+++ trunk/catalog/includes/classes/page.php 2011-12-19 00:56:52 UTC (rev 3975)
@@ -409,27 +409,32 @@
$seo_urls=seo_url::getInstance($languages_id);
$seo_urls->header_tags($here, $_SERVER['QUERY_STRING']);
- if(count($seo_urls->header_tag)<=3)
- $this->page['seo_url']['error'] = true;
- $this->page['seo_url']['result'] = $seo_urls->header_tag;
- $this->page['seo_url']['path'] = $here;
- $this->page['seo_url']['query_string'] = $_SERVER['QUERY_STRING'];
- $the_title= $seo_urls->header_tag['title'];
- $the_desc= $seo_urls->header_tag['desc'];
- $the_key_words= $seo_urls->header_tag['keywords'];
+ /// meta tags content for html balise
+ $meta['title']=(tep_not_null($seo_urls->header_tag['title'])? $seo_urls->header_tag['title'] : (tep_not_null($this->title)? $this->title: STORE_NAME));
+ if(tep_not_null($seo_urls->header_tag['desc']))
+ $meta['description']=$seo_urls->header_tag['desc'];
+
+ if(tep_not_null($seo_urls->header_tag['keywords']))
+ $meta['keywords']=$seo_urls->header_tag['keywords'];
+
}
else {
- $the_desc= HEAD_DESC_TAG_ALL;
- $the_key_words= HEAD_KEY_TAG_ALL;
- $the_title='';
+ /// meta tags content for html balise
+ $meta['title']=/*(defined('HEADING_TITLE')? HEADING_TITLE : */ (tep_not_null($this->title)? $this->title: STORE_NAME) /*)*/;
+ $meta['description']=HEAD_DESC_TAG_ALL;
+ $meta['keywords']=HEAD_KEY_TAG_ALL;
}
- /// meta tags content for html balise
- $this->page['meta']['title']=(tep_not_null($the_title)? $the_title : (tep_not_null($this->title)? $this->title: STORE_NAME));
- $this->page['meta']['description']=$the_desc;
- $this->page['meta']['keywords']=$the_key_words;
+ if(count($meta)<=3)
+ $this->page['seo_url']['error'] = true;
+
+ $this->page['meta'] = $meta;
+ // log
+ $this->page['seo_url']['result'] = $this->page['meta'];
+ $this->page['seo_url']['path'] = $here;
+ $this->page['seo_url']['query_string'] = $_SERVER['QUERY_STRING'];
}
@@ -774,7 +779,7 @@
\brief Call meta tags
*/
public function GetHtmlMeta($type = 'title'){
- return (in_array($type, $this->page['meta'])) ? $this->page['meta'][$type] : false ;;
+ return ((isset($this->page['meta'][$type])) ? (string)$this->page['meta'][$type] : false );
}
/**
Modified: trunk/catalog/includes/filenames.php
===================================================================
--- trunk/catalog/includes/filenames.php 2011-12-18 22:31:37 UTC (rev 3974)
+++ trunk/catalog/includes/filenames.php 2011-12-19 00:56:52 UTC (rev 3975)
@@ -56,7 +56,7 @@
define('FILENAME_SEARCH_HELP', 'search_help.php');
define('FILENAME_SHIPPING', 'shipping.php');
-
+ define('FILENAME_SHOPPING_CART', 'shopping_cart.php');
define('FILENAME_SPECIALS', 'listing_specials.php');
define('FILENAME_SSL_CHECK', 'ssl_check.php');
define('FILENAME_TELL_A_FRIEND', 'tell_a_friend.php');
@@ -77,7 +77,6 @@
/* Retrocompatibilite */
define('FILENAME_CONTENT', FILENAME_DEFAULT);
define('FILENAME_PRODUCT_INFO', FILENAME_DEFAULT);
- define('FILENAME_SHOPPING_CART', FILENAME_DEFAULT);
/**
Modified: trunk/catalog/index.php
===================================================================
--- trunk/catalog/index.php 2011-12-18 22:31:37 UTC (rev 3974)
+++ trunk/catalog/index.php 2011-12-19 00:56:52 UTC (rev 3975)
@@ -154,18 +154,19 @@
}
/** HOME */
- elseif( ! isset($cPath) ) {
+ else {
+// elseif( ! isset($cPath) ) {
$page->init('home.php',$language);
$breadcrumb=$page->return_object('breadcrumb');
// $page->force_content('home.php');
}
- else {
- header("Status: 404 Not Found");
- header("HTTP/1.0 301 Moved Permanently");
- tep_redirect(tep_href_link('error/404.html'));
- }
+// else {
+// header("Status: 404 Not Found");
+// header("HTTP/1.0 301 Moved Permanently");
+// tep_redirect(tep_href_link('error/404.html'));
+// }
unset($category_cfils,$category_pfils,$category_parent);
Modified: trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php 2011-12-18 22:31:37 UTC (rev 3974)
+++ trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php 2011-12-19 00:56:52 UTC (rev 3975)
@@ -16,7 +16,7 @@
<div id="shoppingCart">
<?php $boxe =$page->oscss_boxes->_return('checkout_progressbar'); ?>
- <?php echo unhtmlentities($boxe->content) ?>
+ <?php if($boxe)echo unhtmlentities($boxe->content) ?>
<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2011-12-19 09:15:38
|
Revision: 3976
http://oscss.svn.sourceforge.net/oscss/?rev=3976&view=rev
Author: oscim
Date: 2011-12-19 09:15:27 +0000 (Mon, 19 Dec 2011)
Log Message:
-----------
Correction coquille css theme
Site et fin modification block menu develop , suppression de la var develop , et activation du module uniquement pour l'admin, cf link visiter la boutique , et activation cookieadmin
Ce block ne sera donc actif que pour les administrateurs qui ont activ?\195?\169 la liaison cookie.
Ajout recalcul cache page au blokc develop
Modified Paths:
--------------
trunk/catalog/includes/classes/core_page/develop.php
trunk/catalog/includes/classes/page.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/Css/BottomTop.css
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/cfg/init.php
trunk/catalog/install/data/templates/appareil_photo/electronix/cfg/init.php
Modified: trunk/catalog/includes/classes/core_page/develop.php
===================================================================
--- trunk/catalog/includes/classes/core_page/develop.php 2011-12-19 00:56:52 UTC (rev 3975)
+++ trunk/catalog/includes/classes/core_page/develop.php 2011-12-19 09:15:27 UTC (rev 3976)
@@ -42,7 +42,6 @@
}
$li.='</ul>';
-// print_r($page->oscss_plugins);
/// list all plugins
$p_li='This list load plugins in current page'.
@@ -152,9 +151,12 @@
.'';
+
+
/// PRINT block menu One
print '<div id="develop" class="develop">'.
'<h4>Frontend Develop Menu - <a href="#" onclick="ViewData(\'Help\');return false; " title="view detail">(help)</a></h4>'.
+ ((OSCSS_DEBUG==false)? '<p>Page In cache : <a href="'.tep_href_link(substr($_SERVER['SCRIPT_NAME'],strlen(DIR_WS_CATALOG) ), tep_get_all_get_params(array('cache')).'cache=calcul').'">Recalculer</a></p> ' : '').
'<p> <a href="#" onclick="ViewData(\'NormalInfo\');return false; " title="view detail"> Popup Dev Info </a> '.
'</p>'.
@@ -163,7 +165,7 @@
'<p><span style="font-weight:bold;">Content: <a href="#" title="le contenu principal de la page ne cours">(i)</a></span> <a href="#" title="'.@$page->page['path_content'].'">(i)</a>'.@$page->page['content'].'</p>'.
'<p><span style="font-weight:bold;">Gabarit:</span> '. $page->page['gabarit'].'</p>'.
'<ul>'.
-( ( ($val = $mock->is_count()) >0 )? '<li><a style="color:red" href="#" onclick="ViewData(\'Errors\');return false; " title="View Php Error">php('.$val.')</a></li>' : '' ).
+( ( ( OSCSS_DEBUG==true && $val = $mock->is_count()) >0 )? '<li><a style="color:red" href="#" onclick="ViewData(\'Errors\');return false; " title="View Php Error">php('.$val.')</a></li>' : '' ).
( ( ($val2 = $page->messageStack->size()) >0 )? '<li><a style="color:red" href="#" onclick="ViewData(\'CoreAlert\');return false; " title="View Core Alert">Core('.$val2.')</a></li>' : '' ).
( ( ( count($page->page['seo_url']['result']) )<3 )? '<li><a style="color:red" href="#" onclick="ViewData(\'SEO\');return false; " title="View Core Alert">SEO ('.(3 - count($page->page['seo_url']['result']) ) .')</a></li>' : '' ).
'</ul>'.
@@ -216,7 +218,7 @@
padding:1em;
position:fixed;
right:0;
- top:0;
+ top:0;
font-size:14px;
padding:3px; margin:0;
}
Modified: trunk/catalog/includes/classes/page.php
===================================================================
--- trunk/catalog/includes/classes/page.php 2011-12-19 00:56:52 UTC (rev 3975)
+++ trunk/catalog/includes/classes/page.php 2011-12-19 09:15:27 UTC (rev 3976)
@@ -87,7 +87,6 @@
private function __construct($FileRegistered=array()){
$this->ext='.php';
- $this->page['var']['develop'] ='false';
$this->page['header']['file']=array();
$this->page['footer']['file']=array();
$this->page['modules']=array();
@@ -97,11 +96,17 @@
$this->page['content']=FILENAME_DEFAULT;
$this->page['class']='none';
$this->page['script']='';
+ /**
+ @var log error process for help
+ */
+ $this->page['seo_url']=array();
+
$this->PileFileLang=array();
self::$CacheCalcul=(isset($_GET['cache']) && $_GET['cache']=='calcul')? true :false;
+
/**
base page en cours
*/
@@ -446,11 +451,14 @@
* \note fonction qui doit être appelé dans le application_top
*/
public function pre_init(){
-
-
// set the template
$this->page['template'] = page::oscss_get_template();
+ // force redirect clean url after empty page cache
+ if(self::$CacheCalcul){
+ $quey_string=tep_get_all_get_params(array('cache','page'));
+ tep_redirect( tep_href_link(basename($_SERVER['SCRIPT_NAME']) , ( ( $quey_string !='')? $quey_string : '') ) );
+ }
}
/**
@@ -467,8 +475,7 @@
$this->page['language']=$language;
$this->type_content();
$page=$this;
-// var_dump($p_content);
-// exit;
+
$this->CurrentPageInit($p_content);
/// include start the breadcrumb trail
@@ -992,14 +999,7 @@
$load->lists_file[__FUNCTION__][] = $bar;
self::$load_theme = $load;
- /**
- @remarks specific menu admin for front loggued admin
- */
- if(self::$CookieAdmin)
- echo '<div class="osCSS_Admin" style="position:absolute; right:20px; top:0;">'.
-// '<a href="'.tep_href_link(substr($_SERVER['SCRIPT_NAME'],strlen(DIR_WS_CATALOG) ), tep_get_all_get_params(array('cache')).'cache=calcul').'">Recalculer page</a> '.
- '<a href="'.tep_href_link(substr($_SERVER['SCRIPT_NAME'],strlen(DIR_WS_CATALOG) ), tep_get_all_get_params(array('cache')).'cache=calcul').'">Recalculer page</a> '.
- '</div>';
+
}
@@ -1041,8 +1041,6 @@
$load = self::$load_theme;
- if ($this->page['var']['develop']=='true') $this->develop();
-
$plugins=$this->the_var('plugins');
while($r=each($plugins)){
/**
@@ -1063,6 +1061,12 @@
if(self::TestFile($file)) require_once($file);
self::$load_theme = $load;
+
+ /**
+ @remarks specific menu admin for front loggued admin
+ */
+ if(self::$CookieAdmin && tep_session_is_registered('aauth') )
+ $this->develop();
}
Modified: trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/Css/BottomTop.css
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/Css/BottomTop.css 2011-12-19 00:56:52 UTC (rev 3975)
+++ trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/Css/BottomTop.css 2011-12-19 09:15:27 UTC (rev 3976)
@@ -94,9 +94,9 @@
}
nav ul li a {
- display: block;
- margin-right: 20px;
- width: 100px;
+ display: inline-block;
+ margin-right: 20px;
+ padding: 0 10px;
line-height: 44px;
}
Modified: trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/cfg/init.php
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/cfg/init.php 2011-12-19 00:56:52 UTC (rev 3975)
+++ trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/cfg/init.php 2011-12-19 09:15:27 UTC (rev 3976)
@@ -28,14 +28,6 @@
/**
- @var develop
- commenté par defaut
- affiche le panneau des définitions de pages
-*/
-$this->add_var_page('develop','true');
-
-
-/**
@var PathChildGab Path
Childs html tpl files
*/
Modified: trunk/catalog/install/data/templates/appareil_photo/electronix/cfg/init.php
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/electronix/cfg/init.php 2011-12-19 00:56:52 UTC (rev 3975)
+++ trunk/catalog/install/data/templates/appareil_photo/electronix/cfg/init.php 2011-12-19 09:15:27 UTC (rev 3976)
@@ -15,11 +15,6 @@
Les variable local, de la page application top par exemple, eux ne le sont pas. Tout les appel ici, doit utiliser l'object constructeur
*/
-/**
- commenté par defaut
- affiche le panneau des définitions de pages
-*/
-$this->add_var_page('develop','true');
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2011-12-19 12:45:55
|
Revision: 3977
http://oscss.svn.sourceforge.net/oscss/?rev=3977&view=rev
Author: oscim
Date: 2011-12-19 12:45:41 +0000 (Mon, 19 Dec 2011)
Log Message:
-----------
Report meta canonical pre calcul?\195?\169 via seo
Correction htaccess for accept path canonical
Correction php notice
Modified Paths:
--------------
trunk/catalog/common/classes/seo_url.php
trunk/catalog/includes/application_top.php
trunk/catalog/includes/classes/page.php
trunk/catalog/includes/functions/html_output.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/Childs_tpl/header.php
trunk/catalog/install/data/templates/appareil_photo/electronix/header.php
trunk/catalog/install/includes/modele/htaccess.txt
Modified: trunk/catalog/common/classes/seo_url.php
===================================================================
--- trunk/catalog/common/classes/seo_url.php 2011-12-19 09:15:27 UTC (rev 3976)
+++ trunk/catalog/common/classes/seo_url.php 2011-12-19 12:45:41 UTC (rev 3977)
@@ -360,9 +360,16 @@
$link = $connection == 'NONSSL' ? self::$base_url : self::$base_url_ssl;
$separator = '?';
self::$htexe = true;
-// var_dump($page, $parameters);
+
$this->parse_parameters($page, $parameters ,$connection , $separator);
-// var_dump($this->header_tag);
+
+ if ($connection == 'NONSSL') $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
+ elseif ($connection == 'SSL') {
+ if (_cst_bool('ENABLE_SSL')) $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
+ else $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
+ }
+ else die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><strong>Error!</strong></font><br /><br /><strong>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL</strong><br /><br />');
+ $this->header_tag['canonical'] = $link . $page .(empty($this->header_tag['canonical'])? '' : '?'. $this->header_tag['canonical'] );
self::$htexe = false;
}
@@ -575,7 +582,15 @@
else
$cpath = '';
-// var_dump($anchor_type);
+ if(self::$htexe)
+ $this->header_tag['canonical']= sprintf(
+ $this->reg_mask['no-rewrite'],
+ $anchor_type,
+ $id,
+ $cpath.$string,
+ self::$extention
+ );
+
return sprintf(
$this->reg_mask[self::$SEO_REWRITE_TYPE],
$key,
Modified: trunk/catalog/includes/application_top.php
===================================================================
--- trunk/catalog/includes/application_top.php 2011-12-19 09:15:27 UTC (rev 3976)
+++ trunk/catalog/includes/application_top.php 2011-12-19 12:45:41 UTC (rev 3977)
@@ -238,7 +238,14 @@
if(isset($_GET['admin']) )header("Location: /");
}
}
+ elseif( isset($_GET['admin']) && $_GET['admin'] !=md5($SecuKey)) {
+ tep_session_register('aauth');
+ $aauth = 'yes';
+ // force redirect by not GET
+ if(isset($_GET['admin']) )header("Location: /");
+ }
+
/// include navigation history class
$navigation=navigation_history::getInstance();
$page->add_object('navigation_history',$navigation);
Modified: trunk/catalog/includes/classes/page.php
===================================================================
--- trunk/catalog/includes/classes/page.php 2011-12-19 09:15:27 UTC (rev 3976)
+++ trunk/catalog/includes/classes/page.php 2011-12-19 12:45:41 UTC (rev 3977)
@@ -413,23 +413,15 @@
if (_cst_bool('SEO_ENABLED')){
$seo_urls=seo_url::getInstance($languages_id);
$seo_urls->header_tags($here, $_SERVER['QUERY_STRING']);
-
-
-
- /// meta tags content for html balise
- $meta['title']=(tep_not_null($seo_urls->header_tag['title'])? $seo_urls->header_tag['title'] : (tep_not_null($this->title)? $this->title: STORE_NAME));
- if(tep_not_null($seo_urls->header_tag['desc']))
- $meta['description']=$seo_urls->header_tag['desc'];
-
- if(tep_not_null($seo_urls->header_tag['keywords']))
- $meta['keywords']=$seo_urls->header_tag['keywords'];
-
+ /// meta tags content for html balise
+ $meta=$seo_urls->header_tag;
}
else {
/// meta tags content for html balise
$meta['title']=/*(defined('HEADING_TITLE')? HEADING_TITLE : */ (tep_not_null($this->title)? $this->title: STORE_NAME) /*)*/;
$meta['description']=HEAD_DESC_TAG_ALL;
$meta['keywords']=HEAD_KEY_TAG_ALL;
+ $meta['canonical']=$here;
}
if(count($meta)<=3)
Modified: trunk/catalog/includes/functions/html_output.php
===================================================================
--- trunk/catalog/includes/functions/html_output.php 2011-12-19 09:15:27 UTC (rev 3976)
+++ trunk/catalog/includes/functions/html_output.php 2011-12-19 12:45:41 UTC (rev 3977)
@@ -230,25 +230,14 @@
return $price->print_products_price($product_info['products_id'],$style);
}
-/**
- \fn CanonicalUrl
- \brief canonical tag function -
- \return url
-*/
-function CanonicalUrl() {
- global $request_type;
- $domain = ($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER;
- $string = $_SERVER['REQUEST_URI'];
- $search = '/\&osCsid.*|\?osCsid.*/';
- $replace = '';
- return $domain . preg_replace( $search, $replace, $string );
-}
/**
Fonctions remplacé par des class
=> Retrocompatibilité
*/
+function CanonicalUrl() { global $page; return $page->GetHtmlMeta('canonical'); }
+
function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '',$mode=false) { $img=image_ratio::getInstance(); return $img->tep_image($src, $alt, $width, $height, $parameters,$mode); }
Modified: trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/Childs_tpl/header.php
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/Childs_tpl/header.php 2011-12-19 09:15:27 UTC (rev 3976)
+++ trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/Childs_tpl/header.php 2011-12-19 12:45:41 UTC (rev 3977)
@@ -67,7 +67,7 @@
<link rel="shortcut icon" type="images/x-icon" href="favicon.ico"/>
<link rel="alternate" type="application/rss+xml" title="global" href="<?php echo tep_get_httpdir().'rss.php' ?>" />
- <link rel="canonical" href="<?php echo CanonicalUrl(); ?>" />
+ <link rel="canonical" href="<?php echo $page->GetHtmlMeta('canonical'); ?>" />
</head>
<body id="<?php echo page::oscss_body_id() ; ?>" class="<?php echo 'Type_'.$page->the_type(); ?> <?php echo 'Class_'.$page->the_typeClass('class'); ?>">
Modified: trunk/catalog/install/data/templates/appareil_photo/electronix/header.php
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/electronix/header.php 2011-12-19 09:15:27 UTC (rev 3976)
+++ trunk/catalog/install/data/templates/appareil_photo/electronix/header.php 2011-12-19 12:45:41 UTC (rev 3977)
@@ -49,7 +49,7 @@
$this->draw_file_header(); ?>
<link rel="shortcut icon" type="images/x-icon" href="favicon.ico"/>
<link rel="alternate" type="application/rss+xml" title="global" href="<?php echo tep_get_httpdir().'rss.php' ?>" />
- <link rel="canonical" href="<?php echo CanonicalUrl(); ?>" />
+ <link rel="canonical" href="<?php echo $page->GetHtmlMeta('canonical'); ?>" />
</head>
<body id="<?php echo page::oscss_body_id() ; ?>" class="<?php echo 'Type_'.$page->the_type(); ?> <?php echo 'Class_'.$page->the_typeClass('class'); ?>">
Modified: trunk/catalog/install/includes/modele/htaccess.txt
===================================================================
--- trunk/catalog/install/includes/modele/htaccess.txt 2011-12-19 09:15:27 UTC (rev 3976)
+++ trunk/catalog/install/includes/modele/htaccess.txt 2011-12-19 12:45:41 UTC (rev 3977)
@@ -57,10 +57,14 @@
RewriteBase %WS_DOCUMENT_ROOT%
+ ## Accept Canonical Url or no-rewrite mode
+ RewriteCond %{REQUEST_FILENAME} ^/.*/content.* [OR]
+ RewriteCond %{REQUEST_FILENAME} ^/.*/index_listing.* [OR]
+ RewriteCond %{REQUEST_FILENAME} ^/.*/product_info.* [NC]
+ RewriteRule ^([a-zA-Z_]*)\.(php)$ index.php?%{QUERY_STRING} [L]
-
## Error Document
## Authorization htaccess & htpassword
ErrorDocument 401 %WS_DOCUMENT_ROOT%error/401.html
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2011-12-19 18:03:37
|
Revision: 3978
http://oscss.svn.sourceforge.net/oscss/?rev=3978&view=rev
Author: oscim
Date: 2011-12-19 18:03:30 +0000 (Mon, 19 Dec 2011)
Log Message:
-----------
Refonte partielle de la class de gestion de l'historique de navigation et debug erreur lors du renvoi vers la page login
Simplification via l'utilisation des pre-calcul de class SEO
mise a niveau des fichier associ?\195?\169
Modified Paths:
--------------
trunk/catalog/checkout_shipping.php
trunk/catalog/common/classes/seo_url.php
trunk/catalog/create_account.php
trunk/catalog/document.php
trunk/catalog/iframe.php
trunk/catalog/includes/application_bottom.php
trunk/catalog/includes/application_top.php
trunk/catalog/includes/classes/navigation_history.php
trunk/catalog/includes/classes/page.php
trunk/catalog/includes/content/shopping_cart.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/gabarit/address_book.form_edit.gab
trunk/catalog/login.php
trunk/catalog/popup_image.php
Modified: trunk/catalog/checkout_shipping.php
===================================================================
--- trunk/catalog/checkout_shipping.php 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/checkout_shipping.php 2011-12-19 18:03:30 UTC (rev 3978)
@@ -1,18 +1,17 @@
<?php
/**
- *\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 31/10/10, 22:59
- *\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 18/12/11, 21:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
*\file
*\brief page display choose shipping method
*/
require('includes/application_top.php');
-// require('includes/classes/http_client.php');
$page->init(basename(__FILE__),$language);
$page->is_registered();
Modified: trunk/catalog/common/classes/seo_url.php
===================================================================
--- trunk/catalog/common/classes/seo_url.php 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/common/classes/seo_url.php 2011-12-19 18:03:30 UTC (rev 3978)
@@ -361,15 +361,18 @@
$separator = '?';
self::$htexe = true;
- $this->parse_parameters($page, $parameters ,$connection , $separator);
+ $url = $this->parse_parameters($page, $parameters ,$connection , $separator);
- if ($connection == 'NONSSL') $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
+ if ($connection == 'NONSSL') $link = DIR_WS_HTTP_CATALOG;
elseif ($connection == 'SSL') {
- if (_cst_bool('ENABLE_SSL')) $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
- else $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
+ if (_cst_bool('ENABLE_SSL')) $link = DIR_WS_HTTPS_CATALOG;
+ else $link = DIR_WS_HTTP_CATALOG;
}
else die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><strong>Error!</strong></font><br /><br /><strong>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL</strong><br /><br />');
+
$this->header_tag['canonical'] = $link . $page .(empty($this->header_tag['canonical'])? '' : '?'. $this->header_tag['canonical'] );
+ $this->header_tag['url'] = $link .$url;
+
self::$htexe = false;
}
Modified: trunk/catalog/create_account.php
===================================================================
--- trunk/catalog/create_account.php 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/create_account.php 2011-12-19 18:03:30 UTC (rev 3978)
@@ -1,12 +1,12 @@
<?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: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 18/12/11, 21:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
*\file
*\brief display form creat account and manage confirmed account by email
* depend class customer
@@ -73,12 +73,11 @@
tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, 'action=success', 'SSL'));
}
elseif(isset($_GET['action']) && $_GET['action']=='success') {
- $navigation=navigation_history::getInstance();
- if (sizeof($navigation->snapshot) > 0) {
- $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
- $navigation->clear_snapshot();
- }
- else $origin_href = tep_href_link(FILENAME_DEFAULT);
+ $navigation=navigation_history::getInstance();
+ if ( ($snap = $navigation->get_snapshot()) && $snap !=false )
+ $origin_href = $snap;
+ else
+ $origin_href = tep_href_link(FILENAME_DEFAULT);
$page->init('create_account_success.php',$language);
Modified: trunk/catalog/document.php
===================================================================
--- trunk/catalog/document.php 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/document.php 2011-12-19 18:03:30 UTC (rev 3978)
@@ -12,8 +12,6 @@
$page->init(basename(__FILE__),$language);
-// die('toto');
-
switch($_REQUEST['mod']){
Modified: trunk/catalog/iframe.php
===================================================================
--- trunk/catalog/iframe.php 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/iframe.php 2011-12-19 18:03:30 UTC (rev 3978)
@@ -1,47 +1,27 @@
<?php
-/*
- $Id: popup_image.php,v 1.5 02.09.2009 21:47:46 oscim Exp $
-// kate: replace-trailing-space-save true; space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; word-wrap-marker-color #41C2A4
-+-----------------------------------------------------------------------+
-| osCSS Open Source E-commerce |
-+-----------------------------------------------------------------------+
-| Copyright (c) 2005-2009 The osCSS developers |
-| |
-| http://www.oscss.org |
-| |
-| Portions Copyright (c) 2003-2009 osCommerce |
-+-----------------------------------------------------------------------+
-| This source file is subject to version 2.0 of the GPL license, |
-| available at the following url: |
-| http://www.oscss.org/license/2_0.txt. |
-+-----------------------------------------------------------------------+
-
- ENCODE UTF-8
-*/
/**
-* @package oscss-Rv
-* @date 02.09.2009 ACCEPT RV_COMPATIBILITY a ON
- modifie pour RV_COMPATIBILITY
-*/
- require('includes/application_top.php');
- $page->init(basename(__FILE__),$language);
- $navigation->remove_current_page();
+ @ licence GPL *2005-2011 The osCSS developers - os*CSS Open Source E-commerce
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 24/09/11, 21:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ */
+require('includes/application_top.php');
+$page->init(basename(__FILE__),$language);
+$navigation->remove_current_page();
- if (isset($_GET['products_id'])) {
- //! PRODUCT
- $type='product';
+if (isset($_GET['products_id'])) {
+ //! PRODUCT
+ $type='product';
- $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, pd.products_viewed from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
+ $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, pd.products_viewed from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
- /** Control ok products */
- $product_info = tep_db_fetch_array($product_info_query);
+ /** Control ok products */
+ $product_info = tep_db_fetch_array($product_info_query);
- $page->new_class($type,$product_info);
-// $page->new_class('product_portfolio');
-// $page->new_class('customer_is',$customer_id);
-// $module=$page->_call('product','ret_modules');
-
-
+ $page->new_class($type,$product_info);
} else {
//! HOME
$type='home';
@@ -50,30 +30,30 @@
}
$module=$page->_call($type,'ret_modules');
-?>
-<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html <?php echo HTML_PARAMS; ?>>
-<head>
-<title><?php echo STORE_NAME ?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
-<!-- <title><?php echo $products['products_name']; ?></title> -->
-<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
-<script language="javascript" type="text/javascript"><!--
-var i=0;
-var s=0;
-function resize() {
- if (navigator.appName == 'Netscape') i=40;
- if (window.navigator.userAgent.indexOf("rv") != -1) i=-40; //For Firefox
+ ?>
+ <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+ <html <?php echo HTML_PARAMS; ?>>
+ <head>
+ <title><?php echo STORE_NAME ?></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+ <!-- <title><?php echo $products['products_name']; ?></title> -->
+ <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+ <script language="javascript" type="text/javascript"><!--
+ var i=0;
+ var s=0;
+ function resize() {
+ if (navigator.appName == 'Netscape') i=40;
+ if (window.navigator.userAgent.indexOf("rv") != -1) i=-40; //For Firefox
if (window.navigator.userAgent.indexOf("SV1") != -1) s=50; //This browser is Internet Explorer in SP2.
if (document.images[0]) window.resizeTo(document.images[0].width +30+s/2, document.images[0].height+60-i+s);
- self.focus();
-}
-//-->
-</script>
-<?php echo $page->_call($type,'get_header_js',@$_GET['action']); //$module->get_header_js(); ?>
-</head>
-<body onload="resize();">
- <?php $module['portfolio']->$_GET['method'](); //draw_list('son'); ?>
-</body>
-</html>
-<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file
+ self.focus();
+ }
+ //-->
+ </script>
+ <?php echo $page->_call($type,'get_header_js',@$_GET['action']); //$module->get_header_js(); ?>
+ </head>
+ <body onload="resize();">
+ <?php $module['portfolio']->$_GET['method'](); //draw_list('son'); ?>
+ </body>
+ </html>
+ <?php require('includes/application_bottom.php'); ?>
\ No newline at end of file
Modified: trunk/catalog/includes/application_bottom.php
===================================================================
--- trunk/catalog/includes/application_bottom.php 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/includes/application_bottom.php 2011-12-19 18:03:30 UTC (rev 3978)
@@ -1,14 +1,15 @@
<?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.0
- @date 12/02/11, 15:02
- @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 18/12/11, 21:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
@brief this file for close core pages
*/
+print_r($_SESSION['navigation']);
//! close session
$page->tep_session_close();
Modified: trunk/catalog/includes/application_top.php
===================================================================
--- trunk/catalog/includes/application_top.php 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/includes/application_top.php 2011-12-19 18:03:30 UTC (rev 3978)
@@ -1,12 +1,12 @@
<?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 12/10/11, 13:43
- @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 18/12/11, 21:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
*\file application_top.php
*
*/
@@ -352,8 +352,8 @@
tep_session_register('navigation');
$navigation = $page->return_object('navigation_history');
}
- $page->navigation_history->add_current_page();
+
/// Shopping cart actions
if (isset($_GET['action'])) {
/// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
Modified: trunk/catalog/includes/classes/navigation_history.php
===================================================================
--- trunk/catalog/includes/classes/navigation_history.php 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/includes/classes/navigation_history.php 2011-12-19 18:03:30 UTC (rev 3978)
@@ -1,12 +1,12 @@
<?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
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 29/03/11, 10:10
- @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 18/12/11, 21:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
\class navigation_history
\dir includes/classes/
@@ -15,12 +15,20 @@
class navigation_history {
/**
+ @var Max stock page
+ */
+ const MAX_NAVSESSION = 5;
+ /**
@var array
*/
- public $path;
+ private $path = array();
/**
@var array
*/
+ private $NoDbl = array();
+ /**
+ @var array
+ */
public $snapshot;
/**
@var object current instance
@@ -30,28 +38,48 @@
@var string current page by REQUEST_URI
*/
private static $_Page;
+ /**
+ @var current pos
+ */
+ private static $_id;
+ /**
+ @fn __construct()
+ @brief constructor
+ */
protected function __construct() {
if (tep_session_is_registered('navigation')){
$this->path = $_SESSION['navigation']->path;
$this->snapshot = $_SESSION['navigation']->snapshot;
+
+ if(sizeof($this->path) > self::MAX_NAVSESSION ){
+ $this->path = array_slice($this->path , (sizeof($this->path) - self::MAX_NAVSESSION ), self::MAX_NAVSESSION );
+ self::$_id = self::MAX_NAVSESSION ;
+ }
+
+ if(is_array($this->path))
+ foreach($this->path as $k=>$row)
+ $this->NoDbl[$k] =$row['link'] ;
}
- else $this->reset();
+ else
+ $this->reset();
+
+ self::$_id = sizeof($this->path);
}
+ /**
+ @fn getInstance()
+ @brief public call instance
+ @return instance
+ */
public static function getInstance() {
- if(self::$_instance == null) {
+ if(self::$_instance == null)
self::$_instance = new self();
- }
+
return self::$_instance;
}
- public static function resetInstance() {
- self::$_instance = null;
- return self::getInstance();
- }
-
/**
@fn $object->set_close();
@brief call by close session page. save snapshot
@@ -63,54 +91,44 @@
}
}
+ /**
+ @fn reset()
+ */
public function reset() {
$this->path = array();
$this->snapshot = array();
}
- public function add_current_page() {
+ /**
+ @brief Add current page
+ Check if page is not action page and not reload
+ */
+ public function add_current_page($page, $array) {
global $_GET, $_POST, $request_type, $cPath;
- $set = true;
- for ($i=0, $n=sizeof($this->path); $i<$n; $i++) {
- if ( ($this->path[$i]['page'] == self::cleanPage() ) ) {
- if (isset($cPath)) {
- if (!isset($this->path[$i]['get']['cPath'])) {
- continue;
- } else {
- if ($this->path[$i]['get']['cPath'] == $cPath) {
- array_splice($this->path, ($i+1));
- $set = false;
- break;
- } else {
- $old_cPath = explode('_', $this->path[$i]['get']['cPath']);
- $new_cPath = explode('_', $cPath);
+ if(
+ ( $array['url'] == $this->NoDbl[(self::$_id-1)] )
+ || in_array(trim($page), array('document.php', 'ajax_exe.php', '404.php'))
+ || isset($_REQUEST['action'])
+ || isset($_REQUEST['cache'])
+ )
+ return;
- for ($j=0, $n2=sizeof($old_cPath); $j<$n2; $j++) {
- if ($old_cPath[$j] != $new_cPath[$j]) {
- array_splice($this->path, ($i));
- $set = true;
- break 2;
- }
- }
- }
- }
- } else {
- array_splice($this->path, ($i));
- $set = true;
- break;
- }
- }
- }
+ $current = array('title' => $array['title'],
+ 'page' => $page,
+ 'mode' => $request_type,
+ 'link' => $array['url'],
+ 'get' => $_GET,
+ 'post' => $_POST
+ );
- if ((bool)$set) {
- $this->path[] = array('page' => self::cleanPage(),
- 'mode' => $request_type,
- 'get' => $_GET,
- 'post' => $_POST);
- }
+ $this->path[self::$_id] = $current;
+ $this->NoDbl[self::$_id] = $array['url'];
}
+ /**
+ @brief Remove current page
+ */
public function remove_current_page() {
$last_entry_position = sizeof($this->path) - 1;
if ($this->path[$last_entry_position]['page'] == self::cleanPage() ) {
@@ -118,31 +136,47 @@
}
}
- public function set_snapshot($page = '') {
- global $_GET, $_POST, $request_type;
+ /**
+ @brief Remove current page
+ @param $pos integer pos return value
+ @return value path link or false
+ */
+ public function GetBack($pos = 2) {
+ if(count($navigation->snapshot) > 0)
+ return $this->get_snapshot();
+ else {
+ $back = (int) sizeof($this->path)-$pos;
- if (is_array($page)) {
- $this->snapshot = array('page' => $page['page'],
- 'mode' => $page['mode'],
- 'get' => $page['get'],
- 'post' => $page['post']);
- } else {
- $this->snapshot = array('page' => self::cleanPage(),
- 'mode' => $request_type,
- 'get' => $_GET,
- 'post' => $_POST);
- }
- }
+ if (isset($this->path[$back]))
+ return $this->path[$back]['link'];
+ else
+ return tep_href_link();
+ }
- public function clear_snapshot() {
- $this->snapshot = array();
+ return false;
+ }
+
+ /**
+ @fn set_snapshot()
+ @brief Capture current snapshot
+ */
+ public function set_snapshot() {
+ $this->snapshot = $this->path[sizeof($this->path)-1];
}
/**
+ @fn get_snapshot()
@brief call content snapshot
+ @return value path link or false
*/
public function get_snapshot(){
- return $this->snapshot;
+ if(isset($this->snapshot['link']) ){
+ $url = $this->snapshot['link'];
+ $this->snapshot = array();
+ return $url;
+ }
+
+ return false;
}
public function set_path_as_snapshot($history = 0) {
@@ -161,36 +195,5 @@
}
- function unserialize($broken) {
- for(reset($broken);$kv=each($broken);) {
- $key=$kv['key'];
- if (gettype($this->$key)!="user function")
- $this->$key=$kv['value'];
- }
- }
-
-// public function debug() {
-// for ($i=0, $n=sizeof($this->path); $i<$n; $i++) {
-// echo $this->path[$i]['page'] . '?';
-// while (list($key, $value) = each($this->path[$i]['get'])) {
-// echo $key . '=' . $value . '&';
-// }
-// if (sizeof($this->path[$i]['post']) > 0) {
-// echo '<br />';
-// while (list($key, $value) = each($this->path[$i]['post'])) {
-// echo ' <strong>' . $key . '=' . $value . '</strong><br />';
-// }
-// }
-// echo '<br />';
-// }
-//
-// if (sizeof($this->snapshot) > 0) {
-// echo '<br /><br />';
-//
-// echo $this->snapshot['mode'] . ' ' . $this->snapshot['page'] . '?' . tep_array_to_string($this->snapshot['get'], array(tep_session_name())) . '<br />';
-// }
-// }
-
-
}
?>
Modified: trunk/catalog/includes/classes/page.php
===================================================================
--- trunk/catalog/includes/classes/page.php 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/includes/classes/page.php 2011-12-19 18:03:30 UTC (rev 3978)
@@ -1,12 +1,12 @@
<?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
- @portion code Copyright (c) 2002 osCommerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
- @date 06/12/11, 10:44
- @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 18/12/11, 21:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
\class page
\file
\dir includes/classes/
@@ -422,6 +422,7 @@
$meta['description']=HEAD_DESC_TAG_ALL;
$meta['keywords']=HEAD_KEY_TAG_ALL;
$meta['canonical']=$here;
+ $meta['path']=$here;
}
if(count($meta)<=3)
@@ -432,6 +433,8 @@
$this->page['seo_url']['result'] = $this->page['meta'];
$this->page['seo_url']['path'] = $here;
$this->page['seo_url']['query_string'] = $_SERVER['QUERY_STRING'];
+
+ $this->navigation_history->add_current_page( $here, $meta );
}
@@ -847,7 +850,7 @@
*/
public function is_registered(){
if (!tep_session_is_registered('customer_id')) {
-// $this->navigation_history->set_snapshot();
+ $this->navigation_history->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
}
Modified: trunk/catalog/includes/content/shopping_cart.php
===================================================================
--- trunk/catalog/includes/content/shopping_cart.php 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/includes/content/shopping_cart.php 2011-12-19 18:03:30 UTC (rev 3978)
@@ -1,12 +1,12 @@
<?php
/**
- @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.1
- @date 20/10/11, 11:14
- @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 18/12/11, 21:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
*/
$page->add_var_page('SMALL_IMAGE_WIDTH_CART', '30');
$page->add_var_page('SMALL_IMAGE_HEIGHT_CART', '30');
@@ -106,10 +106,7 @@
<?php echo '<a class="Bt navBt link" href="' . tep_href_link(FILENAME_SHOPPING_CART, 'action=resetCart') . '">' . IMAGE_BUTTON_RESET_CART . '</a>'; ?>
<input class="Bt navBt submit" type="submit" value="<?php echo IMAGE_BUTTON_UPDATE_CART; ?>" />
- <?php
- $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="' . $navigation->GetBack() . '">' . IMAGE_BUTTON_CONTINUE_SHOPPING . '</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/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php 2011-12-19 18:03:30 UTC (rev 3978)
@@ -1,22 +1,24 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
- @subpackage 2cShopHtml5Oscim
- @package osCSS-2 <www http://www.oscss.org>
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @date 16/09/10, 21:54
- @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 18/12/11, 21:44
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
*/
$page->add_var_page('SMALL_IMAGE_WIDTH_CART', '30');
$page->add_var_page('SMALL_IMAGE_HEIGHT_CART', '30');
//! chargement cart fonction d'affichage
$DCart=$cart->init_draw();
+
?>
<div id="shoppingCart">
<?php $boxe =$page->oscss_boxes->_return('checkout_progressbar'); ?>
- <?php if($boxe)echo unhtmlentities($boxe->content) ?>
+ <?php if($boxe)echo unhtmlentities($boxe->content) ?>
<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>
@@ -105,10 +107,7 @@
<?php echo '<a class="Bt navBt link" href="' . tep_href_link(FILENAME_SHOPPING_CART, 'action=resetCart') . '">' . IMAGE_BUTTON_RESET_CART . '</a>'; ?>
<input class="Bt navBt submit" type="submit" value="<?php echo IMAGE_BUTTON_UPDATE_CART; ?>" />
- <?php
- $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="' . $navigation->GetBack() . '">' . IMAGE_BUTTON_CONTINUE_SHOPPING . '</a>'; ?>
<?php echo '<a class="Bt navBt link" href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . IMAGE_BUTTON_CHECKOUT . '</a>'; ?>
</div>
Modified: trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/gabarit/address_book.form_edit.gab
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/gabarit/address_book.form_edit.gab 2011-12-19 12:45:41 UTC (rev 3977)
+++ trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/gabarit/address_book.form_edit.gab 2011-12-19 18:03:30 UTC (rev 3978)
@@ -30,17 +30,11 @@
<input class="submitBt" id="send" type="submit" value="<?php echo IMAGE_BUTTON_UPDATE; ?>" />
</div>
- <?php } else {
- if (sizeof($navigation->snapshot) > 0) {
- $back_link = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
- } else {
- $back_link = tep_href_link(FILENAME_ACCOUNT, 'aca_mod=address_book&aca_type=account&aca_action=display_view', 'SSL');
- }
- ?>
+ <?php } else { ?>
<div class="navBt">
<?php echo tep_draw_hidden_field('action', 'process') ;?>
<input type="submit" class="submitBt" value="<?php echo IMAGE_BUTTON_CONTINUE; ?>" />
- <?php echo '<a class="navBt" href="' . $back_link . '">' .IMAGE_BUTTON_BACK . '</a>'; ?>
+ <?php echo '<a class="navBt" href="' . tep_href_link(FILENAME_ACCOUNT, 'aca_mod=address_book&aca_type=account&aca_action=display_view', 'SSL') . '">' .IMAGE_BUTTON_BACK . '</a>'; ?>
</div>
<?php } ?>...
[truncated message content] |
|
From: <os...@us...> - 2011-12-19 19:49:23
|
Revision: 3980
http://oscss.svn.sourceforge.net/oscss/?rev=3980&view=rev
Author: oscim
Date: 2011-12-19 19:49:17 +0000 (Mon, 19 Dec 2011)
Log Message:
-----------
correction coquille
Ajout prise en charge de la suppression d'une ligne dans le panier via ajax et recalcul total
Modified Paths:
--------------
trunk/catalog/includes/application_bottom.php
trunk/catalog/includes/js/shopping_cart.js.php
trunk/catalog/includes/triggers/cart_totaux.inc
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/triggers/cart_totaux.inc
Added Paths:
-----------
trunk/catalog/includes/triggers/cart_line_delete.inc
Modified: trunk/catalog/includes/application_bottom.php
===================================================================
--- trunk/catalog/includes/application_bottom.php 2011-12-19 18:07:00 UTC (rev 3979)
+++ trunk/catalog/includes/application_bottom.php 2011-12-19 19:49:17 UTC (rev 3980)
@@ -9,7 +9,6 @@
@encode UTF-8
@brief this file for close core pages
*/
-print_r($_SESSION['navigation']);
//! close session
$page->tep_session_close();
Modified: trunk/catalog/includes/js/shopping_cart.js.php
===================================================================
--- trunk/catalog/includes/js/shopping_cart.js.php 2011-12-19 18:07:00 UTC (rev 3979)
+++ trunk/catalog/includes/js/shopping_cart.js.php 2011-12-19 19:49:17 UTC (rev 3980)
@@ -16,85 +16,116 @@
$(function() {
- $('.CartQty').each(function() {
- var field = $(this);
+ /**
+ @brief delete row
+ */
+ $('.CartQty').each(function() {
+ var field = $(this);
- $(this).prev().click(function() {
- var cartQty = updateQuantity(field, 1);
- var cart_id = field.attr("id");
- var data = cart_id;
- if(texte = file('<?php echo tep_href_link('ajax_exe.php', 'action=cart_line').'&'; ?>cart_id='+escape(data.substring(8))+'&'+'product_qty='+cartQty)){
- update = texte.split('|');
-// var data = cart_id;
- writebox();
- writeqty(update, data.substring(8) );
- }
+ $(this).prev().click(function() {
- });
+ var cartQty = updateQuantity(field, 1);
+ var cart_id = field.attr("id");
+ var data = cart_id;
+ if(texte = file('<?php echo tep_href_link('ajax_exe.php', 'action=cart_line').'&'; ?>cart_id='+escape(data.substring(8))+'&'+'product_qty='+cartQty)){
+ update = texte.split('|');
+ writebox();
+ writeqty(update, data.substring(8) );
+ }
+ });
- $(this).next().click(function() {
- var cartQty = updateQuantity(field, -1);
- var cart_id = field.attr("id");
- var data = cart_id;
- if(texte = file('<?php echo tep_href_link('ajax_exe.php', 'action=cart_line').'&'; ?>cart_id='+escape(data.substring(8))+'&'+'product_qty='+cartQty)){
- update = texte.split('|');
+ $(this).next().click(function() {
- writebox();
- writeqty(update, data.substring(8) );
- }
+ var cartQty = updateQuantity(field, -1);
+ var cart_id = field.attr("id");
+ var data = cart_id;
- });
+ if(texte = file('<?php echo tep_href_link('ajax_exe.php', 'action=cart_line').'&'; ?>cart_id='+escape(data.substring(8))+'&'+'product_qty='+cartQty)){
+ update = texte.split('|');
- });
+ writebox();
+ writeqty(update, data.substring(8) );
+ }
+ });
+
+ });
+
+
+ /**
+ @brief delete row
+ */
+ $('.CartDel').each(function() {
+
+ $(this).change(function() {
+ var field = $(this);
+ var cart_id = field.attr("id");
+ var data = escape(cart_id.substring(8));
+ if(texte = file('<?php echo tep_href_link('ajax_exe.php', 'action=cart_line_delete').'&'; ?>cart_id='+data)){
+ update = texte.split('|');
+ writebox();
+ $('#cart-line-'+data).remove();
+ }
+
+ });
+
+ });
+
+
+
});
+ /*
+ Lib functions
+ */
- function updateQuantity(field, qty) {
- var val = parseFloat(field.val()) + qty;
+function updateQuantity(field, qty) {
- if (val < 0) val = 0;
+ var val = parseFloat(field.val()) + qty;
- field.val(val);
+ if (val < 0) val = 0;
- return val;
- }
+ field.val(val);
+ return val;
+}
- function writebox() {
- if(texte = file('<?php echo tep_href_link('ajax_exe.php', 'action=cart_totaux'); ?>')){
- document.getElementById('TotCart').innerHTML = texte;
- }
- }
+function writebox() {
+ if(texte = file('<?php echo tep_href_link('ajax_exe.php', 'action=cart_totaux'); ?>')){
+ document.getElementById('TotCart').innerHTML = texte;
+ }
- function writeqty(update, cart_id) {
+}
- cartPriceId = 'ajaxcarttext'+cart_id;
- document.getElementById(cartPriceId).innerHTML = update[0];
- cartPriceId = 'ajaxcarttaxe'+cart_id;
- document.getElementById(cartPriceId).innerHTML = update[1];
+function writeqty(update, cart_id) {
- cartPriceId = 'ajaxcartPrice'+cart_id;
- document.getElementById(cartPriceId).innerHTML = update[3];
+ cartPriceId = 'ajaxcarttext'+cart_id;
+ document.getElementById(cartPriceId).innerHTML = update[0];
- }
+ cartPriceId = 'ajaxcarttaxe'+cart_id;
+ document.getElementById(cartPriceId).innerHTML = update[1];
+ cartPriceId = 'ajaxcartPrice'+cart_id;
+ document.getElementById(cartPriceId).innerHTML = update[3];
+}
+
+
</script>
<?php } ?>
\ No newline at end of file
Added: trunk/catalog/includes/triggers/cart_line_delete.inc
===================================================================
--- trunk/catalog/includes/triggers/cart_line_delete.inc (rev 0)
+++ trunk/catalog/includes/triggers/cart_line_delete.inc 2011-12-19 19:49:17 UTC (rev 3980)
@@ -0,0 +1,43 @@
+<?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 20/10/11, 11:13
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @brief code is part of execution shopping cart by ajax control
+*/
+
+ $cart_id_get = (int)tep_output_string_protected($_GET['cart_id']);
+ $total_nb_products_with_qty = 0;
+ $products = $cart->get_products();
+
+
+ $line =array();
+ $line['stock'] = '';
+
+
+ $products_box = $cart->get_products();
+ foreach($cart->get_products() as $i=>$products_box)
+ if($cart_id_get == $i)
+ $current = $products_box;
+
+ if(!isset($current) || !is_array($current) )
+ return false;
+
+ $cart->remove($current['id']);
+
+ $products_sum = $currencies->format(tep_round(tep_add_tax($current['final_price'], tep_get_tax_rate($current['tax_class_id'])),$currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) *$product_qty_get );
+
+ $line['stock'] = 0;
+
+ $line['tot_ht'] = $currencies->format($proud_ht);
+ $line['tot_ttc'] = $currencies->format($products_sum);
+
+ $line['tot_taxe'] = $currencies->format( $products_sum - $proud_ht );
+
+
+ echo implode('|',$line);
+?>
\ No newline at end of file
Modified: trunk/catalog/includes/triggers/cart_totaux.inc
===================================================================
--- trunk/catalog/includes/triggers/cart_totaux.inc 2011-12-19 18:07:00 UTC (rev 3979)
+++ trunk/catalog/includes/triggers/cart_totaux.inc 2011-12-19 19:49:17 UTC (rev 3980)
@@ -10,16 +10,15 @@
@brief code is part of execution shopping cart by ajax control
*/
-
global $cart;
if (is_object($cart) && $cart->count_contents() > 0) {
foreach($cart->show_list_total() as $i=>$tot) {
- $det .= '<li>'. sprintf('<span>%s </span> %s' ,$tot->text, $currencies->format($tot->value)) .'</li>' ;
+ $det .= '<li>'. sprintf('<span class="text">%s </span> <span class="value">%s</span>' ,$tot->text, $currencies->format($tot->value)) .'</li>' ;
}
- $det .= '<li><span>'.__('box shopping cart weight').'</span> '.$cart->show_weight().' '.UNIT_WEIGHT_NAME.'</a></li>'."\n";
+ $det .= '<li><span class="text">'.__('box shopping cart weight').'</span> <span class="value">'.$cart->show_weight().' '.UNIT_WEIGHT_NAME.'</span></li>'."\n";
}
Modified: trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php 2011-12-19 18:07:00 UTC (rev 3979)
+++ trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/shopping_cart.php 2011-12-19 19:49:17 UTC (rev 3980)
@@ -26,14 +26,15 @@
<?php if ($cart->count_contents() > 0): ?>
<table class="invoice invoiceDetails" cellspacing="0" >
- <tr>
- <th class="cart-header desc tleft"><?php echo TABLE_HEADING_PRODUCTS; ?></th>
- <th class="cart-header puht tcenter"><?php echo HEADING_PRODUCTS_PRICE_U; ?></th>
- <th class="cart-header qty tcenter"><?php echo HEADING_PRODUCTS_QTY; ?></th>
- <th class="cart-header taxe tcenter"><?php echo HEADING_PRODUCTS_TAXE; ?></th>
- <th class="cart-header tottaxe tright"><?php echo HEADING_PRODUCTS_TOT_TAXE ?></th>
- <th class="cart-header totttc tright"><?php echo HEADING_PRODUCTS_TOT_TTC; ?></th>
- </tr>
+ <tr>
+ <th class="cart-header desc tleft"><?php echo TABLE_HEADING_PRODUCTS; ?></th>
+ <th class="cart-header puht tcenter"><?php echo HEADING_PRODUCTS_PRICE_U; ?></th>
+ <th class="cart-header qty tcenter"><?php echo HEADING_PRODUCTS_QTY; ?></th>
+ <th class="cart-header taxe tcenter"><?php echo HEADING_PRODUCTS_TAXE; ?></th>
+ <th class="cart-header tottaxe tright"><?php echo HEADING_PRODUCTS_TOT_TAXE ?></th>
+ <th class="cart-header totttc tright"><?php echo HEADING_PRODUCTS_TOT_TTC; ?></th>
+ <th class="cart-header tright"> </th>
+ </tr>
@@ -41,29 +42,31 @@
<?php foreach($DCart->products as $i=>$product): ?>
- <tr class="cart-line <?php echo ($i%2)?'pair':'impair'; ?>">
- <td class="cart-line desc">
- <?php echo $product['name'] ;?><span id="ajaxcarttext<?php echo $i; ?>"><?php echo $product['alert_stock'] ;?></span>
- </td>
- <td class="cart-line puht tcenter">
- <?php echo $currencies->format($product['price']) ;?>
- </td>
- <td class="cart-line qty tcenter">
- <input class="Bt button cart-line" type="button" value="+" >
- <?php echo tep_draw_input_field('cart_quantity[]','cartQty_'.$i, $product['quantity'], 'class="CartQty" ');?>
- <input class="Bt button cart-line" type="button" value="-" >
-
- <?php echo tep_draw_hidden_field('products_id[]', $product['id']) ; ?>
- </td>
- <td class="cart-line taxe tcenter">
- <?php echo tep_get_tax_rate($product['tax_class_id']) ;?> </span>
- </td>
- <td class="cart-line tottaxe tright">
- <span id="ajaxcarttaxe<?php echo $i; ?>" class="cartPrice"> <?php echo$currencies->format( ($product['final_price_ttc'] - $product['final_price']) ) ;?> </span>
- </td>
- <td class="cart-line totttc tright">
- <span id="ajaxcartPrice<?php echo $i; ?>" class="cartPrice"> <?php echo $currencies->format(tep_add_tax($product['final_price'], tep_get_tax_rate($product['tax_class_id'])) *$product['quantity'] ) ;?> </span>
- </td>
+ <tr id="cart-line-<?php echo $i; ?>" class="cart-line <?php echo ($i%2)?'pair':'impair'; ?>">
+ <td class="cart-line desc">
+ <?php echo $product['name'] ;?><span id="ajaxcarttext<?php echo $i; ?>"><?php echo $product['alert_stock'] ;?></span>
+ </td>
+ <td class="cart-line puht tcenter">
+ <?php echo $currencies->format($product['price']) ;?>
+ </td>
+ <td class="cart-line qty tcenter">
+ <input class="Bt button cart-line" type="button" value="+" >
+ <?php echo tep_draw_input_field('cart_quantity[]','cartQty_'.$i, $product['quantity'], 'class="CartQty" ');?>
+ <input class="Bt button cart-line" type="button" value="-" >
+ <?php echo tep_draw_hidden_field('products_id[]', $product['id']) ; ?>
+ </td>
+ <td class="cart-line taxe tcenter">
+ <?php echo tep_get_tax_rate($product['tax_class_id']) ;?> </span>
+ </td>
+ <td class="cart-line tottaxe tright">
+ <span id="ajaxcarttaxe<?php echo $i; ?>" class="cartPrice"> <?php echo$currencies->format( ($product['final_price_ttc'] - $product['final_price']) ) ;?> </span>
+ </td>
+ <td class="cart-line totttc tright">
+ <span id="ajaxcartPrice<?php echo $i; ?>" class="cartPrice"> <?php echo $currencies->format(tep_add_tax($product['final_price'], tep_get_tax_rate($product['tax_class_id'])) *$product['quantity'] ) ;?> </span>
+ </td>
+ <td class="cart-line tcenter">
+ <span id="ajaxcartdel<?php echo $i; ?>"> <?php echo tep_draw_checkbox_field('cart_delete['.$i.']','CartDel_'.$i, $i, false, 'class="CartDel" ');?> </span>
+ </td>
</tr>
@@ -79,7 +82,7 @@
<div class="SubTotal">
<ul id="TotCart">
<?php foreach($cart->show_list_total() as $i=>$tot): ?>
- <li><?php printf('<span>%s </span><span class="value"> %s </span>' ,$tot->text, $currencies->format($tot->value)); ?></li>
+ <li><?php printf('<span class="text">%s </span><span class="value"> %s </span>' ,$tot->text, $currencies->format($tot->value)); ?></li>
<?php endforeach; ?>
<?php if($cart->get_content_type() !='virtual'): ?>
Modified: trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/triggers/cart_totaux.inc
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/triggers/cart_totaux.inc 2011-12-19 18:07:00 UTC (rev 3979)
+++ trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/triggers/cart_totaux.inc 2011-12-19 19:49:17 UTC (rev 3980)
@@ -14,7 +14,7 @@
if (is_object($cart) && $cart->count_contents() > 0) {
foreach($cart->show_list_total() as $i=>$tot) {
- $det .= '<li>'. sprintf('<span>%s </span> <span class="value">%s</span>' ,$tot->text, $currencies->format($tot->value)) .'</li>' ;
+ $det .= '<li>'. sprintf('<span class="text">%s </span> <span class="value">%s</span>' ,$tot->text, $currencies->format($tot->value)) .'</li>' ;
}
$det .= '<li><span class="text">'.__('box shopping cart weight').'</span> <span class="value">'.$cart->show_weight().' '.UNIT_WEIGHT_NAME.'</span></li>'."\n";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2011-12-20 22:18:35
|
Revision: 3984
http://oscss.svn.sourceforge.net/oscss/?rev=3984&view=rev
Author: oscim
Date: 2011-12-20 22:18:28 +0000 (Tue, 20 Dec 2011)
Log Message:
-----------
int?\195?\169gration de la gestion et du suivi des images en db
Int?\195?\169gration des update/create/delete via tinybroswer
Add class de gestion sqlimages dans le bo
Amelioration page documents
refonte tep_info_image pour traiter l'appel des image via le fichier documents
Modified Paths:
--------------
trunk/catalog/admin/document.php
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/edit.php
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php
trunk/catalog/admin/includes/classes/drivers/sqlimage.php
trunk/catalog/admin/includes/functions/html_output.php
trunk/catalog/admin/includes/gabarit/configuration/modmembres.listing.gab
Added Paths:
-----------
trunk/catalog/install/includes/sql/mysql/tables/osc_images.sql
Modified: trunk/catalog/admin/document.php
===================================================================
--- trunk/catalog/admin/document.php 2011-12-19 21:14:41 UTC (rev 3983)
+++ trunk/catalog/admin/document.php 2011-12-20 22:18:28 UTC (rev 3984)
@@ -28,24 +28,35 @@
@remarks Adjust type requete
*/
switch((string)$_REQUEST['typ']){
- case 'product':
- $res=sqlproduct::fetch(array('id'=>(int)$_REQUEST['id'],'language_id'=>$languages_id), true);
+ case 'product':
+ $res=sqlproduct::fetch(array('id'=>(int)$_REQUEST['id'],'language_id'=>$languages_id), true);
- $img = $res->image;
- $ext1 = $ext = str_replace('.','',substr($img,-4));
- break;
+ $img = $res->image;
+ break;
+ case 'db':
+ if(isset($_REQUEST['id']))
+ $myar = array('id'=>(int)$_REQUEST['id']);
+ elseif(isset($_REQUEST['key']))
+ $myar = array('pathkey'=>$_REQUEST['key']);
+
+ $res=sqlimage::fetch($myar, true);
+// print_r($res);
+// exit;
+ $img = preg_replace('#^('.DIR_WS_IMAGES.')#' , '', $res->path);
+ break;
}
$get=image_ratio::get_image(DIR_WS_CATALOG_IMAGES.$img,'',$width,$height);
+ $img=preg_replace('#^('.DIR_WS_CATALOG_IMAGES.')#' , '', $get['src']);
+ $ext = str_replace('.','',substr($img,-4));
if($ext='jpg')$ext='jpeg';
+// var_dump($ext);
+// exit;
+ header('Content-type: image/'.$ext);
- $img=$get['src'];
-
- header('Content-type: image/'.$ext1);
-
- readfile(HTTP_SERVER.$img);
+ readfile(DIR_FS_CATALOG_IMAGES.$img);
exit;
break;
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/edit.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/edit.php 2011-12-19 21:14:41 UTC (rev 3983)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/edit.php 2011-12-20 22:18:28 UTC (rev 3984)
@@ -92,7 +92,22 @@
foreach($_POST['deletefile'] as $delthis => $val)
{
$delthisfile = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$delthis];
- if (file_exists($delthisfile) && unlink($delthisfile)) $deleteqty++; else $errorqty++;
+ if (file_exists($delthisfile) && unlink($delthisfile)) $deleteqty++;
+ else $errorqty++;
+
+ /**
+ @remarks Check And add if not exists in db table
+ */
+ $res= sqlimage::fetch(array('path'=>.$editpath.$_POST['actionfile'][$delthis]), true);
+ if($res){
+
+ $sql = array(
+ 'id'=>$res->rowid,
+ );
+ $res= sqlimage::delete($sql);
+ }
+
+
if($typenow=='image')
{
$delthisthumb = $tinybrowser['docroot'].$editpath.$tinybrowser['thumbfolder'].'/_'.$_POST['actionfile'][$delthis];
@@ -110,7 +125,24 @@
{
$namethisfilefrom = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$namethis];
$namethisfileto = $tinybrowser['docroot'].$editpath.clean_filename($newname.$_POST['renameext'][$namethis]);
- if (file_exists($namethisfilefrom) && rename($namethisfilefrom,$namethisfileto)) $renameqty++; else $errorqty++;
+ if (file_exists($namethisfilefrom) && rename($namethisfilefrom,$namethisfileto)) $renameqty++;
+ else $errorqty++;
+
+ /**
+ @remarks Check And add if not exists in db table
+ */
+ $res= sqlimage::fetch(array('path'=>$editpath.$_POST['actionfile'][$namethis]), true);
+ if($res){
+
+ $sql = array(
+ 'id'=>$res->rowid,
+ 'path'=>$editpath.clean_filename($newname.$_POST['renameext'][$namethis]),
+ 'pathkey'=>$editpath.clean_filename($newname.$_POST['renameext'][$namethis]),
+ 'file'=>basename($editpath.clean_filename($newname.$_POST['renameext'][$namethis])),
+ );
+ $res= sqlimage::update($sql);
+ }
+
if($typenow=='image')
{
$namethisthumbfrom = $tinybrowser['docroot'].$editpath.$tinybrowser['thumbfolder'].'/_'.$_POST['actionfile'][$namethis];
@@ -128,6 +160,24 @@
{
$movethisfile = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$movethis];
$movefiledest = $tinybrowser['docroot'].$destfolder.$_POST['actionfile'][$movethis];
+
+
+ /**
+ @remarks Check And add if not exists in db table
+ */
+ $res= sqlimage::fetch(array('path'=>$editpath.$_POST['actionfile'][$movethis]), true);
+ if($res){
+
+ $sql = array(
+ 'id'=>$res->rowid,
+ 'path'=>$destfolder.$_POST['actionfile'][$movethis],
+ 'pathkey'=>$destfolder.$_POST['actionfile'][$movethis],
+ 'file'=>basename($destfolder.$_POST['actionfile'][$movethis]),
+ );
+ $res= sqlimage::update($sql);
+ }
+
+
if (!file_exists($movefiledest) && file_exists($movethisfile) && copy($movethisfile,$movefiledest))
{
$moveqty++;
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php 2011-12-19 21:14:41 UTC (rev 3983)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php 2011-12-20 22:18:28 UTC (rev 3984)
@@ -353,7 +353,7 @@
$filenum=0;
foreach($filetypes as $filetype)
{
- $filenum = $filenum + count(glob($root.$tree.$branch.tn_sql_regcase($filetype),GLOB_NOSORT));
+ $filenum = $filenum + count(glob($root.$tree.$branch.'/'.$filetype,GLOB_NOSORT));
}
$treeparts = explode('/',rtrim($tree,'/'));
$topname = end($treeparts);
@@ -369,7 +369,7 @@
$filenum=0;
foreach($filetypes as $filetype)
{
- $filenum = $filenum + count(glob($root.$tree.$branch.$dirname.'/'.tn_sql_regcase($filetype),GLOB_NOSORT));
+ $filenum = $filenum + count(glob($root.$tree.$branch.$dirname.'/'.$filetype,GLOB_NOSORT));
}
$indent = '';
for($i=0;$i<$level;$i++) { $indent .= ' '; }
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php 2011-12-19 21:14:41 UTC (rev 3983)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php 2011-12-20 22:18:28 UTC (rev 3984)
@@ -91,13 +91,14 @@
$u=0;
while (($filename = readdir($dh)) !== false)
{
+
// get file extension
$nameparts = explode('.',$filename);
$ext = end($nameparts);
unset($imginfo);
// filter directories and prohibited file types
- if($filename != '.' && $filename != '..' && !is_dir($tinybrowser['docroot'].$browsepath.$filename) && !in_array($ext, $tinybrowser['prohibited']) && ($typenow == 'file' || strpos(strtolower($tinybrowser['filetype'][$typenow]),strtolower($ext))))
- {
+ if($filename != '.' && $filename != '..' && !is_dir($tinybrowser['docroot'].$browsepath.$filename) && !in_array($ext, $tinybrowser['prohibited']) && ($typenow == 'file' || strpos(strtolower($tinybrowser['filetype'][$typenow]),strtolower($ext)))
+ ) {
// search file name if search term entered
if($findnow) $exists = strpos(strtolower($filename),strtolower($findnow));
@@ -105,6 +106,7 @@
if(!$findnow || ($findnow && $exists !== false))
{
$file['name'][$u] = $filename;
+ $file['title'][$u] = $filename;
$file['sortname'][$u] = strtolower($filename);
$file['modified'][$u] = filemtime($tinybrowser['docroot'].$browsepath.$filename);
$file['size'][$u] = filesize($tinybrowser['docroot'].$browsepath.$filename);
@@ -112,14 +114,46 @@
// image specific info or general
if($typenow=='image' ) /*getimagesize($tinybrowser['docroot'].$browsepath.$filename)*//*)*/
{
- $imginfo = image_ratio::get_image($tinybrowser['docroot'].$browsepath.$filename,'',$tinybrowser['thumbsize'],$tinybrowser['thumbsize']);
- $file['width'][$u] = $imginfo['width'] ;//$imginfo[0];
- $file['height'][$u] = $imginfo['height'] ;//$imginfo[1];
- $file['dimensions'][$u] = $imginfo['width']+$imginfo['height'] ;// $imginfo[0] + $imginfo[1];
- $file['type'][$u] = $imginfo['mime'];
- $file['src'][$u] = $imginfo['src'];
+ /**
+ @remarks Check And add if not exists in db table
+ */
+ $res= sqlimage::fetch(array('path'=>$browsepath.$filename), true);
+
+ if(!$res){
+ $imginfo = image_ratio::get_image($tinybrowser['docroot'].$browsepath.$filename,'');
+
+ $sql = array(
+ 'path'=>$browsepath.$filename,
+ 'file'=>$filename,
+ 'width'=>$imginfo['width'],
+ 'height'=>$imginfo['height'],
+ 'ext'=>$imginfo['mime'],
+ );
+
+ $id = $res= sqlimage::create($sql);
+ $width = $imginfo['width'] ;
+ $height = $imginfo['height'] ;
+ $ext = $imginfo['mime'] ;
+ $src =$imginfo['src'];
}
+ else{
+ $id = $res->rowid;
+ $width = $res->width ;
+ $height = $res->height ;
+ $ext = $res->ext ;
+ $src = $res->path ;
+ }
+
+ $file['width'][$u] = $width;
+ $file['height'][$u] = $height;
+ $file['dimensions'][$u] =$width+$height ;// $imginfo[0] + $imginfo[1];
+ $file['type'][$u] = $ext; //$imginfo['mime'];
+ $file['src'][$u] =$src;
+ $file['id'][$u] =$id;
+
+
+ }
else
{
$file['width'][$u] = 'N/A';
@@ -128,8 +162,8 @@
$file['type'][$u] = returnMIMEType($filename);
}
}
+ $u++;
}
- $u++;
}
closedir($dh);
}
@@ -150,6 +184,7 @@
}
}
+
// Assign directory structure to array
$browsedirs=array();
dirtree($browsedirs,$tinybrowser['filetype'][$typenow],$tinybrowser['docroot'],$tinybrowser['path'][$typenow]);
@@ -299,16 +334,16 @@
for($i=$showpage_start;$i<$showpage_end;$i++)
{
- echo '<div class="img-browser"><a href="#" onclick="selectURL(\''.$linkpath.$file['name'][$i].'\');" title="'.TB_FILENAME.': '.$file['name'][$i]
+ echo '<div class="img-browser"><a href="#" onclick="selectURL(\''.$linkpath.$file['name'][$i].'\');" title="'.TB_FILENAME.': '.$file['title'][$i]
.' '.TB_DIMENSIONS.': '.$file['width'][$i].' x '.$file['height'][$i]
.' '.TB_DATE.': '.date($tinybrowser['dateformat'],$file['modified'][$i])
.' '.TB_TYPE.': '.$file['type'][$i]
.' '.TB_SIZE.': '.bytestostring($file['size'][$i],1)
.'">'
- .'<img src="'.tep_get_http().$file['src'][$i] .'" />'
+ .'<img src="'.tep_get_http().DIR_WS_ADMIN.'document.php?mod=img&typ=db&id='.$file['id'][$i].'&w='.$tinybrowser['thumbsize'].'&h='.$tinybrowser['thumbsize'] /*$file['src'][$i]*/ .'" />'
// .'<img src="'.$thumbpath.$tinybrowser['thumbfolder'].'/_'.$file['name'][$i] . .'" />'
// .tep_image()
- .'<div class="filename">'.$file['name'][$i].'</div></a></div>';
+ .'<div class="filename">'.$file['title'][$i].'</div></a></div>';
}
}
else
@@ -317,8 +352,8 @@
{
$alt = (IsOdd($i) ? 'r1' : 'r0');
echo '<tr class="'.$alt.'">';
- if($typenow=='image') echo '<td><a class="imghover" href="#" onclick="selectURL(\''.$linkpath.$file['name'][$i].'\');" title="'.$file['name'][$i].'"><img src="'.$thumbpath.$tinybrowser['thumbfolder'].'/_'.$file['name'][$i].'" alt="" />'.truncate_text($file['name'][$i],30).'</a></td>';
- else echo '<td><a href="#" onclick="selectURL(\''.$linkpath.$file['name'][$i].'\');" title="'.$file['name'][$i].'">'.truncate_text($file['name'][$i],30).'</a></td>';
+ if($typenow=='image') echo '<td><a class="imghover" href="#" onclick="selectURL(\''.$linkpath.$file['name'][$i].'\');" title="'.$file['title'][$i].'"><img src="'.tep_get_http().DIR_WS_ADMIN.'document.php?mod=img&typ=db&id='.$file['id'][$i].'&w='.$tinybrowser['thumbsize'].'&h='.$tinybrowser['thumbsize']/*$thumbpath.$tinybrowser['thumbfolder'].'/_'.$file['name'][$i]*/.'" alt="" />'.truncate_text($file['name'][$i],30).'</a></td>';
+ else echo '<td><a href="#" onclick="selectURL(\''.$linkpath.$file['name'][$i].'\');" title="'.$file['name'][$i].'">'.truncate_text($file['title'][$i],30).'</a></td>';
echo '<td>'.bytestostring($file['size'][$i],1).'</td>';
if($typenow=='image') echo '<td>'.$file['width'][$i].' x '.$file['height'][$i].'</td>';
echo '<td>'.$file['type'][$i].'</td>'
Modified: trunk/catalog/admin/includes/classes/drivers/sqlimage.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlimage.php 2011-12-19 21:14:41 UTC (rev 3983)
+++ trunk/catalog/admin/includes/classes/drivers/sqlimage.php 2011-12-20 22:18:28 UTC (rev 3984)
@@ -16,22 +16,27 @@
EN cours de dev
-CREATE TABLE IF NOT EXISTS `osc_images` (
- `rowid` int(11) NOT NULL,
- `path` varchar(250) NOT NULL,
- `file` varchar(100) NOT NULL,
- `date_added` datetime NOT NULL,
- `last_modified` datetime NOT NULL,
- PRIMARY KEY (`rowid`)
-) ENGINE=InnoDB DEFAULT ;
+CREATE TABLE IF NOT EXISTS osc_images (
+ rowid int(11) NOT NULL AUTO_INCREMENT,
+ pathkey varchar(32) NOT NULL,
+ path varchar(250) NOT NULL,
+ file varchar(100) NOT NULL,
+ date_added datetime NOT NULL,
+ last_modified datetime NOT NULL,
+ width int(5) NOT NULL,
+ height int(5) NOT NULL,
+ ext char(4) NOT NULL,
+ PRIMARY KEY (rowid)
+)
-CREATE TABLE IF NOT EXISTS `osc_images_used` (
- `rowid` int(11) NOT NULL,
- `width` float NOT NULL,
- `height` float NOT NULL,
- `watermark` varchar(100) NOT NULL
+
+CREATE TABLE IF NOT EXISTS osc_images_used (
+ rowid int(11) NOT NULL,
+ width float NOT NULL,
+ height float NOT NULL,
+ watermark varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT ;
*/
@@ -64,15 +69,21 @@
public static function create($option){
self::getInstance();
+
if(!isset($option['path']))
return 'path';
if(!isset($option['file']))
return 'file';
- $sql_data_array['path'] = 'now()';
- $sql_data_array['file'] = 'now()';
+ $sql_data_array['pathkey']= md5($option['path']);
+ $sql_data_array['path'] =$option['path'];
+ $sql_data_array['file'] = basename($option['file']);
$sql_data_array['date_added'] = 'now()';
+ if(isset($option['width'])) $sql_data_array['width'] =$option['width'];
+ if(isset($option['height'])) $sql_data_array['height'] =$option['height'];
+ if(isset($option['ext'])) $sql_data_array['ext'] =$option['ext'];
+
$res=tep_db_perform(TABLE_IMAGES, $sql_data_array);
if(!$res)
@@ -92,13 +103,22 @@
if(!isset($option['file']))
return 'file';
$where ='';
+
if(isset($option['id'])) $where .="AND rowid = '".(int)$option['id']."' ";
+ if(isset($option['path'])) $sql .="AND path = '".tep_db_input($option['path'])."' ";
+ if(isset($option['pathkey']))
+ $sql .="AND pathkey = '".tep_db_input($option['pathkey'])."' ";
+ elseif(isset($option['path']))
+ $sql_data_array['pathkey']= md5($option['path']);
+ $sql_data_array['path'] =$option['path'];
+ $sql_data_array['file'] = basename($option['file']);
+ $sql_data_array['last_modified'] = 'now()';
+ if(isset($option['width'])) $sql_data_array['width'] =$option['width'];
+ if(isset($option['height'])) $sql_data_array['height'] =$option['height'];
+ if(isset($option['ext'])) $sql_data_array['ext'] =$option['ext'];
- $sql_data_array['path'] = 'now()';
- $sql_data_array['file'] = 'now()';
- $sql_data_array['last_modified'] = 'now()';
$res=tep_db_perform(TABLE_IMAGES, $sql_data_array, 'update' , substr($where,3) );
return $res;
@@ -131,13 +151,18 @@
$sql ="";
if(isset($option['id'])) $sql .="AND rowid = '".(int)tep_db_input($option['id'])."' ";
+ if(isset($option['path'])) $sql .="AND path = '".tep_db_input($option['path'])."' ";
+ if(isset($option['pathkey']))
+ $sql .="AND pathkey = '".tep_db_input($option['pathkey'])."' ";
+ elseif(isset($option['path']))
+ $sql .="AND pathkey = '".md5(tep_db_input($option['path']))."' ";
$sql="SELECT * FROM " . TABLE_IMAGES . " a ".
- " LEFT JOIN " . TABLE_IMAGES_USED . " g ON (a.rowid=g.rowid) ".
+// " LEFT JOIN " . TABLE_IMAGES_USED . " g ON (a.rowid=g.rowid) ".
" WHERE ".substr($sql,3);
-
+// echo $sql;
$res=$DB->query($sql);
$num = $res->__get('numRows');
@@ -175,7 +200,7 @@
// self::$modules->delete($categories[$i]['id']);
- $DB->query("delete from " . TABLE_IMAGES_USED . " where rowid = '" . (int)$_id . "' ");
+// $DB->query("delete from " . TABLE_IMAGES_USED . " where rowid = '" . (int)$_id . "' ");
$DB->query("delete from " . TABLE_IMAGES . " where rowid = '" . (int)$_id . "'");
@@ -196,7 +221,8 @@
'last_modified' => '',
'width' => '',
'height' => '',
- 'watermark' => '',
+ 'ext' => '',
+// 'watermark' => '',
);
return self::CleanKey($par);
Modified: trunk/catalog/admin/includes/functions/html_output.php
===================================================================
--- trunk/catalog/admin/includes/functions/html_output.php 2011-12-19 21:14:41 UTC (rev 3983)
+++ trunk/catalog/admin/includes/functions/html_output.php 2011-12-20 22:18:28 UTC (rev 3984)
@@ -226,15 +226,18 @@
return '<a class="button ActionBack" href="' . $href . '" '.$js.'>'.$text.'</a>';
}
+// public images
+function tep_info_image($image, $alt, $width = '', $height = '', $parameters = '',$mode=false) { return '<img src="'.tep_href_link('document.php', 'mod=img&typ=db&key='.md5('images/'.$image).'&w='.$width.'&h='.$height).'" alt="'.$alt.'" title="'.$image.'" '.$parameters.'/>'; }
+
/**
Fonctions remplacé par des class
=> Retrocompatibilité
*/
function tep_customers_row_action($customers_id,$opt='') { return customerUtility::DisplayRowAction($customers_id,$opt); }
function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '',$mode=false) { $img=image_ratio::getInstance(); return $img->tep_image($src, $alt, $width, $height, $parameters,$mode); }
-function tep_info_image($image, $alt, $width = '', $height = '') { return tep_image(DIR_WS_CATALOG_IMAGES . $image, $alt, $width, $height); }
+
function tep_image_submit($image, $alt = '', $parameters = '',$classCss='') { return formUtility::image_submit($image, $alt, $parameters ,$classCss); }
function tep_image_button($image, $alt = '', $params = ''){ return formUtility::image_button($image, $alt, $parameters ); }
function tep_draw_form($name, $action, $parameters = '', $method = 'post', $params = ''){ return formUtility::draw_form($name, $action, $parameters, $method, $params ); }
Modified: trunk/catalog/admin/includes/gabarit/configuration/modmembres.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/configuration/modmembres.listing.gab 2011-12-19 21:14:41 UTC (rev 3983)
+++ trunk/catalog/admin/includes/gabarit/configuration/modmembres.listing.gab 2011-12-20 22:18:28 UTC (rev 3984)
@@ -144,28 +144,7 @@
- <fieldset class="block_field">
- <legend><?php echo __('modmembres legend state') ?></legend>
- <div class="block_input">
- <?php /** */ $row = modmembres::$list['ACCOUNT_STATE']; ?>
- <div class="fleft w_50">
- <label title="<?php echo '('.$row->key.' - ' . $row->set . ')'; ?>"><?php echo __($row->description). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
- <p>
- <?php echo $row->value_field ; ?>
- </p>
- </div>
- <?php if(_test_bool(modmembres::$list['ACCOUNT_STATE']->value)): ?>
- <?php /** */ $row = modmembres::$list['ENTRY_STATE_MIN_LENGTH']; ?>
- <div class="fleft w_50">
- <label title="<?php echo '('.$row->key.' - ' . $row->set . ')'; ?>"><?php echo __($row->description). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
- <p>
- <?php echo $row->value_field ; ?>
- </p>
- </div>
- <?php endif; ?>
- </div>
- </fieldset>
<fieldset class="block_field">
@@ -254,7 +233,31 @@
<fieldset class="block_field">
+ <legend><?php echo __('modmembres legend state') ?></legend>
+ <div class="block_input">
+ <?php /** */ $row = modmembres::$list['ACCOUNT_STATE']; ?>
+ <div class="fleft w_50">
+ <label title="<?php echo '('.$row->key.' - ' . $row->set . ')'; ?>"><?php echo __($row->description). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
+ <p>
+ <?php echo $row->value_field ; ?>
+ </p>
+ </div>
+ <?php if(_test_bool(modmembres::$list['ACCOUNT_STATE']->value)): ?>
+ <?php /** */ $row = modmembres::$list['ENTRY_STATE_MIN_LENGTH']; ?>
+ <div class="fleft w_50">
+ <label title="<?php echo '('.$row->key.' - ' . $row->set . ')'; ?>"><?php echo __($row->description). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></label>
+ <p>
+ <?php echo $row->value_field ; ?>
+ </p>
+ </div>
+ <?php endif; ?>
+ </div>
+ </fieldset>
+
+
+ <fieldset class="block_field">
+
<legend><?php echo __('modmembres legend general'); ?></legend>
<ul class="block_input">
@@ -350,7 +353,7 @@
<ul class="block_input">
<?php foreach(modmembres::$list as $row)
- if(!in_array($row->key,array('ACCOUNT_DOB','ENTRY_DOB_MIN','MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX','MAX_DISPLAY_ORDER_HISTORY','CC_NUMBER_MIN_LENGTH', 'CC_OWNER_MIN_LENGTH', 'ACCOUNT_DOB', 'ENTRY_DOB_MIN_LENGTH', 'ENTRY_LAST_NAME_MIN_LENGTH', 'ENTRY_FIRST_NAME_MIN_LENGTH','ACCOUNT_GENDER' ,'ENTRY_EMAIL_ADDRESS_MIN_LENGTH', 'ENTRY_STREET_ADDRESS_MIN_LENGTH', 'ENTRY_POSTCODE_MIN_LENGTH', 'ENTRY_CITY_MIN_LENGTH', 'ACCOUNT_COMPANY', 'ENTRY_COMPANY_MIN_LENGTH','CUSTOMER_FORCE_UCWORDS','CUSTOMER_FORCE_STRTOUPPER','ENTRY_STATE_MIN_LENGTH', 'ACCOUNT_STATE', 'ENTRY_PASSWORD_MIN_LENGTH', 'ENTRY_TELEPHONE_MIN_LENGTH', 'ACCOUNT_FAXNUM', 'ACCOUNT_COUNTRY')) ) { ?>
+ if(!in_array($row->key,array('ACCOUNT_DOB','ENTRY_DOB_MIN','MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX','MAX_DISPLAY_ORDER_HISTORY','CC_NUMBER_MIN_LENGTH', 'CC_OWNER_MIN_LENGTH', 'ACCOUNT_DOB', 'ENTRY_DOB_MIN_LENGTH', 'ENTRY_LAST_NAME_MIN_LENGTH', 'ENTRY_FIRST_NAME_MIN_LENGTH','ACCOUNT_GENDER' ,'ENTRY_EMAIL_ADDRESS_MIN_LENGTH', 'ENTRY_STREET_ADDRESS_MIN_LENGTH', 'ENTRY_POSTCODE_MIN_LENGTH', 'ENTRY_CITY_MIN_LENGTH', 'ACCOUNT_COMPANY', 'ENTRY_COMPANY_MIN_LENGTH','CUSTOMER_FORCE_UCWORDS','CUSTOMER_FORCE_STRTOUPPER','ENTRY_STATE_MIN_LENGTH', 'ACCOUNT_STATE', 'ENTRY_PASSWORD_MIN_LENGTH', 'ENTRY_TELEPHONE_MIN_LENGTH', 'ACCOUNT_FAXNUM', 'ACCOUNT_COUNTRY', 'CUSTOMER_CITY_FORCE_STRTOUPPER')) ) { ?>
<li id="nav_<?php echo $row->key ?>"><h5 title="<?php echo '('.$row->key.' - ' . $row->set . ')'; ?>"><?php echo __($row->title). tep_image(DIR_WS_ICONS . 'icon_help.gif'); ?></h5>
<div class="block_input tirroir">
Added: trunk/catalog/install/includes/sql/mysql/tables/osc_images.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_images.sql (rev 0)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_images.sql 2011-12-20 22:18:28 UTC (rev 3984)
@@ -0,0 +1,27 @@
+--+######################################################################--+
+--| osCSS Open Source E-commerce |
+--+######################################################################--+
+--| Copyright (c) 2005-2011 The osCSS developers |
+--| |
+--| http://www.oscss.org |
+--| Portions Copyright (c) 2003 osCommerce |
+--+######################################################################--+
+--| This source file is subject to version 2.0 of the GPL license, |
+--| available at the following url: |
+--| http://www.oscss.org/ |
+--+######################################################################--+
+
+
+CREATE TABLE IF NOT EXISTS osc_images (
+ rowid int(11) NOT NULL AUTO_INCREMENT,
+ pathkey varchar(32) NOT NULL,
+ path varchar(250) NOT NULL,
+ file varchar(100) NOT NULL,
+ date_added datetime NOT NULL,
+ last_modified datetime NOT NULL,
+ width int(5) NOT NULL,
+ height int(5) NOT NULL,
+ ext char(4) NOT NULL,
+ PRIMARY KEY (rowid)
+) DEFAULT CHARSET=utf8 ;
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2011-12-26 14:27:50
|
Revision: 3986
http://oscss.svn.sourceforge.net/oscss/?rev=3986&view=rev
Author: oscim
Date: 2011-12-26 14:27:42 +0000 (Mon, 26 Dec 2011)
Log Message:
-----------
Suite amelioration et evolution de la prise en charge des images de data (dir images) deport?\195?\169 dans le dossier Documents et trait?\195?\169 par les fichier document.
Deplacement du dossier images ds Documents
Suite evolution du tinybroswer pour la gestion du suivi et mise a jour de la db lors des actions sur les image (resize, rotate, move, rename) des fichiers
Ajout d'une class imageUtility de centralisation des operations sur les images
Ajout class sqlsrivers pour les coutries, et amelioration des geozone et geo2zone.
Ajustement des functions tep_images (FO) et tep_inof_image (BO)
Modified Paths:
--------------
trunk/catalog/admin/document.php
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/config_tinybrowser.php
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/edit.php
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php
trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php
trunk/catalog/admin/includes/classes/drivers/sqlgeozone.php
trunk/catalog/admin/includes/classes/drivers/sqlzonetogeozone.php
trunk/catalog/admin/includes/classes/fileUtility.php
trunk/catalog/admin/includes/functions/html_output.php
trunk/catalog/common/classes/image_ratio.php
trunk/catalog/document.php
trunk/catalog/includes/database_tables.php
trunk/catalog/includes/functions/html_output.php
Added Paths:
-----------
trunk/catalog/Documents/images/
trunk/catalog/admin/includes/classes/drivers/sqlcountries.php
trunk/catalog/admin/includes/classes/imageUtility.php
Removed Paths:
-------------
trunk/catalog/images/
Modified: trunk/catalog/admin/document.php
===================================================================
--- trunk/catalog/admin/document.php 2011-12-23 09:28:12 UTC (rev 3985)
+++ trunk/catalog/admin/document.php 2011-12-26 14:27:42 UTC (rev 3986)
@@ -34,26 +34,25 @@
$img = $res->image;
break;
case 'db':
- if(isset($_REQUEST['id']))
- $myar = array('id'=>(int)$_REQUEST['id']);
- elseif(isset($_REQUEST['key']))
- $myar = array('pathkey'=>$_REQUEST['key']);
+ if(isset($_REQUEST['id']) && !empty($_REQUEST['id']) )
+ $myar = array('id'=>(int)$_REQUEST['id']);
+ elseif(isset($_REQUEST['key']))
+ $myar = array('pathkey'=>$_REQUEST['key']);
+ else
+ $myar = array('pathkey'=>md5(str_replace(array('//',DIR_WS_CATALOG_IMAGES),array('/',DIR_WS_IMAGES),IMAGE_NONEXISTENT)) );
+ $res=sqlimage::fetch($myar, true);
- $res=sqlimage::fetch($myar, true);
-// print_r($res);
-// exit;
- $img = preg_replace('#^('.DIR_WS_IMAGES.')#' , '', $res->path);
+ $img = preg_replace('#^('.DIR_WS_IMAGES.')#' , '', $res->path);
break;
}
-
$get=image_ratio::get_image(DIR_WS_CATALOG_IMAGES.$img,'',$width,$height);
+
$img=preg_replace('#^('.DIR_WS_CATALOG_IMAGES.')#' , '', $get['src']);
$ext = str_replace('.','',substr($img,-4));
if($ext='jpg')$ext='jpeg';
-// var_dump($ext);
-// exit;
+
header('Content-type: image/'.$ext);
readfile(DIR_FS_CATALOG_IMAGES.$img);
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/config_tinybrowser.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/config_tinybrowser.php 2011-12-23 09:28:12 UTC (rev 3985)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/config_tinybrowser.php 2011-12-26 14:27:42 UTC (rev 3986)
@@ -3,8 +3,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.0
- @date 24/03/11, 20:39
+ @version 2.1.1
+ @date 28/12/11, 20:39
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -57,7 +57,7 @@
$tinybrowser['integration'] = 'tinymce'; // Possible values: 'tinymce', 'fckeditor'
// Default is rtrim($_SERV/*ER['DOCUMENT_ROOT'],'/') (suitable when using absolute paths, but can be set to '' if using relative paths)
-$tinybrowser['docroot'] =DIR_FS_DOCUMENT_ROOT; //$_SERVER['DOCUMENT_ROOT'];
+$tinybrowser['docroot'] =DIR_FS_ROOT_DOCS; //$_SERVER['DOCUMENT_ROOT'];
// Folder permissions for Unix servers only
$tinybrowser['unixpermissions'] = 0777;
@@ -133,6 +133,9 @@
$tinybrowser['window']['height'] = 480;
// Assign Permissions for Upload, Edit, Delete & Folders
+/**
+ TODO REVOIR les ACL , utilisé ceux d'osCSS
+*/
$tinybrowser['allowupload'] = true;
$tinybrowser['allowedit'] = true;
$tinybrowser['allowdelete'] = true;
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/edit.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/edit.php 2011-12-23 09:28:12 UTC (rev 3985)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/edit.php 2011-12-26 14:27:42 UTC (rev 3986)
@@ -89,31 +89,17 @@
// Delete any checked files
if(isset($_POST['deletefile']))
{
- foreach($_POST['deletefile'] as $delthis => $val)
- {
- $delthisfile = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$delthis];
- if (file_exists($delthisfile) && unlink($delthisfile)) $deleteqty++;
- else $errorqty++;
+ foreach($_POST['deletefile'] as $delthis => $val){
/**
- @remarks Check And add if not exists in db table
+ @remarks delete all files (thumb + src + db)
*/
- $res= sqlimage::fetch(array('path'=>.$editpath.$_POST['actionfile'][$delthis]), true);
- if($res){
+ if( ! imageUtility::delete($editpath.$_POST['actionfile'][$delthis]) )
+ $errorqty++;
+ else
+ $deleteqty++;
- $sql = array(
- 'id'=>$res->rowid,
- );
- $res= sqlimage::delete($sql);
}
-
-
- if($typenow=='image')
- {
- $delthisthumb = $tinybrowser['docroot'].$editpath.$tinybrowser['thumbfolder'].'/_'.$_POST['actionfile'][$delthis];
- if (file_exists($delthisthumb)) unlink($delthisthumb);
- }
- }
}
// Rename any files with changed name
@@ -123,32 +109,16 @@
{
if($_POST['actionfile'][$namethis] != $newname.$_POST['renameext'][$namethis])
{
- $namethisfilefrom = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$namethis];
- $namethisfileto = $tinybrowser['docroot'].$editpath.clean_filename($newname.$_POST['renameext'][$namethis]);
- if (file_exists($namethisfilefrom) && rename($namethisfilefrom,$namethisfileto)) $renameqty++;
- else $errorqty++;
+
/**
- @remarks Check And add if not exists in db table
+ @remarks delete all files (thumb + src + db)
*/
- $res= sqlimage::fetch(array('path'=>$editpath.$_POST['actionfile'][$namethis]), true);
- if($res){
+ if( ! imageUtility::rename($editpath.$_POST['actionfile'][$namethis], $editpath.clean_filename($newname.$_POST['renameext'][$namethis])) )
+ $errorqty++;
+ else
+ $renameqty++;
- $sql = array(
- 'id'=>$res->rowid,
- 'path'=>$editpath.clean_filename($newname.$_POST['renameext'][$namethis]),
- 'pathkey'=>$editpath.clean_filename($newname.$_POST['renameext'][$namethis]),
- 'file'=>basename($editpath.clean_filename($newname.$_POST['renameext'][$namethis])),
- );
- $res= sqlimage::update($sql);
- }
-
- if($typenow=='image')
- {
- $namethisthumbfrom = $tinybrowser['docroot'].$editpath.$tinybrowser['thumbfolder'].'/_'.$_POST['actionfile'][$namethis];
- $namethisthumbto = $tinybrowser['docroot'].$editpath.$tinybrowser['thumbfolder'].'/_'.clean_filename($newname.$_POST['renameext'][$namethis]);
- if (file_exists($namethisthumbfrom)) rename($namethisthumbfrom,$namethisthumbto);
- }
}
}
}
@@ -158,39 +128,15 @@
{
foreach($_POST['movefile'] as $movethis => $val)
{
- $movethisfile = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$movethis];
- $movefiledest = $tinybrowser['docroot'].$destfolder.$_POST['actionfile'][$movethis];
-
-
/**
- @remarks Check And add if not exists in db table
+ @remarks delete all files (thumb + src + db)
*/
- $res= sqlimage::fetch(array('path'=>$editpath.$_POST['actionfile'][$movethis]), true);
- if($res){
+ if( ! imageUtility::move($editpath.$_POST['actionfile'][$movethis], $destfolder.$_POST['actionfile'][$movethis]) )
+ $errorqty++;
+ else
+ $renameqty++;
- $sql = array(
- 'id'=>$res->rowid,
- 'path'=>$destfolder.$_POST['actionfile'][$movethis],
- 'pathkey'=>$destfolder.$_POST['actionfile'][$movethis],
- 'file'=>basename($destfolder.$_POST['actionfile'][$movethis]),
- );
- $res= sqlimage::update($sql);
}
-
-
- if (!file_exists($movefiledest) && file_exists($movethisfile) && copy($movethisfile,$movefiledest))
- {
- $moveqty++;
- unlink($movethisfile);
- if($typenow=='image')
- {
- $movethisthumb = $tinybrowser['docroot'].$editpath.$tinybrowser['thumbfolder'].'/_'.$_POST['actionfile'][$movethis];
- $movethumbdest = $tinybrowser['docroot'].$destfolder.$tinybrowser['thumbfolder'].'/_'.$_POST['actionfile'][$movethis];
- if (file_exists($movethisthumb) && copy($movethisthumb,$movethumbdest)) unlink($movethisthumb);
- }
- }
- else $errorqty++;
- }
}
// Resize any files with new size
@@ -204,27 +150,16 @@
// detect silly sizes
if($newsize > $tinybrowser['thumbsize'])
{
- // do image resize
- $targetimg = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$sizethis];
- if (file_exists($targetimg))
- {
- $mime = getimagesize($targetimg);
- if($_POST['resizetype'][$sizethis]=='width')
- {
- $rw = $newsize;
- $rh = $mime[1];
- }
- else
- {
- $rw = $mime[0];
- $rh = $newsize;
- }
- $im = convert_image($targetimg,$mime['mime']);
- resizeimage($im,$rw,$rh,$targetimg,$tinybrowser['imagequality'],$mime['mime']);
- imagedestroy($im);
- $resizeqty++;
- }
- else $errorqty++;
+
+
+ /**
+ @remarks delete all files (thumb + src + db)
+ */
+ if( ! imageUtility::resize($editpath.$_POST['actionfile'][$sizethis], $_POST['resizetype'][$sizethis]) )
+ $resizeqty++;
+ else
+ $rotateqty++;
+
}
else $errorqty++;
}
@@ -234,104 +169,30 @@
// Rotate any selected files
if(isset($_POST['rotatefile']))
{
- $imagerefresh = '?refresh='.uniqid('');
- foreach($_POST['rotatefile'] as $rotatethis => $direction)
- {
- if($direction != 'none')
- {
+// $imagerefresh = '?refresh='.uniqid('');
+ foreach($_POST['rotatefile'] as $rotatethis => $direction){
+
+ if($direction != 'none'){
+
$targetimg = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$rotatethis];
- if (file_exists($targetimg))
- {
- // rotate image
- if($direction == 'clock') $degree=270; else $degree=90;
- $mime = getimagesize($targetimg);
- $im = convert_image($targetimg,$mime['mime']);
- // additional processing for png / gif transparencies (credit to Dirk Bohl)
- if($mime['mime'] == 'image/x-png' || $mime['mime'] == 'image/png')
- {
- imagealphablending($newim, false);
- imagesavealpha($newim, true);
- }
- elseif($mime['mime'] == 'image/gif')
- {
- $originaltransparentcolor = imagecolortransparent( $im );
- if($originaltransparentcolor >= 0 && $originaltransparentcolor < imagecolorstotal( $im ))
- {
- $transparentcolor = imagecolorsforindex( $im, $originaltransparentcolor );
- $newtransparentcolor = imagecolorallocate($newim,$transparentcolor['red'],$transparentcolor['green'],$transparentcolor['blue']);
- imagefill( $newim, 0, 0, $newtransparentcolor );
- imagecolortransparent( $newim, $newtransparentcolor );
- }
- }
- $newim = imagerotate($im, $degree, 0);
- imagedestroy($im);
+ /**
+ @remarks delete all files (thumb + src + db)
+ */
+ if( ! imageUtility::rotate($editpath.$_POST['actionfile'][$rotatethis], $direction) )
+ $errorqty++;
+ else
+ $rotateqty++;
- if($mime['mime'] == 'image/pjpeg' || $mime['mime'] == 'image/jpeg')
- imagejpeg ($newim,$targetimg,$tinybrowser['imagequality']);
- elseif($mime['mime'] == 'image/x-png' || $mime['mime'] == 'image/png')
- imagepng ($newim,$targetimg,substr($tinybrowser['imagequality'],0,1));
- elseif($mime['mime'] == 'image/gif')
- imagegif ($newim,$targetimg);
- imagedestroy($newim);
- $rotateqty++;
- // delete and recreate thumbnail image
- $targetthumb = $tinybrowser['docroot'].$editpath.$tinybrowser['thumbfolder'].'/_'.$_POST['actionfile'][$rotatethis];
- if (file_exists($targetthumb)) unlink($targetthumb);
- $mime = getimagesize($targetimg);
- $im = convert_image($targetimg,$mime['mime']);
- resizeimage($im,$tinybrowser['thumbsize'],$tinybrowser['thumbsize'],$targetthumb,$tinybrowser['thumbquality'],$mime['mime']);
- imagedestroy($im);
- }
- else $errorqty++;
}
}
}
// Read directory contents and populate $file array
-$dh = opendir($tinybrowser['docroot'].$editpath);
-$file = array();
-while (($filename = readdir($dh)) !== false)
- {
- // get file extension
- $nameparts = explode('.',$filename);
- $ext = end($nameparts);
- // filter directories and prohibited file types
- if($filename != '.' && $filename != '..' && !is_dir($tinybrowser['docroot'].$editpath.$filename) && !in_array($ext, $tinybrowser['prohibited']) && ($typenow == 'file' || strpos(strtolower($tinybrowser['filetype'][$typenow]),strtolower($ext))))
- {
- // search file name if search term entered
- if($findnow) $exists = strpos(strtolower($filename),strtolower($findnow));
+ $file = TinyBrowser::BrowseFiles($editpath);
- // assign file details to array, for all files or those that match search
- if(!$findnow || ($findnow && $exists !== false))
- {
- $file['name'][] = $filename;
- $file['sortname'][] = strtolower($filename);
- $file['modified'][] = filemtime($tinybrowser['docroot'].$editpath.$filename);
- $file['size'][] = filesize($tinybrowser['docroot'].$editpath.$filename);
-
- // image specific info or general
- if($typenow=='image' && $imginfo = getimagesize($tinybrowser['docroot'].$editpath.$filename))
- {
- $file['width'][] = $imginfo[0];
- $file['height'][] = $imginfo[1];
- $file['dimensions'][] = $imginfo[0] + $imginfo[1];
- $file['type'][] = $imginfo['mime'];
- }
- else
- {
- $file['width'][] = 'N/A';
- $file['height'][] = 'N/A';
- $file['dimensions'][] = 'N/A';
- $file['type'][] = returnMIMEType($filename);
- }
- }
- }
- }
-closedir($dh);
-
// Assign directory structure to array
$editdirs=array();
dirtree($editdirs,$tinybrowser['filetype'][$typenow],$tinybrowser['docroot'],$tinybrowser['path'][$typenow]);
@@ -539,7 +400,10 @@
{
$alt = (IsOdd($i) ? 'r1' : 'r0');
echo '<tr class="'.$alt.'">';
- if($typenow=='image') echo '<td><a class="imghover" href="#" onclick="return false;" title="'.$file['name'][$i].' '.TB_DIMENSIONS.': '.$file['width'][$i].' x '.$file['height'][$i].' '.TB_DATE.': '.date($tinybrowser['dateformat'],$file['modified'][$i]).'"><img src="'.$thumbpath.$tinybrowser['thumbfolder'].'/_'.$file['name'][$i].$imagerefresh.'" alt="" />' .truncate_text($file['name'][$i],30).'</a></td>';
+ if($typenow=='image') echo '<td><a class="imghover" href="#" onclick="return false;" title="'.$file['name'][$i].' '.TB_DIMENSIONS.': '.$file['width'][$i].' x '.$file['height'][$i].' '.TB_DATE.': '.date($tinybrowser['dateformat'],$file['modified'][$i]).'">'
+// <img src="'.$thumbpath.$tinybrowser['thumbfolder'].'/_'.$file['name'][$i].$imagerefresh.'" alt="" />
+ .'<img src="'.tep_get_http().DIR_WS_ADMIN.'document.php?mod=img&typ=db&id='.$file['id'][$i].'&w='.$tinybrowser['thumbsize'].'&h='.$tinybrowser['thumbsize'] /*$file['src'][$i]*/ .'" />'
+ .truncate_text($file['name'][$i],30).'</a></td>';
else echo '<td title="'.$file['name'][$i].' '.TB_DATE.': '.date($tinybrowser['dateformat'],$file['modified'][$i]).'">'.truncate_text($file['name'][$i],30).'</td>';
echo '<td>'.bytestostring($file['size'][$i],1).'</td><td>'.$file['type'][$i].'</td>'
.'<td>';
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php 2011-12-23 09:28:12 UTC (rev 3985)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php 2011-12-26 14:27:42 UTC (rev 3986)
@@ -1,5 +1,114 @@
<?php
error_reporting(E_ALL);
+
+
+
+Class TinyBrowser{
+
+
+
+ /**
+ @fn
+ @brief construct Browse Path and adjust sql links
+ @param $browsepath dirpath relative dir path ofr config tinybrowser
+ @param $findnow string keywords search
+ */
+ static public function BrowseFiles($browsepath, $findnow=''){
+ global $tinybrowser, $typenow;
+
+// print_r($tinybrowser);
+
+ // Read directory contents and populate $file array
+ $dh = opendir($tinybrowser['docroot'].$browsepath);
+ $file = array();
+ $u=0;
+ while (($filename = readdir($dh)) !== false)
+ {
+
+ // get file extension
+ $nameparts = explode('.',$filename);
+ $ext = end($nameparts);
+ unset($imginfo);
+ // filter directories and prohibited file types
+ if($filename != '.' && $filename != '..' && !is_dir($tinybrowser['docroot'].$browsepath.$filename) && !in_array($ext, $tinybrowser['prohibited']) && ($typenow == 'file' || strpos(strtolower($tinybrowser['filetype'][$typenow]),strtolower($ext)))
+ ) {
+ // search file name if search term entered
+ if($findnow)
+ $exists = strpos(strtolower($filename),strtolower($findnow));
+
+ // assign file details to array, for all files or those that match search
+ if(!$findnow || ($findnow && $exists !== false))
+ {
+ $file['name'][$u] = $filename;
+ $file['title'][$u] = $filename;
+ $file['sortname'][$u] = strtolower($filename);
+ $file['modified'][$u] = filemtime($tinybrowser['docroot'].$browsepath.$filename);
+ $file['size'][$u] = filesize($tinybrowser['docroot'].$browsepath.$filename);
+
+ // image specific info or general
+ if($typenow=='image' ) /*getimagesize($tinybrowser['docroot'].$browsepath.$filename)*//*)*/
+ {
+
+ /**
+ @remarks Check And add if not exists in db table
+ */
+ $res= sqlimage::fetch(array('path'=>$browsepath.$filename), true);
+
+ if(!$res){
+ $imginfo = image_ratio::get_image($tinybrowser['docroot'].$browsepath.$filename,'');
+
+ $sql = array(
+ 'path'=>$browsepath.$filename,
+ 'file'=>$filename,
+ 'width'=>$imginfo['width'],
+ 'height'=>$imginfo['height'],
+ 'ext'=>substr($imginfo['mime'], strpos($imginfo['mime'],'/')+1 ) ,
+ );
+
+ $id = $res= sqlimage::create($sql);
+ $width = $imginfo['width'] ;
+ $height = $imginfo['height'] ;
+ $ext = $sql['ext'] ;
+ $src =$imginfo['src'];
+ }
+ else{
+ $id = $res->rowid;
+ $width = $res->width ;
+ $height = $res->height ;
+ $ext = $res->ext ;
+ $src = $res->path ;
+ }
+
+ $file['width'][$u] = $width;
+ $file['height'][$u] = $height;
+ $file['dimensions'][$u] =$width+$height ;// $imginfo[0] + $imginfo[1];
+ $file['type'][$u] = $ext; //$imginfo['mime'];
+ $file['src'][$u] =$src;
+ $file['id'][$u] =$id;
+
+
+ }
+ else
+ {
+ $file['width'][$u] = 'N/A';
+ $file['height'][$u] = 'N/A';
+ $file['dimensions'][$u] = 'N/A';
+ $file['type'][$u] = returnMIMEType($filename);
+ }
+ }
+ $u++;
+ }
+ }
+ closedir($dh);
+
+ return $file;
+ }
+
+
+}
+
+
+
// *************************CREATE FOLDER**********************************
function createfolder($dir,$perm) {
is_dir(dirname($dir)) || createfolder(dirname($dir), $perm);
@@ -26,19 +135,19 @@
switch($sortbynow)
{
case 'name':
- array_multisort($file['sortname'], $sortorder, $file['name'], $sortorder, $file['type'], $sortorder, $file['modified'], $sortorder, $file['size'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder,$file['src'], $sortorder);
+ array_multisort($file['sortname'], $sortorder, $file['name'], $sortorder, $file['type'], $sortorder, $file['modified'], $sortorder, $file['size'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder,$file['src'], $sortorder, $file['id'], $sortorder, $file['title'], $sortorder);
break;
case 'size':
- array_multisort($file['size'], $sortorder, $file['sortname'], SORT_ASC, $file['name'], SORT_ASC, $file['type'], $sortorder, $file['modified'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder,$file['src'], $sortorder);
+ array_multisort($file['size'], $sortorder, $file['sortname'], $sortorder, $file['name'], $sortorder, $file['type'], $sortorder, $file['modified'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder,$file['src'], $sortorder, $file['id'], $sortorder, $file['title'], $sortorder);
break;
case 'type':
- array_multisort($file['type'], $sortorder, $file['sortname'], SORT_ASC, $file['name'], SORT_ASC, $file['size'], $sortorder, $file['modified'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder,$file['src'], $sortorder);
+ array_multisort($file['type'], $sortorder, $file['sortname'], $sortorder, $file['name'], $sortorder, $file['size'], $sortorder, $file['modified'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder,$file['src'], $sortorder, $file['id'], $sortorder, $file['title'], $sortorder);
break;
case 'modified':
- array_multisort($file['modified'], $sortorder, $file['name'], $sortorder, $file['name'], $sortorder, $file['type'], $sortorder, $file['size'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder,$file['src'], $sortorder);
+ array_multisort($file['modified'], $sortorder, $file['name'], $sortorder, $file['name'], $sortorder, $file['type'], $sortorder, $file['size'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder,$file['src'], $sortorder, $file['id'], $sortorder, $file['title'], $sortorder);
break;
case 'dimensions':
- array_multisort($file['dimensions'], $sortorder, $file['width'], $sortorder, $file['sortname'], SORT_ASC, $file['name'], SORT_ASC, $file['modified'], $sortorder, $file['type'], $sortorder, $file['size'], $sortorder, $file['height'], $sortorder,$file['src'], $sortorder);
+ array_multisort($file['dimensions'], $sortorder, $file['width'], $sortorder, $file['sortname'], $sortorder, $file['name'], $sortorder, $file['modified'], $sortorder, $file['type'], $sortorder, $file['size'], $sortorder, $file['height'], $sortorder,$file['src'], $sortorder, $file['id'], $sortorder, $file['title'], $sortorder);
break;
default:
// do nothing
Modified: trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php
===================================================================
--- trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php 2011-12-23 09:28:12 UTC (rev 3985)
+++ trunk/catalog/admin/editeur/tiny_mce/plugins/tinybrowser/tinybrowser.php 2011-12-26 14:27:42 UTC (rev 3986)
@@ -83,89 +83,10 @@
$newthumbqty = 0;
// read folder contents if folder exists
-if(file_exists($tinybrowser['docroot'].$browsepath))
- {
- // Read directory contents and populate $file array
- $dh = opendir($tinybrowser['docroot'].$browsepath);
- $file = array();
- $u=0;
- while (($filename = readdir($dh)) !== false)
- {
+if(file_exists($tinybrowser['docroot'].$browsepath)){
- // get file extension
- $nameparts = explode('.',$filename);
- $ext = end($nameparts);
- unset($imginfo);
- // filter directories and prohibited file types
- if($filename != '.' && $filename != '..' && !is_dir($tinybrowser['docroot'].$browsepath.$filename) && !in_array($ext, $tinybrowser['prohibited']) && ($typenow == 'file' || strpos(strtolower($tinybrowser['filetype'][$typenow]),strtolower($ext)))
- ) {
- // search file name if search term entered
- if($findnow) $exists = strpos(strtolower($filename),strtolower($findnow));
+ $file = TinyBrowser::BrowseFiles($browsepath);
- // assign file details to array, for all files or those that match search
- if(!$findnow || ($findnow && $exists !== false))
- {
- $file['name'][$u] = $filename;
- $file['title'][$u] = $filename;
- $file['sortname'][$u] = strtolower($filename);
- $file['modified'][$u] = filemtime($tinybrowser['docroot'].$browsepath.$filename);
- $file['size'][$u] = filesize($tinybrowser['docroot'].$browsepath.$filename);
-
- // image specific info or general
- if($typenow=='image' ) /*getimagesize($tinybrowser['docroot'].$browsepath.$filename)*//*)*/
- {
-
- /**
- @remarks Check And add if not exists in db table
- */
- $res= sqlimage::fetch(array('path'=>$browsepath.$filename), true);
-
- if(!$res){
- $imginfo = image_ratio::get_image($tinybrowser['docroot'].$browsepath.$filename,'');
-
- $sql = array(
- 'path'=>$browsepath.$filename,
- 'file'=>$filename,
- 'width'=>$imginfo['width'],
- 'height'=>$imginfo['height'],
- 'ext'=>$imginfo['mime'],
- );
-
- $id = $res= sqlimage::create($sql);
- $width = $imginfo['width'] ;
- $height = $imginfo['height'] ;
- $ext = $imginfo['mime'] ;
- $src =$imginfo['src'];
- }
- else{
- $id = $res->rowid;
- $width = $res->width ;
- $height = $res->height ;
- $ext = $res->ext ;
- $src = $res->path ;
- }
-
- $file['width'][$u] = $width;
- $file['height'][$u] = $height;
- $file['dimensions'][$u] =$width+$height ;// $imginfo[0] + $imginfo[1];
- $file['type'][$u] = $ext; //$imginfo['mime'];
- $file['src'][$u] =$src;
- $file['id'][$u] =$id;
-
-
- }
- else
- {
- $file['width'][$u] = 'N/A';
- $file['height'][$u] = 'N/A';
- $file['dimensions'][$u] = 'N/A';
- $file['type'][$u] = returnMIMEType($filename);
- }
- }
- $u++;
- }
- }
- closedir($dh);
}
// create file upload folder
else
@@ -206,7 +127,8 @@
// sort files by selected order
sortfileorder($sortbynow,$sortorder,$file);
}
-
+// print_r($file);
+// // exit;
// determine pagination
if($tinybrowser['pagination']>0)
{
@@ -339,10 +261,11 @@
.' '.TB_DATE.': '.date($tinybrowser['dateformat'],$file['modified'][$i])
.' '.TB_TYPE.': '.$file['type'][$i]
.' '.TB_SIZE.': '.bytestostring($file['size'][$i],1)
+
.'">'
.'<img src="'.tep_get_http().DIR_WS_ADMIN.'document.php?mod=img&typ=db&id='.$file['id'][$i].'&w='.$tinybrowser['thumbsize'].'&h='.$tinybrowser['thumbsize'] /*$file['src'][$i]*/ .'" />'
// .'<img src="'.$thumbpath.$tinybrowser['thumbfolder'].'/_'.$file['name'][$i] . .'" />'
-// .tep_image()
+// .
.'<div class="filename">'.$file['title'][$i].'</div></a></div>';
}
}
Added: trunk/catalog/admin/includes/classes/drivers/sqlcountries.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcountries.php (rev 0)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcountries.php 2011-12-26 14:27:42 UTC (rev 3986)
@@ -0,0 +1,217 @@
+<?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
+ @portion code Copyright (c) 2002 osCommerce
+ @package osCSS-2 <www http://www.oscss.org>
+ @version 2.1.1
+ @date 23/10/11, 16:51
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class sqlcountries
+ @file sqlcountries.php
+ @brief manage insert/update/delete in zone tables
+*/
+
+
+
+
+class sqlcountries
+ implements ModSqlDataDriver{
+
+ public static $modules;
+
+ protected static $_instance;
+
+ protected function __construct(){
+ }
+
+
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+ self::getInstance();
+
+ if(!isset($option['name']))
+ return 'name';
+
+ $sql_data_array['countries_name'] = tep_db_prepare_input($option['name']);
+ $sql_data_array['countries_localname'] = (isset($option['localname'])) ? tep_db_prepare_input($option['localname']) :'NULL';
+ $sql_data_array['countries_iso_code_2'] = (isset($option['iso_code_2'])) ? tep_db_prepare_input($option['iso_code_2']) :'NULL';
+ $sql_data_array['countries_iso_code_3'] = (isset($option['iso_code_3'])) ? tep_db_prepare_input($option['iso_code_3']) :'NULL';
+ $sql_data_array['address_format_id'] = (isset($option['address_format_id'])) ? tep_db_prepare_input($option['address_format_id']) :'1';
+ $sql_data_array['country_visible'] = (isset($option['country_visible'])) ? tep_db_prepare_input($option['country_visible']) :'0';
+
+ $res=tep_db_perform(TABLE_COUNTRIES, $sql_data_array);
+
+ if(!$res)
+ return $res;
+ else
+ return $res->__get('insertId');
+ }
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ self::getInstance();
+
+ if(!isset($option['id']))
+ return 'id';
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND countries_id = '".(int)$option['id']."' ";
+
+
+ if(isset($option['name']))$sql_data_array['countries_name'] = tep_db_prepare_input($option['name']);
+ if(isset($option['localname'])) $sql_data_array['countries_localname'] = tep_db_prepare_input($option['localname']);
+ if(...
[truncated message content] |
|
From: <os...@us...> - 2011-12-26 22:25:39
|
Revision: 3987
http://oscss.svn.sourceforge.net/oscss/?rev=3987&view=rev
Author: oscim
Date: 2011-12-26 22:25:33 +0000 (Mon, 26 Dec 2011)
Log Message:
-----------
suite correction evolution des images
Modified Paths:
--------------
trunk/catalog/admin/includes/functions/html_output.php
trunk/catalog/common/classes/image_ratio.php
Modified: trunk/catalog/admin/includes/functions/html_output.php
===================================================================
--- trunk/catalog/admin/includes/functions/html_output.php 2011-12-26 14:27:42 UTC (rev 3986)
+++ trunk/catalog/admin/includes/functions/html_output.php 2011-12-26 22:25:33 UTC (rev 3987)
@@ -228,10 +228,10 @@
// public images
function tep_info_image($image, $alt, $width = '', $height = '', $parameters = '',$mode=false) {
- if(preg_match('#([0-9\.]*)#', $image))
+ if(preg_match('#^([0-9\.]*)$#i', $image))
return '<img src="'.tep_href_link('document.php', 'mod=img&typ=db&id='.$image.'&w='.$width.'&h='.$height).'" alt="'.$alt.'" title="'.$alt.'" '.$parameters.'/>';
else
- return '<img src="'.tep_href_link('document.php', 'mod=img&typ=db&key='.md5('images/'.$image).'&w='.$width.'&h='.$height).'" alt="'.$alt.'" title="'.$alt.'" '.$parameters.'/>';
+ return '<img src="'.tep_href_link('document.php', 'mod=img&typ=db&key='.md5(DIR_WS_IMAGES.$image).'&w='.$width.'&h='.$height).'" alt="'.$alt.'" title="'.$alt.'" '.$parameters.'/>';
}
/**
Modified: trunk/catalog/common/classes/image_ratio.php
===================================================================
--- trunk/catalog/common/classes/image_ratio.php 2011-12-26 14:27:42 UTC (rev 3986)
+++ trunk/catalog/common/classes/image_ratio.php 2011-12-26 22:25:33 UTC (rev 3987)
@@ -159,7 +159,7 @@
return self::$CacheImage[self::$key][self::$keydim]['img'];
}
else {
- $image = '<img src="' . (!self::$env->inadmin ? tep_output_string(tep_get_httpdir().$theImg['src_origin']."?w=" . $width . "&h=" . $height ) : tep_output_string($src)) . '" alt="' . tep_output_string($alt) . '" ';
+ $image = '<img src="' . (!self::$env->inadmin ? tep_output_string(tep_get_httpdir().$theImg['src_origin']."?w=" . $width . "&h=" . $height ) : tep_output_string(DIR_WS_ADMIN.$src)) . '" alt="' . tep_output_string($alt) . '" ';
if($mode !='simple') $image .= 'width="' . $theImg['width'] . '" height="' . $theImg['height'] . '"';
if (tep_not_null($theImg['alt'])) $image .= ' title="' . tep_output_string($theImg['alt']) . '"';
if (tep_not_null($parameters)) $image .= ' ' . $parameters;
@@ -287,7 +287,6 @@
Any commercial selling of this script is forbidden.
*/
protected static function thumbgd ($image, $width, $height, $width_src, $height_scr, $format, $thumbfile){
-echo $thumbfile;
// error_reporting(E_ALL);
$image = call_user_func("imagecreatefrom".$format, $image);
@@ -344,13 +343,10 @@
if(isset(self::$CacheImage[self::$key]['conf']['original'])) return ;
$sortie=true;
-// var_dump($src);
if(strpos($src, DIR_FS_ROOT_DOCS) === false ) $src;
else $src= substr ($src, strlen(DIR_FS_ROOT_DOCS));
-// var_dump($src);
-
if(strpos($src, DIR_WS_LANGUAGES) >0 ) self::$CacheImage[self::$key]['conf']['dest']='lang';
else self::$CacheImage[self::$key]['conf']['dest']='image';
@@ -367,8 +363,6 @@
}
-
-// var_dump($src_dir);
if (!@is_file($src_dir) || empty($src_dir)){
if (self::$env->img_required) $sortie= '<span class="errorText">'.__('Le fichier n\'a pas pu être trouvé sur le serveur !').'</span>';
$sortie = false;
@@ -389,7 +383,7 @@
private static function initCurrent($src,$width,$height){
-// var_dump(());
+
self::$key = md5($src.get_class(self::$Modele));
self::$keydim=md5($width . $height.get_class(self::$Modele));
@@ -463,13 +457,13 @@
/**
@remarks Sub Folder in Cache
*/
- $subpath = $width.'x'.$height.'/';
-// var_dump($image);
-// exit;
+ $subpath = $width.'x'.$height.( (self::$env->inadmin) ? '_' : '/' );
+
$thumb = $subpath.$getclass.basename($image).'_'.md5($image).'.'.((self::$types[$format]=="jpeg") ? "jpg" : self::$types[$format]);
- if(!file_exists( DIR_FS_ROOT_DOCS.self::$env->cachedir.$subpath) || !is_dir(DIR_FS_ROOT_DOCS.self::$env->cachedir.$subpath))
- @mkdir(DIR_FS_ROOT_DOCS.self::$env->cachedir.$subpath);
+ if (!self::$env->inadmin)
+ if(!file_exists( DIR_FS_ROOT_DOCS.self::$env->cachedir.$subpath) || !is_dir(DIR_FS_ROOT_DOCS.self::$env->cachedir.$subpath))
+ @mkdir(DIR_FS_ROOT_DOCS.self::$env->cachedir.$subpath);
$thumbfile = substr($image,0, strpos($image, DIR_WS_IMAGES) ) . self::$env->cachedir . $thumb;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2011-12-27 10:47:19
|
Revision: 3989
http://oscss.svn.sourceforge.net/oscss/?rev=3989&view=rev
Author: oscim
Date: 2011-12-27 10:47:11 +0000 (Tue, 27 Dec 2011)
Log Message:
-----------
Correction coquille template suite evolution function tep_image
refonte de la page de gestion des zones, structuration des class sqlxxx et exploitation de zone reverse ou zone modele
refonte des mise en page , deport des gabarit en un dossier independant.
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcountries.php
trunk/catalog/admin/includes/classes/drivers/sqlgeozone.php
trunk/catalog/admin/includes/classes/drivers/sqlzonetogeozone.php
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/geo_zones.txt
trunk/catalog/admin/includes/modules/pages/geo_zones.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/gabarit/box.languages.gab
trunk/catalog/install/data/templates/appareil_photo/electronix/includes/gabarit/box.languages.gab
Added Paths:
-----------
trunk/catalog/Documents/admin/data/geozones-modeles.xml
trunk/catalog/admin/includes/gabarit/geo_zones/
trunk/catalog/admin/includes/gabarit/geo_zones/display_view.delete.gab
trunk/catalog/admin/includes/gabarit/geo_zones/display_view.deletesub.gab
trunk/catalog/admin/includes/gabarit/geo_zones/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/geo_zones/display_view.new.gab
Removed Paths:
-------------
trunk/catalog/admin/includes/gabarit/geo_zones.list.gab
trunk/catalog/admin/includes/gabarit/geo_zones.listing.gab
Added: trunk/catalog/Documents/admin/data/geozones-modeles.xml
===================================================================
--- trunk/catalog/Documents/admin/data/geozones-modeles.xml (rev 0)
+++ trunk/catalog/Documents/admin/data/geozones-modeles.xml 2011-12-27 10:47:11 UTC (rev 3989)
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<root>
+ <!--
+ SAMPLE
+ <zone>
+ <id>(int) uniq id</id>
+ <name>(string) name</name>
+
+ <subzone>
+ FOR COUNTRY NO STATE
+ <item>
+ <isocode>string ISO CODE 2</isocode>
+ </item>
+ FOR STATE
+ <item>
+ <isocode>string ISO CODE 2 coutry ref </isocode>
+ <subsub>
+ <zone_code>(string) Zone code </zone_code>
+ </subsub>
+ <isocode>
+ </item>
+ </subzone>
+ </zone>
+ -->
+ <zone>
+ <id>1</id>
+ <name>UE Continental</name>
+ <subzone>
+ <item>
+ <isocode>AT</isocode>
+ </item>
+ <item>
+ <isocode>BG</isocode>
+ </item>
+ <item>
+ <isocode>BE</isocode>
+ </item>
+ <item>
+ <isocode>CZ</isocode>
+ </item>
+ <item>
+ <isocode>DK</isocode>
+ </item>
+ <item>
+ <isocode>DE</isocode>
+ </item>
+ <item>
+ <isocode>ES</isocode>
+ </item>
+ <item>
+ <isocode>BG</isocode>
+ </item>
+ <item>
+ <isocode>BE</isocode>
+ </item>
+ <item>
+ <isocode>EE</isocode>
+ </item>
+ <item>
+ <isocode>FI</isocode>
+ </item>
+ <item>
+ <isocode>FR</isocode>
+ </item>
+ <item>
+ <isocode>GR</isocode>
+ </item>
+ <item>
+ <isocode>HU</isocode>
+ </item>
+ <item>
+ <isocode>IE</isocode>
+ </item>
+ <item>
+ <isocode>IT</isocode>
+ </item>
+ <item>
+ <isocode>LV</isocode>
+ </item>
+ <item>
+ <isocode>LT</isocode>
+ </item>
+ <item>
+ <isocode>LU</isocode>
+ </item>
+ <item>
+ <isocode>NL</isocode>
+ </item>
+ <item>
+ <isocode>PL</isocode>
+ </item>
+ <item>
+ <isocode>PT</isocode>
+ </item>
+ <item>
+ <isocode>RO</isocode>
+ </item>
+ <item>
+ <isocode>SK</isocode>
+ </item>
+ <item>
+ <isocode>SI</isocode>
+ </item>
+ <item>
+ <isocode>SE</isocode>
+ </item>
+ <item>
+ <isocode>UK</isocode>
+ </item>
+ <item>
+ <isocode>GB</isocode>
+ </item>
+ </subzone>
+ </zone>
+
+ <zone>
+ <id>2</id>
+ <name>UE All</name>
+ <subzone>
+ <item>
+ <isocode>AT</isocode>
+ </item>
+ <item>
+ <isocode>BG</isocode>
+ </item>
+ <item>
+ <isocode>BE</isocode>
+ </item>
+ <item>
+ <isocode>CZ</isocode>
+ </item>
+ <item>
+ <isocode>CY</isocode>
+ </item>
+ <item>
+ <isocode>DK</isocode>
+ </item>
+ <item>
+ <isocode>DE</isocode>
+ </item>
+ <item>
+ <isocode>ES</isocode>
+ </item>
+ <item>
+ <isocode>BG</isocode>
+ </item>
+ <item>
+ <isocode>BE</isocode>
+ </item>
+ <item>
+ <isocode>EE</isocode>
+ </item>
+ <item>
+ <isocode>FI</isocode>
+ </item>
+ <item>
+ <isocode>FR</isocode>
+ </item>
+ <item>
+ <isocode>GR</isocode>
+ </item>
+ <item>
+ <isocode>HU</isocode>
+ </item>
+ <item>
+ <isocode>IE</isocode>
+ </item>
+ <item>
+ <isocode>IT</isocode>
+ </item>
+ <item>
+ <isocode>LV</isocode>
+ </item>
+ <item>
+ <isocode>LT</isocode>
+ </item>
+ <item>
+ <isocode>LU</isocode>
+ </item>
+ <item>
+ <isocode>MT</isocode>
+ </item>
+ <item>
+ <isocode>NL</isocode>
+ </item>
+ <item>
+ <isocode>PL</isocode>
+ </item>
+ <item>
+ <isocode>PT</isocode>
+ </item>
+ <item>
+ <isocode>RO</isocode>
+ </item>
+ <item>
+ <isocode>SK</isocode>
+ </item>
+ <item>
+ <isocode>SI</isocode>
+ </item>
+ <item>
+ <isocode>SE</isocode>
+ </item>
+ <item>
+ <isocode>UK</isocode>
+ </item>
+ <item>
+ <isocode>GB</isocode>
+ </item>
+ </subzone>
+ </zone>
+ </root>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcountries.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcountries.php 2011-12-26 23:15:54 UTC (rev 3988)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcountries.php 2011-12-27 10:47:11 UTC (rev 3989)
@@ -108,11 +108,11 @@
$sql ="";
if(isset($option['id'])) $sql .="AND countries_id = '".(int)$option['id']."' ";
- if(isset($option['name'])) $sql .="AND countries_name = '".(int)tep_db_input($option['name'])."' ";
- if(isset($option['localname'])) $sql .="AND countries_localname = '".(int)tep_db_input($option['localname'])."' ";
- if(isset($option['iso_code_2'])) $sql .="AND countries_iso_code_2 = '".(int)tep_db_input($option['iso_code_2'])."' ";
- if(isset($option['list_iso_code_2'])) $sql .="AND countries_iso_code_2 IN( '".(int)tep_db_input($option['list_iso_code_2'])."' ) ";
- if(isset($option['iso_code_3'])) $sql .="AND countries_iso_code_3 = '".(int)tep_db_input($option['iso_code_3'])."' ";
+ if(isset($option['name'])) $sql .="AND countries_name = '".(string)tep_db_input($option['name'])."' ";
+ if(isset($option['localname'])) $sql .="AND countries_localname = '".(string)tep_db_input($option['localname'])."' ";
+ if(isset($option['iso_code_2'])) $sql .="AND countries_iso_code_2 = '".(string)tep_db_input($option['iso_code_2'])."' ";
+ if(isset($option['list_iso_code_2'])) $sql .="AND countries_iso_code_2 IN( '".(string)tep_db_input($option['list_iso_code_2'])."' ) ";
+ if(isset($option['iso_code_3'])) $sql .="AND countries_iso_code_3 = '".(string)tep_db_input($option['iso_code_3'])."' ";
if($sql=='')
return false;
@@ -150,10 +150,10 @@
$DB=Database::getInstance();
if(isset($option['id'])) $where .="AND countries_id = '".(int)$option['id']."' ";
- elseif(isset($option['name'])) $where .="AND countries_name = '".(int)tep_db_input($option['name'])."' ";
- elseif(isset($option['localname'])) $where .="AND countries_localname = '".(int)tep_db_input($option['localname'])."' ";
- elseif(isset($option['iso_code_2'])) $where .="AND countries_iso_code_2 = '".(int)tep_db_input($option['iso_code_2'])."' ";
- elseif(isset($option['iso_code_3'])) $where .="AND countries_iso_code_3 = '".(int)tep_db_input($option['iso_code_3'])."' ";
+ elseif(isset($option['name'])) $where .="AND countries_name = '".(string)tep_db_input($option['name'])."' ";
+ elseif(isset($option['localname'])) $where .="AND countries_localname = '".(string)tep_db_input($option['localname'])."' ";
+ elseif(isset($option['iso_code_2'])) $where .="AND countries_iso_code_2 = '".(string)tep_db_input($option['iso_code_2'])."' ";
+ elseif(isset($option['iso_code_3'])) $where .="AND countries_iso_code_3 = '".(string)tep_db_input($option['iso_code_3'])."' ";
else
return false;
@@ -202,7 +202,9 @@
$object= new stdclass();
foreach($array as $key=>$value){
- if( strpos($key,'country_') ===8)
+ if( strpos($key,'countries_') ===0)
+ $key=substr($key,10);
+ elseif( strpos($key,'country_') ===0)
$key=substr($key,8);
$object->$key = $value;
Modified: trunk/catalog/admin/includes/classes/drivers/sqlgeozone.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlgeozone.php 2011-12-26 23:15:54 UTC (rev 3988)
+++ trunk/catalog/admin/includes/classes/drivers/sqlgeozone.php 2011-12-27 10:47:11 UTC (rev 3989)
@@ -56,7 +56,8 @@
else
return $res->__get('insertId');
}
-// UPDATE `osc_geo_zones` SET `geo_zone_type`='2', ` geo_zone_grp`='no_name', `geo_zone_name`='Shp: France', `geo_zone_description`='', `last_modified`=now() WHERE geo_zone_id = '5' ;
+
+
/**
@brief update ligne in table configuration
*/
@@ -69,15 +70,11 @@
$where ='';
if(isset($option['id'])) $where .="AND geo_zone_id = '".(int)$option['id']."' ";
-// var_dump($option);
-// exit;
-
$sql_data_array['geo_zone_type'] = (isset($option['type'])) ? tep_db_prepare_input($option['type']) :'1';
$sql_data_array['geo_zone_grp'] = str_replace(' ','_',(isset($option['grp'])) ? tep_db_prepare_input($option['grp']) :'NULL');
$sql_data_array['geo_zone_name'] = (isset($option['name'])) ? tep_db_prepare_input($option['name']) :'NULL';
$sql_data_array['geo_zone_description'] = (isset($option['description'])) ? tep_db_prepare_input($option['description']) :'NULL';
-// $sql_data_array['zone_id'] = (isset($option['zone_id'])) ? tep_db_prepare_input($option['zone_id']) :'NULL';
$sql_data_array['last_modified'] = 'now()';
@@ -136,7 +133,7 @@
$array=array();
foreach($res->fetchAllAssoc() as $result)
- $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
return $array;
}
Modified: trunk/catalog/admin/includes/classes/drivers/sqlzonetogeozone.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlzonetogeozone.php 2011-12-26 23:15:54 UTC (rev 3988)
+++ trunk/catalog/admin/includes/classes/drivers/sqlzonetogeozone.php 2011-12-27 10:47:11 UTC (rev 3989)
@@ -17,13 +17,6 @@
class sqlzonetogeozone
implements ModSqlDataDriver{
- /**
- @var array pre configured section by iso code.
- */
- private static $type = array(
- 'EU'=>'AT, BG, BE , CY, CZ, DK, ES, EE, FI, FR, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, DE, SK, SI, SE, UK,GB, '
- 'EU_continentale'=>'AT, BG, BE , CZ, DK, DE, ES, EE, FI, FR, GR, HU,IE, IT, LV, LT, LU, NL, PL, PT, RO, SK, SI, SE, UK,GB, '
- );
public static $modules;
@@ -195,7 +188,7 @@
$object= new stdclass();
foreach($array as $key=>$value){
- $object->$key = $value;
+ $object->$key = $value;
}
return $object;
Added: trunk/catalog/admin/includes/gabarit/geo_zones/display_view.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/geo_zones/display_view.delete.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/geo_zones/display_view.delete.gab 2011-12-27 10:47:11 UTC (rev 3989)
@@ -0,0 +1,22 @@
+<?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 28/12/11, 16:51
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+ <h3><?php printf(__('geo_zones heading delete zone'),''); ?></h3>
+ <?php print tep_draw_form('geo_zones', geo_zones::FILENAME, 'action=deleteconfirm') ; ?>
+
+ <fieldset class="block_input">
+ <p><?php print __('geo_zones text delete intro'). tep_draw_hidden_field('id', '', geo_zones::$getzID) ; ?></p>
+ </fieldset>
+
+ <fieldset class="block_input button_nav">
+ <?php print tep_image_submit('button_delete.gif', IMAGE_DELETE) . tep_js_back(tep_href_link(geo_zones::FILENAME), IMAGE_CANCEL) ; ?>
+ </fieldset>
+ </form>
\ No newline at end of file
Added: trunk/catalog/admin/includes/gabarit/geo_zones/display_view.deletesub.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/geo_zones/display_view.deletesub.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/geo_zones/display_view.deletesub.gab 2011-12-27 10:47:11 UTC (rev 3989)
@@ -0,0 +1,22 @@
+<?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 28/12/11, 16:51
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+ <h3><?php printf(__('geo_zones heading delete sub zone'),''); ?></h3>
+ <?php print tep_draw_form('geo_zones', geo_zones::FILENAME, 'action=deletesubconfirm') ; ?>
+
+ <fieldset class="block_input">
+ <p><?php print __('geo_zones text intro'). tep_draw_hidden_field('id', '', geo_zones::$getsID). tep_draw_hidden_field('zid', '', geo_zones::$getzID) ; ?></p>
+ </fieldset>
+
+ <fieldset class="block_input button_nav">
+ <?php print tep_image_submit('button_delete.gif', IMAGE_DELETE) . tep_js_back(tep_href_link(geo_zones::FILENAME, 'zID='.geo_zones::$getzID.'&action=edit'), IMAGE_CANCEL) ; ?>
+ </fieldset>
+ </form>
\ No newline at end of file
Added: trunk/catalog/admin/includes/gabarit/geo_zones/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/geo_zones/display_view.edit.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/geo_zones/display_view.edit.gab 2011-12-27 10:47:11 UTC (rev 3989)
@@ -0,0 +1,154 @@
+<?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 28/12/11, 16:51
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<h3><?php echo __('text info heading edit zone'); ?></h3>
+
+
+
+<div id="tabs">
+
+
+ <ul>
+ <li><a href="#tabs-1"><?php echo __('geo_zones specification') ?></a></li>
+ <li><a href="#tabs-2"><?php echo __('geo_zones content') ?></a></li>
+ <li><a href="#tabs-3"><?php echo __('geo_zones group adjust') ?></a></li>
+ </ul>
+
+
+ <div id="tabs-1" class="tabPage">
+ <p><?php echo __('text info edit zone intro'); ?></p>
+
+
+ <?php echo tep_draw_form('zones', geo_zones::FILENAME, 'zID=' . geo_zones::$zInfo->geo_zone_id . '&action=save_zone') ?>
+ <!--
+ <div class="button_nav">
+ <?php //if (!geo_zones::$action) echo '<a class="button" href="' . tep_href_link(FILENAME_GEO_ZONES, tep_get_all_get_params(array('action','sID')). '&action=new_zone') . '">' .tep_image(DIR_WS_ICONS . 'icon_add_new.png', IMAGE_ICON_INFO).' '. __('image insert new zone') . '</a>'; ?>
+ </div>-->
+
+ <div class="box_form">
+ <!-- <div class="box_left"> -->
+
+ <p class="block_input">
+ <label for="geo_zone_name" ><?php echo __('text info zone name'); ?></label>
+ <?php echo tep_draw_input_field('geo_zone_name','', geo_zones::$zInfo->geo_zone_name) ?>
+ </p>
+
+ <p class="block_input">
+ <label for="geo_zone_description" ><?php echo __('text info zone description') ; ?></label>
+ <?php echo tep_draw_input_field('geo_zone_description','', geo_zones::$zInfo->geo_zone_description) ?>
+ </p>
+
+ <p class="block_input">
+ <label for="geo_zone_name" ><?php echo __('text info zone name'); ?></label>
+ <?php echo tep_draw_pull_down_menu('geo_zone_type',geo_zones::$geoTypes, geo_zones::$zInfo->geo_zone_type) ?>
+ </p>
+
+ <p class="block_input">
+ <label for="geo_zone_name" ><?php echo __('text info zone grp'); ?></label>
+ <?php echo tep_draw_pull_down_menu('geo_zone_grp',geo_zones::$geoGrpDispo, geo_zones::$zInfo->geo_zone_grp) ?>
+ <?php echo tep_draw_input_field('geo_zone_grp_add','','') ?>
+ </p>
+
+ <fieldset class="block_input">
+ <div class="block_input button_nav" style="width:95%;">
+ <?php
+ echo tep_image_submit('', IMAGE_UPDATE) . tep_image_submit('', IMAGE_UPDATE_AND_CLOSE,' name="up_and_close"' );
+ echo tep_js_back(tep_href_link(geo_zones::FILENAME, '&zID=' . geo_zones::$zInfo->geo_zone_id ), IMAGE_CANCEL) ;
+ ?>
+ </div>
+ </fieldset>
+
+
+ </div>
+ </form>
+ </div>
+
+ <div id="tabs-2" class="tabPage">
+
+ <div class="box_left">
+ <table class="dataTable">
+ <thead>
+ <tr>
+ <th><?php echo __('table heading country'); ?></th>
+ <th><?php echo __('table heading country region'); ?></th>
+ <th class="tright"><?php echo __('table heading action'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ </tbody>
+ </table>
+ </div>
+ <div class="box_right ">
+ <div class="button_nav">
+ <?php echo '<a class="button" href="' . tep_href_link(geo_zones::FILENAME, 'zID=' . geo_zones::$getzID . '&saction=new&action=edit' ) . '">'.tep_image(DIR_WS_ICONS . 'icon_add_new.png', IMAGE_ICON_INFO).' '. __('image insert new geo zone') . '</a>'; ?>
+ </div>
+
+ <?php echo geo_zones::get_right_bar() ?>
+ </div>
+ </div>
+
+
+ <div id="tabs-3" class="tabPage">
+ <p><?php echo __('geo_zones tabs group intro'); ?></p>
+
+ <fieldset class="block_field">
+ <h5><?php echo __('geo_zones group info other');?></h5>
+
+ <ul>
+ <?php foreach(geo_zones::$zInfo->grp_other as $row): ?>
+ <li><a href="<?php echo tep_href_link(geo_zones::FILENAME, 'zID='.$row['id'].'&action=edit') ;?>" ><?php echo $row['title'] ;?></a></li>
+ <?php endforeach; ?>
+ </ul>
+
+ </fieldset>
+
+ <?php if(count(geo_zones::$zInfo->grp_notin) > 0): ?>
+ <fieldset class="block_field">
+
+ <?php echo tep_draw_form('zones', geo_zones::FILENAME, 'zID=' . geo_zones::$zInfo->geo_zone_id . '&action=reverse_zone') ?>
+ <div class="block_input">
+ <h4><?php echo __('geo_zones reverse intro');?></h4>
+
+ <ul>
+ <?php foreach(geo_zones::$zInfo->grp_other as $row): ?>
+ <li><?php echo tep_draw_checkbox_field('geo_zone_reverse[]','',$row['id']) ?> <?php echo $row['title'] ;?></li>
+ <?php endforeach; ?>
+ </ul>
+
+ <div class="button_nav">
+ <p>
+ <?php echo tep_draw_hidden_field('current_grp', '',geo_zones::$zInfo->geo_zone_grp) . tep_draw_hidden_field('current_type','', geo_zones::$zInfo->geo_zone_type) ?>
+ <?php echo tep_image_submit('', __('image reverse zone create') ); ?>
+ </p>
+ </div>
+
+ <h4><?php echo __('geo_zones group country not in');?></h4>
+
+ <?php if(count(geo_zones::$zInfo->grp_notin) > 10): ?>
+ <p><?php printf (__('geo_zones group country not in is importante %s'), count(geo_zones::$zInfo->grp_notin) );?></p>
+ <?php else: ?>
+ <ul>
+ <?php foreach(geo_zones::$zInfo->grp_notin as $row): ?>
+ <li><?php echo $row['countries_id'] ;?> <?php echo $row['countries_name'] ;?> <?php echo $row['countries_localname'] ;?></li>
+ <?php endforeach; ?>
+ </ul>
+ <?php endif; ?>
+ </div>
+ </form>
+
+ </fieldset>
+ <?php endif; ?>
+ </div>
+
+ <br class="clear" />
+
+
+</div>
\ No newline at end of file
Added: trunk/catalog/admin/includes/gabarit/geo_zones/display_view.new.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/geo_zones/display_view.new.gab (rev 0)
+++ trunk/catalog/admin/includes/gabarit/geo_zones/display_view.new.gab 2011-12-27 10:47:11 UTC (rev 3989)
@@ -0,0 +1,73 @@
+<?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 28/12/11, 16:51
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+*/
+?>
+<h3><?php echo __('text info heading edit zone'); ?></h3>
+
+
+
+ <p><?php echo __('text info edit zone intro'); ?></p>
+
+
+ <?php echo tep_draw_form('zones', geo_zones::FILENAME, 'zID=' . geo_zones::$zInfo->geo_zone_id . '&action=insert_zone') ?>
+ <div class="box_form">
+ <!--
+ <div class="button_nav">
+ <?php //if (!geo_zones::$action) echo '<a class="button" href="' . tep_href_link(FILENAME_GEO_ZONES, tep_get_all_get_params(array('action','sID')). '&action=new_zone') . '">' .tep_image(DIR_WS_ICONS . 'icon_add_new.png', IMAGE_ICON_INFO).' '. __('image insert new zone') . '</a>'; ?>
+ </div>-->
+
+ <fieldset class="block_input">
+
+ <!-- <div class="box_left"> -->
+
+ <p class="block_input">
+ <label for="geo_zone_name" ><?php echo __('text info zone name'); ?></label>
+ <?php echo tep_draw_input_field('geo_zone_name','','') ?>
+ </p>
+
+ <p class="block_input">
+ <label for="geo_zone_description" ><?php echo __('text info zone description') ; ?></label>
+ <?php echo tep_draw_input_field('geo_zone_description','', '') ?>
+ </p>
+
+ <p class="block_input">
+ <label for="geo_zone_name" ><?php echo __('text info zone name'); ?></label>
+ <?php echo tep_draw_pull_down_menu('geo_zone_type',geo_zones::$geoTypes,'') ?>
+ </p>
+
+ <p class="block_input">
+ <label for="geo_zone_name" ><?php echo __('text info zone grp'); ?></label>
+ <span class="nobr">
+ <?php echo tep_draw_pull_down_menu('geo_zone_grp',geo_zones::$geoGrpDispo,'') ?>
+ <?php echo tep_draw_input_field('geo_zone_grp_add','','') ?>
+ </span>
+ </p>
+ </fieldset>
+
+ <fieldset class="block_input">
+ <h4><?php echo __('geo_zone text info zone pre-programmed'); ?></h4>
+
+ <p class="block_input">
+ <label for="geo_zone_name" ><?php echo __('text info zone name'); ?></label>
+ <?php echo tep_draw_pull_down_menu('geo_zone_model',geo_zones::$zInfo->modeleszones,'') ?>
+ </p>
+ </fieldset>
+
+ <fieldset class="block_input">
+ <div class="block_input button_nav" style="width:95%;">
+ <?php
+ echo tep_image_submit('', IMAGE_INSERT);
+ echo tep_js_back(tep_href_link(geo_zones::FILENAME, '&zID=' . geo_zones::$zInfo->geo_zone_id ), IMAGE_CANCEL) ;
+ ?>
+ </div>
+ </fieldset>
+ </div>
+ </form>
+
Deleted: trunk/catalog/admin/includes/gabarit/geo_zones.list.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/geo_zones.list.gab 2011-12-26 23:15:54 UTC (rev 3988)
+++ trunk/catalog/admin/includes/gabarit/geo_zones.list.gab 2011-12-27 10:47:11 UTC (rev 3989)
@@ -1,67 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.0.9
- @date 17/07/10, 16:35
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-?>
-<h3><?php echo __('heading title'); ?></h3>
-
-
- <div class="button_nav">
- <?php echo '<a class="button" href="' . tep_href_link(FILENAME_GEO_ZONES,'zID=' . geo_zones::$getzID) . '">' . IMAGE_BACK . '</a> <a class="button" href="' . tep_href_link(FILENAME_GEO_ZONES, 'zID=' . geo_zones::$getzID . '&saction=list&action=new&' . (isset(geo_zones::$sInfo) ? 'sID=' . geo_zones::$sInfo->association_id : '') ) . '">'.tep_image(DIR_WS_ICONS . 'icon_add_new.png', IMAGE_ICON_INFO).' '. __('image insert new geo zone') . '</a>'; ?>
- </div>
-
- <h4><?php echo @$thezone['geo_zone_name']; ?></h4>
- <p><?php echo @$thezone['geo_zone_description']; ?></p>
-
-<div class="box_uniq">
- <div class="box_left">
-
- <table class="dataTable">
- <thead>
- <tr>
- <th><?php echo __('table heading country'); ?></th>
- <th><?php echo __('table heading country region'); ?></th>
- <th class="tright"><?php echo __('table heading action'); ?></th>
- </tr>
- </thead>
-<?php /*
- <tfoot>
- <tr>
- <td><?php echo $zones_split->display_count($zones_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, $spage, TEXT_DISPLAY_NUMBER_OF_COUNTRIES); ?></td>
- <td colspan="2" ><span class="tcenter"><?php echo row_by_page(FILENAME_GEO_ZONES,$row_bypage_array, $row_by_page, "fleft") ?></span>
- <span class="fright"><?php echo $zones_split->display_links($zones_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, MAX_DISPLAY_PAGE_LINKS, $spage, tep_get_all_get_params(array('action','spage','sID')).'action=list', 'spage'); ?> </span>
- </td>
- </tr>
- </tfoot>
-*/ ?>
- <tbody>
- <?php /*foreach($list_g2z as $zones){ ?>
- <tr class="view parent dataTableRow <?php if(isset($_GET['sID']) && ($_GET['sID'] == $zones['association_id']))echo "Selected" ?>" >
- <td class="tcenter"><?php echo (($zones['countries_name']) ? $zones['countries_name'] : TEXT_ALL_COUNTRIES); ?></td>
- <td class="tcenter"><?php echo (($zones['zone_id']) ? $zones['zone_name'] : PLEASE_SELECT); ?></td>
- <td style="width:100px">
- <span class="view fils fleft">
- <?php
- echo '<a class="buttonimg" href="' . tep_href_link(FILENAME_GEO_ZONES, tep_get_all_get_params(array('saction','sID')).'sID=' . $zones['association_id'] . '&saction=edit') . '">' . tep_image(DIR_WS_ICONS . 'icon_edit.png',IMAGE_EDIT ). '</a>'
- .'<a class="buttonimg" href="' . tep_href_link(FILENAME_GEO_ZONES,tep_get_all_get_params(array('saction','sID','geo_zone_name')).'sID=' . $zones['association_id'] . '&saction=delete') . '">' . tep_image(DIR_WS_ICONS . 'icon_delete.png',IMAGE_DELETE).'</a>';
- ?>
- </span>
- <span class="fright">
- <?php if (isset($sInfo) && is_object($sInfo) && ($zones['association_id'] == $sInfo->association_id)) { echo tep_image(DIR_WS_ICONS . 'icon_arrow_right.gif', ''); }
- else { echo '<a href="' . tep_href_link(FILENAME_GEO_ZONES, tep_get_all_get_params(array('action','sID')).'action=list&sID=' . $zones['association_id']) . '">' . tep_image(DIR_WS_ICONS . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>
- </span>
- </td>
- </tr>
- <?php } */?>
- </tbody>
- </table>
- </div>
- <div class="box_right ">
- <?php echo geo_zones::get_right_bar() ?>
- </div>
-</div>
\ No newline at end of file
Deleted: trunk/catalog/admin/includes/gabarit/geo_zones.listing.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/geo_zones.listing.gab 2011-12-26 23:15:54 UTC (rev 3988)
+++ trunk/catalog/admin/includes/gabarit/geo_zones.listing.gab 2011-12-27 10:47:11 UTC (rev 3989)
@@ -1,38 +0,0 @@
-<?php
-/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- @package osCSS-2 <www http://www.oscss.org>
- @version 2.0.9
- @date 17/07/10, 16:35
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-?>
-<h3><?php echo __('heading title'); ?></h3>
-
-
- <div class="button_nav">
- <?php if (!geo_zones::$action) echo '<a class="button" href="' . tep_href_link(FILENAME_GEO_ZONES, tep_get_all_get_params(array('action','sID')). '&action=new_zone') . '">' .tep_image(DIR_WS_ICONS . 'icon_add_new.png', IMAGE_ICON_INFO).' '. __('image insert new zone') . '</a>'; ?>
- </div>
-
- <div class="box_uniq">
- <div class="box_left">
- <table class="dataTable">
- <thead>
- <tr>
- <th style="width:20px;"><?php echo __('table heading tax zones type'); ?></th>
- <th><?php echo __('table heading tax zones'); ?></th>
- <th><?php echo __('table heading tax zones desc'); ?></th>
- <th><?php echo __('table heading nbr sub'); ?></th>
- <th class="tright"><?php echo __('table heading action'); ?></th>
- </tr>
- </thead>
- <tbody>
- <!-- AJAX BLOCK -->
- </tbody>
- </table>
- </div>
- <div class="box_right ">
- <?php echo geo_zones::get_right_bar() ?>
- </div>
-</div>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/geo_zones.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/geo_zones.txt 2011-12-26 23:15:54 UTC (rev 3988)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/geo_zones.txt 2011-12-27 10:47:11 ...
[truncated message content] |
|
From: <os...@us...> - 2011-12-29 21:55:16
|
Revision: 3997
http://oscss.svn.sourceforge.net/oscss/?rev=3997&view=rev
Author: oscim
Date: 2011-12-29 21:55:10 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
FS#951
correction text menu extensions
Modified Paths:
--------------
trunk/catalog/admin/includes/languages/fr_FR/boxes/02_modules.php
trunk/catalog/includes/triggers/cart_totaux.inc
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/triggers/cart_totaux.inc
Modified: trunk/catalog/admin/includes/languages/fr_FR/boxes/02_modules.php
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/boxes/02_modules.php 2011-12-29 18:55:35 UTC (rev 3996)
+++ trunk/catalog/admin/includes/languages/fr_FR/boxes/02_modules.php 2011-12-29 21:55:10 UTC (rev 3997)
@@ -2,8 +2,8 @@
/**
@licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 09/12/10, 17:23
+ @version 2.1.1
+ @date 28/12/10, 17:23
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief file languages for boxes menu
@@ -13,8 +13,8 @@
define('BOX_MODULES_SHIPPING',"Expédition" );
define('BOX_MODULES_ORDER_TOTAL',"Total commande" );
define('BOX_MODULES_INSTALLATEUR',"Extension Catalogue" );
-define('BOX_MODULES_PANEL',"Extension générale" );
-define('BOX_MODULES_CHECKOUT_PANEL',"Extension checkout" );
+define('BOX_MODULES_PANEL',"Modules générale" );
+define('BOX_MODULES_CHECKOUT_PANEL',"Modules checkout" );
define('BOX_PLUGINS_PANEL',"Plugins de thème" );
define('BOX_HEADING_CONF_BOX_PLUGIN',"Plugins du template" );
?>
\ No newline at end of file
Modified: trunk/catalog/includes/triggers/cart_totaux.inc
===================================================================
--- trunk/catalog/includes/triggers/cart_totaux.inc 2011-12-29 18:55:35 UTC (rev 3996)
+++ trunk/catalog/includes/triggers/cart_totaux.inc 2011-12-29 21:55:10 UTC (rev 3997)
@@ -4,12 +4,12 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 20/10/11, 11:14
+ @date 28/12/11, 17:30
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @brief code is part of execution shopping cart by ajax control
*/
+
global $cart;
if (is_object($cart) && $cart->count_contents() > 0) {
@@ -21,7 +21,7 @@
$det .= '<li><span class="text">'.__('box shopping cart weight').'</span> <span class="value">'.$cart->show_weight().' '.UNIT_WEIGHT_NAME.'</span></li>'."\n";
}
+ /// force return by
+ echo $det.' ';
- echo $det;
-
?>
\ No newline at end of file
Modified: trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/triggers/cart_totaux.inc
===================================================================
--- trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/triggers/cart_totaux.inc 2011-12-29 18:55:35 UTC (rev 3996)
+++ trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/triggers/cart_totaux.inc 2011-12-29 21:55:10 UTC (rev 3997)
@@ -4,7 +4,7 @@
@subpackage 2cShopHtml5Oscim
@package osCSS-2 <www http://www.oscss.org>
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @date 16/09/10, 21:54
+ @date 128/12/11, 21:54
@encode UTF-8
*/
@@ -20,7 +20,7 @@
$det .= '<li><span class="text">'.__('box shopping cart weight').'</span> <span class="value">'.$cart->show_weight().' '.UNIT_WEIGHT_NAME.'</span></li>'."\n";
}
+ /// force return by
+ echo $det.' ';
- echo $det;
-
?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-01-01 16:43:07
|
Revision: 4003
http://oscss.svn.sourceforge.net/oscss/?rev=4003&view=rev
Author: oscim
Date: 2012-01-01 16:42:59 +0000 (Sun, 01 Jan 2012)
Log Message:
-----------
nombreuse correction et optimisation du code
suite evolution du code sur la normalisation des DataType
Amelioration des drivers associ?\195?\169
modification de la page membre public
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/aca.php
trunk/catalog/admin/includes/classes/drivers/productsACA.php
trunk/catalog/admin/includes/gabarit/customers/address_book/display_view.tabs.gab
trunk/catalog/admin/includes/gabarit/customers/address_book/inline.delete.gab
trunk/catalog/admin/includes/gabarit/customers/address_book/inline.edit.gab
trunk/catalog/admin/includes/header.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/template/oscss/inc/lib_general-1.js
trunk/catalog/admin/includes/template/oscss/stylesheet-1.css
trunk/catalog/common/class.interfaces.php
trunk/catalog/includes/classes/AbstractAcaModule.php
trunk/catalog/includes/classes/drivers/data/categorie.php
trunk/catalog/includes/classes/drivers/data/content.php
trunk/catalog/includes/classes/drivers/data/product.php
trunk/catalog/includes/classes/drivers/page/GabaritTemplate.php
trunk/catalog/includes/classes/page.php
trunk/catalog/includes/inc_base_lib.php
trunk/catalog/index.php
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/Css/habillage.css
trunk/catalog/install/data/templates/appareil_photo/2cShopHtml5Oscim/includes/content/customers.php
trunk/catalog/install/includes/modele/htaccess.txt
Removed Paths:
-------------
trunk/catalog/admin/includes/functions/lib.customers_groups.php
Modified: trunk/catalog/admin/includes/classes/aca.php
===================================================================
--- trunk/catalog/admin/includes/classes/aca.php 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/admin/includes/classes/aca.php 2012-01-01 16:42:59 UTC (rev 4003)
@@ -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 14/12/11, 22:53
+ @date 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief base class for aca extension
@@ -44,14 +44,14 @@
$this->image_handler='';
foreach(parent::initialise_type($const,$key) as $class){
- $cl[$class]=new $class ();
- $list_mod[$class] = $cl[$class]->sort_order;
+ $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];
+ }
}
- }
}
public function ret_modules ($action){ return $this->modules;}
Modified: trunk/catalog/admin/includes/classes/drivers/productsACA.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/productsACA.php 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/admin/includes/classes/drivers/productsACA.php 2012-01-01 16:42:59 UTC (rev 4003)
@@ -25,32 +25,47 @@
public $image_handler;
/**
- class constructor
+ @brief class constructor
+ @param $id int products id for load sub module
+ @note if $id is null serach $_GET['pID'] or $_REQUEST['pID']
*/
- function __construct() {
+ function __construct($id=0) {
global $language, $languages_id,$language_code2, $lang,$oscss;
$this->name='products';
- $this->products_id='';
+ $this->products_id=(int)(($id>0)?$Id : 0);
$this->image_handler='';
$this->type_flag=1;
+ /// force
+ if($this->products_id <= 0){
+ if (isset ($_GET['pID']))
+ $this->products_id=(int)$_GET['pID'];
+ elseif (isset ($_REQUEST['pID']))
+ $this->products_id=(int)$_REQUEST['pID'];
+ }
+
$this->modules=array();
$list_mod = array();
foreach(parent::initialise_type('MODULE_ACAPRO_INSTALLED_BO','products') as $class){
$cl[$class]=new $class ();
- // test flag type module, si aucun, produist base
- if(!isset($cl[$class]->flag_type_virtual)) $cl[$class]->flag_type_virtual=0;
- // incremente tableau module unqiuement si flag ok
- if($this->control_type_mod($cl[$class]->flag_type_virtual)) $list_mod[$class] = $cl[$class]->sort_order;
+
+ if($this->products_id > 0){
+ // test flag type module, si aucun, produist base
+ if(!isset($cl[$class]->flag_type_virtual)) $cl[$class]->flag_type_virtual=0;
+ // incremente tableau module unqiuement si flag ok
+ if($this->control_type_mod($cl[$class]->flag_type_virtual)) $list_mod[$class] = $cl[$class]->sort_order;
+ }
+ else
+ $list_mod[$class] = $cl[$class]->sort_order;
}
if(count($list_mod)>1) {
asort($list_mod);
foreach($list_mod as $class=>$s){
- $this->modules[$class] =$cl[$class];
+ $this->modules[$class] =$cl[$class];
}
unset($list_mod);
}
@@ -91,8 +106,10 @@
@return int, Id du type ou 1
*/
private function load_type_product(){
- if(!isset($_GET['pID'])) return ;
- $sql = "select * from ".TABLE_PRODUCTS." where products_id=".(int)$_GET['pID'];
+ if($this->products_id<=0)
+ return $this->type_flag=1;
+
+ $sql = "select * from ".TABLE_PRODUCTS." where products_id='".(int)$this->products_id."'";
$result = tep_db_query($sql);
if (tep_db_num_rows($result) > 0) { // this product is in the virtual table
$virtual = tep_db_fetch_array($result);
@@ -283,8 +300,8 @@
/**
Vue etat et list specifique modules
*/
- function display_view (&$contents) {
- }
+// function display_view (&$contents) {
+// }
/**
Return tableau complet des element à insrére dans la clause sql
Deleted: trunk/catalog/admin/includes/functions/lib.customers_groups.php
===================================================================
--- trunk/catalog/admin/includes/functions/lib.customers_groups.php 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/admin/includes/functions/lib.customers_groups.php 2012-01-01 16:42:59 UTC (rev 4003)
@@ -1,16 +0,0 @@
-<?php
-/**
- @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 19/12/10, 19:49
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
-*/
-
-
-function list_mod_shipping(){
-
-}
-?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/customers/address_book/display_view.tabs.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/customers/address_book/display_view.tabs.gab 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/admin/includes/gabarit/customers/address_book/display_view.tabs.gab 2012-01-01 16:42:59 UTC (rev 4003)
@@ -1,10 +1,10 @@
<?php
/**
- @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.1
- @date 30/12/11, 19:31
+ @date 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@subpackage address_book
Modified: trunk/catalog/admin/includes/gabarit/customers/address_book/inline.delete.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/customers/address_book/inline.delete.gab 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/admin/includes/gabarit/customers/address_book/inline.delete.gab 2012-01-01 16:42:59 UTC (rev 4003)
@@ -1,10 +1,10 @@
<?php
/**
- @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.1
- @date 30/12/11, 19:31
+ @date 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@subpackage address_book
Modified: trunk/catalog/admin/includes/gabarit/customers/address_book/inline.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/customers/address_book/inline.edit.gab 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/admin/includes/gabarit/customers/address_book/inline.edit.gab 2012-01-01 16:42:59 UTC (rev 4003)
@@ -1,10 +1,10 @@
<?php
/**
- @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.1
- @date 30/12/11, 19:31
+ @date 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@subpackage address_book
Modified: trunk/catalog/admin/includes/header.php
===================================================================
--- trunk/catalog/admin/includes/header.php 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/admin/includes/header.php 2012-01-01 16:42:59 UTC (rev 4003)
@@ -1,9 +1,10 @@
<?php
/**
- @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 05/01/11, 11:51
+ @version 2.1.1
+ @date 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief block in balise html head.
@@ -68,18 +69,25 @@
$('.tabs_lang').tabs().find('.ui-tabs-nav').sortable({axis:'x'});
- /** Flag ajax process Used in row status */
- $('a.ajaxinline').each(function(){
- var current = $(this);
- var ref =this.href +='&forceajax=true';
- current.click(function() {
- $.get(ref, function(data) {
- current.replaceWith(data);
- });
- return false;
- });
- });
+ /** Flag ajax process Used in row status */
+ $('a.ajaxinline').each(function(){
+ var current = $(this);
+ var reg = /(forceajax)/gi;
+ if( ! reg.test( this.href) )
+ var ref =this.href +='&forceajax=true';
+ else
+ var ref =this.href;
+ current.click(function() {
+ $.get(ref, function(data) {
+ current.replaceWith(data);
+ });
+ return false;
+ });
+ });
+
+
+// simple_tooltip("input","tooltip");
}
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2012-01-01 16:42:59 UTC (rev 4003)
@@ -1,11 +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
- @Portioncode products class for ACA v2 (Advanced Categories Admin) by Rigadin2, www.osc-help.net
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 28/12/11, 09:40
+ @date 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class customers
@@ -113,6 +112,7 @@
$DB=Database::getInstance();
$_return=array();
+// var_dump(__CLASS__.'check_action');
if(isset($_GET['cID'])) self::$cID= (int)$_GET['cID'];
elseif(isset($_POST['customers_id'])) self::$cID= (int)$_POST['customers_id'];
@@ -291,9 +291,9 @@
A module has asked to privately take care of this action, check if class and method exist and run it.
*/
if (!empty(self::$actions['action_method']) && method_exists(self::$modules->modules[self::$actions['action_class']],self::$actions['action_method'] )){
- $metho=self::$actions['action_method'];
- self::$box = new box;
- self::$box=self::$modules->modules[self::$actions['action_class']]->$metho(self::$box,(int)$_GET['pID']);
+ $metho=self::$actions['action_method'];
+ self::$box = new box;
+ self::$box=self::$modules->modules[self::$actions['action_class']]->$metho(self::$box,(int)$_GET['pID']);
}
}
@@ -339,7 +339,7 @@
/**
@remarks Normal View Page
*/
- case 'confirm':
+ case 'delete':
self::load_db_values(self::$cID);
$action='delete';
break;
@@ -382,7 +382,7 @@
sprintf(CsrtAction::getLink('row_action_right', __('incarner'), 'incarner'), '', tep_catalog_href_link('login.php','osCAdminDirect='.md5($SecuKey.date('d')).'&id='.$customers['customers_id'],'SSL', false ) ,'').
sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'noedit'), '', tep_href_link(self::FILENAME,'cID=' . $customers['customers_id'].'&action=noedit' ),'' ).
sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME,'cID=' . $customers['customers_id'].'&action=edit' ),'' ).
- sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $customers['customers_id'].'&action=confirm' ) ,'' )
+ sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cID=' . $customers['customers_id'].'&action=delete' ) ,'' )
);
}
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2012-01-01 16:42:59 UTC (rev 4003)
@@ -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 28/12/11, 17:30
+ @date 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -101,17 +101,23 @@
/**
@remarks not load if not first init
*/
- if(defined('JSONSTATMENT')) return;
+ if(!defined('JSONSTATMENT')){
+ //! active datatable in ajax, precise les GET necessaire
+ if(self::$action =='listing') define('JSONSTATMENT', 'mod=page&type='.self::$code.(isset($_GET['expected'])?'&expected=true':'').(isset($_GET['cPath'])?'&cPath='.$_GET['cPath']:'').(isset($_GET['Vtype'])?'&Vtype='.$_GET['Vtype']:''));
+ //! detail item in ajax
+ if(!defined('AJAXSTATMENTDETAIL')) define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
+ }
+ /**
+ @remarks Specific product, force load current id for adjust module
+ */
+ if (isset ($_GET['pID']))
+ self::$modules=new productsACA($_GET['pID']);
+ elseif (isset ($_POST['pID']))
+ self::$modules=new productsACA($_POST['pID']);
+ else
+ self::$modules=new productsACA();
- //! active datatable in ajax, precise les GET necessaire
- if(!defined('JSONSTATMENT')) define('JSONSTATMENT', 'mod=page&type='.self::$code.(isset($_GET['expected'])?'&expected=true':'').(isset($_GET['cPath'])?'&cPath='.$_GET['cPath']:'').(isset($_GET['Vtype'])?'&Vtype='.$_GET['Vtype']:''));
- //! detail item in ajax
- if(!defined('AJAXSTATMENTDETAIL')) define('AJAXSTATMENTDETAIL', 'mod=page&type='.self::$code);
-
-
-
- self::$modules=new productsACA;
self::$modules->set_image_handler();
// check if the catalog image directory exists
@@ -138,21 +144,24 @@
$epf = array();
$xfields = array();
while ($e = tep_db_fetch_array($epf_query)) { // retrieve all active extra fields for all languages
- $field = 'extra_value' . ($e['epf_uses_value_list'] ? '_id' : '') . $e['epf_id'];
- $epf[] = array('id' => $e['epf_id'],
- 'label' => $e['epf_label'],
- 'uses_list' => $e['epf_uses_value_list'],
- 'show_chain' => $e['epf_show_parent_chain'],
- 'size' => $e['epf_size'],
- 'language' => $e['languages_id'],
- 'language_active' => $e['epf_active_for_language'],
- 'field' => $field);
- if (!in_array( $field, $xfields))
- $xfields[] = $field; // build list of distinct fields
+ $field = 'extra_value' . ($e['epf_uses_value_list'] ? '_id' : '') . $e['epf_id'];
+ $epf[] = array('id' => $e['epf_id'],
+ 'label' => $e['epf_label'],
+ 'uses_list' => $e['epf_uses_value_list'],
+ 'show_chain' => $e['epf_show_parent_chain'],
+ 'size' => $e['epf_size'],
+ 'language' => $e['languages_id'],
+ 'language_active' => $e['epf_active_for_language'],
+ 'field' => $field);
+ if (!in_array( $field, $xfields))
+ $xfields[] = $field; // build list of distinct fields
}
// end Extra Product Fields
+
+
+
self::$actions['action'] = self::$action;
self::$actions['display_file']='';
self::$actions['action_class']=(isset($_GET['action_class']))? $_GET['action_class'] : '';
@@ -160,6 +169,7 @@
// Ask categories modules if want to change the action
self::$actions = self::$modules->check_action(self::$actions);
+
self::$action = self::$actions['action'];
Modified: trunk/catalog/admin/includes/template/oscss/inc/lib_general-1.js
===================================================================
--- trunk/catalog/admin/includes/template/oscss/inc/lib_general-1.js 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/admin/includes/template/oscss/inc/lib_general-1.js 2012-01-01 16:42:59 UTC (rev 4003)
@@ -1,11 +1,30 @@
function showmenu(num_id){
- for(i=0;i<8;i++){
- if (num_id !=='' && num_id===i) {
- $('#menu'+i+'Container').show().Fisheye({maxWidth: 90, items: 'a', itemsText: 'span', container: '.options', itemWidth: 50, proximity: 55, alignment: 'left', valign: 'top', halign: 'center'});
- }
- else {$('#menu'+i+'Container').hide();}
- }
-}
-$(function(){
- $(".adminBlock h3").click(function () {$(".adminBlock .tirroir").slideToggle("slow");});
-});
\ No newline at end of file
+ for(i=0;i<8;i++){
+ if (num_id !=='' && num_id===i) {
+ $('#menu'+i+'Container').show().Fisheye({maxWidth: 90, items: 'a', itemsText: 'span', container: '.options', itemWidth: 50, proximity: 55, alignment: 'left', valign: 'top', halign: 'center'});
+ }
+ else {$('#menu'+i+'Container').hide();}
+ }
+ }
+ $(function(){
+ $(".adminBlock h3").click(function () {$(".adminBlock .tirroir").slideToggle("slow");});
+ });
+
+
+
+ // function simple_tooltip(target_items, name){
+ // $(target_items).each(function(i){
+ // $("body").append("<div class='"+name+"' id='"+name+i+"'><p>"+$(this).attr('title')+"</p></div>");
+ // var my_tooltip = $("#"+name+i);
+ //
+ // var ref = $(this).attr("id");
+ //
+ // $("label[for='"+ref+"']").removeAttr("title").mouseover(function(){
+ // my_tooltip.css({opacity:0.8, display:"none"}).fadeIn(400);
+ // }).mousemove(function(kmouse){
+ // my_tooltip.css({left:kmouse.pageX+15, top:kmouse.pageY+15});
+ // }).mouseout(function(){
+ // my_tooltip.fadeOut(400);
+ // });
+ // });
+ // }
\ No newline at end of file
Modified: trunk/catalog/admin/includes/template/oscss/stylesheet-1.css
===================================================================
--- trunk/catalog/admin/includes/template/oscss/stylesheet-1.css 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/admin/includes/template/oscss/stylesheet-1.css 2012-01-01 16:42:59 UTC (rev 4003)
@@ -1,17 +1,17 @@
/**
- @ 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.1
- @date 23/06/10, 17:42
- @author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @encode UTF-8
+ * @ 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 01/01/2012, 18:17
+ * @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ * @encode UTF-8
*/
body { background:#faf9f7 url(img/1/body.jpg) repeat-x; color:#000; margin:0; padding:0; font: normal 11px Verdana, Arial, sans-serif; }
html { height: 100%;}
/* prepend */
* {margin:0;padding:0}
-a :link, ***
+a * :link, **
a:visited {text-decoration: underline; color:#000;}
a:hover { text-decoration: none; }
img { border-width:0 ; margin:0; padding:0; }
@@ -41,6 +41,17 @@
.noselected{}
.selected{background:#f0d4bf;}
+/* popup form by fancy */
+#fancybox-inner h3 { background: none repeat scroll 0 0 black; color: white; font-weight: normal; height: 21px; left: 0; line-height: 20px; padding: 0; position: absolute; text-align: center; text-shadow: none; top: 0; width: 100%;}
+#fancybox-inner form {margin:0; padding:0; position: relative;top:20px;min-height: 90%;}
+#fancybox-inner form h3{ top: -25px;}
+#fancybox-inner fieldset { margin: 5px; padding:5pxem; border:none; }
+#fancybox-inner fieldset label { width: 100%; line-height: 18px; margin-right: 10px; display:inline-block; text-align: left; padding: 0 0 2px 0;}
+#fancybox-inner fieldset select,
+#fancybox-inner fieldset input[type="text"] { min-width:65%; display:inline-block;float:right;}
+#fancybox-inner .button_nav {bottom: 0; position: absolute; right: 0;}
+
+
/* general class */
.error{ color:red; }
.info{ color:blue;}
@@ -357,7 +368,7 @@
#central form fieldset legend { color:#666666; font-size:1.2em; font-style:italic; font-weight:bold; padding:0 5px 0 20px;}
#central form p select,
#central form p input[type="text"] { margin:5px 15px; min-width:200px; }
-#central form p input[type="radio"],
+/* #central form p input[type="radio"], */
#central form p input[type="checkbox"] { float:right; margin:5px 15px; width:20px; }
#central form .input-multi input[type="radio"]{float:none;}
@@ -483,8 +494,8 @@
#customerInfos p{min-height:70px;background:transparent url(img/1/header_infos.png) no-repeat bottom right;}
#salesStats p{float:left;min-height:50px;margin:0 auto;background:transparent url(img/1/header_sales.png) no-repeat bottom right;}
/* #orderStats,
- # customerStats, ***
-#customerInfos { height: 110px; }*/
+ * # customerStats, **
+ # *customerInfos { height: 110px; }*/
#orderStats ul,
#customerStats ul,
/* #salesStats ul { list-style-type:none; margin:0 0 0 2px; padding:0;} */
@@ -647,4 +658,24 @@
/* Ext */
-#central .dataTables_wrapper {min-height:200px}
\ No newline at end of file
+#central .dataTables_wrapper {min-height:200px}
+
+/* Toolips */
+
+.tooltip{
+ position:absolute;
+ z-index:999;
+ left:-9999px;
+ background-color:#dedede;
+ padding:5px;
+ border:1px solid #fff;
+ width:250px;
+}
+
+.tooltip p{
+ margin:0;
+ padding:0;
+ color:#fff;
+ background-color:#222;
+ padding:2px 7px;
+}
\ No newline at end of file
Modified: trunk/catalog/common/class.interfaces.php
===================================================================
--- trunk/catalog/common/class.interfaces.php 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/common/class.interfaces.php 2012-01-01 16:42:59 UTC (rev 4003)
@@ -1,10 +1,10 @@
<?php
/**
- @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.0.9
- @date 05/07/10, 18:17
+ @version 2.1.1
+ @date 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -104,7 +104,23 @@
}
+/**
+ @class DataStatmentFO
+ @brief This class is master abstract class Data Statment FO by driverDataType
+*/
abstract class DataStatmentFO {
+ /**
+ @var $lg_id int
+ */
+ public static $lg_id;
+ /**
+ @var $obj_language query sql ressource result
+ */
+ public static $obj_language;
+ /**
+ @var $cache array cache result
+ */
+ public static $cache=array();
// Force la classe étendue à définir cette méthode
protected static function statment_query($content_query,$exclude='',$search=''){}
@@ -122,5 +138,31 @@
self::$obj_language = $DB->query("select code from " . TABLE_LANGUAGES . " where languages_id='" .self::$lg_id . "'");
}
+ /**
+ \brief delet item in cache
+ \param $id integer id cat
+ */
+ public static function resetCacheId($id){
+ foreach(self::$cache as $k=>$v)
+ if($v==$id) {
+ unset(self::$cache[$k]);
+ }
+ }
+
+ /**
+ * \brief Mise en pile de toutes les element des page de cms
+ * @param $id int
+ */
+ public static function add_cache($id){
+ self::$cache[]=$id;
+ }
+
+ /**
+ * \brief Appel et recup des element du cache
+ */
+ public static function in_cache(){
+ return implode("," ,self::$cache);
+ }
+
}
?>
\ No newline at end of file
Modified: trunk/catalog/includes/classes/AbstractAcaModule.php
===================================================================
--- trunk/catalog/includes/classes/AbstractAcaModule.php 2011-12-30 15:06:00 UTC (rev 4002)
+++ trunk/catalog/includes/classes/AbstractAcaModule.php 2012-01-01 16:42:59 UTC (rev 4003)
@@ -1,17 +1,97 @@
<?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
- \portion code Copyright (c) 2002 osCommerce
- \package osCSS-2 <www http://www.oscss.org>
- \version 2.1.0
- \date 22/03/2011, 23:18
- \author oscim <mail aur...@os...> <www http://www.oscim.fr>
- \encode UTF-8
+ @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 01/01/2012, 18:17
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
\file AbstractAcaModule.php
\brief
Ces classes sont les classes de base de l'appel des structure aca, elle ne sont appelé que par l'intermisiaire de class enfants
*/
+
+Class DataTypeFactory{
+
+ public static $modules;
+ /**
+ @var current type datatype value
+ */
+ public static $type;
+
+ /**
+ @brief constructor
+ */
+ protected function __construct($full) {
+ global $languages_id;
+ if($full) $this->start_module();
+ }
+
+ /**
+ @brief Appel magic
+ @param $method string
+ @param $attrs array
+ */
+// public function __call($method, $attrs) {
+// $r=array();
+// foreach ($this->modules as $key=>$module) {
+// if (method_exists($module, $method )) /// control presence method
+// $r[$key]=$this->modules[$key]->$method($attrs);
+// }
+//
+// return $r;
+// }
+
+
+ /**
+ Module ACA
+ */
+
+ /**
+ * \fn ret_modules()
+ * \brief Retour tableau des modules type products actif
+ * @return plusieurs modules via array(object)
+ */
+ public function ret_modules(){ $pdm=$this->start_module(); return $pdm->ret_modules();}
+ /**
+ * \fn check_action($class='',$actions='')
+ * \brief execute la capture des actions par les modlues
+ * @param $class string
+ * @param $actions array
+ */
+ public function check_action($class='',$actions=''){ $pdm=$this->start_module(); return $pdm->check_action($class,$actions);}
+ /**
+ * \fn get_header($class='',$actions='')
+ * \brief traitement block header des module
+ * Display block header modules
+ * @param $class string
+ * @param $actions array
+ */
+ public function get_header($class='',$actions=''){ $pdm=$this->start_module(); return $pdm->get_header($class,$actions);}
+ /**
+ * \fn after_check_action($class='',$actions='')
+ * \brief after_check_action
+ * @param $class string
+ * @param $actions array
+ */
+ public function after_check_action($class='',$actions=''){ $pdm=$this->start_module(); return $pdm->after_check_action($class,$actions);}
+ /**
+ * \fn display_view($pID,$class='',$exclude=array())
+ * \brief after_check_action
+ * @param $pID int
+ * @param $class string
+ * @param $exclude array
+ */
+ public function display_view($ID,$class='',$exclude=array()){ $pdm=$this->start_module(); return $pdm->display_view($ID,$class,$exclude);}
+
+
+
+
+}
+
+
/**
\class AbstractAcaModule
\brief class d'appel des module aca
@@ -29,24 +109,26 @@
public static function initialise_type($cst, $folder_base){
global $page,$language,$messageStack;
$list_mod=array();
+
if(defined($cst)){
+// var_dump($cst);
$files_array=explode (';',str_replace(';;',';',constant($cst)));
if (tep_not_null($files_array[0])) {
- reset ($files_array);
- while (list ($key, $file) = each ($files_array)) {
- $class=substr($file,0, strlen($file)-4 );
- $folder=$folder_base;
- //! module dans leur propre sous rep
- if(is_dir(DIR_WS_MODULES . $folder.'/'.$class)) {
- $folder .= '/' . $class;
- }
- if (!empty($class)) {
- if(($path=page::fix_file(DIR_WS_INCLUDES .'languages/'. $language . '/modules/'. $folder...
[truncated message content] |
|
From: <os...@us...> - 2012-01-01 20:07:48
|
Revision: 4004
http://oscss.svn.sourceforge.net/oscss/?rev=4004&view=rev
Author: oscim
Date: 2012-01-01 20:07:41 +0000 (Sun, 01 Jan 2012)
Log Message:
-----------
FS#917
FS#957
correction coquille suite remont?\195?\169 precedente
correction suite evolution prise en charge des images
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/productsACA.php
trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
trunk/catalog/admin/includes/functions/html_output.php
trunk/catalog/admin/includes/gabarit/categories/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
trunk/catalog/admin/includes/modules/configuration/modtemplate.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/admin/includes/template/oscss/jquery-ui-1.css
trunk/catalog/admin/includes/template/oscss/stylesheet-1.css
trunk/catalog/includes/modules/also_purchased_products.php
trunk/catalog/index.php
trunk/catalog/install/includes/content/core.base.php
trunk/catalog/install/includes/modele/admin_configure.txt
trunk/catalog/install/includes/sql/mysql/data/91_osc_images.sql
Modified: trunk/catalog/admin/includes/classes/drivers/productsACA.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/productsACA.php 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/admin/includes/classes/drivers/productsACA.php 2012-01-01 20:07:41 UTC (rev 4004)
@@ -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 14/12/11, 20:11
+ @date 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -33,7 +33,7 @@
global $language, $languages_id,$language_code2, $lang,$oscss;
$this->name='products';
- $this->products_id=(int)(($id>0)?$Id : 0);
+ $this->products_id=(int)(($id>0)?$id : 0);
$this->image_handler='';
$this->type_flag=1;
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcategorie.php 2012-01-01 20:07:41 UTC (rev 4004)
@@ -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 22/09/11, 20:11
+ @date 01/01/12, 20:11
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class sqlcategorie
@@ -249,8 +249,8 @@
$check_q = $DB->query($sql="select * from " . TABLE_CATEGORIES_DESCRIPTION . " cd where categories_id = '" .(int) $ID . "'");
foreach($check_q->fetchAllAssoc() as $catlg){
- $result['categories_name'][$catlg['language_id']] = $catlg['categories_name'];
- $result['categories_description'][$catlg['language_id']] = $catlg['categories_description'];
+ $result['categories_name'][$catlg['language_id']] = $catlg['categories_name'];
+ $result['categories_description'][$catlg['language_id']] = $catlg['categories_description'];
}
$result['products_count'] = categorieUtility::products_in_category_count($ID);
$result['cms_count'] =categorieUtility::cms_in_category_count($ID);
@@ -399,13 +399,13 @@
public static function AddImage($cat_image='', $no_img=''){
if (tep_not_null($cat_image) && ($cat_image != 'none')){
- if( strpos($cat_image,DIR_WS_CATALOG_IMAGES) >=0 )
- $cat_image = tep_db_prepare_input(substr($cat_image, strlen( DIR_WS_CATALOG_IMAGES) ) );
+ if( strpos($cat_image,DIR_WS_CATALOG_IMAGES) ===0 )
+ $cat_image = tep_db_prepare_input(substr($cat_image, strlen( DIR_WS_CATALOG_IMAGES) ) );
else
- $cat_image = tep_db_prepare_input($cat_image);
+ $cat_image = tep_db_prepare_input($cat_image);
}
- $cat_image =(empty($cat_image) || ($no_img=='' && $cat_image=='on') ) ? '' : tep_db_prepare_input($cat_image) ;
+ $cat_image =(empty($cat_image) || (/*$no_img=='' &&*/ $no_img=='on') ) ? '' : tep_db_prepare_input($cat_image) ;
return $cat_image;
}
Modified: trunk/catalog/admin/includes/functions/html_output.php
===================================================================
--- trunk/catalog/admin/includes/functions/html_output.php 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/admin/includes/functions/html_output.php 2012-01-01 20:07:41 UTC (rev 4004)
@@ -234,6 +234,10 @@
return '<img src="'.tep_href_link('document.php', 'mod=img&typ=db&key='.md5(DIR_WS_IMAGES.$image).'&w='.$width.'&h='.$height).'" alt="'.$alt.'" title="'.$alt.'" '.$parameters.'/>';
}
+function tep_language_image($image, $alt, $width = '', $height = '', $parameters = '') {
+ return '<img src="'.tep_catalog_href_link(DIR_WS_LANGUAGES.$image).'" width="'.$width.'" height="'.$height.'" alt="'.$alt.'" title="'.$alt.'" '.$parameters.'/>';
+ }
+
/**
Fonctions remplacé par des class
=> Retrocompatibilité
Modified: trunk/catalog/admin/includes/gabarit/categories/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/categories/display_view.edit.gab 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/admin/includes/gabarit/categories/display_view.edit.gab 2012-01-01 20:07:41 UTC (rev 4004)
@@ -1,10 +1,10 @@
<?php
/**
- @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 07/10/11, 23:13
+ @date 01/01/12, 23:13
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -44,7 +44,7 @@
<div class="tabs_lang">
<ul>
<?php for ($i=0, $n=sizeof(categories::$languages); $i<$n; $i++) { ?>
- <li><a href="#fieldset_<?php echo $i ?>"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . categories::$languages[$i]['directory'] . '/images/' . categories::$languages[$i]['image'], categories::$languages[$i]['name']); ?></a></li>
+ <li><a href="#fieldset_<?php echo $i ?>"><?php echo tep_language_image( categories::$languages[$i]['directory'] . '/images/' . categories::$languages[$i]['image'], categories::$languages[$i]['name']); ?></a></li>
<?php } ?>
</ul>
@@ -81,11 +81,11 @@
<div class="edit box_right fright w_30">
<dl>
- <dt class="block_input" style="width:95%; text-align:center;">
- <?php echo tep_image(DIR_WS_CATALOG_IMAGES . categories::$cInfo->categories_image, 'image', TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT) ?>
+ <dt class="block_input tcenter" style=" text-align:center;">
+ <?php echo tep_info_image( categories::$cInfo->categories_image, 'image', TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT) ?>
<?php if(tep_not_null(categories::$cInfo->categories_image)) echo tep_draw_checkbox_field('categories_image_no', 'categories_image_no', 'on'). ' '.__('text delete image cat'); ?>
</dt>
- <dt class="block_input" style="width:95%; ">
+ <dt class="block_input" >
<Label><?php echo __('text choose img') ?></label>
<?php echo '<a class="button" href="#" onclick="'.tep_get_filebroswerserveur("categories_image", "image", '').'">'.tep_draw_input_field('categories_image','', categories::$cInfo->categories_image ).' '.tep_image(DIR_WS_ICONS . 'icon_browser.png', PARCOURIR_SERVER).'</a>' ?>
</dt>
Modified: trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/admin/includes/gabarit/products/display_view.edit.gab 2012-01-01 20:07:41 UTC (rev 4004)
@@ -1,13 +1,14 @@
<?php
/**
- @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.1
- @date 07/11/11, 10:08
+ @date 01/01/12, 23:13
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
+
?>
<h3><?php echo __('heading title'); ?></h3>
@@ -33,13 +34,13 @@
<fieldset class="tabs_lang block_field">
<ul>
<?php for ($i=0, $n=sizeof(products::$languages); $i<$n; $i++) { ?>
- <li><?php echo '<a href="#products_name-' . ($i+1).'" >' . tep_image(DIR_WS_CATALOG_LANGUAGES . products::$languages[$i]['directory'] . '/images/' . products::$languages[$i]['image'], products::$languages[$i]['name']) . ' ' . products::$languages[$i]['name'] . '</a>' ?></li>
+ <li><?php echo '<a href="#products_name-' . ($i+1).'" title="'.products::$languages[$i]['name'].'">' . tep_language_image( products::$languages[$i]['directory'] . '/images/' . products::$languages[$i]['image'], products::$languages[$i]['name']). '</a>' ?></li>
<?php } ?>
</ul>
- <?php for ($i=0, $n=sizeof(products::$languages); $i<$n; $i++) { ?>
+ <?php for ($i=0, $n=sizeof(products::$languages); $i<$n; $i++) {?>
<ul id="<?php echo 'products_name-'.($i+1) ?>">
<li class="block_input">
- <label for="<?php echo 'products_name_' . products::$languages[$i]['id']; ?>"><?php echo __('text products name'); ?></label>
+ <label for="<?php echo 'products_name_' . products::$languages[$i]['id']; ?>"><?php echo __('product text products name'); ?></label>
<?php echo tep_draw_input_field('products_name[' . products::$languages[$i]['id'] . ']', 'products_name_' . products::$languages[$i]['id'], (isset($products_name[products::$languages[$i]['id']]) ? stripslashes($products_name[products::$languages[$i]['id']]) : tep_get_products_name(products::$pInfo->products_id, products::$languages[$i]['id']))).'<span class="required">*</span>'; ?>
</li>
</ul>
@@ -205,7 +206,7 @@
<legend><?php echo __('text legend image'); ?></legend>
<dl>
<dt class="block_input">
- <p class="new_product_img" ><?php echo tep_image((!empty(products::$pInfo->products_image)?DIR_WS_CATALOG_IMAGES.products::$pInfo->products_image:IMAGE_NONEXISTENT) , products::$pInfo->products_image, TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT, 'class="new_product_img" id="products_imageimg"'); ?></p>
+ <p class="new_product_img" ><?php echo tep_info_image(products::$pInfo->products_image, products::$pInfo->products_image, TEMP_BO_HEADING_IMAGE_WIDTH, TEMP_BO_HEADING_IMAGE_HEIGHT, 'class="new_product_img" id="products_imageimg"'); ?></p>
</dt>
<?php if(products::CheckClassProduct('CLASS_IMAGE')): /** Si image de prix defini, les prix sont pris en charge par un onglet */ ?>
<dt class="block_input">
Modified: trunk/catalog/admin/includes/modules/configuration/modtemplate.php
===================================================================
--- trunk/catalog/admin/includes/modules/configuration/modtemplate.php 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/admin/includes/modules/configuration/modtemplate.php 2012-01-01 20:07:41 UTC (rev 4004)
@@ -1,10 +1,10 @@
<?php
/**
- @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 22/09/11, 19:49
+ @date 01/01/12, 19:49
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class modtemplate
@@ -97,7 +97,9 @@
$template_infos = @simplexml_load_file($file);
if (!empty($template_infos->thumb) && file_exists(DIR_FS_TEMPLATES.$theme.'/'.$template_infos->thumb)) {
- $picture = '<a href="'. DIR_WS_TEMPLATES.$theme.'/'.$template_infos->thumb.'" class="fancy" rel="template" title="'.$theme.' / '.$template_infos->desc.' ('.__('version').' : '.$template_infos->version.') '.__('by ').$template_infos->author.'" >'.tep_image(DIR_WS_TEMPLATES.$theme . '/' . $template_infos->thumb, $theme, SMALL_IMAGE_WIDTH).'</a>';
+ $picture = '<a href="'. DIR_WS_TEMPLATES.$theme.'/'.$template_infos->thumb.'" class="fancy" rel="template" title="'.$theme.' / '.$template_infos->desc.' ('.__('version').' : '.$template_infos->version.') '.__('by ').$template_infos->author.'" >
+<img title="image" alt="image" src="'.DIR_WS_TEMPLATES.$theme . '/' . $template_infos->thumb.'" width="150" />
+'/*.tep_image(DIR_WS_TEMPLATES.$theme . '/' . $template_infos->thumb, $theme, SMALL_IMAGE_WIDTH)*/.'</a>';
} else $picture = __('text no preview');
if ($theme == TEMPLATE_NAME ) {
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2012-01-01 20:07:41 UTC (rev 4004)
@@ -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 02/10/11, 09:44
+ @date 01/01/12, 09:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@brief manage category and module aca for cat
@@ -196,9 +196,14 @@
'parent_id' => tep_db_prepare_input((int)@$_POST['cPath']),
'categories_status' => (isset($_POST['categories_status'])) ? tep_db_prepare_input((int)$_POST['categories_status']) : 0,
'categories_hidden' => (isset($_POST['categories_hidden'])) ? tep_db_prepare_input((int)$_POST['categories_hidden']) : 0 ,
- 'categories_image'=>sqlcategorie::AddImage(@$_POST['categories_image'], @$_POST['categories_image_no'])
);
+ if (!isset($_POST['categories_image_no']) && !empty($_POST['categories_image']) )
+ $params['sqlarray']['categories_image']=sqlcategorie::AddImage(@$_POST['categories_image'], @$_POST['categories_image_no']);
+ else
+ $params['sqlarray']['categories_image']='';
+
+
$params['id']=$categories_id;
$params['action']=self::$action;
$params['post']=$_POST;
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2012-01-01 20:07:41 UTC (rev 4004)
@@ -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 01/01/12, 09:44
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -247,22 +247,18 @@
unset($params['sqlarray']['products_quantity']);
}
- if (isset($_POST['products_image']) && tep_not_null($_POST['products_image']) && ($_POST['products_image'] != 'none')){
+ if (isset($_POST['products_image']) && !preg_match('#^[0-9]*$#',$_POST['products_image']) && ($_POST['products_image'] != 'none')){
if( substr($_POST['products_image'], 0,strlen( DIR_WS_CATALOG_IMAGES)) ==DIR_WS_CATALOG_IMAGES )
-// $params['sqlarray']['products_image']
-$img_src= tep_db_prepare_input(substr($_POST['products_image'], strlen( DIR_WS_CATALOG_IMAGES) ) );
+ $img_src= tep_db_prepare_input(substr($_POST['products_image'], strlen( DIR_WS_CATALOG_IMAGES) ) );
else
-// $params['sqlarray']['products_image'] =
-$img_src= tep_db_prepare_input($_POST['products_image']);
+ $img_src= tep_db_prepare_input($_POST['products_image']);
$sqli=sqlimage::fetch(array('pathkey'=>md5(DIR_WS_IMAGES.$img_src) ), true);
$params['sqlarray']['products_image'] = $sqli->rowid;
}
-/*
-var_dump($sqli->rowid);
-exit;*/
+
$params['id']=$products_id;
$params['action']=self::$action;
$params['post']=$_POST;
Modified: trunk/catalog/admin/includes/template/oscss/jquery-ui-1.css
===================================================================
--- trunk/catalog/admin/includes/template/oscss/jquery-ui-1.css 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/admin/includes/template/oscss/jquery-ui-1.css 2012-01-01 20:07:41 UTC (rev 4004)
@@ -9,7 +9,7 @@
*/
/* Layout helpers
- - ---------------------------------*/ *
+ - ---------------------------------*/ * *
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
@@ -17,25 +17,25 @@
.ui-helper-clearfix { display: inline-block; }
/* required comment for clearfix to work in Opera \*/
* html .ui-helper-clearfix { height:1%; }
- . ui-helper-clearfix { display:block; } *
+ . ui-helper-clearfix { display:block; } * *
/* end clearfix */
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues
- - ---------------------------------*/ *
+ - ---------------------------------*/ * *
.ui-state-disabled { cursor: default !important; }
/* Icons
- - ---------------------------------*/ *
+ - ---------------------------------*/ * *
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
- - ---------------------------------*/ *
+ - ---------------------------------*/ * *
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
@@ -55,7 +55,7 @@
/* Component containers
- - ---------------------------------*/ *
+ - ---------------------------------*/ **
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
@@ -65,7 +65,7 @@
.ui-widget-header a { color: #222222; }
/* Interaction states
- - ---------------------------------*/ *
+ - ---------------------------------*/ **
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(img/1/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(img/1/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
@@ -75,7 +75,7 @@
.ui-widget :active { outline: none; }
/* Interaction Cues
- - ---------------------------------*/ *
+ - ---------------------------------*/ **
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(img/1/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(img/1/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
@@ -86,7 +86,7 @@
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
/* Icons
- - ---------------------------------*/ *
+ - ---------------------------------*/ **
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(img/1/ui-icons_222222_256x240.png); }
@@ -277,7 +277,7 @@
/* Misc visuals
- - ---------------------------------*/ *
+ - ---------------------------------*/ * *
/* Corner radius */
.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; }
@@ -304,7 +304,7 @@
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;
/* http://bugs.jqueryui.com/ticket/7233
- - Resizable: resizable handles fail to work in IE if transparent *and content overlaps
+ - Resizable: resizable handles fail to work in IE if transparent *a*nd content overlaps
*/
background-image:url(data:);
}
Modified: trunk/catalog/admin/includes/template/oscss/stylesheet-1.css
===================================================================
--- trunk/catalog/admin/includes/template/oscss/stylesheet-1.css 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/admin/includes/template/oscss/stylesheet-1.css 2012-01-01 20:07:41 UTC (rev 4004)
@@ -11,7 +11,7 @@
html { height: 100%;}
/* prepend */
* {margin:0;padding:0}
-a * :link, **
+a * * :link, **
a:visited {text-decoration: underline; color:#000;}
a:hover { text-decoration: none; }
img { border-width:0 ; margin:0; padding:0; }
@@ -23,7 +23,7 @@
h5 { font-size: 1em ;text-shadow:0 1px 0 #fff;}
p {padding:1em;}
ul {list-style:none;}
-#central li {padding-left:0;cursor:pointer;margin:0.1em 0;}
+/* #central li {padding-left:0;cursor:pointer;margin:0.1em 0;} */
th { text-shadow:0 1px 0 #fff;-moz-border-radius:6px; -webkit-border-radius:6px; margin:2px 1px; text-align: left; padding: 0 5px;line-height:30px;}
/* form defintion generale */
@@ -284,11 +284,11 @@
#central h3{ font-size:15px; font-weight:bold; margin:0 0 10px; padding:0 5px 10px 3px; clear:both; }
#central h4{font-weight:bold; padding:15px 5px 8px; clear:both; }
/* Block formulaire central */
-#central .block_form { -moz-border-radius:6px; -webkit-border-radius:6px; width:99%; margin:0;padding:5px 0.2em 10px 0.2em; display:inline-block; text-align: left; background:#C9C9C9;}
-#central .block_form .tabs_lang{width:98%; float:left;}
+#central .block_form { -moz-border-radius:6px; -webkit-border-radius:6px; margin:0;padding:5px 0.2em 10px 0.2em; display:inline-block; text-align: left; background:#C9C9C9;}
+#central .block_form .tabs_lang{/*width:98%;*/ float:left;}
#central .block_form div.tabPage {padding-left:0; padding-right:0;}
#central .block_form .block_input,
-#central form .block_input { text-shadow:0 1px 0 #fff;-moz-border-radius:6px; -webkit-border-radius:6px; width:98%; margin:2px 1px; display:inline-block; text-align: left; padding: 0 5px; background:#DEDADE;float:left;line-height:30px;}
+#central form .block_input { text-shadow:0 1px 0 #fff;-moz-border-radius:6px; -webkit-border-radius:6px; width:97%; margin:2px 1px; display:inline-block; text-align: left; padding: 0 5px; background:#DEDADE;float:left;line-height:30px;}
/* input[type="radio"] */
@@ -357,10 +357,12 @@
/* central form .block_input */
#central form .block_input .hasDatepicker{ margin:0; display:inline-block; text-align: left; padding: 0 5px; background:#DEDADE;float:left;line-height:30px; min-width:0;}
-#central form .block_field { text-shadow:0 1px 0 #fff;-moz-border-radius:6px; -webkit-border-radius:6px; min-width:96%; width:96.5%; max-width:97%; margin:2px ; display:inline-block; text-align: left; padding: 5px; float:left;background:#eee;}
-#central form .block_field.tabs_lang{width:96.9%}
-#central form .block_field.tabs_lang ul.ui-tabs-nav{padding:0; margin:0 -5px;}
-#central form .block_field.tabs_lang ul.ui-tabs-panel{padding:0; margin:0 -5px;}
+#central form .block_field { text-shadow:0 1px 0 #fff;-moz-border-radius:6px; -webkit-border-radius:6px; /*min-width:96%;*/ width:96.5%; /*max-width:97%; */margin:2px ; display:inline-block; text-align: left; padding: 5px; float:left;background:#eee;}
+#central form .block_field.tabs,
+#central form .block_field.tabs_lang{width:96.5%; margin:0 2px ; display:inline-block; text-align: left; padding:0 5px; float:left;background:#eee;}
+#central form ul.ui-tabs-nav {display: inline-block; margin: 0 ; padding: 1px; width: 99%;}
+#central form .block_field.tabs_lang ul.ui-tabs-nav,
+#central form .block_field.tabs_lang ul.ui-tabs-panel{display: inline-block; margin: 0 -5px; padding: 1px; width: 100%;}
#central form .edit.col_right .block_input{width:95%;}
#central form .edit.col_right .block_input label{width:20%;text-align:left;font-weight:bold}
#central form p.new_product_img { float:left; padding:5px; margin : 0 auto;text-align:center; width:98%;}
@@ -495,7 +497,7 @@
#salesStats p{float:left;min-height:50px;margin:0 auto;background:transparent url(img/1/header_sales.png) no-repeat bottom right;}
/* #orderStats,
* # customerStats, **
- # *customerInfos { height: 110px; }*/
+ * # *customerInfos { height: 110px; }*/
#orderStats ul,
#customerStats ul,
/* #salesStats ul { list-style-type:none; margin:0 0 0 2px; padding:0;} */
Modified: trunk/catalog/includes/modules/also_purchased_products.php
===================================================================
--- trunk/catalog/includes/modules/also_purchased_products.php 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/includes/modules/also_purchased_products.php 2012-01-01 20:07:41 UTC (rev 4004)
@@ -1,10 +1,10 @@
<?php
/**
- @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.1
- @date 17/12/11, 10:48
+ @date 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -26,7 +26,7 @@
"ON d.products_id = op2.products_id AND d.language_id='".$languages_id."'".
"WHERE op1.products_id = '" . (int)$_GET['products_id'] . "' ".
"GROUP BY op2.products_id, p2.products_image ".
- "ORDER BY 3 DESC ".
+// "ORDER BY 3 DESC ".
"LIMIT ".$page->_conf_value('MAX_DISPLAY_ALSO_PURCHASED') );
}
Modified: trunk/catalog/index.php
===================================================================
--- trunk/catalog/index.php 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/index.php 2012-01-01 20:07:41 UTC (rev 4004)
@@ -72,7 +72,7 @@
* \section Page Customer public
\note For active public customer page , delete false
*/
- if (false/* isset($_GET['customers_id']*/) ) {
+ if (false/* isset($_GET['customers_id'])*/ ) {
$page->init('customers.php',$language);
$breadcrumb=$page->return_object('breadcrumb');
Modified: trunk/catalog/install/includes/content/core.base.php
===================================================================
--- trunk/catalog/install/includes/content/core.base.php 2012-01-01 16:42:59 UTC (rev 4003)
+++ trunk/catalog/install/includes/content/core.base.php 2012-01-01 20:07:41 UTC (rev 4004)
@@ -1,11 +1,12 @@
<?php
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
- @package oscss-2 <www http://www.oscss.org>
- @version Rc-3
- @date 19/05/10, 09:10
+ @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 01/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
- @author Ayatus <www http://www.ayatus.org>
+ Ayatus <www http://www.ayatus.org>
@encode UTF-8
*/
@@ -37,37 +38,16 @@
'root_doc_p_log'=>'Documents/public/logs/',
'root_doc_p_data'=>'Documents/public/oscss_data/',
'root_doc_p_sessions'=>'Documents/public/sessions/',
+ 'root_doc_p_images'=>'Documents/images/imagecache/',
-
'htacces_admin'=>'admin/.htaccess',
'admin'=>'admin/',
'admin_inc'=>'ad...
[truncated message content] |
|
From: <os...@us...> - 2012-01-02 14:25:35
|
Revision: 4006
http://oscss.svn.sourceforge.net/oscss/?rev=4006&view=rev
Author: oscim
Date: 2012-01-02 14:25:25 +0000 (Mon, 02 Jan 2012)
Log Message:
-----------
correction de l'installateur d'extension , debut du nettoyage des sorties text.
Correction erreur de notice
Amelioration des tags filesql et extractzip , ajout de la methode remove et de test avant install
correction fr
correction class support file fileUtility
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/fileUtility.php
trunk/catalog/admin/includes/exts/package/CIP.php
trunk/catalog/admin/includes/exts/package/CipUtility.php
trunk/catalog/admin/includes/exts/package/ci_tag.class.php
trunk/catalog/admin/includes/exts/package/packageInstaller.php
trunk/catalog/admin/includes/exts/package/tags/add2end.php
trunk/catalog/admin/includes/exts/package/tags/description.php
trunk/catalog/admin/includes/exts/package/tags/extractzip.php
trunk/catalog/admin/includes/exts/package/tags/filesql.php
trunk/catalog/admin/includes/gabarit/package/display_view.package.detail.gab
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/package.txt
trunk/catalog/admin/includes/modules/pages/package.php
trunk/catalog/install/includes/modele/htaccess.txt
Added Paths:
-----------
trunk/catalog/admin/includes/gabarit/package/display_view.package.install.gab
Modified: trunk/catalog/admin/includes/classes/fileUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/fileUtility.php 2012-01-02 08:51:24 UTC (rev 4005)
+++ trunk/catalog/admin/includes/classes/fileUtility.php 2012-01-02 14:25:25 UTC (rev 4006)
@@ -1,9 +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
- @package oscss-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 19/12/10, 09:26
+ @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 02/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class fileUtility
@@ -77,8 +78,7 @@
/**
- @package oscss
- @author OscssTeam
+ @brief delete recurisve folder
@param string path element a supprimer
*/
public static function _rmdir($source) {
@@ -86,29 +86,37 @@
if (isset($tep_remove_error)) $tep_remove_error = false;
if (is_dir($source)) {
- while ($file = self::_scandir($source)) {
- if ( ($file != '.') && ($file != '..') ) {
- if (is_writeable($source . '/' . $file)) self::_rmdir($source . '/' . $file);
- else {
- self::ComportForError(__CLASS__.'->'.__FUNCTION__.'::'.__LINE__.__('error file not removeable'). $source . '/' . $file, 'error');
- return false;
- }
- }
+ foreach(self::_scandir($source) as $file){
+ if ( ($file != '.') && ($file != '..') ) {
+ if(!is_writeable($source . '/' . $file)) {
+ self::ComportForError(__CLASS__.'->'.__FUNCTION__.'::'.__LINE__.__('error file not removeable'). $source . '/' . $file, 'error');
+ }
+ elseif (is_dir($source . '/' . $file) && is_writeable($source . '/' . $file))
+ self::_rmdir($source . '/' . $file);
+ elseif (file_exists($source . '/' . $file) && is_writeable($source . '/' . $file)){
+ self::_unlink($source . '/' . $file);
+ }
+
+ }
}
if (is_writeable($source)) rmdir($source);
else {
- self::ComportForError(__CLASS__.'->'.__FUNCTION__.'::'.__LINE__.__('error directory not removeable'). $source, 'error');
- return false;
+ self::ComportForError(__CLASS__.'->'.__FUNCTION__.'::'.__LINE__.__('error directory not removeable'). $source, 'error');
+ return false;
}
}
- else $tep_remove_error = self::_unlink($source);
+ else
+ $tep_remove_error = self::_unlink($source);
+
return $tep_remove_error;
}
public static function _unlink($source){
- if (is_writeable($source)) return unlink($source);
- else self::ComportForError(__CLASS__.'->'.__FUNCTION__.'::'.__LINE__.__('error file not removeable'). $source, 'error');
+ if (is_writeable($source))
+ return unlink($source);
+ else
+ self::ComportForError(__CLASS__.'->'.__FUNCTION__.'::'.__LINE__.__('error file not removeable'). $source, 'error');
return false;
}
@@ -153,10 +161,10 @@
public static function _chown($mypath, $uid, $gid) {
while(($file =self::_scandir($d)) !== false) {
if ($file != "." && $file != "..") {
- $typepath = $mypath . "/" . $file ;
- if (filetype ($typepath) == 'dir') self::_chown($typepath, $uid, $gid);
- self::_chmod($typepath, $uid);
- chgrp($typepath, $gid);
+ $typepath = $mypath . "/" . $file ;
+ if (filetype ($typepath) == 'dir') self::_chown($typepath, $uid, $gid);
+ self::_chmod($typepath, $uid);
+ chgrp($typepath, $gid);
}
}
}
@@ -166,16 +174,25 @@
@brief Copy repertoire recursif
*/
public static function _copy($src,$dst){
- if(!is_dir($src)) return @copy($src,$dst);
+ if(!is_dir($src))
+ return copy($src,$dst);
else {
+
+ if(substr($dst,-1) !='/')
+ $dst .='/' ;
+ if(substr($src,-1) !='/')
+ $src .='/' ;
+
foreach(self::_scandir($src) as $file){
- if (( $file != '.' ) && ( $file != '..' )) {
- if ( is_dir($src . '/' . $file) ) {
- self::_copy($src . '/' . $file,$dst . '/' . $file);
+ if (( $file != '.' ) && ( $file != '..' ) && substr($file,-1) !='~') {
+ if ( is_dir($src . $file) ){
+ if ( !is_dir($dst . $file) )
+ self::_mkdir($dst. $file);
+
+ self::_copy($src. $file,$dst. $file);
}
- else {
- copy($src . '/' . $file,$dst . '/' . $file);
- }
+ else
+ copy($src. $file,$dst . $file);
}
}
return true;
@@ -223,25 +240,25 @@
switch ($ext) {
case 'zip':
case 'gz':
- $in_file = $directory . $file_in;
- $out_file = $directory . $file_in . '.gz';
- if (!file_exists ($in_file) || !is_readable ($in_file))return false;
+ $in_file = $directory . $file_in;
+ $out_file = $directory . $file_in . '.gz';
+ if (!file_exists ($in_file) || !is_readable ($in_file))return false;
- if (file_exists($out_file)) return false;
+ if (file_exists($out_file)) return false;
- $fin_file = fopen($in_file, "rb");
- if (!$fout_file = gzopen($out_file, "wb".$level)) return false;
+ $fin_file = fopen($in_file, "rb");
+ if (!$fout_file = gzopen($out_file, "wb".$level)) return false;
- while (!feof ($fin_file)) {
- $buffer = fread($fin_file, 8192); // 8 kB is maximum value
- gzwrite($fout_file, $buffer, 8192);
- }
+ while (!feof ($fin_file)) {
+ $buffer = fread($fin_file, 8192); // 8 kB is maximum value
+ gzwrite($fout_file, $buffer, 8192);
+ }
- fclose($fin_file);
- gzclose($fout_file);
- if ($delete_file == true) {
- self::_unlink($in_file);
- }
+ fclose($fin_file);
+ gzclose($fout_file);
+ if ($delete_file == true) {
+ self::_unlink($in_file);
+ }
break;
}
return true;
Modified: trunk/catalog/admin/includes/exts/package/CIP.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/CIP.php 2012-01-02 08:51:24 UTC (rev 4005)
+++ trunk/catalog/admin/includes/exts/package/CIP.php 2012-01-02 14:25:25 UTC (rev 4006)
@@ -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.0.9
- @date 08/06/10, 22:46
+ @version 2.1.1
+ @date 02/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
Original:
@@ -546,8 +546,9 @@
//! We passed by all checks. So if an error appears
foreach ($this->contrib_data as $id=>$tag)
if ( $tag->do_remove() ===false){
- self::InProcess(__("Erreur durant traitement de cette fonction "),'tag_xml-['.$id.']'. $tag->tag_name.'->do_remove()','block');
- break;
+// var_dump($tag->tag_name.'->do_remove()');
+ self::InProcess(__("Erreur durant traitement de cette fonction "),'tag_xml-['.$id.']'. $tag->tag_name.'->do_remove()','block');
+ break;
}
$this->DeleteContribFull(false);
@@ -580,14 +581,14 @@
*/
foreach ($this->contrib_data as $id=>$tag)
if($tag->isTagName('description') || $tag->isTagName('depend'))
- if (self::$error=(int)$tag->do_install()) break;
+ if (self::$error=(int)$tag->do_install()) break;
- //! If we had a problems at runtime we should remove this CIP.
- if (self::$error) $this->remove(true);
+ //! If we had a problems at runtime we should remove this CIP.
+ if (self::$error) $this->remove(true);
else {
- if ($this->was_unpacked() && $this->is_unpacked()) {
- fileUtility::_rmdir(DIR_FS_CIP.$this->get_cip_name());
- }
+ if ($this->was_unpacked() && $this->is_unpacked()) {
+ fileUtility::_rmdir(DIR_FS_CIP.$this->get_cip_name());
+ }
}
}
@@ -622,7 +623,7 @@
private function total_restore() {
if (false /*_cst_bool('ALLOW_FILES_BACKUP')*/){
//! Files restore
- if (!$this->restore() || !self::check_bylevel(1)/* !$this->is_all_right()*/){
+ if ( (method_exists($tag, 'restore_file' ) && !$this->restore()) || !self::check_bylevel(1)/* !$this->is_all_right()*/){
self::InProcess(__("Erreur apres traitement de cette fonction restore()"), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'error');
return false;
}
@@ -642,9 +643,9 @@
*/
private function backup() {
foreach ($this->contrib_data as $id=>$tag)
- if ( $tag->backup_file() ===false){
- self::InProcess(__("Erreur durant traitement de cette fonction "),'tag_xml-['.$id.']'. $tag->tag_name.'->backup_file()','block');
- return false;
+ if ( method_exists($tag, 'backup_file' ) && $tag->backup_file() ===false){
+ self::InProcess(__("Erreur durant traitement de cette fonction "),'tag_xml-['.$id.']'. $tag->tag_name.'->backup_file()','block');
+ return false;
}
return true;
}
@@ -654,7 +655,7 @@
*/
private function restore() {
foreach ($this->contrib_data as $id=>$tag)
- if ( $tag->restore_file() ===false){
+ if ( method_exists($tag, 'restore_file' ) && $tag->restore_file() ===false){
self::InProcess(__("Erreur durant traitement de cette fonction "),'tag_xml-['.$id.']'. $tag->tag_name.'->restore_file()','block');
}
if(file_exists(self::PATH_BACKUP.self::$cip_name) && !fileUtility::_rmdir(self::PATH_BACKUP.self::$cip_name)){
Modified: trunk/catalog/admin/includes/exts/package/CipUtility.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/CipUtility.php 2012-01-02 08:51:24 UTC (rev 4005)
+++ trunk/catalog/admin/includes/exts/package/CipUtility.php 2012-01-02 14:25:25 UTC (rev 4006)
@@ -1,10 +1,10 @@
<?php
/**
- @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.0.9
- @date 25/07/10, 22:48
+ @version 2.1.1
+ @date 02/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -176,7 +176,7 @@
//chmod($backup_file, 0777);
tep_remove($backup_file);
}
- if (file_exists($backup_file.'.gz')) chmod($backup_file.'.gz', 0777);
+ if (file_exists($backup_file.'.gz')) @chmod($backup_file.'.gz', 0777);
return true;
}
Modified: trunk/catalog/admin/includes/exts/package/ci_tag.class.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2012-01-02 08:51:24 UTC (rev 4005)
+++ trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2012-01-02 14:25:25 UTC (rev 4006)
@@ -1,10 +1,10 @@
<?php
/**
- @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.1
- @date 31/10/11, 08:07
+ @date 02/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
Original:
@@ -426,7 +426,7 @@
fileUtility::CfgComport(true);
if( ($res= fileUtility::_copy($src,$dst)) && $res ==false) {
foreach(fileUtility::GetError() as $error)
- CIP::InProcess($error['text'].dirname($path), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+ CIP::InProcess($error['text'].dirname($path), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
}
return $res;
}
@@ -436,7 +436,7 @@
fileUtility::CfgComport(true);
if( ($res= fileUtility::_mkdir($path)) && $res ==false) {
foreach(fileUtility::GetError() as $error)
- CIP::InProcess($error['text'].dirname($path), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+ CIP::InProcess($error['text'].dirname($path), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'noblock');
}
return $res;
}
@@ -445,7 +445,7 @@
fileUtility::CfgComport(true);
if( ($res= fileUtility::_rmdir($path)) && $res ==false) {
foreach(fileUtility::GetError() as $error)
- CIP::InProcess($error['text'].dirname($path), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+ CIP::InProcess($error['text'].dirname($path), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'noblock');
}
return $res;
}
Modified: trunk/catalog/admin/includes/exts/package/packageInstaller.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/packageInstaller.php 2012-01-02 08:51:24 UTC (rev 4005)
+++ trunk/catalog/admin/includes/exts/package/packageInstaller.php 2012-01-02 14:25:25 UTC (rev 4006)
@@ -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 31/10/11, 08:07
+ @date 02/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class packageInstaller
@@ -55,7 +55,7 @@
/**
- View et check package
+ @brief View et check package
*/
public function view_exts($pkgID){
global $messageStack;
@@ -77,8 +77,8 @@
//Print description:
$description=$cip->get_data($cip->get_description_id());
if ($description) {
- $array=$this->cip_description($description->data);
- parent::$Rightlist=array_merge(parent::$Rightlist,ErrorAndBlockProcess::$ArrayError);
+ $array=$this->cip_description($description->data);
+ parent::$Rightlist=array_merge(parent::$Rightlist,ErrorAndBlockProcess::$ArrayError);
}
else $array[]= '<strong style="color:red;">'.CIP::CONFIG_FILENAME. __('text doesnt exists').'!!!</strong>';
@@ -121,16 +121,16 @@
foreach($cips as $cp){
$cp->compute_dependencies();
if ($cp->get_error()) {
- parent::$Rightlist=array_merge(parent::$Rightlist,ErrorAndBlockProcess::$ArrayError);
- return $array;
- }
- $messageStack->add_session("CIP ".$cp->getIdent().__('msg was applied'), 'installed');
- $array[]= '<h4>'.$cp->getIdent().'<h4>'.
- '<strong>'.__('text post install notes').':</strong><br />'.
- $cp->post_install_notes();
+ parent::$Rightlist=array_merge(parent::$Rightlist,ErrorAndBlockProcess::$ArrayError);
+ return $array;
+ }
+ $messageStack->add_session("CIP ".$cp->getIdent().__('msg was applied'), 'installed');
+ $array[]= '<h4>'.$cp->getIdent().'<h4>'.
+ '<strong>'.__('text post install notes').':</strong><br />'.
+ $cp->post_install_notes();
}
}
- $array=array_merge($array,(array)ErrorAndBlockProcess::$ArrayError);
+ parent::$Rightlist=array_merge(parent::$Rightlist,(array)ErrorAndBlockProcess::$ArrayError);
/// NOTE: force init menu admin
$menu=menu::getInstance();
@@ -197,6 +197,9 @@
/**
+ @fn cip_description($data='')
+ @brief adjust detail paquet based on description tag
+ @return array
*/
private function cip_description($data='') {
if (!$data) return null;
@@ -204,23 +207,23 @@
$contents[] = '<h3>'.__('text info support').':</h3>';
if (isset($data['oscss_forum_ref']) && $data['oscss_forum_ref'] !=0)
- $contents[]='<strong>• <a href="'.__('text link contr oscss') . $data['oscss_forum_ref'].'" title= "'. __('contribs page oscss alt') . '">' . __('contribs page oscss') .'</a></strong>';
+ $contents[]='<strong><a href="'. $data['oscss_forum_ref'].'" title= "'. __('contribs page oscss alt') . '">' . __('contribs page oscss') .'</a></strong>';
if (isset($data['contrib_ref']) && $data['contrib_ref'] !=0)
- $contents[]='<strong>• <a href="'. __('text link contr '). $data['contrib_ref'].'" title= "'. __('contribs page alt') . '">' . __('contribs page').'</a></strong>';
-
+ $contents[]='<strong><a href="'.$data['contrib_ref'].'" title= "'. __('contribs page alt') . '">' . __('contribs page').'</a></strong>';
+//
if (isset($data['forum_ref']) && $data['forum_ref'] !=0)
- $contents[]='<strong>• <a href="'. __('text link forum').$data['forum_ref']. '" title="'. __('contribs forum alt'). '">'. __('contribs forum').'</a></strong>';
+ $contents[]='<strong><a href="'. $data['forum_ref']. '" title="'. __('contribs forum alt'). '">'. __('contribs forum').'</a></strong>';
if (isset($data['author_pkg']) && $data['author_pkg'] !='')
- $contents[]='<strong>• <a href="http://'. $data['author_pkg'].'">' . __('contribs cip pkg'). $data['author_pkg'] .'</a></strong>';
+ $contents[]='<strong class="label text">'.__('contribs cip pkg').'</strong>' . '<a href="http://'. $data['author_pkg'].'">' . $data['author_pkg'] .'</a>';
$contents[] = '<br /><h3>'.__('text info contrib').':</h3>';
foreach ($data as $key=>$value) {
$value=htmlspecialchars($value);//convert to entries...
if (!in_array($key,array('post_install_notes','author_pkg','contrib_ref','forum_ref','oscss_forum_ref'))) {
- $contents[]='<strong>'.$key.'</strong>: '.nl2br($value);
+ $contents[]='<strong class="label text">'.__('contribs '.$key).'</strong>: '.nl2br($value);
}
}
return $contents;
Modified: trunk/catalog/admin/includes/exts/package/tags/add2end.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/tags/add2end.php 2012-01-02 08:51:24 UTC (rev 4005)
+++ trunk/catalog/admin/includes/exts/package/tags/add2end.php 2012-01-02 14:25:25 UTC (rev 4006)
@@ -1,11 +1,11 @@
<?php
/**
- @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
- @originla author Made by Imrich Schindler <ischindl at progis.sk>
+ @original author Made by Imrich Schindler <ischindl at progis.sk>
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.0
- @date 19/12/10, 18:52
+ @version 2.1.1
+ @date 02/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class Tc_add2end
@@ -82,16 +82,22 @@
/**-----------------------------conflicts--------------------------- */
public function conflicts_check_for_remove() {
- $find=$this->add_str();
+
+ $find=$this->add_str($this->data['add']);
$new_file=$this->linebreak_fixing(file_get_contents($this->fs_filename()));
- $this->write_to_file($this->fs_filename(), $new_file);
+
+
$count=substr_count($new_file, $find);
+
//We can also check a database records for conflicts.
if ($count==0) {
$sg=__('couldnt find text').": ".nl2br(htmlspecialchars($find)). "<br />". __('in the file text'). $this->fs_filename();
CIP::InProcess($sg, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
- return false;
+// return false;
}
+
+ $this->write_to_file($this->fs_filename(), $new_file);
+
return true;
}
@@ -111,7 +117,8 @@
}
function do_remove() {
- if(!$this->remove_file_part($this->data['filename'],$this->add_str($this->data['add']))) return false;
+ if(!$this->remove_file_part($this->data['filename'],$this->add_str($this->data['add'])))
+ return false;
return true;
}
}
Modified: trunk/catalog/admin/includes/exts/package/tags/description.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/tags/description.php 2012-01-02 08:51:24 UTC (rev 4005)
+++ trunk/catalog/admin/includes/exts/package/tags/description.php 2012-01-02 14:25:25 UTC (rev 4006)
@@ -1,12 +1,11 @@
<?php
/**
- @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
@original author Vlad Savitsky
- @Support: http://forums.oscommerce.com/index.php?showuser=20490, http://forums.oscommerce.com/index.php?showtopic=156667
@package osCSS-2 <www http://www.oscss.org>
- @version 2.0.9
- @date 24/07/10, 18:07
+ @version 2.1.1
+ @date 02/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class Tc_description
Modified: trunk/catalog/admin/includes/exts/package/tags/extractzip.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/tags/extractzip.php 2012-01-02 08:51:24 UTC (rev 4005)
+++ trunk/catalog/admin/includes/exts/package/tags/extractzip.php 2012-01-02 14:25:25 UTC (rev 4006)
@@ -1,10 +1,10 @@
<?php
/**
- @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.0.9
- @date 23/06/10, 12:02
+ @version 2.1.1
+ @date 02/01/2012, 18:17
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -17,8 +17,17 @@
class Tc_extractzip
extends ContribInstallerBaseTag {
- var $tag_name='extractzip';
+ public $tag_name='extractzip';
+ /**
+ @var array content file in zip
+ */
+ protected $zipContent;
+ /**
+ @var object result PclZip
+ */
+ protected static $PclZip;
+
function __construct($contrib='', $id='', $xml_data='', $dep='') {
$this->params=array(
'zip'=>array(
@@ -31,97 +40,162 @@
),
);
$this->ContribInstallerBaseTag($contrib, $id, $xml_data, $dep);
+
+// var_dump(__CLASS__);
}
function get_data_from_xml_parser($xml_data='') {
$this->data['zip'] =$this->getTagAttr($xml_data,'zip',0,'name');
$this->data['path'] =replace_path_admin(trim(str_replace("%TEMPLATE_NAME%",TEMPLATE_NAME,$this->getTagAttr($xml_data,'path',0,'name')))) ;
+
+
+ $le_file=DIR_FS_CIP.'/'.$this->contrib.'/'.$this->data['zip'];
+
+ self::$PclZip = new PclZip( $le_file );
+ if($this->cip->is_Windows()) if(!defined('OS_WINDOWS'))define('OS_WINDOWS',1);
+ else if(!defined('OS_WINDOWS'))define('OS_WINDOWS',0);
+
+ $this->zipContent = self::$PclZip->listContent( PCLZIP_OPT_PATH, DIR_FS_CATALOG.$this->data['path'] );
+
}
function write_to_xml() {
return '
<'.$this->tag_name.'>
- <zip name="'.$this->data['zip'].'" />
- <path name="'.$this->data['path'].'" />
+ <zip name="'.$this->data['zip'].'" />
+ <path name="'.$this->data['path'].'" />
</'.$this->tag_name.'>';
}
+ public function permissions_check_for_install() {
+ if (!CIP::check_bylevel(1))return false;
+ foreach($this->zipContent as $row){
- public function permissions_check_for_install() { return true; }
+ $rs_filename=replace_path_admin($row);
+
+ $path=dirname($rs_filename['filename']);
+ $fs_filename = $rs_filename['filename'];
+
+// if(!is_dir($path))
+// parent::recursive_mkdir($path);
+
+ if(is_dir($path) && !is_writable($path)) {
+ CIP::InProcess(__('write folder permissins needed text').$path, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+// return false;
+ }
+ elseif(file_exists($fs_filename) && !is_writable($fs_filename)) {
+ CIP::InProcess(__('write file permissins needed text').' '.$fs_filename, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'noblock');
+// return false;
+ }
+ }
+ return true;
+ }
+
+// // public function permissions_check_for_install() { return true; }
public function permissions_check_for_remove() { return true; }
- public function conflicts_check_for_install() { return true; }
- public function conflicts_check_for_remove() { return true; }
+ public function conflicts_check_for_install() {
+ if (!CIP::check_bylevel(1)) return false;
+ foreach($this->zipContent as $row){
+
+ $rs_filename=replace_path_admin($row);
+
+ $path=dirname($rs_filename['filename']);
+ $fs_filename = $rs_filename['filename'];
+
+ $backup_file=DIR_FS_BACKUP.CONTRIB_INSTALLER_NAME."_".CONTRIB_INSTALLER_VERSION.'/'. $fs_filename;
+
+ // check if file is already copied
+ if($this->equal_files($backup_file,$fs_filename)) continue;
+
+ if (!_cst_bool('ALLOW_OVERWRITE_MODIFIED')) {
+ if (!is_file($fs_filename)) {
+
+ $msg="Backup file ".$backup_file." is not exists. This file needed to check if file". $fs_filename. " was modified since Contrib Installer have been installed.
+ <br /><b>CIP.NET.UA Advise</b>:<br />
+ Set \"Allow Overwrite Existing Modified Files\" to TRUE and all modified files will be overwritten.
+ All changes will be lost!<br />
+ <i>or</i><br />
+ Copy clean osCommerce files to ".DIR_FS_CIP."/".CONTRIB_INSTALLER_NAME."_".CONTRIB_INSTALLER_VERSION. "/catalog/ and try again.";
+
+ CIP::InProcess($msg, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'noblock');
+ }
+ elseif (file_exists($fs_filename) && file_exists($backup_file)&& !$this->equal_files($fs_filename, $backup_file)) {
+ $msg="File ".$fs_filename." exists and was modified since Contrib Installer have been installed. Overwriting is not allowed.<br /><b>CIP.NET.UA Advise</b>:<br />Set \"Allow Overwrite Existing Modified Files\" to TRUE or change install.xml.";
+ CIP::InProcess($msg, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public function conflicts_check_for_remove() {return true; }
+
+
public function do_install() {
- if(!$this->unpack_plus($this->data['zip'],$this->data['path'])) return false;
+
+ if(!$this->unpack_plus($this->data['zip'],$this->data['path']))
+ return false;
else{
+
// deplacement admin
$folder_admin=substr(DIR_WS_ADMIN, strlen(DIR_WS_CATALOG) );
+
if(file_exists(DIR_FS_CATALOG.'admin') && $folder_admin !='admin/' ){
- parent::recurse_copy(DIR_FS_CATALOG.'admin',DIR_FS_ADMIN);
- parent::recursive_rmdir(DIR_FS_CATALOG.'admin/');
+ parent::recurse_copy(DIR_FS_CATALOG.'admin',DIR_FS_ADMIN);
+
+ $res=parent::recursive_rmdir(DIR_FS_CATALOG.'admin/');
}
+
return true;
}
}
public function do_remove() {
-// $this->recursive_rmdir();
- return true;
+
+ foreach($this->zipContent as $row){
+
+ $rs_filename=replace_path_admin($row);
+
+ $path=dirname($rs_filename['filename']);
+ $fs_filename = $rs_filename['filename'];
+
+ if(file_exists(DIR_FS_CATALOG.$fs_filename) && is_writable(DIR_FS_CATALOG.$fs_filename) && !is_dir(DIR_FS_CATALOG.$fs_filename) ){
+ if(! fileUtility::_unlink(DIR_FS_CATALOG. $fs_filename) ){
+ CIP::InProcess(__('write file permissins needed text').' '.$fs_filename, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'noblock');
+// return false;
+ }
+ }
+ }
+ return true;
+
}
+
+
/** =============================================================== PRIVATE =============================================================== */
private function unpack_plus($file,$dir) {
- $le_file=DIR_FS_CIP.'/'.$this->contrib.'/'.$file;
- $zipfile = new PclZip( $le_file );
- if($this->cip->is_Windows()) if(!defined('OS_WINDOWS'))define('OS_WINDOWS',1);
- else if(!defined('OS_WINDOWS'))define('OS_WINDOWS',0);
- $ret = $zipfile->extract( PCLZIP_OPT_PATH, DIR_FS_CATALOG.$dir );
+ $ret = self::$PclZip->extract( PCLZIP_OPT_PATH, DIR_FS_CATALOG.$dir );
if($ret == 0) {
- CIP::$error=true;
- trigger_error(__CLASS__.sprintf(' error %s', __FUNCTION__).__('Unrecoverable error "').$zipfile->errorName(true).$le_file , E_USER_ERROR);
+// CIP::$error=true;
+// trigger_error(__CLASS__.sprintf(' error %s', __FUNCTION__).__('Unrecoverable error "').$zipfile->errorName(true).$le_file , E_USER_ERROR);
+ CIP::InProcess('check'.__('unpack with error').$file, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
return false;
}
return true;
}
-// function permissions_check_for_install($name='') {
-// if (!file_exists(DIR_FS_CATALOG.$this->data['path'])){
-// CIP::$error= true;
-// trigger_error(__CLASS__.sprintf('error %s', __FUNCTION__).__('Unrecoverable error "').$this->data['path'] , E_USER_ERROR);
-// }
-// elseif(!is_writable(DIR_FS_CATAL...
[truncated message content] |
|
From: <os...@us...> - 2012-01-03 00:05:49
|
Revision: 4007
http://oscss.svn.sourceforge.net/oscss/?rev=4007&view=rev
Author: oscim
Date: 2012-01-03 00:05:41 +0000 (Tue, 03 Jan 2012)
Log Message:
-----------
Amelioration , correction et developpement de l'installateur
Ajout de class sqlxx pour manipuler les db associ?\195?\169
centralisation du control des fichier install?\195?\169 , et report en base des modules, drivers, plugin en db
usage de la nouvelle table de bd pour acceder a l'ensemble des elements de configuration associ?\195?\169 a une extension
Modified Paths:
--------------
trunk/catalog/admin/includes/exts/package/CIP.php
trunk/catalog/admin/includes/exts/package/CipUtility.php
trunk/catalog/admin/includes/exts/package/ci_tag.class.php
trunk/catalog/admin/includes/exts/package/packageInstaller.php
trunk/catalog/admin/includes/exts/package/packageUtility.php
trunk/catalog/admin/includes/exts/package/tags/addfile.php
trunk/catalog/admin/includes/exts/package/tags/depend.php
trunk/catalog/admin/includes/exts/package/tags/extractzip.php
trunk/catalog/admin/includes/exts/package/tags/filesql.php
trunk/catalog/admin/includes/exts/package/tags/sql.php
trunk/catalog/admin/includes/gabarit/package/display_view.package.config.gab
trunk/catalog/admin/includes/modules/pages/package.php
trunk/catalog/install/includes/sql/mysql/data/91_osc_admin_cip.sql
trunk/catalog/install/includes/sql/mysql/tables/osc_admin_cip.sql
Added Paths:
-----------
trunk/catalog/admin/includes/classes/drivers/sqlcip.php
trunk/catalog/admin/includes/classes/drivers/sqlcip_modfiles.php
trunk/catalog/admin/includes/exts/package/cip_modfiles.php
trunk/catalog/admin/includes/gabarit/package/display_view.package.configedit.gab
trunk/catalog/install/includes/sql/mysql/tables/osc_admin_cip_modfiles.sql
Added: trunk/catalog/admin/includes/classes/drivers/sqlcip.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcip.php (rev 0)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcip.php 2012-01-03 00:05:41 UTC (rev 4007)
@@ -0,0 +1,217 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @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 03/01/12, 08:07
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class sqlcip_modfiles
+ @file sqlcip_modfiles.php
+ @brief manage insert/update/delete in zone tables
+*/
+
+
+define('TABLE_MODFILES', DB_TABLE_PREFIX . 'admin_cip_modfiles');
+
+class sqlcip_modfiles
+ implements ModSqlDataDriver{
+
+ public static $modules;
+
+ protected static $_instance;
+
+ protected function __construct(){
+ }
+
+
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+ self::getInstance();
+
+ if(!isset($option['cip_id']))
+ return 'cip_id';
+
+
+ $sql_data_array['k_cip_id'] = tep_db_prepare_input($option['cip_id']);
+ $sql_data_array['cip_filename'] = tep_db_prepare_input($option['filename']);
+ $sql_data_array['cip_folder'] = tep_db_prepare_input($option['folder']);
+ $sql_data_array['cip_type'] = tep_db_prepare_input($option['type']);
+ $sql_data_array['cip_typetype'] = tep_db_prepare_input($option['typetype']);
+ $sql_data_array['core'] = tep_db_prepare_input($option['core']);
+ $sql_data_array['cip_install'] = tep_db_prepare_input($option['install']);
+
+
+ $res=tep_db_perform(TABLE_MODFILES, $sql_data_array);
+
+ if(!$res)
+ return $res;
+ else
+ return $res->__get('insertId');
+ }
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ self::getInstance();
+
+ if(!isset($option['id']))
+ return 'id';
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND rowid = '".(int)$option['id']."' ";
+ if(isset($option['cip_id'])) $where .="AND k_cip_id = '".(int)$option['cip_id']."' ";
+
+ if(isset($option['new_cip_id'])) $sql_data_array['k_cip_id'] = tep_db_prepare_input($option['cip_id']);
+
+ if(isset($option['filename'])) $sql_data_array['cip_filename'] = tep_db_prepare_input($option['filename']);
+ if(isset($option['folder'])) $sql_data_array['cip_folder'] = tep_db_prepare_input($option['folder']);
+ if(isset($option['type'])) $sql_data_array['cip_type'] = tep_db_prepare_input($option['type']);
+ if(isset($option['typetype'])) $sql_data_array['cip_typetype'] = tep_db_prepare_input($option['typetype']);
+ if(isset($option['core'])) $sql_data_array['core'] = tep_db_prepare_input($option['core']);
+ if(isset($option['install'])) $sql_data_array['cip_install'] = tep_db_prepare_input($option['install']);
+
+ $res=tep_db_perform(TABLE_MODFILES, $sql_data_array, 'update' , substr($where,3) );
+
+ return $res;
+ }
+
+ /**
+ @brief load ligne in table configuration
+ @param option array
+ id => row id int (configuration_id)
+ key => string key (configuration_key)
+ group_id => group_id int (configuration_group_id)
+ @param $shortkey use cleankey for return short key
+ @return
+
+ object(stdClass)[13]
+ public 'id' => string '1' (length=1)
+
+ OR
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
+
+ */
+ public static function fetch($option,$shortkey=false){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ $sql ="";
+ if(isset($option['id'])) $sql .="AND rowid = '".(int)$option['id']."' ";
+ if(isset($option['cip_id'])) $sql .="AND k_cip_id = '".(int)$option['cip_id']."' ";
+ if(isset($option['type'])) $sql .="AND cip_type = '".(string)$option['type']."' ";
+ if(isset($option['typetype'])) $sql .="AND cip_typetype = '".(string)$option['typetype']."' ";
+ if(isset($option['core'])) $sql .="AND core = '".(int)$option['core']."' ";
+ if(isset($option['filename'])) $sql .="AND cip_filename = '".(string)$option['filename']."' ";
+ if(isset($option['folder'])) $sql .="AND cip_folder = '".(string)$option['folder']."' ";
+
+ if($sql=='')
+ return false;
+
+
+ $sql="SELECT * FROM " . TABLE_MODFILES . " a ".
+// " LEFT JOIN " . TABLE_IMAGES_USED . " g ON (a.rowid=g.rowid) ".
+ " WHERE ".substr($sql,3);
+// echo '<br>';
+ $res=$DB->query($sql);
+
+ $num = $res->__get('numRows');
+
+ if($num == 1){
+ $result=$res->fetchAssoc();
+ return ((!$shortkey)? $result : self::CleanKey($result));
+ }
+ elseif($num > 1){
+ $array=array();
+
+ foreach($res->fetchAllAssoc() as $result)
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+
+ return $array;
+ }
+
+ return false;
+ }
+
+ /**
+ @brief delete row
+ */
+ public static function delete($option){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ $sql ="";
+
+ if(isset($option['id'])) $sql .="AND rowid = '".(int)$option['id']."' ";
+ if(isset($option['cip_id'])) $sql .="AND k_cip_id = '".(int)$option['cip_id']."' ";
+
+ if(strlen($sql) < 5)
+ return false;
+
+ $DB->query($s="DELETE FROM " . TABLE_MODFILES ." WHERE ". substr($sql,3) );
+
+ return true;
+ }
+
+
+ /**
+ @brief
+ @return array product empty
+ */
+ public static function Specimen($shortkey=false){
+ $par = array('rowid' => '',
+ 'k_cip_id' => '',
+ 'cip_filename' => '',
+ 'cip_folder' => '',
+ 'cip_type' => '',
+ 'cip_typetype' => '',
+ 'core' => '',
+ 'cip_install' => '',
+ );
+
+ return ((!$shortkey)? $par : self::CleanKey($par));
+ }
+
+
+
+ /**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ private static function CleanKey($array){
+ self::getInstance();
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( strpos($key,'k_') ===0)
+ $key=substr($key,2);
+ elseif( $key == 'rowid' )
+ $key='id';
+ elseif( strpos($key,'cip_') ===0)
+ $key=substr($key,4);
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+}
+
+
+?>
\ No newline at end of file
Added: trunk/catalog/admin/includes/classes/drivers/sqlcip_modfiles.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcip_modfiles.php (rev 0)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcip_modfiles.php 2012-01-03 00:05:41 UTC (rev 4007)
@@ -0,0 +1,217 @@
+<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
+/**
+ @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 03/01/12, 08:07
+ @author oscim <mail aur...@os...> <www http://www.oscim.fr>
+ @encode UTF-8
+ @class sqlcip_modfiles
+ @file sqlcip_modfiles.php
+ @brief manage insert/update/delete in zone tables
+*/
+
+
+define('TABLE_MODFILES', DB_TABLE_PREFIX . 'admin_cip_modfiles');
+
+class sqlcip_modfiles
+ implements ModSqlDataDriver{
+
+ public static $modules;
+
+ protected static $_instance;
+
+ protected function __construct(){
+ }
+
+
+ public static function getInstance() {
+ if(self::$_instance == null) self::$_instance = new self();
+ return self::$_instance;
+ }
+
+
+ /**
+ @brief create new ligne in table configuration
+ */
+ public static function create($option){
+ self::getInstance();
+
+ if(!isset($option['cip_id']))
+ return 'cip_id';
+
+
+ $sql_data_array['k_cip_id'] = tep_db_prepare_input($option['cip_id']);
+ $sql_data_array['cip_filename'] = tep_db_prepare_input($option['filename']);
+ $sql_data_array['cip_folder'] = tep_db_prepare_input($option['folder']);
+ $sql_data_array['cip_type'] = tep_db_prepare_input($option['type']);
+ $sql_data_array['cip_typetype'] = tep_db_prepare_input($option['typetype']);
+ $sql_data_array['core'] = tep_db_prepare_input($option['core']);
+ $sql_data_array['cip_install'] = tep_db_prepare_input($option['install']);
+
+
+ $res=tep_db_perform(TABLE_MODFILES, $sql_data_array);
+
+ if(!$res)
+ return $res;
+ else
+ return $res->__get('insertId');
+ }
+
+ /**
+ @brief update ligne in table configuration
+ */
+ public static function update($option){
+ self::getInstance();
+
+ if(!isset($option['id']))
+ return 'id';
+
+ $where ='';
+ if(isset($option['id'])) $where .="AND rowid = '".(int)$option['id']."' ";
+ if(isset($option['cip_id'])) $where .="AND k_cip_id = '".(int)$option['cip_id']."' ";
+
+ if(isset($option['new_cip_id'])) $sql_data_array['k_cip_id'] = tep_db_prepare_input($option['cip_id']);
+
+ if(isset($option['filename'])) $sql_data_array['cip_filename'] = tep_db_prepare_input($option['filename']);
+ if(isset($option['folder'])) $sql_data_array['cip_folder'] = tep_db_prepare_input($option['folder']);
+ if(isset($option['type'])) $sql_data_array['cip_type'] = tep_db_prepare_input($option['type']);
+ if(isset($option['typetype'])) $sql_data_array['cip_typetype'] = tep_db_prepare_input($option['typetype']);
+ if(isset($option['core'])) $sql_data_array['core'] = tep_db_prepare_input($option['core']);
+ if(isset($option['install'])) $sql_data_array['cip_install'] = tep_db_prepare_input($option['install']);
+
+ $res=tep_db_perform(TABLE_MODFILES, $sql_data_array, 'update' , substr($where,3) );
+
+ return $res;
+ }
+
+ /**
+ @brief load ligne in table configuration
+ @param option array
+ id => row id int (configuration_id)
+ key => string key (configuration_key)
+ group_id => group_id int (configuration_group_id)
+ @param $shortkey use cleankey for return short key
+ @return
+
+ object(stdClass)[13]
+ public 'id' => string '1' (length=1)
+
+ OR
+ array(
+ object(stdClass)[13]
+ ...
+ object(stdClass)[13]
+ ..
+ )
+
+ */
+ public static function fetch($option,$shortkey=false){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ $sql ="";
+ if(isset($option['id'])) $sql .="AND rowid = '".(int)$option['id']."' ";
+ if(isset($option['cip_id'])) $sql .="AND k_cip_id = '".(int)$option['cip_id']."' ";
+ if(isset($option['type'])) $sql .="AND cip_type = '".(string)$option['type']."' ";
+ if(isset($option['typetype'])) $sql .="AND cip_typetype = '".(string)$option['typetype']."' ";
+ if(isset($option['core'])) $sql .="AND core = '".(int)$option['core']."' ";
+ if(isset($option['filename'])) $sql .="AND cip_filename = '".(string)$option['filename']."' ";
+ if(isset($option['folder'])) $sql .="AND cip_folder = '".(string)$option['folder']."' ";
+
+ if($sql=='')
+ return false;
+
+
+ $sql="SELECT * FROM " . TABLE_MODFILES . " a ".
+// " LEFT JOIN " . TABLE_IMAGES_USED . " g ON (a.rowid=g.rowid) ".
+ " WHERE ".substr($sql,3);
+// echo '<br>';
+ $res=$DB->query($sql);
+
+ $num = $res->__get('numRows');
+
+ if($num == 1){
+ $result=$res->fetchAssoc();
+ return ((!$shortkey)? $result : self::CleanKey($result));
+ }
+ elseif($num > 1){
+ $array=array();
+
+ foreach($res->fetchAllAssoc() as $result)
+ $array[]= ((!$shortkey)? $result : self::CleanKey($result));
+
+ return $array;
+ }
+
+ return false;
+ }
+
+ /**
+ @brief delete row
+ */
+ public static function delete($option){
+ self::getInstance();
+ $DB=Database::getInstance();
+
+ $sql ="";
+
+ if(isset($option['id'])) $sql .="AND rowid = '".(int)$option['id']."' ";
+ if(isset($option['cip_id'])) $sql .="AND k_cip_id = '".(int)$option['cip_id']."' ";
+
+ if(strlen($sql) < 5)
+ return false;
+
+ $DB->query($s="DELETE FROM " . TABLE_MODFILES ." WHERE ". substr($sql,3) );
+
+ return true;
+ }
+
+
+ /**
+ @brief
+ @return array product empty
+ */
+ public static function Specimen($shortkey=false){
+ $par = array('rowid' => '',
+ 'k_cip_id' => '',
+ 'cip_filename' => '',
+ 'cip_folder' => '',
+ 'cip_type' => '',
+ 'cip_typetype' => '',
+ 'core' => '',
+ 'cip_install' => '',
+ );
+
+ return ((!$shortkey)? $par : self::CleanKey($par));
+ }
+
+
+
+ /**
+ @fn CleanKey()
+ @brief Clean string name key
+ */
+ private static function CleanKey($array){
+ self::getInstance();
+ $object= new stdclass();
+
+ foreach($array as $key=>$value){
+ if( strpos($key,'k_') ===0)
+ $key=substr($key,2);
+ elseif( $key == 'rowid' )
+ $key='id';
+ elseif( strpos($key,'cip_') ===0)
+ $key=substr($key,4);
+
+ $object->$key = $value;
+ }
+
+ return $object;
+ }
+
+}
+
+
+?>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/exts/package/CIP.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/CIP.php 2012-01-02 14:25:25 UTC (rev 4006)
+++ trunk/catalog/admin/includes/exts/package/CIP.php 2012-01-03 00:05:41 UTC (rev 4007)
@@ -4,7 +4,7 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 02/01/2012, 18:17
+ @date 03/01/12, 08:07
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
Original:
@@ -25,6 +25,9 @@
*/
+
+include_once(dirname(__FILE__).'/cip_modfiles.php');
+
class CIP {
public static $debugg=true;
/**
@@ -88,15 +91,20 @@
/**
Number of php tags in install.xml
*/
- var $count_php_tags=0;
+ public $count_php_tags=0;
/**
*/
- var $cip_id;
+ public $cip_id;
/**
* '1' if CIP was installed, '0' if not.
*/
- var $cip_installed;
+ public $cip_installed;
+ /**
+ @var object
+ @brief all base data current cip
+ */
+ public static $cInfo;
/**
Config
@@ -144,6 +152,8 @@
}
//! control db etat
+// $resObj = sqlcip::fetch(array());
+
$result=self::$DB->query("select cip_id, cip_installed, cip_version from ".TABLE_CIP. " where cip_folder_name='".self::$cip_name."'; ");
$installed=$result->fetchAssoc();
@@ -154,6 +164,16 @@
$this->cip_installed=(int)$installed['cip_installed'];
}
+ /// Transversal info base paquet
+ self::$cInfo = new stdClass;
+ self::$cInfo->id = $this->cip_id;
+ self::$cInfo->installed = $this->cip_installed;
+// self::$cInfo->version = $this->cip_installed;
+ self::$cInfo->name = self::$cip_name;
+
+
+// print_r(self::$cInfo);
+
define('CONTRIB_INSTALLER_NAME', 'CIP');
define('CONTRIB_INSTALLER_VERSION', 'oscss 2 2.0.1');
}
@@ -311,9 +331,12 @@
*/
private function register() {
- $resobj=self::$DB->query($sql="insert into ".TABLE_CIP." (cip_id, cip_folder_name, cip_installed, cip_ident, cip_version) values ('', '".self::$cip_name."', '0', '".$this->getIdent()."','".$this->getVersion()."')");
- $this->cip_id=$resobj->__get('insertId');
+// $resobj=self::$DB->query($sql="insert into ".TABLE_CIP." (cip_id, cip_folder_name, cip_installed, cip_ident, cip_version) values ('', '".self::$cip_name."', '0', '".$this->getIdent()."','".$this->getVersion()."')");
+// $this->cip_id=$resobj->__get('insertId');
+// if(is_object(self::$cInfo) && self::$cInfo->id > 0)
+ $this->cip_id=sqlcip::create(array('folder_name'=>self::$cip_name , 'ident'=>$this->getIdent() ,'version'=>$this->getVersion() ));
+
$this->cip_installed=0;
self::InProcess(__("register add db table_cip "), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'info');
}
@@ -322,7 +345,8 @@
Delete in db this contrib
*/
public function unregister() {
- self::$DB->query("DELETE FROM ".TABLE_CIP." WHERE cip_folder_name='".self::$cip_name."' ");
+ if(is_object(self::$cInfo) && self::$cInfo->id > 0)
+ sqlcip::delete(array('id'=>self::$cInfo->id));
}
///================================================================== //Is installed? //==================================================================
@@ -331,6 +355,8 @@
*/
private function is_installed() {
if (!isset($this->cip_installed)) {
+
+
$result=tep_db_query("select cip_installed from ".TABLE_CIP." where cip_folder_name='".self::$cip_name."'");
if ($result===false) { trigger_error(__CLASS__.sprintf('error %s', __FUNCTION__.'::'.__LINE__), E_USER_ERROR); return $this->cip_installed=false; }
$installed=tep_db_fetch_array($result);
@@ -346,7 +372,9 @@
/**
*/
private function set_installed($status='1') {
- self::$DB->query("UPDATE ".TABLE_CIP." SET cip_installed='".$status."', cip_ident='".$this->getIdent()."', cip_version='".$this->getVersion()."' WHERE cip_folder_name='".self::$cip_name."'");
+ if(is_object(self::$cInfo) && self::$cInfo->id > 0)
+ sqlcip::update(array('id'=>self::$cInfo->id, 'installed'=>(int)$status ,'version'=>$this->getVersion() ));
+
self::InProcess(__("Install update db table_cip "), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'normal');
}
@@ -491,27 +519,28 @@
}
//! backup
- if (!$this->total_backup()){
- self::InProcess(__("Erreur durant traitement de cette fonction total_backup()"), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
- return false;
- }
+// if (!$this->total_backup()){
+// self::InProcess(__("Erreur durant traitement de cette fonction total_backup()"), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+// return false;
+// }
//! We passed by all checks. So if an error appears
foreach ($this->contrib_data as $id=>$tag)
if ( $tag->do_install() ===false){
- self::InProcess(__("Erreur durant traitement de cette fonction "),'tag_xml-['.$id.']'. $tag->tag_name.'->do_install()','block');
- break;
+ self::InProcess(__("Erreur durant traitement de cette fonction "),'tag_xml-['.$id.']'. $tag->tag_name.'->do_install()','block');
+ break;
}
//! If we had a problems at runtime we should remove this CIP.
- if (!self::check_bylevel(1)) $this->remove(true);
- else {
- $this->DeleteContribFull(false, 'ok');
-
- //! up db etat install cip name
+// if (!self::check_bylevel(1))
+// $this->remove(true);
+// else {
+// $this->DeleteContribFull(false, 'ok');
+//
+// //! up db etat install cip name
$this->set_installed();
- }
+// }
}
/**
@@ -584,12 +613,13 @@
if (self::$error=(int)$tag->do_install()) break;
//! If we had a problems at runtime we should remove this CIP.
- if (self::$error) $this->remove(true);
- else {
- if ($this->was_unpacked() && $this->is_unpacked()) {
- fileUtility::_rmdir(DIR_FS_CIP.$this->get_cip_name());
- }
- }
+// if (self::$error)
+// $this->remove(true);
+// else {
+// if ($this->was_unpacked() && $this->is_unpacked()) {
+// fileUtility::_rmdir(DIR_FS_CIP.$this->get_cip_name());
+// }
+// }
}
///================================================================== //Backup //==================================================================
@@ -598,24 +628,24 @@
//! prepare backup folder:
if (!is_dir(self::PATH_BACKUP.self::$cip_name)) {
if (!@mkdir(self::PATH_BACKUP.self::$cip_name, 0777)){
- self::InProcess(__("write permissins needed text").self::PATH_BACKUP.self::$cip_name, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'error');
- return false;
+ self::InProcess(__("write permissins needed text").self::PATH_BACKUP.self::$cip_name, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'error');
+ return false;
}
fileUtility::_chmod(self::PATH_BACKUP.self::$cip_name, 0777);
}
- if ( _cst_bool('ALLOW_FILES_BACKUP')){
+// if ( _cst_bool('ALLOW_FILES_BACKUP')){
//! Backup Files:
- if (!$this->backup() || !self::check_bylevel(1) /* !$this->is_all_right()*/){
- self::InProcess(__("Erreur apres traitement de cette fonction : backup()"), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
- return false;
- }
+// if (!$this->backup() || !self::check_bylevel(1) /* !$this->is_all_right()*/){
+// self::InProcess(__("Erreur apres traitement de cette fonction : backup()"), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+// return false;
+// }
//! Backup DataBase:
- if (!CipUtility::sql_backup() || !self::check_bylevel(1)){
- self::InProcess(__("Erreur apres traitement de cette fonction : CipUtility::sql_backup()"), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
- return false;
- }
- }
+// if (!CipUtility::sql_backup() || !self::check_bylevel(1)){
+// self::InProcess(__("Erreur apres traitement de cette fonction : CipUtility::sql_backup()"), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+// return false;
+// }
+// }
return true;
}
@@ -795,12 +825,12 @@
@return tag ident
*/
function getIdent(){
- if(self::$ident!=null) return self::$ident;
- if(isset($this->description_id) && isset( $this->contrib_data[$this->description_id]->data['ident']))
- return self::$ident=$this->contrib_data[$this->description_id]->data['ident'];
-
- self::InProcess(__("pas de tag de ident (obligatoire)"), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
- return false;
+// if(self::$ident!=null) return self::$ident;
+// if(isset($this->description_id) && isset( $this->contrib_data[$this->description_id]->data['ident']))
+// return self::$ident=$this->contrib_data[$this->description_id]->data['ident'];
+ return self::$ident = self::$cip_name;
+// self::InProcess(__("pas de tag de ident (obligatoire)"), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+// return false;
}
/**
Modified: trunk/catalog/admin/includes/exts/package/CipUtility.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/CipUtility.php 2012-01-02 14:25:25 UTC (rev 4006)
+++ trunk/catalog/admin/includes/exts/package/CipUtility.php 2012-01-03 00:05:41 UTC (rev 4007)
@@ -4,7 +4,7 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 02/01/2012, 18:17
+ @date 03/01/12, 08:07
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
Modified: trunk/catalog/admin/includes/exts/package/ci_tag.class.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2012-01-02 14:25:25 UTC (rev 4006)
+++ trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2012-01-03 00:05:41 UTC (rev 4007)
@@ -4,7 +4,7 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 02/01/2012, 18:17
+ @date 03/01/12, 08:07
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
Original:
@@ -139,23 +139,25 @@
return $this->get_fs_filename($this->data['filename']);
}
- function get_fs_filename($fname) {
- if($this->isJoscom()){
+ public static function get_fs_filename($fname) {
+// if($this->isJoscom()){
$fname = str_replace(DIR_WS_CATALOG,"",$fname);
$fname = str_replace(DIR_WS_ADMIN,"admin/",$fname);
-
+//
if (strpos($fname, "admin/") === false) {
- $filepath = DIR_FS_CATALOG;
+ $filepath = DIR_FS_CATALOG;
} else {
- $filepath = DIR_FS_ADMIN;
- $fname = substr($fname, 6);
+ $filepath = DIR_FS_ADMIN;
+ $fname = substr($fname, 6);
}
return $filepath.$fname;
- }else{
- if ($fname)return DIR_FS_CATALOG.$fname;
- }
+// }else{
+// if ($fname)return DIR_FS_CATALOG.$fname;
+// }
}
+
+
function isJoscom(){return ((defined("JOSCOM_VERSION")) ? true : false);}
/**
@@ -318,66 +320,77 @@
///======================================================================= //Backup //=======================================================================
-// public function backup_file($filename=''){
-// $filename=((isset($filename))
-// ? (is_array($filename)
-// ? $filename
-// : array($filename)
-// )
-// : ((isset($this->data['filename']))
-// ? $this->data['filename']
-// : ''
-// )
-// );
-//
-// if(is_array($filename)) $filenames= $filename;
-// else $filenames[0] = $filename;
-//
-// foreach($filenames as $filename){
-// $full_path=$this->get_fs_filename($filename);
-// if(!is_file($full_path) or is_link($full_path))return false;
-//
-// // CIP::$ArrayError[]=
-// if(!$res=fileUtility::_mkdir(dirname(CIP::PATH_BACKUP.$this->contrib.'/'.$filename).'/'))CIP::InProcess(__('_medir error'). implode(',',$res). " to ".CIP::PATH_BACKUP.$this->contrib.'/'.$filename, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
-//
-// if(in_array(false,CIP::$ArrayError)) return false ;
-//
-// if(!fileUtility::_copy($full_path, CIP::PATH_BACKUP.$this->contrib.'/'.$filename)){
-// CIP::InProcess(__('couldnt copy to text'). $full_path. " to ".CIP::PATH_BACKUP.$this->contrib.'/'.$filename, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
-// return false;
-// }
-// elseif (file_exists(CIP::PATH_BACKUP.$this->contrib.'/'.$filename))
-// fileUtility::_chmod(CIP::PATH_BACKUP.$this->contrib.'/'.$filename, 0777);
-//
-// }
-// return true;
-// }
-// public function restore_file($filename=''){
-// $filename=((isset($filename)) ? $filename : ((isset($this->data['filename'])) ? $this->data['filename'] : ''));
-// if (!isset($filename)) return false;
-// if(is_array($filename)) $filenames= $filename;
-// else $filenames[0] = $filename;
-//
-// foreach($filenames as $filename){
-// $backup_file=CIP::PATH_BACKUP.$this->contrib.'/'.$filename;
-// $current_file=$this->get_fs_filename($filename);
-// if(is_link($current_file)) return false;
-// //Remove current_file
-// fileUtility::_rmdir($current_file);
-// if (!is_file($backup_file)) return false;
-// //Restore
-// if (!fileUtility::_copy($backup_file, $current_file)) {
-// CIP::InProcess(__("Couldn't restore file ").' '. $filename. __("from").' '.$backup_file, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
-// return false;
-// }
-// else{
-// if(!ci_remove($backup_file)) return false;
-// }
-// }
-// return true;
-// }
+ /**
+ @brief backup one file
+ @param $filename absolute path required
+ */
+ public static function backup_file($filename){
+ $filename=( is_array($filename)
+ ? $filename
+ : array($filename)
+ );
+ if(is_array($filename)) $filenames= $filename;
+ else $filenames[0] = $filename;
+
+ foreach($filenames as $full_path){
+// echo $full_path.'<br>';
+// $full_path=self::get_fs_filename($filename);
+
+
+ if(strpos('_'.$full_path, DIR_FS_ADMIN)> 0 )
+ $filename = str_replace(DIR_FS_ADMIN,'',$full_path);
+ elseif(strpos('_'.$full_path, DIR_FS_CATALOG)>0)
+ $filename = str_replace(DIR_FS_CATALOG,'',$full_path);
+ else
+ $filename = $full_path;
+
+
+ if(!is_file($full_path)
+ or is_link($full_path))
+ return false;
+
+ if(!$res=fileUtility::_mkdir(dirname(CIP::PATH_BACKUP.CIP::$cInfo->name.'/'.$filename).'/'))
+ CIP::InProcess(__('_medir error'). implode(',',$res). " to ".CIP::PATH_BACKUP.CIP::$cInfo->name.'/'.$filename, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+
+
+ if(!fileUtility::_copy($full_path, CIP::PATH_BACKUP.CIP::$cInfo->name.'/'.$filename)){
+ CIP::InProcess(__('couldnt copy to text'). $full_path. " to ".CIP::PATH_BACKUP.CIP::$cInfo->name.'/'.$filename, __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+ return false;
+ }
+ elseif (file_exists(CIP::PATH_BACKUP.CIP::$cInfo->name.'/'.$filename))
+ ...
[truncated message content] |
|
From: <os...@us...> - 2012-01-05 13:21:01
|
Revision: 4010
http://oscss.svn.sourceforge.net/oscss/?rev=4010&view=rev
Author: oscim
Date: 2012-01-05 13:20:53 +0000 (Thu, 05 Jan 2012)
Log Message:
-----------
Suite refonte gestion des paquets
Modified Paths:
--------------
trunk/catalog/Documents/admin/data/repository_sources.xml
trunk/catalog/admin/includes/exts/package/CIP.php
trunk/catalog/admin/includes/exts/package/cip_modfiles.php
trunk/catalog/admin/includes/exts/package/packageInstaller.php
trunk/catalog/admin/includes/exts/package/packageRepository.php
trunk/catalog/admin/includes/languages/fr_FR/modules/pages/package.txt
trunk/catalog/admin/includes/modules/pages/package.php
Modified: trunk/catalog/Documents/admin/data/repository_sources.xml
===================================================================
--- trunk/catalog/Documents/admin/data/repository_sources.xml 2012-01-03 15:40:57 UTC (rev 4009)
+++ trunk/catalog/Documents/admin/data/repository_sources.xml 2012-01-05 13:20:53 UTC (rev 4010)
@@ -1,11 +1,33 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
+
<channel>
<title>Official</title>
<key>official</key>
<description>official repository</description>
- <repository>http://plugins.oscss.org/</repository>
- <rep_listing>rss.php?box=package</rep_listing>
- <rep_detail>rss.php?box=products_info</rep_detail>
+ <repository>http://localhost/plugins.oscss.org/services.php</repository>
+ <ident>
+ <user></user>
+ <token></token>
+ </ident>
+ <service>
+ <listing>listing_package</listing>
+ <view>detail_package</view>
+ <download>download_package</download>
+ </service>
</channel>
+
+
+
+ <channel>
+ <title>Local</title>
+ <key>local</key>
+ <description>local folder</description>
+ <repository>
+ </repository>
+ <rep_listing>
+ </rep_listing>
+ <rep_detail>
+ </rep_detail>
+ </channel>
</root>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/exts/package/CIP.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/CIP.php 2012-01-03 15:40:57 UTC (rev 4009)
+++ trunk/catalog/admin/includes/exts/package/CIP.php 2012-01-05 13:20:53 UTC (rev 4010)
@@ -399,17 +399,17 @@
//! Erreur fatal before process, delete and exit
if(!$this->check_bylevel(1)){
- self::InProcess(__("Erreur suite lecture XML file "), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
- return false;
+ self::InProcess(__("Erreur suite lecture XML file "), __CLASS__.'->'.__FUNCTION__.'::'.__LINE__,'block');
+ return false;
- $this->DeleteContribFull();
+// $this->DeleteContribFull();
}
else
- return true;
+ return true;
}
elseif ($this->was_unpacked()) {
$messageStack->add( 'Couldn\'t unpack <strong>'.$this->get_zip_name().'</strong> to read data about CIP. ', 'warning');
- $this->DeleteContribFull();
+// $this->DeleteContribFull();
}
return false;
}
Modified: trunk/catalog/admin/includes/exts/package/cip_modfiles.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/cip_modfiles.php 2012-01-03 15:40:57 UTC (rev 4009)
+++ trunk/catalog/admin/includes/exts/package/cip_modfiles.php 2012-01-05 13:20:53 UTC (rev 4010)
@@ -57,15 +57,14 @@
/**
@remarks file process
*/
+// echo $fs_filename .'<br>';
if(!is_dir(DIR_FS_CIP.CIP::$cInfo->name.'/catalog/'.$fs_filename)){
- if(!in_array(substr($fs_filename, 0,-4), array('.svn', '.csv')) && substr($fs_filename, 0,-1) !='~' ){
+
+ if(!in_array(substr($fs_filename, 0,-4), array('.svn', '.csv')) && substr($fs_filename,-1) !='~' ){
// echo $fs_filename .'<br>';
-// echo DIR_FS_CIP.CIP::$cInfo->name.'/catalog/'.$fs_filename .'---'.DIR_FS_CATALOG . replace_path_admin($fs_filename) .'<br>';
-
$act_install=self::CheckBackupFile(DIR_FS_CIP.CIP::$cInfo->name.'/catalog/'.$fs_filename , DIR_FS_CATALOG . replace_path_admin($fs_filename) );
-// var_dump($act_install, basename($fs_filename));
-// echo '<br>';
+
/**
@remarks Not File language
*/
Modified: trunk/catalog/admin/includes/exts/package/packageInstaller.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/packageInstaller.php 2012-01-03 15:40:57 UTC (rev 4009)
+++ trunk/catalog/admin/includes/exts/package/packageInstaller.php 2012-01-05 13:20:53 UTC (rev 4010)
@@ -24,7 +24,7 @@
}
/**
- Recup du package distant
+ @brief Recup du package distant
*/
public function download_exts($pkgID){
global $messageStack;
@@ -37,17 +37,19 @@
tep_redirect(tep_href_link(self::FILENAME, 'action=view&pkgID='.(int)$obj->item->internalID ));
}
else {
+
$dest=fopen(DIR_FS_CIP.(string)$obj->item->ident.'_'.(string)$obj->item->level.'.zip',"wb");
- if($this->fetchRemote((string)$obj->item->url_src,$dest)) {
- $messageStack->add_session('good', 'succes');
+
+ if($this->fetchRemote((string)$obj->item->url_download,$dest)) {
+ $messageStack->add_session(__('packageInstaller download file exts good'), 'success');
fclose($dest);
$cip= new CIP( (string)$obj->item->ident.'_'.(string)$obj->item->level.'.zip');
tep_redirect(tep_href_link(self::FILENAME, 'action=view&pkgID='.$pkgID));
}
else{
- $messageStack->add_session('error recup zip url ', 'error');
+ $messageStack->add_session(__('packageInstaller error recup zip url'), 'error');
tep_redirect(tep_href_link(self::FILENAME));
}
}
@@ -80,7 +82,8 @@
$array=$this->cip_description($description->data);
parent::$Rightlist=array_merge(parent::$Rightlist,ErrorAndBlockProcess::$ArrayError);
}
- else $array[]= '<strong style="color:red;">'.CIP::CONFIG_FILENAME. __('text doesnt exists').'!!!</strong>';
+ else
+ $array[]= '<strong style="color:red;">'.CIP::CONFIG_FILENAME. __('text doesnt exists').'!!!</strong>';
@@ -233,10 +236,11 @@
/**
*/
private function fetchRemote($src,&$dest,$step=0) {
+ if (($content=fileUtility::url_fopen($src)) ==false)
+ return false;
+ else
+ $this->write_dest($content, $dest);
- if (($content=fileUtility::url_fopen($src)) ==false) return false;
- else $this->write_dest($content, $dest);
-
return true;
}
Modified: trunk/catalog/admin/includes/exts/package/packageRepository.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/packageRepository.php 2012-01-03 15:40:57 UTC (rev 4009)
+++ trunk/catalog/admin/includes/exts/package/packageRepository.php 2012-01-05 13:20:53 UTC (rev 4010)
@@ -21,34 +21,46 @@
/**
- Ajout d'un depot
+ @brief Ajout d'un depot
*/
public static function SourceAdd(){
}
/**
- Suppression d'un depot
+ @brief Suppression d'un depot
*/
public static function SourceRemove(){
}
/**
- Load xml data,
+ @brief Load xml data,
+ @note this methode adjust static var parent class $FeedItem
+ @param $key string key source
+ @return if key no empty retrun object result current source, else no result
*/
- public static function SourceLoad(){
+ public static function SourceLoad($key=''){
global $messageStack,$osCSS_Cache;
+
try{
//! load xml file
- if(!$Parser = @simplexml_load_file(DIR_FS_ROOT_DOCS.'admin/data/'.self::REPOSITORY_SOURCE)) throw new Exception('Flux introuvable');
+ if(!$Parser = @simplexml_load_file(DIR_FS_ROOT_DOCS.'admin/data/'.self::REPOSITORY_SOURCE))
+ throw new Exception(__('package packageRepository link source no found or incorrectly formatted'));
+
$FeedItem = $Parser->xpath('channel');
- if(!$osCSS_Cache->read(parent::REPOSITORY_CACHE,0,true)) throw new Exception('Cache introuvable');
+ if(!$osCSS_Cache->read(parent::REPOSITORY_CACHE,0,true))
+ throw new Exception(__('package packageRepository cache no found'));
//! recup info cache
$var_file = $osCSS_Cache->getCache();
foreach($FeedItem as $item){
- $item->last_update=(isset($var_file[(string)$item->key]['last_update'] ) ? $var_file[(string)$item->key]['last_update'] : 'N/A');
- parent::$FeedItem[]=$item;
+ $item->last_update=(isset($var_file[(string)$item->key]['last_update'] ) ? $var_file[(string)$item->key]['last_update'] : 'N/A');
+
+ /// adjust parent var
+ if(!empty($key) && $key == (string)$item->key )
+ return $item;
+ else
+ parent::$FeedItem[]=$item;
}
}
catch(Exception $e){
@@ -60,17 +72,20 @@
public static function SourceLastUpdate($key){
}
+
+
/**
- Recup info depot par rapport a sa key
+ @brief Recup info depot par rapport a sa key
*/
public static function SourceLoadByKey($key){
global $messageStack;
try{
//! load xml file
- if(!$Parser = @simplexml_load_file(DIR_FS_ROOT_DOCS.'admin/data/'.self::REPOSITORY_SOURCE)) throw new Exception('Flux introuvable');
+ if(!$Parser = @simplexml_load_file(DIR_FS_ROOT_DOCS.'admin/data/'.self::REPOSITORY_SOURCE)) throw new Exception('file cache introuvable');
$FeedItem = $Parser->xpath('channel');
foreach($FeedItem as $item){
- if((string)$item->key == (string)$key) return $item;
+ if((string)$item->key == (string)$key)
+ return $item;
}
}
catch(Exception $e){
@@ -78,9 +93,39 @@
}
}
+
+ /**
+ @brief Test connextion and content
+ */
+ public static function InitConnexion($repo, $action = ''){
+ global $messageStack;
+
+ if(!$re= fileUtility::url_fopen( self::HrefSrc($repo, $action ) ) ){
+ $messageStack->add_session('recuperation repository impossible :'.$repo->repository,'error' );
+ return false;
+ }
+ else {
+
+ if(!$Repos = simplexml_load_string($re)){
+ $messageStack->add_session(sprintf(__('package packageRepository contenu illisible pour %s') , $repo->title) ,'error' );
+ return false;
+ }
+
+ if(isset($Repos->error)){
+ $messageStack->add_session(sprintf(__('package packageRepository error in process for repository %s :>> %s') , $repo->repository , addslashes(self::FomatError($Repos->error )) ),'error' );
+ break;
+ }
+
+ return $Repos;
+ }
+
+ return false;
+ }
+
+
/**
- Write file xml global source respoitory
- and mise en cache
+ @brief Write file xml global source respoitory and cache
+ @param $key string key source
*/
public static function SourceUpdate(){
global $messageStack;
@@ -104,115 +149,142 @@
$channel = $dom->createElement("channel");
$rss->appendChild($channel);
- if(!$SP = simplexml_load_file(DIR_FS_ROOT_DOCS.'admin/data/'.parent::REPOSITORY_SOURCE)) throw new Exception('Fichier Source introuvable '.DIR_WS_ADMIN.DIR_WS_INCLUDES.'data/'.parent::REPOSITORY_SOURCE);
+ if(!$SP = simplexml_load_file(DIR_FS_ROOT_DOCS.'admin/data/'.parent::REPOSITORY_SOURCE))
+ throw new Exception('Fichier Source introuvable '.DIR_WS_ADMIN.DIR_WS_INCLUDES.'data/'.parent::REPOSITORY_SOURCE);
foreach($SP as $repo){
- if(!$re= fileUtility::url_fopen($repo->repository.$repo->rep_listing) ) $messageStack->add_session('recuperation repository impossible :'.$repo->repository,'error' );
- else {
+ if((string)$repo->key =='local'){
+ //! add local package
+ $locale=0;
+ foreach(scan(DIR_FS_CIP) as $item){
+ $pkg=(!is_dir(DIR_FS_CIP.$item))?substr($item, 0,(strlen($item) -4) ) : $item;
- if(!$Repos = simplexml_load_string($re)) $messageStack->add_session('Impossible lire le contenu :'.$repo->title,'error' );
- else{
- //! compteur entree / repository
- $comp=0;
- //! concatene
+ if(!isset($temparray[md5($pkg)]) && $pkg !='index.' && !empty($pkg)) {
+ $st=strpos($pkg,'_stable');
+ $unst=strpos($pkg,'_unstable');
+ if($st>0){
+ $ident=substr($pkg,0,$st);
+ $level=substr($pkg,$st+1);
+ }
+ elseif($unst>0){
+ $ident=substr($pkg,0,$unst);
+ $level=substr($pkg,$unst+1);
+ }
+ else{
+ $ident=$pkg;
+ $level='unstable';
+ }
+ $InternalID++;
+ $comp++;
+ $locale++;
+ $re="\n".'<item>'."\n".
+ '<title>'.$pkg.'</title>'."\n".
+ '<ident>'.$ident.'</ident>'."\n".
+ '<author>local</author>'."\n".
+ '<version>N/A</version>'."\n".
+ '<level>'.$level.'</level>'."\n".
+ '<checksum>'.md5(DIR_FS_CIP.$pkg).'</checksum>'."\n".
+ '<url_src></url_src>'."\n".
+ '<pid>'.$locale.'</pid>'."\n".
+ '<internalID>'.$InternalID.'</internalID>'."\n".
+ '<link></link>'."\n".
+ '<image></image>'."\n".
+ '<description>'.$ident.'</description>'."\n".
+ '<sourceTitle>'.(string)$repo->title.'</sourceTitle>'."\n".
+ '<sourceKey>'.(string)$repo->key.'</sourceKey>'."\n".
+ '</item>'."\n";
+ $res=simplexml_load_string($re);
+ $dom_sxe = dom_import_simplexml($res);
+ $dom_sxe=$dom->importNode($dom_sxe, true);
+ $channel->appendChild($dom_sxe);
+ $dom->saveXML();
+ $temparray[md5($pkg)]='';
- $objres=$Repos->channel->item;
- foreach($objres as $item){
- $item->sourceTitle=(string)$repo->title;
- $item->sourceKey=(string)$repo->key;
- $item->internalID=$InternalID;
- $comp++;
- $InternalID++;
- $dom_sxe = dom_import_simplexml($item);
- $dom_sxe=$dom->importNode($dom_sxe, true);
- $channel->appendChild($dom_sxe);
- $dom->saveXML();
+ //! mise en cache info
+ $var_file[$pkg]['last_update']= date("Y-m-d H:n:s");
+ $var_file[$pkg]['count']= $comp;
+ }
+ }
+ //! message
+ if(count($var_file)==0)
+ throw new Exception('Erreur recuperation');
+ else
+ $messageStack->add_session(sprintf(__('package packageRepository repository %supdate ok'),$repo->title) ,'success' );
- $temparray[(string)$repo->ident.'_'.(string)$repo->level]='';
- }
+ }
+ else{
- //! mise en cache info
- $var_file[(string)$repo->key]['last_update']= date("Y-m-d H:n:s");
- $var_file[(string)$repo->key]['count']= $comp;
- $var_file[(string)$repo->key]['title']= (string)$repo->title;
- $var_file[(string)$repo->key]['link']= (string)$repo->repository;
-// $var_file[(string)$repo->key]['object']=$objres;
+// if(!$re= fileUtility::url_fopen( self::HrefSrc($repo, 'listing') ) )
+// $messageStack->add_session('recuperation repository impossible :'.$repo->repository,'error' );
+// else {
+//
+// if(!$Repos = simplexml_load_string($re))
+// $messageStack->add_session('Impossible lire le contenu :'.$repo->title,'error' );
+// else
+ if($Repos = self::InitConnexion($repo, 'listing') ){
- //! message
- $messageStack->add_session(__('repository ok :').$repo->title,'success' );
- }
+ //! compteur entree / repository
+ $comp=0;
- $compteur +=$comp;
- }
+ if(!isset($Repos->channel->item))
+ return $Repos;
- //! mise en cache global
- $var_file['global']['last_update']= date("Y-m-d H:n:s");
- $var_file['global']['count']= $compteur;
-// $var_file['global']['object']=new objectInfo($globalRepository);
+ $objres=$Repos->channel->item;
+ foreach($objres as $item){
+// print_r($item);
+// exit;
+ if(!isset($temparray[md5((string)$item->ident.'_'.(string)$item->level)]) ) {
+ $item->sourceTitle=(string)$repo->title;
+ $item->sourceKey=(string)$repo->key;
+ $item->internalID=$InternalID;
+ $comp++;
+ $InternalID++;
+ $dom_sxe = dom_import_simplexml($item);
+ $dom_sxe=$dom->importNode($dom_sxe, true);
+ $channel->appendChild($dom_sxe);
+ $dom->saveXML();
+
+ $temparray[md5((string)$item->ident.'_'.(string)$item->level)]='';
+ }
+ }
+
+ //! mise en cache info
+ $var_file[(string)$repo->key]['last_update']= date("Y-m-d H:n:s");
+ $var_file[(string)$repo->key]['count']= $comp;
+ $var_file[(string)$repo->key]['title']= (string)$repo->title;
+ $var_file[(string)$repo->key]['link']= (string)$repo->repository;
+ // $var_file[(string)$repo->key]['object']=$objres;
+
+ //! message
+ $messageStack->add_session(sprintf(__('package packageRepository repository %supdate ok'),$repo->title) ,'success' );
+
+ $compteur +=$comp;
+ }
+
+
+// }
+
+
+ }
+ //! mise en cache global
+ $var_file['global']['last_update']= date("Y-m-d H:n:s");
+ $var_file['global']['count']= $compteur;
+ // $var_file['global']['object']=new objectInfo($globalRepository);
+
}
// if(count($var_file)==0) throw new Exception('Erreur recuperation');
- //! add local package
- $locale=0;
- foreach(scan(DIR_FS_CIP) as $item){
- $pkg=(!is_dir(DIR_FS_CIP.$item))?substr($item, 0,(strlen($item) -4) ) : $item;
- if(!isset($temparray[$pkg]) && $pkg !='index.' && !empty($pkg)) {
- $st=strpos($pkg,'_stable');
- $unst=strpos($pkg,'_unstable');
- if($st>0){
- $ident=substr($pkg,0,$st);
- $level=substr($pkg,$st+1);
- }
- elseif($unst>0){
- $ident=substr($pkg,0,$unst);
- $level=substr($pkg,$unst+1);
- }
- else{
- $ident=$pkg;
- $level='unstable';
- }
- $InternalID++;
- $comp++;
- $locale++;
- $re="\n".'<item>'."\n".
- '<title>'.$pkg.'</title>'."\n".
- '<ident>'.$ident.'</ident>'."\n".
- '<author>local</author>'."\n".
- '<version>N/A</version>'."\n".
- '<level>'.$level.'</level>'."\n".
- '<checksum>'.md5(DIR_FS_CIP.$pkg).'</checksum>'."\n".
- '<url_src></url_src>'."\n".
- '<pid>'.$locale.'</pid>'."\n".
- '<internalID>'.$InternalID.'</internalID>'."\n".
- '<link></link>'."\n".
- '<image></image>'."\n".
- '<description>'.$ident.'</description>'."\n".
- '<sourceTitle>local</sourceTitle>'."\n".
- '</item>'."\n";
- $res=simplexml_load_string($re);
- $dom_sxe = dom_import_simplexml($res);
- $dom_sxe=$dom->importNode($dom_sxe, true);
- $channel->appendChild($dom_sxe);
- $dom->saveXML();
- //! mise en cache info
- $var_file[$pkg]['last_update']= date("Y-m-d H:n:s");
- $var_file[$pkg]['count']= $comp;
- }
- }
- //! message
- if(count($var_file)==0) throw new Exception('Erreur recuperation');
- else $messageStack->add_session(__('repository ok :').' local','success' );
+ fileUtility::_unlink(DIR_FS_ROOT_DOCS.'admin/data/'.parent::REPOSITORY_DATA);
- @unlink(DIR_FS_ROOT_DOCS.'admin/data/'.parent::REPOSITORY_DATA);
-
- if($dom->save(DIR_FS_ROOT_DOCS.'admin/data/'.parent::REPOSITORY_DATA) !=true)throw new Exception('erreur enregistrement');
+ if($dom->save(DIR_FS_ROOT_DOCS.'admin/data/'.parent::REPOSITORY_DATA) !=true)
+ throw new Exception('erreur enregistrement');
$osCSS_Cache->writeBuffer($var_file,true);
@@ -225,6 +297,50 @@
}
+ /**
+ @brief Ajout d'un depot
+ @param $obj xml_load
+ @param $service [precise service call]
+ @return link src (string)
+ */
+ public static function HrefSrc($obj, $service=''){
+ $src = (string)$obj->repository.'?';
+
+ /// put service
+ if(!empty($service) && isset($obj->service)){
+ $src .='service='.(string)$obj->service->$service.'&';
+ }
+
+ /// put user
+ if(isset($obj->ident)){
+ $src .='user='.(string)$obj->ident->user.'&token='.(string)$obj->ident->token;
+ }
+
+ /// put local environement
+// $src .='&language='.$_SESSION['language_iso'];
+ /// put version
+ preg_match('#([0-9\.]*)#i', get_info_core( DIR_FS_ROOT_DOCS.'oscss.version.xml','version'), $match );
+ $src .='&core='.$match[1] ;
+
+ return $src;
+ }
+
+ /**
+ @brief Ajout d'un depot
+ @param $obj xml_load
+ @return link src (string)
+ */
+ private static function FomatError($obj){
+ $s = (string)$obj->text;
+
+ if(isset($obj->link)){
+ $s .='<a href="'.(string)$obj->link.'"> '.__('view').' </a>';
+ }
+
+ return $s;
+ }
+
+
}
Modified: trunk/catalog/admin/includes/languages/fr_FR/modules/pages/package.txt
===================================================================
--- trunk/catalog/admin/includes/languages/fr_FR/modules/pages/package.txt 2012-01-03 15:40:57 UTC (rev 4009)
+++ trunk/catalog/admin/includes/languages/fr_FR/modules/pages/package.txt 2012-01-05 13:20:53 UTC (rev 4010)
@@ -15,7 +15,7 @@
$lang['title heading configuration package']="Configuration de l'extension " ;
-/* Menu */
+/** Menu */
/* paquet */
$lang['image upload package']="Ajouter un paquet" ;
$lang['image package updatable']="Paquets à mettre à jour" ;
@@ -29,7 +29,7 @@
-/* listing*/
+/** listing*/
/* paquet */
$lang['table heading nom']="Nom" ;
$lang['table heading description']="Description" ;
@@ -45,7 +45,7 @@
$lang['heading source key']="Clef" ;
$lang['heading source last update']="Dernière mise a jour" ;
-/* Add */
+/** Add */
/* paquet */
$lang['title heading upload package']="Ajouter un paquet" ;
@@ -54,48 +54,65 @@
/* source */
-/* Install */
+/** UnInstall */
$lang['msg was removed']="Extension desinstallée" ;
-/* view */
+/** view */
+ /* source */
+ $lang['title heading configuration source repository edit']="Modifié un depot" ;
+ $lang['package source legend ident']="Identification" ;
+ $lang['package source legend service declared']="services declaré" ;
+ $lang['package text package user id']="Numéro d'utilisateur" ;
+ $lang['package text package token']="Clef utilisateur" ;
+ $lang['package src url']="Url du dêpot" ;
- /* bouton */
- $lang['image cip install']="Installer cette extension " ;
- /* text */
- $lang['package heading title detail']="Detail du paquet" ;
- $lang['package heading title detail logs']="Detail des logs et nodes" ;
+ /* paquet */
+ /* bouton */
+ $lang['image cip install']="Installer cette extension " ;
+ /* text */
+ $lang['package heading title detail']="Detail du paquet" ;
+ $lang['package heading title detail logs']="Detail des logs et nodes" ;
- $lang['text info support']="Support " ;
- $lang['text info contrib']="Detail du paquet " ;
+ $lang['text info support']="Support " ;
+ $lang['text info contrib']="Detail du paquet " ;
- $lang['contribs page oscss']="osCSSS.org page de support" ;
- $lang['contribs cip pkg']="osCSS.org page" ;
+ $lang['contribs page oscss']="osCSSS.org page de support" ;
+ $lang['contribs cip pkg']="osCSS.org page" ;
-
-/* install */
+/** install */
/* bouton */
$lang['config extension']="Configurer cette extension " ;
/* text */
$lang['package heading title install']="installation du paquet" ;
$lang['package heading title install logs']="Detail des logs et nodes de l'installation" ;
+ /* errors / alert / message */
+ $lang['packageInstaller download file exts good']="Extension téléchargé" ;
+ $lang['packageInstaller error recup zip url']="Erreur lors de la récuperation du paquet" ;
-
-
-/* view config */
+/** view config */
/* bouton */
// $lang['config extension']="Configurer cette extension " ;
/* text */
$lang['package text frontend']="Frontend / public " ;
- $lang['package text frontend']="Backend / private " ;
+ $lang['package text backend']="Backend / private " ;
+/** update source */
+ /* errors / alert / message */
+ $lang['package packageRepository error in process for repository %s :>> %s']="Erreur lors de la recuperation du depot<strong>%s</strong>; message d'erreur retourné : %s" ;
+ $lang['package packageRepository contenu illisible pour %s']="Erreur sur la lecture du depot <strong>%s</strong>" ;
+
+
+ $lang['package packageRepository repository %supdate ok']="Récuperation du depot <strong>%s</strong> effectué" ;
+
+
/*
$lang['contribs cip pkg']="contribs cip pkg" ;
- $lang['contribs cip pkg']="contribs cip pkg" ;*/
+;*/
$lang['contribs contrib_type']="Type " ;
$lang['contribs status']="Etat " ;
Modified: trunk/catalog/admin/includes/modules/pages/package.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/package.php 2012-01-03 15:40:57 UTC (rev 4009)
+++ trunk/catalog/admin/includes/modules/pages/package.php 2012-01-05 13:20:53 UTC (rev 4010)
@@ -34,7 +34,8 @@
*/
const FILENAME = FILENAME_PACKAGE;
/**
- @var obj
+ @var obj for one result or array( obj, obj ) for mutli result
+ @brief this var is modified by childs class package
*/
public static $FeedItem;
/**
@@ -112,11 +113,11 @@
self::$code=__CLASS__;
self::$action=(isset($_REQUEST['action'])? $_REQUEST['action'] : 'listing' );
- self::$type_data=(isset($_GET['type_data'])?$_GET['type_data']:'package');
+ self::$type_data=(isset($_GET['type_data'])?$_GET['type_data']: 'package');
$mode=(isset($_GET['mode'])?$_GET['mode']:'');
+// var_dump( self::$type_data);
-
/**
@remarks not load if not first init
*/
@@ -150,7 +151,34 @@
global $messageStack;
switch(self::$action){
+ case 'source_test';
+ if(isset($_GET['mode'])) {
+//
+// if(self::$objChild->SourceUpdate()==true)
+// InitConnexion($repo, $action = '')
+ }
+
+// tep_redirect(tep_href_link(self::FILENAME), 'type_data=source');
+ break;
+
+
+ case 'source_synchro';
+ if(isset($_GET['key'])) {
+//
+// if(self::$objChild->SourceUpdate()==true)
+
+// if(self::$objChild->SourceUpdate()==true)
+
+//
+ }
+
+ if(!isset($_GET['forceajax']))
+ tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cPath','pID','setflag','flag'), false) ));
+// tep_redirect(tep_href_link(self::FILENAME), 'type_data=source');
+ break;
+
case 'source_update':
+// // self::$objChild->SourceUpdate();
if(self::$objChild->SourceUpdate()==true)
tep_redirect(tep_href_link(self::FILENAME));
break;
@@ -234,24 +262,34 @@
self::load_repository();
+
//! recup element pkg
foreach(self::$FeedItem as $item){
if((int)$pkg_code == (int)$item->internalID)$ObjPkg =$item;
}
//! recup depot, si != local ; local pas info supp
- if((string)$ObjPkg->sourceTitle !='local') {
+ if((string)$ObjPkg->sourceKey !='local') {
$class=__CLASS__.'Repository';
if(!class_exists($class) && !tep_class_exists('exts_'.__CLASS__.'_'.$class)) return false;
$obj=new $class;
$ObjDepot=call_user_func(array($obj, 'SourceLoadByKey'),(string)$ObjPkg->sourceKey);
+
try{
//! load xml file
- if(!$Parser = @simplexml_load_file((string)$ObjDepot->repository.(string)$ObjDepot->rep_detail.'&pid='.(int)$ObjPkg->pid) ) throw new Exception('Flux introuvable');
+ if(!$Parser = @simplexml_load_file(packageRepository::HrefSrc($ObjDepot, 'view').'&pid='.(int)$ObjPkg->pid) )
+ throw new Exception('Flux introuvable');
$FeedItem = $Parser->xpath('channel');
+ $FeedItem[0]->item->url_download = packageRepository::HrefSrc($ObjDepot, 'download').'&pid='.(int)$ObjPkg->pid;
+ $FeedItem[0]->item->ident = (string)$ObjPkg->ident;
+ $FeedItem[0]->item->level = (string)$ObjPkg->level;
+ $FeedItem[0]->item->sourceKey =(string)$ObjPkg->sourceKey ;
+ $FeedItem[0]->item->sourceTitle =(string)$ObjPkg->sourceTitle ;
+ $FeedItem[0]->item->internalID =(string)$ObjPkg->internalID ;
+
return $FeedItem;
}
catch(Exception $e){
@@ -259,8 +297,9 @@
}
}
//! local depot
- elseif((string)$ObjPkg->sourceTitle =='local')
- return array(new objectInfo(array('item'=>$ObjPkg)));
+ elseif((string)$ObjPkg->sourceKey =='local'){
+ return array(new objectInfo(array('item'=>$ObjPkg)) );
+ }
}
@@ -292,7 +331,8 @@
Mise à jour cache paquet installed / updatable / non install
*/
foreach($Feed as $item){
-
+// print_r($item);
+// exit;
$item->etat=(self::pkg_is_installed($item->ident.'_'.$item->level)? 1 : 0);
switch($mode){
@@ -330,19 +370,42 @@
switch(self::$action){
//! source repository
+ /**
+ @remarks Ajax View result
+ */
+
+
+ /**
+ @remarks Normal display
+ */
case 'source_update':
break;
case 'source_add':
$action='edit';
break;
+ case 'source_edit':
+ $class=self::$code.'Repository';
+ if(!tep_class_exists('exts_'.self::$code.'_'.$class)) return false;
+ $obj=new $class;
+ self::$list=$obj->SourceLoad((string)$_GET['key']);
+ $action='edit';
+ break;
+
+
+
//! paquets
+ /**
+ @remarks Ajax View result
+ */
case 'setflag':
return self::status_flag((int)$_GET['flag'],'dbset='.(int)$_GET['dbset']);
break;
-
+ /**
+ @remarks Normal display
+ */
case 'upload':
break;
@@ -413,40 +476,55 @@
}
private static function get_item_action($pkg, $pkg_full, $url_pck, $pkgobj){
- return sprintf(
- CsrtAction::getFormat('row_action'),
- '' ,
- (($pkgobj->etat==1)
- ?
- sprintf(CsrtAction::getLink('row_action_right', __('icon remove'), 'install'), '', tep_href_link(self::FILENAME,'action=remove&pkgID='.urlencode($pkg_full)) ,'' ).
- sprintf(CsrtAction::getLink('row_action_right', __('image edit'), 'edit'), '', tep_href_link(self::FILENAME,'action=config&class='.$pkg) ,'' )
- :
- sprintf(CsrtAction::getLink('row_action_right', __('icon install'), 'remove'), '', tep_href_link(self::FILENAME,'action=download&pkgID='.urlencode($pkg_full)) ,'' )
- )
- );
+// var_dump(self::$type_data);
+// exit;
+ switch(self::$type_data){
+ case 'source':
+ return sprintf(
+ CsrtAction::getFormat('row_action'),
+ '' ,
+ sprintf(CsrtAction::getLink('row_action_right', __('image synchro'), 'synchro'), 'fancy', tep_href_link(self::FILENAME,'type_data=source&action=source_synchro&key='.$pkgobj->key) ,'' ).
+ sprintf(CsrtAction::getLink('row_action_right', __('image edit'), 'edit'), '', t...
[truncated message content] |
|
From: <os...@us...> - 2012-01-07 08:27:43
|
Revision: 4012
http://oscss.svn.sourceforge.net/oscss/?rev=4012&view=rev
Author: oscim
Date: 2012-01-07 08:27:36 +0000 (Sat, 07 Jan 2012)
Log Message:
-----------
coquille
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/drivers/sqlcip.php
trunk/catalog/admin/includes/widget/homeStock.php
trunk/catalog/install/includes/sql/mysql/data/91_osc_admin_cip.sql
Modified: trunk/catalog/admin/includes/classes/drivers/sqlcip.php
===================================================================
--- trunk/catalog/admin/includes/classes/drivers/sqlcip.php 2012-01-05 17:01:17 UTC (rev 4011)
+++ trunk/catalog/admin/includes/classes/drivers/sqlcip.php 2012-01-07 08:27:36 UTC (rev 4012)
@@ -7,15 +7,15 @@
@date 03/01/12, 08:07
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class sqlcip_modfiles
- @file sqlcip_modfiles.php
+ @class sqlcip
+ @file sqlcip.php
@brief manage insert/update/delete in zone tables
*/
-define('TABLE_MODFILES', DB_TABLE_PREFIX . 'admin_cip_modfiles');
+// define('TABLE_CIP', DB_TABLE_PREFIX . 'admin_cip');
-class sqlcip_modfiles
+class sqlcip
implements ModSqlDataDriver{
public static $modules;
@@ -38,21 +38,24 @@
public static function create($option){
self::getInstance();
- if(!isset($option['cip_id']))
- return 'cip_id';
+ if(!isset($option['ident']))
+ return 'ident';
+ preg_match('#([a-zA-Z0-9_-]*)_(unstable|stable|test)#i', trim($option['ident']), $match);
- $sql_data_array['k_cip_id'] = tep_db_prepare_input($option['cip_id']);
- $sql_data_array['cip_filename'] = tep_db_prepare_input($option['filename']);
- $sql_data_array['cip_folder'] = tep_db_prepare_input($option['folder']);
- $sql_data_array['cip_type'] = tep_db_prepare_input($option['type']);
- $sql_data_array['cip_typetype'] = tep_db_prepare_input($option['typetype']);
- $sql_data_array['core'] = tep_db_prepare_input($option['core']);
- $sql_data_array['cip_install'] = tep_db_prepare_input($option['install']);
+ $sql_data_array['cip_ident'] = tep_db_prepare_input($match[1]);
+ $sql_data_array['cip_checksum'] = tep_db_prepare_input(md5($match[1]));
+ $sql_data_array['cip_level'] = tep_db_prepare_input($match[2] );
- $res=tep_db_perform(TABLE_MODFILES, $sql_data_array);
+ $sql_data_array['cip_folder_name'] = tep_db_prepare_input($option['folder_name']);
+ $sql_data_array['cip_installed'] = tep_db_prepare_input($option['installed']);
+ $sql_data_array['cip_version'] =(!isset($option['version'])? tep_db_prepare_input($option['version']): '0.0.1') ;
+
+
+ $res=tep_db_perform(TABLE_CIP, $sql_data_array);
+
if(!$res)
return $res;
else
@@ -69,20 +72,16 @@
return 'id';
$where ='';
- if(isset($option['id'])) $where .="AND rowid = '".(int)$option['id']."' ";
- if(isset($option['cip_id'])) $where .="AND k_cip_id = '".(int)$option['cip_id']."' ";
+ if(isset($option['id'])) $where .="AND cip_id = '".(int)$option['id']."' ";
+ if(isset($option['ident'])) $where .="AND cip_ident = '".(int)$option['ident']."' ";
- if(isset($option['new_cip_id'])) $sql_data_array['k_cip_id'] = tep_db_prepare_input($option['cip_id']);
+ if(isset($option['folder_name']))$sql_data_array['cip_folder_name'] = tep_db_prepare_input($option['folder_name']);
+ if(isset($option['installed'])) $sql_data_array['cip_installed'] = tep_db_prepare_input($option['installed']);
+ if(isset($option['version'])) $sql_data_array['cip_version'] = tep_db_prepare_input($option['version']);
+// if(isset($option['level'])) $sql_data_array['cip_level'] = tep_db_prepare_input($option['level']);
- if(isset($option['filename'])) $sql_data_array['cip_filename'] = tep_db_prepare_input($option['filename']);
- if(isset($option['folder'])) $sql_data_array['cip_folder'] = tep_db_prepare_input($option['folder']);
- if(isset($option['type'])) $sql_data_array['cip_type'] = tep_db_prepare_input($option['type']);
- if(isset($option['typetype'])) $sql_data_array['cip_typetype'] = tep_db_prepare_input($option['typetype']);
- if(isset($option['core'])) $sql_data_array['core'] = tep_db_prepare_input($option['core']);
- if(isset($option['install'])) $sql_data_array['cip_install'] = tep_db_prepare_input($option['install']);
+ $res=tep_db_perform(TABLE_CIP, $sql_data_array, 'update' , substr($where,3) );
- $res=tep_db_perform(TABLE_MODFILES, $sql_data_array, 'update' , substr($where,3) );
-
return $res;
}
@@ -112,22 +111,19 @@
$DB=Database::getInstance();
$sql ="";
- if(isset($option['id'])) $sql .="AND rowid = '".(int)$option['id']."' ";
- if(isset($option['cip_id'])) $sql .="AND k_cip_id = '".(int)$option['cip_id']."' ";
- if(isset($option['type'])) $sql .="AND cip_type = '".(string)$option['type']."' ";
- if(isset($option['typetype'])) $sql .="AND cip_typetype = '".(string)$option['typetype']."' ";
- if(isset($option['core'])) $sql .="AND core = '".(int)$option['core']."' ";
- if(isset($option['filename'])) $sql .="AND cip_filename = '".(string)$option['filename']."' ";
- if(isset($option['folder'])) $sql .="AND cip_folder = '".(string)$option['folder']."' ";
+ if(isset($option['id'])) $sql .="AND cip_id = '".(int)$option['id']."' ";
+ if(isset($option['ident'])) $sql .="AND ( cip_ident = '".(string)$option['ident']."' OR cip_checksum = '".(string)md5($option['ident'])."' ) ";
+ if(isset($option['level'])) $sql .="AND cip_level = '".(string)$option['level']."' ";
+
if($sql=='')
return false;
- $sql="SELECT * FROM " . TABLE_MODFILES . " a ".
+ $sql="SELECT * FROM " . TABLE_CIP . " a ".
// " LEFT JOIN " . TABLE_IMAGES_USED . " g ON (a.rowid=g.rowid) ".
" WHERE ".substr($sql,3);
-// echo '<br>';
+
$res=$DB->query($sql);
$num = $res->__get('numRows');
@@ -157,14 +153,24 @@
$sql ="";
- if(isset($option['id'])) $sql .="AND rowid = '".(int)$option['id']."' ";
- if(isset($option['cip_id'])) $sql .="AND k_cip_id = '".(int)$option['cip_id']."' ";
+ if(isset($option['id'])) $sql .="AND cip_id = '".(int)$option['id']."' ";
+ if(isset($option['ident'])) $sql .="AND cip_ident = '".(int)$option['ident']."' ";
+ if(isset($option['level'])) $sql .="AND cip_level = '".(string)$option['level']."' ";
+
if(strlen($sql) < 5)
return false;
- $DB->query($s="DELETE FROM " . TABLE_MODFILES ." WHERE ". substr($sql,3) );
+ $res = $DB->query($s="SELECT cip_id FROM " . TABLE_CIP ." WHERE ". substr($sql,3) );
+ $row=$res->fetchAssoc();
+
+ // depend tables
+ sqlcip_modfiles::delete(array('cip_id'=>$row['cip_id']));
+
+
+ $DB->query($s="DELETE FROM " . TABLE_CIP ." WHERE ". substr($sql,3) );
+
return true;
}
@@ -174,14 +180,13 @@
@return array product empty
*/
public static function Specimen($shortkey=false){
- $par = array('rowid' => '',
- 'k_cip_id' => '',
- 'cip_filename' => '',
- 'cip_folder' => '',
- 'cip_type' => '',
- 'cip_typetype' => '',
- 'core' => '',
- 'cip_install' => '',
+ $par = array('cip_id' => '',
+ 'cip_checksum' => '',
+ 'cip_folder_name' => '',
+ 'cip_installed' => '',
+ 'cip_ident' => '',
+ 'cip_version' => '',
+ 'cip_level' => '',
);
return ((!$shortkey)? $par : self::CleanKey($par));
@@ -198,11 +203,7 @@
$object= new stdclass();
foreach($array as $key=>$value){
- if( strpos($key,'k_') ===0)
- $key=substr($key,2);
- elseif( $key == 'rowid' )
- $key='id';
- elseif( strpos($key,'cip_') ===0)
+ if( strpos($key,'cip_') ===0)
$key=substr($key,4);
$object->$key = $value;
Modified: trunk/catalog/admin/includes/widget/homeStock.php
===================================================================
--- trunk/catalog/admin/includes/widget/homeStock.php 2012-01-05 17:01:17 UTC (rev 4011)
+++ trunk/catalog/admin/includes/widget/homeStock.php 2012-01-07 08:27:36 UTC (rev 4012)
@@ -1,10 +1,10 @@
<?php
/**
- @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 23/10/11, 11:36
+ @date 06/01/12, 11:36
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -13,14 +13,16 @@
if(!_cst_bool('STOCK_CHECK'))
return false;
-?>
-<div id="homeStock" class="<?php echo $widg['class'] ?>">
- <h3><a href="<?php echo tep_href_link(FILENAME_STATS,'module=stats_low_stock_attrib') ?>"><?php echo __('heading stock') ;?></a></h3>
-<?php
if(!class_exists('tracked_stock'))require_once(DIR_WS_CLASSES . 'tracked_stock.php');
$tracked_stock = new tracked_stock();
$l=$tracked_stock->db_low_stock();
+
+if(!is_array($l) || count($l) <=0)
+ return false;
?>
+<div id="homeStock" class="<?php echo $widg['class'] ?>">
+ <h3><a href="<?php echo tep_href_link(FILENAME_STATS,'module=stats_low_stock_attrib') ?>"><?php echo __('heading stock') ;?></a></h3>
+
<ul>
<?php foreach(@$l as $p) : ?>
<?php if(isset($p['option']) && is_array($p['option'])) { ?>
Modified: trunk/catalog/install/includes/sql/mysql/data/91_osc_admin_cip.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/data/91_osc_admin_cip.sql 2012-01-05 17:01:17 UTC (rev 4011)
+++ trunk/catalog/install/includes/sql/mysql/data/91_osc_admin_cip.sql 2012-01-07 08:27:36 UTC (rev 4012)
@@ -17,7 +17,7 @@
INSERT INTO osc_admin_cip (cip_id, cip_checksum, cip_folder_name, cip_installed, cip_ident, cip_version, cip_level) VALUES (2, '4f88808dacb5a4460eb57bdd1dc3189b', 'ADDRESS_BOOK_stable', 1, 'ADDRESS_BOOK', '1.0', 'stable');
INSERT INTO osc_admin_cip (cip_id, cip_checksum, cip_folder_name, cip_installed, cip_ident, cip_version, cip_level) VALUES (3, 'eec88916a23139e55400cf0dd834856f', 'DESC_BASE_stable', 1, 'DESC_BASE', '1.0', 'stable');
INSERT INTO osc_admin_cip (cip_id, cip_checksum, cip_folder_name, cip_installed, cip_ident, cip_version, cip_level) VALUES (4, '451a84aa41e342884b84890af7cf69e7', 'HEADER_TAGS_stable', 1, 'HEADER_TAGS', '1.0', 'stable');
-INSERT INTO osc_admin_cip (cip_id, cip_checksum, cip_folder_name, cip_installed, cip_ident, cip_version, cip_level) VALUES (5, 'e62f47533278a4cacb1c9324a1aa7f27', 'ACCOUNT_EXTRA_stable', 1, 'ACCOUNT_EXTRA', '1.0'), 'stable';
+INSERT INTO osc_admin_cip (cip_id, cip_checksum, cip_folder_name, cip_installed, cip_ident, cip_version, cip_level) VALUES (5, 'e62f47533278a4cacb1c9324a1aa7f27', 'ACCOUNT_EXTRA_stable', 1, 'ACCOUNT_EXTRA', '1.0', 'stable');
INSERT INTO osc_admin_cip (cip_id, cip_checksum, cip_folder_name, cip_installed, cip_ident, cip_version, cip_level) VALUES (6, 'a72e4a34f10af98a9814d865e717399f', 'SPECIAL_stable', 1, 'SPECIAL', '1.0', 'stable');
INSERT INTO osc_admin_cip (cip_id, cip_checksum, cip_folder_name, cip_installed, cip_ident, cip_version, cip_level) VALUES (7, '1415dd6d4b211ace908a6ac84621f88a', 'SVNUPDATE_unstable', 1, 'SVNUPDATE', '1.0', 'unstable');
INSERT INTO osc_admin_cip (cip_id, cip_checksum, cip_folder_name, cip_installed, cip_ident, cip_version, cip_level) VALUES (8, 'da8a0d4a6c802e4d0bb48065258582b1', 'SPU_stable', 1, 'SPU', '1.0', 'stable');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-01-09 16:26:49
|
Revision: 4013
http://oscss.svn.sourceforge.net/oscss/?rev=4013&view=rev
Author: oscim
Date: 2012-01-09 16:26:38 +0000 (Mon, 09 Jan 2012)
Log Message:
-----------
coquille
Modified Paths:
--------------
trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab
trunk/catalog/admin/includes/gabarit/header_tags.form.gab
trunk/catalog/common/classes/image_ratio.php
trunk/catalog/includes/application_top.php
trunk/catalog/includes/classes/split_page_results.php
trunk/catalog/includes/modules/products/desc_base.php
Modified: trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab 2012-01-07 08:27:36 UTC (rev 4012)
+++ trunk/catalog/admin/includes/gabarit/cms_content/display_view.edit.gab 2012-01-09 16:26:38 UTC (rev 4013)
@@ -1,10 +1,10 @@
<?php
/**
- @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.0
- @date 07/02/11, 19:18
+ @version 2.1.1
+ @date 09/01/12, 19:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -33,7 +33,7 @@
<div class="tabs_lang">
<ul>
<?php for ($i=0, $n=sizeof(cms_content::$languages); $i<$n; $i++) { ?>
- <li><a href="#fieldset_<?php echo $i ?>"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . cms_content::$languages[$i]['directory'] . '/images/' . cms_content::$languages[$i]['image'], cms_content::$languages[$i]['name']); ?></a></li>
+ <li><a href="#fieldset_<?php echo $i ?>"><?php echo tep_language_image(cms_content::$languages[$i]['directory'] . '/images/' . cms_content::$languages[$i]['image'], cms_content::$languages[$i]['name']); ?></a></li>
<?php } ?>
</ul>
Modified: trunk/catalog/admin/includes/gabarit/header_tags.form.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/header_tags.form.gab 2012-01-07 08:27:36 UTC (rev 4012)
+++ trunk/catalog/admin/includes/gabarit/header_tags.form.gab 2012-01-09 16:26:38 UTC (rev 4013)
@@ -1,10 +1,10 @@
<?php
/**
- @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.0.9
- @date 29/08/10, 14:32
+ @version 2.1.1
+ @date 09/01/12, 19:18
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -13,7 +13,7 @@
<ul>
<?php for ($i=0, $n=sizeof(header_tags::$languages); $i<$n; $i++): ?>
<li>
- <a href="#content_head-<?php echo ($i+1) ?>" ><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . header_tags::$languages[$i]['directory'] . '/images/' . header_tags::$languages[$i]['image'], header_tags::$languages[$i]['name']) . ' ' . header_tags::$languages[$i]['name'] ?></a>
+ <a href="#content_head-<?php echo ($i+1) ?>" ><?php echo tep_language_image(header_tags::$languages[$i]['directory'] . '/images/' . header_tags::$languages[$i]['image'], header_tags::$languages[$i]['name']) . ' ' . header_tags::$languages[$i]['name'] ?></a>
</li>
<?php endfor; ?>
</ul>
@@ -22,7 +22,7 @@
<div id="content_head-<?php echo ($i+1) ?>">
<fieldset>
<legend>
- <?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . header_tags::$languages[$i]['directory'] . '/images/' . header_tags::$languages[$i]['image'], header_tags::$languages[$i]['name']) . ' ' . header_tags::$languages[$i]['name'] ?>
+ <?php echo tep_language_image( header_tags::$languages[$i]['directory'] . '/images/' . header_tags::$languages[$i]['image'], header_tags::$languages[$i]['name']) . ' ' . header_tags::$languages[$i]['name'] ?>
</legend>
<label for="<?php echo 'header_tags' ?>_content_head_title_tag_<?php echo header_tags::$languages[$i]['id'] ?>"><?php echo __('text htc page title').tep_image(DIR_WS_ICONS .'icon_help.gif', __('text products page title help')) ?></label>
Modified: trunk/catalog/common/classes/image_ratio.php
===================================================================
--- trunk/catalog/common/classes/image_ratio.php 2012-01-07 08:27:36 UTC (rev 4012)
+++ trunk/catalog/common/classes/image_ratio.php 2012-01-09 16:26:38 UTC (rev 4013)
@@ -353,9 +353,11 @@
if (self::$env->inadmin){
self::$CacheImage[self::$key]['conf']['mode']='BO';
if(strpos($src, DIR_WS_ADMIN)===false && strpos($src, DIR_WS_CATALOG)===false && file_exists(DIR_FS_ADMIN.$src)) $src_dir = $src;
- elseif (strpos($src, DIR_WS_ADMIN) >0 || ( strpos($src, DIR_WS_IMAGES) ==0 && file_exists(DIR_FS_ADMIN.$src) ) ) $src_dir = DIR_FS_ADMIN . $src;
+ elseif (strpos('_'.$src, DIR_WS_ADMIN) >0 || ( strpos('_'.$src, DIR_WS_IMAGES) >0 && file_exists(DIR_FS_ADMIN.$src) ) ) $src_dir = DIR_FS_ADMIN . $src;
elseif(strpos($src, DIR_WS_CATALOG)===false ) $src_dir = DIR_FS_ROOT_DOCS . $src;
else $src_dir = DIR_FS_ROOT_DOCS . substr ($src, (strrpos (DIR_WS_CATALOG , '/'))+1);
+
+// var_dump($src_dir);
}
else {
self::$CacheImage[self::$key]['conf']['mode']='FO';
@@ -504,9 +506,10 @@
@param string pathname
*/
private static function CleanPathReturn($img){
-
- $ws_=(strpos($img, DIR_WS_CATALOG)===false)?false:true;
- $ws_admin=(self::$env->inadmin && strpos($img, DIR_WS_ADMIN)===false )?false:true;
+// echo $img.'<br>';
+// var_dump(strpos('_'.$img, DIR_WS_ADMIN));
+ $ws_=(strpos('_'.$img, DIR_WS_CATALOG) >0)?false:true;
+ $ws_admin=(self::$env->inadmin && strpos('_'.$img, DIR_WS_ADMIN) >0 )?false:true;
$ws_lg=(strpos($img, DIR_WS_LANGUAGES)===false)?false:true;
$ws_img=(strpos($img, DIR_WS_IMAGES)===false)?false:true;
@@ -516,7 +519,9 @@
$image.=DIR_WS_CATALOG;
$mask .='(.*'.DIR_WS_CATALOG.'){0,1}';
}
- if(self::$env->inadmin && $ws_admin) $image.=DIR_WS_ADMIN;
+// if(self::$env->inadmin && $ws_admin)
+// $image.=DIR_WS_ADMIN;
+
if($ws_lg){
$image.=DIR_WS_LANGUAGES;
$mask .='(.*'.DIR_WS_LANGUAGES.'){0,1}';
@@ -527,7 +532,7 @@
}
$image.=preg_replace('#'.$mask.'#i','',$img);
-
+// echo $image.'<br>';
return $image;
}
Modified: trunk/catalog/includes/application_top.php
===================================================================
--- trunk/catalog/includes/application_top.php 2012-01-07 08:27:36 UTC (rev 4012)
+++ trunk/catalog/includes/application_top.php 2012-01-09 16:26:38 UTC (rev 4013)
@@ -238,7 +238,7 @@
if(isset($_GET['admin']) )header("Location: /");
}
}
- elseif( isset($_GET['admin']) && $_GET['admin'] !=md5($SecuKey)) {
+ elseif( isset($_GET['admin']) && $_GET['admin'] ==md5($SecuKey)) {
tep_session_register('aauth');
$aauth = 'yes';
// force redirect by not GET
Modified: trunk/catalog/includes/classes/split_page_results.php
===================================================================
--- trunk/catalog/includes/classes/split_page_results.php 2012-01-07 08:27:36 UTC (rev 4012)
+++ trunk/catalog/includes/classes/split_page_results.php 2012-01-09 16:26:38 UTC (rev 4013)
@@ -1,9 +1,10 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2009 The osCSS developers - osCSS Open Source E-commerce
- @package oscss-2 <www http://www.oscss.org>
- @version Rc-3
- @date 25/04/10, 12:29
+ \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 06/01/12, 11:16
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -11,12 +12,12 @@
*/
class splitPageResults {
- var $sql_query;
- var $number_of_rows;
- var $current_page_number;
- var $number_of_pages;
- var $number_of_rows_per_page;
- var $page_name;
+ public $sql_query;
+ public $number_of_rows;
+ public $current_page_number;
+ public $number_of_pages;
+ public $number_of_rows_per_page;
+ public $page_name;
/* class constructor */
function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page') {
@@ -54,12 +55,18 @@
$count_string = ' '.tep_db_input($count_key).'';
- if (strpos($this->SQL_QUERY, 'DISTINCT') || strpos($this->SQL_QUERY, 'GROUP BY')) $sql="SELECT DISTINCT COUNT(" . $count_string . ") AS total " . substr($this->sql_query, $pos_from, ($pos_to - $pos_from));
- else $sql="SELECT COUNT(" . $count_string . ") AS total " . substr($this->sql_query, $pos_from, ($pos_to - $pos_from));
+// if (strpos($this->SQL_QUERY, 'DISTINCT') || strpos($this->SQL_QUERY, 'GROUP BY')) $sql="SELECT DISTINCT COUNT(" . $count_string . ") AS total " . substr($this->sql_query, $pos_from, ($pos_to - $pos_from));
+// else $sql="SELECT COUNT(" . $count_string . ") AS total " . substr($this->sql_query, $pos_from, ($pos_to - $pos_from));
+ if (strpos($this->SQL_QUERY, 'DISTINCT') || strpos($this->SQL_QUERY, 'GROUP BY')) $sql="SELECT DISTINCT " . $count_string . " " . substr($this->sql_query, $pos_from, ($pos_to - $pos_from));
+ else $sql="SELECT " . $count_string . " " . substr($this->sql_query, $pos_from, ($pos_to - $pos_from));
+
+
$count_query = tep_db_query($sql);
+// $res_count = $count_query->fetchAssoc();
- $this->number_of_rows = tep_db_num_rows($count_query);
+// $this->number_of_rows = $res_count['total'];
+ $this->number_of_rows =$count_query->__get('numRows'); //tep_db_num_rows($count_query);
$this->number_of_pages = ceil($this->number_of_rows / $this->number_of_rows_per_page);
Modified: trunk/catalog/includes/modules/products/desc_base.php
===================================================================
--- trunk/catalog/includes/modules/products/desc_base.php 2012-01-07 08:27:36 UTC (rev 4012)
+++ trunk/catalog/includes/modules/products/desc_base.php 2012-01-09 16:26:38 UTC (rev 4013)
@@ -1,10 +1,10 @@
<?php
/**
- \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.0.9
- \date 24/08/10, 11:16
+ \version 2.1.1
+ \date 06/01/12, 11:16
\author oscim <mail aur...@os...> <www http://www.oscim.fr>
\encode UTF-8
\class desc_base
@@ -15,11 +15,14 @@
implements InterfaceModule {
/**
- Var access in .gab
+ @var access in .gab
*/
public static $products_description;
/**
- *
+ @var access in .gab
+ */
+ public static $products_chapo;
+ /**
* @var string
*/
public static $products_url;
@@ -52,9 +55,9 @@
$c=explode('<img',$this->content['products_description']);
foreach($c as $l){
if( (preg_match_all('/src=.([a-zA-Z0-9.:\/_-]*)/i', strip_tags($l) , $match)) !=false){
- $lg=strlen(HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES);
- $img=substr($match[1][0], ( (substr($match[1][0],0, $lg)==HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES) ? $lg :strlen(DIR_WS_IMAGES) ) );
- if(!in_array( $img,$page->product->pile_img)) $page->product->pile_img[]=$img;
+ $lg=strlen(HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES);
+ $img=substr($match[1][0], ( (substr($match[1][0],0, $lg)==HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES) ? $lg :strlen(DIR_WS_IMAGES) ) );
+ if(!in_array( $img,$page->product->pile_img)) $page->product->pile_img[]=$img;
}
}
}
@@ -66,21 +69,23 @@
*/
public function load_db_values($pID){
$DB=Database::getInstance();
- $product_query = $DB->query("select pd.products_id, pd.language_id, pd.products_name , pd.products_description,pd.products_url from " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id= '" . $pID . "' and language_id='".$this->language_id."' ");
+ $product_query = $DB->query("select pd.products_id, pd.language_id, pd.products_name , pd.products_description, products_chapo, pd.products_url from " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id= '" . $pID . "' and language_id='".$this->language_id."' ");
$this->content=$product_query->fetchAssoc();
+
+ self::$products_description= $this->content['products_description'];
+ self::$products_chapo= $this->content['products_chapo'];
+ self::$products_url= $this->content['products_url'];
+
}
/**
* \brief display
- * @param $pID int product id
+ * @param $pID int product id
* @param $class null
*/
public function display_view($pID,$class=''){
$this->load_db_values((int)$pID);
- self::$products_description= $this->content['products_description'];
- self::$products_url= $this->content['products_url'];
-
$v=$this->content;
$v['title']=__('tab products desc base');
$v['content']=tep_output_string_protected(tep_get_include_contents(__CLASS__.'.'.__FUNCTION__), false, true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-01-11 10:28:46
|
Revision: 4015
http://oscss.svn.sourceforge.net/oscss/?rev=4015&view=rev
Author: oscim
Date: 2012-01-11 10:28:36 +0000 (Wed, 11 Jan 2012)
Log Message:
-----------
correction coquille
correction erreur logique dans le process de boucle des boxes et modules utilis?\195?\169 dans le template
Modified Paths:
--------------
trunk/catalog/download.php
trunk/catalog/includes/functions/template.php
trunk/catalog/includes/languages/fr_FR/fr_FR.php
Modified: trunk/catalog/download.php
===================================================================
--- trunk/catalog/download.php 2012-01-10 14:05:54 UTC (rev 4014)
+++ trunk/catalog/download.php 2012-01-11 10:28:36 UTC (rev 4015)
@@ -1,30 +1,36 @@
<?php
/**
- *\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 31/10/10, 22:59
+ *\version 2.1.2
+ *\date 10/01/12, 22:59
*\author oscim <mail aur...@os...> <www http://www.oscim.fr>
*\encode UTF-8
*\file
- *\dir catalog/
+ *\dir catalog/
*\brief page process download products; No display
*/
include('includes/application_top.php');
$page->init(basename(__FILE__),$language);
- if (!tep_session_is_registered('customer_id')) die;
+ if (!tep_session_is_registered('customer_id'))
+ tep_redirect(FILENAME_DEFAULT);
// Check download.php was called with proper GET parameters
if ((isset($_GET['order']) && !is_numeric($_GET['order'])) || (isset($_GET['id']) && !is_numeric($_GET['id'])) ) {
- die;
+ tep_redirect(FILENAME_DEFAULT);
}
-
+
// Check that order_id, customer_id and filename match
$downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . $customer_id . "' and o.orders_id = '" . (int)$_GET['order'] . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '" . (int)$_GET['id'] . "' and opd.orders_products_filename != ''");
- if (!tep_db_num_rows($downloads_query)) die;
+
+
+ if (!tep_db_num_rows($downloads_query))
+ tep_redirect(FILENAME_DEFAULT);
+
+
$downloads = tep_db_fetch_array($downloads_query);
// MySQL 3.22 does not have INTERVAL
list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);
@@ -36,7 +42,7 @@
if ($downloads['download_count'] <= 0) die;
// Die if file is not there
if (!file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) die;
-
+
// Now decrement counter
tep_db_query("update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_count = download_count-1 where orders_products_download_id = '" . (int)$_GET['id'] . "'");
@@ -71,7 +77,7 @@
if ($file == '.' || $file == '..') continue;
@unlink($dir . $subdir . '/' . $file);
}
- closedir($h2);
+ closedir($h2);
@rmdir($dir . $subdir);
}
closedir($h1);
Modified: trunk/catalog/includes/functions/template.php
===================================================================
--- trunk/catalog/includes/functions/template.php 2012-01-10 14:05:54 UTC (rev 4014)
+++ trunk/catalog/includes/functions/template.php 2012-01-11 10:28:36 UTC (rev 4015)
@@ -1,10 +1,10 @@
<?php
/**
- @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 14/09/11, 20:33
+ @version 2.1.2
+ @date 10/01/12, 20:33
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@@ -133,13 +133,19 @@
$page->pos_init($type,$pile,$page->$methode->_call('',$pile));
$key=$page->pos_next($type,$pile);
- return TempModRes('type='.$type.'&key='.$key);
+ $result = TempModRes('type='.$type.'&key='.$key);
+
+ if($result ==-1)
+ return templ_draw_list($arg);
+ else
+ return $result;
}
/**
* \fn TempModRes($arg=array())
* \brief return object current in pile
* @param $arg array key=>value
+ @return false if no key, -1 si empty result or object if ok
*/
function TempModRes($arg=array()){
global $page;
@@ -148,11 +154,14 @@
$sortie=array();
$type=(isset($cf['type'])? $cf['type'] : 'modules'); /* modules, boxes */
$methode='oscss_'.$type;
- if(!isset($cf['key'])) return false;
+ if(!isset($cf['key']) || empty($cf['key']) )
+ return false;
$key=$cf['key'] ;
+
$mo =$page->$methode->_return($key);
+
if(is_array($mo) && !isset($mo['result_sql'])) $page->$methode->_call($key);
elseif(is_object($mo) && !isset($mo->result_sql)) $page->$methode->_call($key);
@@ -168,9 +177,9 @@
}elseif(is_object($mo)) {
return $mo;
}
- else return false;
+ else return -1;
}
- else return false;
+ else return -1;
}
/**
Modified: trunk/catalog/includes/languages/fr_FR/fr_FR.php
===================================================================
--- trunk/catalog/includes/languages/fr_FR/fr_FR.php 2012-01-10 14:05:54 UTC (rev 4014)
+++ trunk/catalog/includes/languages/fr_FR/fr_FR.php 2012-01-11 10:28:36 UTC (rev 4015)
@@ -252,7 +252,6 @@
define('PASSWORD_HIDDEN',"--CACHE--" );
define('FORM_REQUIRED_INFORMATION',"* Information requise" );
-define('TEXT_FIELD_REQUIRED',"ORM_REQUIRED_INFORMATIO" );
// constants for use in tep_prev_next_display function
define('TEXT_RESULT_PAGE',"Pages de résultat :" );
@@ -391,6 +390,9 @@
/// titre option dispo
define('TEXT_PRODUCT_OPTIONS',"Options disponibles" );
+// no touch
+define('TEXT_FIELD_REQUIRED', FORM_REQUIRED_INFORMATION );
+
/*
The following copyright announcement can only be
appropriately modified or removed if the layout of
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-01-16 16:56:17
|
Revision: 4018
http://oscss.svn.sourceforge.net/oscss/?rev=4018&view=rev
Author: oscim
Date: 2012-01-16 16:56:07 +0000 (Mon, 16 Jan 2012)
Log Message:
-----------
correction
Modified Paths:
--------------
trunk/catalog/admin/document.php
trunk/catalog/admin/includes/exts/package/CIP.php
trunk/catalog/admin/includes/gabarit/geo_zones/display_view.new.gab
trunk/catalog/admin/includes/gabarit/package/display_view.source.edit.gab
trunk/catalog/common/classes/seo_url.php
trunk/catalog/includes/filenames.php
Modified: trunk/catalog/admin/document.php
===================================================================
--- trunk/catalog/admin/document.php 2012-01-14 18:32:31 UTC (rev 4017)
+++ trunk/catalog/admin/document.php 2012-01-16 16:56:07 UTC (rev 4018)
@@ -49,7 +49,7 @@
$get=image_ratio::get_image(DIR_WS_CATALOG_IMAGES.$img,'',$width,$height);
- $img=preg_replace('#^('.DIR_WS_CATALOG_IMAGES.')#' , '', $get['src']);
+ $img=preg_replace('#^('.DIR_WS_IMAGES.')#' , '', $get['src']);
$ext = str_replace('.','',substr($img,-4));
if($ext='jpg')$ext='jpeg';
Modified: trunk/catalog/admin/includes/exts/package/CIP.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/CIP.php 2012-01-14 18:32:31 UTC (rev 4017)
+++ trunk/catalog/admin/includes/exts/package/CIP.php 2012-01-16 16:56:07 UTC (rev 4018)
@@ -25,9 +25,6 @@
*/
-include_once(dirname(__FILE__).'/sqlcip.php');
-include_once(dirname(__FILE__).'/sqlcip_modfiles.php');
-
include_once(dirname(__FILE__).'/cip_modfiles.php');
class CIP {
Modified: trunk/catalog/admin/includes/gabarit/geo_zones/display_view.new.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/geo_zones/display_view.new.gab 2012-01-14 18:32:31 UTC (rev 4017)
+++ trunk/catalog/admin/includes/gabarit/geo_zones/display_view.new.gab 2012-01-16 16:56:07 UTC (rev 4018)
@@ -1,73 +1,35 @@
<?php
/**
- @licence GPL 2005-2011 The osCSS developers - osCSS Open Source E-commerce
- @portion code Copyright (c) 2002 osCommerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 28/12/11, 16:51
+ @date 10/01/12, 16:35
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
?>
-<h3><?php echo __('text info heading edit zone'); ?></h3>
+<h3><?php echo __('heading title'); ?></h3>
+ <div class="button_nav">
+ <?php if (!geo_zones::$action) echo '<a class="button" href="' . tep_href_link(FILENAME_GEO_ZONES, tep_get_all_get_params(array('action','sID')). '&action=new_zone') . '">' .tep_image(DIR_WS_ICONS . 'icon_add_new.png', IMAGE_ICON_INFO).' '. __('image insert new zone') . '</a>'; ?>
+ </div>
- <p><?php echo __('text info edit zone intro'); ?></p>
-
-
- <?php echo tep_draw_form('zones', geo_zones::FILENAME, 'zID=' . geo_zones::$zInfo->geo_zone_id . '&action=insert_zone') ?>
- <div class="box_form">
- <!--
- <div class="button_nav">
- <?php //if (!geo_zones::$action) echo '<a class="button" href="' . tep_href_link(FILENAME_GEO_ZONES, tep_get_all_get_params(array('action','sID')). '&action=new_zone') . '">' .tep_image(DIR_WS_ICONS . 'icon_add_new.png', IMAGE_ICON_INFO).' '. __('image insert new zone') . '</a>'; ?>
- </div>-->
-
- <fieldset class="block_input">
-
- <!-- <div class="box_left"> -->
-
- <p class="block_input">
- <label for="geo_zone_name" ><?php echo __('text info zone name'); ?></label>
- <?php echo tep_draw_input_field('geo_zone_name','','') ?>
- </p>
-
- <p class="block_input">
- <label for="geo_zone_description" ><?php echo __('text info zone description') ; ?></label>
- <?php echo tep_draw_input_field('geo_zone_description','', '') ?>
- </p>
-
- <p class="block_input">
- <label for="geo_zone_name" ><?php echo __('text info zone name'); ?></label>
- <?php echo tep_draw_pull_down_menu('geo_zone_type',geo_zones::$geoTypes,'') ?>
- </p>
-
- <p class="block_input">
- <label for="geo_zone_name" ><?php echo __('text info zone grp'); ?></label>
- <span class="nobr">
- <?php echo tep_draw_pull_down_menu('geo_zone_grp',geo_zones::$geoGrpDispo,'') ?>
- <?php echo tep_draw_input_field('geo_zone_grp_add','','') ?>
- </span>
- </p>
- </fieldset>
-
- <fieldset class="block_input">
- <h4><?php echo __('geo_zone text info zone pre-programmed'); ?></h4>
-
- <p class="block_input">
- <label for="geo_zone_name" ><?php echo __('text info zone name'); ?></label>
- <?php echo tep_draw_pull_down_menu('geo_zone_model',geo_zones::$zInfo->modeleszones,'') ?>
- </p>
- </fieldset>
-
- <fieldset class="block_input">
- <div class="block_input button_nav" style="width:95%;">
- <?php
- echo tep_image_submit('', IMAGE_INSERT);
- echo tep_js_back(tep_href_link(geo_zones::FILENAME, '&zID=' . geo_zones::$zInfo->geo_zone_id ), IMAGE_CANCEL) ;
- ?>
- </div>
- </fieldset>
- </div>
- </form>
-
+ <div class="box_uniq">
+<!-- <div class="box_left"> -->
+ <table class="dataTable">
+ <thead>
+ <tr>
+ <th style="width:20px;"><?php echo __('table heading tax zones type'); ?></th>
+ <th style="width:20px;"><?php echo __('table heading tax zones grp'); ?></th>
+ <th><?php echo __('table heading tax zones'); ?></th>
+ <th><?php echo __('table heading tax zones desc'); ?></th>
+ <th><?php echo __('table heading nbr sub'); ?></th>
+ <th class="tright"><?php echo __('table heading action'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <!-- AJAX BLOCK -->
+ </tbody>
+ </table>
+</div>
\ No newline at end of file
Modified: trunk/catalog/admin/includes/gabarit/package/display_view.source.edit.gab
===================================================================
--- trunk/catalog/admin/includes/gabarit/package/display_view.source.edit.gab 2012-01-14 18:32:31 UTC (rev 4017)
+++ trunk/catalog/admin/includes/gabarit/package/display_view.source.edit.gab 2012-01-16 16:56:07 UTC (rev 4018)
@@ -1,33 +1,73 @@
<?php
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.0.9
- @date 22/06/10, 18:12
+ @version 2.1.1
+ @date 10/01/12, 18:12
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
+// print_r(package::$list->service);
+$r =package::$list->service;
?>
-<h3><?php echo __('title heading configuration source repository') ?></h3>
-<table class="dataTable">
- <thead>
- <tr>
- <th><?php echo __('heading key') ?></th>
- <th><?php echo __('heading title') ?></th>
- <th><?php echo __('heading last update') ?></th>
- <th><?php echo __('heading action') ?></th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <td><?php echo __('heading key') ?></td>
- <td><?php echo __('heading title') ?></td>
- <td><?php echo __('heading last update') ?></td>
- <td><?php echo __('heading action') ?></td>
- </tr>
- </tfoot>
- <tbody>
- <!-- AJAX BLOCK -->
- </tbody>
-</table>
+<h3><?php echo __('title heading configuration source repository edit') ?></h3>
+
+ <?php echo tep_draw_form('new_product', package::FILENAME, 'type_data=source&action=source_update', 'post'); ?>
+
+ <div class="box_uniq block_form">
+ <?php echo tep_draw_hidden_field('key', '', (string)package::$list->key, ' ') ?>
+
+ <p class="block_input">
+ <label class="inline" for="package_date_available"><?php echo __('package src url'); ?></label>
+ <?php echo tep_draw_input_field('repository', '', (string)package::$list->repository, ' style="width:500px" ') //. '<a class="ajaxinline" href="'.tep_href_link( package::FILENAME , 'type_data=source&key='. (string)package::$list->key.'&action=source_test').'">Test</a>'; ?>
+
+ </p>
+
+ <fieldset class="block_field">
+ <legend><?php echo __('package source legend ident') ?></legend>
+ <p class="block_input">
+ <label class="inline" for="package_date_available"><?php echo __('package text package user id'); ?></label>
+ <?php echo tep_draw_input_field('user', 'useradd', (string)package::$list->ident->user, ' ') ?>
+ </p>
+ <p class="block_input">
+ <label class="inline" for="package_date_available"><?php echo __('package text package token'); ?></label>
+ <?php echo tep_draw_input_field('token', '', (string)package::$list->ident->token, 'style="width:500px" ') ?>
+ </p>
+ </fieldset>
+
+
+
+
+
+
+ <fieldset class="block_field">
+<legend><?php echo __('package source legend service declared') ?></legend>
+ <ul class="block_input">
+ <?php foreach($r->children() as $k=>$row): ?>
+<li>
+ <?php echo $k ?> <?php echo $row?>
+</li>
+ <?php endforeach; ?>
+</ul>
+ </fieldset>
+
+
+
+<!-- <fieldset class="block_field"> -->
+ <div class="block_input button_nav" >
+ <?php
+ echo tep_image_submit('', IMAGE_UPDATE);
+ echo tep_js_back(tep_href_link(package::FILENAME, 'type_data=source'), IMAGE_CANCEL) ;
+ ?>
+ </div>
+<!-- </fieldset> -->
+
+
+
+ </div>
+ </form>
+
+
+
+
Modified: trunk/catalog/common/classes/seo_url.php
===================================================================
--- trunk/catalog/common/classes/seo_url.php 2012-01-14 18:32:31 UTC (rev 4017)
+++ trunk/catalog/common/classes/seo_url.php 2012-01-16 16:56:07 UTC (rev 4018)
@@ -547,7 +547,7 @@
}
- $url = isset($url) ? $url : $page;
+ $url = (isset($url) && !empty($url) ? $url : $page);
if ( sizeof($container) > 0 ){
if ( $imploded_params = $this->implode_assoc($container) ){
@@ -555,7 +555,7 @@
$separator = '&';
}
}
-// var_dump($url);s
+
return $url;
}
Modified: trunk/catalog/includes/filenames.php
===================================================================
--- trunk/catalog/includes/filenames.php 2012-01-14 18:32:31 UTC (rev 4017)
+++ trunk/catalog/includes/filenames.php 2012-01-16 16:56:07 UTC (rev 4018)
@@ -106,7 +106,7 @@
FILENAME_POPUP_IMAGE,
// FILENAME_PRODUCT_INFO,
// FILENAME_CONTENT,
- FILENAME_ADVANCED_SEARCH,
+// FILENAME_ADVANCED_SEARCH,
FILENAME_PRODUCTS_NEW,
FILENAME_SMALL_PRICE,
FILENAME_SPECIALS,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-01-18 22:02:37
|
Revision: 4020
http://oscss.svn.sourceforge.net/oscss/?rev=4020&view=rev
Author: oscim
Date: 2012-01-18 22:02:29 +0000 (Wed, 18 Jan 2012)
Log Message:
-----------
BO: Correction d'une coquille sur le la function de traitement des liens vers le catalog public
Amelioration des liens du backend direct vers une ressource de type datatype dans le frontend
Report d'une nouvelle fonction au sein des requetes sql des datadriver public
Ajustement du liens des liens dans la gestions des categorie, et ajout d'un liens de ce type dans les produits
Modified Paths:
--------------
trunk/catalog/admin/includes/functions/html_output.php
trunk/catalog/admin/includes/modules/pages/categories.php
trunk/catalog/admin/includes/modules/pages/products.php
trunk/catalog/includes/classes/drivers/data/categorie.php
trunk/catalog/includes/classes/drivers/data/content.php
trunk/catalog/includes/classes/drivers/data/product.php
trunk/catalog/includes/functions/general.php
Modified: trunk/catalog/admin/includes/functions/html_output.php
===================================================================
--- trunk/catalog/admin/includes/functions/html_output.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/admin/includes/functions/html_output.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -1,10 +1,10 @@
<?php
/**
- @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 20/11/11, 22:53
+ @version 2.1.2
+ @date 18/01/2012, 22:53
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -30,25 +30,27 @@
}
/**
- @version 2.0
- @brief Ultimate SEO URLs v2.1 The HTML href link wrapper function Or href classic
+ @fn tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL', $linkadmin= true, $linkvaradmin = 'admin')
+ @brief Link in Public Catalog. Use for direct link un frontend.
@param $page string name page destination
@param $parameters Get value
@param $linkadmin bool add link for connectin front for admin user
+ @param $linkvaradmin string name var put in get params
+ @return href link for specified public pages
*/
if (_cst_bool('SEO_ENABLED')) {
- function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL', $linkadmin= true) {
+ function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL', $linkadmin= true, $linkvaradmin = 'admin') {
global $languages_id,$SecuKey;
$add_session_id = true;
$search_engine_safe = true;
/// force offline mode
- if($linkadmin)$parameters =(empty($parameters)? '' : '&' ).'admin='.md5($SecuKey);
+ if($linkadmin)$parameters .=(empty($parameters)? '' : '&' ).$linkvaradmin.'='.md5($SecuKey);
$seo_urls = seo_url::getInstance($languages_id);
return preg_replace('/&/','&',$seo_urls->href_link($page, $parameters, $connection, $add_session_id));
}
} else {
- function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL', $linkadmin= true) {
+ function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL', $linkadmin= true, $linkvaradmin = 'admin') {
global $SecuKey;
if ($connection == 'NONSSL') $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
@@ -56,7 +58,7 @@
else die('<br /><br /><span class="error"><strong>Error!</strong><br /><br /><strong>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL<br /><br />Function used:<br /><br />tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</strong></span>');
/// force offline mode
- if($linkadmin)$parameters =(empty($parameters)? '' : '&' ).'admin='.md5($SecuKey);
+ if($linkadmin)$parameters .=(empty($parameters)? '' : '&' ).$linkvaradmin.'='.md5($SecuKey);
if ($parameters == '')$link .= $page;
else $link .= $page . '?' . $parameters;
Modified: trunk/catalog/admin/includes/modules/pages/categories.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/categories.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/admin/includes/modules/pages/categories.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -442,7 +442,7 @@
private static function get_item_action($categories){
return sprintf(
CsrtAction::getFormat('row_action'),
- sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'cPath=' . $categories['cPath']) ,' target="blank" ' ).
+ sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'cPath=' . $categories['cPath'],'SSL', true, 'forceview') ,' target="blank" ' ).
sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['categories_id'] . '&action=edit' ),'' ).
sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'cPath=' . self::$cPath . '&cID=' . $categories['categories_id'] . '&action=delete') ,'' ),
sprintf(CsrtAction::getLink('row_action_right', ICON_FOLDER, 'dir'), '', tep_href_link(self::FILENAME, 'cPath=' . $categories['cPath'] ),'' )
Modified: trunk/catalog/admin/includes/modules/pages/products.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/products.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/admin/includes/modules/pages/products.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -450,6 +450,7 @@
return sprintf(
CsrtAction::getFormat('row_action'),
self::$modules->display_ColumnRowAction($products['products_id']) ,
+ sprintf(CsrtAction::getLink('row_action_right', __('image view public') , 'publiclink'), '', tep_catalog_href_link('index.php', 'products_id=' . $products['products_id'],'SSL', true, 'forceview') ,' target="blank" ' ).
sprintf(CsrtAction::getLink('row_action_right', IMAGE_COPY_TO, 'copyto'), 'fancy', tep_href_link(self::FILENAME, 'pID=' . $products['products_id'] . '&action=copy_to') ,'' ).
sprintf(CsrtAction::getLink('row_action_right', IMAGE_EDIT, 'edit'), '', tep_href_link(self::FILENAME, 'pID=' . $products['products_id'] . '&action=new_product') ,'' ).
sprintf(CsrtAction::getLink('row_action_right', IMAGE_DELETE, 'delete'), 'fancy', tep_href_link(self::FILENAME, 'pID=' . $products['products_id'] . '&action=delete_product') ,'' ).
Modified: trunk/catalog/includes/classes/drivers/data/categorie.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/categorie.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/includes/classes/drivers/data/categorie.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -153,7 +153,7 @@
* @param $option
*/
protected static function cstr_query($orderby='', $limit='', $option=''){
- $query="SELECT c.categories_id, parent_id, cd.categories_description, c.categories_image, cd.categories_name, sortchids_products, sortchids_content FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_status='1' AND c.categories_id = cd.categories_id AND cd.language_id = '" . self::$lg_id . "' ";
+ $query="SELECT c.categories_id, parent_id, cd.categories_description, c.categories_image, cd.categories_name, sortchids_products, sortchids_content FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE " . DataForceStatus(" c.categories_status='1' AND ") . " c.categories_id = cd.categories_id AND cd.language_id = '" . self::$lg_id . "' ";
$query .=self::$where_query;
$query .=' ORDER BY ' .(!tep_not_null($orderby)? ' c.sort_order, cd.categories_name ASC ' : $orderby) ;
Modified: trunk/catalog/includes/classes/drivers/data/content.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/content.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/includes/classes/drivers/data/content.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -135,7 +135,7 @@
protected static function cstr_query($orderby='', $limit='', $option=''){
$query="SELECT content_title AS title, c.content_id AS id, c.content_name AS name, content_text AS text, c.date_added as date_added
FROM " . TABLE_CONTENT_DESCRIPTION . " cd, " . TABLE_CONTENT . " c, " . TABLE_CONTENT_TO_CATEGORIES . " ctc, " . TABLE_CATEGORIES . " cat
- WHERE cat.categories_id=ctc.categories_id and cat.categories_status='1' AND c.content_status = '1' AND c.content_id = ctc.content_id AND cd.content_id = ctc.content_id AND cd.language_id = '" . self::$lg_id . "' " ;
+ WHERE cat.categories_id=ctc.categories_id " . DataForceStatus(" AND cat.categories_status='1' ") . " " . DataForceStatus(" AND c.content_status = '1' ") . " AND c.content_id = ctc.content_id AND cd.content_id = ctc.content_id AND cd.language_id = '" . self::$lg_id . "' " ;
$query .=self::$where_query;
$query .=' ORDER BY ' .(!tep_not_null($orderby)? ' c.sort_order, c.content_name ASC ' : $orderby) ;
Modified: trunk/catalog/includes/classes/drivers/data/product.php
===================================================================
--- trunk/catalog/includes/classes/drivers/data/product.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/includes/classes/drivers/data/product.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -253,8 +253,9 @@
$query="SELECT distinct p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price,p.track_stock, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, pd.products_viewed, p2c.categories_id, p.products_weight, products_type as type
FROM " . TABLE_PRODUCTS . " p , " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c
- WHERE p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . self::$lg_id . "' and p2c.products_id=p.products_id and c.categories_id=p2c.categories_id and c.categories_status='1' " ;
+ WHERE " . DataForceStatus(" p.products_status = '1' AND ") . " pd.products_id = p.products_id and pd.language_id = '" . self::$lg_id . "' and p2c.products_id=p.products_id and c.categories_id=p2c.categories_id " . DataForceStatus(" AND c.categories_status='1' ") . " " ;
+
$query .=self::$where_query;
$query .=' ORDER BY ' .(!tep_not_null($orderby)? ' p.products_date_added DESC ' : $orderby) ;
$query .=' LIMIT '.(!tep_not_null($limit)? '1' : $limit) ;
Modified: trunk/catalog/includes/functions/general.php
===================================================================
--- trunk/catalog/includes/functions/general.php 2012-01-18 17:13:31 UTC (rev 4019)
+++ trunk/catalog/includes/functions/general.php 2012-01-18 22:02:29 UTC (rev 4020)
@@ -1080,6 +1080,20 @@
return $f;
}
+/**
+ @fn DataForceStatus($clause)
+ @brief this function force status on datatype Required for admin view off data
+ @note use in sql Requete, next clause where and prev other clause
+ @param $clause string clause normal control status ( c.status='1' AND )
+ @return normal clause status or empty string
+*/
+function DataForceStatus($clause){
+ global $SecuKey;
+ if ( ( !empty($SecuKey) && (strlen($SecuKey)==40) && isset($_GET['forceview']) && (string)$_GET['forceview'] ==md5($SecuKey)) )
+ return '';
+ else
+ return ' '.$clause.' ';
+}
/** Alias */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-01-23 13:02:16
|
Revision: 4021
http://oscss.svn.sourceforge.net/oscss/?rev=4021&view=rev
Author: oscim
Date: 2012-01-23 13:02:10 +0000 (Mon, 23 Jan 2012)
Log Message:
-----------
correction coquille
Modified Paths:
--------------
trunk/catalog/Documents/admin/data/repository_sources.xml
trunk/catalog/Documents/oscss.version.xml
trunk/catalog/admin/includes/exts/package/packageRepository.php
trunk/catalog/admin/includes/modules/pages/package.php
Modified: trunk/catalog/Documents/admin/data/repository_sources.xml
===================================================================
--- trunk/catalog/Documents/admin/data/repository_sources.xml 2012-01-18 22:02:29 UTC (rev 4020)
+++ trunk/catalog/Documents/admin/data/repository_sources.xml 2012-01-23 13:02:10 UTC (rev 4021)
@@ -5,7 +5,7 @@
<title>Official</title>
<key>official</key>
<description>official repository</description>
- <repository>http://localhost/plugins.oscss.org/services.php</repository>
+ <repository>http://plugins.oscss.org/services.php</repository>
<ident>
<user></user>
<token></token>
Modified: trunk/catalog/Documents/oscss.version.xml
===================================================================
--- trunk/catalog/Documents/oscss.version.xml 2012-01-18 22:02:29 UTC (rev 4020)
+++ trunk/catalog/Documents/oscss.version.xml 2012-01-23 13:02:10 UTC (rev 4021)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<core>
- <version>2.1.1 (dev)</version>
- <svn>3885</svn>
- <level>stable</level>
+ <version>2.1.1 (beta)</version>
+ <svn>4020</svn>
+ <level>unstable</level>
<template_admin>oscss</template_admin>
<urloscssorgtrac>http://sourceforge.net/apps/trac/oscss/changeset/?format=zip&new=SVN_REV_MAX&old=SVN_REV&new_path=trunk%2Fcatalog&old_path=trunk%2Fcatalog</urloscssorgtrac>
Modified: trunk/catalog/admin/includes/exts/package/packageRepository.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/packageRepository.php 2012-01-18 22:02:29 UTC (rev 4020)
+++ trunk/catalog/admin/includes/exts/package/packageRepository.php 2012-01-23 13:02:10 UTC (rev 4021)
@@ -12,6 +12,7 @@
if(!class_exists('package')) include_once(DIR_WS_MODULES .'pages/package.php');
+error_reporting(E_ALL);
class packageRepository
extends package {
@@ -95,7 +96,12 @@
/**
- @brief Test connextion and content
+ @brief Test connection and content
+ This function initialise connection in repository url, and ceck retrun content result or error
+ This service in depot is normalise
+ @param $repo string url source depot
+ @param $action [value saction string] name action
+ @return result or false
*/
public static function InitConnexion($repo, $action = ''){
global $messageStack;
@@ -112,8 +118,7 @@
}
if(isset($Repos->error)){
- $messageStack->add_session(sprintf(__('package packageRepository error in process for repository %s :>> %s') , $repo->repository , addslashes(self::FomatError($Repos->error )) ),'error' );
- break;
+ $messageStack->add_session(sprintf(__('package packageRepository error in process for repository %s :>> %s') , $repo->repository , self::FomatError($Repos->error ) ),'error' );
}
return $Repos;
@@ -215,14 +220,6 @@
}
else{
-
-// if(!$re= fileUtility::url_fopen( self::HrefSrc($repo, 'listing') ) )
-// $messageStack->add_session('recuperation repository impossible :'.$repo->repository,'error' );
-// else {
-//
-// if(!$Repos = simplexml_load_string($re))
-// $messageStack->add_session('Impossible lire le contenu :'.$repo->title,'error' );
-// else
if($Repos = self::InitConnexion($repo, 'listing') ){
//! compteur entree / repository
@@ -234,8 +231,7 @@
$objres=$Repos->channel->item;
foreach($objres as $item){
-// print_r($item);
-// exit;
+
if(!isset($temparray[md5((string)$item->ident.'_'.(string)$item->level)]) ) {
$item->sourceTitle=(string)$repo->title;
$item->sourceKey=(string)$repo->key;
@@ -265,9 +261,6 @@
}
-// }
-
-
}
//! mise en cache global
$var_file['global']['last_update']= date("Y-m-d H:n:s");
@@ -279,8 +272,6 @@
// if(count($var_file)==0) throw new Exception('Erreur recuperation');
-
-
fileUtility::_unlink(DIR_FS_ROOT_DOCS.'admin/data/'.parent::REPOSITORY_DATA);
if($dom->save(DIR_FS_ROOT_DOCS.'admin/data/'.parent::REPOSITORY_DATA) !=true)
@@ -291,7 +282,6 @@
}
catch(Exception $e){
$messageStack->add_session($e->getMessage(),'error' );
-// $messageStack->add($e->getMessage(),'error' );
}
return true;
}
Modified: trunk/catalog/admin/includes/modules/pages/package.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/package.php 2012-01-18 22:02:29 UTC (rev 4020)
+++ trunk/catalog/admin/includes/modules/pages/package.php 2012-01-23 13:02:10 UTC (rev 4021)
@@ -98,8 +98,8 @@
public function __construct() {
self::GetConf();
- include_once(DIR_WS_FUNCTIONS.'lib.cip_manager.php');
- include_once(DIR_WS_FUNCTIONS.'lib.configuration.php');
+ include_once(DIR_WS_FUNCTIONS.'lib.cip_manager.php');
+ include_once(DIR_WS_FUNCTIONS.'lib.configuration.php');
}
@@ -116,8 +116,8 @@
self::$type_data=(isset($_GET['type_data'])?$_GET['type_data']: 'package');
$mode=(isset($_GET['mode'])?$_GET['mode']:'');
-// var_dump( self::$type_data);
+
/**
@remarks not load if not first init
*/
@@ -178,9 +178,10 @@
break;
case 'source_update':
-// // self::$objChild->SourceUpdate();
if(self::$objChild->SourceUpdate()==true)
tep_redirect(tep_href_link(self::FILENAME));
+
+ tep_redirect(tep_href_link(self::FILENAME));
break;
case 'download':
$class=self::$code.'Installer';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-01-31 08:18:39
|
Revision: 4026
http://oscss.svn.sourceforge.net/oscss/?rev=4026&view=rev
Author: oscim
Date: 2012-01-31 08:18:33 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
correction coquille
Modified Paths:
--------------
trunk/catalog/admin/includes/exts/package/ci_tag.class.php
trunk/catalog/admin/includes/exts/package/packageInstaller.php
trunk/catalog/includes/application_top.php
trunk/catalog/includes/functions/general.php
Modified: trunk/catalog/admin/includes/exts/package/ci_tag.class.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2012-01-30 16:22:32 UTC (rev 4025)
+++ trunk/catalog/admin/includes/exts/package/ci_tag.class.php 2012-01-31 08:18:33 UTC (rev 4026)
@@ -140,10 +140,6 @@
}
public static function get_fs_filename($fname) {
-// if($this->isJoscom()){
- $fname = str_replace(DIR_WS_CATALOG,"",$fname);
- $fname = str_replace(DIR_WS_ADMIN,"admin/",$fname);
-//
if (strpos($fname, "admin/") === false) {
$filepath = DIR_FS_CATALOG;
} else {
@@ -152,9 +148,6 @@
}
return $filepath.$fname;
-// }else{
-// if ($fname)return DIR_FS_CATALOG.$fname;
-// }
}
Modified: trunk/catalog/admin/includes/exts/package/packageInstaller.php
===================================================================
--- trunk/catalog/admin/includes/exts/package/packageInstaller.php 2012-01-30 16:22:32 UTC (rev 4025)
+++ trunk/catalog/admin/includes/exts/package/packageInstaller.php 2012-01-31 08:18:33 UTC (rev 4026)
@@ -4,7 +4,7 @@
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
@version 2.1.1
- @date 03/01/12, 08:07
+ @date 30/01/12, 08:07
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class packageInstaller
@@ -32,9 +32,10 @@
$obj=parent::load_db_values($pkgID);
$obj=$obj[0];
- if((string)$obj->item->sourceTitle =='local'){
+
+ if((string)$obj->item->sourceKey =='local'){
$cip= new CIP( (string)$obj->item->ident.'_'.(string)$obj->item->level.'.zip');
- tep_redirect(tep_href_link(self::FILENAME, 'action=view&pkgID='.(int)$obj->item->internalID ));
+ tep_redirect(tep_href_link(self::FILENAME, 'action=view&pkgID='.$pkgID ));
}
else {
Modified: trunk/catalog/includes/application_top.php
===================================================================
--- trunk/catalog/includes/application_top.php 2012-01-30 16:22:32 UTC (rev 4025)
+++ trunk/catalog/includes/application_top.php 2012-01-31 08:18:33 UTC (rev 4026)
@@ -118,11 +118,11 @@
@note if vou want to allow specific fields, added an exclusion in the loop in question
*/
if(isset($_GET))
- foreach($_GET as $k=>$v) $_GET[$k]=tep_sanitize_request($v);
+ $_GET = PutCleanVars($_GET);
if(isset($_POST))
- foreach($_POST as $k=>$v) $_POST[$k]=tep_sanitize_request($v);
+ $_POST = PutCleanVars($_POST);
if(isset($_REQUEST))
- foreach($_REQUEST as $k=>$v) $_REQUEST[$k]=tep_sanitize_request($v);
+ $_REQUEST = PutCleanVars($_REQUEST);
/// Constructeur de page
Modified: trunk/catalog/includes/functions/general.php
===================================================================
--- trunk/catalog/includes/functions/general.php 2012-01-30 16:22:32 UTC (rev 4025)
+++ trunk/catalog/includes/functions/general.php 2012-01-31 08:18:33 UTC (rev 4026)
@@ -92,6 +92,18 @@
}
/**
+ *\fn PutCleanVars($get)
+ *\brief Recursive methode for clean vars
+ \param array/string la chaîne à nettoyer
+*/
+function PutCleanVars($get){
+ foreach($get as $k=>$v)
+ if(is_array($v)) $get[$k]=PutCleanVars($v);
+ else $get[$k]=tep_sanitize_request($v);
+ return $get;
+}
+
+/**
*\fn tep_random_select($query)
*\brief Return a random row from a database query
\return one result
@@ -1085,7 +1097,7 @@
@brief this function force status on datatype Required for admin view off data
@note use in sql Requete, next clause where and prev other clause
@param $clause string clause normal control status ( c.status='1' AND )
- @return normal clause status or empty string
+ @return normal clause status or empty string
*/
function DataForceStatus($clause){
global $SecuKey;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <os...@us...> - 2012-02-01 14:57:48
|
Revision: 4027
http://oscss.svn.sourceforge.net/oscss/?rev=4027&view=rev
Author: oscim
Date: 2012-02-01 14:57:36 +0000 (Wed, 01 Feb 2012)
Log Message:
-----------
correction coquille
correction db colonne uniqe
correction gestion des documents pdf
Modified Paths:
--------------
trunk/catalog/admin/includes/functions/general.php
trunk/catalog/common/classes/osCSS_pdf.php
trunk/catalog/common/functions/pdf_output.php
trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql
Modified: trunk/catalog/admin/includes/functions/general.php
===================================================================
--- trunk/catalog/admin/includes/functions/general.php 2012-01-31 08:18:33 UTC (rev 4026)
+++ trunk/catalog/admin/includes/functions/general.php 2012-02-01 14:57:36 UTC (rev 4027)
@@ -176,6 +176,16 @@
}
/**
+ *\fn tep_sanitize_request($string)
+ *\brief suppression et nettoyage request value (sécu)
+ \param string la chaîne à nettoyer
+*/
+function tep_sanitize_request($string) {
+ $string = htmlspecialchars(strip_tags($string));
+ return preg_replace("#(\./|\.\./|(\<|%3C)|(\>|%3E)|(\<|%3C).*script.*(\>|%3E))*#i",'',$string);
+}
+
+/**
Convetion de langue Generation 2
@package oscss-2
@author oscim <mail os...@os...> <www http://www.oscim.fr>
Modified: trunk/catalog/common/classes/osCSS_pdf.php
===================================================================
--- trunk/catalog/common/classes/osCSS_pdf.php 2012-01-31 08:18:33 UTC (rev 4026)
+++ trunk/catalog/common/classes/osCSS_pdf.php 2012-02-01 14:57:36 UTC (rev 4027)
@@ -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 19/09/11, 20:11
+ @date 31/12/2012, 20:11
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
@class osCSS_pdf
@@ -34,14 +34,14 @@
private function __construct(){
define('BATCH_PRINT_INC', DIR_WS_MODULES . 'template_pdf/');
- define('BATCH_PDF_DIR', DIR_WS_INCLUDES . 'tmp/');
+ define('BATCH_PDF_DIR', DIR_FS_ROOT_DOCS . 'tmp/');
define('FPDF_FONTPATH',DIR_FS_CATALOG.DIR_WS_COMMON_FONTS);
require_once(DIR_FS_CATALOG.DIR_WS_COMMON_CLASSES.'fpdf.php');
require_once(DIR_FS_CATALOG.DIR_WS_COMMON_FUNCTIONS.'pdf_output.php');
- define('LOGO_SHOP_FOR_PRINT',HTTP_SERVER.str_replace('//','/',STORE_LOGO_PRINT));
+ define('LOGO_SHOP_FOR_PRINT',HTTP_SERVER. 'document.php?mod=img&i='. str_replace('//','/',STORE_LOGO_PRINT) );
}
Modified: trunk/catalog/common/functions/pdf_output.php
===================================================================
--- trunk/catalog/common/functions/pdf_output.php 2012-01-31 08:18:33 UTC (rev 4026)
+++ trunk/catalog/common/functions/pdf_output.php 2012-02-01 14:57:36 UTC (rev 4027)
@@ -1,9 +1,9 @@
<?php
/**
- @licence GPL 2005-2010 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2012 The osCSS developers - osCSS Open Source E-commerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.0.9
- @date 30/05/10, 19:28
+ @version 2.1.1
+ @date 31/01/2012, 19:28
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
*/
@@ -58,7 +58,7 @@
global $oID;
$date = strftime('%A, %d %B %Y');
//Logo + link shop
- $this->Image(HTTP_SERVER.STORE_LOGO_PRINT,5,10,50,0,'',HTTP_SERVER.DIR_WS_CATALOG);
+ $this->Image(LOGO_SHOP_FOR_PRINT,5,10,50,0,'',HTTP_SERVER.DIR_WS_CATALOG);
// Company Address
$this->SetX(0);
@@ -216,7 +216,7 @@
function Header()
{
// //Logo
- $this->Image(HTTP_SERVER.STORE_LOGO_PRINT,5,10,50,0,'',HTTP_SERVER.DIR_WS_CATALOG);
+ $this->Image(LOGO_SHOP_FOR_PRINT,5,10,50,0,'',HTTP_SERVER.DIR_WS_CATALOG);
}
function Footer() {
Modified: trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql
===================================================================
--- trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql 2012-01-31 08:18:33 UTC (rev 4026)
+++ trunk/catalog/install/includes/sql/mysql/tables/osc_configuration_group.sql 2012-02-01 14:57:36 UTC (rev 4027)
@@ -23,5 +23,6 @@
configuration_group_group_id varchar(64) NOT NULL,
configuration_group_key varchar(64) not null ,
PRIMARY KEY (configuration_group_id)
+ UNIQUE KEY configuration_group_key (configuration_group_key)
) DEFAULT CHARSET=utf8;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|