Changeset 31196


Ignore:
Timestamp:
06/01/15 19:07:18 (4 years ago)
Author:
plg
Message:

with theme stripped, display paypal form right under the photo and not in a tab

Location:
extensions/PayPalShoppingCart
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PayPalShoppingCart/main.inc.php

    r30179 r31196  
    6666define('PPPPP_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); 
    6767define('PPPPP_SIZE_TABLE', $prefixeTable.'ppppp_size'); 
    68  
    69 function ppppp_append_form($tpl_source, &$smarty){ 
    70  $pattern = '#<.*\"infoTable\".*>#'; 
    71  $replacement = ' 
     68define('PPPPP_VERSION', 'auto'); 
     69 
     70function ppppp_append_form($tpl_source, &$smarty) 
     71{ 
     72  global $theme; 
     73 
     74  $pattern = '#<.*\"infoTable\".*>#'; 
     75  $replacement = ' 
    7276  <tr> 
    7377   <td class="label">{\'Buy this picture\'|@translate}</td> 
     
    109113 {/literal} 
    110114 '; 
    111  if(!preg_match($pattern,$tpl_source)) { 
    112   $pattern='#{if isset\(\$COMMENT_IMG\)}#'; 
    113   $replacement='<table>'.$replacement.'</table>'; 
    114   $replacement=$replacement.'$0'; 
    115   } 
    116  else 
    117   $replacement='$0'.$replacement; 
    118  return preg_replace($pattern, $replacement, $tpl_source,1); 
    119  } 
     115 
     116  if (strpos($theme, 'stripped') === 0) 
     117  { 
     118    $pattern = '#</div>\s*<!--\s*theImage\s*-->#'; 
     119    $replacement = ' 
     120{combine_css path="plugins/PayPalShoppingCart/stripped.css"} 
     121<table id="paypalCart">'.$replacement.'</table>'; 
     122    $replacement = $replacement.'$0'; 
     123  } 
     124  else 
     125  { 
     126    if(!preg_match($pattern,$tpl_source)) 
     127    { 
     128      $pattern='#{if isset\(\$COMMENT_IMG\)}#'; 
     129      $replacement='<table>'.$replacement.'</table>'; 
     130      $replacement=$replacement.'$0'; 
     131    } 
     132    else 
     133    { 
     134      $replacement='$0'.$replacement; 
     135    } 
     136  } 
     137   
     138  return preg_replace($pattern, $replacement, $tpl_source,1); 
     139} 
    120140 
    121141function ppppp_picture_handler() 
Note: See TracChangeset for help on using the changeset viewer.