mirror of
https://github.com/typemill/typemill.git
synced 2025-08-06 14:16:46 +02:00
Version 1.0.4 optimized author panel and refactoring
This commit is contained in:
@@ -192,6 +192,11 @@ class Field
|
||||
$this->attributes[$key] = $value;
|
||||
}
|
||||
|
||||
public function unsetAttribute($key)
|
||||
{
|
||||
unset($this->attributes[$key]);
|
||||
}
|
||||
|
||||
/* get a single attribute, if it is defined. For usage in templates like getAttribute('required') */
|
||||
public function getAttribute($key)
|
||||
{
|
||||
@@ -238,7 +243,7 @@ class Field
|
||||
$this->attributeValues[$key] = $value;
|
||||
}
|
||||
|
||||
private function getAttributeValue($key)
|
||||
public function getAttributeValue($key)
|
||||
{
|
||||
if(isset($this->attributeValues[$key]))
|
||||
{
|
||||
|
@@ -119,7 +119,7 @@ class Folder
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
public static function getPagingForItem($content, $item)
|
||||
{
|
||||
|
@@ -173,7 +173,7 @@ class Validation
|
||||
return $this->validationResult($v, $name);
|
||||
}
|
||||
|
||||
public function pluginField($fieldName, $fieldValue, $pluginName, $fieldDefinitions)
|
||||
public function objectField($fieldName, $fieldValue, $pluginName, $fieldDefinitions)
|
||||
{
|
||||
$v = new Validator(array($fieldName => $fieldValue));
|
||||
|
||||
@@ -186,6 +186,11 @@ class Validation
|
||||
switch($fieldDefinitions['type'])
|
||||
{
|
||||
case "select":
|
||||
/* create array with option keys as value */
|
||||
$options = array();
|
||||
foreach($fieldDefinitions['options'] as $key => $value){ $options[] = $key; }
|
||||
$v->rule('in', $fieldName, $options);
|
||||
break;
|
||||
case "radio":
|
||||
case "checkboxlist":
|
||||
$v->rule('in', $fieldName, $fieldDefinitions['options']);
|
||||
|
@@ -20,6 +20,6 @@ class VersionCheck
|
||||
return false;
|
||||
}
|
||||
$version = json_decode($version);
|
||||
return $version->version;
|
||||
return $version->system->typemill;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user