Skip to content

Commit

Permalink
Closes #5112 New method setMetaTitle()
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Nov 22, 2023
1 parent 1df7d8e commit afd72ff
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
19 changes: 17 additions & 2 deletions e107_handlers/admin_ui.php
Expand Up @@ -767,6 +767,19 @@ public function addMetaTitle($title)
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
*
Expand Down Expand Up @@ -1789,6 +1802,8 @@ class e_admin_controller
*/
protected $disallow = array();



/**
* Constructor
* @param e_admin_request $request
Expand Down Expand Up @@ -3560,7 +3575,7 @@ public function getConfig()
*/
public function setConfig($config)
{
$this->_prefs = $config;
$this->_prefs = $config; // XXX Discuss.
return $this;
}

Expand Down Expand Up @@ -7756,7 +7771,7 @@ public function renderFilter($current_query = array(), $location = '', $input_op
' .$this->select_close()."
<div class='e-autocomplete'></div>
".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()."
".$gridToggle."
Expand Down
24 changes: 17 additions & 7 deletions e107_tests/tests/unit/e_admin_controller_uiTest.php
Expand Up @@ -24,7 +24,7 @@ protected function _before()
}
catch(Exception $e)
{
$this->assertTrue(false, "Couldn't load e_admin_controller_ui object");
$this->fail("Couldn't load e_admin_controller_ui object");
}

}
Expand Down Expand Up @@ -220,12 +220,13 @@ public function testGetPrefs()
{
}
public function testGetConfig()
*/
/* public function testGetConfig()
{
$result = $this->ui->getConfig();
}
}*/
/*
public function testGetBatchExport()
{
Expand Down Expand Up @@ -380,13 +381,22 @@ public function testSetUserPref()
{
}
*/
/*
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);
}
*/



}

0 comments on commit afd72ff

Please sign in to comment.