1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Move 'custom page' frontpage to its own e_frontpage addon

This commit is contained in:
Tijn Kuyper 2019-10-24 10:44:24 +02:00
parent f010d1f32c
commit 60abccc1e2
No known key found for this signature in database
GPG Key ID: AAEA3CC2C5A308F2
2 changed files with 49 additions and 12 deletions

View File

@ -47,26 +47,16 @@ $frontPref = e107::pref('core'); // Get prefs
'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
//v2.x spec. ----------
//v2.x specification
$new = e107::getAddonConfig('e_frontpage');
foreach($new as $k=>$v)
{
$front_page[$k] = $v;
}
// v1.x spec.---------------
// v1.x specification
if(!empty($frontPref['e_frontpage_list']))
{
foreach($frontPref['e_frontpage_list'] as $val)

View 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;
}
}