1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-26 01:11:28 +02:00

Closes #5112 New method setMetaTitle()

This commit is contained in:
camer0n
2023-11-22 12:18:23 -08:00
parent 1df7d8ed1d
commit afd72ff7cb
2 changed files with 34 additions and 9 deletions

View File

@@ -767,6 +767,19 @@ class e_admin_response
return $this; return $this;
} }
/**
* Set the Meta-title (overrides existing)
* @param string $title
* @return e_admin_response
*/
public function setMetaTitle($title)
{
$meta = '_e_PAGETITLE';
$this->{$meta} = array(strip_tags($title));
return $this;
}
/** /**
* Add meta description segment * Add meta description segment
* *
@@ -1789,6 +1802,8 @@ class e_admin_controller
*/ */
protected $disallow = array(); protected $disallow = array();
/** /**
* Constructor * Constructor
* @param e_admin_request $request * @param e_admin_request $request
@@ -3560,7 +3575,7 @@ class e_admin_controller_ui extends e_admin_controller
*/ */
public function setConfig($config) public function setConfig($config)
{ {
$this->_prefs = $config; $this->_prefs = $config; // XXX Discuss.
return $this; return $this;
} }
@@ -7756,7 +7771,7 @@ class e_admin_form_ui extends e_form
' .$this->select_close()." ' .$this->select_close()."
<div class='e-autocomplete'></div> <div class='e-autocomplete'></div>
".implode("\n", $filter_preserve_var). ' ".implode("\n", $filter_preserve_var). '
' .$this->admin_button('etrigger_filter', 'etrigger_filter', 'filter e-hide-if-js', ADMIN_FILTER_ICON, array('id' => false, 'title' =>LAN_FILTER, 'loading' => false)). ' ' .$this->admin_button('etrigger_filter', 'etrigger_filter', 'filter e-hide-if-js', defset('ADMIN_FILTER_ICON'), array('id' => false, 'title' =>LAN_FILTER, 'loading' => false)). '
' .$this->renderPagination()." ' .$this->renderPagination()."
".$gridToggle." ".$gridToggle."

View File

@@ -24,7 +24,7 @@
} }
catch(Exception $e) catch(Exception $e)
{ {
$this->assertTrue(false, "Couldn't load e_admin_controller_ui object"); $this->fail("Couldn't load e_admin_controller_ui object");
} }
} }
@@ -220,12 +220,13 @@
{ {
} }
*/
public function testGetConfig() /* public function testGetConfig()
{ {
$result = $this->ui->getConfig();
} }*/
/*
public function testGetBatchExport() public function testGetBatchExport()
{ {
@@ -380,13 +381,22 @@
{ {
} }
*/
/*
public function testSetConfig() public function testSetConfig()
{ {
$cfg = e107::getConfig();
$before = $cfg->get('sitename');
$this->ui->setConfig($cfg);
$pref = $this->ui->getConfig();
$after = $pref->get('sitename');
$this->assertSame($after, $before);
} }
*/ */
} }