From: <rob...@us...> - 2012-10-12 19:31:46
|
Revision: 43426 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=43426&view=rev Author: robertplummer Date: 2012-10-12 19:31:39 +0000 (Fri, 12 Oct 2012) Log Message: ----------- [FIX] Step through items that are not expandable, and list them as content, remove id from parent table, not needed Modified Paths: -------------- trunk/lib/core/WikiPlugin/expandingoutline/list.php trunk/lib/core/WikiPlugin/expandingoutline.php trunk/lib/test/core/JisonParser/PluginTest.php Modified: trunk/lib/core/WikiPlugin/expandingoutline/list.php =================================================================== --- trunk/lib/core/WikiPlugin/expandingoutline/list.php 2012-10-12 18:02:56 UTC (rev 43425) +++ trunk/lib/core/WikiPlugin/expandingoutline/list.php 2012-10-12 19:31:39 UTC (rev 43426) @@ -14,6 +14,8 @@ { $this->stacks = $parserList->stacks; $this->index = $parserList->index; + ini_set('error_reporting', E_ALL); + ini_set('display_errors', 1); } public function toHtml() @@ -23,9 +25,8 @@ $lists = array(); foreach ($this->stacks as $key => &$stack) { - $id = 'id' . microtime() * 1000000; + $lists[$key] = '<table class="tikiListTable">'; - $lists[$key] = '<table class="tikiListTable" id="' . $id . '">'; $this->labelTracker = array(); $lists[$key] .= $this->toHtmlChildren($stack); @@ -44,7 +45,8 @@ } $i = 0; - foreach ($stack as &$list) { + for ($j = 0, $max = count($stack); $j < $max; $j++) { + $list = $stack[$j]; switch($list['type']) { case '*': @@ -71,36 +73,26 @@ $trail = implode('_', $trail); if (empty($list['content']) == false) { + $nonExpanding = $this->groupNonExpanding($stack, $j); + $children = $this->toHtmlChildren($stack[$j]['children'], $tier + 1); - $result .= - '<tr>' . - '<td>' . - '<table>' . - '<tr>' . - '<td id="" class="' . $class . ' tier' . $tier . '" data-trail="' . $trail . '" style="width:' . ((count($this->labelTracker) * 30) + 30) . 'px; text-align: right;">' . - (empty($list['children']) == false ? '<img class="listImg" src="img/toggle-expand-dark.png" data-altImg="img/toggle-collapse-dark.png" />' : ''). - $label . - '</td>' . - '<td class="tikiListTableItem">' . $list['content'] .'</td>' . - '</tr>'; + $item = '<tr>' . + '<td id="" class="' . $class . ' tier' . $tier . '" data-trail="' . $trail . '" style="width:' . ((count($this->labelTracker) * 30) + 30) . 'px; text-align: right;">' . + (empty($stack[$j]['children']) == false ? '<img class="listImg" src="img/toggle-expand-dark.png" data-altImg="img/toggle-collapse-dark.png" />' : ''). + $label . + '</td>' . + '<td class="tikiListTableItem">' . $list['content'] .'</td>' . + '</tr>'; - if (empty($list['children']) == false) { - $result .= '<tr class="parentTrail' . $trail . ' tikiListTableChild"><td colspan="2"><table>'; + if (!empty($nonExpanding)) { + $item .= '<tr><td class="tier' . $tier . '"></td><td>' . $nonExpanding . '</td></tr>'; } - } - $result .= $this->toHtmlChildren($list['children'], $tier + 1); - - if (empty($list['content']) == false) { - - if (empty($list['children']) == false) { - $result .= '</table></td></tr>'; + if (empty($children) == false) { + $item .= '<tr class="parentTrail' . $trail . ' tikiListTableChild"><td colspan="2"><table>' . $children . '</table></td></tr>'; } - $result .= - '</table>' . - '</td>' . - '</tr>'; + $result .= '<tr><td><table>' . $item . '</table></td></tr>'; } array_pop($this->labelTracker); @@ -108,4 +100,18 @@ return $result; } + + private function groupNonExpanding(&$stack, &$j) + { + $result = ''; + + while (isset($stack[$j + 1]['type']) && $stack[$j + 1]['type'] == '+' && isset($stack[$j + 1]['content'])) { + $j++; + if (isset($stack[$j]['content'])) { + $result .= $stack[$j]['content'] . '<br />'; + } + } + + return $result; + } } Modified: trunk/lib/core/WikiPlugin/expandingoutline.php =================================================================== --- trunk/lib/core/WikiPlugin/expandingoutline.php 2012-10-12 18:02:56 UTC (rev 43425) +++ trunk/lib/core/WikiPlugin/expandingoutline.php 2012-10-12 19:31:39 UTC (rev 43426) @@ -75,26 +75,28 @@ $headerlib->add_css( - "#$id table { + ".wikiplugin_expandingoutline table { width: 100%; border-collapse:collapse; + border-width: 0px; } - #$id * { + .wikiplugin_expandingoutline * { border-width: 0px; + padding: 0px; } - #$id .tikiListTable td, #$id .tikiListTable { + .wikiplugin_expandingoutline .tikiListTable td, #$id .tikiListTable { font-size: 14px; background-color: white; list-style-type: none; } - #$id .tikiListTableLabel + .wikiplugin_expandingoutline .tikiListTableLabel { width: 1px; white-space: nowrap; } - .tikiListTableChild { + .wikiplugin_expandingoutline .tikiListTableChild { display: none; } Modified: trunk/lib/test/core/JisonParser/PluginTest.php =================================================================== --- trunk/lib/test/core/JisonParser/PluginTest.php 2012-10-12 18:02:56 UTC (rev 43425) +++ trunk/lib/test/core/JisonParser/PluginTest.php 2012-10-12 19:31:39 UTC (rev 43426) @@ -142,7 +142,7 @@ *test{EXPANDINGOUTLINE}" , '<div id="expandingoutline1" class="wikiplugin_expandingoutline" style="">' . - '<table class="tikiListTable" id="">' . + '<table class="tikiListTable">' . '<tr>' . '<td>' . '<table>' . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |