[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12221] switch to jquery tabs
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [12221] switch to jquery tabs |
Date: |
Thu, 23 Oct 2014 08:17:52 +0000 |
Revision: 12221
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12221
Author: sigurdne
Date: 2014-10-23 08:17:50 +0000 (Thu, 23 Oct 2014)
Log Message:
-----------
switch to jquery tabs
Modified Paths:
--------------
branches/dev-syncromind/phpgwapi/inc/class.common.inc.php
branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php
Modified: branches/dev-syncromind/phpgwapi/inc/class.common.inc.php
===================================================================
--- branches/dev-syncromind/phpgwapi/inc/class.common.inc.php 2014-10-23
05:40:34 UTC (rev 12220)
+++ branches/dev-syncromind/phpgwapi/inc/class.common.inc.php 2014-10-23
08:17:50 UTC (rev 12221)
@@ -500,7 +500,7 @@
*/
public function create_tabs($tabs, $selection, $lang = false)
{
- phpgw::import_class('phpgwapi.yui');
+ phpgw::import_class('phpgwapi.jquery');
if ( $lang )
{
foreach ( $tabs as &$tab )
@@ -509,9 +509,9 @@
}
}
- $html = phpgwapi_yui::tabview_generate($tabs,
$selection);
+ $html = phpgwapi_jquery::tabview_generate($tabs,
$selection);
$output = <<<HTML
- <div class="yui-navset">
+ <div id="tab-content">
{$html}
</div>
Modified: branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php
===================================================================
--- branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php 2014-10-23
05:40:34 UTC (rev 12220)
+++ branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php 2014-10-23
08:17:50 UTC (rev 12221)
@@ -98,7 +98,8 @@
$load = array
(
"js/jquery-2.1.1{$_type}",
- "tabs/jquery.responsiveTabs{$_type}"
+ "tabs/jquery.responsiveTabs{$_type}",
+ 'common'
);
$GLOBALS['phpgw']->css->add_external_file("phpgwapi/js/jquery/tabs/css/responsive-tabs.css");
@@ -112,10 +113,12 @@
return '';
}
- foreach ($load as $script) {
+ foreach ($load as $script)
+ {
$test = $GLOBALS['phpgw']->js->validate_file('jquery',
$script);
- if (!$test) {
+ if (!$test)
+ {
$err = "Unable to load jQuery script '%1' when
attempting to load widget: '%2'";
trigger_error(lang($err, $script, $widget),
E_USER_WARNING);
return '';
@@ -142,7 +145,8 @@
return $output;
}
- public static function tabview_generate($tabs, $selection) {
+ public static function tabview_generate($tabs, $selection)
+ {
self::load_widget('tabview');
$output = <<<HTML
<ul>
@@ -164,6 +168,12 @@
if ($tab['disable'] == 1) {
$disabled[] = $i;
}
+
+ if($tab['link'] && !preg_match('/(^#)/i', $tab['link']))
+ {
+ $_function = " onclick=\"javascript:
window.location = '{$tab['link']}';\"";
+ $tab['link'] = "#";
+ }
$output .= <<<HTML
<li><a
href="{$tab['link']}"{$_function}>{$label}</a></li>
@@ -181,7 +191,7 @@
$js = <<<JS
$(document).ready(function ()
{
- if(!JqueryPortico.inlineTablesDefined == 'undefined' ||
JqueryPortico.inlineTablesDefined == 0)
+ if(typeof(JqueryPortico.inlineTablesDefined) ==
'undefined' || JqueryPortico.inlineTablesDefined == 0)
{
JqueryPortico.render_tabs();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12221] switch to jquery tabs,
Sigurd Nes <=