Source for file TableCell.php
Documentation is available at TableCell.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* Created on 04. Jan. 2007 by Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This software consists of voluntary contributions made by many individuals
* and is licensed under the GPL. For more information please see
* <http://opendocumentphp.org>.
* $Id: TableCell.php 250 2007-07-31 08:52:06Z nmarkgraf $
* @package OpenDocumentPHP
* @subpackage content_body_table
* @author Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
* @copyright Copyright in 2006, 2007 by The OpenDocumentPHP Team
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License 2.0.
* @version SVN: $Id: TableCell.php 250 2007-07-31 08:52:06Z nmarkgraf $
* @link http://opendocumentphp.org
* @since 0.5.0 - 08. Feb. 2007
require_once 'OpenDocumentPHP/OpenDocumentArchive.php';
require_once 'OpenDocumentPHP/util/Namespaces.php';
require_once 'OpenDocumentPHP/util/ODPElement.php';
* @package OpenDocumentPHP
* @subpackage content_body_table
* @author Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
* @copyright Copyright in 2006, 2007 by The OpenDocumentPHP Team
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License 2.0.
* @version Release: @package_version@
* @link http://opendocumentphp.org
* @since 0.5.0 - 08. Feb. 2007
* @todo This class is highly experimental, outdated and should be updated soon.
* @var integer $spannedRows Numbers of spanned rows
* @var integer $spannedCols Number of spanned columns
* @var integer $decimal Number of decimals of a number.
parent::__construct('table:table-cell', '', self::TABLE);
$this->content = $content;
* Set a hyperlink with text $content and URI $link into a cell
* @param string $link URI of the hyperlink where it links to
* @param string $content text of the hyperlink which is displayed.
* @since 0.6.0 - 25. Jul. 2007
$this->content = $content;
$this->type = 'hyperlink';
* @todo NOT IMPLEMENTED NOW
* @todo NOT IMPLEMENTED NOW
* @todo NOT IMPLEMENTED NOW
if (isset ($this->type)) {
$content = $this->content;
$content = $this->content;
$this->root->setAttributeNS(self :: TABLE, 'table:number-rows-spanned', $this->getSpannedRows());
$this->root->setAttributeNS(self :: TABLE, 'table:number-columns-spanned', $this->getSpannedCols());
$this->root->setAttributeNS(self :: OFFICE, 'office:value-type', $type);
$this->root->setAttributeNS(self :: OFFICE, 'office:value', $content);
$text = $this->domFragment->createElementNS(self :: TEXT, 'text:p', $content);
$this->root->appendChild($text);
$this->root->setAttributeNS(self :: OFFICE, 'office:value-type', 'string');
$text = $this->domFragment->createElementNS(self :: TEXT, 'text:p');
$anchor = $this->domFragment->createElementNS(self::TEXT, 'text:a', $content);
$anchor->setAttributeNS(self::XLINK, 'link:href', $this->link);
$text->appendChild($anchor);
$this->root->appendChild($text);
$this->root->setAttributeNS(self :: OFFICE, 'office:value-type', 'string');
$text = $this->domFragment->createElementNS(self :: TEXT, 'text:p', $content);
$this->root->appendChild($text);
|