public function addDefaultPages() { $request = Zend_Controller_Front::getInstance()->getRequest(); $id = $request->getInt('id', $request->getInt('user_id')); if (!$id && $request->getInt('_u_id')) { $id = $request->getInt('_u_id'); } if (!$id && $request->getParam('_u_a') == 'insert') { $id = 'insert'; } if (!$id) { throw new Am_Exception_InputError("Could not find out [id]"); } $userUrl = REL_ROOT_URL . '/admin-users?'; if ($action = $request->getFiltered('_u_a', 'edit')) { $userUrl .= "_u_a={$action}&"; } if ($a = $request->getFiltered('_u_id', $id)) { $userUrl .= "_u_id={$a}"; } $this->addPage(array('id' => 'users', 'uri' => $userUrl, 'label' => ___('User Info'), 'order' => 0, 'disabled' => $id <= 0, 'active' => $request->getFiltered('_u_id', false)))->addPage(array('id' => 'payments', 'label' => ___('Payments'), 'controller' => 'admin-user-payments', 'params' => array('user_id' => $id), 'order' => 100, 'resource' => 'grid_payment'))->addPage(array('id' => 'access-log', 'label' => ___('Access Log'), 'controller' => 'admin-users', 'action' => 'access-log', 'params' => array('user_id' => $id), 'order' => 200, 'resource' => Am_Auth_Admin::PERM_LOGS)); $event = new Am_Event_UserTabs($this, $id <= 0, (int) $id); $event->run(); /// workaround against using the current route for generating urls foreach (new RecursiveIteratorIterator($this, RecursiveIteratorIterator::SELF_FIRST) as $child) { if ($child instanceof Zend_Navigation_Page_Mvc && $child->getRoute() === null) { $child->setRoute('default'); } if ($id <= 0) { $child->set('disabled', true); } } }
function onUserTabs(Am_Event_UserTabs $event) { if ($event->getUserId() > 0) { $event->getTabs()->addPage(array('id' => 'cc', 'module' => 'cc', 'controller' => 'admin', 'action' => 'info-tab', 'params' => array('user_id' => $event->getUserId()), 'label' => ___('Credit Cards'), 'order' => 900, 'resource' => 'cc')); foreach ($this->getPlugins() as $ps) { if ($ps instanceof Am_Paysystem_Echeck) { $event->getTabs()->addPage(array('id' => 'cc', 'module' => 'cc', 'controller' => 'admin', 'action' => 'info-tab-echeck', 'params' => array('user_id' => $event->getUserId()), 'label' => ___('Echeck'), 'order' => 901, 'resource' => 'cc')); break; } } } }
function onUserTabs(Am_Event_UserTabs $event) { $event->getTabs()->addPage(array('id' => 'helpdesk', 'module' => 'helpdesk', 'controller' => 'admin-user', 'action' => 'index', 'params' => array('user_id' => $event->getUserId()), 'label' => ___('Tickets'), 'order' => 1000, 'resource' => 'helpdesk')); }
function onUserTabs(Am_Event_UserTabs $event) { if ($event->getUserId() > 0) { $event->getTabs()->addPage(array('id' => 'cc', 'module' => 'cc', 'controller' => 'admin', 'action' => 'info-tab', 'params' => array('user_id' => $event->getUserId()), 'label' => ___('Credit Cards'), 'order' => 900, 'resource' => 'cc')); } }
function onUserTabs(Am_Event_UserTabs $event) { if ($event->getUserId() > 0) { $user = $this->getDi()->userTable->load($event->getUserId()); if ($user->is_affiliate > 0) { $event->getTabs()->addPage(array('id' => 'aff', 'uri' => '#', 'label' => ___('Affiliate Info'), 'order' => 1000, 'resource' => self::ADMIN_PERM_ID, 'pages' => array(array('id' => 'aff-stat', 'module' => 'aff', 'controller' => 'admin', 'action' => 'info-tab', 'params' => array('user_id' => $event->getUserId()), 'label' => ___('Statistics'), 'resource' => self::ADMIN_PERM_ID), array('id' => 'aff-subaff', 'module' => 'aff', 'controller' => 'admin', 'action' => 'subaff-tab', 'params' => array('user_id' => $event->getUserId()), 'label' => ___('Sub-Affiliates'), 'resource' => self::ADMIN_PERM_ID), array('id' => 'aff-comm', 'module' => 'aff', 'controller' => 'admin', 'action' => 'comm-tab', 'params' => array('user_id' => $event->getUserId()), 'label' => ___('Commissions'), 'resource' => self::ADMIN_PERM_ID), array('id' => 'aff-payout', 'module' => 'aff', 'controller' => 'admin', 'action' => 'payout-tab', 'params' => array('user_id' => $event->getUserId()), 'label' => ___('Payouts'), 'resource' => self::ADMIN_PERM_ID)))); } } }
function onUserTabs(Am_Event_UserTabs $event) { extract($this->getDi()->db->selectRow("SELECT COUNT(*) AS cnt_all,\n COUNT(IF(status IN ('new', 'awaiting_admin_response'), ticket_id, NULL)) AS cnt_open\n FROM ?_helpdesk_ticket WHERE user_id=?", $event->getUserId())); $event->getTabs()->addPage(array('id' => 'helpdesk', 'module' => 'helpdesk', 'controller' => 'admin-user', 'action' => 'index', 'params' => array('user_id' => $event->getUserId()), 'label' => ___('Tickets') . sprintf(' (%s)', $cnt_all ? $cnt_open . '/' . $cnt_all : 0), 'order' => 1000, 'resource' => self::ADMIN_PERM_ID)); }