Skip to content

Commit

Permalink
initial work
Browse files Browse the repository at this point in the history
  • Loading branch information
shamsbd71 committed Aug 1, 2016
0 parents commit 8af3309
Show file tree
Hide file tree
Showing 14 changed files with 402 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# OSX
.DS_Store
._*
.Spotlight-V100
.Trashes

# Windows
Thumbs.db
Desktop.ini

# PHPStorm
.idea/

# Sublime Text
*.sublime*

# Eclipse
.buildpath
.project
.settings

# Temp files
*.tmp
*.bak
*.swp
*~.nib
*~

# Build config
gulp-config.json
node_modules

# Sass cache
.sass-cache

# Default releases folder
releases/

# Never ignore
!.gitignore
!index.html
!index.php
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Xpert Google Map
Simple Joomla module for map
6 changes: 6 additions & 0 deletions gulp-config.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"wwwDir" : "/var/www/joomla-cms",
"browserConfig" : {
"proxy" : "localhost"
}
}
27 changes: 27 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
var requireDir = require('require-dir');

var dir = requireDir('./node_modules/joomla-gulp', {recurse: true});
var dir = requireDir('./joomla-gulp', {recurse: true});

// Load config
var extension = require('./package.json');
var gulp = require('gulp');
var zip = require('gulp-zip');
var rm = require('gulp-rimraf');
var replace = require('gulp-replace');
var es = require('event-stream');

//release
gulp.task('cleanRelease', function () {
return gulp.src('./releases', { read: false }).pipe(rm({ force: true }));
});


// identifies a dependent task must be complete before this one begins
gulp.task('release', ['cleanRelease'], function() {
modelZip = gulp.src('./src/**')
.pipe(replace(/##VERSION##/g, extension.version))
.pipe(replace(/##CREATIONDATE##/g, extension.creationDate))
.pipe(zip(extension.name + '_' + extension.version +'.zip'))
.pipe(gulp.dest('releases'));
});
38 changes: 38 additions & 0 deletions joomla-gulp/modules/frontend/map.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
var gulp = require('gulp');

var config = require('../../../gulp-config.json');

// Dependencies
var browserSync = require('browser-sync');
var rm = require('gulp-rimraf');
var gutil = require('gulp-util');

var baseTask = 'modules.frontend.map';
var extPath = './src';

// Clean
gulp.task('clean:' + baseTask, function() {
gulp.src([
config.wwwDir + '/language/en-GB/en-GB.mod_tx_google_map.ini',
config.wwwDir + '/language/en-GB/en-GB.mod_tx_google_map.sys.ini'
], { read: false }
).pipe(rm({ force: true }));

return gulp.src(config.wwwDir + '/modules/mod_tx_google_map', { read: false })
.pipe(rm({ force: true }));
});

// Copy module
gulp.task('copy:' + baseTask, ['clean:' + baseTask], function() {
gulp.src([
extPath + '/language/en-GB/**'
]).pipe(gulp.dest(config.wwwDir + '/language/en-GB'));
return gulp.src(extPath + '/**')
.pipe(gulp.dest(config.wwwDir + '/modules/mod_tx_google_map'));
});


// Watch: Module
gulp.task('watch:' + baseTask, function() {
gulp.watch(extPath + '/**', ['copy:' + baseTask, browserSync.reload]);
});
19 changes: 19 additions & 0 deletions mainfest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<updates>
<update>
<name>Xpert Google Map</name>
<description>Xpert Google Map Module Update</description>
<element>mod_tx_google_map</element>
<type>module</type>
<version>1.3.0</version>
<client>site</client>
<infourl title="Xpert Contact Module">https://github.com/themexpert/xpertcontact/releases/tag/1.3.0</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/themexpert/xpertcontact/releases/download/1.3.0/mod_tx_google_map_v1.3.0.zip</downloadurl>
</downloads>
<tags>
<tag>1.3.0</tag>
</tags>
<targetplatform name="joomla" version="3.0" />
</update>
</updates>
46 changes: 46 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "mod_tx_google_map",
"version": "1.3.0",
"creationDate": "01 Aug 2016",
"description": "Xpert Google Map for Joomla",
"main": "gulpfile.js",
"directories": {
"doc": "docs"
},
"dependencies": {
"event-stream": "^3.3.4"
},
"devDependencies": {
"browser-sync": "1.9.0",
"gulp": "3.9.0",
"gulp-changed": "1.1.0",
"gulp-imagemin": "0.5.1",
"gulp-minify-css": "0.3.13",
"gulp-rename": "1.2.0",
"gulp-replace": "0.3.0",
"gulp-rimraf": "0.1.1",
"gulp-uglify": "0.3.2",
"gulp-util": "3.0.2",
"gulp-zip": "0.3.4",
"joomla-gulp": "1.1.1",
"require-dir": "0.1.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git://github.com/themexpert/mod_tx_google_map.git"
},
"keywords": [
"googlemap",
"xpert",
"joomla"
],
"author": "ThemeXpert",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/themexpert/mod_tx_google_map/issues"
},
"homepage": "https://github.com/themexpert/mod_tx_google_map"
}
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
33 changes: 33 additions & 0 deletions src/language/en-GB/en-GB.mod_tx_google_map.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
MOD_TX_GOOGLE_MAP = "Xpert Google Map"
MOD_TX_GOOGLE_MAP_DESC="Xpert Google Map module for Joomla!. Google map require API key. Follow the link to create API key <a href='https://developers.google.com/maps/documentation/javascript/get-api-key' target='_blnk'>
Get a Key/Authentication<a>"

MOD_TX_GOOGLE_MAP_LAT_TITLE="Latitudes"
MOD_TX_GOOGLE_MAP_LAT_DESC="Provide the Latitudes value of your location."
MOD_TX_GOOGLE_MAP_LNG_TITLE="Longitudes"
MOD_TX_GOOGLE_MAP_LNG_DESC="Provide the Longitudes value of your location."
MOD_TX_GOOGLE_MAP_HEIGHT_TITLE="Height"
MOD_TX_GOOGLE_MAP_HEIGHT_DESC="Set the height of the module without px, eg. 300."
MOD_TX_GOOGLE_MAP_MOD_TX_GOOGLE_MAP_TYPE_TITLE="Map Type"
MOD_TX_GOOGLE_MAP_MOD_TX_GOOGLE_MAP_TYPE_DESC="Select type of Map to be displayed from the lists."
MOD_TX_GOOGLE_MAP_ZOOM_TITLE="Zoom"
MOD_TX_GOOGLE_MAP_ZOOM_DESC="Set the defualt Zoom value of your map."

MOD_TX_GOOGLE_MAP_LOCATION_HEADER = "<strong>Location</strong>"
MOD_TX_GOOGLE_MAP_TYPE_TITLE = "Map type"
MOD_TX_GOOGLE_MAP_TYPE_DESC = "Set map type"
MOD_TX_GOOGLE_MAP_TYPE_ROADMAP = "Roadmap"
MOD_TX_GOOGLE_MAP_TYPE_SATELLITE = "Satellite"
MOD_TX_GOOGLE_MAP_TYPE_HYBRID = "Hubrid"
MOD_TX_GOOGLE_MAP_TYPE_TERRAIN = "Terrain"

;api
MOD_TX_GOOGLE_MAP_API = "Api"
MOD_TX_GOOGLE_MAP_API_DESC = "Google map require API Key. To configure api key please check module description."

;marker
MOD_TX_GOOGLE_MAP_MARKER_IMAGE = "Marker Image"
MOD_TX_GOOGLE_MAP_MARKER_IMAGE_DESC = ""

; warning
MOD_TX_GOOGLE_MAP_CONFIG_PROPERLY = "Please provide the Latitudes and Longitudes value."
3 changes: 3 additions & 0 deletions src/language/en-GB/en-GB.mod_tx_google_map.sys.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MOD_TX_GOOGLE_MAP = "Xpert Google Map"
MOD_TX_GOOGLE_MAP_DESC="Xpert Google Map module for Joomla!. Google map require API key. Follow the link to create API key <a href='https://developers.google.com/maps/documentation/javascript/get-api-key' target='_blnk'>
Get a Key/Authentication<a>"
28 changes: 28 additions & 0 deletions src/mod_tx_google_map.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* @package Joomla.Site
* @subpackage mod_tx_google_map
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

//Parameters
$uniqid = $module->id;
$lat = $params->get ('lat');
$lng = $params->get ('lng');
$height = $params->get ('height',300);
$map_type = $params->get ('map_type','ROADMAP');
$zoom = $params->get ('zoom',8);

if( !empty($params->get ('marker_image', '')) ){
$marker_img = JUri::root(false) . '/' . $params->get ('marker_image', '');
}else{
$marker_img = 'http://maps.google.com/mapfiles/marker.png';
}

$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));

require JModuleHelper::getLayoutPath('mod_tx_google_map', $params->get('layout', 'default'));
79 changes: 79 additions & 0 deletions src/mod_tx_google_map.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="3.0" client="site" method="upgrade">
<name>MOD_TX_GOOGLE_MAP</name>
<author>ThemeXpert</author>
<authorEmail>info@themexpert</authorEmail>
<authorUrl>www.themexpet.com</authorUrl>
<creationDate>##CREATIONDATE##</creationDate>
<copyright>Copyright (C) 2010 - 2012 ThemeXpert. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<version>##VERSION##</version>
<description>MOD_TX_GOOGLE_MAP_DESC</description>

<languages folder="language">
<language tag="en-GB">en-GB/en-GB.mod_tx_google_map.ini</language>
<language tag="en-GB">en-GB/en-GB.mod_tx_google_map.sys.ini</language>
</languages>

<files>
<filename module="mod_tx_google_map">mod_tx_google_map.php</filename>
<folder>tmpl</folder>
<filename>index.html</filename>
</files>

<config>
<fields name="params">
<fieldset name="basic">

<field type="text" name="api" label="MOD_TX_GOOGLE_MAP_API" description="MOD_TX_GOOGLE_MAP_API_DESC"/>

<field type="media" name="marker_image" label="MOD_TX_GOOGLE_MAP_MARKER_IMAGE" description="MOD_TX_GOOGLE_MAP_MARKER_IMAGE_DESC"/>

<field type="spacer" name="location_header" label="MOD_TX_GOOGLE_MAP_LOCATION_HEADER" class="text-info"/>

<field name="lat" type="text" default="-33.8665" label="MOD_TX_GOOGLE_MAP_LAT_TITLE" description="MOD_TX_GOOGLE_MAP_LAT_DESC"/>

<field name="lng" type="text" default="151.1956" label="MOD_TX_GOOGLE_MAP_LNG_TITLE" description="MOD_TX_GOOGLE_MAP_LNG_DESC"/>

<field name="height" type="text" default="300" label="MOD_TX_GOOGLE_MAP_HEIGHT_TITLE" description="MOD_TX_GOOGLE_MAP_HEIGHT_DESC"/>

<field name="map_type" type="list" default="ROADMAP" label="MOD_TX_GOOGLE_MAP_TYPE_TITLE" description="MOD_TX_GOOGLE_MAP_TYPE_DESC">
<option value="ROADMAP">MOD_TX_GOOGLE_MAP_TYPE_ROADMAP</option>
<option value="SATELLITE">MOD_TX_GOOGLE_MAP_TYPE_SATELLITE</option>
<option value="HYBRID">MOD_TX_GOOGLE_MAP_TYPE_HYBRID</option>
<option value="TERRAIN">MOD_TX_GOOGLE_MAP_TYPE_TERRAIN</option>
</field>

<field name="zoom" type="text" default="15" label="MOD_TX_GOOGLE_MAP_ZOOM_TITLE" description="MOD_TX_GOOGLE_MAP_ZOOM_DESC"/>

<field name="enable_style" type="radio" class="btn-group" default="1" label="Style Map" description="Style map">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>

</fieldset>

<fieldset name="advanced">
<field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" />

<field name="moduleclass_sfx" type="textarea" default="" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"/>

<field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC">
<option value="1">JGLOBAL_USE_GLOBAL</option>
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
</field>

<field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC"/>
<field name="cachemode" type="hidden" default="itemid">
<option value="itemid"/>
</field>

</fieldset>
</fields>
</config>

<!-- UPDATESERVER DEFINITION -->
<updateservers>
<server type="extension" priority="1" name="Xpert Google Map Module">https://raw.githubusercontent.com/themexpert/mod_tx_google_map/master/mainfest.xml</server>
</updateservers>
</extension>
Loading

0 comments on commit 8af3309

Please sign in to comment.