コード例 #1
0
ファイル: openstreetmap.php プロジェクト: Jobar87/fabrik
	/**
	 * load the javascript class that manages interaction with the form element
	 * should only be called once
	 * @return string javascript class file
	 */

	function formJavascriptClass(&$srcs)
	{
		static $jsloaded;
		if (!isset($jsloaded)) {
			$document = JFactory::getDocument();
			$params = $this->getParams();

			$document->addScript("http://www.openlayers.org/api/OpenLayers.js");
			parent::formJavascriptClass($srcs);
			FabrikHelperHTML::script('components/com_fabrik/libs/openlayers/openlayers_ext.js', true);

			if ($params->get('fb_osm_virtualearthlayers')) {
				$document->addScript('http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1');
			}

			if ($params->get('fb_osm_gmlayers')) {
				$src = "http://maps.google.com/maps?file=api&v=2&key=" . $params->get('fb_osm_gm_key');
				$document->addScript($src);
			}

			if ($params->get('fb_osm_yahoolayers')) {
				$yahooid = $params->get('fb_yahoo_key');
				$document->addScript('http://api.maps.yahoo.com/ajaxymap?v=3.8&appid='.$yahooid);
			}

			$document->addScript('http://www.openstreetmap.org/openlayers/OpenStreetMap.js');
			$jsloaded = true;
		}

	}
コード例 #2
0
ファイル: googlemap.php プロジェクト: nine007/fabrik
 /**
  * load the javascript class that manages interaction with the form element
  * should only be called once
  * @return string javascript class file
  */
 function formJavascriptClass(&$srcs)
 {
     $src = "http://maps.google.com/maps/api/js?sensor=" . $this->getParams()->get('fb_gm_sensor', 'false');
     $src .= "&callback=googlemapload";
     parent::formJavascriptClass($srcs, $src);
     parent::formJavascriptClass($srcs);
 }
コード例 #3
0
ファイル: user.php プロジェクト: juliano-hallac/fabrik
 /**
  * load the javascript class that manages interaction with the form element
  * should only be called once
  * @return string javascript class file
  */
 function formJavascriptClass(&$srcs)
 {
     plgFabrik_Element::formJavascriptClass($srcs, 'plugins/fabrik_element/databasejoin/databasejoin.js');
     parent::formJavascriptClass($srcs);
 }
コード例 #4
0
ファイル: databasejoin.php プロジェクト: nine007/fabrik
 /**
  * @param array already loaded plugin scripts
  * load the javascript class that manages interaction with the form element
  * should only be called once
  * @since 3.0
  */
 function formJavascriptClass(&$srcs)
 {
     plgFabrik_Element::formJavascriptClass($srcs, 'media/com_fabrik/js/window.js');
     parent::formJavascriptClass($srcs);
 }
コード例 #5
0
ファイル: usergroup.php プロジェクト: rogeriocc/fabrik
 public function formJavascriptClass(&$srcs, $script = '')
 {
     plgFabrik_Element::formJavascriptClass($srcs, 'plugins/fabrik_element/usergroup/usergroup.js');
     parent::formJavascriptClass($srcs, $script);
 }
コード例 #6
0
ファイル: slideshow.php プロジェクト: Jobar87/fabrik
	/**
	 * load the javascript class that manages interaction with the form element
	 * should only be called once
	 * @return string javascript class file
	 */

	function formJavascriptClass(&$srcs)
	{
		// @FIXME the js paths are not right for fabrik3
		$params = $this->getParams();
		$document = JFactory::getDocument();
		$params = $this->getParams();
		$slideshow_type = $params->get('slideshow_type', 1);
		$src = COM_FABRIK_LIVESITE.DS.'components'.DS.'com_fabrik'.DS.'plugins'.DS.'element'.DS.'fabrikslideshow'.DS.'lib'.DS.'slideshow2'.DS.'js'.DS.'slideshow.js';
		$document->addScript($src);
		switch ($slideshow_type) {
			case 1:
				break;
			case 2:
				$src = COM_FABRIK_LIVESITE.DS.'components'.DS.'com_fabrik'.DS.'plugins'.DS.'element'.DS.'fabrikslideshow'.DS.'lib'.DS.'slideshow2'.DS.'js'.DS.'slideshow.kenburns.js';
				$document->addScript($src);
				break;
			case 3:
				$src = COM_FABRIK_LIVESITE.DS.'components'.DS.'com_fabrik'.DS.'plugins'.DS.'element'.DS.'fabrikslideshow'.DS.'lib'.DS.'slideshow2'.DS.'js'.DS.'slideshow.push.js';
				$document->addScript($src);
				break;
			case 4:
				$src = COM_FABRIK_LIVESITE.DS.'components'.DS.'com_fabrik'.DS.'plugins'.DS.'element'.DS.'fabrikslideshow'.DS.'lib'.DS.'slideshow2'.DS.'js'.DS.'slideshow.fold.js';
				$document->addScript($src);
				break;
			default:
				break;
		}
		JHTML::stylesheet('slideshow.css', 'components'.DS.'com_fabrik'.DS.'plugins'.DS.'element'.DS.'fabrikslideshow'.DS.'lib'.DS.'slideshow2'.DS.'css'.DS);
		parent::formJavascriptClass($srcs);
	}
コード例 #7
0
ファイル: elementlist.php プロジェクト: rogeriocc/fabrik
 /**
  * get the class to manage the form element
  * if a plugin class requires to load another elements class (eg user for dbjoin then it should
  * call FabrikModelElement::formJavascriptClass('plugins/fabrik_element/databasejoin/databasejoin.js', true);
  * to ensure that the file is loaded only once
  *
  * @param   array   &$srcs   scripts previously loaded (load order is important as we are loading via head.js
  * and in ie these load async. So if you this class extends another you need to insert its location in $srcs above the
  * current file
  * @param   string  $script  script to load once class has loaded
  *
  * @return void
  */
 public function formJavascriptClass(&$srcs, $script = '')
 {
     $files = array('media/com_fabrik/js/element.js', 'media/com_fabrik/js/elementlist.js');
     foreach ($files as $file) {
         if (!in_array($file, $srcs)) {
             $srcs[] = $file;
         }
     }
     parent::formJavascriptClass($srcs, $script);
 }
コード例 #8
0
ファイル: fileupload.php プロジェクト: rogeriocc/fabrik
 /**
  * Get the class to manage the form element
  *
  * @param   array   &$srcs   scripts previously loaded (load order is important as we are loading via head.js
  * and in ie these load async. So if you this class extends another you need to insert its location in $srcs above the
  * current file
  * @param   string  $script  script to load once class has loaded
  *
  * @return void
  */
 public function formJavascriptClass(&$srcs, $script = '')
 {
     /**
      * $$$ hugh - adding js.new folder to make it easier to test new plupload git releases
      * I just copy new stuff into js.new, and un-comment one of these as appropriate
      */
     $js_dir = 'js';
     // $js_dir = 'js.new';
     $params = $this->getParams();
     if ($params->get('ajax_upload')) {
         $prefix = JDEBUG ? '' : '.min';
         $runtimes = $params->get('ajax_runtime', 'html5');
         $folder = 'plugins/fabrik_element/fileupload/lib/plupload/';
         parent::formJavascriptClass($srcs, $folder . $js_dir . '/plupload' . $prefix . '.js');
         if (strstr($runtimes, 'html5')) {
             parent::formJavascriptClass($srcs, $folder . $js_dir . '/plupload.html5' . $prefix . '.js');
         }
         if (strstr($runtimes, 'html4')) {
             parent::formJavascriptClass($srcs, $folder . $js_dir . '/plupload.html4' . $prefix . '.js');
         }
         if (strstr($runtimes, 'gears')) {
             parent::formJavascriptClass($srcs, $folder . $js_dir . '/gears_init.js');
             parent::formJavascriptClass($srcs, $folder . $js_dir . '/plupload.gears' . $prefix . '.js');
         }
         if (strstr($runtimes, 'flash')) {
             parent::formJavascriptClass($srcs, $folder . $js_dir . '/plupload.flash' . $prefix . '.js');
         }
         if (strstr($runtimes, 'silverlight')) {
             parent::formJavascriptClass($srcs, $folder . $js_dir . '/plupload.silverlight' . $prefix . '.js');
         }
         if (strstr($runtimes, 'browserplus')) {
             parent::formJavascriptClass($srcs, $folder . $js_dir . '/plupload.browserplus' . $prefix . '.js');
         }
     }
     parent::formJavascriptClass($srcs, $script);
     static $elementclasses;
     if (!isset($elementclasses)) {
         $elementclasses = array();
     }
     // Load up the default scipt
     if ($script == '') {
         $script = 'plugins/fabrik_element/' . $this->getElement()->plugin . '/' . $this->getElement()->plugin . '.js';
     }
     if (empty($elementclasses[$script])) {
         $srcs[] = $script;
         $elementclasses[$script] = 1;
     }
     // $$$ hugh - added this, and some logic in the view, so we will get called on a per-element basis
     return false;
 }
コード例 #9
0
ファイル: fileupload.php プロジェクト: romuland/khparts
 /**
  * @param array of scripts previously loaded (load order is important as we are loading via head.js
  * and in ie these load async. So if you this class extends another you need to insert its location in $srcs above the
  * current file
  *
  * get the class to manage the form element
  * if a plugin class requires to load another elements class (eg user for dbjoin then it should
  * call FabrikModelElement::formJavascriptClass('plugins/fabrik_element/databasejoin/databasejoin.js', true);
  * to ensure that the file is loaded only once
  */
 function formJavascriptClass(&$srcs, $script = '')
 {
     $params = $this->getParams();
     if ($params->get('ajax_upload')) {
         $prefix = JDEBUG ? '' : '.min';
         $runtimes = $params->get('ajax_runtime', 'html5');
         parent::formJavascriptClass($srcs, 'plugins/fabrik_element/fileupload/lib/plupload/js/plupload' . $prefix . '.js');
         if (strstr($runtimes, 'html5')) {
             parent::formJavascriptClass($srcs, 'plugins/fabrik_element/fileupload/lib/plupload/js/plupload.html5' . $prefix . '.js');
         }
         if (strstr($runtimes, 'html4')) {
             parent::formJavascriptClass($srcs, 'plugins/fabrik_element/fileupload/lib/plupload/js/plupload.html4' . $prefix . '.js');
         }
         if (strstr($runtimes, 'gears')) {
             parent::formJavascriptClass($srcs, 'plugins/fabrik_element/fileupload/lib/plupload/js/gears_init.js');
             parent::formJavascriptClass($srcs, 'plugins/fabrik_element/fileupload/lib/plupload/js/plupload.gears' . $prefix . '.js');
         }
         if (strstr($runtimes, 'flash')) {
             parent::formJavascriptClass($srcs, 'plugins/fabrik_element/fileupload/lib/plupload/js/plupload.flash' . $prefix . '.js');
         }
         if (strstr($runtimes, 'silverlight')) {
             parent::formJavascriptClass($srcs, 'plugins/fabrik_element/fileupload/lib/plupload/js/plupload.silverlight' . $prefix . '.js');
         }
         if (strstr($runtimes, 'browserplus')) {
             parent::formJavascriptClass($srcs, 'plugins/fabrik_element/fileupload/lib/plupload/js/plupload.browserplus' . $prefix . '.js');
         }
     }
     parent::formJavascriptClass($srcs, $script);
     static $elementclasses;
     if (!isset($elementclasses)) {
         $elementclasses = array();
     }
     //load up the default scipt
     if ($script == '') {
         $script = 'plugins/fabrik_element/' . $this->getElement()->plugin . '/' . $this->getElement()->plugin . '.js';
     }
     if (empty($elementclasses[$script])) {
         $srcs[] = $script;
         $elementclasses[$script] = 1;
     }
 }
コード例 #10
0
ファイル: kaltura.php プロジェクト: rogeriocc/fabrik
 /**
  * load the javascript class that manages interaction with the form element
  * should only be called once
  * @return string javascript class file
  */
 function formJavascriptClass(&$srcs)
 {
     parent::formJavascriptClass($srcs);
 }
コード例 #11
0
ファイル: link.php プロジェクト: rhotog/fabrik
 /**
  * @param array of scripts previously loaded (load order is important as we are loading via head.js
  * and in ie these load async. So if you this class extends another you need to insert its location in $srcs above the
  * current file
  *
  * get the class to manage the form element
  * if a plugin class requires to load another elements class (eg user for dbjoin then it should
  * call FabrikModelElement::formJavascriptClass('plugins/fabrik_element/databasejoin/databasejoin.js', true);
  * to ensure that the file is loaded only once
  */
 function formJavascriptClass(&$srcs, $script = '')
 {
     //whilst link isnt really an element list we can use its js AddNewEvent method
     $elementList = 'media/com_fabrik/js/elementlist.js';
     if (!in_array($elementList, $srcs)) {
         $srcs[] = $elementList;
     }
     parent::formJavascriptClass($srcs, $script);
 }
コード例 #12
0
ファイル: kaltura.php プロジェクト: juliano-hallac/fabrik
 /**
  * load the javascript class that manages interaction with the form element
  * should only be called once
  * @return string javascript class file
  */
 function formJavascriptClass(&$srcs)
 {
     FabrikHelperHTML::script('media/com_fabrik/js/swfobject.js', false);
     parent::formJavascriptClass($srcs);
 }
コード例 #13
0
ファイル: youtube.php プロジェクト: rogeriocc/fabrik
 /**
  * get the class to manage the form element
  * if a plugin class requires to load another elements class (eg user for dbjoin then it should
  * call FabrikModelElement::formJavascriptClass('plugins/fabrik_element/databasejoin/databasejoin.js', true);
  * to ensure that the file is loaded only once
  *
  * @param   array   &$srcs   scripts previously loaded (load order is important as we are loading via head.js
  * and in ie these load async. So if you this class extends another you need to insert its location in $srcs above the
  * current file
  * @param   string  $script  script to load once class has loaded
  *
  * @return void
  */
 function formJavascriptClass(&$srcs, $script = '')
 {
     plgFabrik_Element::formJavascriptClass($srcs, 'plugins/fabrik_element/youtube/youtube.js');
     parent::formJavascriptClass($srcs);
 }
コード例 #14
0
ファイル: date.php プロジェクト: rogeriocc/fabrik
 /**
  * get the class to manage the form element
  * if a plugin class requires to load another elements class (eg user for dbjoin then it should
  * call FabrikModelElement::formJavascriptClass('plugins/fabrik_element/databasejoin/databasejoin.js', true);
  * to ensure that the file is loaded only once
  *
  * @param   array   &$srcs   scripts previously loaded (load order is important as we are loading via head.js
  * and in ie these load async. So if you this class extends another you need to insert its location in $srcs above the
  * current file
  * @param   string  $script  script to load once class has loaded
  *
  * @return void
  */
 public function formJavascriptClass(&$srcs, $script = '')
 {
     $prefix = JDEBUG ? '' : '-min';
     $params = $this->getParams();
     if ($params->get('date_advanced', '0') == '1') {
         if (empty($prefix)) {
             parent::formJavascriptClass($srcs, 'media/com_fabrik/js/lib/datejs/date' . $prefix . '.js');
             parent::formJavascriptClass($srcs, 'media/com_fabrik/js/lib/datejs/core' . $prefix . '.js');
             parent::formJavascriptClass($srcs, 'media/com_fabrik/js/lib/datejs/parser' . $prefix . '.js');
             parent::formJavascriptClass($srcs, 'media/com_fabrik/js/lib/datejs/extras' . $prefix . '.js');
         } else {
             parent::formJavascriptClass($srcs, 'media/com_fabrik/js/lib/datejs/date.js');
             parent::formJavascriptClass($srcs, 'media/com_fabrik/js/lib/datejs/core.js');
             parent::formJavascriptClass($srcs, 'media/com_fabrik/js/lib/datejs/parser.js');
             parent::formJavascriptClass($srcs, 'media/com_fabrik/js/lib/datejs/extras.js');
         }
     }
     parent::formJavascriptClass($srcs);
     // Return false, as we need to be called on per-element (not per-plugin) basis
     return false;
 }