Skip to content

Commit

Permalink
Fix PHPCS warnings and Update version to 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Aug 3, 2013
1 parent 1ed4fdf commit d6693b2
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 112 deletions.
7 changes: 6 additions & 1 deletion changelog.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// no direct access
// No direct access
die('Restricted access');

?>
Expand All @@ -15,6 +15,11 @@
- -> Removed
! -> Note

Version 1.3.1
# Bug fix for some users unable to open LastFM and Google+ tabs
^ PHPCS fixes to Joomla Standards
+ Max-width and target parameters added

Version 1.3.0
+ Added ability to use jQuery instead of CSS3 animations

Expand Down
181 changes: 100 additions & 81 deletions mod_social_slider/mod_social_slider.php
Original file line number Diff line number Diff line change
@@ -1,56 +1,69 @@
<?php
/**
* @package JJ Social Slider
* @author JoomJunk
* @copyright Copyright (C) 2011 - 2013 JoomJunk. All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html
* @package JJ_Social_Slider
* @author JoomJunk <admin@joomjunk.co.uk>
* @copyright Copyright (C) 2011 - 2013 JoomJunk. All Rights Reserved
* @license GPL v3.0 or later http://www.gnu.org/licenses/gpl-3.0.html
*/

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

$document = JFactory::getDocument();

if($params->get('jquery_css') == 0){
if(version_compare(JVERSION,'3.0.0','ge')) {
if ($params->get('jquery_css') == 0)
{
if (version_compare(JVERSION, '3.0.0', 'ge'))
{
JHtml::_('jquery.framework');
}
else
{
if($params->get('jquery') == 0){
if(!JFactory::getApplication()->get('jquery')){
JFactory::getApplication()->set('jquery',true);
if ($params->get('jquery') == 0)
{
if (!JFactory::getApplication()->get('jquery'))
{
JFactory::getApplication()->set('jquery', true);
$document->addScript("http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js");
}
}
elseif($params->get('jquery') == 1){
if(!JFactory::getApplication()->get('jquery')){
JFactory::getApplication()->set('jquery',true);
elseif ($params->get('jquery') == 1)
{
if (!JFactory::getApplication()->get('jquery'))
{
JFactory::getApplication()->set('jquery', true);
$document->addScript(JUri::root() . "modules/mod_social_slider/assets/jquery.js");
}
}
}
}

$style1 = 'ul#jj_sl_navigation li a {'
$style1 = 'ul#jj_sl_navigation li a {'
. 'background-color:#' . $params->get('slide_colour') . ';'
. 'text-align:' . $params->get('position') . ';'
. '}';
$document->addStyleDeclaration($style1);
if ($params->get('disable') == 1) {
$mobile = '@media screen and (max-width: ' . $params->get("mobile_width", "480px") . '){'

if ($params->get('disable') == 1)
{
$mobile = '@media screen and (max-width: ' . $params->get("mobile_width", "480px") . '){'
. 'ul#jj_sl_navigation { display: none; }'
. '}';
$document->addStyleDeclaration($mobile);
$document->addStyleDeclaration($mobile);
}
if ($params->get('disable') == 2) {
$mobile_tablet = '@media screen and (max-width: ' . $params->get("tablet_width", "768px") . '){'

if ($params->get('disable') == 2)
{
$mobile_tablet = '@media screen and (max-width: ' . $params->get("tablet_width", "768px") . '){'
. 'ul#jj_sl_navigation { display: none; }'
. '}';
$document->addStyleDeclaration($mobile_tablet);
$document->addStyleDeclaration($mobile_tablet);
}
if ($params->get('position') == "left") {
if($params->get('jquery_css') == 0){

if ($params->get('position') == "left")
{
if ($params->get('jquery_css') == 0)
{
$js_left = '
(function($){
$(function() {
Expand All @@ -69,8 +82,10 @@ function () {
$css = '';
$document->addScriptDeclaration($js_left);
}
if($params->get('jquery_css') == 1){
$css='ul#jj_sl_navigation li { '

if ($params->get('jquery_css') == 1)
{
$css = 'ul#jj_sl_navigation li { '
. 'margin-left: -140px;'
. '-webkit-transition: margin-left 0.3s;'
. '-moz-transition: margin-left 0.3s;'
Expand All @@ -79,8 +94,9 @@ function () {
. 'transition: margin-left 0.3s;'
. '}';
}

$style = 'ul#jj_sl_navigation { '
. $params->get('position') .':0px;'
. $params->get('position') . ':0px;'
. 'top:' . $params->get('top') . 'px;'
. '}'
. 'ul#jj_sl_navigation li:hover { '
Expand All @@ -94,86 +110,87 @@ function () {
. 'background-position: 144px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/facebook-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .twitter a {'
. 'ul#jj_sl_navigation .twitter a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/twitter-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .google a {'
. 'ul#jj_sl_navigation .google a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/google-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .myspace a {'
. 'ul#jj_sl_navigation .myspace a {'
. 'background-position: 144px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/myspace-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .youtube a {'
. 'ul#jj_sl_navigation .youtube a {'
. 'background-position: 144px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/youtube-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .linkedin a {'
. 'ul#jj_sl_navigation .linkedin a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/linkedin-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .steam a {'
. '}'
. 'ul#jj_sl_navigation .steam a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/steam-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .lastfm a {'
. 'ul#jj_sl_navigation .lastfm a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/lastfm-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .pinterest a {'
. 'ul#jj_sl_navigation .pinterest a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/pinterest-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .soundcloud a {'
. 'ul#jj_sl_navigation .soundcloud a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/soundcloud-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .tumblr a {'
. 'ul#jj_sl_navigation .tumblr a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/tumblr-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .github a {'
. 'ul#jj_sl_navigation .github a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/github-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .flickr a {'
. 'ul#jj_sl_navigation .flickr a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/flickr-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .rss a {'
. 'ul#jj_sl_navigation .rss a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/rss-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .vimeo a {'
. 'ul#jj_sl_navigation .vimeo a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/vimeo-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .custom1 a {'
. 'ul#jj_sl_navigation .custom1 a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/' . $params->get('custom1_image') . ');'
. '}'
.'ul#jj_sl_navigation .custom2 a {'
. 'ul#jj_sl_navigation .custom2 a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/' . $params->get('custom2_image') . ');'
. '}'
.'ul#jj_sl_navigation .custom3 a {'
. 'ul#jj_sl_navigation .custom3 a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/' . $params->get('custom3_image') . ');'
. '}'
.'ul#jj_sl_navigation .custom4 a {'
. 'ul#jj_sl_navigation .custom4 a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/' . $params->get('custom4_image') . ');'
. '}'
.'ul#jj_sl_navigation .custom5 a {'
. 'ul#jj_sl_navigation .custom5 a {'
. 'background-position: 145px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/' . $params->get('custom5_image') . ');'
. '}'
;
}
else if ($params->get('position') == "right") {
if($params->get('jquery_css') == 0){
. '}';
}
elseif ($params->get('position') == "right")
{
if ($params->get('jquery_css') == 0)
{
$js_right = '
(function($){
$(function() {
Expand All @@ -192,8 +209,10 @@ function () {
$css = 'ul#jj_sl_navigation li {left: 140px;position: relative;}';
$document->addScriptDeclaration($js_right);
}
if($params->get('jquery_css') == 1){
$css= 'ul#jj_sl_navigation li { '

if ($params->get('jquery_css') == 1)
{
$css = 'ul#jj_sl_navigation li { '
. 'right: -138px;'
. 'position:relative;'
. '-webkit-transition: right 0.3s;'
Expand All @@ -202,101 +221,102 @@ function () {
. '-o-transition: right 0.3s;'
. 'transition: right 0.3s;'
. '}';
$margin='-2px';
$margin = '-2px';
}

$style = 'ul#jj_sl_navigation { '
. $params->get('position') .':0px;'
. $params->get('position') . ':0px;'
. 'top:' . $params->get('top') . 'px;'
. '}'
. 'ul#jj_sl_navigation li:hover { '
. 'right: 0px;'
. '}'
. 'ul#jj_sl_navigation li a { '
. 'padding: 11px 10px 11px 0px;'
. 'margin-right:'.$margin.';'
. 'margin-right:' . $margin . ';'
. '}'
. 'ul#jj_sl_navigation .facebook a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/facebook-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .twitter a {'
. 'ul#jj_sl_navigation .twitter a {'
. 'background-position: 5px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/twitter-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .google a {'
. 'ul#jj_sl_navigation .google a {'
. 'background-position: 5px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/google-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .myspace a {'
. 'ul#jj_sl_navigation .myspace a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/myspace-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .youtube a {'
. 'ul#jj_sl_navigation .youtube a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/youtube-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .linkedin a {'
. 'ul#jj_sl_navigation .linkedin a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/linkedin-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .steam a {'
. 'ul#jj_sl_navigation .steam a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/steam-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .lastfm a {'
. 'ul#jj_sl_navigation .lastfm a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/lastfm-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .pinterest a {'
. 'ul#jj_sl_navigation .pinterest a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/pinterest-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .soundcloud a {'
. 'ul#jj_sl_navigation .soundcloud a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/soundcloud-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .tumblr a {'
. 'ul#jj_sl_navigation .tumblr a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/tumblr-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .github a {'
. '}'
. 'ul#jj_sl_navigation .github a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/github-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .flickr a {'
. 'ul#jj_sl_navigation .flickr a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/flickr-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .rss a {'
. 'ul#jj_sl_navigation .rss a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/rss-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .vimeo a {'
. 'ul#jj_sl_navigation .vimeo a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/vimeo-' . $params->get('icon_colour') . '.png);'
. '}'
.'ul#jj_sl_navigation .custom1 a {'
. '}'
. 'ul#jj_sl_navigation .custom1 a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/' . $params->get('custom1_image') . ');'
. '}'
.'ul#jj_sl_navigation .custom2 a {'
. 'ul#jj_sl_navigation .custom2 a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/' . $params->get('custom2_image') . ');'
. '}'
.'ul#jj_sl_navigation .custom3 a {'
. 'ul#jj_sl_navigation .custom3 a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/' . $params->get('custom3_image') . ');'
. '}'
.'ul#jj_sl_navigation .custom4 a {'
. 'ul#jj_sl_navigation .custom4 a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/' . $params->get('custom4_image') . ');'
. '}'
.'ul#jj_sl_navigation .custom5 a {'
. 'ul#jj_sl_navigation .custom5 a {'
. 'background-position: 4px 50%;'
. 'background-image: url(' . JURI::root() . 'modules/mod_social_slider/assets/icons/' . $params->get('custom5_image') . ');'
. '}'
;
. '}';
}

$custom_css = 'ul#jj_sl_navigation .custom1 a:hover{
background-color: ' . $params->get('custom1_colour') . ';
}
Expand All @@ -316,5 +336,4 @@ function () {
$document->addStyleDeclaration($style);
$document->addStyleDeclaration($css);

require(JModuleHelper::getLayoutPath('mod_social_slider'));
?>
require JModuleHelper::getLayoutPath('mod_social_slider');
Loading

0 comments on commit d6693b2

Please sign in to comment.