• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Data missing in list page of custom module

M

MiriamK

Guest
Hi,

I am new to plesk module development. I have a new requirement to develop a module for listing and selecting some items. I have used the following code to list the items.
--------------------------------------------------------------------------------
file: mylist.php
<?php
class mylist extends pm_cList {
function fetchmylist() {

$this->columns_ = array();
$this->list_ = array();

$this->columns_ = array(
'0' => array('name' => 'ItemName', 'sort' => 'ItemName'),
);

$productslist = db_query('SELECT ItemName FROM module_my_items');
while($row = db_fetch_assoc($productslist)) {
$this->list_[] = $row;
}
function ItemNameGet() {

}
}
?>
My list_ array is:
Array
(
[0] => Array
(
[ItemName] => item 1
)

[1] => Array
(
[ItemName] => item 2
)
............
)


--------------------------------------------------------------------------------
In index.php, I use the following code to fetch the list which is assigned to the template variable for display.

$list = new mylist;
$list->setFSP('setPage');
$list->init();
$listdisplay = $list->get();
--------------------------------------------------------------------------------

When I run this code I am getting the "list template" correctly. I mean only the template structure is shown, with no data listed. When I debugged the code, I could see that the count of table rows and the column headings are correct. Please let me know which function do I need to call, otherthan $list->get(), to get the listing correctly. I could not trace which function will display the item names.

Thank you,
Miriam
 
Back
Top