1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-19 20:21:51 +02:00

Renamed "Site Links" admin area to "Navigation". Navigation shortcode names changed (see debug: 'deprecated' mode to check usage)

This commit is contained in:
Cameron 2020-12-27 14:28:19 -08:00
parent 71c5be17ea
commit e66d3f32de
9 changed files with 195 additions and 99 deletions

View File

@ -46,14 +46,14 @@ class links_admin extends e_admin_dispatcher
'main/edit' => 'main/list'
);
protected $menuTitle = ADLAN_138;
protected $menuTitle = LAN_NAVIGATION;
protected $adminMenuIcon = 'e-links-24';
}
class links_admin_ui extends e_admin_ui
{
protected $pluginTitle = ADLAN_138;
protected $pluginTitle = LAN_NAVIGATION;
protected $pluginName = 'core';
protected $table = "links";
protected $listQry = '';

View File

@ -1,14 +1,15 @@
<?php
require_once(__DIR__.'/navigation_shortcodes_legacy.php');
/**
* Navigation Shortcodes
*
* @todo SEF
*/
class navigation_shortcodes extends e_shortcode
{
use navigation_shortcodes_legacy;
public $template;
public $counter;
public $active;
@ -18,7 +19,6 @@
function sc_nav_class($parm = null)
{
return $this->navClass;
}
@ -28,7 +28,7 @@
* @return string 'active' on the active link.
* @example {LINK_ACTIVE}
*/
function sc_link_active($parm = '')
function sc_nav_active($parm = null)
{
if($this->active == true)
@ -46,13 +46,13 @@
*
* @return integer
*/
function sc_link_id($parm = null)
function sc_nav_id($parm = null)
{
return (int) $this->var['link_id'];
}
function sc_link_depth($parm = null)
function sc_nav_depth($parm = null)
{
unset($parm);
@ -74,7 +74,7 @@
* @return string
* @example {LINK_NAME}
*/
function sc_link_name($parm = null)
function sc_nav_name($parm = null)
{
if(empty($this->var['link_name']))
@ -101,14 +101,14 @@
*
* @return integer
*/
function sc_link_parent($parm = null)
function sc_nav_parent($parm = null)
{
return (int) $this->var['link_parent'];
}
function sc_link_identifier($parm = null)
function sc_nav_identifier($parm = null)
{
return isset($this->var['link_identifier']) ? $this->var['link_identifier'] : '';
@ -119,7 +119,7 @@
*
* @return string
*/
function sc_link_url($parm = null)
function sc_nav_url($parm = null)
{
$tp = e107::getParser();
@ -153,7 +153,7 @@
}
/*
function sc_link_sub_oversized($parm='')
function sc_nav_sub_oversized($parm='')
{
$count = count($this->var['link_sub']);
@ -173,7 +173,7 @@
* @param array $parm
* @return null|string
*/
function sc_link_target($parm = null)
function sc_nav_target($parm = null)
{
if(strpos($this->var['link_url'], '#') !== false)
@ -188,13 +188,13 @@
}
function sc_link_open($parm = '')
function sc_nav_open($parm = null)
{
$type = $this->var['link_open'] ? (int) $this->var['link_open'] : 0;
### 0 - same window, 1 - target blank, 4 - 600x400 popup, 5 - 800x600 popup
### TODO - JS popups (i.e. bootstrap)
### TODO - JS modal (i.e. bootstrap)
switch($type)
{
case 1:
@ -213,24 +213,13 @@
return '';
}
/**
* @deprecated - Use {LINK_ICON} instead.
*/
function sc_link_image($parm = '')
{
trigger_error('<b>{LINK_IMAGE} is deprecated. Use {LINK_ICON} instead</b>', E_USER_DEPRECATED); // NO LAN
return $this->sc_link_icon($parm);
}
/**
* Return the link icon of the current link
*
* @example {NAV_ICON}
* @return string
*/
function sc_link_icon($parm = '')
function sc_nav_icon($parm = null)
{
$tp = e107::getParser();
@ -256,10 +245,10 @@
/**
* Return the link description of the current link
*
* @example {NAV_DESCRIPTION}
* @return string
*/
function sc_link_description($parm = '')
function sc_nav_description($parm = null)
{
$toolTipEnabled = e107::pref('core', 'linkpage_screentip', false);
@ -279,7 +268,7 @@
*
* @return string
*/
function sc_link_sub($parm = '')
function sc_nav_sub($parm = null)
{
if(empty($this->var['link_sub']))
@ -302,6 +291,7 @@
$endTemplate = !empty($this->var['link_sub'][0]['link_sub']) && isset($this->template['submenu_lowerstart']) ? $this->template['submenu_lowerend'] : $this->template['submenu_end'];
$text = e107::getParser()->parseTemplate(str_replace('{LINK_SUB}', '', $startTemplate), true, $this);
$text = e107::getParser()->parseTemplate(str_replace('{NAV_SUB}', '', $startTemplate), true, $this);
foreach($this->var['link_sub'] as $val)
{
@ -317,7 +307,7 @@
}
$text .= e107::getParser()->parseTemplate(str_replace('{LINK_SUB}', '', $endTemplate), true, $this);
$text .= e107::getParser()->parseTemplate(str_replace('{NAV_SUB}', '', $endTemplate), true, $this);
return $text;
}
@ -328,7 +318,7 @@
* @return string - a generated anchor for the current link.
* @example {LINK_ANCHOR}
*/
function sc_link_anchor($parm = '')
function sc_nav_anchor($parm = null)
{
return $this->var['link_name'] ? '#' . e107::getForm()->name2id($this->var['link_name']) : '';

View File

@ -0,0 +1,168 @@
<?php
trait navigation_shortcodes_legacy
{
/**
* @deprecated
* @return string 'active' on the active link.
* @example {LINK_ACTIVE}
*/
function sc_link_active($parm = null)
{
trigger_error('<b>{LINK_ACTIVE} is deprecated</b> Use {NAV_ACTIVE} instead', E_USER_DEPRECATED); // NO LAN
return $this->sc_nav_active($parm);
}
/**
* Return the primary_id number for the current link
* @deprecated
* @return integer
*/
function sc_link_id($parm = null)
{
trigger_error('<b>{LINK_ID} is deprecated</b> Use {NAV_ID} instead', E_USER_DEPRECATED); // NO LAN
return $this->sc_nav_id($parm);
}
/**
* @deprecated
* @param null $parm
* @return int
*/
function sc_link_depth($parm = null)
{
trigger_error('<b>{LINK_DEPTH} is deprecated</b> Use {NAV_DEPTH} instead', E_USER_DEPRECATED); // NO LAN
return $this->sc_nav_depth($parm);
}
/**
* Return the name of the current link
* @deprecated
* @return string
* @example {LINK_NAME}
*/
function sc_link_name($parm = null)
{
trigger_error('<b>{LINK_NAME} is deprecated</b> Use {NAV_NAME} instead', E_USER_DEPRECATED); // NO LAN
return $this->sc_nav_name($parm);
}
/**
* Return the parent of the current link
* @deprecated
* @return integer
*/
function sc_link_parent($parm = null)
{
trigger_error('<b>{LINK_PARENT} is deprecated</b> Use {NAV_PARENT} instead', E_USER_DEPRECATED); // NO LAN
return $this->sc_nav_parent($parm);
}
/**
* @deprecated
* @param null $parm
* @return mixed|string
*/
function sc_link_identifier($parm = null)
{
trigger_error('<b>{LINK_IDENTIFIER} is deprecated</b> Use {NAV_IDENTIFIER} instead', E_USER_DEPRECATED); // NO LAN
return $this->sc_nav_identifier($parm);
}
/**
* Return the URL of the current link
* @deprecated
* @return string
*/
function sc_link_url($parm = null)
{
trigger_error('<b>{LINK_URL} is deprecated</b> Use {NAV_URL} instead', E_USER_DEPRECATED); // NO LAN
return $this->sc_nav_url($parm);
}
/**
* Returns only the anchor target in the URL if one is found.
* @deprecated
* @param array $parm
* @return null|string
*/
function sc_link_target($parm = null)
{
trigger_error('<b>{LINK_TARGET} is deprecated</b> Use {NAV_TARGET} instead', E_USER_DEPRECATED); // NO LAN
return $this->sc_nav_target($parm);
}
/**
* @deprecated
* @param null $parm
* @return string
*/
function sc_link_open($parm = null)
{
return $this->sc_nav_open($parm);
}
/**
* @deprecated - Use {LINK_ICON} instead.
*/
function sc_link_image($parm = null)
{
trigger_error('<b>{LINK_IMAGE} is deprecated</b> Use {NAV_ICON} instead', E_USER_DEPRECATED); // NO LAN
return $this->sc_nav_icon($parm);
}
/**
* Return the link icon of the current link
* @deprecated
* @return string
*/
function sc_link_icon($parm = null)
{
trigger_error('<b>{LINK_ICON} is deprecated</b> Use {NAV_ICON} instead', E_USER_DEPRECATED); // NO LAN
return $this->sc_nav_icon($parm);
}
/**
* Return the link description of the current link
* @deprecated
* @return string
*/
function sc_link_description($parm = null)
{
trigger_error('<b>{LINK_DESCRIPTION} is deprecated</b> Use {NAV_DESCRIPTION} instead', E_USER_DEPRECATED); // NO LAN
return $this->sc_nav_description($parm);
}
/**
* Return the parsed sublinks of the current link
* @deprecated
* @return string
*/
function sc_link_sub($parm = null)
{
return $this->sc_nav_sub($parm);
}
/**
* Return a generated anchor for the current link.
* @deprecated
* @param unused
* @return string - a generated anchor for the current link.
* @example {LINK_ANCHOR}
*/
function sc_link_anchor($parm = null)
{
return $this->sc_nav_anchor($parm);
}
}

View File

@ -66,4 +66,3 @@ class news_archive_shortcodes extends e_shortcode
}
?>

View File

@ -1,59 +0,0 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2009 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*
*
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/news_archives.php,v $
* $Revision$
* $Date$
* $Author$
*/
if (!defined('e107_INIT')) { exit; }
include_once(e_HANDLER.'shortcode_handler.php');
$news_archive_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
/*
SC_BEGIN ARCHIVE_BULLET
//TODO review bullet
$bullet = '';
if(defined('BULLET'))
{
$bullet = '<img src="'.THEME.'images/'.BULLET.'" alt="" class="icon" />';
}
elseif(file_exists(THEME.'images/bullet2.gif'))
{
$bullet = '<img src="'.THEME.'images/bullet2.gif" alt="" class="icon" />';
}
return $bullet;
SC_END
SC_BEGIN ARCHIVE_LINK
global $news2;
return "<a href='news.php?item.".$news2['news_id']."'>".$news2['news_title']."</a>";
SC_END
SC_BEGIN ARCHIVE_AUTHOR
global $news2;
return "<a href='".e_BASE."user.php?id.".$news2['user_id']."'>".$news2['user_name']."</a>";
SC_END
SC_BEGIN ARCHIVE_DATESTAMP
global $news2;
return $news2['news_datestamp'];
SC_END
SC_BEGIN ARCHIVE_CATEGORY
global $news2;
return $news2['category_name'];
SC_END
*/
?>

View File

@ -878,7 +878,7 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
// 9 => array(e_ADMIN.'filemanager.php', ADLAN_30, ADLAN_31, '6', 5, E_16_FILE, E_32_FILE), // replaced by media-manager
10 => array(e_ADMIN_ABS.'frontpage.php', ADLAN_60, ADLAN_61, 'G', 1, E_16_FRONT, E_32_FRONT),
11 => array(e_ADMIN_ABS.'image.php', LAN_MEDIAMANAGER, LAN_MEDIAMANAGER, 'A', 5, E_16_IMAGES, E_32_IMAGES),
12 => array(e_ADMIN_ABS.'links.php', ADLAN_138, ADLAN_139, 'I', 1, E_16_LINKS, E_32_LINKS),
12 => array(e_ADMIN_ABS.'links.php', LAN_NAVIGATION, ADLAN_139, 'I', 1, E_16_LINKS, E_32_LINKS),
13 => array(e_ADMIN_ABS.'wmessage.php', ADLAN_28, ADLAN_29, 'M', 3, E_16_WELCOME, E_32_WELCOME),
14 => array(e_ADMIN_ABS.'ugflag.php', ADLAN_40, ADLAN_41, '9', 4, E_16_MAINTAIN, E_32_MAINTAIN),
15 => array(e_ADMIN_ABS.'menus.php', ADLAN_6, ADLAN_7, '2', 5, E_16_MENUS, E_32_MENUS),

View File

@ -1822,7 +1822,7 @@ class e_userperms
"1" => array(LAN_PREFS,E_16_PREFS, E_32_PREFS), // Alter Site Preferences
"X" => array(LAN_SEARCH,E_16_SEARCH, E_32_SEARCH), // Search
"I" => array(ADLAN_138,E_16_LINKS, E_32_LINKS), // Post SiteLinks
"I" => array(LAN_NAVIGATION,E_16_LINKS, E_32_LINKS), // Post SiteLinks
"8" => array(ADMSLAN_27,E_16_LINKS, E_32_LINKS), // Oversee SiteLink Categories
"K" => array(ADLAN_159,E_16_EURL, E_32_EURL), // Configure URLs

View File

@ -577,4 +577,4 @@ define("LAN_ROBOTS_NOFOLLOW", "Prevent search engines from following links in th
define("LAN_ROBOTS_NOARCHIVE", "Prevent cached copies of this item from appearing in search results.");
define("LAN_ROBOTS_NOIMAGE", "Prevent search engines from indexing images of this item.");
define("LAN_NAVIGATION", "Navigation");

View File

@ -501,8 +501,6 @@ class news_front
// $i = $this->interval;
// require_once(e_CORE.'shortcodes/batch/news_archives.php');
$sc = e107::getScBatch('news_archive');
if(!$NEWSARCHIVE)