2013-05-23 2 views
1

현재 변경하려고 시도하고 있습니다. this 구성 요소가 자체적으로 부트 스트랩 모달을 사용합니다. 구성 요소에서 사용되는 라이트 박스가 전혀 반응이 없습니다 ..이 구성 요소는 내장되어 있습니다 ... 매우 이상한 방법으로 많이 ...부트 스트랩 모달 Iframe Joomla

하지만 내가해야 할 일에 대한 핵심 파일을 가지고 있는데, 나는 어디서 잘못 될지 모르겠습니다. iframe이 어디 다음

jQuery(document).ready(function(){ 
    srztb_init('a.youModal');//pass where to apply srzthickbox 
    imgLoader = new Image();// preload image 
    imgLoader.src = srztb_pathToImage; 
}); 

function srztb_init(domChunk){ 
    jQuery(domChunk).click(function(){ 
    var t = this.title || this.name || null; 
    var a = this.href || this.alt; 
    var g = this.rel || false; 
    srztb_show(t,a,g); 
    this.blur(); 
    return false; 
    }); 
} 

function srztb_show(caption, url, imageGroup) {//function called when the user clicks on a srzthickbox link 
     jQuery('#youModal').removeData("modal"); 
     jQuery('#youModal').modal({remote: jQuery(this).attr(url)}); 
} 

하고 코드의 가장 큰 chunck : 모달를 활성화

$link = '<a class="youModal" data-toggle="modal" href="'.JURI::base().'index.php?option=com_jusertube&amp;view=lightbox&amp;rid='.$video['id'].'&amp;'.$yorvuser .'='.$youtubeuser.$doautoplay.'&amp;eh='.$eheight.'&amp;ew='.$ewidth.'&amp;st='.$showtitle.'&amp;height='.$popupy.'&amp;width='.$popupx.'" data-target="#youModal">'; 

후 JS : 여기

모달에 대한 링크입니다 변수의 생성 :

<?php 
/** 
* @package   JUserTube 
* @version   5.6.0 
* 
* @author   Md. Afzal Hossain <[email protected]> 
* @link   http://www.srizon.com 
* @copyright  Copyright 2012 Md. Afzal Hossain All Rights Reserved 
* @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL 
*/ 

// No direct access 
defined('_JEXEC') or die; 

jimport('joomla.application.component.view'); 

/** 
* Content categories view. 
* 
* @package  Joomla.Site 
* @subpackage com_weblinks 
* @since 1.5 
*/ 
class JusertubeViewLightbox extends JViewLegacy 
{ 

    function display() 
    { 
     $filepath = dirname(__FILE__).'/../../../../modules/mod_jusertube/'.'savedxml'.'/'; 
     if(!isset($_GET['yuser'])) $_GET['yuser'] = 0; 
     if(!isset($_GET['auto'])) $_GET['auto'] = 0; 
     $rid = $_GET['rid']; 
     $auto = $_GET['auto']; 
     if(isset($_GET['ttv'])) $ttv = $_GET['ttv']; 
     else $ttv = 0; 
     if($_GET['yuser']){ 
      $youtubeuser = $_GET['yuser']; 
      $filename = $filepath.'youtube_'.$youtubeuser.'.xml'; 
     } 
     else{ 
      $youtubeuser = $_GET['vuser']; 
      $filename = $filepath.'vimeo_'.$youtubeuser.'.xml'; 
     } 
     if($auto == 1){ 
      $autotext = '&amp;autoplay=1'; 
     } 
     else{ 
      $autotext = '&amp;autoplay=0'; 
     } 
     if(is_file($filename)){ 
      $data = file_get_contents($filename); 
     } 
     $rss = new SimpleXMLElement($data); 
     $videos = array(); 
     $u =& JURI::getInstance(); 
     $url = $u->toString(); 
     $url = str_replace("view=lightbox","view=video",$url); 
     $p2 = strpos($url,'&auto='); 
     $url = substr($url,0,$p2); 
     $url.='&auto=1&eh=385&ew=640&st=yes'; 
     $url = str_replace('&','&amp;',$url); 
     if($_GET['yuser']){ 
      foreach($rss->channel->item as $item){ 
       $guid_split = parse_url($item->link); 
       parse_str($guid_split['query'],$temp_v); 
       $tid = $temp_v['v']; 

       if($tid == $rid) 
       { 
        $videos['title'] = (string) $item->title; 
        $videos['embed'] = '<iframe class="youtube-player" type="text/html" width="'.$_GET['ew'].'" height="'.$_GET['eh'].'" src="http://www.youtube.com/embed/'.$tid.'?fs=1&amp;rel=0'.$autotext.'" frameborder="0"></iframe>'; 
        if($GLOBALS['pageprotocol']=='https'){ 
         $videos['embed'] = str_replace('http:','https:',$videos['embed']); 
        } 
        break; 
       } 
      } 
     } 
     else{ 
      foreach($rss->channel->item as $item){ 
       $tlnk = $item->link; 
       if($ttv == 1){ 
        $pos1 = strpos($tlnk,'com'); 
        $tid = substr($tlnk,$pos1+4); 
       } 
       else{ 
       //$pos1 = strpos($tlnk,'#'); 
       $pos1 = strrpos($tlnk,'/'); 
       $tid = substr($tlnk,$pos1+1); 
       } 
       if($tid == $rid) 
       { 
        str_replace('&amp;','',$autotext); 
        $videos['title'] = (string) $item->title; 
        $videos['embed'] = '<iframe src="http://player.vimeo.com/video/'.$tid.'?'.$autotext.'" width="'.$_GET['ew'].'" height="'.$_GET['eh'].'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'; 
        break; 
       } 
      } 

     } 
?> 
<div id="youModal" class="modal hide fade flex-video" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 
      <div class="modal-header"> 
      <h2><?php echo $videos['title']?></h2> 
      </div> 
      <div class="modal-body"> 
       <?php echo $videos['embed'];?> 
      </div> 
</div> 
<?php 
     exit(); 
    } 

} 
?> 

죄송합니다. 마지막 부분에는 많은 코드가 있으며, 이 코드는 구성 요소 코드를 변경하는 것이기 때문에 모달 창에 전체 구성 요소를 다시 쓰는 것을 피하고 싶습니다.

크게 감사합니다 도움이 .. 자신은 JHTML 클래스의 모달 및 renderModal 기능을 사용하는 방법에 대한

소스 코드는 어떻게 모든 자바 스크립트를 추가하는 대신

+2

"더 많은 작업을 수행하는 데 필요한 작업을 줄이기위한 프레임 워크 사용"이라는 완벽한 예가 있습니다. 어쨌든 당신 잘못이 아니에요. 너를 느껴. 형. –

답변