Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • Simone replied on the discussion topic How handle required JS file
    Because I need that this will be an amd module. As you suggest I can implement this creating a module that make an ajax call to an action page, that can generate the right content, and store the ajax response in module variable... my problem... view reply
  • Simone replied on the discussion topic How handle required JS file
    My explanations wasn't clear, sorry... For Example in myplugin/rewrite/myamd.php something like: <?php if (elgg_is_admin_logged_in()) { $write = '{"msg":"admins", "data":"data that only... view reply
  • Simone replied on the discussion topic How handle required JS file
    Not exactly... my goal is use hybrid php-javascript amd module.  I know what you suggest but according to documentations,  using elgg_register_simplecache_view:  If the view is called by... view reply
  • Simone added a new discussion topic How handle required JS file in the group Elgg Technical Support
    Dear group, I've regularly registered a amd plugin, say in myplugin/rewrite/myamd.js . Now I need improve this with some php, so I've tried the follow: renamed myamd.js in myamd.php and then add some php code to echo my...
    • My explanations wasn't clear, sorry...

      For Example in myplugin/rewrite/myamd.php something like:

      <?php
      
      if (elgg_is_admin_logged_in()) {
         $write = '{"msg":"admins", "data":"data that only admin can receive as required plugin", "time":"' . time() . '"}';
      } else {
         $write = '{"msg":"admins", "data":false, "time": "' . time() . '"';
      }echo "define($write);"

      as you can see I need elgg usage to check if is admin an generate content on the fly since the time must be updated every call (that' a simple example, but substantially I need this skill to improve my complex goal), therefore content can't be stored in chache.

      Since requirejs can load only ".js" extension file, I use the .htaccess in my first post to rewrite the ".php" in ".js";

       

    • Is there a reason why the logic needs to be in the javascript file?

      Why not e.g. fetch the needed data via AJAX, checking the user's role on server side, and providing the response based on it?

      Or include the data to the page (html) already when it is being rendered on server side?

    • Because I need that this will be an amd module.

      As you suggest I can implement this creating a module that make an ajax call to an action page, that can generate the right content, and store the ajax response in module variable... my problem isn't achieve my purpose in some exotic manner, but if I could reach exactly my goal, with the method I've explained.

      Anyway, thanks for all reply... I hope to reach my goal!

  • Simone added a new discussion topic login from page with IP or DNS in the group Elgg Technical Support
    I've a Virtual Host with ip xxx.xxx.xxx.xxx where i've installed and developed Elgg. I've bought a DNS, say "example.com" (A host), and associate it to xxx.xxx.xxx.xxx . I can navigate without problems but... in one php...
  • Simone added a new discussion topic How list all entitie's metadata in the group Beginning Developers
    I've a plugin that add particular metadata to an user, each with particular name. For example I retrieve a $user via guid, than I set to it a metadata via a $parameter and assign a $foo value:   $user->{$param.'Face'} =...
  • Simone replied on the discussion topic extend other plugin's view
    Ohhhh thanks!! I thought that for other plugin's view I need a special path... now I'm feel a little noob :-)   Cordially, Simone view reply
  • Simone added a new discussion topic extend other plugin's view in the group Elgg Technical Support
    Hi, with "myplugin" I would like extend the "profile/wrapper" view of "profile" plugin, but my problem is that I don't know how extend other's plugin views. Someone can help me?   thanks