Exemplo n.º 1
0
     display_documents();
     break;
 case "new_document":
     if (isset($_SESSION["new_document_state"]) && $_SESSION["new_document_state"] == "display") {
         $_SESSION["new_document_state"] = "execute";
         // Une fois réaffiché, on repasse en mode "exécution"
         if (isset($_SESSION["new_document_display"])) {
             echo $_SESSION["new_document_display"];
             // Affichage;
             unset($_SESSION["new_document_display"]);
             // On supprime le texte qui a été affiché
         }
     }
     break;
 case "remove_doc":
     delete_doc();
     break;
 case "edit_doc":
     edit_doc();
     break;
     // Affichage des propositions
 // Affichage des propositions
 case "display_post":
     display_post();
     break;
     // Nouvelle proposition
 // Nouvelle proposition
 case "new_post":
     new_post();
     break;
     // Suppression
Exemplo n.º 2
0
    * @caller ajax user action
    * @calls is_ajax
    * @ingorup user actions
    *
    * @param bool is_ajax() checks if it's an ajax call
    *
    * @var string $action is the function name called from ajax
    */
    if (isset($_POST['action']) && !empty($_POST['action'])) {
        $action = $_POST['action'];
        if ($action === 'make_doc') {
            make_doc($_POST['docParams'], $_POST['projectParams']);
        } elseif ($action === 'save_doc') {
            save_doc($_POST['dir'], $_POST['title'], $_POST['pages']);
        } elseif ($action === 'delete_doc') {
            delete_doc($_POST['dir']);
        } elseif ($action === 'update_editor_instructions') {
            update_editor_instructions($_POST['dir']);
        } elseif ($action === 'try_to_unlock') {
            try_to_unlock($_POST['passwordAttempt'], $_POST['dir']);
        } elseif ($action === 'lock_page') {
            lock_page($_POST['dir']);
        } elseif ($action === 'download_doc') {
            make_word_doc($_POST['Doc'], $_POST['dir']);
        }
    }
}
function add_index_file($dir)
{
    /**
    * description make the index file