$page = type::super('page', 'string'); $subpage = type::super('subpage', 'string'); $action = type::super('action', 'string'); $structure_id = type::super('structure_id', 'int', 0); $id = type::super('id', 'int', 0); // Falls was an der Page geƤndert worden ist if ($page == 'structure' && $subpage == 'pages' && in_array($action, ['add', 'edit', 'seo']) && !$structure_id) { extension::add('FORM_AFTER_SAVE', function ($form) { seo_rewrite::generatePathlist(); return $form; }); } // Wenn SEO Button geklickt worden ist if ($page == 'structure' && $subpage == 'pages' && $action == 'seo') { seoPage::generateForm($id); layout::addJsCode("\n\t\tvar default_url = \$('#seo-costum-url').text();\n\t\t\n\t\t\$('#seo-costum-url-text').keyup(function() {\n\t\t\tvar val = \$(this).val();\n\t\t\t\n\t\t\tif(val == '')\n\t\t\t\tval = default_url;\n\t\t\t\t\t\t\t\n\t\t\t\$('#seo-costum-url').text(val);\n\t\t});\n\t\t\n\t\tvar default_title = \$('#seo-default-title').text();\n\t\t\$('#seo-title-text').keyup(function() {\n\t\t\tvar val = \$(this).val();\n\t\t\t\n\t\t\tif(val == '')\n\t\t\t\tval = default_title;\n\t\t\t\n\t\t\t\$('#seo-title').text(val);\n\t\t});\n\t\t"); } // Wenn Sortiert worden ist if ($page == 'structure' && $subpage == 'pages' && (ajax::is() || $action == 'delete' && !$structure_id)) { extension::add('BACKEND_OUTPUT', function ($output) { seo_rewrite::generatePathlist(); return $output; }); } // Inhaltsseite der page if ($page == 'structure' && $subpage == 'pages' && ($structure_id || $action == 'edit' && $id)) { $id = $structure_id ? $structure_id : $id; extension::add('BACKEND_OUTPUT', function ($output) use($id) { return seoPage::generateButton($output, $id); }); }
<?php if ($action == 'delete') { if (dyn::get('user')->get('id') == $id) { echo message::danger(lang::get('user_self_deleted')); } else { $sql = sql::factory(); $sql->setTable('user'); $sql->setWhere('id=' . $id); $sql->delete(); echo message::success(lang::get('user_deleted')); } $action = ''; } if ($action == 'add' || $action == 'edit') { layout::addJsCode("\n\tvar page_admin_button = \$('#pageadmin-button');\n\tvar page_admin_content = \$('#pageadmin-content');\n\t\n\tpage_admin_button.change(function() {\n\t\t\tif(page_admin_button.is(':checked')) {\n\t\t\t\tpage_admin_content.stop().slideUp(300);\n\t\t\t} else {\n\t\t\t\tpage_admin_content.stop().slideDown(300);\n\t\t\t}\n\t});"); $form = form::factory('user', 'id=' . $id, 'index.php'); $field = $form->addTextField('firstname', $form->get('firstname')); $field->fieldName(lang::get('firstname')); $field->autofocus(); $field = $form->addTextField('name', $form->get('name')); $field->fieldName(lang::get('name')); $field = $form->addTextField('email', $form->get('email')); $field->fieldName(lang::get('email_adress')); $field->addValidator('notEmpty', lang::get('user_email_empty')); $field->addValidator('email', lang::get('user_wrong_email')); if ($form->get('password') != $form->sql->getValue('password')) { $password = userLogin::hash($form->get('password'), $form->get('salt')); } else { $password = $form->sql->getValue('password'); }
<?php layout::addJS('addons/tinyMCE/layout/js/tinymce/tinymce.min.js'); layout::addJsCode('tinymce.init({ selector: "textarea.tinyMCE", relative_urls : false, document_base_url: "' . dyn::get('hp_url') . '", plugins: [ "advlist autolink lists link image charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste filemanager" ], toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image" }); ', false); $page = type::get('page', 'string'); $subpage = type::get('subpage', 'string'); $layout = type::get('layout', 'string'); if ($page == 'media' && $subpage == 'popup' && $layout == 'true') { layout::addJsCode("\n if(parent.tinymce.editors.length) {\n \$('.dyn-media-select').on('click', function() {\n parent.tinymce.activeEditor.windowManager.getParams().setUrl('/media/' + \$(this).data('name'));\n parent.tinymce.activeEditor.windowManager.close();\n });\n\t}\n "); }
<?php layout::addJS('addons/tinyMCE/layout/js/tinymce/tinymce.min.js'); layout::addJsCode('tinymce.init({ selector: "textarea.tinyMCE", plugins: [ "advlist autolink lists link image charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste" ], toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image" }); ', false);
</div> </div> </div> <?php } } else { if ($action == 'delete' && dyn::get('user')->hasPerm('page[delete]')) { $sql = sql::factory(); $sql->setTable('slots'); $sql->setWhere('id=' . $id); $sql->delete(); echo message::success(lang::get('slot_deleted'), true); $action = ''; } if ($action == 'add' || $action == 'edit' && dyn::get('user')->hasPerm('page[edit]')) { layout::addJsCode("\n\tvar button = \$('#allcat-button');\n\tvar content = \$('#allcat-content');\n\t\n\tbutton.change(function() {\n\t\t\tif(button.is(':checked')) {\n\t\t\t\tcontent.stop().slideUp(300);\n\t\t\t} else {\n\t\t\t\tcontent.stop().slideDown(300);\n\t\t\t}\n\t});"); $form = form::factory('slots', 'id=' . $id, 'index.php'); $field = $form->addTextField('name', $form->get('name')); $field->fieldName(lang::get('name')); $field->autofocus(); $field = $form->addTextField('description', $form->get('description')); $field->fieldName(lang::get('description')); $field = $form->addRawField('<select name="modul" class="form-control">' . pageAreaHtml::moduleList($form->get('modul')) . '</select>'); $field->fieldName(lang::get('module')); $field = $form->addCheckboxField('is-structure', $form->get('is-structure')); $field->fieldName(lang::get('slots_show')); $field->add('1', lang::get('all_categories'), ['id' => 'allcat-button']); $select = pageMisc::getTreeStructure(true, $form->get('structure')); if ($form->get('is-structure') == 1) { $select->addAttribute('style', 'display:none;'); }