1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

More bootstrap theme work and start of pageNavigation function for sitelinks.

This commit is contained in:
Cameron 2012-12-17 04:21:16 -08:00
parent 0d37da0efc
commit 04e9157961
3 changed files with 33 additions and 21 deletions

View File

@ -1442,10 +1442,10 @@ class e_navigation
/**
* Compile Array Structure
*/
protected function compile(&$inArray, &$outArray, $pid = 0)
public function compile(&$inArray, &$outArray, $pid = 0)
{
if(!is_array($inArray) || !is_array($outArray)){ return; }
foreach($inArray as $key => $val)
{
if($val['link_parent'] == $pid)

View File

@ -14,12 +14,15 @@
* $Author$
*
*/
//require_once("../../class2.php");
if (!defined('e107_INIT')) { exit; }
/*if(!plugInstalled('gsitemap'))
{
return;
}*/
//$pg = new page_sitelinks;
//$pg->myfunction();
class page_sitelinks // include plugin-folder in the name.
@ -30,7 +33,7 @@ class page_sitelinks // include plugin-folder in the name.
$links[] = array(
'name' => "All Pages",
'function' => "myfunction",
'function' => "pageNav",
'description' => ""
);
@ -39,30 +42,39 @@ class page_sitelinks // include plugin-folder in the name.
function myfunction()
function pageNav()
{
$sql = e107::getDb();
$sublinks = array();
$sql->db_Select("page","*","page_theme = '' ORDER BY page_title");
$query = "SELECT p.*, c.* FROM #page AS p LEFT JOIN #page_chapters AS c ON p.page_chapter = c.chapter_id ORDER BY c.chapter_order,p.page_order";
while($row = $sql->db_Fetch())
// $sql->db_Select("page","*","page_theme = '' ORDER BY page_title");
$data = $sql->retrieve($query, true);
$sublinks = array();
foreach($data as $row)
{
$sublinks[] = array(
'link_id' => $row['page_id'],
'link_name' => $row['page_title'],
'link_url' => 'page.php?'.$row['page_id'],
'link_description' => '',
'link_button' => '',
'link_category' => '',
'link_order' => '',
'link_parent' => '',
'link_order' => $row['page_order'],
'link_parent' => 0,
'link_open' => '',
'link_class' => intval($row['page_class'])
);
}
return $sublinks;
$outArray = array();
$ret = e107::getNav()->compile($sublinks, $outArray);
// print_a($ret);
return $ret;
// compile();
}
}

View File

@ -106,12 +106,12 @@ function tablestyle($caption, $text, $mode)
{
//FIXME Use Bootstrap css. ie. span4 etc.
case 'menu' :
echo '
<div class="block">
<h4 class="caption">'.$caption.'</h4>
'.$text.'
</div>
';
echo '<div class="well sidebar-nav">
<ul class="nav nav-list"><li class="nav-header">'.$caption.'</li></ul>
'.$text.'
</div><!--/.well -->';
break;
case 'span4' :
@ -130,12 +130,11 @@ function tablestyle($caption, $text, $mode)
default:
echo '
<div class="block">
<h1 class="caption">'.$caption.'</h1>
<div class="block-text">
<h2>'.$caption.'</h2>
<p>
'.$text.'
</div>
</div>
</p>
';
break;
}
@ -171,6 +170,7 @@ $HEADER['default'] = '
{MENU=1}
</div><!--/span-->
<div class="span9">
{SETSTYLE=default}
';
$FOOTER['default'] = '