Exemplo n.º 1
0
            }
        }
        // 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
    header("Location: " . $cms_module->getAdminFrontendPath(PATH_RELATIVETO_WEBROOT) . "?cms_message_id=65&" . session_name() . "=" . session_id());
    exit;
}
Exemplo n.º 2
0
        }
        $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();
foreach ($polyModules as $aModule) {
    $poly_types = array_merge($poly_types, CMS_poly_object_catalog::getObjectsForModule($aModule->getCodename()));
}
        $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>
<script type="text/javascript" src="../codemirror/clike.js"></script>
<script type="text/javascript" src="../codemirror/htmlmixed.js"></script>