Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Horizontal separator #283

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions inc/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ public static function addNewField($table, $field, $after = false) {
case 'bool' :
$query .= "TINYINT (1) NOT NULL DEFAULT '0'";
break;
case 'horizontalseparator' :
case 'emptyspace' :
case 'text' :
$query .= "VARCHAR ( 255 ) collate utf8_unicode_ci NOT NULL DEFAULT ''";
Expand Down
14 changes: 14 additions & 0 deletions inc/object.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,11 @@ function displayField($canedit, $name, $value, $template, $description = []) {
$description['Type'] = 'emptyspace';
}

if (isset($searchoption['input_type']) && 'horizontalseparator' === $searchoption['input_type']) {
$this->DisplayHorizontalSeparator($searchoption['name']);
return;
}

$this->startColumn();
echo $searchoption['name'];
if (isset($searchoption['autoname']) && $searchoption['autoname'] && $template) {
Expand Down Expand Up @@ -741,6 +746,15 @@ function closeColumn() {
}
}

/**
* Display an horizontal separator on all columns
**/

function DisplayHorizontalSeparator($name) {
$this->closeColumn();
echo '<tr class="tab_bg_1"><th colspan="4">'. $name."</th></tr>";
$this->cpt = 0;
}

function prepareInputForAdd($input) {

Expand Down