1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 04:10:38 +02:00

Fix: Admin Area > Meta Tags > Keywords to be considered as global keywords to append to all pages of the site as originally intended. Leave blank to disable.

This commit is contained in:
Cameron
2019-07-05 13:35:36 -07:00
parent 845b489f70
commit 20e15a4ac0
2 changed files with 23 additions and 9 deletions

View File

@@ -3979,7 +3979,7 @@ class eResponse
'jsonNoTitle' => false, 'jsonNoTitle' => false,
'jsonRender' => false, 'jsonRender' => false,
); );
public function setParam($key, $value) public function setParam($key, $value)
{ {
$this->_params[$key] = $value; $this->_params[$key] = $value;
@@ -4048,8 +4048,8 @@ class eResponse
/** /**
* Append content * Append content
* @param str $body * @param string $body
* @param str $ns namespace * @param string $ns namespace
* @return eResponse * @return eResponse
*/ */
public function appendBody($body, $ns = 'default') public function appendBody($body, $ns = 'default')
@@ -4065,8 +4065,8 @@ class eResponse
/** /**
* Set content * Set content
* @param str $body * @param string $body
* @param str $ns namespace * @param string $ns namespace
* @return eResponse * @return eResponse
*/ */
public function setBody($body, $ns = 'default') public function setBody($body, $ns = 'default')
@@ -4128,8 +4128,8 @@ class eResponse
/** /**
* Prepend content * Prepend content
* @param str $body * @param string $body
* @param str $ns namespace * @param string $ns namespace
* @return eResponse * @return eResponse
*/ */
function prependBody($body, $ns = 'default') function prependBody($body, $ns = 'default')
@@ -4138,7 +4138,7 @@ class eResponse
{ {
$this->_body[$ns] = ''; $this->_body[$ns] = '';
} }
$this->_body[$ns] = $content.$this->_body[$ns]; // $this->_body[$ns] = $content.$this->_body[$ns];
return $this; return $this;
} }
@@ -4337,6 +4337,19 @@ class eResponse
e107::getEvent()->trigger('system_meta_pre', $this->_meta); e107::getEvent()->trigger('system_meta_pre', $this->_meta);
$pref = e107::getPref();
if(!empty($pref['meta_keywords'][e_LANGUAGE])) // Always append (global) meta keywords to the end.
{
$tmp1 = (array) explode(",", $this->getMetaKeywords());
$tmp2 = (array) explode(",", $pref['meta_keywords'][e_LANGUAGE]);
$tmp3 = array_unique(array_merge($tmp1,$tmp2));
$this->setMeta('keywords', implode(',',$tmp3));
}
foreach ($this->_meta as $attr) foreach ($this->_meta as $attr)
{ {
$attrData .= '<meta'; $attrData .= '<meta';
@@ -4562,7 +4575,7 @@ class eResponse
$override = array_merge(array( $override = array_merge(array(
'header' => $title, 'header' => $title,
'body' => $content, 'body' => $content,
'footer' => $statusText, // 'footer' => $statusText, // FIXME $statusText has no value.
), $override); ), $override);
echo $jshelper->buildJsonResponse($override); echo $jshelper->buildJsonResponse($override);
$jshelper->sendJsonResponse(null); $jshelper->sendJsonResponse(null);

View File

@@ -2365,6 +2365,7 @@ class e107
*/ */
public static function meta($name = null, $content = null, $extended = array()) public static function meta($name = null, $content = null, $extended = array())
{ {
/** @var eResponse $response */
$response = self::getSingleton('eResponse'); $response = self::getSingleton('eResponse');
if($name === 'description') if($name === 'description')