1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-24 08:22:07 +02:00

Added new field to navigation links table: link_rel

This commit is contained in:
Cameron
2021-09-27 10:22:14 -07:00
parent 5fd8fdc92b
commit 66d8081580
6 changed files with 24 additions and 4 deletions

View File

@@ -599,7 +599,7 @@ class page_admin_ui extends e_admin_ui
'page_comment_flag' => array('title'=> LAN_COMMENTS, 'tab' => 1, 'type' => 'boolean', 'data'=>'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center' ),
'page_password' => array('title'=> LAN_PASSWORD, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'writeParms'=>array('password'=>1, 'nomask'=>1, 'size' => 40, 'class' => 'tbox e-password', 'generate' => 1, 'strength' => 1, 'required'=>0)),
'page_sef' => array('title'=> LAN_SEFURL, 'tab' => 1, 'type' => 'text', 'batch'=>true, 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'writeParms'=>'size=xxlarge&sef=page_title'),
'page_metakeys' => array('title'=> LAN_KEYWORDS, 'tab' => 1, 'type' => 'tags', 'data'=>'str', 'width' => 'auto'),
'page_metakeys' => array('title'=> LAN_KEYWORDS, 'tab' => 1, 'type' => 'tags', 'data'=>'str', 'width' => 'auto', 'inline'=>true),
'page_metadscr' => array('title'=> CUSLAN_11, 'tab' => 1, 'type' => 'textarea', 'data'=>'str', 'help'=>CUSLAN_82, 'width' => 'auto', 'writeParms'=>array('size'=>'xxlarge', 'rows'=>2, 'maxlength'=>155)),
'page_metaimage' => array('title'=> CUSLAN_81, 'nolist'=>false, 'tab' => 1, 'type' => 'image', 'help'=> CUSLAN_82, 'width' => '110px', 'thclass' => 'center', 'class' => "center", 'nosort' => false, 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','writeParms'=>'media=page^&video=1', 'readonly'=>false),

View File

@@ -83,6 +83,8 @@ class links_admin_ui extends e_admin_ui
'link_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto'), // 'method'=>'tinymce_plugins', ?
'link_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'width' => 'auto', 'nolist'=>false, 'inline' => true),
'link_open' => array('title'=> LCLAN_19, 'type' => 'dropdown', 'inline'=>true, 'width' => 'auto', 'batch'=>true, 'filter'=>true, 'thclass' => 'left first', 'writeParms'=>array('size'=>'xlarge')),
'link_rel' => array('title'=> LINKLAN_11, 'type' => 'tags', 'inline'=>true, 'width' => 'auto', 'batch'=>false, 'filter'=>false, 'thclass' => 'left', 'help'=>LINKLAN_12, 'writeParms'=>array('placeholder'=>'eg.nofollow,noreferrer','size'=>'xlarge')),
'link_function' => array('title'=> LCLAN_105, 'type' => 'method', 'data'=>'str', 'width' => 'auto', 'thclass' => 'left first'),
'link_owner' => array('title'=> LCLAN_106, 'type' => 'hidden', 'filter'=>true, 'data'=>'str'),
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class'=>'center','readParms'=>'sort=1') // quick workaround

View File

@@ -151,7 +151,7 @@ require_once(__DIR__.'/navigation_shortcodes_legacy.php');
if(strpos($url, "{") !== false)
{
$url = $tp->parseTemplate($url, true); // BC Fix shortcode in URL support - dynamic urls for multilanguage.
$url = $tp->parseTemplate($url); // BC Fix shortcode in URL support - dynamic urls for multilanguage.
}
return $url;
@@ -193,6 +193,7 @@ require_once(__DIR__.'/navigation_shortcodes_legacy.php');
}
/**
* Optional link attributes. onclick, rel etc.
* @param null $parm
* @example {NAV_LINK_OPEN}
* @return string
@@ -206,12 +207,13 @@ require_once(__DIR__.'/navigation_shortcodes_legacy.php');
### TODO - JS modal (i.e. bootstrap)
$text = '';
$rel = '';
switch($type)
{
case 1:
$text = ' target="_blank"';
$text .= (strpos($this->var['link_url'], 'http') !== false) ? ' rel="noopener noreferrer"' : '';
$rel = (strpos($this->var['link_url'], 'http') !== false) ? 'noopener noreferrer' : '';
break;
case 4:
@@ -223,10 +225,22 @@ require_once(__DIR__.'/navigation_shortcodes_legacy.php');
break;
}
if(!empty($this->var['link_rel']))
{
$rel = str_replace(',', ' ', $this->var['link_rel']);
}
if(!empty($rel))
{
$text .= " rel='".$rel."'";
}
return $text;
}
/**
* Return the link icon of the current link
* @example {NAV_LINK_ICON}

View File

@@ -221,6 +221,7 @@ CREATE TABLE links (
link_order int(10) unsigned NOT NULL default '0',
link_parent int(10) unsigned NOT NULL default '0',
link_open tinyint(1) unsigned NOT NULL default '0',
link_rel varchar(200) NOT NULL default '',
link_class varchar(255) NOT NULL default '0',
link_function varchar(100) NOT NULL default '',
link_sefurl varchar(255) NOT NULL,

View File

@@ -86,6 +86,9 @@ define("LINKLAN_8", "News Categories");
define("LINKLAN_9", "Download Categories");
define("LINKLAN_10", "Theme Shortcodes");
define("LINKLAN_11", "Relationship");
define("LINKLAN_12", "Optional 'rel' attribute. Comma separated.");
// define("LINKLAN_10", "Create Sublink");
// define('LINKLAN_11', 'Nothing changed - not updated');

View File

@@ -1533,7 +1533,7 @@ li.rssRow > div {
color: #ffffff;
}*/
.selectize-input { width: 530px; max-width: 90%; }
.selectize-input { width: 530px; max-width: 100%; }
/*