first commit
63
modules/mod_roktabs/MD5SUMS
Normal file
@ -0,0 +1,63 @@
|
||||
063ed3be320235a7dc4dc6a1318b1c10 RT-LICENSE.php
|
||||
c66166c5ae530cd3cea4069c7b162006 admin/icons.css
|
||||
ec68da5aab719c0ecf5ab84d8cad6376 admin/icons.js
|
||||
cdde0999750afc770445bc0ecccfe1a3 admin/icons_25.js
|
||||
1988c3cc1384a3ac9b9a4129183248f3 admin/images/add.png
|
||||
68461ca5187cd2c6af08786467085f2b admin/images/delete.png
|
||||
8a3edb0428f11a404535d9134c90063f admin/images/index.html
|
||||
8a3edb0428f11a404535d9134c90063f admin/index.html
|
||||
1d3a6e0380af79ff4b9eb8083e24d71d fields/break.php
|
||||
1fef6dff8f511b4f27bc88df34cc53c7 fields/contenttype.php
|
||||
8a3edb0428f11a404535d9134c90063f fields/index.html
|
||||
1ee4b8dbf63481a29043169b71fdebd3 fields/k2categories.php
|
||||
f686c3d8bc37a16ed7a81243f797fe59 fields/k2check.php
|
||||
2c3e6750a85a83281d9aadae32e24df9 fields/roktabsicons.php
|
||||
cf52e03050e18a9c6de0ba42daec5d6e helper.php
|
||||
7a89e1f63c135ab6c45a07f778be6c82 images/icon_accept.gif
|
||||
cebf0d8c08804c222a97850ff556d6f7 images/icon_clock.gif
|
||||
3e084045f4247152a67c4bdce2a0684b images/icon_code.gif
|
||||
d63c31b681cbebc794c57f1e5e48f8a4 images/icon_comment.gif
|
||||
2aa5ea3766204090ad50b7fb44ea6265 images/icon_date.gif
|
||||
1fc438d311944ff37ecc93c16f01b2b1 images/icon_email.gif
|
||||
802387dee178715cd52e310304ff81d4 images/icon_favourites.gif
|
||||
0b3a22de911b3fe1ecbcdd1333567bfc images/icon_forward.gif
|
||||
920f06337fb9dac87bc010f4c03389d7 images/icon_home.gif
|
||||
cfa352c051609ccd737e549cabd8a3dd images/icon_info.gif
|
||||
64706912cc465b279f6ff38ee4a77d01 images/icon_key.gif
|
||||
b2ba0ea15e7daeb77971ea4f0f63a15d images/icon_mail.gif
|
||||
f9106fb2f4f4c953bc6bdac9337f0ae8 images/icon_note.gif
|
||||
1ea5665e4054cb2076223708122c62ff images/icon_package_get.gif
|
||||
a9f23e146cda4b5e0c4a09d1fde758e1 images/icon_padlock.gif
|
||||
6cc4c661c26954bdb85f8243f476630b images/icon_save.gif
|
||||
26976f1650f3e09514fd514f5b45321e images/icon_security.gif
|
||||
d50f8f524e2072990995af5615b6e5eb images/icon_settings.gif
|
||||
58e4ec775869cd5dca578f1c71660190 images/icon_user.gif
|
||||
3ddc466237777d88338b096b9ca8b168 images/icon_world.gif
|
||||
8a3edb0428f11a404535d9134c90063f images/index.html
|
||||
ea4f1d0cc4466c07f9915a098d8b410c images/readme.txt
|
||||
8a3edb0428f11a404535d9134c90063f index.html
|
||||
d41d8cd98f00b204e9800998ecf8427e language/en-GB/en-GB.mod_roktabs.ini
|
||||
8a3edb0428f11a404535d9134c90063f language/en-GB/index.html
|
||||
8a3edb0428f11a404535d9134c90063f language/index.html
|
||||
5ad2625cc1fa6767d942981cf346332f mod_roktabs.php
|
||||
ae3f4e948d6f8ed9081213697c8ebf94 mod_roktabs.xml
|
||||
1187d5b9ee0c700b2dc1929e824f2695 thumbnail.inc.php
|
||||
8a3edb0428f11a404535d9134c90063f tmpl/dark/index.html
|
||||
945629c1ce672c71fa7bef17d8f7d352 tmpl/dark/next-dark.png
|
||||
8298daaedcf05b23835dbc525b89226f tmpl/dark/prev-dark.png
|
||||
92bd791c78ee06b56819da06248f9a7f tmpl/dark/roktabs.css
|
||||
7c82a8737d30aef32b87e7557f5d8ecb tmpl/dark/tabbg-active-dark.png
|
||||
c20a5a135a683ca0a039677f2e23fb82 tmpl/dark/tabbg-bottom-active-dark.png
|
||||
a6b3214f7f6a729a761071621d9a492c tmpl/dark/tabbg-bottom-dark.png
|
||||
a300af3cb22c4972202bf059944727ad tmpl/dark/tabbg-dark.png
|
||||
7a71fd61ac2fce5c2975e6980aecdf1a tmpl/default.php
|
||||
8a3edb0428f11a404535d9134c90063f tmpl/index.html
|
||||
8a3edb0428f11a404535d9134c90063f tmpl/light/index.html
|
||||
046685dc26e5c62789c37f22d858d4b0 tmpl/light/next-light.png
|
||||
4cbc9d1b2f32f41fde6ec13149e54c9e tmpl/light/prev-light.png
|
||||
2d2fdd0ced90238c5a441ca42b6d34f2 tmpl/light/roktabs.css
|
||||
846b01bdde4560fed31b83884cc32b3e tmpl/light/tabbg-active-bottom-light.png
|
||||
65ebe5781c0649e829649189b54db574 tmpl/light/tabbg-active-light.png
|
||||
72b90a65b2ced36d7b85815054b725bc tmpl/light/tabbg-bottom-light.png
|
||||
3bc380b0a0a2f8315c1bd440be01af6b tmpl/light/tabbg-light.png
|
||||
558635f608c280d4bd358af910b8ec71 tmpl/roktabs.js
|
25
modules/mod_roktabs/RT-LICENSE.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('_JEXEC') or die();
|
||||
?>
|
||||
|
||||
RocketTheme Joomla Extension License
|
||||
------------------------------------
|
||||
|
||||
All RocketTheme Joomla Extensions (Templates, Modules, Components, Plugins, etc.) are released under the GPL version 2.0 license (http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2). As such the PHP code portions of these extensions are distributed under the GPL version 2.0 license. If not otherwise stated, all images, cascading style sheets, and included JavaScript are NOT GPL, and are released under the RocketTheme Proprietary Use License v1.0 (See below) unless specifically authorized by RocketTheme. Elements of the extensions released under this proprietary license may not be redistributed or repackaged for use other than those allowed by the Terms of Service of the club. Please review the Terms of Service for further information on these usages.
|
||||
|
||||
|
||||
RocketTheme phpBB3 Extension License
|
||||
------------------------------------
|
||||
|
||||
All RocketTheme phpBB3 Extensions (Themes, mods, etc.) are released under the GPL version 2.0 license (http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2). As such the PHP code portions of these extensions are distributed under the GPL version 2.0 license. If not otherwise stated, all images, cascading style sheets, and included JavaScript are NOT GPL, and are released under the RocketTheme Proprietary Use License v1.0 (See below) unless specifically authorized by RocketTheme. Elements of the extensions released under this proprietary license may not be redistributed or repackaged for use other than those allowed by the Terms of Service of the club. Please review the Terms of Service for further information on these usages.
|
||||
|
||||
|
||||
The RocketTheme Proprietary Use License (v1.0)
|
||||
----------------------------------------------
|
||||
|
||||
The RocketTheme Proprietary Use License is a GPL compatible license that pertains only to the images, cascading style sheets and JavaScript elements of RocketTheme extensions (Joomla, phpBB3, etc). produced by RocketTheme. As stated by the GPL version 2.0 license, These elements of product that are not compiled together but are sent independently of GPL code, and combined in a client's browser, do not have to be GPL themselves. These images, cascading style sheets and JavaScript elements are copyright RocketTheme and can be used and manipulated for your own or your clients purposes. You cannot redistribute these files as your own, or include them in a package or extension of your own without prior consent of RocketTheme.
|
||||
|
||||
|
||||
This License is effective as of Januray 1, 2009.
|
||||
|
||||
Version 1.1 - Modified 6/14/2009
|
13
modules/mod_roktabs/admin/icons.css
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @author RocketTheme, LLC http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
.icons {clear:both;margin: 5px 0;}
|
||||
.icons_previews {float:left;margin-right:5px;min-width:21px;min-height:21px;}
|
||||
.icons select {float:left;}
|
||||
.icons .tab_label {float: left;margin: 7px 5px 0 0;color:#aaa;font-weight:bold;}
|
||||
body .icons .controls {display: inline-block;margin-left: 0;}
|
||||
.icons .controls span {float:left;margin-left:2px;margin-top:5px;width:16px;height:16px;cursor:pointer;}
|
||||
.icons .controls .add {background:url(images/add.png) no-repeat;}
|
||||
.icons .controls .remove {background:url(images/delete.png) no-repeat;}
|
24
modules/mod_roktabs/admin/icons.js
Normal file
@ -0,0 +1,24 @@
|
||||
var RokTabsIcons=new Class({Implements:[Options,Events],initialize:function(){this.Path=SitePath+"/";this.selects=$$(".icons select");this.pathEl=document.id("jform_params_tabs_iconpath");
|
||||
if(this.pathEl){this.pathEl.addEvent("keyup",function(){this.Path=SitePath+"/"+this.pathEl.value;this.Path=this.Path.replace("__template__",TemplatePath);
|
||||
this.Path=this.Path.replace("__module__",ModulePath);if(this.Path[this.Path.length-1]!="/"){this.Path+="/";}}.bind(this));this.Path=SitePath+"/"+this.pathEl.value;
|
||||
this.Path=this.Path.replace("__template__",TemplatePath);this.Path=this.Path.replace("__module__",ModulePath);if(this.Path[this.Path.length-1]!="/"){this.Path+="/";
|
||||
}}this.selects.each(function(b){this.selectEvent(b,this);},this);this.adds=$$(".icons .controls .add");this.removes=$$(".icons .controls .remove");var a=this;
|
||||
this.adds.each(function(b){b.addEvent("click",function(){a.add(this);});});this.removes.each(function(b){b.addEvent("click",function(){a.remove(this);});
|
||||
});},selectEvent:function(a,c){var e=a.options[a.selectedIndex].value;var f=a.getPrevious();var d=this;if(f.getElement("img")){f.getElement("img").src=c.Path+e;
|
||||
}else{new Asset.image(c.Path+e).inject(f);}if(e=="__none__"){f.getElement("img").setStyle("display","none");}else{f.getElement("img").setStyle("display","block");
|
||||
}a.getElements("option").addEvents({mouseenter:function(){if(this.value=="__none__"){f.getElement("img").setStyle("display","none");}else{f.getElement("img").setStyle("display","block");
|
||||
}f.getElement("img").src=c.Path+this.value;},mouseleave:function(){if(this.value=="__none__"){f.getElement("img").setStyle("display","none");}else{f.getElement("img").setStyle("display","block");
|
||||
}f.getElement("img").src=c.Path+e;}});a.addEvent("change",function(){e=a.options[a.selectedIndex].value;if(e=="__none__"){f.getElement("img").setStyle("display","none");
|
||||
}else{f.getElement("img").setStyle("display","block");}f.getElement("img").src=c.Path+e;var g=[];d.selects.each(function(h){g.push(h.value);});document.id("jform_params_tabs_icon").value=g.join(",");
|
||||
});if(typeof jQuery!="undefiend"&&typeof jQuery.fn.chosen!="undefined"){jQuery(a).chosen().change(function(){e=a.options[a.selectedIndex].value;if(e=="__none__"){f.getElement("img").setStyle("display","none");
|
||||
}else{f.getElement("img").setStyle("display","block");}f.getElement("img").src=c.Path+e;var g=[];d.selects.each(function(h){g.push(h.value);});document.id("jform_params_tabs_icon").value=g.join(",");
|
||||
});var b=a.getNext(".chzn-container").getElements(".chzn-results li");if(b&&b.length){b.addEvents({mouseenter:function(){var g=this.getParent("ul").getElements("li").indexOf(this),h=a.getElements("option")[g].value;
|
||||
if(h=="__none__"){f.getElement("img").setStyle("display","none");}else{f.getElement("img").setStyle("display","block");}f.getElement("img").src=c.Path+h;
|
||||
},mouseleave:function(){var g=this.getParent("ul").getElements("li").indexOf(this),h=a.getElements("option")[g].value;if(h=="__none__"){f.getElement("img").setStyle("display","none");
|
||||
}else{f.getElement("img").setStyle("display","block");}f.getElement("img").src=c.Path+e;}});}}},add:function(c){var d=c.getParent().getParent();var f=d.clone(true).inject(d,"after");
|
||||
var b=f.getElement("select");var e=f.getElement(".add");var a=f.getElement(".remove").setStyle("display","block");e.addEvent("click",function(){this.add(e);
|
||||
}.bind(this));a.addEvent("click",function(){this.remove(a);}.bind(this));this.selectEvent(b,this);this.rearrange();},remove:function(a){var b=a.getParent().getParent();
|
||||
b.empty().dispose();this.rearrange();},rearrange:function(){this.removes=$$(".icons .controls .add");this.adds=$$(".icons .controls .remove");this.selects=$$(".icons select");
|
||||
var a=[];this.selects.each(function(b,d){var e=b.getPrevious();var c=e.getPrevious();e.className="preview_tabs_icon"+(d+1)+" icons_previews";c.set("html","Tab "+(d+1)+": ");
|
||||
a.push(b.value);});if(this.selects.length==1){this.selects[0].getNext(".controls").getElement(".remove").setStyle("display","none");}else{this.selects[0].getNext(".controls").getElement(".remove").setStyle("display","block");
|
||||
}document.id("jform_params_tabs_icon").value=a.join(",");}});
|
18
modules/mod_roktabs/admin/icons_25.js
Normal file
@ -0,0 +1,18 @@
|
||||
var RokTabsIcons=new Class({Implements:[Options,Events],initialize:function(){this.Path=SitePath+"/";this.selects=$$(".icons select");this.pathEl=document.id("jform_params_tabs_iconpath");
|
||||
if(this.pathEl){this.pathEl.addEvent("keyup",function(){this.Path=SitePath+"/"+this.pathEl.value;this.Path=this.Path.replace("__template__",TemplatePath);
|
||||
this.Path=this.Path.replace("__module__",ModulePath);if(this.Path[this.Path.length-1]!="/"){this.Path+="/";}}.bind(this));this.Path=SitePath+"/"+this.pathEl.value;
|
||||
this.Path=this.Path.replace("__template__",TemplatePath);this.Path=this.Path.replace("__module__",ModulePath);if(this.Path[this.Path.length-1]!="/"){this.Path+="/";
|
||||
}}this.selects.each(function(b){this.selectEvent(b,this);},this);this.adds=$$(".icons .controls .add");this.removes=$$(".icons .controls .remove");var a=this;
|
||||
this.adds.each(function(b){b.addEvent("click",function(){a.add(this);});});this.removes.each(function(b){b.addEvent("click",function(){a.remove(this);});
|
||||
});},selectEvent:function(a,b){var d=a.options[a.selectedIndex].value;var e=a.getPrevious();var c=this;if(e.getElement("img")){e.getElement("img").src=b.Path+d;
|
||||
}else{new Asset.image(b.Path+d).inject(e);}if(d=="__none__"){e.getElement("img").setStyle("display","none");}else{e.getElement("img").setStyle("display","block");
|
||||
}a.getElements("option").addEvents({mouseenter:function(){if(this.value=="__none__"){e.getElement("img").setStyle("display","none");}else{e.getElement("img").setStyle("display","block");
|
||||
}e.getElement("img").src=b.Path+this.value;},mouseleave:function(){if(this.value=="__none__"){e.getElement("img").setStyle("display","none");}else{e.getElement("img").setStyle("display","block");
|
||||
}e.getElement("img").src=b.Path+d;}});a.addEvent("change",function(){d=a.options[a.selectedIndex].value;if(d=="__none__"){e.getElement("img").setStyle("display","none");
|
||||
}else{e.getElement("img").setStyle("display","block");}e.getElement("img").src=b.Path+d;var f=[];c.selects.each(function(g){f.push(g.value);});document.id("jform_params_tabs_icon").value=f.join(",");
|
||||
});},add:function(c){var d=c.getParent().getParent();var f=d.clone(true).inject(d,"after");var b=f.getElement("select");var e=f.getElement(".add");var a=f.getElement(".remove").setStyle("display","block");
|
||||
e.addEvent("click",function(){this.add(e);}.bind(this));a.addEvent("click",function(){this.remove(a);}.bind(this));this.selectEvent(b,this);this.rearrange();
|
||||
},remove:function(a){var b=a.getParent().getParent();b.empty().dispose();this.rearrange();},rearrange:function(){this.removes=$$(".icons .controls .add");
|
||||
this.adds=$$(".icons .controls .remove");this.selects=$$(".icons select");var a=[];this.selects.each(function(b,d){var e=b.getPrevious();var c=e.getPrevious();
|
||||
e.className="preview_tabs_icon"+(d+1)+" icons_previews";c.set("html","Tab "+(d+1)+": ");a.push(b.value);});if(this.selects.length==1){this.selects[0].getNext().getElement(".remove").setStyle("display","none");
|
||||
}else{this.selects[0].getNext().getElement(".remove").setStyle("display","block");}document.id("jform_params_tabs_icon").value=a.join(",");}});
|
BIN
modules/mod_roktabs/admin/images/add.png
Normal file
After Width: | Height: | Size: 733 B |
BIN
modules/mod_roktabs/admin/images/delete.png
Normal file
After Width: | Height: | Size: 715 B |
1
modules/mod_roktabs/admin/images/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
1
modules/mod_roktabs/admin/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
59
modules/mod_roktabs/fields/break.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: break.php 6824 2013-01-28 06:14:09Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
defined('JPATH_PLATFORM') or die;
|
||||
|
||||
/**
|
||||
* Form Field class for the Joomla Platform.
|
||||
* Supports a one line text field.
|
||||
*
|
||||
* @package Joomla.Platform
|
||||
* @subpackage Form
|
||||
* @link http://www.w3.org/TR/html-markup/input.text.html#input.text
|
||||
* @since 11.1
|
||||
*/
|
||||
class JFormFieldBreak extends JFormField
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $type = 'Break';
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function getLabel()
|
||||
{
|
||||
$doc = JFactory::getDocument();
|
||||
$version = new JVersion();
|
||||
$doc->addStyleDeclaration(".rok-break {border-bottom:1px solid #eee;font-size:16px;color:#0088CC;margin-top:15px;padding:2px 0;width:100%}");
|
||||
|
||||
if (isset($this->element['label']) && !empty($this->element['label'])) {
|
||||
$label = JText::_((string)$this->element['label']);
|
||||
$css = (string)$this->element['class'];
|
||||
$version = new JVersion();
|
||||
if (version_compare($version->getShortVersion(), '3.0', '>=')) {
|
||||
return '<div class="rok-break ' . $css . '">' . $label . '</div>';
|
||||
} else {
|
||||
return '<label class="rok-break ' . $css . '">' . $label . '</label>';
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
96
modules/mod_roktabs/fields/contenttype.php
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: contenttype.php 6824 2013-01-28 06:14:09Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
jimport('joomla.html.html');
|
||||
jimport('joomla.form.formfield');
|
||||
JHtml::_('behavior.framework', true);
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
class JFormFieldContentType extends JFormFieldList
|
||||
{
|
||||
protected $type = 'contenttype';
|
||||
|
||||
protected function getInput()
|
||||
{
|
||||
$doc = JFactory::getDocument();
|
||||
|
||||
// Initialize some field attributes.
|
||||
$attr = '';
|
||||
$attr .= $this->element['class'] ? ' class="' . (string)$this->element['class'] . '"' : '';
|
||||
// To avoid user's confusion, readonly="true" should imply disabled="true".
|
||||
if ((string)$this->element['readonly'] == 'true' || (string)$this->element['disabled'] == 'true') {
|
||||
$attr .= ' disabled="disabled"';
|
||||
}
|
||||
$attr .= $this->element['size'] ? ' size="' . (int)$this->element['size'] . '"' : '';
|
||||
$attr .= $this->element['multiple'] ? ' multiple="multiple"' : '';
|
||||
// Initialize JavaScript field attributes.
|
||||
$attr .= $this->element['onchange'] ? ' onchange="' . (string)$this->element['onchange'] . '"' : '';
|
||||
|
||||
$version = new JVersion();
|
||||
if (version_compare($version->getShortVersion(), '3.0', '<')) {
|
||||
if (K2_CHECK) {
|
||||
$js = "window.addEvent('domready', function() {
|
||||
$('" . $this->id . "').addEvent('change', function(){
|
||||
$$('.ifk2').getParent('li').setStyle('display','block');
|
||||
$$('." . $this->element['name'] . "').getParent('li').setStyle('display','none');
|
||||
$$('." . $this->value . "').getParent('li').setStyle('display','block');
|
||||
var sel = this.getSelected().get('value');
|
||||
$$('.source').getParent('li').setStyle('display','none');
|
||||
$$('.'+sel).getParent('li').setStyle('display','block');
|
||||
}).fireEvent('change');
|
||||
});";
|
||||
} else {
|
||||
$js = "window.addEvent('domready', function() {
|
||||
$('" . $this->id . "').set('value', 'joomla');
|
||||
$('" . $this->id . "').getParent('li').setStyle('display','none');
|
||||
$$('." . $this->element['name'] . "').getParent('li').setStyle('display','none');
|
||||
$$('.joomla').getParent('li').setStyle('display','block');
|
||||
});";
|
||||
}
|
||||
} else {
|
||||
if (K2_CHECK) {
|
||||
$js = "window.addEvent('domready', function() {
|
||||
var chzn = $('" . $this->id . "_chzn');
|
||||
if(chzn!=null){
|
||||
$('" . $this->id . "_chzn').addEvent('click', function(){
|
||||
$$('.ifk2').getParent('div.control-group').setStyle('display','block');
|
||||
$$('." . $this->value . "').getParent('div.control-group').setStyle('display','block');
|
||||
$$('." . $this->element['name'] . "').getParent('div.control-group').setStyle('display','none');
|
||||
var text = $('" . $this->id . "_chzn').getElement('span').get('text');
|
||||
var options = $('" . $this->id . "').getElements('option');
|
||||
options.each(function(option) {
|
||||
var optText = String(option.get('text'));
|
||||
var optValue = String(option.get('value'));
|
||||
if(text == optText){
|
||||
var sel = optValue;
|
||||
}
|
||||
$$('.'+sel).getParent('div.control-group').setStyle('display','block');
|
||||
});
|
||||
}).fireEvent('click');
|
||||
}
|
||||
});";
|
||||
} else {
|
||||
$js = "window.addEvent('domready', function() {
|
||||
$('" . $this->id . "').set('value', 'joomla');
|
||||
$('" . $this->id . "').getParent('div.control-group').setStyle('display','none');
|
||||
$$('." . $this->element['name'] . "').getParent('div.control-group').setStyle('display','none');
|
||||
$$('.joomla').getParent('div.control-group').setStyle('display','block');
|
||||
});";
|
||||
}
|
||||
}
|
||||
|
||||
$doc->addScriptDeclaration($js);
|
||||
|
||||
return JHtml::_('select.genericlist', (array)$this->getOptions(), $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
1
modules/mod_roktabs/fields/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
86
modules/mod_roktabs/fields/k2categories.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: k2categories.php 6824 2013-01-28 06:14:09Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*
|
||||
* "K2 Items" Module by JoomlaWorks for Joomla! 1.5.x - Version 2.0.0
|
||||
* Copyright (c) 2006 - 2009 JoomlaWorks Ltd. All rights reserved.
|
||||
* Released under the GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
* More info at http://www.joomlaworks.gr
|
||||
* Designed and developed by the JoomlaWorks team
|
||||
* *** Last update: June 20th, 2009 ***
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ('Restricted access');
|
||||
jimport('joomla.html.html');
|
||||
jimport('joomla.form.formfield');
|
||||
JHtml::_('behavior.framework', true);
|
||||
/**
|
||||
* @package RocketTheme
|
||||
* @subpackage rokstories.fields
|
||||
*/
|
||||
class JFormFieldK2Categories extends JFormField
|
||||
{
|
||||
var $_name = 'k2categories';
|
||||
|
||||
public function getInput()
|
||||
{
|
||||
|
||||
// Initialize variables.
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
// Initialize some field attributes.
|
||||
$attr = '';
|
||||
$attr .= $this->element['class'] ? ' class="' . (string)$this->element['class'] . '"' : '';
|
||||
// To avoid user's confusion, readonly="true" should imply disabled="true".
|
||||
if ((string)$this->element['readonly'] == 'true' || (string)$this->element['disabled'] == 'true') {
|
||||
$attr .= ' disabled="disabled"';
|
||||
}
|
||||
$attr .= $this->element['size'] ? ' size="' . (int)$this->element['size'] . '"' : '';
|
||||
$attr .= $this->element['multiple'] ? ' multiple="multiple"' : '';
|
||||
// Initialize JavaScript field attributes.
|
||||
$attr .= $this->element['onchange'] ? ' onchange="' . (string)$this->element['onchange'] . '"' : '';
|
||||
|
||||
$mitems = array();
|
||||
if ($this->available()) {
|
||||
|
||||
$query = 'SELECT m.* FROM #__k2_categories m WHERE published=1 AND trash = 0 ORDER BY parent, ordering';
|
||||
$db->setQuery($query);
|
||||
$mitems = $db->loadObjectList();
|
||||
$children = array();
|
||||
if ($mitems) {
|
||||
foreach ($mitems as $v) {
|
||||
$v->title = $v->name;
|
||||
$v->parent_id = $v->parent;
|
||||
$pt = $v->parent;
|
||||
$list = @$children[$pt] ? $children[$pt] : array();
|
||||
array_push($list, $v);
|
||||
$children[$pt] = $list;
|
||||
}
|
||||
}
|
||||
$list = JHtml::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
|
||||
$mitems = array();
|
||||
|
||||
foreach ($list as $item) {
|
||||
$item->treename = JString::str_ireplace(' ', '- ', $item->treename);
|
||||
$mitems[] = JHtml::_('select.option', $item->id, ' ' . $item->treename);
|
||||
}
|
||||
}
|
||||
return JHtml::_('select.genericlist', $mitems, $this->name, trim($attr), 'value', 'text', $this->value);
|
||||
}
|
||||
|
||||
function available()
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = 'select count(*) from #__extensions where element = ' . $db->Quote('com_k2') . ' AND enabled=1';
|
||||
$db->setQuery($query);
|
||||
$count = (int)$db->loadResult();
|
||||
if ($count > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
36
modules/mod_roktabs/fields/k2check.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: k2check.php 6824 2013-01-28 06:14:09Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die();
|
||||
jimport('joomla.html.html');
|
||||
jimport('joomla.form.formfield');
|
||||
JHtml::_('behavior.framework', true);
|
||||
/**
|
||||
* @package RocketTheme
|
||||
* @subpackage rokstories.elements
|
||||
*/
|
||||
class JFormFieldK2check extends JFormField
|
||||
{
|
||||
public function getInput()
|
||||
{
|
||||
if (defined('K2_CHECK')) return;
|
||||
$k2 = JPATH_SITE . "/components/com_k2/k2.php";
|
||||
|
||||
if (!file_exists($k2)) {
|
||||
define('K2_CHECK', 0);
|
||||
$warning_style = "style='background: #FFF3A3;border: 1px solid #E7BD72;color: #B79000;display: block;padding: 8px 10px;'";
|
||||
return "<span $warning_style><strong>K2 Component</strong> Not Found. In order to use the <strong>K2 Content</strong> type, you will need to <a href=\"http://k2.joomlaworks.gr\" target=\"_blank\">download and install it</a>.</span>";
|
||||
} else {
|
||||
define('K2_CHECK', 1);
|
||||
$success_style = "style='background: #d2edc9;border: 1px solid #90e772;color: #2b7312;display: block;padding: 8px 10px;'";
|
||||
return "<span $success_style><strong>K2 Component</strong> has been found and is available to use.</span>";
|
||||
}
|
||||
}
|
||||
}
|
132
modules/mod_roktabs/fields/roktabsicons.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: roktabsicons.php 6824 2013-01-28 06:14:09Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die();
|
||||
|
||||
/**
|
||||
* @package RocketTheme
|
||||
* @subpackage roktabs.elements
|
||||
*/
|
||||
class JFormFieldRoktabsicons extends JFormField
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'RokTabsIcons';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
var $_name = 'roktabsicons';
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getInput()
|
||||
{
|
||||
$document = JFactory::getDocument();
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
if (!defined('ROKTABS_ICONS')) {
|
||||
define('ROKTABS_ICONS', 1);
|
||||
|
||||
$db = JFactory::getDBO();
|
||||
// Get the current default template
|
||||
$query = ' SELECT template ' . ' FROM #__template_styles ' . ' WHERE client_id = 0 ' . ' AND home = 1 ';
|
||||
$db->setQuery($query);
|
||||
$template = $db->loadResult();
|
||||
|
||||
$path = JURI::Root(true) . "/modules/mod_roktabs/";
|
||||
$document->addStyleSheet($path . 'admin/icons.css');
|
||||
$version = new JVersion();
|
||||
if (version_compare($version->getShortVersion(), '3.0', '<')) {
|
||||
$document->addScript($path . 'admin/icons_25.js');
|
||||
} else {
|
||||
$document->addScript($path . 'admin/icons.js');
|
||||
}
|
||||
$document->addScriptDeclaration("
|
||||
var SitePath = '" . JURI::Root(true) . "', TemplatePath = 'templates/" . $template . "', ModulePath = 'modules/mod_roktabs';
|
||||
window.addEvent('domready', function() {new RokTabsIcons();});
|
||||
");
|
||||
|
||||
}
|
||||
|
||||
$html = "";
|
||||
|
||||
$value = str_replace(" ", "", $this->value);
|
||||
$list = explode(",", $value);
|
||||
|
||||
$i = 0;
|
||||
foreach ($list as $img) {
|
||||
$i++;
|
||||
$html .= "<div class='icons'>";
|
||||
$html .= " <span class='tab_label'>Tab " . $i . ":</span> ";
|
||||
$html .= " <div class='preview_" . $this->id . $i . " icons_previews'></div>";
|
||||
$html .= " <select class='inputbox'>";
|
||||
$html .= $this->loadIcons($this->name, $img, $template);
|
||||
$html .= " </select>";
|
||||
$html .= " <div class='controls'>";
|
||||
$html .= " <span class='add' title='Add new tab icon'></span>";
|
||||
$html .= " <span class='remove' title='Remove current tab icon'></span>";
|
||||
$html .= " </div>";
|
||||
$html .= " <div style='clear: both;'></div>";
|
||||
$html .= "</div>";
|
||||
}
|
||||
|
||||
$html .= "<input id='" . $this->id . "' name='" . $this->name . "' type='hidden' value='" . $value . "' />";
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @param $value
|
||||
* @param $template
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function loadIcons($name, $value, $template)
|
||||
{
|
||||
$path = JPATH_SITE . "/modules/mod_roktabs/images/";
|
||||
$urlPath = JURI::Root(true) . "/modules/mod_roktabs/images/";
|
||||
|
||||
if ($this->form->getValue('tabs_iconpath', 'params') != '') {
|
||||
$path = JPATH_SITE . '/' . $this->form->getValue('tabs_iconpath', 'params');
|
||||
$urlPath = JURI::Root(true) . "/" . $this->form->getValue('tabs_iconpath', 'params');
|
||||
}
|
||||
|
||||
$path = str_replace('__template__', 'templates' . '/' . $template, $path);
|
||||
$urlPath = str_replace('__template__', 'templates/' . $template, $urlPath);
|
||||
$path = str_replace('__module__', 'modules/mod_roktabs', $path);
|
||||
$urlPath = str_replace('__module__', 'modules/mod_roktabs', $urlPath);
|
||||
|
||||
$icons = array('__none__');
|
||||
$html = "";
|
||||
|
||||
if ($handle = @opendir($path)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$ext = strtolower(substr($file, strrpos($file, '.') + 1));
|
||||
if ($ext == 'gif' || $ext == 'bmp' || $ext == 'jpg' || $ext == 'png') {
|
||||
array_push($icons, $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
foreach ($icons as $icon) {
|
||||
if ($icon == $value) $selected = "selected='selected'"; else $selected = "";
|
||||
$html .= "<option alt='" . $urlPath . $icon . "' $selected>" . $icon . "</option>";
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
571
modules/mod_roktabs/helper.php
Normal file
@ -0,0 +1,571 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: helper.php 6824 2013-01-28 06:14:09Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*
|
||||
*/
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
require_once (JPath::clean(JPATH_SITE . '/components/com_content/models/articles.php'));
|
||||
require_once (JPath::clean(JPATH_SITE . '/components/com_content/helpers/route.php'));
|
||||
if (file_exists(JPath::clean(JPATH_SITE . '/libraries/joomla/html/html/content.php'))) require_once (JPath::clean(JPATH_SITE . '/libraries/joomla/html/html/content.php'));
|
||||
if (class_exists('JModelLegacy')) JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel');
|
||||
class modRokTabsHelper
|
||||
{
|
||||
function getList($params)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$db = JFactory::getDBO();
|
||||
$user = JFactory::getUser();
|
||||
$userId = (int)$user->get('id');
|
||||
$jnow = JFactory::getDate();
|
||||
$now = $db->Quote($jnow->toSql());
|
||||
$null = $db->Quote($db->getNullDate());
|
||||
$count = $params->get('count', 4);
|
||||
$catid = $params->get('catid');
|
||||
$show_front = $params->get('show_front', 1);
|
||||
$aid = $user->get('aid', 0);
|
||||
$content_type = $params->get('content_type', 'joomla');
|
||||
$ordering = $params->get('itemsOrdering');
|
||||
$cid = $params->get('category_id', NULL);
|
||||
$user_id = $params->get('user_id');
|
||||
$text_length = intval($params->get('preview_count', 200));
|
||||
$tags_option = $params->get('strip_tags', 'a,i,br,img');
|
||||
$thumb_size = $params->get('thumb_width', 90);
|
||||
$show_thumbnails = $params->get('show_thumbnails', 1);
|
||||
$thumbnail_link = $params->get('thumbnail_link', 1);
|
||||
|
||||
$params->set('tabs_count', $count);
|
||||
|
||||
// content specific stuff
|
||||
if ($content_type == 'joomla') {
|
||||
// start Joomla specific
|
||||
jimport('joomla.application.component.model');
|
||||
|
||||
// Get an instance of the generic articles model
|
||||
if (class_exists('JModelLegacy')) {
|
||||
$model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
|
||||
} else {
|
||||
$model = JModel::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
|
||||
}
|
||||
// Set application parameters in model
|
||||
$appParams = JFactory::getApplication()->getParams();
|
||||
$model->setState('params', $appParams);
|
||||
|
||||
// Set the filters based on the module params
|
||||
$model->setState('list.start', 0);
|
||||
$model->setState('list.limit', $count);
|
||||
$model->setState('filter.published', 1);
|
||||
|
||||
// Access filter
|
||||
$access = !JComponentHelper::getParams('com_content')->get('show_noauth');
|
||||
$authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id'));
|
||||
$model->setState('filter.access', $access);
|
||||
|
||||
// Category filter
|
||||
$model->setState('filter.category_id', $catid);
|
||||
|
||||
// User filter
|
||||
$userId = JFactory::getUser()->get('id');
|
||||
switch ($user_id) {
|
||||
case 'by_me':
|
||||
$model->setState('filter.author_id', (int)$userId);
|
||||
break;
|
||||
case 'not_me':
|
||||
$model->setState('filter.author_id', $userId);
|
||||
$model->setState('filter.author_id.include', false);
|
||||
break;
|
||||
|
||||
case 0:
|
||||
break;
|
||||
|
||||
default:
|
||||
$model->setState('filter.author_id', $user_id);
|
||||
break;
|
||||
}
|
||||
|
||||
// Featured switch
|
||||
switch ($show_front) {
|
||||
case 1:
|
||||
$model->setState('filter.featured', 'show');
|
||||
break;
|
||||
case 0:
|
||||
$model->setState('filter.featured', 'hide');
|
||||
break;
|
||||
default:
|
||||
$model->setState('filter.featured', 'only');
|
||||
break;
|
||||
}
|
||||
|
||||
// ordering
|
||||
switch ($ordering) {
|
||||
case 'date' :
|
||||
$orderby = 'a.created ASC';
|
||||
break;
|
||||
case 'rdate' :
|
||||
$orderby = 'a.created DESC';
|
||||
break;
|
||||
case 'alpha' :
|
||||
$orderby = 'a.title';
|
||||
break;
|
||||
case 'ralpha' :
|
||||
$orderby = 'a.title DESC';
|
||||
break;
|
||||
case 'order':
|
||||
if ($show_front == '2') $orderby = 'a.featured_ordering'; else
|
||||
$orderby = 'a.ordering';
|
||||
break;
|
||||
case 'random' :
|
||||
$orderby = 'RAND()';
|
||||
break;
|
||||
default :
|
||||
$orderby = 'a.id DESC';
|
||||
break;
|
||||
}
|
||||
|
||||
$ordering = explode(' ', $orderby);
|
||||
$model->setState('list.ordering', $ordering[0]);
|
||||
$model->setState('list.direction', isset($ordering[1]) ? $ordering[1] : null);
|
||||
|
||||
$rows = $model->getItems();
|
||||
// end Joomla specific
|
||||
} else {
|
||||
// start K2 specific
|
||||
require_once(JPATH_SITE . '/components/com_k2/models/itemlist.php');
|
||||
require_once(JPATH_SITE . '/components/com_k2/helpers/route.php');
|
||||
require_once(JPATH_SITE . '/components/com_k2/helpers/utilities.php');
|
||||
|
||||
//Initialize Variables
|
||||
$k2_category = $params->get('k2_category', array());
|
||||
$k2_children = $params->get('k2_children', 0);
|
||||
$k2_ordering = $params->get('k2_ordering', 'a.title');
|
||||
$k2_featured = $params->get('k2_featured', 1);
|
||||
$k2_image_size = $params->get('k2_image_size', 'M');
|
||||
|
||||
$query = "SELECT a.*, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams";
|
||||
|
||||
$query .= " FROM #__k2_items as a LEFT JOIN #__k2_categories c ON c.id = a.catid";
|
||||
|
||||
$query .= " WHERE a.published = 1 AND a.access IN(" . implode(',', $user->authorisedLevels()) . ") AND a.trash = 0 AND c.published = 1 AND c.access IN(" . implode(',', $user->authorisedLevels()) . ") AND c.trash = 0";
|
||||
|
||||
//User Filter
|
||||
switch ($user_id) {
|
||||
case 'by_me':
|
||||
$query .= ' AND (a.created_by = ' . (int)$userId . ' OR a.modified_by = ' . (int)$userId . ')';
|
||||
break;
|
||||
case 'not_me':
|
||||
$query .= ' AND (a.created_by <> ' . (int)$userId . ' AND a.modified_by <> ' . (int)$userId . ')';
|
||||
break;
|
||||
}
|
||||
|
||||
$query .= " AND ( a.publish_up = " . $null . " OR a.publish_up <= " . $now . " )";
|
||||
$query .= " AND ( a.publish_down = " . $null . " OR a.publish_down >= " . $now . " )";
|
||||
|
||||
if (!is_null($k2_category)) {
|
||||
if (is_array($k2_category)) {
|
||||
if ($k2_children) {
|
||||
require_once (JPATH_SITE . '/components/com_k2/models/itemlist.php');
|
||||
$categories = K2ModelItemlist::getCategoryTree($k2_category);
|
||||
$sql = @implode(',', $categories);
|
||||
$query .= " AND a.catid IN ({$sql})";
|
||||
|
||||
} else {
|
||||
JArrayHelper::toInteger($k2_category);
|
||||
$query .= " AND a.catid IN(" . implode(',', $k2_category) . ")";
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($k2_children) {
|
||||
require_once (JPATH_SITE . '/components/com_k2/models/itemlist.php');
|
||||
$categories = K2ModelItemlist::getCategoryTree($k2_category);
|
||||
$sql = @implode(',', $categories);
|
||||
$query .= " AND a.catid IN ({$sql})";
|
||||
} else {
|
||||
$query .= " AND a.catid=" . (int)$k2_category;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ($k2_featured == '0') $query .= " AND a.featured != 1";
|
||||
|
||||
if ($k2_featured == '2') $query .= " AND a.featured = 1";
|
||||
|
||||
if ($app->getLanguageFilter()) {
|
||||
$languageTag = JFactory::getLanguage()->getTag();
|
||||
$query .= " AND c.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ") AND a.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ")";
|
||||
}
|
||||
|
||||
// ordering
|
||||
switch ($k2_ordering) {
|
||||
case 'date' :
|
||||
$orderby = 'a.created ASC';
|
||||
break;
|
||||
case 'rdate' :
|
||||
$orderby = 'a.created DESC';
|
||||
break;
|
||||
case 'alpha' :
|
||||
$orderby = 'a.title';
|
||||
break;
|
||||
case 'ralpha' :
|
||||
$orderby = 'a.title DESC';
|
||||
break;
|
||||
case 'order':
|
||||
if ($k2_featured == '2') $orderby = 'a.featured_ordering'; else
|
||||
$orderby = 'a.ordering';
|
||||
break;
|
||||
case 'random' :
|
||||
$orderby = 'RAND()';
|
||||
break;
|
||||
default :
|
||||
$orderby = 'a.id DESC';
|
||||
break;
|
||||
}
|
||||
|
||||
$query .= " ORDER BY " . $orderby;
|
||||
$db->setQuery($query, 0, $count);
|
||||
$rows = $db->loadObjectList();
|
||||
}
|
||||
|
||||
// Process the prepare content plugins
|
||||
JPluginHelper::importPlugin('content');
|
||||
|
||||
$i = 0;
|
||||
$lists = array();
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$user = JFactory::getUser();
|
||||
$dispatcher = JDispatcher::getInstance();
|
||||
$results = @$dispatcher->trigger('onContentPrepare', array('com_content.article', & $row, & $params, 0));
|
||||
|
||||
$text = JHtml::_('content.prepare', $row->introtext);
|
||||
$lists[$i] = new stdClass();
|
||||
$lists[$i]->id = $row->id;
|
||||
$lists[$i]->created = $row->created;
|
||||
$lists[$i]->modified = $row->modified;
|
||||
|
||||
if ($content_type == 'joomla') {
|
||||
$link = JRoute::_(ContentHelperRoute::getArticleRoute($row->id, $row->catid));
|
||||
$readmore_register = false;
|
||||
$images = self::getImages($row->introtext, $thumb_size);
|
||||
|
||||
} else {
|
||||
$link = JRoute::_(K2HelperRoute::getItemRoute($row->id, $row->catid));
|
||||
$readmore_register = false;
|
||||
$images = self::getK2Images($row->id, $k2_image_size, $thumb_size);
|
||||
|
||||
}
|
||||
$lists[$i]->link = $link;
|
||||
$lists[$i]->readmore_register = $readmore_register;
|
||||
|
||||
if ($images) {
|
||||
$lists[$i]->image = $images->image;
|
||||
$lists[$i]->thumb = $images->thumb;
|
||||
$lists[$i]->thumbSizes = $images->thumbSizes;
|
||||
} else {
|
||||
$lists[$i]->image = '';
|
||||
$lists[$i]->thumb = '';
|
||||
$lists[$i]->thumbSizes = '';
|
||||
}
|
||||
$lists[$i]->title = htmlspecialchars($row->title);
|
||||
|
||||
$thumb = '';
|
||||
if ($content_type == 'k2') {
|
||||
if ($show_thumbnails && $images->thumb) {
|
||||
if ($thumbnail_link) {
|
||||
$thumb .= '<a href="' . $link . '">';
|
||||
}
|
||||
$thumb .= '<img src="' . $images->thumb . '" alt="' . htmlspecialchars($row->title) . '" style="float:left; padding:5px;" />';
|
||||
if ($thumbnail_link) {
|
||||
$thumb .= '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$lists[$i]->introtext = $thumb;
|
||||
|
||||
$lists[$i]->introtext .= self::prepareContent($text, $text_length, $params->get('show_readmore'), $tags_option);
|
||||
|
||||
if ($params->get('show_readmore')) {
|
||||
ob_start();
|
||||
?>
|
||||
<a href="<?php echo $lists[$i]->link; ?>" class="readon"><span>
|
||||
<?php if ($lists[$i]->readmore_register) :
|
||||
echo JText::_('Register to read more...'); elseif ($readmore = $params->get('readmore')) :
|
||||
echo $readmore; else :
|
||||
echo JText::sprintf('Read more...');
|
||||
endif; ?></span></a>
|
||||
<?php
|
||||
$readmore_html = ob_get_clean();
|
||||
|
||||
$lists[$i]->introtext .= $readmore_html;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
private static function getK2Images($id, $image_size, $thumb_size = 70)
|
||||
{
|
||||
|
||||
$images = new stdClass();
|
||||
$images->image = false;
|
||||
$images->thumb = false;
|
||||
$images->thumbSizes = array('width' => $thumb_size, 'height' => 'auto');
|
||||
$current_size = intval($thumb_size);
|
||||
|
||||
|
||||
if (file_exists(JPATH_SITE . '/media/k2/items/cache/' . md5("Image" . $id) . '_' . $image_size . '.jpg')) {
|
||||
$image_path = 'media/k2/items/cache/' . md5("Image" . $id) . '_' . $image_size . '.jpg';
|
||||
$images->image = JURI::Root(true) . '/' . $image_path;
|
||||
|
||||
// create a thumb filename
|
||||
$file_div = strrpos($image_path, '.');
|
||||
$thumb_ext = substr($image_path, $file_div);
|
||||
$thumb_prev = substr($image_path, 0, $file_div);
|
||||
$thumb_path = $thumb_prev . "_thumb" . $thumb_ext;
|
||||
|
||||
// check to see if this file exists, if so we don't need to create it
|
||||
if (function_exists("gd_info")) {
|
||||
// file doens't exist, so create it and save it
|
||||
if (!class_exists("Thumbnail")) include_once('thumbnail.inc.php');
|
||||
|
||||
if (file_exists($thumb_path)) {
|
||||
$existing_thumb = new Thumbnail($thumb_path);
|
||||
$current_size = $existing_thumb->getCurrentWidth();
|
||||
$images->thumbSizes = $existing_thumb->currentDimensions;
|
||||
}
|
||||
|
||||
if (!file_exists($thumb_path) || $current_size != $thumb_size) {
|
||||
|
||||
$thumb = new Thumbnail($image_path);
|
||||
|
||||
if ($thumb->error) {
|
||||
echo "ROKSTORIES ERROR: " . $thumb->errmsg . ": " . $image_path;
|
||||
return false;
|
||||
}
|
||||
$thumb->resize($thumb_size);
|
||||
if (!is_writable(dirname($thumb_path))) {
|
||||
$thumb->destruct();
|
||||
return false;
|
||||
}
|
||||
$thumb->save($thumb_path);
|
||||
$images->thumbSizes = $thumb->currentDimensions;
|
||||
$thumb->destruct();
|
||||
}
|
||||
}
|
||||
$images->thumb = $thumb_path;
|
||||
}
|
||||
return $images;
|
||||
}
|
||||
|
||||
private static function getImages($text, $thumb_size = 70)
|
||||
{
|
||||
|
||||
preg_match("/\<img.+?src=\"(.+?)\".+?\/>/", $text, $matches);
|
||||
|
||||
$images = new stdClass();
|
||||
$images->image = false;
|
||||
$images->thumb = false;
|
||||
$images->thumbSizes = array('width' => $thumb_size, 'height' => 'auto');
|
||||
|
||||
$paths = array();
|
||||
|
||||
if (isset($matches[1])) {
|
||||
$image_path = $matches[1];
|
||||
|
||||
//joomla 1.5 only
|
||||
$full_url = JURI::base();
|
||||
|
||||
//remove any protocol/site info from the image path
|
||||
$parsed_url = parse_url($full_url);
|
||||
|
||||
$paths[] = $full_url;
|
||||
if (isset($parsed_url['path']) && $parsed_url['path'] != "/") $paths[] = $parsed_url['path'];
|
||||
|
||||
|
||||
foreach ($paths as $path) {
|
||||
if (strpos($image_path, $path) === 0) {
|
||||
$image_path = substr($image_path, strpos($image_path, $path) + strlen($path));
|
||||
}
|
||||
}
|
||||
|
||||
// remove any / that begins the path
|
||||
if (substr($image_path, 0, 1) == '/') $image_path = substr($image_path, 1);
|
||||
|
||||
//if after removing the uri, still has protocol then the image
|
||||
//is remote and we don't support thumbs for external images
|
||||
if (strpos($image_path, 'http://') !== false || strpos($image_path, 'https://') !== false
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$images->image = JURI::Root(True) . "/" . $image_path;
|
||||
|
||||
// create a thumb filename
|
||||
$file_div = strrpos($image_path, '.');
|
||||
$thumb_ext = substr($image_path, $file_div);
|
||||
$thumb_prev = substr($image_path, 0, $file_div);
|
||||
$thumb_path = $thumb_prev . "_thumb" . $thumb_ext;
|
||||
|
||||
// check to see if this file exists, if so we don't need to create it
|
||||
if (function_exists("gd_info")) {
|
||||
// file doens't exist, so create it and save it
|
||||
if (!class_exists("Thumbnail")) include_once('thumbnail.inc.php');
|
||||
|
||||
if (file_exists($thumb_path)) {
|
||||
$existing_thumb = new Thumbnail($thumb_path);
|
||||
$current_size = $existing_thumb->getCurrentWidth();
|
||||
$images->thumbSizes = $existing_thumb->currentDimensions;
|
||||
} else {
|
||||
|
||||
$thumb = new Thumbnail($image_path);
|
||||
|
||||
if ($thumb->error) {
|
||||
echo "ROKSTORIES ERROR: " . $thumb->errmsg . ": " . $image_path;
|
||||
return false;
|
||||
}
|
||||
$thumb->resize($thumb_size);
|
||||
if (!is_writable(dirname($thumb_path))) {
|
||||
$thumb->destruct();
|
||||
return false;
|
||||
}
|
||||
$thumb->save($thumb_path);
|
||||
$images->thumbSizes = $thumb->currentDimensions;
|
||||
$thumb->destruct();
|
||||
}
|
||||
}
|
||||
$images->thumb = $thumb_path;
|
||||
}
|
||||
return $images;
|
||||
}
|
||||
|
||||
public static function write_tabs($tabs, $tabs_position, &$list, $tabs_title, $tabs_incremental, $tabs_hideh6, $params = null)
|
||||
{
|
||||
|
||||
jimport('joomla.filesystem.file');
|
||||
jimport('joomla.filesystem.folder');
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
if (empty($params)) {
|
||||
$params = new JForm("");
|
||||
}
|
||||
|
||||
$tabs_prefixed = $params->get('tabs_prefixed', 0);
|
||||
$navscrolling = $params->get('navscrolling', 1);
|
||||
|
||||
$tabs_hideh6 = $params->get('tabs_hideh6', 1);
|
||||
$tabs_title = $params->get('tabs_title', 'content'); // content | h6 | incremental
|
||||
|
||||
$tabs_showicons = $params->get('tabs_showicons', 0);
|
||||
$tabs_iconpath = $params->get('tabs_iconpath', '__module__/images');
|
||||
$tabs_icon = $params->get('tabs_icon');
|
||||
$tabs_iconside = $params->get('tabs_iconside', 'left');
|
||||
|
||||
// replace template token
|
||||
$tabs_iconpath = str_replace('__template__', 'templates/' . $app->getTemplate(), $tabs_iconpath);
|
||||
$tabs_iconpath = str_replace('__module__', 'modules/mod_roktabs', $tabs_iconpath);
|
||||
|
||||
$tabs_icons = explode(',', $tabs_icon);
|
||||
$iconpath = JPATH_SITE . '/' . $tabs_iconpath;
|
||||
|
||||
$iconpath_exists = JFolder::exists($iconpath);
|
||||
|
||||
if ($tabs_position == 'hidden') $tabstyle = 'style="display: none;"'; else $tabstyle = '';
|
||||
|
||||
$return = '';
|
||||
$return .= "<div class='roktabs-links" . (!$navscrolling ? ' roktabs-links-noscroll' : '') . "' $tabstyle>\n";
|
||||
$return .= "<ul class='roktabs-$tabs_position'>\n";
|
||||
$tabs = intval($tabs);
|
||||
|
||||
if ($tabs == 0 || $tabs > count($list)) $tabs = count($list);
|
||||
|
||||
for ($i = 0; $i < $tabs; $i++) {
|
||||
if ($list[$i]->introtext != '') {
|
||||
$class = '';
|
||||
if (!$i) $class = 'first active';
|
||||
if ($i == $tabs - 1) $class = 'last';
|
||||
|
||||
switch ($tabs_title) {
|
||||
case 'incremental':
|
||||
if (strlen($tabs_incremental) > 0) $title = $tabs_incremental . '' . ($i + 1); else $title = $tabs_incremental . '' . ($i + 1);
|
||||
break;
|
||||
case 'h6':
|
||||
$regex = '/<h6(?:.+)?>(.+?)<\/h6>/is';
|
||||
preg_match($regex, $list[$i]->introtext, $matches);
|
||||
if (count($matches) && strlen($matches[1]) > 0) {
|
||||
$title = $matches[1];
|
||||
if ($tabs_hideh6 == "1") {
|
||||
$list[$i]->introtext = str_replace($matches[0], '', $list[$i]->introtext);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
$title = $list[$i]->title;
|
||||
}
|
||||
|
||||
$icon = '';
|
||||
if ($tabs_showicons == 1 && $iconpath_exists && isset($tabs_icons[$i]) && $tabs_icon[$i] != '__none__') {
|
||||
|
||||
$thisicon = $tabs_icons[$i];
|
||||
$thisiconpath = $iconpath . '/' . $thisicon;
|
||||
if (JFile::exists($thisiconpath)) {
|
||||
$thisiconuri = JURI::root(true) . "/" . $tabs_iconpath . "/" . $thisicon;
|
||||
$icon = '<img src="' . $thisiconuri . '" class="tab-icon" alt="' . $list[$i]->title . '" />';
|
||||
}
|
||||
}
|
||||
|
||||
// set icons on the correct side
|
||||
if ($tabs_iconside == 'left') {
|
||||
$title = $icon . $title;
|
||||
$class .= ' icon-left';
|
||||
} else {
|
||||
$title = $title . $icon;
|
||||
$class .= ' icon-right';
|
||||
}
|
||||
|
||||
if ($tabs_prefixed) $return .= "<li class=\"$class\"><span class=\"tabnumber\"><span class=\"tabnumber2\">" . ($i + 1) . "</span></span><span>$title</span></li>\n"; else $return .= "<li class=\"$class\"><span>$title</span></li>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$return .= "</ul>\n";
|
||||
$return .= "</div>\n";
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public static function _getJSVersion()
|
||||
{
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
private static function prepareContent($text, $length = 200, $show_readmore = false, $tags_option)
|
||||
{
|
||||
|
||||
$tags = explode(",", $tags_option);
|
||||
$strip_tags = array();
|
||||
for ($i = 0; $i < count($tags); $i++) {
|
||||
$strip_tags[$i] = '<' . trim($tags[$i]) . '>';
|
||||
}
|
||||
$tags = implode(',', $strip_tags);
|
||||
|
||||
// strips tags won't remove the actual jscript
|
||||
$text = preg_replace("'<script[^>]*>.*?</script>'si", "", $text);
|
||||
|
||||
$text = preg_replace('/{.+?}/', '', $text);
|
||||
$text = strip_tags($text, $tags);
|
||||
|
||||
// cut off text at word boundary if required
|
||||
if (strlen($text) > $length) {
|
||||
//$text = substr($text, 0, strpos($text, ' ', $length)) . "..." ;
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
}
|
BIN
modules/mod_roktabs/images/icon_accept.gif
Normal file
After Width: | Height: | Size: 263 B |
BIN
modules/mod_roktabs/images/icon_clock.gif
Normal file
After Width: | Height: | Size: 207 B |
BIN
modules/mod_roktabs/images/icon_code.gif
Normal file
After Width: | Height: | Size: 278 B |
BIN
modules/mod_roktabs/images/icon_comment.gif
Normal file
After Width: | Height: | Size: 257 B |
BIN
modules/mod_roktabs/images/icon_date.gif
Normal file
After Width: | Height: | Size: 280 B |
BIN
modules/mod_roktabs/images/icon_email.gif
Normal file
After Width: | Height: | Size: 260 B |
BIN
modules/mod_roktabs/images/icon_favourites.gif
Normal file
After Width: | Height: | Size: 243 B |
BIN
modules/mod_roktabs/images/icon_forward.gif
Normal file
After Width: | Height: | Size: 265 B |
BIN
modules/mod_roktabs/images/icon_home.gif
Normal file
After Width: | Height: | Size: 179 B |
BIN
modules/mod_roktabs/images/icon_info.gif
Normal file
After Width: | Height: | Size: 266 B |
BIN
modules/mod_roktabs/images/icon_key.gif
Normal file
After Width: | Height: | Size: 230 B |
BIN
modules/mod_roktabs/images/icon_mail.gif
Normal file
After Width: | Height: | Size: 257 B |
BIN
modules/mod_roktabs/images/icon_note.gif
Normal file
After Width: | Height: | Size: 270 B |
BIN
modules/mod_roktabs/images/icon_package_get.gif
Normal file
After Width: | Height: | Size: 616 B |
BIN
modules/mod_roktabs/images/icon_padlock.gif
Normal file
After Width: | Height: | Size: 249 B |
BIN
modules/mod_roktabs/images/icon_save.gif
Normal file
After Width: | Height: | Size: 279 B |
BIN
modules/mod_roktabs/images/icon_security.gif
Normal file
After Width: | Height: | Size: 266 B |
BIN
modules/mod_roktabs/images/icon_settings.gif
Normal file
After Width: | Height: | Size: 251 B |
BIN
modules/mod_roktabs/images/icon_user.gif
Normal file
After Width: | Height: | Size: 246 B |
BIN
modules/mod_roktabs/images/icon_world.gif
Normal file
After Width: | Height: | Size: 184 B |
1
modules/mod_roktabs/images/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
2
modules/mod_roktabs/images/readme.txt
Normal file
@ -0,0 +1,2 @@
|
||||
mini icons - famfamfam.com
|
||||
Contact: mjames@gmail.com
|
1
modules/mod_roktabs/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
1
modules/mod_roktabs/language/en-GB/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
1
modules/mod_roktabs/language/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
26
modules/mod_roktabs/mod_roktabs.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: mod_roktabs.php 8643 2013-03-21 02:24:31Z steph $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
* */
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// Include the syndicate functions only once
|
||||
require_once (dirname(__FILE__) . '/helper.php');
|
||||
|
||||
JHtml::_('behavior.framework', true);
|
||||
|
||||
$conf = JFactory::getConfig();
|
||||
if ($conf->get('caching') && $params->get('module_cache')) {
|
||||
$cache = JFactory::getCache('mod_roktabs');
|
||||
$list = $cache->call(array('modRokTabsHelper', 'getList'), $params);
|
||||
} else {
|
||||
$helper = new modRokTabsHelper();
|
||||
$list = $helper->getList($params);
|
||||
}
|
||||
|
||||
require(JModuleHelper::getLayoutPath('mod_roktabs'));
|
223
modules/mod_roktabs/mod_roktabs.xml
Normal file
@ -0,0 +1,223 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<extension client="site" method="upgrade" type="module" version="2.5">
|
||||
<name>RokTabs</name>
|
||||
<author>RocketTheme, LLC</author>
|
||||
<creationDate>November 5, 2013</creationDate>
|
||||
<authorEmail>support@rockettheme.com</authorEmail>
|
||||
<authorUrl>http://www.rockettheme.com</authorUrl>
|
||||
<copyright>(C) 2005 - 2013 RocketTheme, LLC. All rights reserved.</copyright>
|
||||
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
|
||||
<version>1.12</version>
|
||||
<description>RokTabs is a news module designed to show section articles in a pleasing format. Brought to you by
|
||||
RocketTheme
|
||||
</description>
|
||||
<files>
|
||||
<folder>admin</folder>
|
||||
<filename>thumbnail.inc.php</filename>
|
||||
<folder>images</folder>
|
||||
<filename module="mod_roktabs">mod_roktabs.php</filename>
|
||||
<folder>fields</folder>
|
||||
<folder>language</folder>
|
||||
<filename>index.html</filename>
|
||||
<folder>tmpl</folder>
|
||||
<filename>helper.php</filename>
|
||||
<filename>RT-LICENSE.php</filename>
|
||||
</files>
|
||||
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset addfieldpath="/modules/mod_roktabs/fields" name="basic">
|
||||
<field default="" description="" label="" name="" type="k2check"/>
|
||||
|
||||
<field default="light" description="The style theme you want to use. Custom will disable the default styles and will let you use your own customized style. It will be added 'base' classname." label="Theme Style" name="theme" type="list">
|
||||
<option value="light">Light</option>
|
||||
<option value="dark">Dark</option>
|
||||
<option value="base">Custom</option>
|
||||
</field>
|
||||
|
||||
<field class="ifk2" default="joomla" description="whether to use Joomla Core Content, or K2 Content" label="Content Type" name="content_type" type="contenttype">
|
||||
<option value="joomla">Joomla Core Content</option>
|
||||
<option value="k2">K2 Content</option>
|
||||
</field>
|
||||
|
||||
<field class="joomla content_type" label="Joomla Options" name="joomla" type="break"/>
|
||||
|
||||
<field class="joomla content_type" default="" description="Selects Articles from one or more Categories. If no selection will show all categories as default" extension="com_content" label="JCATEGORY" multiple="true" name="catid" size="10" type="category">
|
||||
<option value="">JOPTION_ALL_CATEGORIES</option>
|
||||
</field>
|
||||
|
||||
<field default="1" description="Show/Hide items designated for the Frontpage - only works when in Content Items only mode" label="Frontpage Items" name="show_front" type="radio">
|
||||
<option value="1">Show</option>
|
||||
<option value="0">Hide</option>
|
||||
<option value="2">Only Frontpage Items</option>
|
||||
</field>
|
||||
|
||||
<field class="joomla content_type" default="0" description="Filter by author" label="Authors" name="user_id" type="list">
|
||||
<option value="0">Anyone</option>
|
||||
<option value="by_me">Added or modified by me</option>
|
||||
<option value="not_me">Not added or modified by me</option>
|
||||
</field>
|
||||
|
||||
<field class="k2 content_type" label="K2 Options" name="k2" type="break"/>
|
||||
<field class="k2 content_type" default="" description="" label="Select a category" multiple="true" name="k2_category" size="10" type="k2categories"/>
|
||||
<field class="k2 content_type" default="0" description="" label="Include Children" name="k2_children" type="list">
|
||||
<option value="0">No</option>
|
||||
<option value="1">Yes</option>
|
||||
</field>
|
||||
<field class="k2 content_type" default="1" description="" label="K2_FEATURED_ITEMS" name="k2_featured" type="list">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
<option value="2">Only Featured Items</option>
|
||||
</field>
|
||||
<field class="k2 content_type" default="L" description="" label="K2_IMAGE_SIZE" name="k2_image_size" type="list">
|
||||
<option value="XS">XSmall</option>
|
||||
<option value="S">Small</option>
|
||||
<option value="M">Medium</option>
|
||||
<option value="L">Large</option>
|
||||
<option value="XL">XLager</option>
|
||||
</field>
|
||||
|
||||
<field default="" description="" label="Additional Content Options" name="spacer_content_parameters" type="break"/>
|
||||
|
||||
<field default="" description="" label="Item Ordering" name="itemsOrdering" type="list">
|
||||
<option value="">Default</option>
|
||||
<option value="date">Oldest first</option>
|
||||
<option value="rdate">Most recent first</option>
|
||||
<option value="alpha">Title Alphabetical</option>
|
||||
<option value="ralpha">Title Reverse-Alphabetical</option>
|
||||
<option value="random">Random</option>
|
||||
<option value="order">Ordering</option>
|
||||
</field>
|
||||
<field default="3" description="The maximum number of tabs to show. Use 0 to show them all. <img src='../templates/rhuk_milkyway/template_thumbnail.png' alt='' /><script>alert('hello');</script>" label="Max # of Tabs (0 = All)" name="count" type="text"/>
|
||||
|
||||
<field default="a,i,br,img,p,span" description="List the HTML tags you want to allow in your content, separated by comma. All the others will be stripped out." label="Allowed HTML tags" name="strip_tags" type="text"/>
|
||||
|
||||
<field default="1" description="" label="Default Readmore" name="show_readmore" type="list">
|
||||
<option value="0">Hide</option>
|
||||
<option value="1">Show</option>
|
||||
</field>
|
||||
<field default="Read more..." description="Custom Text to use for the Read More links" label="Custom Readmore Text" name="readmore" type="text"/>
|
||||
<field default="" description="" label="Animation and Styling" name="spacer_animation" type="break"/>
|
||||
<field default="1" description="Enable item image thumbnails for this module" label="Show Thumbnails" name="show_thumbnails" type="list">
|
||||
<option value="1">Show</option>
|
||||
<option value="0">Hide</option>
|
||||
</field>
|
||||
<field default="90" description="" label="Width of thumbnail (px)" name="thumb_width" size="4" type="text"/>
|
||||
<field default="1" description="Use the thumbnail as a link to the article" label="Use Thumbnail as link" name="thumbnail_link" type="list">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</field>
|
||||
|
||||
<field default="500" description="Width in pixel to be used for RokTabs" label="Width" name="width" type="text"/>
|
||||
<field default="600" description="Duration in ms of the transition effect" label="Transition Duration" name="duration" type="text"/>
|
||||
<field default="scrolling" description="The type of the transition. Can be scrolling or fading." label="Type of Transition" name="transition_type" type="list">
|
||||
<option value="scrolling">Scrolling</option>
|
||||
<option value="fading">Fading</option>
|
||||
</field>
|
||||
<field default="Quad.easeInOut" description="The effect to be used for the transition" label="Transition Effect" name="transition_fx" type="list">
|
||||
<option value="linear">linear</option>
|
||||
<option value="Quad.easeOut">Quad.easeOut</option>
|
||||
<option value="Quad.easeIn">Quad.easeIn</option>
|
||||
<option value="Quad.easeInOut">Quad.easeInOut</option>
|
||||
<option value="Cubic.easeOut">Cubic.easeOut</option>
|
||||
<option value="Cubic.easeIn">Cubic.easeIn</option>
|
||||
<option value="Cubic.easeInOut">Cubic.easeInOut</option>
|
||||
<option value="Quart.easeOut">Quart.easeOut</option>
|
||||
<option value="Quart.easeIn">Quart.easeIn</option>
|
||||
<option value="Quart.easeInOut">Quart.easeInOut</option>
|
||||
<option value="Quint.easeOut">Quint.easeOut</option>
|
||||
<option value="Quint.easeIn">Quint.easeIn</option>
|
||||
<option value="Quint.easeInOut">Quint.easeInOut</option>
|
||||
<option value="Expo.easeOut">Expo.easeOut</option>
|
||||
<option value="Expo.easeIn">Expo.easeIn</option>
|
||||
<option value="Expo.easeInOut">Expo.easeInOut</option>
|
||||
<option value="Circ.easeOut">Circ.easeOut</option>
|
||||
<option value="Circ.easeIn">Circ.easeIn</option>
|
||||
<option value="Circ.easeInOut">Circ.easeInOut</option>
|
||||
<option value="Sine.easeOut">Sine.easeOut</option>
|
||||
<option value="Sine.easeIn">Sine.easeIn</option>
|
||||
<option value="Sine.easeInOut">Sine.easeInOut</option>
|
||||
<option value="Back.easeOut">Back.easeOut</option>
|
||||
<option value="Back.easeIn">Back.easeIn</option>
|
||||
<option value="Back.easeInOut">Back.easeInOut</option>
|
||||
<option value="Bounce.easeOut">Bounce.easeOut</option>
|
||||
<option value="Bounce.easeIn">Bounce.easeIn</option>
|
||||
<option value="Bounce.easeInOut">Bounce.easeInOut</option>
|
||||
<option value="Elastic.easeOut">Elastic.easeOut</option>
|
||||
<option value="Elastic.easeIn">Elastic.easeIn</option>
|
||||
<option value="Elastic.easeInOut">Elastic.easeInOut</option>
|
||||
</field>
|
||||
<field default="0" description="Whether to subtract roktabs-links margins from the tabs width" label="Subtract roktabs-links margins" name="linksMargins" type="radio">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field default="1" description="Whether to enable the scroll ability on the navigation tabs" label="Scrollable Tabs" name="navscrolling" type="radio">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field default="" description="" label="Tabs Details" name="spacer_tabs_details" type="break"/>
|
||||
<field default="top" description="Where make the tabs to appear" label="Tabs Position" name="tabs_position" type="list">
|
||||
<option value="top">Top</option>
|
||||
<option value="bottom">Bottom</option>
|
||||
<option value="hidden">Hidden</option>
|
||||
</field>
|
||||
<field default="click" description="If you want to mouseover or click for triggering the tab change" label="Tabs Interaction" name="tabs_event" type="list">
|
||||
<option value="click">Click</option>
|
||||
<option value="mouseenter">MouseOver</option>
|
||||
</field>
|
||||
<field default="content" description="Choose one of the way you want your Tabs title are set.<br><strong>By Content Title:</strong> uses the Title assigned when creating the content.<br><strong>By First Content h6 tag:</strong> searches for the first h6 tag in your content and use its value as Tab Title (you can hide or show h6 in the content from the option below).<br><strong>By Incremental:</strong> set the Tabs title by the 'Incremental prepend text' option below and then append incremental values (i.e. Tab 1 | Tab 2 | Tab 3)." label="Tabs Title" name="tabs_title" type="list">
|
||||
<option value="content">By Content Title</option>
|
||||
<option value="h6">By First Content h6 tag</option>
|
||||
<option value="incremental">By Incremental</option>
|
||||
</field>
|
||||
<field default="Tab " description="The prepend text to be used when Incremental Tabs Title is set" label="Incremental prepend text" name="tabs_incremental" type="text"/>
|
||||
<field default="1" description="Whether to hide or not h6 tags when used as Tabs Titles" label="Hide h6 tags?" name="tabs_hideh6" type="radio">
|
||||
<option value="0">No</option>
|
||||
<option value="1">Yes</option>
|
||||
</field>
|
||||
<field default="0" description="Whether to prefix or not the tabs with the current tab position" label="Prefix tabs with numbers" name="tabs_prefixed" type="radio">
|
||||
<option value="0">No</option>
|
||||
<option value="1">Yes</option>
|
||||
</field>
|
||||
<field default="0" description="Choose whether or not to show tab icons" label="Show Tab Icons" name="tabs_showicons" type="radio">
|
||||
<option value="0">No</option>
|
||||
<option value="1">Yes</option>
|
||||
</field>
|
||||
<field default="left" description="Choose whether the tab icons should show on the right or the left of the tab title" label="Tab Icon Side" name="tabs_iconside" type="list">
|
||||
<option value="left">Left</option>
|
||||
<option value="right">Right</option>
|
||||
</field>
|
||||
<field default="__module__/images" description="The location of your tab icons, use __template__ for current template directory, and __module__ for current module directory" label="Tab Icons Path" name="tabs_iconpath" size="40" type="text"/>
|
||||
<field default="icon_home.gif, icon_security.gif, icon_comment.gif, icon_world.gif, icon_note.gif" label="Tabs Icons" name="tabs_icon" type="roktabsicons"/>
|
||||
|
||||
<field default="" description="" label="Autoplay Settings" name="spacer_autoplay" type="break"/>
|
||||
<field default="0" description="Whether to autoplay RokTabs or no" label="Autoplay" name="autoplay" type="radio">
|
||||
<option value="0">No</option>
|
||||
<option value="1">Yes</option>
|
||||
</field>
|
||||
<field default="2000" description="Amount in milliseconds for the autoplay to change. Default 2secs (2000ms)" label="Autoplay Delay (ms)" name="autoplay_delay" type="text"/>
|
||||
|
||||
</fieldset>
|
||||
<fieldset name="advanced">
|
||||
<field description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" name="moduleclass_sfx" type="text"/>
|
||||
|
||||
<field default="0" name="cache" type="hidden">
|
||||
</field>
|
||||
<field default="1" description="COM_MODULES_FIELD_CACHING_DESC" label="COM_MODULES_FIELD_CACHING_LABEL" name="module_cache" type="list">
|
||||
<option value="1">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
||||
</field>
|
||||
|
||||
<field default="900" description="COM_MODULES_FIELD_CACHE_TIME_DESC" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" name="cache_time" type="text"/>
|
||||
<field default="static" name="cachemode" type="hidden">
|
||||
<option value="static"/>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
<updateservers>
|
||||
<server name="RocketTheme Update Directory" priority="1" type="collection">
|
||||
http://updates.rockettheme.com/joomla/updates.xml
|
||||
</server>
|
||||
</updateservers>
|
||||
</extension>
|
639
modules/mod_roktabs/thumbnail.inc.php
Normal file
@ -0,0 +1,639 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: thumbnail.inc.php 6824 2013-01-28 06:14:09Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*
|
||||
* thumbnail.inc.php
|
||||
*
|
||||
* original author Ian Selby (ian@gen-x-design.com)
|
||||
* original copyright Copyright 2006
|
||||
* original version 1.2 (modified by RocketTheme)
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them.
|
||||
* @package RocketTheme
|
||||
* @subpackage rokstories
|
||||
*/
|
||||
class Thumbnail
|
||||
{
|
||||
/**
|
||||
* Error message to display, if any
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $errmsg;
|
||||
/**
|
||||
* Whether or not there is an error
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
var $error;
|
||||
/**
|
||||
* Format of the image file
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $format;
|
||||
/**
|
||||
* File name and path of the image file
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $fileName;
|
||||
/**
|
||||
* Image meta data if any is available (jpeg/tiff) via the exif library
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $imageMeta;
|
||||
/**
|
||||
* Current dimensions of working image
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $currentDimensions;
|
||||
/**
|
||||
* New dimensions of working image
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $newDimensions;
|
||||
/**
|
||||
* Image resource for newly manipulated image
|
||||
*
|
||||
* @var resource
|
||||
* @access private
|
||||
*/
|
||||
var $newImage;
|
||||
/**
|
||||
* Image resource for image before previous manipulation
|
||||
*
|
||||
* @var resource
|
||||
* @access private
|
||||
*/
|
||||
var $oldImage;
|
||||
/**
|
||||
* Image resource for image being currently manipulated
|
||||
*
|
||||
* @var resource
|
||||
* @access private
|
||||
*/
|
||||
var $workingImage;
|
||||
/**
|
||||
* Percentage to resize image by
|
||||
*
|
||||
* @var int
|
||||
* @access private
|
||||
*/
|
||||
var $percent;
|
||||
/**
|
||||
* Maximum width of image during resize
|
||||
*
|
||||
* @var int
|
||||
* @access private
|
||||
*/
|
||||
var $maxWidth;
|
||||
/**
|
||||
* Maximum height of image during resize
|
||||
*
|
||||
* @var int
|
||||
* @access private
|
||||
*/
|
||||
var $maxHeight;
|
||||
|
||||
/**
|
||||
* Class constructor
|
||||
*
|
||||
* @param string $fileName
|
||||
*
|
||||
* @return Thumbnail
|
||||
*/
|
||||
function Thumbnail($fileName)
|
||||
{
|
||||
//make sure the GD library is installed
|
||||
if (!function_exists("gd_info")) {
|
||||
echo 'You do not have the GD Library installed. This class requires the GD library to function properly.' . "\n";
|
||||
echo 'visit http://us2.php.net/manual/en/ref.image.php for more information';
|
||||
exit;
|
||||
}
|
||||
//initialize variables
|
||||
$this->errmsg = '';
|
||||
$this->error = false;
|
||||
$this->currentDimensions = array();
|
||||
$this->newDimensions = array();
|
||||
$this->fileName = $fileName;
|
||||
$this->imageMeta = array();
|
||||
$this->percent = 100;
|
||||
$this->maxWidth = 0;
|
||||
$this->maxHeight = 0;
|
||||
|
||||
//check to see if file exists
|
||||
if (!file_exists($this->fileName)) {
|
||||
$this->errmsg = 'File not found';
|
||||
$this->error = true;
|
||||
} //check to see if file is readable
|
||||
elseif (!is_readable($this->fileName)) {
|
||||
$this->errmsg = 'File is not readable';
|
||||
$this->error = true;
|
||||
}
|
||||
|
||||
//if there are no errors, determine the file format
|
||||
if ($this->error == false) {
|
||||
//check if gif
|
||||
if (stristr(strtolower($this->fileName), '.gif')) $this->format = 'GIF'; //check if jpg
|
||||
elseif (stristr(strtolower($this->fileName), '.jpg') || stristr(strtolower($this->fileName), '.jpeg')) $this->format = 'JPG'; //check if png
|
||||
elseif (stristr(strtolower($this->fileName), '.png')) $this->format = 'PNG'; //unknown file format
|
||||
else {
|
||||
$this->errmsg = 'Unknown file format';
|
||||
$this->error = true;
|
||||
}
|
||||
}
|
||||
|
||||
//initialize resources if no errors
|
||||
if ($this->error == false) {
|
||||
switch ($this->format) {
|
||||
case 'GIF':
|
||||
$this->oldImage = ImageCreateFromGif($this->fileName);
|
||||
break;
|
||||
case 'JPG':
|
||||
$this->oldImage = ImageCreateFromJpeg($this->fileName);
|
||||
break;
|
||||
case 'PNG':
|
||||
$this->oldImage = ImageCreateFromPng($this->fileName);
|
||||
break;
|
||||
}
|
||||
|
||||
$size = GetImageSize($this->fileName);
|
||||
$this->currentDimensions = array('width' => $size[0], 'height' => $size[1]);
|
||||
$this->newImage = $this->oldImage;
|
||||
//$this->gatherImageMeta();
|
||||
}
|
||||
|
||||
// if($this->error == true) {
|
||||
// return false;
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* Must be called to free up allocated memory after all manipulations are done
|
||||
*
|
||||
*/
|
||||
function destruct()
|
||||
{
|
||||
if (is_resource($this->newImage)) @ImageDestroy($this->newImage);
|
||||
if (is_resource($this->oldImage)) @ImageDestroy($this->oldImage);
|
||||
if (is_resource($this->workingImage)) @ImageDestroy($this->workingImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current width of the image
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function getCurrentWidth()
|
||||
{
|
||||
return $this->currentDimensions['width'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current height of the image
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function getCurrentHeight()
|
||||
{
|
||||
return $this->currentDimensions['height'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates new image width
|
||||
*
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function calcWidth($width, $height)
|
||||
{
|
||||
$newWp = (100 * $this->maxWidth) / $width;
|
||||
$newHeight = ($height * $newWp) / 100;
|
||||
return array('newWidth' => intval($this->maxWidth), 'newHeight' => intval($newHeight));
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates new image height
|
||||
*
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function calcHeight($width, $height)
|
||||
{
|
||||
$newHp = (100 * $this->maxHeight) / $height;
|
||||
$newWidth = ($width * $newHp) / 100;
|
||||
return array('newWidth' => intval($newWidth), 'newHeight' => intval($this->maxHeight));
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates new image size based on percentage
|
||||
*
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function calcPercent($width, $height)
|
||||
{
|
||||
$newWidth = ($width * $this->percent) / 100;
|
||||
$newHeight = ($height * $this->percent) / 100;
|
||||
return array('newWidth' => intval($newWidth), 'newHeight' => intval($newHeight));
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates new image size based on width and height, while constraining to maxWidth and maxHeight
|
||||
*
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
*/
|
||||
function calcImageSize($width, $height)
|
||||
{
|
||||
$newSize = array('newWidth' => $width, 'newHeight' => $height);
|
||||
|
||||
if ($this->maxWidth > 0) {
|
||||
|
||||
$newSize = $this->calcWidth($width, $height);
|
||||
|
||||
if ($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) {
|
||||
$newSize = $this->calcHeight($newSize['newWidth'], $newSize['newHeight']);
|
||||
}
|
||||
|
||||
//$this->newDimensions = $newSize;
|
||||
}
|
||||
|
||||
if ($this->maxHeight > 0) {
|
||||
$newSize = $this->calcHeight($width, $height);
|
||||
|
||||
if ($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) {
|
||||
$newSize = $this->calcWidth($newSize['newWidth'], $newSize['newHeight']);
|
||||
}
|
||||
|
||||
//$this->newDimensions = $newSize;
|
||||
}
|
||||
|
||||
$this->newDimensions = $newSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates new image size based percentage
|
||||
*
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
*/
|
||||
function calcImageSizePercent($width, $height)
|
||||
{
|
||||
if ($this->percent > 0) {
|
||||
$this->newDimensions = $this->calcPercent($width, $height);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays error image
|
||||
*
|
||||
*/
|
||||
function showErrorImage()
|
||||
{
|
||||
header('Content-type: image/png');
|
||||
$errImg = ImageCreate(220, 25);
|
||||
$bgColor = imagecolorallocate($errImg, 0, 0, 0);
|
||||
$fgColor1 = imagecolorallocate($errImg, 255, 255, 255);
|
||||
$fgColor2 = imagecolorallocate($errImg, 255, 0, 0);
|
||||
imagestring($errImg, 3, 6, 6, 'Error:', $fgColor2);
|
||||
imagestring($errImg, 3, 55, 6, $this->errmsg, $fgColor1);
|
||||
imagepng($errImg);
|
||||
imagedestroy($errImg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resizes image to maxWidth x maxHeight
|
||||
*
|
||||
* @param int $maxWidth
|
||||
* @param int $maxHeight
|
||||
*/
|
||||
function resize($maxWidth = 0, $maxHeight = 0)
|
||||
{
|
||||
$this->maxWidth = $maxWidth;
|
||||
$this->maxHeight = $maxHeight;
|
||||
|
||||
$this->calcImageSize($this->currentDimensions['width'], $this->currentDimensions['height']);
|
||||
|
||||
if (function_exists("ImageCreateTrueColor")) {
|
||||
$this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
|
||||
} else {
|
||||
$this->workingImage = ImageCreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
|
||||
}
|
||||
|
||||
ImageCopyResampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newDimensions['newWidth'], $this->newDimensions['newHeight'], $this->currentDimensions['width'], $this->currentDimensions['height']);
|
||||
|
||||
$this->oldImage = $this->workingImage;
|
||||
$this->newImage = $this->workingImage;
|
||||
$this->currentDimensions['width'] = $this->newDimensions['newWidth'];
|
||||
$this->currentDimensions['height'] = $this->newDimensions['newHeight'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Resizes the image by $percent percent
|
||||
*
|
||||
* @param int $percent
|
||||
*/
|
||||
function resizePercent($percent = 0)
|
||||
{
|
||||
$this->percent = $percent;
|
||||
|
||||
$this->calcImageSizePercent($this->currentDimensions['width'], $this->currentDimensions['height']);
|
||||
|
||||
if (function_exists("ImageCreateTrueColor")) {
|
||||
$this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
|
||||
} else {
|
||||
$this->workingImage = ImageCreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
|
||||
}
|
||||
|
||||
ImageCopyResampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newDimensions['newWidth'], $this->newDimensions['newHeight'], $this->currentDimensions['width'], $this->currentDimensions['height']);
|
||||
|
||||
$this->oldImage = $this->workingImage;
|
||||
$this->newImage = $this->workingImage;
|
||||
$this->currentDimensions['width'] = $this->newDimensions['newWidth'];
|
||||
$this->currentDimensions['height'] = $this->newDimensions['newHeight'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Crops the image from calculated center in a square of $cropSize pixels
|
||||
*
|
||||
* @param int $cropSize
|
||||
*/
|
||||
function cropFromCenter($cropSize)
|
||||
{
|
||||
if ($cropSize > $this->currentDimensions['width']) $cropSize = $this->currentDimensions['width'];
|
||||
if ($cropSize > $this->currentDimensions['height']) $cropSize = $this->currentDimensions['height'];
|
||||
|
||||
$cropX = intval(($this->currentDimensions['width'] - $cropSize) / 2);
|
||||
$cropY = intval(($this->currentDimensions['height'] - $cropSize) / 2);
|
||||
|
||||
if (function_exists("ImageCreateTrueColor")) {
|
||||
$this->workingImage = ImageCreateTrueColor($cropSize, $cropSize);
|
||||
} else {
|
||||
$this->workingImage = ImageCreate($cropSize, $cropSize);
|
||||
}
|
||||
|
||||
imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $cropX, $cropY, $cropSize, $cropSize, $cropSize, $cropSize);
|
||||
|
||||
$this->oldImage = $this->workingImage;
|
||||
$this->newImage = $this->workingImage;
|
||||
$this->currentDimensions['width'] = $cropSize;
|
||||
$this->currentDimensions['height'] = $cropSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner.
|
||||
*
|
||||
* @param int $startX
|
||||
* @param int $startY
|
||||
* @param int $width
|
||||
* @param int $height
|
||||
*/
|
||||
function crop($startX, $startY, $width, $height)
|
||||
{
|
||||
//make sure the cropped area is not greater than the size of the image
|
||||
if ($width > $this->currentDimensions['width']) $width = $this->currentDimensions['width'];
|
||||
if ($height > $this->currentDimensions['height']) $height = $this->currentDimensions['height'];
|
||||
//make sure not starting outside the image
|
||||
if (($startX + $width) > $this->currentDimensions['width']) $startX = ($this->currentDimensions['width'] - $width);
|
||||
if (($startY + $height) > $this->currentDimensions['height']) $startY = ($this->currentDimensions['height'] - $height);
|
||||
if ($startX < 0) $startX = 0;
|
||||
if ($startY < 0) $startY = 0;
|
||||
|
||||
if (function_exists("ImageCreateTrueColor")) {
|
||||
$this->workingImage = ImageCreateTrueColor($width, $height);
|
||||
} else {
|
||||
$this->workingImage = ImageCreate($width, $height);
|
||||
}
|
||||
|
||||
imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $startX, $startY, $width, $height, $width, $height);
|
||||
|
||||
$this->oldImage = $this->workingImage;
|
||||
$this->newImage = $this->workingImage;
|
||||
$this->currentDimensions['width'] = $width;
|
||||
$this->currentDimensions['height'] = $height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the image to the screen, or saves to $name if supplied. Quality of JPEG images can be controlled with the $quality variable
|
||||
*
|
||||
* @param int $quality
|
||||
* @param string $name
|
||||
*/
|
||||
function show($quality = 100, $name = '')
|
||||
{
|
||||
switch ($this->format) {
|
||||
case 'GIF':
|
||||
if ($name != '') {
|
||||
ImageGif($this->newImage, $name);
|
||||
} else {
|
||||
header('Content-type: image/gif');
|
||||
ImageGif($this->newImage);
|
||||
}
|
||||
break;
|
||||
case 'JPG':
|
||||
if ($name != '') {
|
||||
ImageJpeg($this->newImage, $name, $quality);
|
||||
} else {
|
||||
header('Content-type: image/jpeg');
|
||||
ImageJpeg($this->newImage, '', $quality);
|
||||
}
|
||||
break;
|
||||
case 'PNG':
|
||||
if ($name != '') {
|
||||
ImagePng($this->newImage, $name);
|
||||
} else {
|
||||
header('Content-type: image/png');
|
||||
ImagePng($this->newImage);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves image as $name (can include file path), with quality of # percent if file is a jpeg
|
||||
*
|
||||
* @param string $name
|
||||
* @param int $quality
|
||||
*/
|
||||
function save($name, $quality = 100)
|
||||
{
|
||||
$this->show($quality, $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Apple-style reflection under image, optionally adding a border to main image
|
||||
*
|
||||
* @param int $percent
|
||||
* @param int $reflection
|
||||
* @param int $white
|
||||
* @param bool $border
|
||||
* @param string $borderColor
|
||||
*/
|
||||
function createReflection($percent, $reflection, $white, $border = true, $borderColor = '#a4a4a4')
|
||||
{
|
||||
$width = $this->currentDimensions['width'];
|
||||
$height = $this->currentDimensions['height'];
|
||||
|
||||
$reflectionHeight = intval($height * ($reflection / 100));
|
||||
$newHeight = $height + $reflectionHeight;
|
||||
$reflectedPart = $height * ($percent / 100);
|
||||
|
||||
$this->workingImage = ImageCreateTrueColor($width, $newHeight);
|
||||
|
||||
ImageAlphaBlending($this->workingImage, true);
|
||||
|
||||
$colorToPaint = ImageColorAllocateAlpha($this->workingImage, 255, 255, 255, 0);
|
||||
ImageFilledRectangle($this->workingImage, 0, 0, $width, $newHeight, $colorToPaint);
|
||||
|
||||
imagecopyresampled($this->workingImage, $this->newImage, 0, 0, 0, $reflectedPart, $width, $reflectionHeight, $width, ($height - $reflectedPart));
|
||||
$this->imageFlipVertical();
|
||||
|
||||
imagecopy($this->workingImage, $this->newImage, 0, 0, 0, 0, $width, $height);
|
||||
|
||||
imagealphablending($this->workingImage, true);
|
||||
|
||||
for ($i = 0; $i < $reflectionHeight; $i++) {
|
||||
$colorToPaint = imagecolorallocatealpha($this->workingImage, 255, 255, 255, ($i / $reflectionHeight * -1 + 1) * $white);
|
||||
imagefilledrectangle($this->workingImage, 0, $height + $i, $width, $height + $i, $colorToPaint);
|
||||
}
|
||||
|
||||
if ($border == true) {
|
||||
$rgb = $this->hex2rgb($borderColor, false);
|
||||
$colorToPaint = imagecolorallocate($this->workingImage, $rgb[0], $rgb[1], $rgb[2]);
|
||||
imageline($this->workingImage, 0, 0, $width, 0, $colorToPaint); //top line
|
||||
imageline($this->workingImage, 0, $height, $width, $height, $colorToPaint); //bottom line
|
||||
imageline($this->workingImage, 0, 0, 0, $height, $colorToPaint); //left line
|
||||
imageline($this->workingImage, $width - 1, 0, $width - 1, $height, $colorToPaint); //right line
|
||||
}
|
||||
|
||||
$this->oldImage = $this->workingImage;
|
||||
$this->newImage = $this->workingImage;
|
||||
$this->currentDimensions['width'] = $width;
|
||||
$this->currentDimensions['height'] = $newHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inverts working image, used by reflection function
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function imageFlipVertical()
|
||||
{
|
||||
$x_i = imagesx($this->workingImage);
|
||||
$y_i = imagesy($this->workingImage);
|
||||
|
||||
for ($x = 0; $x < $x_i; $x++) {
|
||||
for ($y = 0; $y < $y_i; $y++) {
|
||||
imagecopy($this->workingImage, $this->workingImage, $x, $y_i - $y - 1, $x, $y, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts hexidecimal color value to rgb values and returns as array/string
|
||||
*
|
||||
* @param string $hex
|
||||
* @param bool $asString
|
||||
*
|
||||
* @return array|string
|
||||
*/
|
||||
function hex2rgb($hex, $asString = false)
|
||||
{
|
||||
// strip off any leading #
|
||||
if (0 === strpos($hex, '#')) {
|
||||
$hex = substr($hex, 1);
|
||||
} else if (0 === strpos($hex, '&H')) {
|
||||
$hex = substr($hex, 2);
|
||||
}
|
||||
|
||||
// break into hex 3-tuple
|
||||
$cutpoint = ceil(strlen($hex) / 2) - 1;
|
||||
$rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);
|
||||
|
||||
// convert each tuple to decimal
|
||||
$rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0);
|
||||
$rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0);
|
||||
$rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0);
|
||||
|
||||
return ($asString ? "{$rgb[0]} {$rgb[1]} {$rgb[2]}" : $rgb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads selected exif meta data from jpg images and populates $this->imageMeta with appropriate values if found
|
||||
*
|
||||
*/
|
||||
function gatherImageMeta()
|
||||
{
|
||||
//only attempt to retrieve info if exif exists
|
||||
if (function_exists("exif_read_data") && $this->format == 'JPG') {
|
||||
$imageData = exif_read_data($this->fileName);
|
||||
if (isset($imageData['Make'])) $this->imageMeta['make'] = ucwords(strtolower($imageData['Make']));
|
||||
if (isset($imageData['Model'])) $this->imageMeta['model'] = $imageData['Model'];
|
||||
if (isset($imageData['COMPUTED']['ApertureFNumber'])) {
|
||||
$this->imageMeta['aperture'] = $imageData['COMPUTED']['ApertureFNumber'];
|
||||
$this->imageMeta['aperture'] = str_replace('/', '', $this->imageMeta['aperture']);
|
||||
}
|
||||
if (isset($imageData['ExposureTime'])) {
|
||||
$exposure = explode('/', $imageData['ExposureTime']);
|
||||
$exposure = round($exposure[1] / $exposure[0], -1);
|
||||
$this->imageMeta['exposure'] = '1/' . $exposure . ' second';
|
||||
}
|
||||
if (isset($imageData['Flash'])) {
|
||||
if ($imageData['Flash'] > 0) {
|
||||
$this->imageMeta['flash'] = 'Yes';
|
||||
} else {
|
||||
$this->imageMeta['flash'] = 'No';
|
||||
}
|
||||
}
|
||||
if (isset($imageData['FocalLength'])) {
|
||||
$focus = explode('/', $imageData['FocalLength']);
|
||||
$this->imageMeta['focalLength'] = round($focus[0] / $focus[1], 2) . ' mm';
|
||||
}
|
||||
if (isset($imageData['DateTime'])) {
|
||||
$date = $imageData['DateTime'];
|
||||
$date = explode(' ', $date);
|
||||
$date = str_replace(':', '-', $date[0]) . ' ' . $date[1];
|
||||
$this->imageMeta['dateTaken'] = date('m/d/Y g:i A', strtotime($date));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotates image either 90 degrees clockwise or counter-clockwise
|
||||
*
|
||||
* @param string $direction
|
||||
*/
|
||||
function rotateImage($direction = 'CW')
|
||||
{
|
||||
if ($direction == 'CW') {
|
||||
$this->workingImage = imagerotate($this->workingImage, -90, 0);
|
||||
} else {
|
||||
$this->workingImage = imagerotate($this->workingImage, 90, 0);
|
||||
}
|
||||
$newWidth = $this->currentDimensions['height'];
|
||||
$newHeight = $this->currentDimensions['width'];
|
||||
$this->oldImage = $this->workingImage;
|
||||
$this->newImage = $this->workingImage;
|
||||
$this->currentDimensions['width'] = $newWidth;
|
||||
$this->currentDimensions['height'] = $newHeight;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
1
modules/mod_roktabs/tmpl/dark/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
BIN
modules/mod_roktabs/tmpl/dark/next-dark.png
Normal file
After Width: | Height: | Size: 591 B |
BIN
modules/mod_roktabs/tmpl/dark/prev-dark.png
Normal file
After Width: | Height: | Size: 583 B |
38
modules/mod_roktabs/tmpl/dark/roktabs.css
Normal file
@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @author RocketTheme, LLC http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
/* Dark Theme */
|
||||
|
||||
.roktabs-wrapper {padding: 0;}
|
||||
.roktabs-wrapper .dark {position: relative;border: 1px solid #272727;color: #999;}
|
||||
.roktabs-wrapper .dark .roktabs-container-inner {position:relative;overflow: hidden;}
|
||||
.roktabs-wrapper .dark .roktabs-container-wrapper {clear: both;position: relative;overflow:hidden;width: 30000px;}
|
||||
.roktabs-wrapper .dark .roktabs-container-wrapper div {float: left;/*width: 450px;*//*width: 220px;*/}
|
||||
.roktabs-wrapper .dark .roktabs-container-wrapper div.wrapper {padding: 14px;width: auto;}
|
||||
.roktabs-wrapper .dark .roktabs-links {overflow: hidden;margin:0;}
|
||||
.roktabs-wrapper .dark .active-arrows .roktabs-links {margin:0 21px;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul {text-align: left;font-weight: bold;list-style-type: none;padding: 0;overflow:hidden;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul.roktabs-top {margin: 0;background: url(tabbg-dark.png) 0 0 repeat-x;height: 32px;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul.roktabs-bottom {margin: 0;background: url(tabbg-bottom-dark.png) 0 0 repeat-x;height: 32px;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul li {float: left;padding: 0;margin: 0;text-decoration: none;border-right: 1px solid #272727;border-bottom: none;color: #999;position: relative;height: 31px;line-height: 31px;width: auto;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul li span {padding: 0 10px;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul li.first {border-left: 0;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul li.active.last {border-right: 1px solid #272727;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul li.last {border-right: 0;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul li.hover {color: #ccc;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul.roktabs-top li.active {background: url(tabbg-active-dark.png) 0 0 repeat-x;color: #ccc;height: 31px;border-bottom: 1px solid #151515;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul.roktabs-bottom li.active {background: url(tabbg-bottom-active-dark.png) 0 0 repeat-x;color: #ccc;height: 31px;border-top: 1px solid #151515;margin-top: -1px;}
|
||||
.roktabs-wrapper .dark .roktabs-links ul li.active.first {border-left: 0;}
|
||||
.roktabs-wrapper .dark .roktabs-scroller {position: absolute;bottom: 0;right: 0;height: 32px;}
|
||||
.roktabs-wrapper .dark .arrow-next, .roktabs-wrapper .dark .arrow-prev {line-height: 29px;margin: 1px;text-align: center;float: left;cursor: pointer;border: 1px solid #272727;z-index: 2;width:17px;position:absolute;top:0;height:29px;}
|
||||
.roktabs-wrapper .dark .arrow-next {right:0;background: url(next-dark.png) 50% 0 no-repeat;}
|
||||
.roktabs-wrapper .dark .arrow-prev {left:0;background: url(prev-dark.png) 50% 0 no-repeat;}
|
||||
.roktabs-wrapper .dark .arrow-next-hover {background-position: 50% -29px;}
|
||||
.roktabs-wrapper .dark .arrow-prev-hover {background-position: 50% -29px;}
|
||||
.roktabs-wrapper .dark .arrow-prev span, .roktabs-wrapper .dark .arrow-next span {display: none;}
|
||||
.roktabs-wrapper .dark .roktabs-container-tr, .roktabs-wrapper .dark .roktabs-container-inner, .roktabs-wrapper .dark .active-arrows {background: #151515;}
|
||||
.clear {clear: both;}
|
||||
.roktabs-wrapper .icon-left .tab-icon {vertical-align:middle;margin-right:5px;}
|
||||
.roktabs-wrapper .icon-right .tab-icon {vertical-align:middle;margin-left:5px;}
|
BIN
modules/mod_roktabs/tmpl/dark/tabbg-active-dark.png
Normal file
After Width: | Height: | Size: 298 B |
BIN
modules/mod_roktabs/tmpl/dark/tabbg-bottom-active-dark.png
Normal file
After Width: | Height: | Size: 297 B |
BIN
modules/mod_roktabs/tmpl/dark/tabbg-bottom-dark.png
Normal file
After Width: | Height: | Size: 251 B |
BIN
modules/mod_roktabs/tmpl/dark/tabbg-dark.png
Normal file
After Width: | Height: | Size: 251 B |
104
modules/mod_roktabs/tmpl/default.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 6824 2013-01-28 06:14:09Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$path = JPATH_SITE . '/modules/mod_roktabs/tmpl/';
|
||||
$uri_path = JURI::Root(true) . '/modules/mod_roktabs/tmpl/';
|
||||
|
||||
$count = count($list);
|
||||
|
||||
// options
|
||||
$style = $params->get('theme', 'light');
|
||||
$width = $params->get('width', 500);
|
||||
$tabs = $params->get('tabs_count', 3);
|
||||
$tabs_position = $params->get('tabs_position', 'top');
|
||||
$tabs_event = $params->get('tabs_event', 'click');
|
||||
|
||||
$tabs_incremental = $params->get('tabs_incremental', 'Tab ');
|
||||
|
||||
$linksMargins = $params->get('linksMargins', 0);
|
||||
$duration = $params->get('duration', 600);
|
||||
$transition_type = $params->get('transition_type', 'scrolling');
|
||||
$transition_fx = $params->get('transition_fx', 'Quad.easeInOut');
|
||||
$autoplay = $params->get('autoplay', 0);
|
||||
$autoplay_delay = $params->get('autoplay_delay', 2000);
|
||||
$navscrolling = $params->get('navscrolling', 1);
|
||||
|
||||
if (intval($tabs) > $count) $tabs = $count; else if (intval($tabs) == 0) $tabs = $count;
|
||||
if (strlen($tabs_incremental) <= 0) $tabs_incremental = "Tab ";
|
||||
|
||||
$style_css = $path . $style . '/roktabs.css';
|
||||
$css = $uri_path . $style . '/roktabs.css';
|
||||
|
||||
if (file_exists($style_css)) $document->addStyleSheet($css);
|
||||
if (!defined('ROKTABS_JS')) {
|
||||
$document->addScript($uri_path . 'roktabs' . modRokTabsHelper::_getJSVersion() . '.js');
|
||||
define('ROKTABS_JS', 1);
|
||||
}
|
||||
|
||||
|
||||
$write_tabs = modRokTabsHelper::write_tabs($tabs, $tabs_position, $list, null, $tabs_incremental, null, $params);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
RokTabsOptions.mouseevent.push('<?php echo $tabs_event; ?>');
|
||||
RokTabsOptions.duration.push(<?php echo $duration; ?>);
|
||||
RokTabsOptions.transition.push(Fx.Transitions.<?php echo $transition_fx; ?>);
|
||||
RokTabsOptions.auto.push(<?php echo $autoplay; ?>);
|
||||
RokTabsOptions.delay.push(<?php echo $autoplay_delay; ?>);
|
||||
RokTabsOptions.type.push('<?php echo $transition_type; ?>');
|
||||
RokTabsOptions.linksMargins.push(<?php echo $linksMargins; ?>);
|
||||
RokTabsOptions.navscroll.push(<?php echo $navscrolling; ?>);
|
||||
</script>
|
||||
<div class="roktabs-wrapper" style="width: <?php echo $width; ?>px;">
|
||||
<div class="roktabs <?php echo $style; ?>">
|
||||
<!--<div class="roktabs-arrows">
|
||||
<span class="previous">←</span>
|
||||
<span class="next">→</span>
|
||||
</div>-->
|
||||
<?php
|
||||
if ($tabs_position == 'top' || $tabs_position == 'hidden') echo $write_tabs;
|
||||
?>
|
||||
<div class="roktabs-container-tr">
|
||||
<div class="roktabs-container-tl">
|
||||
<div class="roktabs-container-br">
|
||||
<div class="roktabs-container-bl">
|
||||
<div class="roktabs-container-inner">
|
||||
<div class="roktabs-container-wrapper">
|
||||
<?php
|
||||
if ($tabs == 0) $tabs = count($list);
|
||||
for ($i = 0; $i < $tabs; $i++) {
|
||||
if ($list[$i]->title != '' && $list[$i]->introtext != '') {
|
||||
echo "<div class='roktabs-tab" . ($i + 1) . "'>\n";
|
||||
echo " <div class='wrapper'>\n";
|
||||
echo $list[$i]->introtext;
|
||||
echo " </div>";
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if ($tabs_position == 'bottom') echo $write_tabs;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
?>
|
1
modules/mod_roktabs/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
1
modules/mod_roktabs/tmpl/light/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
BIN
modules/mod_roktabs/tmpl/light/next-light.png
Normal file
After Width: | Height: | Size: 681 B |
BIN
modules/mod_roktabs/tmpl/light/prev-light.png
Normal file
After Width: | Height: | Size: 680 B |
38
modules/mod_roktabs/tmpl/light/roktabs.css
Normal file
@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @author RocketTheme, LLC http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
/* Light Theme */
|
||||
|
||||
.roktabs-wrapper {padding: 0;}
|
||||
.roktabs-wrapper .light {position: relative;border: 1px solid #DCDCDC;}
|
||||
.roktabs-wrapper .light .roktabs-container-inner {position:relative;overflow: hidden;}
|
||||
.roktabs-wrapper .light .roktabs-container-wrapper {clear: both;position: relative;overflow: hidden;width: 30000px;}
|
||||
.roktabs-wrapper .light .roktabs-container-wrapper div {float: left;/*width: 450px;*//*width: 220px;*/}
|
||||
.roktabs-wrapper .light .roktabs-container-wrapper div.wrapper {padding: 14px;width: auto;}
|
||||
.roktabs-wrapper .light .roktabs-links {overflow: hidden;margin:0;}
|
||||
.roktabs-wrapper .light .active-arrows .roktabs-links {margin:0 21px;}
|
||||
.roktabs-wrapper .light .roktabs-links ul {text-align: left;font-weight: bold;list-style-type: none;padding: 0;overflow:hidden;}
|
||||
.roktabs-wrapper .light .roktabs-links ul.roktabs-top {margin: 0;background: url(tabbg-light.png) 0 0 repeat-x;height: 32px;}
|
||||
.roktabs-wrapper .light .roktabs-links ul.roktabs-bottom {margin: 0;background: url(tabbg-bottom-light.png) 0 0 repeat-x;height: 32px;}
|
||||
.roktabs-wrapper .light .roktabs-links ul li {float: left;padding: 0;margin: 0;text-decoration: none;border-right: 1px solid #DCDCDC;border-bottom: none;color: #666;position: relative;height: 31px;line-height: 31px;width: auto;}
|
||||
.roktabs-wrapper .light .roktabs-links ul li span {padding: 0 10px;}
|
||||
.roktabs-wrapper .light .roktabs-links ul li.first {border-left: 0;}
|
||||
.roktabs-wrapper .light .roktabs-links ul li.active.last {border-right: 1px solid #DCDCDC;}
|
||||
.roktabs-wrapper .light .roktabs-links ul li.last {border-right: 0;}
|
||||
.roktabs-wrapper .light .roktabs-links ul li.hover {color: #000;}
|
||||
.roktabs-wrapper .light .roktabs-links ul.roktabs-top li.active {background: url(tabbg-active-light.png) 0 0 repeat-x;color: #000;height: 31px;border-bottom: 1px solid #fff;}
|
||||
.roktabs-wrapper .light .roktabs-links ul.roktabs-bottom li.active {background: url(tabbg-active-bottom-light.png) 0 0 repeat-x;color: #000;height: 31px;border-top: 1px solid #fff;margin-top: -1px;}
|
||||
.roktabs-wrapper .light .roktabs-links ul li.active.first {border-left: 0;}
|
||||
.roktabs-wrapper .light .roktabs-scroller {position: absolute;bottom: 0;right: 0;height: 32px;}
|
||||
.roktabs-wrapper .light .arrow-next, .roktabs-wrapper .light .arrow-prev {line-height: 29px;margin: 1px;text-align: center;float: left;cursor: pointer;border: 1px solid #DCDCDC;z-index: 2;width:17px;position:absolute;top:0;height:29px;}
|
||||
.roktabs-wrapper .light .arrow-next {right:0;background: url(next-light.png) 50% 0 no-repeat;}
|
||||
.roktabs-wrapper .light .arrow-prev {left:0;background: url(prev-light.png) 50% 0 no-repeat;}
|
||||
.roktabs-wrapper .light .arrow-next-hover {background-position: 50% -29px;}
|
||||
.roktabs-wrapper .light .arrow-prev-hover {background-position: 50% -29px;}
|
||||
.roktabs-wrapper .light .arrow-prev span, .roktabs-wrapper .light .arrow-next span {display: none;}
|
||||
.roktabs-wrapper .light .roktabs-container-tr, .roktabs-wrapper .light .roktabs-container-inner, .roktabs-wrapper .light .active-arrows {background: #fff;}
|
||||
.clear {clear: both;}
|
||||
.roktabs-wrapper .icon-left .tab-icon {vertical-align:middle;margin-right:5px;}
|
||||
.roktabs-wrapper .icon-right .tab-icon {vertical-align:middle;margin-left:5px;}
|
BIN
modules/mod_roktabs/tmpl/light/tabbg-active-bottom-light.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
modules/mod_roktabs/tmpl/light/tabbg-active-light.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
modules/mod_roktabs/tmpl/light/tabbg-bottom-light.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
modules/mod_roktabs/tmpl/light/tabbg-light.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
42
modules/mod_roktabs/tmpl/roktabs.js
Normal file
@ -0,0 +1,42 @@
|
||||
var RokTabsOptions={mouseevent:[],duration:[],transition:[],auto:[],delay:[],type:[],arrows:[],tabsScroll:[],linksMargins:[],navscroll:[],marginCompensation:[]};
|
||||
var RokTabsOptions={mouseevent:[],duration:[],transition:[],auto:[],delay:[],type:[],arrows:[],tabsScroll:[],linksMargins:[],navscroll:[],marginCompensation:[]};
|
||||
var RokTabs=new Class({version:"1.8 (mt1.2)",Implements:[Options,Events],options:{scroll:RokTabsOptions},initialize:function(a){this.setOptions({scroll:RokTabsOptions});
|
||||
if(!this.options.scroll.navscroll||!this.options.scroll.navscroll.length){this.options.scroll.navscroll=[];(RokTabsOptions.duration.length).times(function(){this.options.scroll.navscroll.push(true);
|
||||
}.bind(this));}this.containers=$$(".roktabs-container-inner");this.tabsWrapper=$$(".roktabs-links");this.tabs=$$(".roktabs-links ul");this.panels=$$(".roktabs-container-wrapper");
|
||||
this.outer=$$(this.tabsWrapper.getParent());this.wrapper=$$(this.outer.getParent());this.fx=[];this.current=[];this.timer=[];this.tabsSize=[];this.tabScroll=[];
|
||||
this.panels.each(function(b,c){this.current[c]=0;if(!this.options.scroll.mouseevent[c]){this.options.scroll.mouseevent[c]="click";}b.setStyle("width",(Browser.opera)?30000:50000);
|
||||
if(Browser.ie){b.setStyles({filter:"inherit",position:"relative"}).getChildren().setStyles({filter:"inherit",position:"relative"});}},this);this.attachEvents();
|
||||
},attachEvents:function(){var b,a=this;this.tabs.each(function(l,g){if(!this.options.scroll.navscroll[g]){this.tabsWrapper.addClass("roktabs-links-noscroll");
|
||||
}this.outer[g].addEvents({mouseenter:function(){if(a.options.scroll.auto[g]){a.stop(g);}},mouseleave:function(){if(a.options.scroll.auto[g]){a.start(g);
|
||||
}}});this.fx[g]=new Fx.Scroll(this.panels[g].getParent(),{link:"cancel",wheelStops:false,duration:this.options.scroll.duration[g],transition:this.options.scroll.transition[g]});
|
||||
this.fx[g].set(0,false);b=0;this.containers[g].setStyle("width",this.wrapper[g].getStyle("width").toInt()-this.tabsWrapper[g].getParent().getStyle("border-left-width").toInt()-this.tabsWrapper[g].getParent().getStyle("border-right-width").toInt());
|
||||
l.getElements("li").each(function(d,e){var c=this.panels[g].getChildren()[e];c.setStyle("width",((Browser.ie4)?this.wrapper[g]:this.outer[g]).getStyle("width").toInt()-c.getStyle("padding-left").toInt()-c.getStyle("padding-left").toInt()-c.getStyle("margin-left").toInt()-c.getStyle("margin-left").toInt());
|
||||
b+=d.getSize().x;if(this.options.scroll.marginCompensation[g]){b+=d.getStyle("margin-left").toInt()+d.getStyle("margin-right").toInt();}d.setStyle("cursor","pointer").addEvents({mouseenter:this.mouseenter.bind(this,[d,c,g,e]),mouseleave:this.mouseleave.bind(this,[d,c,g,e]),mousedown:this.mousedown.bind(this,[d,c,g,e]),mouseup:this.mouseup.bind(this,[d,c,g,e])});
|
||||
},this);this.tabsSize[g]=[l.getSize().x,b];var k=this.outer[g].getElement(".roktabs-arrows");if(this.options.scroll.arrows[g]){var j=k.getElement(".previous");
|
||||
var h=k.getElement(".next");}if(this.options.scroll.auto[g]){this.start(g);}if(this.tabsSize[g][1]>this.tabsSize[g][0]&&this.options.scroll.navscroll[g]){this.tabScroller(g);
|
||||
}},this);return this;},mouseenter:function(f,e,h,g){if(f[0]){g=f[3];h=f[2];e=f[1];f=f[0];}f.addClass("hover").addClass("over");this.fireEvent("mouseenter",[f,e,h,g]);
|
||||
if(RokTabsOptions.mouseevent[h]=="mouseenter"){this.mousedown(f,e,h,g,true);this.mouseup(f,e,h,g,true);}},mouseleave:function(f,e,h,g){if(f[0]){g=f[3];
|
||||
h=f[2];e=f[1];f=f[0];}f.removeClass("hover").removeClass("over").removeClass("down").removeClass("up");this.fireEvent("mouseleave",[f,e,h,g]);if(RokTabsOptions.mouseevent[h]=="mouseenter"){this.mouseup(f,e,h,g,true);
|
||||
}},mousedown:function(i,h,n,m,l){if(i[0]){l=i[4];m=i[3];n=i[2];h=i[1];i=i[0];}i.removeClass("up").addClass("down");if(this.options.scroll.type[n]=="scrolling"){this.fx[n].options.duration=RokTabsOptions.duration[n];
|
||||
this.fx[n].options.link="cancel";this.fx[n].toElement(h);}else{var k=this;var j=new Fx.Tween(this.fx[n].element,{duration:RokTabsOptions.duration[n]/2,link:"cancel",onComplete:function(){if(!this.to[0].value){k.fx[n].options.duration=0;
|
||||
k.fx[n].toElement(h);j.start("opacity",1);}}});j.cancel().start("opacity",0);}this.fireEvent("mousedown",[i,h,n,m]);},mouseup:function(g,f,j,i,h){if(g[0]){h=g[4];
|
||||
i=g[3];j=g[2];f=g[1];g=g[0];}if(RokTabsOptions.mouseevent[j]!="click"&&!h){return;}this.tabs[j].getElements("li").removeClass("active");g.removeClass("down").addClass("up").addClass("active");
|
||||
this.current[j]=i;this.fireEvent("mouseup",[g,f,j,i]);},click:function(g,f,j,i,h){if(g[0]){h=g[4];i=g[3];j=g[2];f=g[1];g=g[0];}return g.fireEvent("mousedown",[g,f,j,i],h).fireEvent("mouseup",[g,f,j,i]).fireEvent("mouseleave",[g,f,j,i]);
|
||||
},start:function(d){clearTimeout(this.timer[d]);var c=this.next.bind(this,d);this.timer[d]=c.periodical(this.options.scroll.delay[d]);},stop:function(b){clearTimeout(this.timer[b]);
|
||||
},next:function(e){var d=this.tabs.getElements("li");var h=this.current[e]+1,g=d[e][h],f;if(g){f=g;}else{f=d[e][0];h=0;}return this.click(f,this.panels[e],e,h);
|
||||
},previous:function(e){var d=this.tabs.getElements("li");var h=this.current[e]-1,g=d[e][h],f;if(g){f=g;}else{f=d[e][d.length];h=d.length;}return this.click(f,this.panels[e],e,h);
|
||||
},goTo:function(g,f){var k=this.tabs.getElements("li");var j=k[g][f],h;if(j){h=j;}else{h=k[g][0];current=0;}var i=this.panels[g].getChildren()[f];if(this.options.scroll.mouseevent[g]=="mouseenter"){this.mouseenter(h,i,g,j,true);
|
||||
}return this.click(h,i,g,j,true);},tabView:function(d,c){if(c=="hide"){this.tabs[d].setStyle("display","none");}else{this.tabs[d].setStyle("display","");
|
||||
}},tabPosition:function(e,d){var f=this.tabsWrapper[e];switch(d){case"top":f.inject(f.getParent(),"top");f.getFirst().removeProperty("class").addClass("roktabs-top");
|
||||
break;case"bottom":default:f.inject(f.getParent());f.getFirst().removeProperty("class").addClass("roktabs-bottom");}},tabScroller:function(r){var q=this.tabs[r],s=this;
|
||||
var p=q.getParent();(2).times(function(){s.tabsSize[r][1]=0;q.getChildren().each(function(b){if(window.ie){b.getFirst().inject(b);}s.tabsSize[r][1]+=b.getSize().x+b.getStyle("margin-left").toInt()+b.getStyle("margin-right").toInt()+b.getStyle("padding-left").toInt()+b.getStyle("padding-right").toInt()+b.getStyle("border-left-width").toInt()+b.getStyle("border-right-width").toInt();
|
||||
},this);q.setStyle("width",s.tabsSize[r][1]+((Browser.firefox)?5:(Browser.ie6)?0.5:0));}.bind(this));p.setStyles({overflow:"hidden",width:this.tabsSize[r][0],position:"relative"});
|
||||
if(q.getSize().x>p.getSize().x){var o=new Element("div",{"class":"active-arrows"}).setStyle("position","relative").inject(p,"before").adopt(p);var n=new Element("div",{"class":"arrow-prev png"}).set("html","<span><</span>").inject(o,"top");
|
||||
var m=new Element("div",{"class":"arrow-next png"}).set("html","<span>></span>").inject(o);var l={prev:n.getStyle("width").toInt()+n.getStyle("margin-left").toInt()+n.getStyle("margin-right").toInt()+n.getStyle("border-left").toInt()+n.getStyle("border-right").toInt()+n.getStyle("padding-left").toInt()+n.getStyle("padding-right").toInt(),next:m.getStyle("width").toInt()+m.getStyle("margin-left").toInt()+m.getStyle("margin-right").toInt()+m.getStyle("border-left").toInt()+m.getStyle("border-right").toInt()+m.getStyle("padding-left").toInt()+m.getStyle("padding-right").toInt()};
|
||||
var k=0;if(this.options.scroll.linksMargins[r]){k=p.getStyle("margin-right").toInt();}if(k<0){k=Math.abs(k)/2;}p.setStyle("width",this.tabsSize[r][0]-k-l.prev-l.next);
|
||||
new Element("div",{"class":"clear"}).inject(o);this.tabScroll[r]={speed:70,amount:30,current:0};var a;m.addEvents({mouseenter:function(){clearTimeout(a);
|
||||
this.addClass("arrow-next-hover");a=s.tabScrollerAnim.periodical(s.tabScroll[r]["speed"],s,[r,p,true]);},mouseleave:function(){this.removeClass("arrow-next-hover");
|
||||
clearTimeout(a);}});n.addEvents({mouseenter:function(){clearTimeout(a);this.addClass("arrow-prev-hover");a=s.tabScrollerAnim.periodical(s.tabScroll[r]["speed"],s,[r,p,false]);
|
||||
},mouseleave:function(){this.removeClass("arrow-prev-hover");clearTimeout(a);}});}},tabScrollerAnim:function(g,f,k){var j=f.getScrollSize().x,i=f.getScroll().x;
|
||||
var h;if(k){h=i+this.tabScroll[g]["amount"];}else{h=i-this.tabScroll[g]["amount"];}h=(h<0)?0:(h>=j)?j:h;f.scrollTo(h,0);}});var roktabs;window.addEvent("load",function(){roktabs=new RokTabs();
|
||||
});
|