Exemplo n.º 1
0
 function renderInput($articleid, $fieldsid, $value, $extras = null)
 {
     $directory = "";
     if (JFactory::getApplication()->isAdmin()) {
         $directory = "";
     }
     $session =& JFactory::getSession();
     $session->set('articleid', $articleid);
     $session->set('fieldsattachid', $fieldsid);
     $sitepath = fieldsattachHelper::getabsoluteURL();
     $str_gallery = '<div id="gallery_' . $fieldsid . '" class="galleryfield">' . plgfieldsattachment_imagegallery::getGallery1($articleid, $fieldsid) . '</div>';
     $str = '';
     $str .= $str_gallery;
     $str .= "<script type=\"text/javascript\">\n                                        \n\t\t\t\t\t\twindow.addEvent('domready', function(){\n\t\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t\t  update_gallery" . $fieldsid . "(); \n\t\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t}); \n                                               \n\t\t\t\t\t\t\n\t\t\t\t\t\tfunction update_gallery" . $fieldsid . "()\n\t\t\t\t\t\t{\n                                                        \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t  \tvar url_" . $fieldsid . " = \"" . JURI::base(false) . "/index.php?option=com_fieldsattach&view=fieldsattachimagesajax&tmpl=component&catid=" . $articleid . "&fieldsid=" . $fieldsid . "\";\n\t\t\t\t\t\t \t \n                                                        var xmlhttp;\n                                                        if (window.XMLHttpRequest)\n                                                        {// code for IE7+, Firefox, Chrome, Opera, Safari\n                                                        xmlhttp=new XMLHttpRequest();\n                                                        }\n                                                        else\n                                                        {// code for IE6, IE5\n                                                        xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n                                                        }\n                                                        xmlhttp.onreadystatechange=function()\n                                                        {\n                                                        if (xmlhttp.readyState==4 && xmlhttp.status==200)\n                                                            {\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"gallery_" . $fieldsid . "\").innerHTML=xmlhttp.responseText;\n\t\t\t\t\t\t\t\t\tSqueezeBox.initialize({});\n\t\t\t\t\t\t\t\t\tSqueezeBox.assign(\$\$('#gallery_" . $fieldsid . " a.modal'), { parse: 'rel'});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//Sortable ********************************* \n\t\t\t\t\t\t\t\t\tjQuery( '#gallerysortable" . $fieldsid . "' ).sortable(\n\t\t\t\t\t\t\t\t\t\t\t  {\n\t\t\t\t\t\t\t\t\t\t\t  update:  function (event, ui) {\n\t\t\t\t\t\t\t\t\t\t\t\t  //Update the position\n\t\t\t\t\t\t\t\t\t\t\t\t  update_order(" . $fieldsid . ");\n\t\t\t\t\t\t\t\t\t\t\t  }});\n\t\t\t\t\t\t\t\t\tjQuery( '#gallerysortable" . $fieldsid . "' ).disableSelection();\n                                                      \n                                                            }\n                                                        }\n                                                        xmlhttp.open(\"GET\",  url_" . $fieldsid . " ,true);\n                                                        xmlhttp.send(); \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tfunction update_order(fieldsattachid)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t      //Get order *****\n\t\t\t\t\t\t      var tmparray  = new Array();\n\t\t\t\t\t\t      var cont = 0;\n\t\t\t\t\t\t      jQuery( '#gallerysortable'+fieldsattachid+' li' ).each\n\t\t\t\t\t\t      ( \n\t\t\t\t\t\t\t       function(){\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\tvar id = jQuery(this).attr('id');\n\t\t\t\t\t\t\t\t\tvar  tmp = String(id).split('_'); \n\t\t\t\t\t\t\t\t\ttmparray[cont] = tmp[2];\n\t\t\t\t\t\t\t\t\tcont++;\n\t\t\t\t\t\t\t       }\n\t\t\t\t\t\t      );\n\t\t\t\t\t\t      \n\t\t\t\t\t\t      //AJAX CALL *****\n\t\t\t\t\t\t      var url  = \"" . JURI::root(false) . "/administrator/index.php?option=com_fieldsattach&task=fieldsattachimagesorderajax&catid=" . $articleid . "&fieldsid=\"+fieldsattachid+\"&order=\"+tmparray.toString();\n\t\t\t\t\t\t       \n                                                      var xmlhttp;\n\t\t\t\t\t\t      if (window.XMLHttpRequest)\n\t\t\t\t\t\t      {// code for IE7+, Firefox, Chrome, Opera, Safari\n\t\t\t\t\t\t      xmlhttp=new XMLHttpRequest();\n\t\t\t\t\t\t      }\n\t\t\t\t\t\t      else\n\t\t\t\t\t\t      {// code for IE6, IE5\n\t\t\t\t\t\t      xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t\t\t\t      }\n\t\t\t\t\t\t      xmlhttp.onreadystatechange=function()\n\t\t\t\t\t\t      {\n\t\t\t\t\t\t      if (xmlhttp.readyState==4 && xmlhttp.status==200)\n\t\t\t\t\t\t\t  {\n\t\t\t\t\t\t\t\t     // alert(xmlhttp.responseText);\n\t\t\t\t\t\t\t  }\n\t\t\t\t\t\t      }\n\t\t\t\t\t\t      xmlhttp.open(\"GET\",  url ,true);\n\t\t\t\t\t\t      xmlhttp.send(); \n\t\t\t\t\t\t      \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t</script>";
     return $str;
 }
Exemplo n.º 2
0
 function renderInput($articleid, $fieldsid, $value, $extras = null)
 {
     $directory = "";
     if (JFactory::getApplication()->isAdmin()) {
         $directory = "";
     }
     $session =& JFactory::getSession();
     $session->set('articleid', $articleid);
     $session->set('fieldsattachid', $fieldsid);
     $sitepath = fieldsattachHelper::getabsoluteURL();
     $str_gallery = '<div id="gallery_' . $fieldsid . '" class="galleryfield" style="margin-top:50px;">' . plgfieldsattachment_imagegallery::getGallery1($articleid, $fieldsid) . '</div>';
     $str = '';
     /*$str .=  '<div style=" position:relative; width:150px;  overflow: hidden;">
           <div  class="button2-left" >
           <div class="image" >';
       if ((JRequest::getVar('option')=='com_categories' && JRequest::getVar('layout')=="edit"   ))
       {
           $str  .='<a class="modal-button" title="Article" href="'.$sitepath.'/administrator/index.php?option=com_fieldsattach&amp;view=fieldsattachimages&amp;tmpl=component&amp;catid='.$articleid.'&amp;fieldsattachid='.$fieldsid.'&amp;reset=1" onclick="IeCursorFix(); return false;" rel="{handler: \'iframe\', size: {x: 980, y: 500}}">';
        }else{
           $str  .='<a class="modal-button" title="Article" href="'.$sitepath.'/administrator/index.php?option=com_fieldsattach&amp;view=fieldsattachimages&amp;tmpl=component&amp;articleid='.$articleid.'&amp;catid='.$articleid.'&amp;fieldsattachid='.$fieldsid.'&amp;reset=1" onclick="IeCursorFix(); return false;" rel="{handler: \'iframe\', size: {x: 980, y: 500}}">';
       }
        $str  .=JText::_("Gallery administrator");
        $str  .=' 
               </a>
               </div>
               </div>
               </div>';*/
     /*$str .= '<div style="position:relative; float:right; top:0px;"><a class=\'modal\' rel=\'{handler: "iframe", size: {x: 980, y: 500}}\' href=\'index.php?option=com_fieldsattach&view=fieldsattachimage&layout=edit&tmpl=component&reset=2\'></a>
     			';
                $str .= "<a href='#' onclick='update_gallery".$fieldsid."();return false;'><img src='components/com_fieldsattach/images/icon-refresh.png' alt='refresh' /></a>";
     		$str .= "<a class='modal' rel='{handler: \"iframe\", size: {x: 980, y: 500}}' href='index.php?option=com_fieldsattach&view=fieldsattachimage&layout=edit&tmpl=component&reset=2'><img src='components/com_fieldsattach/images/icon-32-new.png' alt='refresh' /></a>";
     		$str .= '</div>';*/
     $str .= $str_gallery;
     $str .= "<script type=\"text/javascript\">\n                                        \n\t\t\t\t\t\twindow.addEvent('domready', function(){\n\t\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t\t  update_gallery" . $fieldsid . "(); \n\t\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t}); \n                                               \n\t\t\t\t\t\t\n\t\t\t\t\t\tfunction update_gallery" . $fieldsid . "()\n\t\t\t\t\t\t{\n                                                        \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t  \tvar url_" . $fieldsid . " = \"" . JURI::base(false) . "/index.php?option=com_fieldsattach&view=fieldsattachimagesajax&tmpl=component&catid=" . $articleid . "&fieldsid=" . $fieldsid . "\";\n\t\t\t\t\t\t \t \n                                                        var xmlhttp;\n                                                        if (window.XMLHttpRequest)\n                                                        {// code for IE7+, Firefox, Chrome, Opera, Safari\n                                                        xmlhttp=new XMLHttpRequest();\n                                                        }\n                                                        else\n                                                        {// code for IE6, IE5\n                                                        xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n                                                        }\n                                                        xmlhttp.onreadystatechange=function()\n                                                        {\n                                                        if (xmlhttp.readyState==4 && xmlhttp.status==200)\n                                                            {\n                                                                 document.getElementById(\"gallery_" . $fieldsid . "\").innerHTML=xmlhttp.responseText;\n                                                                 SqueezeBox.initialize({});\n                                                                 SqueezeBox.assign(\$\$('#gallery_" . $fieldsid . " a.modal'), { parse: 'rel'});\n                                                      \n                                                            }\n                                                        }\n                                                        xmlhttp.open(\"GET\",  url_" . $fieldsid . " ,true);\n                                                        xmlhttp.send(); \n\t\t\t\t\t\t}\n\t\t\t\t</script>";
     return $str;
 }
Exemplo n.º 3
0
<?php

/**
 * @version		$Id: default.php 15 2011-09-02 18:37:15Z cristian $
 * @package		fieldsattach
 * @subpackage		Components
 * @copyright		Copyright (C) 2011 - 2020 Open Source Cristian Grañó, Inc. All rights reserved.
 * @author		Cristian Grañó
 * @link		http://joomlacode.org/gf/project/fieldsattach_1_6/
 * @license		License GNU General Public License version 2 or later
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted Access');
$sitepath = JPATH_SITE;
JLoader::register('fieldsattachHelper', $sitepath . DS . 'administrator/components/com_fieldsattach/helpers/fieldsattach.php');
// load tooltip behavior
JHtml::_('behavior.tooltip');
JPluginHelper::importPlugin('fieldsattachment');
// very important
//renderInput
plgfieldsattachment_imagegallery::construct();
//$articleid, $fieldsid, $value, $extras=null
$articleid = JRequest::getVar("catid");
$fieldsid = JRequest::getVar("fieldsid");
//echo plgfieldsattachment_imagegallery::renderInput($articleid, $fieldsid, null);
//echo fieldsattachHelper::getGallery($articleid, $fieldsid);
echo plgfieldsattachment_imagegallery::getGallery1($articleid, $fieldsid);
?>