\$mm->mm_default(’cacheable’, ’0’, ’’, ’9’);
case 'cacheable': $new_value = ($new_value=='') ? 0 : $new_value; $output .= '$("input[@name=cacheable]").val("'.(int)$new_value.'"); '."\n"; $output .= '$("input[@name=cacheablecheck]").attr("checked",""); '."\n"; break;
case 'cacheable': $new_value = ($new_value=='') ? '0' : $new_value; $checked = ( $new_value=='0' ) ? '' : 'checked'; $output .= '$("input[@name=cacheable]").val("'.(int)$new_value.'"); '."\n"; $output .= '$("input[@name=cacheablecheck]").attr("checked","'.$checked.'"); '."\n"; break;
I would like to set docs uncacheable but only for template n°9Yes, in the moment the mm_function contains no condition to check the rules for templates or roles. So all input expect the $new_value is ignored
if (useThisRule($roles, $templates)) {
case 'cacheable': if (useThisRule($roles, $templates)) { $new_value = ($new_value=='') ? '0' : $new_value; $checked = ( $new_value=='0' ) ? '' : 'checked'; $output .= '$("input[@name=cacheable]").val("'.(int)$new_value.'"); '."\n"; $output .= '$("input[@name=cacheablecheck]").attr("checked","'.$checked.'"); '."\n"; } break;
// What's the new value, and does it include PHP? $new_value = ($eval) ? eval($value) : $value; if (useThisRule($roles, $templates)) { $output = " // ----------- Date defaults -------------- \n"; switch ($field) { case 'pub_date': $new_value = ($new_value=='') ? date("d-m-Y H:i:s") : $new_value; $output .= '$("input[@name=pub_date]").val("'.htmlentities($new_value).'"); '."\n"; break; /* some cases */ case 'cacheable': $new_value = ($new_value=='') ? '0' : $new_value; $checked = ( $new_value=='0' ) ? '' : 'checked'; $output .= '$("input[@name=cacheable]").val("'.(int)$new_value.'"); '."\n"; $output .= '$("input[@name=cacheablecheck]").attr("checked","'.$checked.'"); '."\n"; break; default: return; break; } }
$output .= '$("input[@name=practiseMyEnglish]").attr("checked","checked"); '."\n";
case 'cacheable': if (useThisRule($roles, $templates)) { $new_value = ($new_value=='') ? '0' : $new_value; $checked = ( $new_value=='0' ) ? '' : 'checked'; $output .= '$("input[@name=cacheable]").val("'.(int)$new_value.'"); '."\n"; $output .= '$("input[@name=cacheablecheck]").attr("checked","'.$checked.'"); '."\n"; } break;
//echo ' //<div id="loadingmask"> </div> //<script type="text/javascript"> //$("#loadingmask").css( {width: "100%", height: $("body").height(), position: "absolute", zIndex: "1000", backgroundColor: "#ffffff"} ); //</script> //';
\$mm->mm_default('cacheable', '0', '', '9');
mm->useThisRule($roles, $templates)
case 'cacheable': if (mm->useThisRule($roles, $templates)) { $new_value = ($new_value=='') ? '0' : $new_value; $checked = ( $new_value=='0' ) ? '' : 'checked'; $output .= '$("input[@name=cacheable]").val("'.(int)$new_value.'"); '."\n"; $output .= '$("input[@name=cacheablecheck]").attr("checked","'.$checked.'"); '."\n"; } break;
This discussion is closed to further replies. Keep calm and carry on.