global $content,$default_template, $mm_current_page, $mm_fields, $_lang;
$("div.sectionHeader:contains(\'Template Variables\')").hide(); // This will only work for English$("div.sectionHeader:contains(\''.$_lang["tmplvars"].'\')").hide();// 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(); ob_start(); include ($asset_path.'mm.actions.php'); $mm_actions = ob_get_contents(); ob_end_clean(); include($asset_path.'mm.inc.php');
$mm->mm_hideFields('longtitle');
$mm->mm_hideFields('menutitle');case 'show_in_menu':
if (useThisRule($roles, $templates)) {
$new_value = ($new_value=='') ? '0' : $new_value;
$checked = ( $new_value=='0' ) ? '' : 'checked';
$output .= '$("input[@name=show_in_menu]").val("'.(int)$new_value.'"); '."\n";
$output .= '$("input[@name=hidemenucheck]").attr("checked","'.$checked.'"); '."\n";
}
break;
mm_default('show_in_menu', '0', '', '4'); function mm_HideTemplate($fields, $roles='', $templates='') {
global $modx;
$e = &$modx->Event;
if (!is_array($fields)) {
$fields = $this->makeArray($fields);
}
if ($this->useThisRule($roles, $templates)) {
foreach ($fields as $field) {
$output .= '$("select#template option[@value='.$field.']").hide();';
}
$e->output($output . "\n");
}
} function mm_renameSection($oldtitle, $newtitle, $roles='', $templates='') {
global $modx, $_lang;
$e = &$modx->Event;
if ($this->useThisRule($roles, $templates)) {
switch ($oldtitle) {
case 'setting':
$output .= '$("div.sectionHeader:contains(\''.$_lang["document_setting"].'\')").empty().prepend("'.htmlspecialchars($newtitle).'");' . "\n";
break;
case 'content':
$output .= '$("div.sectionHeader:contains(\''.$_lang["document_content"].'\')").empty().prepend("'.htmlspecialchars($newtitle).'");' . "\n";
break;
case 'templvars':
$output .= '$("div.sectionHeader:contains(\''.$_lang["settings_templvars"].'\')").empty().prepend("'.htmlspecialchars($newtitle).'");' . "\n";
break;
case 'permissions':
$output .= '$("div.sectionHeader:contains(\''.$_lang["access_permissions"].'\')").empty().prepend("'.htmlspecialchars($newtitle).'");' . "\n";
break;
default:
$output .= '$("div.sectionHeader:contains(\''.htmlspecialchars($oldtitle).'\')").empty().prepend("'.htmlspecialchars($newtitle).'");' . "\n";
break;
}
$e->output($output . "\n");
}
}
function mm_hideSection($tabs, $roles='', $templates='') {
global $modx, $_lang;
$e = &$modx->Event;
if (!is_array($tabs)) {
$tabs = $this->makeArray($tabs);
}
if ($this->useThisRule($roles, $templates)) {
$output = " // ----------- Hide sections -------------- \n";
foreach($tabs as $tab) {
switch ($tab) {
case 'setting':
$output .= '$("div.sectionHeader:contains(\''.$_lang["document_setting"].'\')").hide().next("div.sectionBody").hide();';
break;
case 'content':
$output .= '$("div.sectionHeader:contains(\''.$_lang["document_content"].'\')").hide().next("div.sectionBody").hide();';
break;
case 'templvars':
$output .= '$("div.sectionHeader:contains(\''.$_lang["settings_templvars"].'\')").hide().next("div.sectionBody").hide();';
break;
case 'permissions':
$output .= '$("div.sectionHeader:contains(\''.$_lang["access_permissions"].'\')").hide().next("div.sectionBody").hide();';
break;
default:
$output .= '$("div.sectionHeader:contains(\''.htmlspecialchars($tab).'\')").hide().next("div.sectionBody").hide();';
break;
}
$e->output($output . "\n");
}
}
} $mm_current_page['template'] = isset($content['template']) ? $content['template'] : $default_template;
$mm_current_page['template'] = isset($_POST['template']) ? $_POST['template'] : isset($content['template']) ? $content['template'] : $default_template;
I just downloaded the most recent version of this and it’s taken me half an hour to realise that the version in the repository doesn’t have Rachael Black’s modification to avoid conflict with Mootools. Not sure how the repository versions get updated, but this would be a sensible update to add, otherwise people will keep hitting this problem.
This discussion is closed to further replies. Keep calm and carry on.