Permalink
Browse files

Adds a method to set up key pages externally.

  • Loading branch information...
JB Lebrun
JB Lebrun committed Mar 21, 2018
1 parent 31c78e8 commit 5b28159eae571c99936d4a43bb4e225de1c504a3
@@ -962,12 +962,12 @@ final class Admin_ContentPage extends Module {
return '';
/* check with loaded pages */
if ( isset( $this->pages[$page] ) )
if (isset($this->pages[$page]))
return $this->pages[$page]->get_siteLink($params, $lg);
/* load page as single one */
$p = new ContentPage( CAMYKS_MODE_SITE, 0);
if ($p->get( $page ))
if ($p->get($page))
return $p->get_siteLink($params, $lg);
/* page found */
@@ -1260,6 +1260,17 @@ final class Admin_ContentPage extends Module {
public function get_keyPage($key) {
return $this->config->get_keyPage($key);
}
/*
* update key page in config
* @param string $key
* @param mixed $value
* @return void
* @access public
*/
public function set_keyPage($key, $value=null) {
return $this->config->set_keyPage($key, $value);
}
/*
* return navigation root from config
@@ -85,19 +85,37 @@ final class Admin_ContentPageConfig extends PluginConfig {
* @return mixed
* @access public
*/
function get_keyPage($key) {
public function get_keyPage($key) {
if (isset($this->vars['keyPages'][$key]))
return $this->vars['keyPages'][$key];
return false;
}
/*
* update key page in config
* @param string $key
* @param mixed $value
* @return void
* @access public
*/
public function set_keyPage($key, $value=null) {
if ($value == null) {
if (isset($this->vars['keyPages'][$key]))
return;
unset($this->vars['keyPages'][$key]);
} else {
$this->vars['keyPages'][$key] = $value;
}
$this->save();
}
/*
* return navigation root from config
* @param string $key
* @return mixed
* @access public
*/
function get_navigationRoot($key) {
public function get_navigationRoot($key) {
if ($key == 'main')
return $this->vars['navigation_main'];
elseif ($key == 'alt')
@@ -112,7 +130,7 @@ final class Admin_ContentPageConfig extends PluginConfig {
/*
* return w3c validation status list
* @return array
* @access private
* @access public
*/
public function get_w3cValidatorList() {
return array(
@@ -124,7 +142,7 @@ final class Admin_ContentPageConfig extends PluginConfig {
/*
* return w3c validation status title
* @return array
* @access private
* @access public
*/
public function get_w3cValidatorTitle() {
$l = $this->get_w3cValidatorList();
@@ -136,7 +154,7 @@ final class Admin_ContentPageConfig extends PluginConfig {
/*
* return ogmeta status list
* @return array
* @access private
* @access public
*/
public function get_ogMetaStatusList() {
return array(
@@ -148,7 +166,7 @@ final class Admin_ContentPageConfig extends PluginConfig {
/*
* return ogmeta status title
* @return array
* @access private
* @access public
*/
public function get_ogMetaStatusTitle() {
$l = $this->get_ogMetaStatusList();
@@ -160,7 +178,7 @@ final class Admin_ContentPageConfig extends PluginConfig {
/*
* return error 404 fallback values
* @return array
* @access private
* @access public
*/
public function get_404FallbackList() {
return array(
@@ -176,7 +194,7 @@ final class Admin_ContentPageConfig extends PluginConfig {
/*
* return ogmeta status title
* @return array
* @access private
* @access public
*/
public function get_404FallbackTitle() {
$l = $this->get_404FallbackList();

0 comments on commit 5b28159

Please sign in to comment.