Commit 5e9442d0 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Merge remote-tracking branch 'origin/crose_work' into raos_work

parents 8a767f04 eecfb808
...@@ -11,6 +11,21 @@ ...@@ -11,6 +11,21 @@
Administrator Manual Administrator Manual
==================== ====================
Preparation
-----------
The QFQ extension needs the PHP MySQL native driver. The following functions are used and are only available with the
native driver (see also: http://dev.mysql.com/downloads/connector/php-mysqlnd/):
* mysqli::get_result (important),
* mysqli::fetch_all (nice to use)
Installation for Ubuntu::
sudo apt-get install php5-mysqlnd
sudo php5enmod mysqlnd
sudo service apache2 restart
Setup Setup
----- -----
...@@ -56,42 +71,45 @@ Setup a *report* to manage all *forms*: Create a Typo3 page and insert a content ...@@ -56,42 +71,45 @@ Setup a *report* to manage all *forms*: Create a Typo3 page and insert a content
<ext_dir>/config.ini <ext_dir>/config.ini
-------------------- --------------------
+------------------------+--------------+----------------------------------------------------------------------------+ +------------------------+----------------------------------+----------------------------------------------------------------------------+
| Keyword | Example | Description | | Keyword | Example | Description |
+========================+==============+============================================================================+ +========================+==================================+============================================================================+
| DBUSER | qfqUser | Credentials configured in MySQL | | DB_USER | DB_USER=qfqUser | Credentials configured in MySQL |
+------------------------+--------------+----------------------------------------------------------------------------+ +------------------------+----------------------------------+----------------------------------------------------------------------------+
| DBPW | 12345678 | Credentials configured in MySQL | | DB_PASSWORD | DB_PASSWORD=12345678 | Credentials configured in MySQL |
+------------------------+--------------+----------------------------------------------------------------------------+ +------------------------+----------------------------------+----------------------------------------------------------------------------+
| DBSERVER | localhost | Hostname of MySQL Server | | DB_SERVER | DB_SERVER=localhost | Hostname of MySQL Server |
+------------------------+--------------+----------------------------------------------------------------------------+ +------------------------+----------------------------------+----------------------------------------------------------------------------+
| DB | qfq_db | Database name | | DB_NAME | DB_NAME=qfq_db | Database name |
+------------------------+--------------+----------------------------------------------------------------------------+ +------------------------+----------------------------------+----------------------------------------------------------------------------+
| TESTDB | qfq_db_test | Used during development of QFQ | | DB_NAME_TEST | DB_NAME_TEST=qfq_db_test | Used during development of QFQ |
+------------------------+--------------+----------------------------------------------------------------------------+ +------------------------+----------------------------------+----------------------------------------------------------------------------+
| SESSIONNAME | qfq | By default 'qfq' | | SESSION_NAME | SESSION_NAME=qfq | PHP Session name, by default 'qfq' |
+------------------------+--------------+----------------------------------------------------------------------------+ +------------------------+----------------------------------+----------------------------------------------------------------------------+
| SQLLOG | sql.log | filename to log all SQL commands | | SQL_LOG | SQL_LOG=sql.log | Filename to log SQL commands: relative to <ext_dir> or absolute. |
+------------------------+--------------+----------------------------------------------------------------------------+ +------------------------+----------------------------------+----------------------------------------------------------------------------+
| SHOW_DEBUG_INFO | auto | Possible values: auto|yes|no. For 'auto': If a BE User is logged in, | | SQL_LOG_MODE | SQL_LOG_MODE=modify | *all*: every statement will be logged - this is a lot |
| | | debug information will be shown on the fronend. | | | | *modify*: log only statements who change data |
+------------------------+--------------+----------------------------------------------------------------------------+ +------------------------+----------------------------------+----------------------------------------------------------------------------+
| CSS_LINK_CLASS_INTERNAL| internal | CSS class name of links which points to internal tagets | | SHOW_DEBUG_INFO | SHOW_DEBUG_INFO=auto | Possible values: auto|yes|no. For 'auto': If a BE User is logged in, |
+------------------------+--------------+----------------------------------------------------------------------------+ | | | debug information will be shown on the fronend. |
| CSS_LINK_CLASS_EXTERNAL| external | CSS class name of links which points to internal tagets | +------------------------+----------------------------------+----------------------------------------------------------------------------+
+------------------------+--------------+----------------------------------------------------------------------------+ | CSS_LINK_CLASS_INTERNAL| CSS_LINK_CLASS_INTERNAL=internal | CSS class name of links which points to internal tagets |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
| CSS_LINK_CLASS_EXTERNAL| CSS_LINK_CLASS_EXTERNAL=external | CSS class name of links which points to internal tagets |
+------------------------+----------------------------------+----------------------------------------------------------------------------+
Example: *<ext_dir>/config.ini* Example: *<ext_dir>/config.ini*
:: ::
DBUSER = qfqUser DB_USER = qfqUser
DBSERVER = localhost DB_SERVER = localhost
DBPW = 12345678 DB_PASSWORD = 12345678
DB = qfq_db DB_NAME = qfq_db
TESTDB = qfq_db_test DB_NAME_TEST = qfq_db_test
SESSIONNAME = qfq SESSION_NAME = qfq
SQLLOG = sql.log SQL_LOG = sql.log
SHOW_DEBUG_INFO = auto SHOW_DEBUG_INFO = auto
CSS_LINK_CLASS_INTERNAL = internal CSS_LINK_CLASS_INTERNAL = internal
CSS_LINK_CLASS_EXT = external CSS_LINK_CLASS_EXT = external
\ No newline at end of file
...@@ -17,3 +17,6 @@ SHOW_DEBUG_INFO = auto ...@@ -17,3 +17,6 @@ SHOW_DEBUG_INFO = auto
CSS_LINK_CLASS_INTERNAL = internal CSS_LINK_CLASS_INTERNAL = internal
CSS_LINK_CLASS_EXTERNAL = external CSS_LINK_CLASS_EXTERNAL = external
; QFQ with own Bootstrap: 'container'. QFQ already nested in Bootstrap of mainpage: <empty>
CSS_CLASS_MAIN_CONTAINER =
...@@ -10,5 +10,5 @@ $EM_CONF[$_EXTKEY] = array( ...@@ -10,5 +10,5 @@ $EM_CONF[$_EXTKEY] = array(
'dependencies' => 'fluid,extbase', 'dependencies' => 'fluid,extbase',
'clearcacheonload' => true, 'clearcacheonload' => true,
'state' => 'alpha', 'state' => 'alpha',
'version' => '0.1.1' 'version' => '0.1.2'
); );
\ No newline at end of file
...@@ -19,6 +19,6 @@ if (!defined('TYPO3_MODE')) { ...@@ -19,6 +19,6 @@ if (!defined('TYPO3_MODE')) {
*/ */
$GLOBALS['TCA']['tt_content']['types']['qfq_qfq'] = array( $GLOBALS['TCA']['tt_content']['types']['qfq_qfq'] = array(
'showitem' => 'hidden, CType, header, header_position, bodytext, layout, deleted, starttime, endtime, colPos, spaceBefore, spaceAfter, fe_group, header_layout, sectionIndex, linkToTop, section_frame, sys_language_uid' 'showitem' => 'hidden, CType, header, header_position, bodytext;;;nowrap, layout, deleted, starttime, endtime, colPos, spaceBefore, spaceAfter, fe_group, header_layout, sectionIndex, linkToTop, section_frame, sys_language_uid'
); );
...@@ -36,6 +36,8 @@ abstract class AbstractBuildForm { ...@@ -36,6 +36,8 @@ abstract class AbstractBuildForm {
protected $pattern = array(); protected $pattern = array();
protected $wrap = array(); protected $wrap = array();
protected $symbol = array(); protected $symbol = array();
protected $showDebugInfo = false;
// protected $feDivClass = array(); // Wrap FormElements in <div class="$feDivClass[type]"> // protected $feDivClass = array(); // Wrap FormElements in <div class="$feDivClass[type]">
private $formId = null; private $formId = null;
...@@ -54,6 +56,7 @@ abstract class AbstractBuildForm { ...@@ -54,6 +56,7 @@ abstract class AbstractBuildForm {
$this->store = Store::getInstance(); $this->store = Store::getInstance();
$this->db = new Database(); $this->db = new Database();
$this->evaluate = new Evaluate($this->store, $this->db); $this->evaluate = new Evaluate($this->store, $this->db);
$this->showDebugInfo = ($this->store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM) === 'yes');
// $sip = $this->store->getVar(CLIENT_SIP, STORE_CLIENT); // $sip = $this->store->getVar(CLIENT_SIP, STORE_CLIENT);
...@@ -183,7 +186,7 @@ abstract class AbstractBuildForm { ...@@ -183,7 +186,7 @@ abstract class AbstractBuildForm {
*/ */
public function createFormEditUrl() { public function createFormEditUrl() {
if ($this->store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM) !== 'yes') { if (!$this->showDebugInfo) {
return ''; return '';
} }
...@@ -334,7 +337,7 @@ abstract class AbstractBuildForm { ...@@ -334,7 +337,7 @@ abstract class AbstractBuildForm {
$elementHtml = $this->$buildElementFunctionName($formElement, $htmlFormElementId, $value, $debugStack); $elementHtml = $this->$buildElementFunctionName($formElement, $htmlFormElementId, $value, $debugStack);
// debugStack as Tooltip // debugStack as Tooltip
if ($this->store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM) === 'yes' && count($debugStack) > 0) { if ($this->showDebugInfo && count($debugStack) > 0) {
$elementHtml = Support::appendTooltip($elementHtml, implode("\n", OnArray::htmlentitiesOnArray($debugStack))); $elementHtml = Support::appendTooltip($elementHtml, implode("\n", OnArray::htmlentitiesOnArray($debugStack)));
} }
...@@ -354,6 +357,29 @@ abstract class AbstractBuildForm { ...@@ -354,6 +357,29 @@ abstract class AbstractBuildForm {
abstract public function doSubrecords(); abstract public function doSubrecords();
/**
* Takes the current SIP ('form' and additional parameter), set SIP_RECORD_ID=0 and create a new 'NewRecordUrl'.
*
* @throws CodeException
* @throws \qfq\UserException
*/
public function deriveNewRecordUrlFromExistingSip(&$toolTipNew) {
$urlParam = $this->store->getStore(STORE_SIP);
$urlParam[SIP_RECORD_ID] = 0;
unset($urlParam[SIP_SIP]);
unset($urlParam[SIP_URLPARAM]);
$urlParam['id'] = $this->store->getVar(TYPO3_PAGE_ID, STORE_TYPO3);
$urlParam['type'] = $this->store->getVar(TYPO3_PAGE_TYPE, STORE_TYPO3);
$sip = $this->store->getSipInstance();
$url = $sip->queryStringToSip(OnArray::toString($urlParam));
$toolTipNew .= "New" . PHP_EOL . PHP_EOL . OnArray::toString($urlParam, ' = ', PHP_EOL, "'");
return $url;
}
abstract public function buildRowNative($formElement, $elementHtml); abstract public function buildRowNative($formElement, $elementHtml);
abstract public function buildRowPill($formElement, $elementHtml); abstract public function buildRowPill($formElement, $elementHtml);
...@@ -983,9 +1009,7 @@ abstract class AbstractBuildForm { ...@@ -983,9 +1009,7 @@ abstract class AbstractBuildForm {
$flagNew = false; $flagNew = false;
$flagEdit = false; $flagEdit = false;
$flagDelete = false; $flagDelete = false;
$toolTipDelete = '';
$linkNew = ''; $linkNew = '';
$showDebugInfo = false;
$primaryRecord = $this->store->getStore(STORE_RECORD); $primaryRecord = $this->store->getStore(STORE_RECORD);
...@@ -994,9 +1018,8 @@ abstract class AbstractBuildForm { ...@@ -994,9 +1018,8 @@ abstract class AbstractBuildForm {
} }
if (isset($formElement[SUBRECORD_PARAMETER_FORM])) { if (isset($formElement[SUBRECORD_PARAMETER_FORM])) {
$showDebugInfo = $this->store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM);
$linkNew = Support::wrapTag('<th>', $this->createFormLink($formElement, 0, $primaryRecord, $this->symbol[SYMBOL_NEW], 'New', $showDebugInfo)); $linkNew = Support::wrapTag('<th>', $this->createFormLink($formElement, 0, $primaryRecord, $this->symbol[SYMBOL_NEW], 'New'));
// Decode settings in subrecordOption // Decode settings in subrecordOption
$flagNew = Support::findInSet(SUBRECORD_NEW, $formElement['subrecordOption']); $flagNew = Support::findInSet(SUBRECORD_NEW, $formElement['subrecordOption']);
...@@ -1021,7 +1044,7 @@ abstract class AbstractBuildForm { ...@@ -1021,7 +1044,7 @@ abstract class AbstractBuildForm {
$rowHtml = ''; $rowHtml = '';
if ($flagEdit) { if ($flagEdit) {
$rowHtml .= Support::wrapTag('<td>', $this->createFormLink($formElement, $row[$nameColumnId], $primaryRecord, $this->symbol[SYMBOL_EDIT], 'Edit', $showDebugInfo)); $rowHtml .= Support::wrapTag('<td>', $this->createFormLink($formElement, $row[$nameColumnId], $primaryRecord, $this->symbol[SYMBOL_EDIT], 'Edit'));
} elseif ($flagNew) { } elseif ($flagNew) {
$rowHtml .= Support::wrapTag('<td>', $rowHtml, false); $rowHtml .= Support::wrapTag('<td>', $rowHtml, false);
} }
...@@ -1032,10 +1055,15 @@ abstract class AbstractBuildForm { ...@@ -1032,10 +1055,15 @@ abstract class AbstractBuildForm {
} }
if ($flagDelete) { if ($flagDelete) {
$rowHtml .= Support::wrapTag('<td>', $this->createDeleteLink($targetTableName, $row['id'], $this->symbol[SYMBOL_DELETE], 'Delete', $showDebugInfo)); // $rowHtml .= Support::wrapTag('<td>', $this->createDeleteLink($targetTableName, $row['id'], $this->symbol[SYMBOL_DELETE], 'Delete', $this->showDebugInfo));
// $this->createDeleteLink($targetTableName, $row['id'], $this->symbol[SYMBOL_DELETE], 'Delete', $this->showDebugInfo)
// <button type="button" class="record-delete" data-sip={{SIP}}><span class="glyphicon glyphicon-trash"></span></button>
$s = $this->createDeleteUrl($targetTableName, $row['id'], RETURN_SIP);
$rowHtml .= Support::wrapTag('<td>', Support::wrapTag("<button type='button' class='record-delete' data-sip='$s'>", '<span class="glyphicon glyphicon-trash"></span>'));
} }
$html .= Support::wrapTag('<tr>', $rowHtml, true); $html .= Support::wrapTag('<tr class="record">', $rowHtml, true);
} }
return Support::wrapTag('<table class="table">', $html, true); return Support::wrapTag('<table class="table">', $html, true);
...@@ -1096,7 +1124,7 @@ abstract class AbstractBuildForm { ...@@ -1096,7 +1124,7 @@ abstract class AbstractBuildForm {
* @return string * @return string
* @throws UserException * @throws UserException
*/ */
private function createFormLink(array $formElement, $targetRecordId, array $record, $symbol, $toolTip, $showDebugInfo = false) { private function createFormLink(array $formElement, $targetRecordId, array $record, $symbol, $toolTip) {
$queryStringArray = [ $queryStringArray = [
SIP_FORM => $formElement[SUBRECORD_PARAMETER_FORM], SIP_FORM => $formElement[SUBRECORD_PARAMETER_FORM],
...@@ -1119,7 +1147,7 @@ abstract class AbstractBuildForm { ...@@ -1119,7 +1147,7 @@ abstract class AbstractBuildForm {
} }
} }
if ($showDebugInfo) if ($this->showDebugInfo)
$toolTip .= PHP_EOL . OnArray::toString($queryStringArray, ' = ', PHP_EOL, "'"); $toolTip .= PHP_EOL . OnArray::toString($queryStringArray, ' = ', PHP_EOL, "'");
Support::appendTypo3ParameterToArray($queryStringArray); Support::appendTypo3ParameterToArray($queryStringArray);
...@@ -1134,7 +1162,7 @@ abstract class AbstractBuildForm { ...@@ -1134,7 +1162,7 @@ abstract class AbstractBuildForm {
$sip = $this->store->getSipInstance(); $sip = $this->store->getSipInstance();
$url = $sip->queryStringToSip($queryString); $url = $sip->queryStringToSip($queryString);
return Support::wrapTag('<a href="' . $url . '" title="' . $toolTip . '">', $symbol); return Support::wrapTag('<a class="btn btn-default" href="' . $url . '" title="' . $toolTip . '">', $symbol);
} }
/** /**
...@@ -1256,31 +1284,12 @@ abstract class AbstractBuildForm { ...@@ -1256,31 +1284,12 @@ abstract class AbstractBuildForm {
return $cell; return $cell;
} }
/**
* @param $table
* @param $recordId
* @param $symbol
* @param $toolTip
* @return string
*/
private function createDeleteLink($table, $recordId, $symbol, $toolTip, $showDebugInfo = false) {
if ($showDebugInfo) {
$toolTip .= PHP_EOL . "table = '$table'" . PHP_EOL . "id = '$recordId'";
}
$url = $this->createDeleteUrl($table, $recordId);
return Support::wrapTag('<a href="' . $url . '" title="' . $toolTip . '">', $symbol);
}
/** /**
* Create a link (incl. SIP) to delete the current record. * Create a link (incl. SIP) to delete the current record.
* *
* @return string String: "API_DIR/delete.php?sip=...." * @return string String: "API_DIR/delete.php?sip=...."
*/ */
public function createDeleteUrl($table, $recordId) { public function createDeleteUrl($table, $recordId, $mode = RETURN_URL) {
$queryStringArray = [ $queryStringArray = [
SIP_TABLE => $table, SIP_TABLE => $table,
...@@ -1291,7 +1300,8 @@ abstract class AbstractBuildForm { ...@@ -1291,7 +1300,8 @@ abstract class AbstractBuildForm {
$sip = $this->store->getSipInstance(); $sip = $this->store->getSipInstance();
return $sip->queryStringToSip($queryString, RETURN_URL, API_DIR . '/delete.php'); // return $sip->queryStringToSip($queryString, RETURN_URL, API_DIR . '/delete.php');
return $sip->queryStringToSip($queryString, $mode, API_DIR . '/delete.php');
} }
/** /**
...@@ -1419,4 +1429,23 @@ abstract class AbstractBuildForm { ...@@ -1419,4 +1429,23 @@ abstract class AbstractBuildForm {
return $this->buildNativeHidden(CLIENT_SIP, $sipValue); return $this->buildNativeHidden(CLIENT_SIP, $sipValue);
} }
/**
* @param $table
* @param $recordId
* @param $symbol
* @param $toolTip
* @return string
*/
private function createDeleteLink($table, $recordId, $symbol, $toolTip) {
if ($this->showDebugInfo) {
$toolTip .= PHP_EOL . "table = '$table'" . PHP_EOL . "id = '$recordId'";
}
$url = $this->createDeleteUrl($table, $recordId);
return Support::wrapTag('<a href="' . $url . '" title="' . $toolTip . '">', $symbol);
}
} }
\ No newline at end of file
...@@ -37,6 +37,8 @@ class BuildFormBootstrap extends AbstractBuildForm { ...@@ -37,6 +37,8 @@ class BuildFormBootstrap extends AbstractBuildForm {
if (!isset($this->formSpec['class'])) { if (!isset($this->formSpec['class'])) {
$this->formSpec['class'] = 'container'; $this->formSpec['class'] = 'container';
} }
// $this->formSpec['class'] = 'none';
} }
/** /**
...@@ -94,12 +96,13 @@ class BuildFormBootstrap extends AbstractBuildForm { ...@@ -94,12 +96,13 @@ class BuildFormBootstrap extends AbstractBuildForm {
$html .= '<div ' . $this->getAttribute('class', $this->formSpec['class'], TRUE) . '>'; // main <div class=...> around everything, Whole FORM; class="container" or class="container-fluid" $html .= '<div ' . $this->getAttribute('class', $this->formSpec['class'], TRUE) . '>'; // main <div class=...> around everything, Whole FORM; class="container" or class="container-fluid"
$html .= '<div class="row hidden-xs"><div class="col-md-12"><h2>' . $this->formSpec['title'] . '</h2></div></div>'; // Form Title $title = Support::wrapTag('<div class="hidden-xs col-sm-6 col-md-8">', Support::wrapTag('<h3>', $this->formSpec['title']));
$button = Support::wrapTag('<div class="col-xs-12 col-sm-6 col-md-4">', $this->buildButtons());
$html .= Support::wrapTag('<div class="row">', $title . $button);
$pill = $this->buildPillNavigation(OnArray::filter($this->feSpecNative, 'type', 'pill'));
$button = $this->buildButtons();
$html .= Support::wrapTag('<div class="row">', $pill . $button); $pill = $this->buildPillNavigation(OnArray::filter($this->feSpecNative, 'type', 'pill'));
$html .= Support::wrapTag('<div class="row">', $pill);
$html .= $this->getFormTag(); $html .= $this->getFormTag();
...@@ -108,15 +111,81 @@ class BuildFormBootstrap extends AbstractBuildForm { ...@@ -108,15 +111,81 @@ class BuildFormBootstrap extends AbstractBuildForm {
return $html; return $html;
} }
/**
* Simlute Submit Button: http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml
*
* @return string
*/
private function buildButtons() {
$toolTipNew = 'New';
$toolTipDelete = 'Delete';
$buttonDelete = '';
$buttonNew = '';
$buttonDebug = '';
$recordId = $this->store->getVar(SIP_RECORD_ID, STORE_SIP);
// Button: FormEdit
if ($this->showDebugInfo) {
$tooltipFormEdit = "Edit form" . PHP_EOL . PHP_EOL . OnArray::toString($this->store->getStore(STORE_SIP), ' = ', PHP_EOL, "'");
$urlFormEdit = $this->createFormEditUrl();
// Edit Form
$buttonDebug = <<<BUTTON
<div class="btn-group" role="group">
<a href="$urlFormEdit" id="form-edit-button" class="btn btn-default navbar-btn" title="$tooltipFormEdit"><span class="glyphicon glyphicon-wrench"></span></a>
</div>
BUTTON;
}
// Button: Delete
if (Support::findInSet(FORM_BUTTON_DELETE, $this->formSpec['showButton'])) {
if ($this->showDebugInfo && $recordId > 0) {
$toolTipDelete .= PHP_EOL . "table = '" . $this->formSpec['tableName'] . "'" . PHP_EOL . "r = '" . $recordId . "'";
}
$buttonDeleteDisabled = ($recordId > 0) ? '' : 'disabled';
$buttonDelete = <<<BUTTON
<div class="btn-group" role="group">
<button id="delete-button" type="button" class="btn btn-default navbar-btn $buttonDeleteDisabled" title="$toolTipDelete"><span class="glyphicon glyphicon-trash"></span></button>
</div>
BUTTON;
}
// Button: New
if (Support::findInSet(FORM_BUTTON_NEW, $this->formSpec['showButton'])) {
$formNewUrl = $this->deriveNewRecordUrlFromExistingSip($toolTipNew);
$buttonNew = <<<BUTTON
<div class="btn-group" role="group">
<a href="$formNewUrl" id="form-new-button" class="btn btn-default navbar-btn" title="$toolTipNew"><span class="glyphicon glyphicon-plus"></span></a>
</div>
BUTTON;
}
// <div class="btn-toolbar pull-right" role="toolbar">
$html = <<<BUTTON
<div class="btn-toolbar" role="toolbar">
$buttonDebug
<div class="btn-group" role="group">
<button id="save-button" type="button" class="btn btn-default navbar-btn" title="Save"><span class="glyphicon glyphicon-ok"></span></button>
<button id="close-button" type="button" class="btn btn-default navbar-btn" title="Close"><span class="glyphicon glyphicon-remove"></span></button>
</div>
$buttonDelete
$buttonNew
</div>
BUTTON;
return $html;
}
/** /**
* @param $pillArray * @param $pillArray
* @return string * @return string
* @throws UserException * @throws UserException
*/ */
private function buildPillNavigation($pillArray) { private function buildPillNavigation($pillArray) {
$htmlDropdown = '';
$pillButton = ''; $pillButton = '';
$pillDropdown = ''; $pillDropdown = '';
$htmlDropdown = '';
if ($pillArray == null) if ($pillArray == null)
return ''; return '';
...@@ -135,6 +204,7 @@ class BuildFormBootstrap extends AbstractBuildForm { ...@@ -135,6 +204,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
throw new UserException("Field 'name' and/or 'label' are empty", ERROR_NAME_LABEL_EMPTY); throw new UserException("Field 'name' and/or 'label' are empty", ERROR_NAME_LABEL_EMPTY);
} }
// Anker for pill navigation
$a = '<a href="#' . $this->createAnker($formElement['id']) . '" data-toggle="tab">' . $formElement['label'] . '</a>'; $a = '<a href="#' . $this->createAnker($formElement['id']) . '" data-toggle="tab">' . $formElement['label'] . '</a>';
if ($ii <= $maxVisiblePill) { if ($ii <= $maxVisiblePill) {
...@@ -153,7 +223,7 @@ class BuildFormBootstrap extends AbstractBuildForm { ...@@ -153,7 +223,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
} }
$htmlDropdown = Support::wrapTag('<ul id="' . $this->getTabId() . '" class="nav nav-pills" role="tablist">', $pillButton . $htmlDropdown); $htmlDropdown = Support::wrapTag('<ul id="' . $this->getTabId() . '" class="nav nav-pills" role="tablist">', $pillButton . $htmlDropdown);
$htmlDropdown = Support::wrapTag('<div class="col-md-9">', $htmlDropdown); $htmlDropdown = Support::wrapTag('<div class="col-md-12">', $htmlDropdown);
return $htmlDropdown; return $htmlDropdown;
} }
...@@ -175,68 +245,6 @@ class BuildFormBootstrap extends AbstractBuildForm { ...@@ -175,68 +245,6 @@ class BuildFormBootstrap extends AbstractBuildForm {
return 'qfqTabs'; return 'qfqTabs';
} }
/**
* Simlute Submit Button: http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml
*
* @return string
*/
private function buildButtons() {
$toolTipNew = 'New';
$toolTipDelete = 'Delete';
$buttonDelete = '';
$buttonNew = '';
if ($this->store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM) === 'yes') {
$toolTipNew .= PHP_EOL . "form = '" . $this->formSpec['name'] . "'" . PHP_EOL . "r = 0";
$toolTipDelete .= PHP_EOL . "table = '" . $this->formSpec['tableName'] . "'" . PHP_EOL . "r = '" . $this->store->getVar(SIP_RECORD_ID, STORE_SIP) . "'";
}
$sipParamString = OnArray::toString($this->store->getStore(STORE_SIP), ' = ', PHP_EOL, "'");
$formEditUrl = $this->createFormEditUrl();
$buttonDebug = <<<BUTTON
<div class="btn-group" role="group">
<button id="debug-button" type="button" class="btn btn-