Comment to 'events creation in groups'
  • Thanks! I actually discovered that earlier today and got it working, to make events for a particular group. As other people have commented, it is quite an unnatural UI experience. A more natural experience is to have a button that "while viewing a group, creates an event FOR THAT GROUP that you're viewing".

    I'm now looking into writing php code that works with UNA, and have been reading some of the documentation. There's a lot missing from the documentation, or I haven't found it? I looked at the wiki in github under /unacms/una/wiki, /unaio/una-vendor-test/wiki, and /unaio/una/wiki/

    The "sample vendor-test" example is too basic, and doesn't show how to do anything complex. I figured I should read the code for one of the modules, but most of them seem too complicated. Is there a simple module that I can look at without getting lost?

    Also,

    1. is there a way, in a page block php code, to find a "context"? For example, determine if the page the service block is in is "view-group", and get the group-id that is being viewed? Perhaps I want to fetch some info for that group from my own table, and display it in the block;

    and 2. is there a way for blocks to communicate with other blocks on the page, maybe block 1 puts some info (for example, the group id) into a global array that block 2 can check?

    • The best way in UNA to work with the "entry unit" page is to create the child of the BxBaseModProfilePageEntry class (the modules\base\profile\classes\BxBaseModProfilePageEntry .php file). In the beginning it has the detection of the current unique identification parameter.

      // get profile info
          $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
          $iContentId = 0;
          if ('mine' == bx_get('id')) {
            $o = BxDolProfile::getInstance();
            if ($o && $iContentId = $o->getContentId())
              $_GET['id'] = $_REQUEST['id'] = $iContentId;
          } else {
            $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
          }
      
          if ($iProfileId)
            $this->_oProfile = BxDolProfile::getInstance($iProfileId);
      
          if (!$this->_oProfile && $iContentId)
            $this->_oProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->MODULE);
      
          if ($this->_oProfile) {
            $this->_aProfileInfo = $this->_oProfile->getInfo();
            $this->_aContentInfo = $this->_oModule->_oDb->getContentInfoById($this->_aProfileInfo['content_id']);
          }
      

      So then your child class may use the

      $this->_aProfileInfo['content_id']
      

      or

      $this->_oProfile->id()
      

      elements in all blocks for the "entry" page of your module.