1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-31 19:30:40 +02:00

Version 1.3.1: Improve Meta-Tabs

This commit is contained in:
trendschau
2020-01-09 08:30:37 +01:00
parent 25a4f4ddf6
commit b1fb245b4b
7 changed files with 25 additions and 10 deletions

View File

@@ -53,8 +53,15 @@ class Folder
{
if (is_dir($folderPath . DIRECTORY_SEPARATOR . $item))
{
$subFolder = $item;
$folderContent[$subFolder] = self::scanFolder($folderPath . DIRECTORY_SEPARATOR . $subFolder, $draft);
$subFolder = $item;
$folderPublished = file_exists($folderPath . DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . 'index.md');
# scan that folder only if it is a draft or if the folder is published (contains index.md)
if($draft OR $folderPublished)
{
$folderContent[$subFolder] = self::scanFolder($folderPath . DIRECTORY_SEPARATOR . $subFolder, $draft);
}
}
else
{

View File

@@ -329,11 +329,11 @@ class Validation
* @return obj $v the validation object passed to a result method.
*/
public function objectField($fieldName, $fieldValue, $objectName, $fieldDefinitions)
public function objectField($fieldName, $fieldValue, $objectName, $fieldDefinitions, $skiprequired = NULL)
{
$v = new Validator(array($fieldName => $fieldValue));
if(isset($fieldDefinitions['required']))
if(isset($fieldDefinitions['required']) && !$skiprequired)
{
$v->rule('required', $fieldName);
}