// | LICENSE-GPL, and is available through the world-wide-web at | // | http://www.gnu.org/copyleft/gpl.html. | // +----------------------------------------------------------------------+ // | Author: Sébastien Pauchet <*****@*****.**> | // +----------------------------------------------------------------------+ // // $Id: backtrace.php,v 1.3 2010/03/08 16:41:17 sebastien Exp $ /** * PHP page : Backtrace debug page * * @package Automne * @subpackage admin * @author Sébastien Pauchet <*****@*****.**> */ require_once dirname(__FILE__) . '/../../cms_rc_admin.php'; $dialog = new CMS_dialog(); $dialog->setTitle('Automne :: Debug :: BackTrace', 'pic_meta.gif'); $backTraceName = $_GET['bt']; if (!$backTraceName) { $content = 'Cannot backtrace, datas missing ...'; } else { //get backtrace from cache object $cache = new CMS_cache($backTraceName, 'atm-backtrace', 600, false); //load cache content if (!$cache->exist() || !($datas = $cache->load())) { $content = 'Cannot backtrace, datas missing ...'; } else { $content = ' <h3>Backtrace:</h3> ' . $datas['summary'] . '<br /> <h3>Backtrace Detail:</h3>
} if (!$cms_message) { $cms_message = $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE); //grab block content $data = $cms_block->getRawData($cms_page->getID(), $cs, $rowTag, RESOURCE_LOCATION_EDITION, false); } break; case "previz": //checks and assignments $previz = $_POST["item"]; default: //grab block content $data = $cms_block->getRawData($cms_page->getID(), $cs, $rowTag, RESOURCE_LOCATION_EDITION, false); break; } $dialog = new CMS_dialog(); $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE, false, MOD_CMS_FORMS_CODENAME)); if ($cms_message) { $dialog->setActionMessage($cms_message); } // Search for all forms in current language $search = new CMS_forms_search(); // Param : userpermisison on module $search->addWhereCondition("profile", $cms_user); // Param : Language $search->addWhereCondition("language", $items_language); // Param : With categories if (CMS_session::getSessionVar("items_ctg") != '') { $search->addWhereCondition("category", CMS_session::getSessionVar("items_ctg")); } //language selection
if ($pageLink == 'false' && $_GET["encodedOnClick"]) { $onClick = base64_decode($_GET["encodedOnClick"]); } } $linkTarget = '_self'; //($_GET["linkTarget"]) ? $_GET["linkTarget"]:"main"; //root : Must be set if (!$startRoot) { die("Tree : root page not defined"); } //pageProperty : must be inside the page_properties array $page_properties = array("last_creation_date", "template"); if ($pageProperty && !SensitiveIO::isInSet($pageProperty, $page_properties)) { die("Tree : unknown page property"); } $dialog = new CMS_dialog(); if ($hideMenu) { $dialog->setMenu(false); } //add title $title = $title ? SensitiveIO::sanitizeHTMLString($title) : $cms_language->getMessage(MESSAGE_PAGE_TITLE); $pageTitle = $frame && !$onClick ? '<a href="' . CMS_session::getSessionVar('treeHref') . '" target="_self" class="admin_frame">' . $title . '</a>' : $title; $dialog->setTitle($pageTitle); $dialog->changeColor(); //add message if any if ($cms_message) { $dialog->setActionMessage($cms_message); } //add back link if ($backLink) { //links are coded in query string and so ? are replaced by §§ and ampersands are replaced with § to avoid confusion
$page = CMS_tree::getPageByID($_GET["website_root"]); //must check that the page ain't the root of another website already $all_websites = CMS_websitesCatalog::getAll(); foreach ($all_websites as $aWebsite) { $current_root = $aWebsite->getRoot(); if ($current_root->getID() == $page->getID() && $aWebsite->getID() != $website->getID()) { Header("Location: websites.php?cms_message_id=" . MESSAGE_PAGE_ROOT_ALREADY_USED . "&" . session_name() . "=" . session_id()); exit; } } if (!$website->setRoot($page)) { Header("Location: websites.php?cms_message_id=" . MESSAGE_PAGE_ROOT_SET_ERROR . "&" . session_name() . "=" . session_id()); exit; } } $dialog = new CMS_dialog(); //Action management switch ($_POST["cms_action"]) { case "validate": //checks and assignments $cms_message = ""; if (!$_POST["url"] || $_POST["url"] == "http://" || !$_POST["root"]) { header("Location: websites.php?cms_message_id=" . MESSAGE_FORM_ERROR_MANDATORY_FIELDS . "&" . session_name() . "=" . session_id()); exit; } else { $website->setURL($_POST["url"]); $website->setAltDomains($_POST["altdomains"]); if ($website->getID()) { $page = CMS_tree::getPageByID($_POST["root"]); $website_root = $website->getRoot(); if ($page->getID() != $website_root->getID()) {
define('MESSAGE_PAGE_ERROR_MODULE_RIGHTS', 65); define('MESSAGE_PAGE_ERROR_UNKNOWN_MODULE', 809); define('MESSAGE_PAGE_MODULE_EXPORT_TITLE', 1632); define('MESSAGE_PAGE_MODULE_NO_EXPORT', 1633); define('MESSAGE_PAGE_EXPORT_FORMAT', 1634); define('MESSAGE_PAGE_EXPORT_PATCH_FORMAT', 1635); define('MESSAGE_PAGE_EXPORT_XML_FORMAT', 1636); define('MESSAGE_PAGE_EXPORT_PHP_FORMAT', 1637); define('MESSAGE_PAGE_EXPORT_OPTIONS', 1638); define('MESSAGE_PAGE_EXPORT_MODULE', 1639); define('MESSAGE_PAGE_EXPORTED_DATAS', 1640); define('MESSAGE_PAGE_FILE_ERROR', 1641); define('MESSAGE_PAGE_ARCHIVE_ERROR', 1642); define('MESSAGE_PAGE_UNKNOWN_FORMAT', 1643); //Create page object $dialog = new CMS_dialog(); //checks rights if (!$cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITVALIDATEALL)) { $dialog->setContent($cms_language->getMessage(MESSAGE_PAGE_ERROR_MODULE_RIGHTS)); $dialog->show(); exit; } $moduleCodename = io::request('moduleCodename'); if (!$moduleCodename) { $dialog->setContent($cms_language->getMessage(MESSAGE_PAGE_ERROR_UNKNOWN_MODULE)); $dialog->show(); exit; } $module = CMS_modulesCatalog::getByCodename($moduleCodename); if (!is_object($module) || $module->hasError()) { $dialog->setContent($cms_language->getMessage(MESSAGE_PAGE_ERROR_UNKNOWN_MODULE));
if (!$item_relations->writeToPersistence()) { $cms_message .= $cms_language->getMessage(MESSAGE_ACTION_ERROR_ADD_CATEGORIES, false, MOD_CMS_FORMS_CODENAME) . "\n"; } } } // Save data if (!$cms_message && $item->writeToPersistence()) { header("Location: items.php?cms_message_id=" . MESSAGE_ACTION_OPERATION_DONE . "&" . session_name() . "=" . session_id()); exit; } break; } // +----------------------------------------------------------------------+ // | Render | // +----------------------------------------------------------------------+ $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_MODULE, array($cms_module->getLabel($cms_language))) . " :: " . $cms_language->getMessage(MESSAGE_PAGE_TITLE, false, MOD_CMS_FORMS_CODENAME)); $dialog->setBacklink("items.php?item=" . $item->getId()); if ($cms_message) { $dialog->setActionMessage($cms_message); } // Insert prefered text editor for textarea field $toolbarset = !$cms_module->getParameters("editor_toolbar") ? 'Basic' : $cms_module->getParameters("editor_toolbar"); $attrs = array('form' => 'frmitem', 'field' => 'source_' . $item->getID(), 'value' => $item->getAttribute('source'), 'language' => $cms_language, 'width' => 600, 'height' => 600, 'rows' => 8, 'toolbarset' => $toolbarset); $text_editor = CMS_textEditor::getEditorFromParams($attrs); $dialog->setJavascript($text_editor->getJavascript()); // Get listboxes for categories $a_all_categories = CMS_moduleCategories_catalog::getAllCategoriesAsArray($cms_user, $cms_module->getCodename(), $cms_language); if (!sizeof($a_all_categories)) { //user has no right on categories so he can't edit/create items
case "FATHER_IS_IDENTICAL": $errmsg = $cms_language->getMessage(MESSAGE_PAGE_ERROR_FATHER_IS_IDENTICAL); break; } $cms_message = $cms_language->getMessage(MESSAGE_PAGE_ACTION_MOVE_ERROR) . "\n" . $errmsg; } else { $cms_message = $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE); } } else { $cms_message = $cms_language->getMessage(MESSAGE_CLEARANCE_INSUFFICIENT); } } if ($cms_user) { $title = '<span class="admin">' . $cms_language->getMessage(MESSAGE_HELLO) . ' <strong>' . $cms_user->getFirstName() . ' ' . $cms_user->getLastName() . '</strong></span>'; } $dialog = new CMS_dialog(); if ($cms_message) { $dialog->setActionMessage($cms_message); } else { if (isset($_GET["cms_message"])) { $dialog->setActionMessage(SensitiveIO::sanitizeHTMLString($_GET["cms_message"])); } } $dialog->reloadTree(); $content = ' <table border="0" cellpadding="2" cellspacing="0" class="admin_clientSpace"> <tr> <td class="admin" width="100%" align="center"> ' . $title . ' </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%">
/** * add usefull javascript for disable submit button * * @return string : the javascript to add * @access private */ function addJavascriptCheck($makeFocus = true) { $javascriptCheck = ' <!-- javascriptCheck usefull initialisation javascript functions --> <script language="JavaScript" type="text/javascript"> function initJavascript() {'; if ($makeFocus) { $javascriptCheck .= ' makeFocus();'; } $javascriptCheck .= ' if (typeof reloadAll == "function") { reloadAll(); } if (typeof checkFrameSize == "function") { checkFrameSize(); } if (typeof reloadTree == "function") { reloadTree(); } if (typeof reloadModules == "function") { reloadModules(); } if (typeof sortList == "function") { sortList(); } if (typeof(parent.document) != \'undefined\' && typeof(parent.document) != \'unknown\' && typeof(parent.document.title) == \'string\') { parent.document.title=document.title; } else { window.status=document.title; } }'; if ($makeFocus) { $javascriptCheck .= ' function makeFocus() { for (var j=\'0\'; j < document.forms.length; j++) { if (document.forms[j]!=null) { for (var i=\'0\'; i < document.forms[j].length; i++) { if (document.forms[j].elements[i] && document.forms[j].elements[i].type == "text" || document.forms[j].elements[i].type == "textarea") { if (document.forms[j].elements[i].value==\'\') { document.forms[j].elements[i].focus(); return true; } else { document.forms[j].elements[i].select(); return true; } } } } else { return false; } } }'; } $javascriptCheck .= ' function check() { buttonDisable(); window.setTimeout("buttonEnable()",45000); } function buttonDisable() { for (var j=\'0\'; j < document.forms.length; j++) { if (document.forms[j]!=null) { for (var i=\'0\'; i < document.forms[j].length; i++) { if (document.forms[j].elements[i].type == "submit" || document.forms[j].elements[i].type == "button" || document.forms[j].elements[i].type == "image") { document.forms[j].elements[i].style.backgroundColor = "D9D5D4"; document.forms[j].elements[i].style.color = "6E5E59"; document.forms[j].elements[i].disabled = true; } } } } return true; } function buttonEnable() { for (var j=\'0\'; j < document.forms.length; j++) { if (document.forms[j]!=null) { for (var i=\'0\'; i < document.forms[j].length; i++) { if (document.forms[j].elements[i].type == "submit" || document.forms[j].elements[i].type == "button") { document.forms[j].elements[i].disabled = false; document.forms[j].elements[i].style.backgroundColor = "ABD64A"; document.forms[j].elements[i].style.color = "FFFFFF"; } } } } return true; } if (parent && parent.Automne && parent.Ext) { var Automne = parent.Automne; var Ext = parent.Ext; var pr = parent.pr; } </script>'; if (isset($this) && is_a($this, 'CMS_dialog')) { $this->changeColor(); $this->setJavascript($javascriptCheck); return true; } else { return $javascriptCheck . CMS_dialog::changeColor(); } }
} $indexURLValue = $polymod->convertDefinitionString($_POST["indexURL"], false); $URLErrors = $object->setValue("indexURL", $indexURLValue); if ($URLErrors !== true) { $cms_message .= "\n" . $cms_language->getMessage(MESSAGE_FORM_ERROR_MALFORMED_FIELD, array($cms_language->getMessage(MESSAGE_PAGE_OBJECT_INDEXATION_LINK_TO, false, MOD_POLYMOD_CODENAME) . ' : ' . $definitionErrors)); } $object->setValue("module", $moduleCodename); if (!$cms_message && $_POST["cms_action"] == "validate") { //save the data $object->writeToPersistence(); header("Location: modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $object->getID() . "&cms_message_id=" . MESSAGE_ACTION_OPERATION_DONE . "&" . session_name() . "=" . session_id()); exit; } break; } $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_APPLICATIONS) . " :: " . $cms_language->getMessage(MESSAGE_PAGE_TITLE), 'picto_modules.gif'); $dialog->setBacklink("modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $object->getID()); if ($cms_message) { $dialog->setActionMessage($cms_message); } if (method_exists($dialog, 'addStopTab')) { $dialog->addStopTab(); $stopTab = ' onkeydown="return catchTab(this,event)"'; } $content = ' <br /> <table width="80%" border="0" cellpadding="3" cellspacing="2"> <form name="frm" action="' . $_SERVER["SCRIPT_NAME"] . '" method="post"> <input type="hidden" name="cms_action" id="cms_action" value="validate" />
// | Author: Sébastien Pauchet <*****@*****.**> | // +----------------------------------------------------------------------+ // // $Id: stat.php,v 1.9 2010/03/08 16:41:21 sebastien Exp $ /** * Automne Debug Statistics viewver * * @package Automne * @subpackage admin * @author Sébastien Pauchet <*****@*****.**> */ require_once dirname(__FILE__) . '/../../cms_rc_admin.php'; error_reporting(E_ALL & ~E_NOTICE); $SQL_TIME_MARK = $_REQUEST["SQL_TIME_MARK"] ? $_REQUEST["SQL_TIME_MARK"] : '0.001'; $statName = $_REQUEST['stat'] ? $_REQUEST['stat'] : ''; $dialog = new CMS_dialog(); if (!$statName) { $dialog->setTitle('Automne :: Debug :: Statistics', 'pic_meta.gif'); $dialog->setContent('Cannot find stats datas ...'); $dialog->show(); exit; } //get stats from cache object $cache = new CMS_cache($statName, 'atm-stats', 600, false); //load cache content if (!$cache->exist() || !($datas = $cache->load())) { $dialog->setTitle('Automne :: Debug :: Statistics', 'pic_meta.gif'); $dialog->setContent('Cannot find stats datas ...'); $dialog->show(); exit; }
CMS_tree::submitToRegenerator($pg->getID(), true); //validate the father $pg->regenerate(true); $validation = new CMS_resourceValidation(MOD_STANDARD_CODENAME, RESOURCE_EDITION_SIBLINGSORDER + RESOURCE_EDITION_CONTENT, $father); $mod = CMS_modulesCatalog::getByCodename(MOD_STANDARD_CODENAME); $mod->processValidation($validation, VALIDATION_OPTION_ACCEPT); } $cms_message = $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE); $archives = CMS_tree::getArchivedPagesData(); $log = new CMS_log(); $log->logResourceAction(CMS_log::LOG_ACTION_RESOURCE_UNARCHIVE, $cms_user, MOD_STANDARD_CODENAME, $pg->getStatus(), "", $pg); } } break; } $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE), 'pic_archives.gif'); if ($cms_message) { $dialog->setActionMessage($cms_message); $dialog->reloadTree(); } if (is_array($archives) && $archives) { $content .= ' <table border="0" cellpadding="2" cellspacing="2"> <tr> <th class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_REFERENCE) . '</th> <th class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_TITLE) . '</th> <th class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_LASTCREATION) . '</th> <th class="admin" colspan="2">' . $cms_language->getMessage(MESSAGE_PAGE_ACTIONS) . '</th> </tr>
$cms_message .= "\n" . $cms_language->getMessage(MESSAGE_FORM_ERROR_MALFORMED_FIELD, array($cms_language->getMessage(MESSAGE_PAGE_FIELD_DEFINITION) . ' : ' . $definitionErrors)); } if (!$pluginDefinition->setValue("query", $_POST["searchedObjects"])) { $cms_message .= "\n" . $cms_language->getMessage(MESSAGE_FORM_ERROR_MALFORMED_FIELD, array($cms_language->getMessage(MESSAGE_PAGE_FIELD_OBJECT_PARAMETERS, false, MOD_POLYMOD_CODENAME))); } if (!$cms_message && $_POST["cms_action"] == "validate") { //save the data $pluginDefinition->writeToPersistence(); header("Location: modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $object->getID() . "&cms_message_id=" . MESSAGE_ACTION_OPERATION_DONE . "&" . session_name() . "=" . session_id()); exit; } elseif ($_POST["cms_action"] != "validate") { $cms_message = ''; } break; } $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_APPLICATIONS) . " :: " . $cms_language->getMessage(MESSAGE_PAGE_TITLE, array($object->getLabel($cms_languege)), MOD_POLYMOD_CODENAME), 'picto_modules.gif'); $dialog->setBacklink("modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $object->getID()); if (method_exists($dialog, 'addStopTab')) { $dialog->addStopTab(); $stopTab = ' onkeydown="return catchTab(this,event)"'; } if ($cms_message) { $dialog->setActionMessage($cms_message); } $searchParameters = $object->getHTMLSubFieldsParametersSearch($cms_language, '', $pluginDefinition->getValue("query")); //Definition $definition = $_POST["definition"] ? $_POST["definition"] : $polymod->convertDefinitionString($pluginDefinition->getValue("definition"), true); $content = ' <table width="80%" border="0" cellpadding="3" cellspacing="2">
CMS_file::copyTo(PATH_HTACCESS_FS . '/htaccess_file', PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/edited/.htaccess'); CMS_file::chmodFile(FILES_CHMOD, PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/edited/.htaccess'); CMS_file::copyTo(PATH_HTACCESS_FS . '/htaccess_file', PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/public/.htaccess'); CMS_file::chmodFile(FILES_CHMOD, PATH_MODULES_FILES_FS . '/' . $moduleCodename . '/public/.htaccess'); } header("Location: modules_admin.php?moduleCodename=" . $moduleCodename . "&cms_message_id=" . MESSAGE_ACTION_OPERATION_DONE . "&" . session_name() . "=" . session_id()); exit; } else { $cms_message .= "\n" . $cms_language->getMessage(MESSAGE_FORM_ERROR_DIRECTORY_CREATION, array($moduledir->getName(), $moduleDeleted->getName(), $moduleEdited->getName(), $modulePublic->getName())); } } } break; } //page dialog $dialog = new CMS_dialog(); if (is_object($module)) { $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_EDIT, array($module->getLabel($cms_language)))); $dialog->setBackLink('modules_admin.php?moduleCodename=' . $moduleCodename); } else { $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_CREATE)); $dialog->setBackLink('modules_admin.php'); } if ($cms_message) { $dialog->setActionMessage($cms_message); } $content = ' <form action="' . $_SERVER["SCRIPT_NAME"] . '" method="post"> <input type="hidden" name="cms_action" value="validate" /> <input type="hidden" name="moduleCodename" value="' . $moduleCodename . '" /> <table border="0" cellpadding="2" cellspacing="2">
define("MESSAGE_PAGE_ACTION_EXPORT", 1672); define("MESSAGE_PAGE_ACTION_DELETE_MODULE_CONFIRM", 1711); //checks rights if (!$cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITVALIDATEALL)) { header("Location: " . PATH_ADMIN_SPECIAL_ENTRY_WR . "?cms_message_id=" . MESSAGE_PAGE_CLEARANCE_ERROR . "&" . session_name() . "=" . session_id()); exit; } //load page objects and vars $moduleCodename = $_POST["moduleCodename"] ? $_POST["moduleCodename"] : $_GET["moduleCodename"]; $objectID = $_POST["object"] ? $_POST["object"] : $_GET["object"]; $modules = CMS_modulesCatalog::getAll("label", false); if ($moduleCodename) { $module = CMS_modulesCatalog::getByCodename($moduleCodename); } //Create page object $dialog = new CMS_dialog(); $cms_message = ""; // **************************************************************** // ** ACTIONS MANAGEMENT ** // **************************************************************** switch ($_POST["cms_action"]) { case "validate_module": $new_parameters = array(); foreach ($_POST as $label => $value) { if ($label != "cms_action" && $label != "action" && $label != "moduleCodename" && !strpos($label, '_contentType')) { if ($_POST[$label . "_contentType"]) { $new_parameters[$label] = array($value, $_POST[$label . "_contentType"]); } else { $new_parameters[$label] = $value; } }
define('MESSAGE_PAGE_ERROR_FILE_EXTRACT', 1651); define('MESSAGE_PAGE_ERROR_FILE_DIR', 1652); define('MESSAGE_PAGE_MODULE_EXTRACT_DONE', 1653); define('MESSAGE_PAGE_MODULE_EXTRACT_ERROR', 1654); define('MESSAGE_PAGE_MODULE_NO_EXPORT', 1655); define('MESSAGE_PAGE_MODULE_ERROR_NO_IMPORT_DATA', 1656); define('MESSAGE_PAGE_MODULE_IMPORT_ERROR', 1657); define('MESSAGE_PAGE_MODULE_IMPORT_DONE', 1658); define('MESSAGE_PAGE_MODULE_ERROR_CLEANING_DIR', 1659); define('MESSAGE_PAGE_MODULE_IMPORT_LOG', 1660); define('MESSAGE_PAGE_ERROR_MODULE_RIGHTS', 65); define('MESSAGE_PAGE_EXPORT_XML_FORMAT', 1636); define('MESSAGE_PAGE_EXPORT_PHP_FORMAT', 1637); define('MESSAGE_PAGE_EXPORT_OPTIONS', 1638); //Create page object $dialog = new CMS_dialog(); //checks rights if (!$cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITVALIDATEALL)) { $dialog->setContent($cms_language->getMessage(MESSAGE_PAGE_ERROR_MODULE_RIGHTS)); $dialog->show(); exit; } $import = new CMS_module_import(); $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_MODULE_IMPORT_TITLE)); $format = io::post('format', '', 'xml'); $options = io::post('options', 'is_array', !io::post('action') ? $import->getDefaultParameters() : array()); $dialog->setBackLink('modules_admin.php'); $content = '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data"> <input type="hidden" name="action" value="import" /> <fieldset> <legend>' . $cms_language->getMessage(MESSAGE_PAGE_EXPORT_OPTIONS) . '</legend>';
$dialog = new CMS_dialog(); $content = $cms_language->getMessage(MESSAGE_PAGE_CORRECTION_DONE); $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE)); $dialog->setContent($content); $dialog->show(); exit; } else { $updateErrors = array(); foreach ($errors as $anError) { $updateErrors[] = $anError; } CMS_session::setSessionVar('patchErrors', $updateErrors); } break; } $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE)); //correct first error of the array $errors = CMS_session::getSessionVar('patchErrors'); $error = $errors[0]; //button message $validate_msg = !is_array($errors[1]) ? MESSAGE_PAGE_RETURN_TO_PATCH : MESSAGE_PAGE_NEXT_ERROR; switch ($error['no']) { case 5: //try to update a protected file (UPDATE.DENY) $content .= $cms_language->getMessage(MESSAGE_PAGE_ERROR_5_LABEL) . '<br /><br />'; $installParams = array_map("trim", explode("\t", $error['command'])); //get files $file = $installParams[1]; $content .= '
$oembedDefinition->setHtml(io::post('html')); $oembedDefinition->setParameter(io::post('parameter')); $oembedDefinition->setLabel(io::post('label')); if ($oembedDefinition->validate()) { $oembedDefinition->writeToPersistence(); } else { $errors = $oembedDefinition->getValidationFailures(); foreach ($errors as $error) { $cms_message .= "\n" . $error; } } break; case "switchexplanation": break; } $dialog = new CMS_dialog(); $dialog->setTitle("Création / modification d'une définition oembed", 'picto_modules.gif'); $dialog->setBacklink("modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $objectDefinition->getID()); if ($cms_message) { $dialog->setActionMessage($cms_message); } $scriptname = $_SERVER['SCRIPT_NAME']; $definitionHtml = htmlspecialchars($oembedDefinition->getHtml()); // Automne dialog system forces us to use a $content variable and so to mix everything... $content = <<<HTML <link rel="stylesheet" type="text/css" href="./css/admin-bootstrap.css" /> <link rel="stylesheet" type="text/css" href="../codemirror/codemirror.css" /> <script type="text/javascript" src="../codemirror/codemirror.js"></script> <script type="text/javascript" src="../codemirror/indent.js"></script> <script type="text/javascript" src="../codemirror/xml.js"></script> <script type="text/javascript" src="../codemirror/javascript.js"></script>
} else { $field->setValue("params", $params); } } $field->setValue("objectID", $object->getID()); if (!$cms_message && $_POST["cms_action"] == "validate") { //save the data $field->writeToPersistence(); header("Location: modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $object->getID() . "&field=" . $field->getID() . "&cms_message_id=" . MESSAGE_ACTION_OPERATION_DONE . "&" . session_name() . "=" . session_id()); exit; } elseif ($_POST["cms_action"] != "validate") { $cms_message = ''; } break; } $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_APPLICATIONS) . " :: " . $cms_language->getMessage(MESSAGE_PAGE_TITLE, array($object->getLabel($cms_languege))), 'picto_modules.gif'); $dialog->setBacklink("modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $object->getID() . "&field=" . $field->getID()); if ($cms_message) { $dialog->setActionMessage($cms_message); } if ($moduleCodename) { $polymod = CMS_modulesCatalog::getByCodename($moduleCodename); } $required = $field->getValue("required") ? ' checked="checked"' : ''; $indexable = $field->getValue("indexable") ? ' checked="checked"' : ''; $searchlist = $field->getValue("searchlist") ? ' checked="checked"' : ''; $searchable = $field->getValue("searchable") ? ' checked="checked"' : ''; $polyModules = CMS_modulesCatalog::getAll("label", true); $poly_types = array();
// +----------------------------------------------------------------------+ switch ($_POST["cms_action"]) { case "delete": //change the article proposed location and send emails to all the validators $item = CMS_module_cms_forms::getResourceByID($_POST["item"]); if ($item->destroy()) { $cms_message = $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE); } else { $cms_message = $cms_language->getMessage(MESSAGE_PAGE_ACTION_DELETE_ERROR, false, MOD_CMS_FORMS_CODENAME); } break; } // +----------------------------------------------------------------------+ // | Render | // +----------------------------------------------------------------------+ $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_MODULE, array($cms_module->getLabel($cms_language))) . " :: " . $cms_language->getMessage(MESSAGE_PAGE_TITLE)); //$dialog->setBacklink("index.php"); if ($cms_message) { $dialog->setActionMessage($cms_message); } // Search for all forms in current language $search = new CMS_forms_search(); // Param : userpermisison on module $search->addWhereCondition("profile", $cms_user); // Param : Language $search->addWhereCondition("language", $items_language); // Param : With categories if (CMS_session::getSessionVar("items_ctg") != '') { $search->addWhereCondition("category", CMS_session::getSessionVar("items_ctg"));