Initial commit
This commit is contained in:
commit
65e0da7e11
1397 changed files with 596542 additions and 0 deletions
30
site/OFF_plugins/field-engineer/snippets/actions.php
Normal file
30
site/OFF_plugins/field-engineer/snippets/actions.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
$buttons = (empty($buttons)) ? array('delete', 'clone', 'sort-up', 'sort-down', 'sort') : $buttons;
|
||||
$button_array = array(
|
||||
'delete' => array(
|
||||
'icon' => 'trash-o'
|
||||
),
|
||||
'clone' => array(
|
||||
'icon' => 'clone'
|
||||
),
|
||||
'sort-up' => array(
|
||||
'icon' => 'long-arrow-up'
|
||||
),
|
||||
'sort-down' => array(
|
||||
'icon' => 'long-arrow-down'
|
||||
),
|
||||
'sort' => array(
|
||||
'icon' => 'arrows'
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<div class="egr-actions">
|
||||
<?php foreach($buttons as $key) : ?>
|
||||
<?php if(isset($button_array[$key]['icon'])) : ?>
|
||||
<div class="egr-<?php echo $key; ?>">
|
||||
<i class="icon fa fa-<?php echo $button_array[$key]['icon']; ?>"></i>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
14
site/OFF_plugins/field-engineer/snippets/delete.php
Normal file
14
site/OFF_plugins/field-engineer/snippets/delete.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
if(!kirby()->get('option', 'egr.delete.set')) {
|
||||
kirby()->set('option', 'egr.delete.set', true);
|
||||
?>
|
||||
<div class="egr-element-delete">
|
||||
<div class="egr-delete-message">
|
||||
<div class="label"><?php _l('fields.structure.delete.label') ?></div>
|
||||
<div class="egr-delete-buttons">
|
||||
<div class="egr-delete-cancel"><span><?php _l('fields.structure.cancel'); ?></span></div>
|
||||
<div class="egr-delete-apply"><?php _l('fields.structure.delete'); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php }
|
||||
7
site/OFF_plugins/field-engineer/snippets/dropdown.php
Normal file
7
site/OFF_plugins/field-engineer/snippets/dropdown.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?php if(count($fieldset_names) > 1) : ?>
|
||||
<div class="egr-dropdown">
|
||||
<?php foreach($fieldset_names as $field_key => $field_label) : ?>
|
||||
<div class="egr-add-select" data-add="<?php echo $field_key; ?>"><?php echo $field_label; ?></div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
46
site/OFF_plugins/field-engineer/snippets/outline.php
Normal file
46
site/OFF_plugins/field-engineer/snippets/outline.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php if(!empty($outline)) : ?>
|
||||
<?php foreach($outline as $row_name => $set ) : ?>
|
||||
<?php $fieldset_names = array(); ?>
|
||||
<div class="egr-row egr-row-blueprint <?php echo egr::oddEven($set['_level'] + 1); ?> egr-style-<?php echo $set['_style'] ?? 'items'; ?>"
|
||||
data-field-name="<?php echo $row_name; ?>"
|
||||
data-id="<?php echo $row_name; ?>"
|
||||
data-fieldset-count="<?php echo count($set['fieldsets']); ?>"
|
||||
>
|
||||
<div class="egr-fieldsets<?php echo egr::grid($outline[$row_name]); ?>">
|
||||
<?php foreach($set['fieldsets'] as $fieldset_name => $fieldset ) : ?>
|
||||
<?php $fieldset_names[$fieldset_name] = (isset($fieldset['label'])) ? $fieldset['label'] : $fieldset_name; ?>
|
||||
|
||||
<div class="egr-fieldset" data-fieldset-name="<?php echo $fieldset_name; ?>">
|
||||
<div class="egr-fields"><?php
|
||||
if(!empty($fieldset['fields'])) {
|
||||
foreach($fieldset['fields'] as $field_name => $field) {
|
||||
if($field['type'] != 'engineer') {
|
||||
echo $instance->setField()->data($field_name, $field, $instance->page);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if(isset($fieldset['_dropdown'])) : ?>
|
||||
<?php foreach($fieldset['_dropdown'] as $key => $dropdown ) : ?>
|
||||
<div class="egr-row <?php echo egr::oddEven($set['_level']); ?>"
|
||||
data-field-name="<?php echo $key; ?>"
|
||||
data-id="<?php echo $row_name; ?>,<?php echo $key; ?>"
|
||||
data-count="0"
|
||||
>
|
||||
<?php if(isset($dropdown['label'])) : ?>
|
||||
<label class="label"><?php echo $dropdown['label']; ?></label>
|
||||
<?php endif; ?>
|
||||
<div class="egr-fieldsets"></div>
|
||||
<?php echo egr::snippet('row-meta', array('fieldset_names' => $dropdown['sets'])); ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php echo egr::snippet('actions', array('buttons' => egr::buttons($set))); ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
40
site/OFF_plugins/field-engineer/snippets/presentation.php
Normal file
40
site/OFF_plugins/field-engineer/snippets/presentation.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<div
|
||||
class="egr-row <?php echo egr::oddEven($presentation['_level'] + 1) . egr::style($presentation); ?>"
|
||||
data-field-name="<?php echo $field_name; ?>"
|
||||
data-id="<?php echo $id; ?>"
|
||||
data-count="<?php echo egr::count($presentation); ?>"
|
||||
data-fieldset-count="<?php echo count($presentation['_dropdown']); ?>"
|
||||
>
|
||||
<?php if(isset($presentation['label'])) : ?>
|
||||
<label class="label"><?php echo $presentation['label']; ?></label>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="egr-fieldsets<?php echo egr::grid($presentation); ?>">
|
||||
<?php if(isset($presentation['sets'])) : ?>
|
||||
<?php $first = array_values($presentation['sets'])[0]; ?>
|
||||
<?php if(isset($first['labels']) && !empty($first['labels'])) : ?>
|
||||
<div class="egr-labels"><?php
|
||||
foreach($first['labels'] as $field_key => $field) :
|
||||
?><div class="field egr-field field-grid-item field-grid-item-<?php echo (isset($field['width']) ? str_replace('/', '-', $field['width']) : '1-2') ?>">
|
||||
<label class="label"><?php echo $field['label']; ?></label>
|
||||
</div><?php endforeach;
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
foreach($presentation['sets'] as $set_id => $set ) :
|
||||
?><div class="egr-fieldset" data-fieldset-name="<?php echo $set['name']; ?>">
|
||||
<div class="egr-fields"><?php
|
||||
echo $instance->presentation()->render(array(
|
||||
'instance' => $instance,
|
||||
'set' => $set,
|
||||
'id' => $id,
|
||||
));
|
||||
?></div>
|
||||
<?php echo egr::snippet('actions', array('buttons' => egr::buttons($presentation))); ?>
|
||||
</div><?php
|
||||
endforeach; endif; ?>
|
||||
</div>
|
||||
|
||||
<?php echo egr::snippet('row-meta', array('fieldset_names' => $presentation['_dropdown'])); ?>
|
||||
</div>
|
||||
12
site/OFF_plugins/field-engineer/snippets/row-actions.php
Normal file
12
site/OFF_plugins/field-engineer/snippets/row-actions.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<div class="egr-row-actions">
|
||||
<div class="egr-add">
|
||||
<div class="egr-add-button"<?php echo $data_add; ?>>
|
||||
<?php if(count($fieldset_names) > 1) : ?>
|
||||
<i class="icon icon-left fa fa-arrow-circle-down"></i><span><?php echo l('fields.structure.add'); ?></span>
|
||||
<?php else : ?>
|
||||
<i class="icon icon-left fa fa-plus-circle"></i><span><?php echo l('fields.structure.add'); ?></span>
|
||||
<?php endif; ?>
|
||||
<?php echo egr::snippet('dropdown', array('fieldset_names' => $fieldset_names)); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
7
site/OFF_plugins/field-engineer/snippets/row-empty.php
Normal file
7
site/OFF_plugins/field-engineer/snippets/row-empty.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<div class="egr-empty">
|
||||
<?php $icon = (!empty($data_add)) ? 'plus-circle' : 'arrow-circle-down'; ?>
|
||||
<i class="icon icon-left fa fa-<?php echo $icon; ?>"></i>
|
||||
<span class="egr-add-button"<?php echo $data_add; ?>><?php _l('fields.structure.add.first') ?>
|
||||
<?php echo egr::snippet('dropdown', array('fieldset_names' => $fieldset_names)); ?>
|
||||
</span>
|
||||
</div>
|
||||
8
site/OFF_plugins/field-engineer/snippets/row-meta.php
Normal file
8
site/OFF_plugins/field-engineer/snippets/row-meta.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
$data_add = '';
|
||||
if(count($fieldset_names) == 1) {
|
||||
reset($fieldset_names);
|
||||
$data_add = ' data-add="' . key($fieldset_names) . '"';
|
||||
}
|
||||
echo egr::snippet('row-actions', array('data_add' => $data_add, 'fieldset_names' => $fieldset_names));
|
||||
echo egr::snippet('row-empty', array('data_add' => $data_add, 'fieldset_names' => $fieldset_names));
|
||||
21
site/OFF_plugins/field-engineer/snippets/template.php
Normal file
21
site/OFF_plugins/field-engineer/snippets/template.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php if(c::get('engineer.debug', false)) : ?>
|
||||
<style>
|
||||
.egr-outline,
|
||||
.egr-output {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<?php endif; ?>
|
||||
<div class="egr">
|
||||
<div class="egr-outline">
|
||||
<?php echo egr::snippet('delete'); ?>
|
||||
<?php echo egr::snippet('outline', $args['outline']); ?>
|
||||
</div>
|
||||
<div class="egr-presentation"><?php echo egr::snippet('presentation', $args['presentation']); ?></div>
|
||||
<div class="egr-output">
|
||||
<textarea
|
||||
name="<?= $args['instance']->name; ?>"
|
||||
id="form-field-<?= $args['instance']->name; ?>
|
||||
"><?php echo htmlspecialchars($args['instance']->value); ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue