Initial commit
This commit is contained in:
commit
65e0da7e11
1397 changed files with 596542 additions and 0 deletions
43
site/OFF_plugins/field-engineer/lib/tpl.php
Normal file
43
site/OFF_plugins/field-engineer/lib/tpl.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
class egr {
|
||||
public static function oddEven($level) {
|
||||
return ($level % 2 == 0) ? 'egr-even' : 'egr-odd';
|
||||
}
|
||||
|
||||
public static function snippet($name, $data = array()) {
|
||||
$path = kirby()->roots()->plugins() . DS . 'field-engineer' . DS . 'snippets' . DS . $name . '.php';
|
||||
return tpl::load($path, $data);
|
||||
}
|
||||
|
||||
public static function grid($field) {
|
||||
$grid = '';
|
||||
if(isset($field['rowWidth'])) {
|
||||
$grid = ' egr-grid-item egr-grid-item-' . str_replace('/', '-', $field['rowWidth']);
|
||||
}
|
||||
return $grid;
|
||||
}
|
||||
|
||||
public static function buttons($set) {
|
||||
$buttons = array();
|
||||
if(isset($set['buttons'])) {
|
||||
$buttons = $set['buttons'];
|
||||
}
|
||||
return $buttons;
|
||||
}
|
||||
|
||||
public static function count($field) {
|
||||
$count = 0;
|
||||
if(isset($field['sets'])) {
|
||||
$count = count($field['sets']);
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
|
||||
public static function style($set) {
|
||||
$style = '';
|
||||
if(isset($set['style'])) {
|
||||
$style = ' egr-style-' . $set['style'];
|
||||
}
|
||||
return $style;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue