We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21056
    • 327 Posts
    I didn’t bother supporting this because you can set the default value for searchable / cacheable / etc site-wide in the site configuration options.

    Is your scenario that you want a default value ONLY for certain templates or users?
      Author: ManagerManager plugin - customise your ModX manager interface

      Rckt - web development, Sheffield, UK
      • 28436
      • 242 Posts
      Hello ncrossland,

      Is your scenario that you want a default value ONLY for certain templates or users?

      Yes, right. The default is searchable, but some documents, editable by a user should not be searchable.
      And you know, if you give the editor the responsibility to uncheck this box for this kind of documents, he or she will destroy the "searching-plan". smiley involuntary of course.

      ok, dont feel bothered by me, i found some(a huge amount of) examples to get the attributes of a element and how to get the values of it. I have absolutly no experience with the jquery library and so i make out this
      case 'searchable':
          $new_value = ($new_value=='') ? 0 : $new_value;
          $output .= '$("input[@name=searchable]").val("'.(int)$new_value.'"); '."\n";
          $output .= '$("input[@name=searchablecheck]").attr("checked",""); '."\n";
      break;
      

      It works and i hope its not a hap that it do the job.


      Another thing is maybe more intresting for you.
      I run the plugin on a php5 machine an got the "redeclare" Error.

      It seems, that this condition no work correctly
      if (function_exists("mm_default")) {
      	return;
      }


      The way to solve this error was wrapping all functions by this way
      if( !function_exists( "mm_default" ) )
      {
          function mm_default() {}
      }
      


      of course, this will destroy your nice overview at the pluginpage.
      I solve this by copying the three functions mm_createTab, useThisRule and makeArray to the "elseif"-block "OnPluginFormRender".

      damnit, this looks not really smart... who cares, that is the results of the last night and its absolutly in the range of possibilities that iam be on the wrong way.

      ciao, Stefan
        • 6726
        • 7,075 Posts
        Late reply (getting back from Holidays) but what a nice plugin !
        It’s gonna be one of the first I’ll rush to install and try out... thanks for the contrib’ !
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 33337
          • 3,975 Posts
          Fatal error: Cannot redeclare mm_default() (previously declared in D:\xampp163a\htdocs\ccz\assets\plugins\managermanager\mm.inc.php:200) in D:\xampp163a\htdocs\ccz\assets\plugins\managermanager\mm.inc.php on line 231
          


          Firefox 2, PHP 5.2.3

          .. and half screen is wiped out also.
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 21056
            • 327 Posts
            Quote from: zi at Aug 27, 2007, 04:22 PM

            Fatal error: Cannot redeclare mm_default() (previously declared in D:\xampp163a\htdocs\ccz\assets\plugins\managermanager\mm.inc.php:200) in D:\xampp163a\htdocs\ccz\assets\plugins\managermanager\mm.inc.php on line 231
            


            Firefox 2, PHP 5.2.3

            .. and half screen is wiped out also.

            I think this is a PHP5 issue. Will require some testing.
              Author: ManagerManager plugin - customise your ModX manager interface

              Rckt - web development, Sheffield, UK
              • 33337
              • 3,975 Posts
              Okay, I am waiting wink ... good luck friend.
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 7923
                • 4,213 Posts
                @zi / ncrossland,
                Is there some reason why you cannot what stefan said above? eg. wrap the whole function in if( !function_exists( "mm_default" ) ) condition.. or implement a class.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 22098
                  • 218 Posts
                  Hello,

                  excellent plugin! tnx!
                  But it seems hiding the preview tab doesn’t work?
                  we use 0.9.6 with dutch language settings...

                  this is the call:

                  mm_hideTabs(’settings,preview’, ’!1’);

                  the settings-tab is hidden, but the preview not..

                  cheers, Olaf
                    • 6726
                    • 7,075 Posts
                    I got down to testing, works fine smiley

                    Really cool plugin it will allow for better fitting interface for clients, really a big value plugin grin
                    Thanks !
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l'outil id
                      • 16732
                      • 592 Posts
                      Here a fast done version of managermanager who seem to work with PHP5
                      I put all the fonctions in a class an change a bit the plugin code and mm.inc.php to keap the "userfriendly" adding rules.

                      To install : just like the original one => plugin.txt in a new plugin, mm.inc.php and mm.class.inc.php in assets/plugins/manager/manager

                      To add rules just use the \$mm->mm_hideFields(’longtitle’); syntaxe in the place of mm_hideFields(’longtitle’); and put an "/" in front of all your php variables

                      Tell me if it work for you

                      CAUTION :

                      The class use the PHP5 __construct() method, but I think you can change this

                      // ---------------------------------------------------
                      // Contructor
                      // ---------------------------------------------------
                      function __construct(){

                      to :

                      // ---------------------------------------------------
                      // Contructor
                      // ---------------------------------------------------
                      function mm(){

                      for a PHP 4 compatibility

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