<?php
class XenCrea_Colorize_Model_GetNodes extends XenForo_Model
{
public function getNodesOptions($selectedNodesId)
{
$nodes[] = array(
'label' => $node['title'],
'value' => 'yourBlankValue',
'selected' => ('yourBlankValue', $selectedNodesIds)
);
foreach ($this->getDbNodes() AS $node)
{
$nodes[] = array(
'label' => $node['title'],
'value' => $node['node_id'],
'selected' => ($node['node_id'] == $selectedNodesId)
);
}
return $nodes;
}
public function getDbNodes()
{
return $this->_getDb()->fetchAll('
SELECT node_id, title, node_type_id
FROM xf_node
WHERE node_type_id = ?
ORDER BY node_id
', 'Category');
}
}