listingUtility Class Reference

List of all members.

Static Public Member Functions

  • static sortby ($GETsort)
  • static menuSortBy ($name='sort', $id, $selected='', $parameters='')

Static Public Attributes


Detailed Description

Definition at line 217 of file page.listing.php.


Member Function Documentation

static listingUtility::menuSortBy ( name = 'sort',
id,
selected = '',
parameters = '' 
) [static]

Definition at line 276 of file page.listing.php.

00276                                                                                   {
00277 
00278     $cpt=0;
00279     $_array=array();
00280     foreach(self::$column_list as $it) {
00281       $cpt++;
00282       $_array[]=array('id'=>$cpt, 'text'=>str_replace('_LIST','',$it));
00283     }
00284     return tep_draw_pull_down_menu($name,$id, $_array, $selected, $parameters);
00285   }

static listingUtility::sortby ( GETsort  )  [static]

Tri par default, option des categorie Champs sortchids_products & sortchids_content

Tri si aucun tri deja effectué

Definition at line 229 of file page.listing.php.

Referenced by listingData::Exeorderby().

00229                                          {
00230     global $categories;
00231     $listing_sql = '';
00232 /*    if ( (!isset($GETsort)) && (!preg_match('/[1-8][ad]/', $GETsort)) && (substr($GETsort, 0, 1) > sizeof(self::$column_list)) ) {
00233       for ($i=0, $n=sizeof(self::$column_list); $i<$n; $i++) {
00234         if (self::$column_list[$i] == 'PRODUCT_LIST_NAME') {
00235           $GETsort = $i+1 . 'a';
00236           if(!isset($_GET['type_object']) || $_GET['type_object']=='products') return $listing_sql.=" p2c.categories_id,pd.products_name";
00237         }
00238       }
00239     }
00240     else*/if ( isset($GETsort)) {
00241       $sort_col = substr($GETsort, 0 , 1);
00242       $sort_order = substr($GETsort, 1);
00243 
00244         switch (self::$column_list[$sort_col-1]) {
00245           case 'PRODUCT_LIST_MODEL':  $listing_sql.="p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break;
00246           case 'PRODUCT_LIST_NAME':  $listing_sql.="pd.products_name " . ($sort_order == 'd' ? 'desc' : ''); break;
00247           case 'PRODUCT_LIST_MANUFACTURER':   $listing_sql.="m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break;
00248           case 'PRODUCT_LIST_QUANTITY':   $listing_sql.="p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break;
00249           case 'PRODUCT_LIST_IMAGE':   $listing_sql.="pd.products_name"; break;
00250           case 'PRODUCT_LIST_WEIGHT':  $listing_sql.="p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break;
00251           case 'PRODUCT_LIST_PRICE':  $listing_sql.="final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break;
00252         }
00253     }
00257     elseif(isset($categories->sortchids_products) || isset($categories->sortchids_content)){
00258       if(tep_not_null($categories->sortchids_products) && ( listingData::$type_object=='products' || listingData::$type_object=='nested' ) ) $listing_sql .= $categories->sortchids_products.", pd.products_name";
00259       elseif( tep_not_null($categories->sortchids_content) && listingData::$type_object=='pages' )  $listing_sql .= $categories->sortchids_content;
00260     }
00261 
00262 
00266     if(empty($listing_sql)){
00267       if( listingData::$type_object=='products' ) $listing_sql .=  'pd.products_name';
00268       elseif( listingData::$type_object=='pages' )  $listing_sql .=  'content_name';
00269     }
00270 
00271 
00272     return $listing_sql;
00273   }


Member Data Documentation

listingUtility::$column_list [static]
Initial value:
array( 'PRODUCT_LIST_MODEL' ,
                                    'PRODUCT_LIST_NAME' ,
                                    'PRODUCT_LIST_MANUFACTURER' ,
                                    'PRODUCT_LIST_PRICE' ,
                                    'PRODUCT_LIST_QUANTITY' ,
                                    'PRODUCT_LIST_WEIGHT' ,
                                    'PRODUCT_LIST_IMAGE',
                                    'PRODUCT_LIST_BUY_NOW' )

Definition at line 219 of file page.listing.php.


The documentation for this class was generated from the following file: