Exemplo n.º 1
0
     $macroObj = $schedObjs[$_GET['line']];
     $tpl_edit = new Template(TPL_FILE_LOCATION . 'macro_edit.tpl');
     $tpl_edit->set('lang', $lang);
     $tpl_edit->set('theMacro', $macroObj);
     $tpl_body->set('form', $tpl_edit);
     break;
 case "add":
     // if macro exist then don't add the macro else create macro lines,
     // add them to file
     $sm = get_specific_macro($macros, label_parse($_POST["macro_name"], true));
     if (!$sm) {
         $aMacro = new Macro();
         $aMacro->setLabel(label_parse($_POST["macro_name"], true));
         $aMacro->setCommand($_POST["macro_command"]);
         if ($_POST["status"] == COMMENT_SIGN_D) {
             $aMacro->setEnabled(false);
         } else {
             $aMacro->setEnabled(true);
         }
         $aMacro->rebuildElementLine();
         $heyusched->addElement($aMacro);
         $mustSave = true;
     }
     break;
 case "save":
     //build macro line with POST results
     $schedObjs[$_POST["line"]]->setLabel(label_parse($_POST["macro_name"], true));
     $schedObjs[$_POST["line"]]->setCommand($_POST["macro_command"]);
     if ($_POST["status"] == COMMENT_SIGN_D) {
         $schedObjs[$_POST["line"]]->setEnabled(false);
     } else {