We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26657
    • 13 Posts
    Unfortunately I get the following error.

    managermanager - OnPluginFormRender
    An error occurred while loading. Please see the event log for more information.
    Parse error: syntax error, unexpected '/' in /home/www/pm_cms/manager/includes/document.parser.class.inc.php(742) : eval()'d code on line 67


    I applied the changes proposed by Rachael and tested it on two different installs at two different hosts.
    I’m very curious about the further development of this plugin.
      • 21056
      • 327 Posts
      Can you post the contents of the plugin code text box?
        Author: ManagerManager plugin - customise your ModX manager interface

        Rckt - web development, Sheffield, UK
        • 26657
        • 13 Posts
        It’s the original plugin-code, I only changed the mm_hideField to mm_hideFields

        Here it is:

        // ManagerManager plugin v0.2.4
        // See readme.htm for licensing and installation instructions
        if (!function_exists("make_changes")) {
        	function make_changes() { 
        	// ------------------------ INSERT YOUR RULES HERE --------------------
        	// Replace these example rules with your own
        	// News editors role -- creating a variable makes it easier to manage if this changes in the future
        	$news = '3';
        mm_hideFields('pagetitle,menutitle,link_attributes,template,menuindex,description,show_in_menu,which_editor,is_folder,is_richtext,log,searchable,cacheable,clear_cache', $news);
        	mm_renameTab('settings', 'Publication settings', $news);
        	mm_synch_fields('pagetitle,menutitle,longtitle', $news);
        	mm_renameField('longtitle','Headline', $news, '', 'This will be displayed at the top of each page');
        	mm_changeFieldHelp('parent', 'To move this story to a different folder: Click this icon to activate, then choose a new folder in the tree on the left.', '', $news_tpl);
        	// News story template
        	$news_tpl = '10';
        	mm_createTab('Categories','HrCats', '', $news_tpl, '', '600');
        	mm_moveFieldsToTab('tvnewsbigimage', 'general', '', $news_tpl);
        	mm_changeFieldHelp('longtitle', 'The story\'s headline', '', $news_tpl);
        	mm_changeFieldHelp('introtext', 'A short summary of the story', '', $news_tpl);
        	mm_hideFields('menuindex,show_in_menu', '', $news_tpl);
        	// For everyone
        	mm_default('pub_date');
        	mm_renameField('introtext','Summary');
        	mm_changeFieldHelp('alias', 'The URL that will be used to reach this story. Only numbers, letters and hyphens can be used');
        	/ /For everyone except administrators
        	mm_hideFields('link_attributes', '!1');
        	// ------------------------ END OF RULES --------------------
        	}  // Don't remove this
        }  // Don't remove this
        // 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/mm.inc.php';
        include($asset_path);
          • 21056
          • 327 Posts
          There was a typo towards the end of the plugin code --

          / /For everyone except administrators

          should have read:
          // For everyone except administrators


          There were also deprecated function names in there. The whole plugin as shipped should read:

          // ManagerManager plugin v0.2.4
          // See readme.htm for licensing and installation instructions
          
          
          
          if (!function_exists("make_changes")) {
          	function make_changes() { 
          	
          	
          	// ------------------------ INSERT YOUR RULES HERE --------------------
          	// Replace these example rules with your own
          
          	// News editors role -- creating a variable makes it easier to manage if this changes in the future
          	$news = '3';
          		mm_hideFields('pagetitle,menutitle,link_attributes,template,menuindex,description,show_in_menu,which_editor,is_folder,is_richtext,log,searchable,cacheable,clear_cache', $news);
          	mm_renameTab('settings', 'Publication settings', $news);
          	mm_synch_fields('pagetitle,menutitle,longtitle', $news);
          	mm_renameField('longtitle','Headline', $news, '', 'This will be displayed at the top of each page');
          	mm_changeFieldHelp('parent', 'To move this story to a different folder: Click this icon to activate, then choose a new folder in the tree on the left.', '', $news_tpl);
          	
          	// News story template
          	$news_tpl = '10';
          	mm_createTab('Categories','HrCats', '', $news_tpl, '', '600');
          	mm_moveFieldsToTab('tvnewsbigimage', 'general', '', $news_tpl);
          	mm_changeFieldHelp('longtitle', 'The story\'s headline', '', $news_tpl);
          	mm_changeFieldHelp('introtext', 'A short summary of the story', '', $news_tpl);
          	mm_hideFields('menuindex,show_in_menu', '', $news_tpl);
          		
          	// For everyone
          	mm_default('pub_date');
          	mm_renameField('introtext','Summary');
          	mm_changeFieldHelp('alias', 'The URL that will be used to reach this story. Only numbers, letters and hyphens can be used');
          	
          	// For everyone except administrators
          	mm_hideFields('link_attributes', '!1');
          	
          	
          	// ------------------------ END OF RULES --------------------
          
          	}  // Don't remove this
          }  // Don't remove this
          
          
          
          // 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/mm.inc.php';
          include($asset_path);


          I have uploaded an amended version to the repository as 0.2.4.1

          Will look at other bugs next.
            Author: ManagerManager plugin - customise your ModX manager interface

            Rckt - web development, Sheffield, UK
            • 26657
            • 13 Posts
            It works with this plugin-code. I really like how comfortable the configuration is.
              • 18229
              • 1 Posts
              I had the same JavaScript error like Metalle. The solution is to write the string in line.

              Just change this in "mm.inc.php" (line 605) :
              $empty_tab = '		
              <div class="tab-page" id="tab'.$id.'">
              	<h2 class="tab">'.$name.'</h2>
              	<div class="tabIntro" id="tab-intro-'.$id.'">'.$intro.'</div>
              	<table width="'.$width.'" border="0" cellspacing="0" cellpadding="0" id="table-'.$id.'">
              	</table>
              </div>
              ';
              


              to:

              $empty_tab = '<div class="tab-page" id="tab'.$id.'"><h2 class="tab">'.$name.'</h2><div class="tabIntro" id="tab-intro-'.$id.'">'.$intro.'</div><table width="'.$width.'" border="0" cellspacing="0" cellpadding="0" id="table-'.$id.'"></table></div>';
              


              Without any linebreaks!

              greez from Germany
              MarcelF
                • 21056
                • 327 Posts
                That is a solution -- I just liked to keep the code readable!

                Are you using non-English browsers? I suspect it’s something to do with character sets, but I don’t know enough about it really. I thought tabs and carriage returns were universal.
                  Author: ManagerManager plugin - customise your ModX manager interface

                  Rckt - web development, Sheffield, UK
                  • 28436
                  • 242 Posts
                  Hey Wow! You made a treasure. Thanks a lot for it!

                  As a note: In the readme.html is an error at the description for the "mm_hideTabs" function.


                  mm_hideTab(’meta’, ’preview’); // Hide the meta and preview tabs for all users
                  mm_hideTab(’meta’, ’1’, ’3’); // Hide the meta tab for users with role "1" editing documents using template ID "3"

                  it must be change to

                  mm_hideTabs( ’meta , preview’ ); // Hide the meta and preview tabs for all users
                  mm_hideTabs( ’meta’ , ’1’ , ’3’ ); // Hide the meta tab for users with role "1" editing documents using template ID "3"

                  first line Error in the arguments, must be one argument with csv value
                  both lines the function name

                  Well done!
                  ciao, Stefan
                    • 21056
                    • 327 Posts
                    Thanks for pointing it out, I have amended the example for future versions.
                      Author: ManagerManager plugin - customise your ModX manager interface

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

                      i added some cases for the mm_default function like this

                      case 'searchable':
                      $output .= '$("input[@name=searchable]").val("'.(int)$new_value.'"); '."\n";
                      break;
                      


                      if i create a new document and save it, the values are set to the given value. All work fine.

                      But at the first time creating a document, the checkboxes which are displayed in the backend have the attribute "checked=checked"
                      Is there a way to strip this attribute or set this checkbox to unchecked?
                      <input name="searchablecheck" class="checkbox" checked="checked" onclick="changestate(document.mutate.searchable);" type="checkbox">


                      i tried this
                      $output .= '$("input[@name=searchablecheck]").checked = false; '."\n";


                      mmhh dont work.. no wonder, i have no idea how to do it.

                      thank you
                      ciao, Stefan

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