Changeset 684


Ignore:
Timestamp:
11/27/2011 10:44:21 PM (6 months ago)
Author:
ofer
Message:

Need to support PHP versions lower than 5.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/wp/transposh_widget.php

    r683 r684  
    164164        foreach ($activewidgets as $key => $v) { 
    165165            $class = $this->load_widget($key); 
    166             if (class_exists($class)) 
    167                     $class::tp_widget_css($key, $this->transposh->transposh_plugin_dir, $this->transposh->transposh_plugin_url); 
     166            if (class_exists($class)) { 
     167                $tmpclass = new $class; 
     168                $tmpclass->tp_widget_css($key, $this->transposh->transposh_plugin_dir, $this->transposh->transposh_plugin_url); 
     169            } 
    168170        } 
    169171        logger('Added transposh_widget_css', 4); 
     
    185187        foreach ($activewidgets as $key => $v) { 
    186188            $class = $this->load_widget($key); 
    187             if (class_exists($class)) 
    188                     $class::tp_widget_js($key, $this->transposh->transposh_plugin_dir, $this->transposh->transposh_plugin_url); 
     189            if (class_exists($class)) { 
     190                $tmpclass = new $class; 
     191                $tmpclass->tp_widget_js($key, $this->transposh->transposh_plugin_dir, $this->transposh->transposh_plugin_url); 
     192            } 
    189193        } 
    190194        logger('Added transposh_widget_js', 4); 
     
    245249        $class = $this->load_widget($instance['widget_file']); 
    246250        if (!class_exists($class)) { 
    247             echo __('Transposh subwidget was not loaded correctly').": $class"; 
     251            echo __('Transposh subwidget was not loaded correctly') . ": $class"; 
    248252        } 
    249253 
     
    265269 
    266270        // actually run the external widget code 
    267         $class::tp_widget_do($widget_args); 
    268  
     271        //if (version_compare(PHP_VERSION, '5.3.0','gt')) { (for the future) 
     272        //   $class::tp_widget_do($widget_args); 
     273        //} else { 
     274        $tmpclass = new $class; 
     275        $tmpclass->tp_widget_do($widget_args); 
     276        //} 
    269277        //at least one language showing - add the edit box if applicable 
    270278        if (!empty($widget_args)) { 
Note: See TracChangeset for help on using the changeset viewer.