Benaesan

About me: Web Developer, interested in new technologies.
Location:

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

  • Beginning Developers

    Beginning Developers

    This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking
  • Professional Services

    Professional Services

    Get / offer professional help on Elgg; like customization, design, development, setup, hosting... Illegal trades are not allowed.
  • Plugin Development

    Plugin Development

    Talking about how to write plugins

Activity

  • Benaesan replied on the discussion topic Disable fontawesome
    Wow, Thanks a lot. But the RvR way is a little bit too much,  I need some icons (social networks, etc.) I'll check this. that was exactly what i'm looking for. Have a good day view reply
  • Benaesan added a new discussion topic Disable fontawesome in the group Beginning Developers
    Hello everyone, I've a problem with fontawesome. I have to migrate a custom theme that work fine with Elgg 1.10 to Elgg 2.3. But Icons are duplicate and stacked. This theme have image as icons, and there is a fontawesome character on...
  • Benaesan replied on the discussion topic Problem with notification url
    Thanks for the reply. I have fixed some of my problem. I've had update_subtype("object", "mySubtype", "MyClass");so the river have the right content, Benaesan a créer le tableau test_tab1 dans le groupe test groupe fermé il y a 7 minutesBut in... view reply
  • Benaesan replied on the discussion topic Problem with notification url
    Really, no one? view reply
  • Benaesan added a new discussion topic Problem with notification url in the group Beginning Developers
    Hello, I've made a plug-in for my company, that work fine but there is still a problem. I have notification issues that i don't understand. On a specific object creation, a notification is made, and the text is correct :...
    • Not enough information to give any advice.

      For the cited text I guess you are asking about the links in the title line of a river entry (activity page) and not about (site) notifications. Or am I wrong?

      If it's a river entry that has a wrong link, what's the code snippet (elgg_create_river_item() arguments) you use? Is the object_guid wrong here. And what about the river view corresponding to the created object? Are you sure you have no error there - what is the code of the view?

      Or is it really a notification you are asking about? Have you added any code for handling of the notification content then? If so, what's the code?

    • Thanks for the reply. I have fixed some of my problem. 

      I've had update_subtype("object", "mySubtype", "MyClass");

      so the river have the right content, 

      Benaesan a créer le tableau test_tab1 dans le groupe test groupe fermé il y a 7 minutes

      But in notification(By mail or by the notifier plugin) the text is

      subject => "Notification à propos de Benaesan"

      body => Voir la nouvelle activitée sur http://localhost/elgg_dev/obj/757 

      That seem to be a generical text, I don't understand why.

      In my Log file

      [13-Apr-2017 15:37:40 Europe/Paris] NOTICE: Missing English translation for "river:create:object:" language key[13-Apr-2017 15:37:40 Europe/Paris] NOTICE: Results for the notification event create:object:: Array(    [36] => Array        (            [email] =>             [notifier] =>             [site] =>         )    [111] => Array        (            [email] => 1            [notifier] => 1            [site] => 1        ))

       

    • It's best to use add a notification handler function to be able to set up the notification text for on-site and email notifications as you want it to be. If the handler functions is not added, Elgg most likely uses some fallback option to send out notifications that might not be fit 100% in all cases.

      As a sidenote: for the river entries you would have to add a language string to the language file(s) of your plugin with the subtype of the object created in the key like

      "river:create:object:mySubtype" => "%s added a new item %s",

      with the %s placeholders which will get replaced by the user's name and the link to the new content item.

      As for the notification handler you can look for example in start.php of the blog plugin or other plugins how to register for the notification event (in your case the "create" event) and how to add the notification handler function. In the init function you would add

      // notifications
      elgg_register_notification_event('object', 'mySubtype', array('create'));
          elgg_register_plugin_hook_handler('prepare', 'notification:create:object:mySubtype', 'mySubtype_prepare_notification');

      And then the function

      function mySubtype_prepare_notification($hook, $type, $notification, $params) {
          $entity = $params['event']->getObject();
          $owner = $params['event']->getActor();
          $recipient = $params['recipient'];
          $language = $params['language'];
          $method = $params['method'];
      
          $notification->subject = elgg_echo('mySubtype:notify:subject', array($entity->title), $language);
          $notification->body = elgg_echo('mySubtype:notify:body', array(
              $owner->name,
              $entity->title,
              $entity->getExcerpt(),
              $entity->getURL()
          ), $language);
          $notification->summary = elgg_echo('mySubtype:notify:summary', array($entity->title), $language);
      
          return $notification;
      }

      You also need to add the language strings used in the handler function.

  • Benaesan joined the group Professional Services
  • Benaesan replied on the discussion topic Javascript in Elgg 1.12.12
    Yeah thank Ismayil,  I've just to move the module.php code to /js/module.php.   view reply
  • Benaesan replied on the discussion topic Javascript in Elgg 1.12.12
    Thanks a lot for your reply. I've tried the two methods but that doesn't work, but I've get another error message. "Raphael not defined", but the source is present in my developers tool in Firefox,  and it's work in... view reply