Ejemplo n.º 1
0
                    <!-- disable chrome email & password autofill -->
                    <input type="text" class="hidden" formnovalidate><input type="password" class="hidden" formnovalidate>
                    <!-- end of autofill disabler -->
                    <div class="modal-body">
                    <?php 
$enablerTextOn = \PeskyCMF\Config\CmfConfig::transBase('.form.bulk_edit.enabler.edit_field');
$enablerTextOff = \PeskyCMF\Config\CmfConfig::transBase('.form.bulk_edit.enabler.skip_field');
$baseEnablerId = str_random() . '-enabler-for-';
foreach ($formConfig->getBulkEditableFields() as $inputConfig) {
    if (!$inputConfig->hasLabel()) {
        $inputConfig->setLabel(trans("{$translationPrefix}.form.field.{$inputConfig->getName()}"));
    }
    try {
        $renderedInput = $inputConfig->render(['translationPrefix' => $translationPrefix]);
        // replace <script> tags to be able to render that template
        $renderedInput = modifyDotJsTemplateToAllowInnerScriptsAndTemplates($renderedInput);
        $enablerSwitchId = $baseEnablerId . str_slug($inputConfig->getName());
        $enablerSwitch = "\n                                    <div class=\"bulk-edit-form-input-enabler pull-left va-t mr15\">\n                                        <input class=\"bulk-edit-form-input-enabler-switch switch\" type=\"checkbox\" \n                                            id=\"{$enablerSwitchId}\" data-size=\"mini\"\n                                            data-on-text=\"{$enablerTextOn}\" data-off-text=\"{$enablerTextOff}\">\n                                    </div>";
        $renderedInput = '<div class="bulk-edit-form-input va-t">' . $renderedInput . '</div>';
        echo '<div class="bulk-edit-form-input-container">' . $enablerSwitch . $renderedInput . '</div>';
    } catch (Exception $exc) {
        echo '<div>' . $exc->getMessage() . '</div>';
        echo '<pre>' . nl2br($exc->getTraceAsString()) . '</pre>';
    }
}
?>
                    </div>
                    <div class="modal-footer">
                        <div class="row">
                            <div class="col-xs-6 text-left">
                                <button type="button" class="btn btn-default" data-dismiss="modal">
Ejemplo n.º 2
0
            echo $renderedInput;
        } else {
            if ($inputConfig->isShownOnCreate()) {
                // display only when creating
                echo $ifCreate . $renderedInput . $endIf;
            } else {
                // display only when editing
                echo $ifEdit . $renderedInput . $endIf;
            }
        }
    } catch (Exception $exc) {
        echo '<div>' . $exc->getMessage() . '</div>';
        echo '<pre>' . nl2br($exc->getTraceAsString()) . '</pre>';
    }
}
echo modifyDotJsTemplateToAllowInnerScriptsAndTemplates($formConfig->getAdditionalHtmlForForm());
?>
        </div>
        <div class="box-footer">
            <div class="row">
                <div class="col-xs-3">
                    <a class="btn btn-default" href="#" data-nav="back" data-default-url="<?php 
echo $backUrl;
?>
">
                        <?php 
echo \PeskyCMF\Config\CmfConfig::transBase('.form.toolbar.cancel');
?>
                    </a>
                </div>
                <div class="col-xs-6 text-center">
Ejemplo n.º 3
0
    echo $config->getName();
    ?>
">
            <th class="text-nowrap">
                <?php 
    if ($config->hasLabel()) {
        echo $config->getLabel();
    } else {
        echo trans("{$translationPrefix}.item_details.field.{$config->getName()}");
    }
    ?>
            </th>
            <td width="80%">
                <?php 
    try {
        echo modifyDotJsTemplateToAllowInnerScriptsAndTemplates($config->render(['translationPrefix' => $translationPrefix]));
    } catch (Exception $exc) {
        echo '<div>' . $exc->getMessage() . '</div>';
        echo '<pre>' . nl2br($exc->getTraceAsString()) . '</pre>';
    }
    ?>
            </td>
        </tr>
        <?php 
}
?>
    </table>
<?php 
View::stopSection();
?>