forked from ZwiiCMS-Team/ZwiiCMS
fonction update
This commit is contained in:
parent
541ab1728b
commit
1ed2e8ec35
@ -61,32 +61,33 @@ class news extends common {
|
|||||||
];
|
];
|
||||||
public static $nbrCol = 1;
|
public static $nbrCol = 1;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mise à jour du module
|
* Mise à jour du module
|
||||||
|
* Appelée par les fonctions index et config
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function update() {
|
public function update() {
|
||||||
// Mettre à jour la version des donnnée si inexistante
|
// Insitialisation de la version
|
||||||
if ($this->getData(['module', $this->getUrl(0), 'versionData']) === NULL) {
|
if ($this->getData(['module', $this->getUrl(0), 'config', 'version']) === NULL) {
|
||||||
$this->setData(['module', $this->getUrl(0), 'versionData','0.0']);
|
$this->setData(['module', $this->getUrl(0), 'config', 'version','0.0']);
|
||||||
}
|
}
|
||||||
// Version 2.4
|
// Version 2.4
|
||||||
if ($this->getData(['module', $this->getUrl(0), 'versionData']) < self::VERSION) {
|
if (version_compare($this->getData(['module', $this->getUrl(0), 'versionData']), self::VERSION, '<') ) {
|
||||||
$this->setData(['module', $this->getUrl(0),'config', [
|
$this->setData(['module', $this->getUrl(0),'config', [
|
||||||
'itemsperPage' => 16,
|
'itemsperPage' => 16,
|
||||||
'itemsperCol'=> 6,
|
'itemsperCol'=> 6,
|
||||||
'feeds' => $this->setData(['module', $this->getUrl(0),'config','feeds']),
|
'feeds' => $this->getData(['module', $this->getUrl(0), 'config','feeds']),
|
||||||
'feedsLabel' => $this->setData(['module', $this->getUrl(0),'config','feedsLabel']),
|
'feedsLabel' => $this->getData(['module', $this->getUrl(0), 'config','feedsLabel']),
|
||||||
'version' => '2.4'
|
'version' => '2.4'
|
||||||
]]);
|
]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flux RSS
|
* Flux RSS
|
||||||
*/
|
*/
|
||||||
public function rss() {
|
public function rss() {
|
||||||
|
|
||||||
// Inclure les classes
|
// Inclure les classes
|
||||||
include_once 'module/news/vendor/FeedWriter/Item.php';
|
include_once 'module/news/vendor/FeedWriter/Item.php';
|
||||||
include_once 'module/news/vendor/FeedWriter/Feed.php';
|
include_once 'module/news/vendor/FeedWriter/Feed.php';
|
||||||
@ -134,7 +135,7 @@ class news extends common {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Édition
|
* Ajout d'un article
|
||||||
*/
|
*/
|
||||||
public function add() {
|
public function add() {
|
||||||
// Soumission du formulaire
|
// Soumission du formulaire
|
||||||
@ -177,6 +178,8 @@ class news extends common {
|
|||||||
* Configuration
|
* Configuration
|
||||||
*/
|
*/
|
||||||
public function config() {
|
public function config() {
|
||||||
|
// Mise à jour des données de module
|
||||||
|
$this->update();
|
||||||
// Soumission du formulaire
|
// Soumission du formulaire
|
||||||
if($this->isPost()) {
|
if($this->isPost()) {
|
||||||
$this->setData(['module', $this->getUrl(0), 'config',[
|
$this->setData(['module', $this->getUrl(0), 'config',[
|
||||||
|
Loading…
Reference in New Issue
Block a user