We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    Hi Laurent, I’ll check this out but I am curious about what didn’t work before ?

    I run ManagerManager with PHP 5.2.3 : no issue so far...
      .: COO - Commerce Guys - Community Driven Innovation :.


      MODx est l'outil id
      • 16732
      • 592 Posts
      @david : I had the same error as Zi and stefan regarding the "if (function_exists("mm_default"))" under PHP 5.2.0
        • 6726
        • 7,075 Posts
        Not an issue with PHP 5.2.3 as far as I can tell, but I’ll definitely check that out !
        Anyway, thanks for the PHP5 patch smiley
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 5091
          • 332 Posts
          It doesn’t work for me either. I first used the original version and was getting the same result Zi’s was getting. Change to Laurentc’s version as my PHP is 5.2.2, login as ’editor’, the error is gone but I do’t see anything different.

            • 16732
            • 592 Posts
            Could you put your plugin content with for my version ?

            Do you have checked all the event as the original one ?
              • 5091
              • 332 Posts
              This is what I have and yes, the "system events" is the first thing I checked:

              // ManagerManager plugin v0.2.4
              // See readme.htm for licensing and installation instructions


              // The URL to the Jquery library. Leave blank and it will use the one available from jquery.com
              // or if you want more control, specify your own local copy (e.g. http://www.yoursite.com/assets/js/jquery.js)
              $js_url = ’’;



              // You don’t need to change anything else from here
              // Get the main code
              $asset_path = $modx->config[’rb_base_dir’].’plugins/managermanager/’;
              include_once($asset_path.’mm.class.inc.php’);
              $mm = new mm();

              $mm_actions = "
              // ------------------------ INSERT YOUR RULES HERE --------------------
              \$mm->mm_hideFields(’longtitle’);
              \$mm->mm_hideFields(’menutitle’);
              // ------------------------ END OF RULES --------------------
              ";

              include($asset_path.’mm.inc.php’);
                • 5091
                • 332 Posts
                Hi Lauren, sorry my bad!!!! I think your version is working, although very basic (but I guess this is because I didn’t add any reules grin )
                Right now the only place I see it’s working is in the ’create/edit plugin’ area, where it added a ’roles and templates’ tab

                And I can see it from admin as well as ’editor’ login.

                  • 33175
                  • 711 Posts
                  This is a very great plugin ! I need it ! I love it !
                  Thanks for ManagerManager smiley

                  ... but I have the same problem as davidm.
                  I use Modx 0.96, ManagerManager 0.2.4 (2007-08-02) and PHP 5.1.2.

                  I sought a little and now I can propose a solution.
                  In some lines, I modified this :
                  if (function_exists("mm_default")) {
                  	return;
                  }
                  
                  // Sets a default value for a field when creating a new document
                  function mm_default($field, $value='', $roles='', $templates='', $eval=false) { 
                  ...
                  }

                  by that
                  if (!function_exists("mm_default")) {
                      // Sets a default value for a field when creating a new document
                      function mm_default($field, $value='', $roles='', $templates='', $eval=false) {
                  ...
                  }

                  I made the same thing for each function of mm.inc.php, and then, I moved these functions enters
                  $mm_fields = array(
                  ...
                  );

                  and
                  // Check the current event
                  global $e;
                  

                  All seems to go perfectly.

                  A few seconds later :
                  In enclosure, the modified file which I use
                    Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
                    • 7455
                    • 2,204 Posts
                    When i use \$mm->mm_createTab(’Engels’, ’tabengels’); all my tabs are gone.

                    There is a big void and then when I scroll I see the tv’s i use but the whole tab row is gone.

                    And I do not see the extra tab when I edit the plugin and in both cases I get the same error:

                    Fout: unterminated string literal
                    Bronbestand: http://www.eomdata.nl/manager/index.php?id=9&a=102
                    Regel: 442, Kolom: 27
                    Broncode:
                    $('div#'+mm_lastTab).after('


                    this is the part te error is taking about:
                    <script src="http://code.jquery.com/jquery-latest.pack.js" type="text/javascript" charset="utf-8"></script><script type="text/javascript">
                    mm_lastTab = 'tabEvents'; 
                     // ----------- Create tab -------------- 
                    $('div#'+mm_lastTab).after('
                            <div class="tab-page" id="tabrolestemplates">
                            <h2 class="tab">Roles & Templates</h2>
                            <div class="tabIntro" id="tab-intro-rolestemplates"><p>These are the IDs for current roles and templates in your site.</p><table><tr><th class="gridHeader">Template name</th><th class="gridHeader">Template description</th><th class="gridHeader">ID</th></tr><tr><td class="gridItem">(blank)</td><td class="gridItem">Blank</td><td class="gridItem">0</td></tr><tr><td class="gridAltItem">basic</td><td class="gridAltItem"></td><td class="gridAltItem">3</td></tr><tr><td class="gridItem">blog</td><td class="gridItem"></td><td class="gridItem">6</td></tr><tr><td class="gridAltItem">home</td><td class="gridAltItem"></td><td class="gridAltItem">4</td></tr></table><p> </p><table><tr><th class="gridHeader">Role name</th><th class="gridHeader">ID</th></tr><tr><td class="gridAltItem">Administrator</td><td class="gridAltItem">1</td></tr><tr><td class="gridItem">Testpersoon</td><td class="gridItem">2</td></tr><tr><td class="gridAltItem">webmaster</td><td class="gridAltItem">3</td></tr></table></div>
                            <table width="450" border="0" cellspacing="0" cellpadding="0" id="table-rolestemplates">
                            </table>
                            </div>
                            '); 
                    mm_lastTab = 'tabrolestemplates'; 
                    tpSnippet.addTabPage( document.getElementById( "tabrolestemplates" ) ); 
                    </script>


                    i use php 4.3.2 5.1.2 I get the same results with the version from the repository and the adapted version by laurentc

                    I really like to be able to use this great tool. does any of you have any idea what this could be?

                    Dimmy
                      follow me on twitter: @dimmy01
                      • 7455
                      • 2,204 Posts
                      mm ok fixed it by applying this change http://modxcms.com/forums/index.php/topic,16948.msg110046.html#msg110046 to the class file.

                      Dimmy
                        follow me on twitter: @dimmy01

                      This discussion is closed to further replies. Keep calm and carry on.