Sisyphus

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • I managed to do this with a rewrite rule in .htacces #rewrite roule to handle qooxdoo resources RewriteRule ^resource/(.*)$ /elgg-qssite/mod/qssite_front_page/vendors/qssite/build/resource/$1 [R=301,NC,L]  Still don't know if it... view reply
  • I want to use qooxdoo as a graphical front end for my site. Right now I am writing a plugin to override the front page to serve the qooxdoo app instead of a html theme. So far it is working except for the static resources like...
    • I managed to do this with a rewrite rule in .htacces

      #rewrite roule to handle qooxdoo resources
      RewriteRule ^resource/(.*)$ /elgg-qssite/mod/qssite_front_page/vendors/qssite/build/resource/$1 [R=301,NC,L]

       Still don't know if it is the proper way but it is amazingly faster than the function in my original post.

      Generally, is it a good idea to dig through the .htaccess file?

  • Sisyphus replied on the discussion topic Is AMD going to be a requirement in later versions of elgg?
    @Matt Beckett: I don't want to use it as a CMS. The project is so custom that a simple CMS won't do. As to what I will gain, I hope knowledge, satisfaction and why not, some money. But, yes, it seems a lot of work and I already feel... view reply
  • Sisyphus added a new discussion topic Is AMD going to be a requirement in later versions of elgg? in the group Beginning Developers
    Hi, I am developing a website in elgg and I want to use the Dojo framework. That framework has it's own AMD loader which conflicts with the require.js that it is used by elgg. Still Dojo provides tools to use it with require.js and I did manage...
    • @Matt Beckett:

      I don't want to use it as a CMS. The project is so custom that a simple CMS won't do. As to what I will gain, I hope knowledge, satisfaction and why not, some money. But, yes, it seems a lot of work and I already feel slumped by it. I hope I can achieve it at the end. 

      @Evan Winslow

      I am not very experienced. I learn as I go. From what I read around is that one cannot use the minified version of one framework with the loader of another. They are incompatible. 

      Anyway it seems very early in my project to think about such things, especially maybe because I haven't reached yet to the part where I will need this kind of fine tuning. I asked mostly because I wanted to do some forward planning.

      Thank you all for your answers.

  • Sisyphus replied on the discussion topic How to change registration page of elgg?
    Many people suggest the profile manager plugin to do that. Alternatively if you want to get your hands dirty with code then I suggest you read this thread. But please read it all before you do anything.  Also this thread is very helpful view reply
  • Sisyphus replied on the discussion topic How to post a form using AJAX?
    Thank you guys. You are great :D view reply
  • Sisyphus replied on the discussion topic How to post a form using AJAX?
    Thanks for your answer. What I am trying to do is in my form to have the username field to be checked for availability and validated against a list of disallowed usernames. Then the browser would get a json response like {isValid:true}. Then that... view reply
  • Sisyphus replied on the discussion topic How to post a form using AJAX?
    Thank you Matt. I reread what I wrote and the meaning is totally different from what I intended to write.  Ismayil Kharedinov wrote that  there is a hook handler registered for 'forward','all' that checks if the action was... view reply
  • Sisyphus replied on the discussion topic How to post a form using AJAX?
    Thanks. It works. I am using dojo for javascript and it works great. But still I don't understand how server side works. I try to study the profile fields plugin but I can't even find where it does it's magic. Let's say that I... view reply
  • Sisyphus replied on the discussion topic How to post a form using AJAX?
    Thank you. I saw the Ajax comments plugin. I understand how to make the ajax request with javascript and how to expect it and what to do with it afterwards. My main confusion is on the server. I have no idea how to handle the request in the... view reply
  • Sisyphus added a new discussion topic How to post a form using AJAX? in the group Beginning Developers
    I need to submit the registration form using AJAX and retrieve the response using AJAX. I am looking through documentation and through comments in discussion and still can't understand. It seems that everybody somehow know how to do it and they...
    • Hello, I have similar question but it is not on register page. this is on Elgg 1.8

      I'm trying to have Announcements plugin (https://community.elgg.org/plugins/1579372) submit form via ajax. Just to note the form is displayed in fancybox in case that makes difference. I tried putting ajax code in plugin js file but it would not work so I moved the script code in the form itself.

      I have the form submitting via ajax using second suggestion by @ihayredinov but problem is that when submitted the list is not updated fully but only some data (missing title, etc.)

      Maybe it's because I should use "success: function(json) {" instead of "success: function(data) {" but not sure how to implement that. Tried adding some code to action file but did not work.

      Here is javascript code from the form:

      $(document).ready(function() {

      $('.elgg-form-announcements-save').live('submit', function(e) {

         //e.preventDefault();
      
         var $form = $(this);
      
         elgg.action($form.attr('action'), {
      
           data: $form.serialize(),
      
          success: function(data) {
      
            // check the status and do stuff
          //e.preventDefault();
            var river = $('ul.announcements_list');
                if (river.length < 1) {
                river.append(data.output);          } else {                
                $(data.output).find('li:first').hide().prependTo(river).slideDown(500);
            };
                        $.fancybox.close();
      
          }
      
         });
      
         return false; // prevent the form from submitting
       e.preventDefault();
      
      }); 
      });

      Here is the action file code I added:

      if ($announcement->save()) {
      elgg_clear_sticky_form('announcement');

      system_message(elgg_echo('announcement:save:success'));

      // added code

      if (elgg_is_xhr()) {
      $options = array( 'type' => 'object', 'subtype' => 'announcements', 'full_view' => false, 'pagination' => false, 'limit' => 1 );
      $newannouncement = elgg_list_entities($options); echo json_encode($newannouncement); }
      } else {

      Can someone suggest the best way to achieve this?

      Thank you so much.

    • Can someone suggest the best way to achieve this?

      Thank you so much.

  • Sisyphus replied on the discussion topic How to make available my own layout and view?
    Thanks. It seems it was a combination of mistakes. First is the elgg_view_page as you said and then the directory structure. This is the correct ├── manifest.xml ├── pages │   └── ssite_registration │       └──... view reply
  • Sisyphus replied on the discussion topic How to make available my own layout and view?
    Thank you. I changed to  $body = elgg_view_layout('register', array('content' => $content)); echo elgg_view_page($title, $body, 'register') but still I get a blank page. If I do... view reply
  • Sisyphus added a new discussion topic How to make available my own layout and view? in the group Beginning Developers
    I want to create a simple page for my registration form that will contain only my css and javascript. I want to do this because I want to load it in a dialog box. Unfortunately I can not make it use my view. Whatever I do elgg uses the default...
    • Thank you. I changed to 

      $body = elgg_view_layout('register', array('content' => $content));
      echo elgg_view_page($title, $body, 'register')

      but still I get a blank page. If I do it 

      echo elgg_view_page($title, $body);

      then it uses the default page shell which I don't want and still uses the pages/layouts/default which also I don't want. I want it to use my layout and my page shell.

    • Again...

      <?php

      //start_of_code

      $title = //your code here ;

      $content = //your code here ;

      $body = elgg_view_layout('register', array('content' => $content));
      echo elgg_view_page($title, $body);

      //end_of_code

      That's all.

      Also don't forget about ; at the string's ending

      RTFM

    • Thanks. It seems it was a combination of mistakes. First is the elgg_view_page as you said and then the directory structure. This is the correct

      ├── manifest.xml
      ├── pages
      │   └── ssite_registration
      │       └── register.php
      ├── README.md
      ├── start.php
      └── views
          └── default
              ├── page
              │   ├── layouts
              │   └── register.php
              └── register.php

       

      Unbelievable. I have been flipping for hours between the book and various FMs and missed that. Thanks a lot. You saved me from a lot of frustration. :)

  • Sisyphus replied on the discussion topic How to extend the registration form?
    Thanks. I saw the line // view to extend to add more fields to the registration form echo elgg_view('register/extend', $vars); and I was curious how to use that. Thank you for showing this. For my form I found this... view reply
  • Sisyphus replied on the discussion topic How to extend the registration form?
    Thanks. It is a very interesting plugin and I sure will find a use for it. But what I would like is to create my own plugin with my form. There are many fields that need custom validation so I am afraid a custom plugin is the way to go.... view reply
  • Sisyphus added a new discussion topic How to extend the registration form? in the group Beginning Developers
    I want to create a plugin to extend the registration form. Specificaly I want to add three extra fields, one for country, one for postal code and one for telephone number. I know that this can be done with the Profile Manager plugin. But I also want...
    • Thanks. It is a very interesting plugin and I sure will find a use for it.

      But what I would like is to create my own plugin with my form. There are many fields that need custom validation so I am afraid a custom plugin is the way to go. Unfortunately I am total begginer so I would like to know if there is a simple plugin or example that does something simmilar so I can adapt it in my own plugin.

       

    • With in the init function of your plugin, extend the registration form like

          elgg_extend_view('register/extend', 'my_plugin/registration_form_extension');

      create a file called registration_form_extension.php inside mod/my_plugin/views/default/my_plugin with the additional fields.

      Now you need to hook into the registration action and get the input fields and process it as per your needs.

       

    • Thanks. I saw the line

      // view to extend to add more fields to the registration form
      echo elgg_view('register/extend', $vars);

      and I was curious how to use that. Thank you for showing this.

      For my form I found this discussion https://community.elgg.org/discussion/view/839506/registration-page and I think this will be a better option as I want to change completely the form and I also want a bare html form so I can apply my own form. Also I found this thread https://community.elgg.org/discussion/view/891630/custom-registration-form that explains how to unregister the registration form and register mine. I hope this is still the correct way for 1.8

  • Sisyphus replied on the discussion topic How to create a library plugin?
    I found the elgg_set_plugin_setting() function. I think this is what I was looking.  view reply
  • Sisyphus replied on the discussion topic How to create a library plugin?
    Thanks a lot for your answer. But how do I make a variable, declared in one plugin, available to other plugins? Something like a global variable. Like in the code I wrote in the first post. That of cοurse doesn't work but is there such... view reply
  • Sisyphus added a new discussion topic How to create a library plugin? in the group Beginning Developers
    Sorry if this question may sound silly but I am searching and I can't find an answer nor any example. Let's say I have a library that contains various js files or css or even icons. I want to write various plugins that take advantage various...
    • For php libraries:

      elgg_register_library('my_library', 'path/to/file.php');

      Then in the other plugins you can call:

      elgg_load_library('my_library');

       

      Sounds like you already know how to do the js/css

      It's insignificant overhead to register the libraries, so I would say register them in your library plugin then let other plugins do the loading as needed.

    • Thanks a lot for your answer. But how do I make a variable, declared in one plugin, available to other plugins? Something like a global variable. Like in the code I wrote in the first post. That of cοurse doesn't work but is there such possibility?

      Another option I am thinking is to have in my mod directory a folder named eg: mod/vendors/my_icon_lib-1.0.2 and a soft link to that folder named mod/vendors/my_icon_lib and every plugin that needs stuff from that library considers given that there will be that folder mod/vendors/my_icon_lib which points to the correct version. And every time the lib is updated to a new version I just update the ln -s.

      But I don't know if this is a correct way to do it or if this is a hack and there are better ways.

    • I found the elgg_set_plugin_setting() function. I think this is what I was looking.