Erzeugt eine Überschriftzeile für Tabellen als HTML-Code.
@access		public
@static
@param		string		$caption 			Inhalt der Überschrift
@param		string		$class 			CSS Style Klasse
@param		string		$checktable_id	ID der CheckTable
@return		string
551517
public static function TableCaption( $caption, $class = '', $checktable_id = "" )
	{
		$ins_class	= $class ? " class=\"".$class."\"" : "";
		$ins_check	= $checktable_id ? " onClick=\"ct.switchTable('".$checktable_id."');\"" : "";
		$span		= UI_HTML_Tag::create( "span", $caption );
		$code		= "<caption".$ins_class.$ins_check.">".$span."</caption>";
		return $code;
	}
426531
static function get_instance($paper = null, $orientation = null,  $class = null) {

    $backend = strtolower(DOMPDF_PDF_BACKEND);
    
    if ( isset($class) && class_exists($class, false) )
      $class .= "_Adapter";
    
    else if ( (DOMPDF_PDF_BACKEND === "auto" || $backend === "pdflib" ) &&
              class_exists("PDFLib", false) )
      $class = "PDFLib_Adapter";

    // FIXME The TCPDF adapter is not ready yet
    //else if ( (DOMPDF_PDF_BACKEND === "auto" || $backend === "cpdf") )
    //  $class = "CPDF_Adapter";

    else if ( $backend === "tcpdf")
      $class = "TCPDF_Adapter";
      
    else if ( $backend === "gd" )
      $class = "GD_Adapter";
    
    else
      $class = "CPDF_Adapter";

    return new $class($paper, $orientation);
        
  }
263238
public function getFkMemberElementDetails($memberFK, $objectFK, $fkClass, $fkTable) {
		$_fkClass = str_replace ( "\\", ".", $fkClass );
		$header = new HtmlHeader ( "", 4, $memberFK, "content" );
		if (is_array ( $objectFK ) || $objectFK instanceof \Traversable) {
			$header = $this->getFkHeaderListDetails ( $memberFK, $fkClass, $objectFK );
			$element = $this->getFkListDetails ( $memberFK, $fkClass, $objectFK );
			foreach ( $objectFK as $oItem ) {
				if (method_exists ( $oItem, "__toString" )) {
					$id = (CRUDHelper::getIdentifierFunction ( $fkClass )) ( 0, $oItem );
					$item = $element->addItem ( $oItem . "" );
					$item->setProperty ( "data-ajax", $_fkClass . "||" . $id );
					$item->addClass ( "showTable" );
					$this->onDisplayFkElementListDetails ( $item, $memberFK, $fkClass, $oItem );
				}
			}
		} else {
			if (method_exists ( $objectFK, "__toString" )) {
				$header = $this->getFkHeaderElementDetails ( $memberFK, $fkClass, $objectFK );
				$id = (CRUDHelper::getIdentifierFunction ( $fkClass )) ( 0, $objectFK );
				$element = $this->getFkElementDetails ( $memberFK, $fkClass, $objectFK );
				$element->setProperty ( "data-ajax", $_fkClass . "||" . $id )->addClass ( "showTable" );
			}
		}
		if (isset ( $element )) {
			return [ $header,$element ];
		}
		return null;
	}
197557
public function submit( $caption = null )
    {
        $el = $this->element( 'button', null, 'submit'  )
            ->css( 'btn waves-effect waves-light' )
            ->content( null !== $caption ? "{$caption}<i class=\"material-icons right\">send</i>" : '' );
        return $el;
    }
485195
public static function parseRelationClass($class)
    {
        // detect many many through syntax
        if (is_array($class)
            && array_key_exists('through', $class)
            && array_key_exists('to', $class)
        ) {
            $toRelation = $class['to'];

            $hasOne = Config::inst()->get($class['through'], 'has_one');
            if (empty($hasOne) || !is_array($hasOne) || !array_key_exists($toRelation, $hasOne)) {
                return $class;
            }

            return $hasOne[$toRelation];
        }

        return $class;
    }
1233042
public function Highlight($class = 'highlight')
    {
        $owner = $this->owner;
        $new = DBHTMLText::create();
        $new->name = $owner->name;
        $owner->value = $owner->forTemplate();
        $new->value = preg_replace('/\[([^\]]*)\]/', '<span class="' . $class . '">$1</span>', $owner->value);
        return $new;
    }
831058
private function getClass(State $state, $class)
    {
        $refClass = $state->getClass($class);
        if ($refClass === null) {
            throw new MarkupException(sprintf('class %s does not exist', $class));
        }

        return $refClass;
    }
1121953
public static CheckBox getCheckBox(final String caption, final String style, final String styleName,
            final boolean required, final String data) {
        return new SPUICheckBox(caption, style, styleName, required, data);
    }
922632
public static function textarea($name,
                             $class = NULL,
                             $id = NULL,
                             $value = NULL,
                             $label = NULL,
                             $attrs = array())
    {
        $ret = NULL;
        if($label)
            $ret .= PHP_EOL . self::formatLabel($label, $id);
        if(!$value)
            $value = '';
        $attrs['name'] = $name;
        $ret .= self::tag('textarea',$value, $class, $id, $attrs);
        
        return $ret;
        
    }
778392
public static function getInstance(string $checkClass) : CheckInterface
    {
        $checkClass = $checkClass;

        if (!class_exists($checkClass)) {
            throw new RuntimeException("Check class [$checkClass] does not exist");
        }

        if (!in_array(static::$interface, array_keys(class_implements($checkClass)))) {
            throw new RuntimeException("Check class [$checkClass] does not implement [" . static::$interface . "]");
        }

        return new $checkClass();
    }
472534
public function data_for_question_response_table($responseclasscolumn, $partid) {
        $return = array();
        if (count($this->get_responses()) == 0) {
            $rowdata = new \stdClass();
            $rowdata->part = $partid;
            $rowdata->responseclass = $this->modelresponse;
            if (!$responseclasscolumn) {
                $rowdata->response = $this->modelresponse;
            } else {
                $rowdata->response = '';
            }
            $rowdata->fraction = $this->fraction;
            $rowdata->totalcount = 0;
            $rowdata->trycount = array();
            $return[] = $rowdata;
        } else {
            foreach ($this->get_responses() as $actualresponse) {
                $response = $this->get_response($actualresponse);
                $return[] = $response->data_for_question_response_table($partid, $this->modelresponse);
            }
        }
        return $return;
    }
806820
public function getFkMemberElement($memberFK, $objectFK, $fkClass, $fkTable) {
		$element = "";
		$_fkClass = str_replace ( "\\", ".", $fkClass );
		if (is_array ( $objectFK ) || $objectFK instanceof \Traversable) {
			$element = $this->getFkList ( $memberFK, $objectFK );
			foreach ( $objectFK as $oItem ) {
				if (method_exists ( $oItem, "__toString" )) {
					$id = (CRUDHelper::getIdentifierFunction ( $fkClass )) ( 0, $oItem );
					$item = $element->addItem ( $oItem . "" );
					$item->setProperty ( "data-ajax", $_fkClass . "||" . $id );
					$item->addClass ( "showTable" );
					$this->displayFkElementList ( $item, $memberFK, $fkClass, $oItem );
				}
			}
		} else {
			if (method_exists ( $objectFK, "__toString" )) {
				$id = (CRUDHelper::getIdentifierFunction ( $fkClass )) ( 0, $objectFK );
				$element = $this->getFkElement ( $memberFK, $fkClass, $objectFK );
				$element->setProperty ( "data-ajax", $_fkClass . "||" . $id )->addClass ( "showTable" );
			}
		}
		return $element;
	}
687628
protected function _showTable($caption, $data, $nested = false)
    {
        $table = \MUtil_Html_TableElement::createArray($data, $caption, $nested);
        $table->class = 'browser table';
        $div = \MUtil_Html::create()->div(array('class' => 'table-container'));
        $div[] = $table;
        $this->html[] = $div;
    }
53166
public void setCaptionClass(java.lang.String captionClass) {
        getStateHelper().put(PropertyKeys.captionClass, captionClass);
    }
327237
public function getCaptionHTML()
    {
        if ($this->CaptionMode == self::CAPTION_TEXT && $this->Caption) {
            return $this->Caption;
        }
        
        if ($this->CaptionMode == self::CAPTION_DESC && $this->Description) {
            return sprintf('<p>%s</p>', $this->Description);
        }
    }
624728
public void getReferenceTableTexts(TableCandidate tc,
	    ArrayList<ArrayList<TextPiece>> linesByPage) {
	/*
	 * Gets the table caption beginning part, e.g., "Table 4"
	 */
	String thisCaption = tc.getCaption().replace(" ", "");
	char lastCharInThisKwd = tc.getKeyword().charAt(
		tc.getKeyword().length() - 1);
	int indexAfterKwd = thisCaption.indexOf(lastCharInThisKwd);
	int ii = indexAfterKwd + 1;
	int captionIndex_start = ii;
	int captionIndex_end = ii + 1;
	while ((ii < thisCaption.length() - 1)
		&& (captionIndex_end - captionIndex_start < 2)
		&& (captionIndex_end >= captionIndex_start)) { // for: Table 12
							       // 4 datasets.
							       // for such case,
							       // we may get
							       // "Tabl124" to
							       // start the
							       // reference text
							       // search,
							       // without the
							       // 2nd condition.
	    String nextChar = thisCaption.substring(ii, ii + 1);
	    if ((nextChar.compareToIgnoreCase(".") != 0)
		    && (nextChar.matches("[0-9]") == true)
		    && (nextChar.compareToIgnoreCase(":") != 0)
		    && (nextChar.compareToIgnoreCase(",") != 0))
		ii++;
	    else {
		captionIndex_end = ii;
		break;
	    }
	}
	String thisTableCaptionBeginning = thisCaption.substring(0, ii);
	/*
	 * Gets each character in the table caption beginning part
	 */
	int cationBeginningLength = thisTableCaptionBeginning.length();
	char[] charsInCaptionBeginning = new char[cationBeginningLength];
	for (int i = 0; i < cationBeginningLength; i++) {
	    charsInCaptionBeginning[i] = thisTableCaptionBeginning.charAt(i);
	}

	if (linesByPage != null && linesByPage.size() != 0
		&& thisTableCaptionBeginning.length() > 5) {
	    for (int k = 0; k < linesByPage.size(); k++) {
		ArrayList<TextPiece> linesThisPage = linesByPage.get(k);
		for (int j = 0; j < linesThisPage.size(); j++) {
		    String thisLine = linesThisPage.get(j).getText()
			    .replace(" ", "");
		    if ((k == tc.getPageId_thisTable())
			    && (j >= tc.getCaptionStartLine())
			    && (j <= tc.getCaptionEndLine())) {
		    }// filter out the table caption itself
		    else {
			if ((thisLine).contains(thisTableCaptionBeginning) == true) {
			    /*
			     * Finds the Index of the Table Caption beginning
			     * part in the matched document line. E.g., the "2"
			     * in "Table 2."
			     */
			    String thisLine_Orig = linesThisPage.get(j)
				    .getText();
			    int kk = thisLine
				    .indexOf(thisTableCaptionBeginning);

			    int beginIndex = thisLine_Orig.indexOf(
				    charsInCaptionBeginning[0], kk);
			    int endIndex = thisLine_Orig
				    .indexOf(
					    charsInCaptionBeginning[cationBeginningLength - 1],
					    beginIndex) + 1;
			    String thisPiece = "";
			    while (beginIndex < thisLine_Orig.length()
				    && endIndex < thisLine_Orig.length()
				    && (endIndex - beginIndex) > 5
				    && beginIndex >= 0 && endIndex > 0) {
				thisPiece = thisLine_Orig.substring(beginIndex,
					endIndex).replace(" ", "");
				/*
				 * for "Table 11", "thisPiece" can be "Table1"
				 */
				if (thisTableCaptionBeginning
					.startsWith(thisPiece)) {
				    while ((thisPiece.length() < thisTableCaptionBeginning
					    .length())
					    && (endIndex < thisLine_Orig
						    .length() - 1)) {
					endIndex++;
					thisPiece = thisLine_Orig.substring(
						beginIndex, endIndex).replace(
						" ", "");
				    }
				    break;
				} else {
				    beginIndex = thisLine_Orig.indexOf(
					    charsInCaptionBeginning[0],
					    endIndex);
				    endIndex = thisLine_Orig
					    .indexOf(
						    charsInCaptionBeginning[cationBeginningLength - 1],
						    beginIndex);
				}
			    }

			    if ((endIndex < thisLine_Orig.length() - 3)
				    && (endIndex > 0)
				    && (beginIndex >= 0)
				    && (thisLine_Orig.substring(endIndex,
					    endIndex + 2).matches("[ ][0-9]") == false)
				    && (thisLine_Orig.substring(endIndex,
					    endIndex + 2).matches("[0-9][.]") == false)
				    && (thisLine_Orig.substring(endIndex,
					    endIndex + 2).matches("[0-9][ ]") == false)
				    && (thisLine_Orig.substring(endIndex,
					    endIndex + 2).matches("[.][0-9]") == false)) {
				String firstHalfLine = thisLine_Orig.substring(
					0, beginIndex);
				String secondHalfLine = thisLine_Orig
					.substring(endIndex);

				/*
				 * Looks up all text of the reference
				 */
				int totalPeriodNum = 0;
				int periodNum_thisLine = 0;
				String curRef = "";
				int nextIndex = j;
				String line = secondHalfLine;
				while (nextIndex < linesThisPage.size() - 1) {
				    if ((k == tc.getPageId_thisTable())
					    && nextIndex <= tc.getBodyEndLine()
					    && nextIndex >= tc
						    .getBodyStartLine()) {
					break;
				    }
				    /*
				     * Gets the number of periods in the line.
				     * If the total period number < 2, get the
				     * whole line, otherwise, cut and break
				     */
				    for (int qq = 0; qq < line.length(); qq++) {
					if (line.substring(qq, qq + 1)
						.contentEquals(".") == true)
					    periodNum_thisLine++;
				    }
				    totalPeriodNum = totalPeriodNum
					    + periodNum_thisLine;
				    if (totalPeriodNum < 2) {
					curRef = curRef + " " + line;
					nextIndex++;
					line = linesThisPage.get(nextIndex)
						.getText();
					periodNum_thisLine = 0;
				    } else {
					if (totalPeriodNum == 2) {
					    if (periodNum_thisLine == 1) {
						String lines = line.substring(
							0,
							line.indexOf(".") + 1);
						curRef = curRef + " " + lines;
						break;
					    }
					    if (periodNum_thisLine == 2) {
						String lines = line
							.substring(
								0,
								line.lastIndexOf(".") + 1);
						curRef = curRef + " " + lines;
						break;
					    }
					}
					/*
					 * totalPeriodNum>2. In this case,
					 * periodNum_thisLine will >=2
					 */
					else {
					    int firstDot = line.indexOf(".");
					    int secondDot = line.indexOf(".",
						    firstDot);
					    String lines = line.substring(0,
						    secondDot + 1);
					    curRef = curRef + " " + lines;
					    break;
					}
				    }
				}

				/*
				 * Looks up the previous period "."
				 */
				totalPeriodNum = 0;
				periodNum_thisLine = 0;
				String preRef = "";
				int preIndex = j;
				line = firstHalfLine;
				while (preIndex > 0) {
				    if ((k == tc.getPageId_thisTable())
					    && preIndex <= tc.getBodyEndLine()
					    && preIndex >= tc
						    .getBodyStartLine()) {
					break;
				    }
				    /*
				     * Gets the period number in line, if total
				     * period number < 2, get the whole line,
				     * otherwise, cut and break
				     */
				    for (int qq = 0; qq < line.length(); qq++) {
					if (line.substring(qq, qq + 1)
						.contentEquals(".") == true)
					    periodNum_thisLine++;
				    }
				    totalPeriodNum = totalPeriodNum
					    + periodNum_thisLine;
				    if (totalPeriodNum < 2) {
					preRef = line + " " + preRef;
					preIndex--;
					line = linesThisPage.get(preIndex)
						.getText();
					periodNum_thisLine = 0;
				    } else {
					/*
					 * No matter this line has 1 or 2 ".",
					 * we get the part after the first "."
					 */
					if (totalPeriodNum == 2) {
					    String lines = line.substring(
						    line.indexOf(".") + 1,
						    line.length());
					    preRef = lines + " " + preRef;
					    break;
					}
					/*
					 * totalPeriodNum>2. In this case,
					 * periodNum_thisLine will >=2
					 */
					else {
					    int lastDot = line.lastIndexOf(".");
					    int secondLastDot = line.substring(
						    lastDot).lastIndexOf(".");
					    String lines = line.substring(
						    secondLastDot + 1,
						    line.length());
					    preRef = lines + " " + preRef;
					    break;
					}
				    }
				}

				String thisReference = preRef
					+ thisTableCaptionBeginning + curRef;
				// thisReference =
				// tc.replaceAllSpecialChracters(thisReference);

				String referenceText = tc.getRefText()
					+ "\n In PAGE " + (k + 1) + ": ..."
					+ thisReference + "...";
				tc.setRefText(referenceText);
			    }
			}
		    }
		}// end for
	    }
	} else {
	    tc.setRefText("");
	}

    }
830711
public String getLabel(final String caption, final boolean captizliseFirstLetter) {
		if (captizliseFirstLetter) {
			return JKFormatUtil.capitalizeFirstLetters(getLabel(caption));
		} else {
			return getLabel(caption);
		}
	}