hey,
I'm trying to extend the XenForo_ControllerAdmin_UserGroupPromotion class to add a variable to my MyAddon_user_criteria template which gets included into the user_group_promotion_edit template but it doesn't get executed. (Using load_class_controller)
What is the issue here?
I'm trying to extend the XenForo_ControllerAdmin_UserGroupPromotion class to add a variable to my MyAddon_user_criteria template which gets included into the user_group_promotion_edit template but it doesn't get executed. (Using load_class_controller)
What is the issue here?
PHP:
<?php
class MyAddon_ControllerAdmin_UserGroupPromotion extends XFCP_MyAddon_ControllerAdmin_UserGroupPromotion
{
public function actionIndex()
{
$db = new Zend_Db_Adapter_Pdo_Mysql(array(
'host' => 'localhost',
'port' => '8889',
'username' => 'root',
'password' => 'root',
'dbname' => 'test'
));
$sql = 'SELECT `group` FROM `table`';
$result = $db->fetchCol($sql);
$viewParams = array(
'MyAddon_groups' => serialize($result)
);
return $this->responseView('MyAddon_ControllerAdmin_UserGroupPromotion', 'MyAddon_user_criteria', $viewParams);
}
}
PHP:
<?php
class MyAddon_Listener_Controller
{
public static function extendController($class, array &$extend)
{
if ($class == 'XenForo_ControllerAdmin_UserGroupPromotion')
{
$extend[] = 'MyAddon_ControllerAdmin_UserGroupPromotion';
}
}
}