mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 06:38:00 +02:00
Navigation Menu added.
This commit is contained in:
76
e107_plugins/navigation/e_menu.php
Normal file
76
e107_plugins/navigation/e_menu.php
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
<?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 (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
//v2.x Standard for extending menu configuration within Menu Manager. (replacement for v1.x config.php)
|
||||||
|
|
||||||
|
class navigation_menu
|
||||||
|
{
|
||||||
|
//function __construct()
|
||||||
|
//{
|
||||||
|
// e107::lan('_blank','menu',true); // English_menu.php or {LANGUAGE}_menu.php
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration Fields.
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function config($menu='')
|
||||||
|
{
|
||||||
|
if($menu !== 'navigation')
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$layouts = e107::getLayouts(null, 'navigation', 'front', null, false, false);
|
||||||
|
|
||||||
|
$types = array(
|
||||||
|
'main' => 'main',
|
||||||
|
'side' => 'side',
|
||||||
|
'footer' => 'footer',
|
||||||
|
'alt' => 'alt',
|
||||||
|
'alt5' => 'alt5',
|
||||||
|
'alt6' => 'alt6',
|
||||||
|
);
|
||||||
|
|
||||||
|
$fields = array();
|
||||||
|
$fields['caption'] = array('title' => 'Caption', 'type' =>'text', 'multilan' =>true, 'writeParms' =>array('size' =>'xxlarge'));
|
||||||
|
$fields['type'] = array('title' => 'Navigation Type', 'type' =>'dropdown', 'writeParms' =>array('optArray' =>$types));
|
||||||
|
$fields['layout'] = array('title' => 'Navigation Layout', 'type' =>'dropdown', 'writeParms' =>array('optArray' =>$layouts));
|
||||||
|
// $fields['size'] = array('title'=> "Size", 'type'=>'dropdown', 'tab'=>0, 'writeParms'=>array('optArray'=>$sizes));
|
||||||
|
|
||||||
|
|
||||||
|
return $fields;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// optional - for when using custom methods above.
|
||||||
|
|
||||||
|
class navigation_menu_form extends e_form
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
function blankCustom($curVal)
|
||||||
|
{
|
||||||
|
|
||||||
|
$frm = e107::getForm();
|
||||||
|
$opts = array(1,2,3,4);
|
||||||
|
$frm->select('blankCustom', $opts, $curVal);
|
||||||
|
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
define("LAN_PLUGIN_NAVIGATION_NAME", "Navigation");
|
14
e107_plugins/navigation/navigation_menu.php
Normal file
14
e107_plugins/navigation/navigation_menu.php
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
$parm['type'] = !empty($parm['type']) ? $parm['type'] : 'main';
|
||||||
|
$parm['layout'] = !empty($parm['layout']) ? $parm['layout'] : $parm['type'];
|
||||||
|
|
||||||
|
require_once(e_CORE."shortcodes/single/navigation.php");
|
||||||
|
|
||||||
|
$text = navigation_shortcode($parm);
|
||||||
|
|
||||||
|
$caption = isset($parm['caption'][e_LANGUAGE]) ? $parm['caption'][e_LANGUAGE] : LAN_PLUGIN_NAVIGATION_NAME;
|
||||||
|
|
||||||
|
e107::getRender()->tablerender($caption, $text);
|
||||||
|
|
4
e107_plugins/navigation/plugin.xml
Normal file
4
e107_plugins/navigation/plugin.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<e107Plugin name="Navigation" version="1.0" date="2020-12-29" compatibility="2.0" installRequired="false" >
|
||||||
|
<category>menu</category>
|
||||||
|
</e107Plugin>
|
Reference in New Issue
Block a user