function add_copyright($f) { $te = new TextEditor(); $te->load_content_from_file($f); $copyright = "<?\n\n /*\n * NOTA DI COPYRIGHT\n Questo framework è esclusiva proprietà di Frostlab gate. Ne è vietato l'utilizzo, la copia, la modifica o la redistribuzione \n sotto qualsiasi forma senza l'esplicito consenso da parte di Frostlab gate. Tutti i diritti riservati.\n *\n * COPYRIGHT NOTICE\n This framework is exclusive property of Frostlab gate. Usage, copy, changes or redistribution in any form are forbidden\n without an explicit agreement with Frostlab gate. All rights reserved.\n */\n\n "; $matches = $te->matches_pattern("/(class)|(interface)/m"); }
<?php require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php"; $smarty = new MMSmarty(); $smarty->assign("pagetitle", "Vanliga frågor"); $namn = "Vanliga frågor"; $texteditor = TextEditor::loadByNamn($namn); $smarty->assign("texteditor", $texteditor); $smarty->display('texteditorsida.tpl');
$_POST["profildatavals"] = trim($_POST["profildatavals"]); if (!empty($_POST["profildatavals"])) { $profildatavals = explode("\n", trim($_POST["profildatavals"])); if (count($profildatavals) > 0) { while (list($key, $value) = each($profildatavals)) { new ProfilDataVal(trim($value), $profildata->getId()); } } } $urlHandler->redirect("ProfilData", URL_ADMIN_EDIT, $profildata->getId()); break; case "texteditor": if (empty($_GET["id"])) { $texteditor = new TextEditor($_POST["namn"], $_POST["tema"]); } else { $texteditor = TextEditor::loadById($_GET["id"]); if (!empty($_POST["namn"])) { $texteditor->setNamn($_POST["namn"]); } if (!empty($_POST["tema"])) { $texteditor->setTema($_POST["tema"]); } if (!empty($_POST["texten"])) { $texteditor->setTexten($_POST["texten"]); } $texteditor->commit(); } $urlHandler->redirect("TextEditor", URL_ADMIN_EDIT, $texteditor->getId()); break; case "help": if (empty($_GET["id"])) {
function testInsertDelete() { $content = "123456789"; $te = new TextEditor(); $te->set_content($content); $this->assertEqual(0, $te->get_changes_count(), "Il numero di modifiche non è zero alla creazione del TextEditor!!"); $te->insert(0, "0"); $this->assertEqual(1, $te->get_changes_count(), "La modifica non e' stata conteggiata!!"); $this->assertEqual($te->preview_changes(), "0123456789", "I cambiamenti effettuati non corrispondono!! Atteso : '123456789' Trovato : " . $te->preview_changes()); $this->assertEqual($te->get_content(), $content, "Il contenuto e' stato modificato dopo l'inserimento della modifica!!"); $te->apply_changes(); $this->assertEqual("0123456789", $te->get_content(), "Il contenuto non e' stato aggiornato correttamente!!"); $this->assertEqual(0, $te->get_changes_count(), "Il numero delle modifiche non e' stato resettato!!"); $te->delete(5, 1); $te->apply_changes(); $this->assertEqual($te->get_content(), "012346789", "Il contenuto eliminato non corrisponde!!"); }
<?php require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php"; Security::demand(ADMIN); $smarty = new AdminSmarty(); $textEditors = TextEditor::listAll(); $smarty->assign("listTextEditors", $textEditors); $smarty->display('listTextEditors.tpl');
public static function listByPage($page) { $helpers = parent::lister(get_class(), "page", $page, "`namn`"); return $helpers; }