HI There,
I think I fixed the renaming and hiding sections issue. I noticed that in the sections.inc.php supplied in version 0.37 of Managermanager the code says:
case 'content':
$output .= '$j("div#sectionContentHeader").empty().prepend("'.jsSafe($newname).'");' . "\n";
break;
case 'tvs':
$output .= '$j("div#sectionTVsHeader").empty().prepend("'.jsSafe($newname).'");' . "\n" ;
break;
and for the hide section functions further down the file. . .
//---------------------------------------------------------------------------------
// mm_hideSections
// Hides sections
//---------------------------------------------------------------------------------
function mm_hideSections($sections, $roles='', $templates='') {
global $modx;
$e = &$modx->Event;
// if we've been supplied with a string, convert it into an array
$sections = makeArray($sections);
// if the current page is being edited by someone in the list of roles, and uses a template in the list of templates
if (useThisRule($roles, $templates)) {
$output = " // ----------- Hide sections -------------- \n";
foreach($sections as $section) {
switch ($section) {
case 'content':
$output .= '
$j("#sectionContentHeader").hide();
$j("#sectionContentBody").hide();
';
break;
case 'tvs':
$output .= '
$j("#sectionTVsHeader").hide();
$j("#sectionTVsBody").hide();
';
break;
case 'access': // These have moved to tabs in 1.0.1
$output .= '
$j("#sectionAccessHeader").hide();
// $j("#sectionAccessBody").hide(); ';
break;
} // end switch
$e->output($output . "\n");
} // end foreach
} // end if
} // end function
I then looked in the manager/actions/mutate_content.dynamic.php and noticed that none of the ids referenced in the code above (#sectionContentHeader and #sectionContentBody, #sectionTVsHeader and sectionTVsBody) existed. so I added id’s and voila.. . .it works.
The exact lines in manager/actions/mutate_content.dynamic.php were:
677, and 678 for the content, lines 736, 737 for the tv section.
I also got rid of the for loop in the sections.inc.php in the hide sections part of the file and now you can hide sections one per rule.
you can see the code below. I know there is a more elegant solution, but I didn’t need to be able to keep them in an array.
function mm_hideSections($section, $roles='', $templates='') {
global $modx;
$e = &$modx->Event;
// if we've been supplied with a string, convert it into an array
// if the current page is being edited by someone in the list of roles, and uses a template in the list of templates
if (useThisRule($roles, $templates)) {
$output = " // ----------- Hide sections -------------- \n";
switch ($section) {
case 'content':
$output .= '
$j("#sectionContentHeader").hide();
$j("#sectionContentBody").hide();
';
break;
case 'tvs':
$output .= '
$j("#sectionTVsHeader").hide();
$j("#sectionTVsBody").hide();
';
break;
case 'access': // These have moved to tabs in 1.0.1
$output .= '
$j("#tabAccess1").hide();
$j("#sectionAccessBody").hide(); ';
break;
} // end switch
$e->output($output . "\n");
} // end if
} // end function
I hope this helps someone out there.
edit:
This same technique worked for a site I have that runs evo 1.0.0-RC1 with different line numbers in the manager/actions/mutate_content.dynamic.php
those lines were: 877, and 878 for the content, lines 936, 937 for the tv section.