Пример #1
0
 /**
  * @param mixed $handler_id The ID of the handler.
  * @param Array $args The argument list.
  * @param Array &$data The local request data.
  */
 public function _handler_view($handler_id, array $args, array &$data)
 {
     midcom::get('auth')->require_valid_user();
     $this->_person = new org_openpsa_contacts_person_dba($args[0]);
     $data['view'] = midcom_helper_datamanager2_handler::get_view_controller($this, $this->_person);
     $this->add_breadcrumb('', $this->_person->get_label());
     $auth = midcom::get('auth');
     if ($this->_person->id == midcom_connection::get_user() || $auth->can_user_do('org.openpsa.user:manage', null, 'org_openpsa_user_interface')) {
         $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "edit/{$this->_person->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get("edit"), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/edit.png', MIDCOM_TOOLBAR_ENABLED => $this->_person->can_do('midgard:update'), MIDCOM_TOOLBAR_ACCESSKEY => 'e'));
         $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "delete/{$this->_person->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get("delete"), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/trash.png', MIDCOM_TOOLBAR_ENABLED => $this->_person->can_do('midgard:delete')));
         if (midcom_connection::is_user($this->_person)) {
             $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "privileges/{$this->_person->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n->get("permissions"), MIDCOM_TOOLBAR_ICON => 'midgard.admin.asgard/permissions-16.png', MIDCOM_TOOLBAR_ENABLED => $this->_person->can_do('midgard:privileges')));
         }
         $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "person/notifications/{$this->_person->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n->get("notification settings"), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock-discussion.png', MIDCOM_TOOLBAR_ENABLED => $this->_person->can_do('midgard:update')));
     }
     $this->bind_view_to_object($this->_person);
 }