Changeset 632 for trunk


Ignore:
Timestamp:
06/02/2011 02:27:39 AM (12 months ago)
Author:
ofer
Message:

Fix iframe src urls, Fix a bug when only="y" shortcode was used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/core/parser.php

    r611 r632  
    463463        //support only_thislanguage class, (nulling the node if it should not display) 
    464464        if (isset($src_set_here) && $src_set_here && $this->srclang != $this->lang && stripos($node->class, ONLY_THISLANGUAGE_CLASS) !== false) { 
     465            $this->srclang = $prevsrclang; //we should return to the previous src lang or it will be kept and carried 
    465466            $node->outertext = ''; 
    466467            return; 
     
    504505        elseif ($node->tag == 'input' && $node->type == 'submit') { 
    505506            $this->parsetext($node->value); 
     507        } 
     508        // for iframes we will rewrite urls if we can 
     509        elseif ($node->tag == 'iframe') { 
     510            $node->src = call_user_func_array($this->url_rewrite_func, array($node->src)); 
     511            logger($node->src); 
    506512        } 
    507513 
     
    687693        } 
    688694 
     695        //fix urls more 
     696        // WORK IN PROGRESS 
     697        /*foreach ($this->atags as $e) { 
     698            $hrefspans = ''; 
     699            foreach (call_user_func_array($this->split_url_func, array($e->href)) as $part) { 
     700                // fix - not for dashes 
     701                list ($source, $translated_text) = call_user_func_array($this->fetch_translate_func, array($part, $this->lang)); 
     702                $hrefspans .= $this->create_edit_span($part, $translated_text, $source, true); 
     703            } 
     704            $e->href = call_user_func_array($this->url_rewrite_func, array($e->href)); 
     705            $e->outertext .= $hrefspans; 
     706        }*/ 
     707 
    689708        // fix urls... 
    690         foreach ($this->atags as $e) { 
    691             $e->href = call_user_func_array($this->url_rewrite_func, array($e->href)); 
     709             foreach ($this->atags as $e) { 
     710              $e->href = call_user_func_array($this->url_rewrite_func, array($e->href)); 
    692711        } 
    693712        foreach ($this->otags as $e) { 
Note: See TracChangeset for help on using the changeset viewer.