Skip to content

Commit

Permalink
7.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Bergstein committed Sep 5, 2013
1 parent 254a828 commit f139cf4
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 23 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": ["framework", "oop sucks", "fp rules"],
"homepage": "http://one2team.ru/project/Codeine",
"license": "BSD-2-Clause",
"version": "7.10.3",
"version": "7.20.0",
"authors": [
{
"name": "Dmitry Bergstein",
Expand All @@ -31,7 +31,7 @@
"type": "package",
"package": {
"name": "one2team/codeine",
"version": "7.10.3",
"version": "7.20.0",
"dist": {
"url": "http://deb.one2team.ru/",
"type": "deb"
Expand Down
4 changes: 3 additions & 1 deletion src/Drivers/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
else
F::Log('Model for '.$Call['Entity'].' not found', LOG_CRIT);

$Call = F::Hook('afterEntityLoad', $Call);
$Call = F::Hook('afterEntityLoad', $Call);

$Call['entity'] = strtolower($Call['Entity']);

return $Call;
});
Expand Down
10 changes: 5 additions & 5 deletions src/Drivers/Entity/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
if($IC == 0)
$Widget['Autofocus'] = true;

if (isset($Widget['Options']))
$Widget['Options'] = F::Live($Widget['Options']);
else
$Widget['Options'] = [];

if (isset($Node['Localized']) && $Node['Localized'])
$Widget['Label'] = $Call['Entity'].'.Entity:'.$Name.'.Label';
else
Expand All @@ -69,11 +74,6 @@
if (isset($Call['Data']))
$Widget['Data'] = $Call['Data'];

if (isset($Widget['Options']))
$Widget['Options'] = F::Live($Widget['Options']);
else
$Widget['Options'] = [];

// Если есть значение, добавляем
if (($Widget['Value'] = F::Dot($Call['Data'], $Name)) === null)
{
Expand Down
30 changes: 19 additions & 11 deletions src/Drivers/View/HTML/Widget/Form/Radiogroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,27 @@
setFn('Make', function ($Call)
{
$Call['Radios'] = '';

foreach($Call['Options'] as $IX => $Value)
{
if (isset($Call['Localized']) && $Call['Localized'])
$lValue = '<l>'.$Call['Entity'].'.Entity:'.$Call['Key'].'.'.$Value.'</l>';
else
$lValue = $Value;

$Call['Radios'] .= F::Run('View', 'Load',
[
'Scope' => $Call['Widget Set'].'/Widgets',
'ID' => 'Form/Radio',
'Data' =>
F::Merge ($Call,
[
'Value' => $Value,
'Checked' => ($IX == $Call['Value']? 'checked': '')
])
]
);
[
'Scope' => $Call['Widget Set'].'/Widgets',
'ID' => 'Form/Radio',
'Data' =>
F::Merge ($Call,
[
'Value' => $lValue,
'Checked' => ($IX == $Call['Value']? 'checked': '')
])
]
);
}

return $Call;
});
4 changes: 2 additions & 2 deletions src/Drivers/View/HTML/Widget/Form/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
$Value = $Option;

if (isset($Call['Localized']) && $Call['Localized'])
$lValue = '<l>'.$Call['Entity'].'.Entity:'.$Call['Node'].'.'.$Value.'</l>';
$lValue = '<l>'.$Call['Entity'].'.Entity:'.$Call['Key'].'.'.$Value.'</l>';
else
$lValue = $Value;
$lValue = '<l>'.$Call['Entity'].'.Entity:'.$Call['Key'].'.'.$Value.'</l>';

if ($Key == $Call['Value'] || $Value == $Call['Value'] || (is_array($Call['Value']) && in_array($Key, $Call['Value'])))
$Options[] = '<option value="'.$Key.'" selected>'.$lValue.'</option>';
Expand Down
2 changes: 1 addition & 1 deletion src/Options/Mixins/CRUD.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Method": "Redirect",
"Call":
{
"Location": "/user/$Data.ID"
"Location": "/$entity/$Data.ID"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/Options/User/Entity.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"Type": "List.Enum",
"Default": 0,
"Options": ["M", "F"],
"Localizable": true,
"Localized": true,
"Widgets":
{
"Write":
Expand Down

0 comments on commit f139cf4

Please sign in to comment.