Updated system, changed setting for new file

This commit is contained in:
markseu 2018-03-06 09:39:33 +01:00
parent ab7626afd2
commit d083218261
4 changed files with 10 additions and 9 deletions

View file

@ -40,6 +40,7 @@ UploadExtension: .upload
TextFile: text.ini
LanguageFile: language-(.*).txt
ErrorFile: page-error-(.*).txt
NewFile: page-new-(.*).txt
RobotsFile: robots.txt
FaviconFile: favicon.ico
ServerUrl:
@ -54,7 +55,6 @@ MultiLanguageMode: 0
InstallationMode: 1
StartupUpdate: none
EditLocation: /edit/
EditNewFile: page-new-(.*).txt
EditUserFile: user.ini
EditUserPasswordMinLength: 4
EditUserHashAlgorithm: bcrypt

View file

@ -1,6 +1,6 @@
<?php
// Core plugin, https://github.com/datenstrom/yellow-plugins/tree/master/core
// Copyright (c) 2013-2017 Datenstrom, https://datenstrom.se
// Copyright (c) 2013-2018 Datenstrom, https://datenstrom.se
// This file may be used and distributed under the terms of the public license.
class YellowCore
@ -67,6 +67,7 @@ class YellowCore
$this->config->setDefault("textFile", "text.ini");
$this->config->setDefault("languageFile", "language-(.*).txt");
$this->config->setDefault("errorFile", "page-error-(.*).txt");
$this->config->setDefault("newFile", "page-new-(.*).txt");
$this->config->setDefault("robotsFile", "robots.txt");
$this->config->setDefault("faviconFile", "favicon.ico");
$this->config->setDefault("serverUrl", "");

View file

@ -5,7 +5,7 @@
class YellowEdit
{
const VERSION = "0.7.7";
const VERSION = "0.7.8";
var $yellow; //access to API
var $response; //web response
var $users; //user accounts
@ -19,7 +19,6 @@ class YellowEdit
$this->users = new YellowUsers($yellow);
$this->merge = new YellowMerge($yellow);
$this->yellow->config->setDefault("editLocation", "/edit/");
$this->yellow->config->setDefault("editNewFile", "page-new-(.*).txt");
$this->yellow->config->setDefault("editUserFile", "user.ini");
$this->yellow->config->setDefault("editUserPasswordMinLength", "4");
$this->yellow->config->setDefault("editUserHashAlgorithm", "bcrypt");
@ -999,14 +998,14 @@ class YellowResponse
if($page->isExisting("templateNew"))
{
$name = $this->yellow->lookup->normaliseName($page->get("templateNew"));
$fileName = strreplaceu("(.*)", $name, $this->yellow->config->get("configDir").$this->yellow->config->get("editNewFile"));
$fileName = strreplaceu("(.*)", $name, $this->yellow->config->get("configDir").$this->yellow->config->get("newFile"));
if(is_file($fileName)) break;
}
}
if(!is_file($fileName))
{
$name = $this->yellow->lookup->normaliseName($this->yellow->config->get("template"));
$fileName = strreplaceu("(.*)", $name, $this->yellow->config->get("configDir").$this->yellow->config->get("editNewFile"));
$fileName = strreplaceu("(.*)", $name, $this->yellow->config->get("configDir").$this->yellow->config->get("newFile"));
}
$rawData = $this->yellow->toolbox->readFile($fileName);
$rawData = preg_replace("/@timestamp/i", time(), $rawData);

View file

@ -1,11 +1,11 @@
<?php
// Update plugin, https://github.com/datenstrom/yellow-plugins/tree/master/update
// Copyright (c) 2013-2017 Datenstrom, https://datenstrom.se
// Copyright (c) 2013-2018 Datenstrom, https://datenstrom.se
// This file may be used and distributed under the terms of the public license.
class YellowUpdate
{
const VERSION = "0.7.8";
const VERSION = "0.7.9";
var $yellow; //access to API
var $updates; //number of updates
@ -18,6 +18,7 @@ class YellowUpdate
$this->yellow->config->setDefault("updateInformationFile", "update.ini");
$this->yellow->config->setDefault("updateVersionFile", "version.ini");
$this->yellow->config->setDefault("updateResourceFile", "resource.ini");
$this->yellow->config->setDefault("newFile", "page-new-(.*).txt"); //TODO: remove with next release
}
// Handle startup
@ -674,7 +675,7 @@ class YellowUpdate
function getRawDataInstallation()
{
$language = $this->yellow->toolbox->detectBrowserLanguage($this->yellow->text->getLanguages(), $this->yellow->config->get("language"));
$fileName = strreplaceu("(.*)", "installation", $this->yellow->config->get("configDir").$this->yellow->config->get("editNewFile"));
$fileName = strreplaceu("(.*)", "installation", $this->yellow->config->get("configDir").$this->yellow->config->get("newFile"));
$rawData = $this->yellow->toolbox->readFile($fileName);
if(empty($rawData))
{