I try to create a list (Enumerations) and then at some point indent and use a Numberings list.This leads to a corrupted document that cannot be opened.
The documentations says: "They can be nested.". But they can't be nested with each other as far as i see.
Example:
<?php
// first level unordered list
$list = new PHPRtfLite_List_Enumeration($rtf);
$list->addItem('hello world');
$list->addItem('foo');
$list->addItem('bar');
// second level numbering
$subNumList = new PHPRtfLite_List_Numbering($rtf);
$subNumList->addItem('hello world');
$subNumList->addItem('foo');
$subNumList->addItem('bar');
$list->addList($subNumList);
// add item in the first level
$list->addItem('foobar');
$section = $rtf->addSection();
// add numbering to a section
$section->addNumbering($list);
I didn't run your code, yet, but by looking at it I was wondering why you creating an enumeration and adding it as numbering ($section->addNumbering($list))?
Should be: $section->addEnumeration($list);
If this solves your problem, please let me know so I can close this ticket.
May be it would be more useful to offer an addList() method instead of addEnumeration() and addNumbering()
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Hi!
No this doesn't solve the problem. The exact error is:
Notice: Undefined property: PHPRtfLite_List_Enumeration::$_prefix in /Users/Shared/ApacheSites/test/apps/cms/lib/PHPRtfLite/List.php on line 226
Fatal error: Call to undefined method PHPRtfLite_List_Enumeration::getNumber() in /Users/Shared/ApacheSites/test/apps/cms/lib/PHPRtfLite/List.php on line 226
Last edit: Anonymous 2016-01-28
Fixed that, please use release PHPRtfLite 1.2. Thanks for the report.