setClass ('list-item'); $this->setListItemLevel ($level); } /** * Return the elements name. * * @return string The ODT XML element name. */ public function getElementName () { return ('text:list-header'); } /** * Return string with encoded opening tag. * * @return string The ODT XML code to open this element. */ public function getOpeningTag () { return ''; } /** * Return string with encoded closing tag. * * @return string The ODT XML code to close this element. */ public function getClosingTag () { return ''; } /** * Are we in a paragraph or not? * As a list item we are not. * * @return boolean */ public function getInParagraph() { return false; } /** * Determine and set the parent for this element. * As a list item the list element is our parent. * * @param ODTStateElement $previous */ public function determineParent(ODTStateElement $previous) { while (isset($previous)) { if ($previous->getClass() == 'list') { break; } $previous = $previous->getParent(); } $this->setParent($previous); } /** * Set the level for an list item * * @param integer $value */ public function setListItemLevel($value) { $this->list_item_level = $value; } /** * Get level of a list item * * @return integer */ public function getListItemLevel() { return $this->list_item_level; } /** * Return the list to which this list item belongs. * * @return ODTStateElement */ public function getList () { return $this->getParent(); } }