mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Move 'custom page' frontpage to its own e_frontpage addon
This commit is contained in:
@@ -47,26 +47,16 @@ $frontPref = e107::pref('core'); // Get prefs
|
|||||||
'diz' =>'index.php'
|
'diz' =>'index.php'
|
||||||
);
|
);
|
||||||
|
|
||||||
if($sql->db_Select('page', 'page_id, page_title', "menu_name=''")) // TODO Move to e107_plugins/page
|
|
||||||
{
|
|
||||||
$front_page['custom']['title'] = FRTLAN_30;
|
|
||||||
while($row = $sql->db_Fetch())
|
|
||||||
{
|
|
||||||
$front_page['custom']['page'][] = array('page' => 'page.php?'.$row['page_id'], 'title' => $row['page_title']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now let any plugins add to the options - must append to the $front_page array as above
|
// Now let any plugins add to the options - must append to the $front_page array as above
|
||||||
|
|
||||||
|
//v2.x specification
|
||||||
//v2.x spec. ----------
|
|
||||||
$new = e107::getAddonConfig('e_frontpage');
|
$new = e107::getAddonConfig('e_frontpage');
|
||||||
foreach($new as $k=>$v)
|
foreach($new as $k=>$v)
|
||||||
{
|
{
|
||||||
$front_page[$k] = $v;
|
$front_page[$k] = $v;
|
||||||
}
|
}
|
||||||
|
|
||||||
// v1.x spec.---------------
|
// v1.x specification
|
||||||
if(!empty($frontPref['e_frontpage_list']))
|
if(!empty($frontPref['e_frontpage_list']))
|
||||||
{
|
{
|
||||||
foreach($frontPref['e_frontpage_list'] as $val)
|
foreach($frontPref['e_frontpage_list'] as $val)
|
||||||
|
47
e107_plugins/page/e_frontpage.php
Normal file
47
e107_plugins/page/e_frontpage.php
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* e107 website system
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008-2015 e107 Inc (e107.org)
|
||||||
|
* Released under the terms and conditions of the
|
||||||
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
if($sql->db_Select('page', 'page_id, page_title', "menu_name=''"))
|
||||||
|
{
|
||||||
|
$front_page['custom']['title'] = FRTLAN_30;
|
||||||
|
while($row = $sql->db_Fetch())
|
||||||
|
{
|
||||||
|
$front_page['custom']['page'][] = array('page' => 'page.php?'.$row['page_id'], 'title' => $row['page_title']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
//v2.x spec.
|
||||||
|
class page_frontpage // include plugin-folder in the name.
|
||||||
|
{
|
||||||
|
|
||||||
|
function config()
|
||||||
|
{
|
||||||
|
$sql = e107::getDb();
|
||||||
|
$config = array();
|
||||||
|
|
||||||
|
// Retrieve all custom pages
|
||||||
|
if($sql->select('page', 'page_id, page_title, page_sef', "menu_name IS NULL OR menu_name=''"))
|
||||||
|
{
|
||||||
|
$config['title'] = FRTLAN_30;
|
||||||
|
|
||||||
|
while($row = $sql->fetch())
|
||||||
|
{
|
||||||
|
$config['page'][] = array('page' => 'page.php?'.$row['page_id'], 'title' => $row['page_title']); // TODO SEF URL
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $config;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user