mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
More bootstrap theme work and start of pageNavigation function for sitelinks.
This commit is contained in:
@@ -1442,10 +1442,10 @@ class e_navigation
|
|||||||
/**
|
/**
|
||||||
* Compile Array Structure
|
* 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; }
|
if(!is_array($inArray) || !is_array($outArray)){ return; }
|
||||||
|
|
||||||
foreach($inArray as $key => $val)
|
foreach($inArray as $key => $val)
|
||||||
{
|
{
|
||||||
if($val['link_parent'] == $pid)
|
if($val['link_parent'] == $pid)
|
||||||
|
@@ -14,12 +14,15 @@
|
|||||||
* $Author$
|
* $Author$
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
//require_once("../../class2.php");
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
/*if(!plugInstalled('gsitemap'))
|
/*if(!plugInstalled('gsitemap'))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}*/
|
}*/
|
||||||
|
//$pg = new page_sitelinks;
|
||||||
|
//$pg->myfunction();
|
||||||
|
|
||||||
|
|
||||||
class page_sitelinks // include plugin-folder in the name.
|
class page_sitelinks // include plugin-folder in the name.
|
||||||
@@ -30,7 +33,7 @@ class page_sitelinks // include plugin-folder in the name.
|
|||||||
|
|
||||||
$links[] = array(
|
$links[] = array(
|
||||||
'name' => "All Pages",
|
'name' => "All Pages",
|
||||||
'function' => "myfunction",
|
'function' => "pageNav",
|
||||||
'description' => ""
|
'description' => ""
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -39,30 +42,39 @@ class page_sitelinks // include plugin-folder in the name.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function myfunction()
|
function pageNav()
|
||||||
{
|
{
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$sublinks = array();
|
$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(
|
$sublinks[] = array(
|
||||||
|
'link_id' => $row['page_id'],
|
||||||
'link_name' => $row['page_title'],
|
'link_name' => $row['page_title'],
|
||||||
'link_url' => 'page.php?'.$row['page_id'],
|
'link_url' => 'page.php?'.$row['page_id'],
|
||||||
'link_description' => '',
|
'link_description' => '',
|
||||||
'link_button' => '',
|
'link_button' => '',
|
||||||
'link_category' => '',
|
'link_category' => '',
|
||||||
'link_order' => '',
|
'link_order' => $row['page_order'],
|
||||||
'link_parent' => '',
|
'link_parent' => 0,
|
||||||
'link_open' => '',
|
'link_open' => '',
|
||||||
'link_class' => intval($row['page_class'])
|
'link_class' => intval($row['page_class'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $sublinks;
|
|
||||||
|
$outArray = array();
|
||||||
|
$ret = e107::getNav()->compile($sublinks, $outArray);
|
||||||
|
// print_a($ret);
|
||||||
|
return $ret;
|
||||||
|
// compile();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -106,12 +106,12 @@ function tablestyle($caption, $text, $mode)
|
|||||||
{
|
{
|
||||||
//FIXME Use Bootstrap css. ie. span4 etc.
|
//FIXME Use Bootstrap css. ie. span4 etc.
|
||||||
case 'menu' :
|
case 'menu' :
|
||||||
echo '
|
echo '<div class="well sidebar-nav">
|
||||||
<div class="block">
|
<ul class="nav nav-list"><li class="nav-header">'.$caption.'</li></ul>
|
||||||
<h4 class="caption">'.$caption.'</h4>
|
|
||||||
'.$text.'
|
'.$text.'
|
||||||
</div>
|
|
||||||
';
|
</div><!--/.well -->';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'span4' :
|
case 'span4' :
|
||||||
@@ -130,12 +130,11 @@ function tablestyle($caption, $text, $mode)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
echo '
|
echo '
|
||||||
<div class="block">
|
<h2>'.$caption.'</h2>
|
||||||
<h1 class="caption">'.$caption.'</h1>
|
<p>
|
||||||
<div class="block-text">
|
|
||||||
'.$text.'
|
'.$text.'
|
||||||
</div>
|
</p>
|
||||||
</div>
|
|
||||||
';
|
';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -171,6 +170,7 @@ $HEADER['default'] = '
|
|||||||
{MENU=1}
|
{MENU=1}
|
||||||
</div><!--/span-->
|
</div><!--/span-->
|
||||||
<div class="span9">
|
<div class="span9">
|
||||||
|
{SETSTYLE=default}
|
||||||
';
|
';
|
||||||
|
|
||||||
$FOOTER['default'] = '
|
$FOOTER['default'] = '
|
||||||
|
Reference in New Issue
Block a user