text is also available * @param object The article params * @param int The 'page' number */ function onPrepareContent( &$article, &$params, $limitstart ) { global $mainframe; $tagName = 'VoxelLauncher'; $posStart = 0; while($posStart!==FALSE) { $posStart = strpos($article->text ,'{'.$tagName,$posStart); if ($posStart!==FALSE) { $posEnd = strpos($article->text,'}',$posStart);//busco la llave de cierre $content = substr($article->text,$posStart,$posEnd-$posStart); $content = trim($content); $plparams = split("[ ]+", $content); $urlparams =""; $caption = "Launch plugin "; for($i=1;$i0) { $urlparams .="&"; $caption .= ", "; } $temp = trim($plparams[$i]); $urlparams .= $temp; $caption .= $temp; } $urlparams .= "&Id="; $js=" function OnPluginClose() { SqueezeBox.close(); } function VXLCloseEvent() { var loader = window.frames['modal'].gLoader; loader.SendToPlugin('PLUGIN_CLOSE',null,''); } var width,height; function UpdateSize() { if (!SqueezeBox.isOpen) return; var curw,curh,str; curw=document.body.parentNode.offsetWidth; curh=document.body.parentNode.offsetHeight; if (curw<1) curw=1; if (curh<1) curh=1; if (curw!=width || curh!=height) { SqueezeBox.resize(SqueezeBox.options.size, true); } width=curw; height=curh; } function OnLoad() { UpdateSize(); setInterval('UpdateSize()',500); } window.attachEvent('onload', function() { OnLoad(); }); "; $document =& JFactory::getDocument(); $document->addScriptDeclaration($js); //print($urlparams."
"); JHTML::_('behavior.modal','a.modal',null); $repHtml = "$caption"; $article->text = substr_replace($article->text,$repHtml,$posStart,$posEnd-$posStart+1); /* ESTO ES LO DE ANTES $posEnd = strpos($article->text,'}',$posStart+1); $contentStart = $posStart+strlen($tagName); $content = substr($article->text,$contentStart,$posEnd-$contentStart); $content = trim($content); $repHtml = "{modal url=/voxelplugins/voxellauncherview.php?plugin=".$content."|type=shadowbox|width=800|height=800|overlay_close=0}View plugin{/modal}"; $article->text = substr_replace($article->text,$repHtml,$posStart,$posEnd-$posStart+1); */ } $posStart++; } } /** * Example after display title method * * Method is called by the view and the results are imploded and displayed in a placeholder * * @param object The article object. Note $article->text is also available * @param object The article params * @param int The 'page' number * @return string */ function onAfterDisplayTitle( &$article, &$params, $limitstart ) { global $mainframe; return ''; } /** * Example before display content method * * Method is called by the view and the results are imploded and displayed in a placeholder * * @param object The article object. Note $article->text is also available * @param object The article params * @param int The 'page' number * @return string */ function onBeforeDisplayContent( &$article, &$params, $limitstart ) { global $mainframe; return ''; } /** * Example after display content method * * Method is called by the view and the results are imploded and displayed in a placeholder * * @param object The article object. Note $article->text is also available * @param object The article params * @param int The 'page' number * @return string */ function onAfterDisplayContent( &$article, &$params, $limitstart ) { global $mainframe; return ''; } /** * Example before save content method * * Method is called right before content is saved into the database. * Article object is passed by reference, so any changes will be saved! * NOTE: Returning false will abort the save with an error. * You can set the error by calling $article->setError($message) * * @param object A JTableContent object * @param bool If the content is just about to be created * @return bool If false, abort the save */ function onBeforeContentSave( &$article, $isNew ) { global $mainframe; return true; } /** * Example after save content method * Article is passed by reference, but after the save, so no changes will be saved. * Method is called right after the content is saved * * * @param object A JTableContent object * @param bool If the content is just about to be created * @return void */ function onAfterContentSave( &$article, $isNew ) { global $mainframe; return true; } }