init
This commit is contained in:
591
mysyde/DcAutoloader.php
Normal file
591
mysyde/DcAutoloader.php
Normal file
@@ -0,0 +1,591 @@
|
||||
<?php
|
||||
|
||||
class DcAutoloader
|
||||
{
|
||||
private static $map = array (
|
||||
'LanguageFunctions' =>
|
||||
array (
|
||||
0 => '/mysyde/admin/edit_language_functions.php',
|
||||
),
|
||||
'SiteFunctions' =>
|
||||
array (
|
||||
0 => '/mysyde/admin/edit_site_functions.php',
|
||||
),
|
||||
'TemplateInserterBase' =>
|
||||
array (
|
||||
0 => '/mysyde/common/abstracts/TemplateInserterBase.php',
|
||||
),
|
||||
'URLBase' =>
|
||||
array (
|
||||
0 => '/mysyde/common/abstracts/URLBase.php',
|
||||
),
|
||||
'Address' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Address.php',
|
||||
),
|
||||
'AddressCollection' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/AddressCollection.php',
|
||||
),
|
||||
'AddressConfig' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/AddressConfig.php',
|
||||
),
|
||||
'Adminmenu' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Adminmenu.php',
|
||||
),
|
||||
'BasicControlFlowHandler' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/BasicControlFlowHandler.php',
|
||||
),
|
||||
'CollectionTypes' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/CollectionTypes.php',
|
||||
),
|
||||
'DOMNodeView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/DOMNodeView.php',
|
||||
),
|
||||
'DOMTest' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/DOMTemplateTest.php',
|
||||
),
|
||||
'A' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/DOMTemplateTest.php',
|
||||
1 => '/mysyde/common/tests/HookTest.php',
|
||||
),
|
||||
'DOMViewModelTest' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/DOMViewModelTest.php',
|
||||
),
|
||||
'EMail' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/EMail.php',
|
||||
),
|
||||
'Encryption' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Encryption.php',
|
||||
),
|
||||
'FlattenedGettableDecorator' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/FlattenedGettableDecorator.php',
|
||||
),
|
||||
'Form' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Form.php',
|
||||
),
|
||||
'FormBuilder' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/FormBuilder.php',
|
||||
),
|
||||
'FormElement' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/FormElement.php',
|
||||
),
|
||||
'GeneralErrorExceptionHandling' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GeneralErrorExceptionHandling.php',
|
||||
),
|
||||
'GenericCRUDObjectStorageUnitOfWork' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GenericCRUDObjectStorageUnitOfWork.php',
|
||||
),
|
||||
'GenericDOMRepositoryListView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GenericDOMRepositoryListView.php',
|
||||
),
|
||||
'GenericDOMView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GenericDOMView.php',
|
||||
),
|
||||
'GenericObjectStorage' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GenericObjectStorage.php',
|
||||
),
|
||||
'GenericPHTMLRepositoryListView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GenericPHTMLRepositoryListView.php',
|
||||
),
|
||||
'GenericPHTMLView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GenericPHTMLView.php',
|
||||
),
|
||||
'GenericPlainRepositoryListView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GenericPlainRepositoryListView.php',
|
||||
),
|
||||
'GenericPlainView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GenericPlainView.php',
|
||||
),
|
||||
'GenericServicePayload' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GenericServicePayload.php',
|
||||
),
|
||||
'GenericServicePayloadBuilder' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GenericServicePayloadBuilder.php',
|
||||
),
|
||||
'GenericView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/GenericView.php',
|
||||
),
|
||||
'Hook' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Hook.php',
|
||||
),
|
||||
'HTMLSnippetProvider' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/HTMLSnippetProvider.php',
|
||||
),
|
||||
'Language' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Language.php',
|
||||
),
|
||||
'LanguageCollection' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/LanguageCollection.php',
|
||||
),
|
||||
'LanguageConfig' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/LanguageConfig.php',
|
||||
),
|
||||
'LanguageRepository' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/LanguageRepository.php',
|
||||
),
|
||||
'MustacheTemplateEngine' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/MustacheTemplateEngine.php',
|
||||
),
|
||||
'MySQLiQueryWrapper' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/MySQLiQueryWrapper.php',
|
||||
),
|
||||
'NativeSessionFlashMessageBag' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/NativeSessionFlashMessageBag.php',
|
||||
),
|
||||
'NAVDateFormulaManagement' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/NAVDateFormulaManagement.php',
|
||||
),
|
||||
'NewValidator' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/NewValidator.php',
|
||||
),
|
||||
'Page' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Page.php',
|
||||
),
|
||||
'PageCollection' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/PageCollection.php',
|
||||
),
|
||||
'PageConfig' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/PageConfig.php',
|
||||
),
|
||||
'PageRepository' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/PageRepository.php',
|
||||
),
|
||||
'PDOQueryWrapper' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/PDOQueryWrapper.php',
|
||||
),
|
||||
'Registry' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Registry.php',
|
||||
),
|
||||
'RememberMeHandlerService' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/RememberMeHandlerService.php',
|
||||
),
|
||||
'RenderableElementResolver' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/RenderableElementResolver.php',
|
||||
),
|
||||
'RenderableStringTransformer' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/RenderableStringTransformer.php',
|
||||
),
|
||||
'SalutationOptions' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/SalutationOptions.php',
|
||||
),
|
||||
'SelectionCriteriaHelper' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/SelectionCriteriaHelper.php',
|
||||
),
|
||||
'ServiceRequestID' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/ServiceRequestID.php',
|
||||
),
|
||||
'SessionHandlerService' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/SessionHandlerService.php',
|
||||
),
|
||||
'SessionStorage' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/SessionStorage.php',
|
||||
),
|
||||
'Site' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Site.php',
|
||||
),
|
||||
'SiteCollection' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/SiteCollection.php',
|
||||
),
|
||||
'SiteConfig' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/SiteConfig.php',
|
||||
),
|
||||
'Siteparts' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Siteparts.php',
|
||||
),
|
||||
'SiteRepository' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/SiteRepository.php',
|
||||
),
|
||||
'StdMD5PasswordCheckerStrategy' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/StdMD5PasswordCheckerStrategy.php',
|
||||
),
|
||||
'TemplateDefaultInserter' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/TemplateDefaultInserter.php',
|
||||
),
|
||||
'TemplateDOMInserter' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/TemplateDOMInserter.php',
|
||||
),
|
||||
'TemplateInserter' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/TemplateInserter.php',
|
||||
),
|
||||
'TemplateInserterFactory' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/TemplateInserterFactory.php',
|
||||
),
|
||||
'TemplateStringInserter' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/TemplateStringInserter.php',
|
||||
),
|
||||
'Templating' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Templating.php',
|
||||
),
|
||||
'Translate' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Translate.php',
|
||||
),
|
||||
'UnitOfWork' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/UnitOfWork.php',
|
||||
),
|
||||
'UploadedFileTypeCheckingService' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/UploadedFileTypeCheckingService.php',
|
||||
),
|
||||
'URL' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/URL.php',
|
||||
),
|
||||
'URLImmutable' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/URLImmutable.php',
|
||||
),
|
||||
'URLMaker' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/URLMaker.php',
|
||||
),
|
||||
'Validator' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Validator.php',
|
||||
),
|
||||
'ViewFactory' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/ViewFactory.php',
|
||||
),
|
||||
'Visitor' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/Visitor.php',
|
||||
),
|
||||
'VisitorCollection' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/VisitorCollection.php',
|
||||
),
|
||||
'VisitorConfig' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/VisitorConfig.php',
|
||||
),
|
||||
'VisitorRepository' =>
|
||||
array (
|
||||
0 => '/mysyde/common/classes/VisitorRepository.php',
|
||||
),
|
||||
'ArrayGettable' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/ArrayGettable.php',
|
||||
),
|
||||
'UserAuthenticationStrategy' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/AuthStrategy.php',
|
||||
),
|
||||
'CriteriaHelperInterface' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/CriteriaHelperInterface.php',
|
||||
),
|
||||
'CRUDObjectStorage' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/CRUDObjectStorage.php',
|
||||
),
|
||||
'DOMRepositoryListView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/DOMRepositoryListView.php',
|
||||
),
|
||||
'DOMTemplate' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/DOMTemplate.php',
|
||||
),
|
||||
'DOMView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/DOMView.php',
|
||||
),
|
||||
'Entity' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/Entity.php',
|
||||
),
|
||||
'FlattenedGettable' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/FlattenedGettable.php',
|
||||
),
|
||||
'GenericDBModelInterface' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/GenericDBModelInterface.php',
|
||||
),
|
||||
'GenericDBQueryWrapperInterface' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/GenericDBQueryWrapperInterface.php',
|
||||
),
|
||||
'GenericObjectStorageInterface' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/GenericObjectStorageInterface.php',
|
||||
),
|
||||
'GenericTemplateInserterInterface' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/GenericTemplateInserterInterface.php',
|
||||
),
|
||||
'GenericViewInterface' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/GenericViewInterface.php',
|
||||
),
|
||||
'HashingStrategy' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/HashingStrategy.php',
|
||||
),
|
||||
'IOCInterface' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/IOCInterface.php',
|
||||
),
|
||||
'Observer' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/Observer.php',
|
||||
),
|
||||
'PageableViewInterface' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/PageableViewInterface.php',
|
||||
),
|
||||
'PasswordCheckerInterface' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/PasswordCheckerInterface.php',
|
||||
),
|
||||
'PHTMLRepositoryListView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/PHTMLRepositoryListView.php',
|
||||
),
|
||||
'PHTMLTemplate' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/PHTMLTemplate.php',
|
||||
),
|
||||
'PHTMLView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/PHTMLView.php',
|
||||
),
|
||||
'PlainRepositoryListView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/PlainRepositoryListView.php',
|
||||
),
|
||||
'PlainTemplate' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/PlainTemplate.php',
|
||||
),
|
||||
'PlainView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/PlainView.php',
|
||||
),
|
||||
'Repository' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/Repository.php',
|
||||
),
|
||||
'RepositoryListView' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/RepositoryListView.php',
|
||||
),
|
||||
'RepositoryUnitOfWorkInterface' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/RepositoryUnitOfWorkInterface.php',
|
||||
),
|
||||
'ServicePayload' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/ServicePayload.php',
|
||||
),
|
||||
'SessionFlashMessageBag' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/SessionFlashMessageBag.php',
|
||||
),
|
||||
'Template' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/Template.php',
|
||||
),
|
||||
'TemplateEngine' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/TemplateEngine.php',
|
||||
),
|
||||
'UnitOfWorkInterface' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/UnitOfWorkInterface.php',
|
||||
),
|
||||
'View' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/View.php',
|
||||
),
|
||||
'ViewModel' =>
|
||||
array (
|
||||
0 => '/mysyde/common/interfaces/ViewModel.php',
|
||||
),
|
||||
'log_mysql' =>
|
||||
array (
|
||||
0 => '/mysyde/common/logparser/class.log.mysql.php',
|
||||
),
|
||||
'log_output' =>
|
||||
array (
|
||||
0 => '/mysyde/common/logparser/class.log.output.php',
|
||||
),
|
||||
'log' =>
|
||||
array (
|
||||
0 => '/mysyde/common/logparser/class.log.php',
|
||||
),
|
||||
'log_processor' =>
|
||||
array (
|
||||
0 => '/mysyde/common/logparser/class.log.processor.php',
|
||||
),
|
||||
'B' =>
|
||||
array (
|
||||
0 => '/mysyde/common/tests/HookTest.php',
|
||||
),
|
||||
'C' =>
|
||||
array (
|
||||
0 => '/mysyde/common/tests/HookTest.php',
|
||||
),
|
||||
'arrayGettableTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/arrayGettableTrait.php',
|
||||
),
|
||||
'arrayMappableTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/arrayMappableTrait.php',
|
||||
),
|
||||
'directoryFileWriterTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/directoryFileWriterTrait.php',
|
||||
),
|
||||
'flattenedGettableTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/flattenedGettableTrait.php',
|
||||
),
|
||||
'genericCollectionTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/genericCollectionTrait.php',
|
||||
),
|
||||
'genericConfigTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/genericConfigTrait.php',
|
||||
),
|
||||
'genericDBModelTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/genericDBModelTrait.php',
|
||||
),
|
||||
'genericPlainTemplateTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/genericPlainTemplateTrait.php',
|
||||
),
|
||||
'genericRepositoryListViewTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/genericRepositoryListViewTrait.php',
|
||||
),
|
||||
'genericRepositoryTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/genericRepositoryTrait.php',
|
||||
),
|
||||
'genericViewModelTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/genericViewModelTrait.php',
|
||||
),
|
||||
'genericViewTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/genericViewTrait.php',
|
||||
),
|
||||
'hasConfigTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/hasConfigTrait.php',
|
||||
),
|
||||
'hookableTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/hookableTrait.php',
|
||||
),
|
||||
'reflectionIDSetter' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/reflectionIDSetter.php',
|
||||
),
|
||||
'universallyGettableTrait' =>
|
||||
array (
|
||||
0 => '/mysyde/common/traits/universallyGettableTrait.php',
|
||||
),
|
||||
'DcAutoloader' =>
|
||||
array (
|
||||
0 => '/mysyde/DcAutoloader.php',
|
||||
),
|
||||
'PDORegionalizedTextProvider' =>
|
||||
array (
|
||||
0 => '/mysyde/regionalization/PDORegionalizedTextProvider.php',
|
||||
),
|
||||
'PHPFileRegionalizedTextProvider' =>
|
||||
array (
|
||||
0 => '/mysyde/regionalization/PHPFileRegionalizedTextProvider.php',
|
||||
),
|
||||
'RegionalizedTextProvider' =>
|
||||
array (
|
||||
0 => '/mysyde/regionalization/RegionalizedTextProvider.php',
|
||||
),
|
||||
);
|
||||
|
||||
public function register()
|
||||
{
|
||||
spl_autoload_register([__NAMESPACE__ . '\\' . __CLASS__,'resolve']);
|
||||
}
|
||||
|
||||
public static function resolve($class)
|
||||
{
|
||||
if (isset(static::$map[$class])) {
|
||||
foreach (static::$map[$class] as $includePath) {
|
||||
include(rtrim($_SERVER['DOCUMENT_ROOT'],'/') . $includePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
895
mysyde/admin/admin.js
Normal file
895
mysyde/admin/admin.js
Normal file
@@ -0,0 +1,895 @@
|
||||
var openCardOnStart = false;
|
||||
var openCardAction = 'edit';
|
||||
var reloadAfterClose = true;
|
||||
let keysPressed = {};
|
||||
|
||||
/** Shortcuts für Page Bearbeitung DuP 20201103 **/
|
||||
$(document).keyup(function(event) {
|
||||
var keycode = (event.keyCode ? event.keyCode : event.which);
|
||||
delete keysPressed[keycode];
|
||||
});
|
||||
$(document).keydown(function(event) {
|
||||
var keycode = (event.keyCode ? event.keyCode : event.which);
|
||||
keysPressed[keycode] = true;
|
||||
|
||||
// if (event.ctrlKey && event.keyCode == 83) {
|
||||
// event.preventDefault();
|
||||
// button_properties = $('.button_save');
|
||||
// setCurrentToolbarClicked(button_properties);
|
||||
// loadCard('save_line_properties_page', true);
|
||||
// }
|
||||
if ($("form#form_inhalte").length) {
|
||||
switch (keycode) {
|
||||
case 80:
|
||||
//Seiten-Einstellungen Key = P
|
||||
button_properties = $('.button_properties[data-formname="form_field_list"]');
|
||||
setCurrentToolbarClicked(button_properties);
|
||||
loadCard('edit_page', true);
|
||||
break;
|
||||
case 73:
|
||||
//Inhalts-Einstellungen Key = I
|
||||
button_properties = $('.button_properties[data-formname="form_field_list"]');
|
||||
setCurrentToolbarClicked(button_properties);
|
||||
loadCard('edit_line_properties_page');
|
||||
break;
|
||||
case 69:
|
||||
//Inhalt bearbeiten Key = E
|
||||
button_properties = $('.button_edit[data-formname="form_field_list"]');
|
||||
setCurrentToolbarClicked(button_properties);
|
||||
loadCard('edit_line_page');
|
||||
break;
|
||||
case 86:
|
||||
//Inhalt erstellen Key = V
|
||||
button_properties = $('.button_inhalt_text[data-formname="form_inhalte"]');
|
||||
setCurrentToolbarClicked(button_properties);
|
||||
contentmenuClick(button_properties, 'textcontent', false, 1);
|
||||
break;
|
||||
case 71:
|
||||
//Gruppe erstellen Key = G
|
||||
button_properties = $('.button_inhalt_collection.graybox[data-formname="form_inhalte"]');
|
||||
setCurrentToolbarClicked(button_properties);
|
||||
contentmenuClick(button_properties, 'group', true);
|
||||
break;
|
||||
case 46:
|
||||
//Inhalt löschen Key = ENTF
|
||||
button_properties = $('.button_delete[data-formname="form_field_list"]');
|
||||
setCurrentToolbarClicked(button_properties);
|
||||
loadCard('delete_line_page', false, 'Wollen Sie die Zuordnung wirklich löschen?');
|
||||
break;
|
||||
case 38:
|
||||
//Inhalt nach oben Key = Pfeil hoch
|
||||
button_properties = $('.button_up[data-formname="form_field_list"]');
|
||||
setCurrentToolbarClicked(button_properties);
|
||||
loadCard('moveup_line_page');
|
||||
break;
|
||||
case 40:
|
||||
//Inhalt nach unten Key = Pfeil unten
|
||||
button_properties = $('.button_down[data-formname="form_field_list"]');
|
||||
setCurrentToolbarClicked(button_properties);
|
||||
loadCard('movedown_line_page');
|
||||
break;
|
||||
default:
|
||||
// code block
|
||||
}
|
||||
}
|
||||
if ($("form#form_collection_cardform").length) {
|
||||
// Strg und S -> Kollektion speichern
|
||||
if ((event.ctrlKey || event.metaKey) && keycode == 83) {
|
||||
event.preventDefault();
|
||||
button_properties = $('.button_save[data-formname="form_collection_cardform"]');
|
||||
setCurrentToolbarClicked(button_properties);
|
||||
saveCollection(false);
|
||||
}
|
||||
}
|
||||
if ((event.ctrlKey || event.metaKey) && keycode == 89) {
|
||||
// Strg und Y -> Toggle Light/Darkmode
|
||||
|
||||
document.getElementById("theme-toggle").checked = !document.getElementById("theme-toggle").checked;
|
||||
|
||||
event.preventDefault();
|
||||
var currentTheme = document.documentElement.getAttribute("data-theme");
|
||||
var targetTheme = "dark";
|
||||
|
||||
if (currentTheme === "dark") {
|
||||
targetTheme = "light";
|
||||
}
|
||||
|
||||
document.documentElement.setAttribute('data-theme', targetTheme)
|
||||
localStorage.setItem('theme', targetTheme);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jQuery(function($) {
|
||||
$.datepicker.regional['de'] = {
|
||||
clearText: 'löschen',
|
||||
clearStatus: 'aktuelles Datum löschen',
|
||||
closeText: 'schließen',
|
||||
closeStatus: 'ohne Änderungen schließen',
|
||||
prevText: '<zurück',
|
||||
prevStatus: 'letzten Monat zeigen',
|
||||
nextText: 'Vor>',
|
||||
nextStatus: 'nächsten Monat zeigen',
|
||||
currentText: 'heute',
|
||||
currentStatus: '',
|
||||
monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
|
||||
'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
|
||||
],
|
||||
monthNamesShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun',
|
||||
'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'
|
||||
],
|
||||
monthStatus: 'anderen Monat anzeigen',
|
||||
yearStatus: 'anderes Jahr anzeigen',
|
||||
weekHeader: 'Wo',
|
||||
weekStatus: 'Woche des Monats',
|
||||
dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
|
||||
dayNamesShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
|
||||
dayNamesMin: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
|
||||
dayStatus: 'Setze DD als ersten Wochentag',
|
||||
dateStatus: 'Wähle D, M d',
|
||||
dateFormat: 'dd.mm.yy',
|
||||
firstDay: 1,
|
||||
initStatus: 'Wähle ein Datum',
|
||||
isRTL: false
|
||||
};
|
||||
$.datepicker.setDefaults($.datepicker.regional['de']);
|
||||
});
|
||||
|
||||
function toggleOn(a) {
|
||||
var e = document.getElementById(a);
|
||||
if (!e) {
|
||||
return true;
|
||||
}
|
||||
e.style.display = "block";
|
||||
return true;
|
||||
}
|
||||
|
||||
function toggleOff(a) {
|
||||
var e = document.getElementById(a);
|
||||
if (!e) {
|
||||
return true;
|
||||
}
|
||||
e.style.display = "none";
|
||||
return true;
|
||||
}
|
||||
|
||||
function toggle(a) {
|
||||
var e = document.getElementById(a);
|
||||
if (e.style.display != "block") {
|
||||
if (!e) {
|
||||
return true;
|
||||
}
|
||||
e.style.display = "block";
|
||||
} else {
|
||||
e.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function MM_jumpMenu(targ, selObj, restore) { //v3.0
|
||||
eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
|
||||
if (restore) {
|
||||
selObj.selectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function LangAJAXreq1() {
|
||||
var company = document.getElementById('company').value;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/mysyde/admin/edit_language_ajax.php",
|
||||
data: "company=" + company,
|
||||
success: function(resp) {
|
||||
// we have the response
|
||||
$('#shopcode').empty().append(resp);
|
||||
},
|
||||
error: function(e) {
|
||||
alert('Error: ' + e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function LangAJAXreq2() {
|
||||
var shop = document.getElementById('shopcode').value;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/mysyde/admin/edit_language_ajax.php",
|
||||
data: "shop=" + shop,
|
||||
success: function(resp) {
|
||||
// we have the response
|
||||
$('#language_code').empty().append(resp);
|
||||
},
|
||||
error: function(e) {
|
||||
alert('Error: ' + e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function LoginAJAXreq1() {
|
||||
var site = document.getElementById('site_id').value;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/mysyde/admin/edit_login_ajax.php",
|
||||
data: "site=" + site,
|
||||
success: function(resp) {
|
||||
// we have the response
|
||||
$('#main_language_id').empty().append(resp);
|
||||
},
|
||||
error: function(e) {
|
||||
alert('Error: ' + e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function LoginAJAXreq2() {
|
||||
var language = document.getElementById('main_language_id').value;
|
||||
var siteId = document.getElementById('site_id').value;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/mysyde/admin/edit_login_ajax.php",
|
||||
data: "language=" + language + "&site_code=" + siteId,
|
||||
success: function(resp) {
|
||||
// we have the response
|
||||
$('#main_navigation_id').empty().append(resp);
|
||||
},
|
||||
error: function(e) {
|
||||
alert('Error: ' + e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function dctest() {
|
||||
alert("zum glück geht das");
|
||||
}
|
||||
|
||||
// linklist functions
|
||||
var dc = {};
|
||||
dc.overlay_mode = false; // Karte offen ja nein
|
||||
dc.linklist_marked = null; // markierte Zeile in einer linkiste
|
||||
dc.mouse_in_linklist = false; // wenn der mauszeiger sich ueber einer linkliste befindet, dann true
|
||||
dc.current_linklist = null; // aktuelle linkliste - entweder direkt im content oder im overlay
|
||||
dc.current_formname = null;
|
||||
dc.files;
|
||||
dc.reorder_call = null; // ajax request zum aendern der reihenfolge in den linklisten
|
||||
|
||||
// Grab the files and set them to our variable
|
||||
function prepareUpload(event) {
|
||||
dc.files = event.target.files;
|
||||
}
|
||||
|
||||
function centerElement(_el) {
|
||||
_el.css({
|
||||
position: 'absolute',
|
||||
left: ($(window).width() - _el.outerWidth()) / 2,
|
||||
top: ($(window).height() - _el.outerHeight()) / 4
|
||||
});
|
||||
}
|
||||
|
||||
function setFormname(_formname) {
|
||||
dc.current_formname = _formname;
|
||||
}
|
||||
|
||||
function setCurrentToolbarClicked(_el) {
|
||||
setFormname(jQuery(_el).data('formname'));
|
||||
}
|
||||
|
||||
function initLinklist() {
|
||||
dc.linklist_marked = null;
|
||||
dc.mouse_in_linklist = false;
|
||||
|
||||
jQuery('.linklist').each(function() {
|
||||
if (jQuery(this).data('linklist_init') === true) {
|
||||
return;
|
||||
}
|
||||
var thiz = this;
|
||||
|
||||
if ($(this).hasClass("sortableTable")) {
|
||||
makeSortable($(this));
|
||||
}
|
||||
|
||||
jQuery('.linklist_content', this).click(function() {
|
||||
if (dc.linklist_marked !== null) {
|
||||
jQuery(dc.linklist_marked).removeClass("linklist_active");
|
||||
}
|
||||
jQuery(this).addClass("linklist_active");
|
||||
dc.linklist_marked = this;
|
||||
dc.current_linklist = thiz;
|
||||
}).mouseenter(function() {
|
||||
dc.mouse_in_linklist = true;
|
||||
}).mouseleave(function() {
|
||||
dc.mouse_in_linklist = false;
|
||||
}).dblclick(function(e) {
|
||||
if (jQuery(this).data('function') !== undefined) {
|
||||
var userFunc = jQuery(this).data('function');
|
||||
var funcCall = userFunc + "(this);";
|
||||
eval(funcCall);
|
||||
return;
|
||||
}
|
||||
|
||||
var target = jQuery(e.target);
|
||||
setFormname(target.closest('form').attr("id"));
|
||||
if (jQuery(this).data("action") != 'no_edit') {
|
||||
loadCard(jQuery(this).data("action"));
|
||||
}
|
||||
}).each(function() {
|
||||
if (jQuery(this).data('checked') == true) {
|
||||
jQuery(this).addClass("linklist_active");
|
||||
dc.linklist_marked = this;
|
||||
dc.current_linklist = thiz;
|
||||
setFormname(jQuery(this).closest('form').attr("id"));
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(this).data('linklist_init', true);
|
||||
});
|
||||
|
||||
if (openCardOnStart === true) {
|
||||
loadCard(openCardAction, true);
|
||||
openCardOnStart = false;
|
||||
}
|
||||
}
|
||||
|
||||
function sortableHelper(e, tr) {
|
||||
var $originals = tr.children();
|
||||
var $helper = tr.clone();
|
||||
$helper.children().each(function(index) {
|
||||
// Set helper cell sizes to match the original sizes
|
||||
$(this).width($originals.eq(index).width());
|
||||
});
|
||||
return $helper;
|
||||
}
|
||||
|
||||
function makeSortable(_linklist) {
|
||||
_linklist.sortable({
|
||||
'axis': 'y',
|
||||
'items': '.linklist_content',
|
||||
handle: '.sorticon',
|
||||
stop: function(event, ui) {
|
||||
if (dc.reorder_call !== null) {
|
||||
dc.reorder_call.abort();
|
||||
}
|
||||
|
||||
serialized = _linklist.sortable('serialize');
|
||||
reorderCall = jQuery.post("?action=" + _linklist.data("sortableupdateaction"), serialized, function(output, status, xhr) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
}
|
||||
});
|
||||
},
|
||||
helper: sortableHelper
|
||||
});
|
||||
}
|
||||
|
||||
function initForm() {
|
||||
$('#overlayContent input.date').each(function() {
|
||||
if (jQuery(this).data('datepicker_init') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
// jQuery(this).datepicker();
|
||||
|
||||
jQuery(this).data('datepicker_init', true);
|
||||
});
|
||||
|
||||
$('#overlayContent form').submit(function() {
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function loadSite(site){
|
||||
window.location.href = site;
|
||||
}
|
||||
|
||||
function initDatepicker() {
|
||||
$('#mainContent input.date').datepicker();
|
||||
}
|
||||
|
||||
function scrollSiteNavigation() {
|
||||
var h = $(window).height();
|
||||
var actualHeight = $('.site_dropdown').actual("height");
|
||||
var newHeight = (h / 100 * 75);
|
||||
if (actualHeight > newHeight) {
|
||||
$('.site_dropdown').css('height', newHeight + 'px');
|
||||
$('.site_dropdown').css('overflow-y', 'scroll');
|
||||
}
|
||||
}
|
||||
|
||||
var addEvent = function(object, type, callback) {
|
||||
if (object == null || typeof(object) == 'undefined') return;
|
||||
if (object.addEventListener) {
|
||||
object.addEventListener(type, callback, false);
|
||||
} else if (object.attachEvent) {
|
||||
object.attachEvent("on" + type, callback);
|
||||
} else {
|
||||
object["on" + type] = callback;
|
||||
}
|
||||
};
|
||||
|
||||
function scrollSiteNavigationOnResize() {
|
||||
addEvent(window, "resize", scrollSiteNavigation);
|
||||
}
|
||||
|
||||
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
initLinklist();
|
||||
// initDatepicker();
|
||||
|
||||
scrollSiteNavigation();
|
||||
scrollSiteNavigationOnResize();
|
||||
|
||||
|
||||
|
||||
|
||||
// click auf document
|
||||
}).click(function(e) {
|
||||
if (dc.current_linklist !== null && dc.mouse_in_linklist === false && e.target.nodeName.toLowerCase() != 'a') {
|
||||
// unmark all linklist
|
||||
jQuery('.linklist_content', dc.current_linklist).removeClass("linklist_active");
|
||||
dc.linklist_marked = null;
|
||||
}
|
||||
|
||||
// keyboardtaste druecken und halten (steuerung der linkliste mit pfeiltasten
|
||||
}).keydown(function(event) {
|
||||
if (dc.overlay_mode === true && event.keyCode == 27) { // ESC
|
||||
if (jQuery('body').hasClass("ckeditor_maximized")) {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
disableOverlay();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (event.keyCode) {
|
||||
//arrow down
|
||||
case 40:
|
||||
var nextRow = jQuery(dc.linklist_marked).nextAll('.linklist_content:visible:first');
|
||||
if (nextRow.length == 0) {
|
||||
return;
|
||||
}
|
||||
nextRow.addClass("linklist_active");
|
||||
jQuery(dc.linklist_marked).removeClass("linklist_active");
|
||||
dc.linklist_marked = nextRow;
|
||||
break;
|
||||
//arrow up
|
||||
case 38:
|
||||
var prevRow = jQuery(dc.linklist_marked).prevAll('.linklist_content:visible:first');
|
||||
if (prevRow.length == 0) {
|
||||
return;
|
||||
}
|
||||
prevRow.addClass("linklist_active");
|
||||
jQuery(dc.linklist_marked).removeClass("linklist_active");
|
||||
dc.linklist_marked = prevRow;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// keyboardtaste druecken
|
||||
}).keypress(function(event) {
|
||||
if (dc.linklist_marked === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.keyCode == 13) {
|
||||
jQuery(dc.linklist_marked).dblclick();
|
||||
}
|
||||
});
|
||||
|
||||
function reloadList() {
|
||||
jQuery('#mainContent').find('.requestLoader').show();
|
||||
|
||||
// reload
|
||||
//document.location = String(document.location).replace(/\?.*$/, '');
|
||||
document.location = replaceUrlParam(String(document.location), 'action', "");
|
||||
return;
|
||||
}
|
||||
|
||||
function replaceUrlParam(url, paramName, paramValue) {
|
||||
var pattern = new RegExp('(' + paramName + '=).*?(&|$)')
|
||||
var newUrl = url
|
||||
if (url.search(pattern) >= 0) {
|
||||
newUrl = url.replace(pattern, '$1' + paramValue + '$2');
|
||||
} else {
|
||||
newUrl = newUrl + (newUrl.indexOf('?') > 0 ? '&' : '?') + paramName + '=' + paramValue
|
||||
}
|
||||
return newUrl
|
||||
}
|
||||
|
||||
function gotoLocation(_href) {
|
||||
document.location = _href;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Overlay Functions
|
||||
========================================================================== */
|
||||
function createOverlay() {
|
||||
dc.linklist_marked = null;
|
||||
dc.current_linklist = null;
|
||||
|
||||
if (dc.overlay_mode === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
dc.overlay_mode = true;
|
||||
jQuery('#overlay').show();
|
||||
|
||||
// overlay wrapper
|
||||
jQuery('#overlayWrapper').show();
|
||||
|
||||
jQuery('#overlayLoader').show();
|
||||
$("#mainContent, .toolbar_menu").hide();
|
||||
$("div#content_3").hide();
|
||||
$("ul.toolbar_menu.collection, .collection_form.collection ").wrapAll("<div class='omega-site-part'></div>");
|
||||
$("#content-collection").insertBefore(".site");
|
||||
|
||||
}
|
||||
|
||||
|
||||
function disableOverlay() {
|
||||
dc.overlay_mode = false;
|
||||
jQuery('#overlay').hide();
|
||||
jQuery('#overlayContent').html("").hide();
|
||||
jQuery('#overlayWrapper').hide();
|
||||
jQuery('#overlayLoader').hide();
|
||||
jQuery('body').removeClass("ckeditor_maximized");
|
||||
|
||||
if (reloadAfterClose === true) {
|
||||
reloadList();
|
||||
return;
|
||||
}
|
||||
|
||||
jQuery('.linklist_content').removeClass("linklist_active");
|
||||
dc.linklist_marked = null;
|
||||
dc.current_linklist = null;
|
||||
}
|
||||
|
||||
function getFormData(_form) {
|
||||
for (instance in CKEDITOR.instances) {
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
}
|
||||
|
||||
return _form.serialize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Absenden von requests ausserhalb vom overlay
|
||||
*
|
||||
* @param _action
|
||||
* @param _load_without_check
|
||||
* @param _confirmtext
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
function sendRequest(_action, _load_without_check, _confirmtext) {
|
||||
// variable zum pruefen ob in einer linkliste ein element markiert wurde
|
||||
var load_without_check = _load_without_check || false;
|
||||
|
||||
if (load_without_check === false) {
|
||||
var currentMarkedLinklistRow = jQuery('.linklist_active', jQuery('#' + dc.current_formname));
|
||||
|
||||
if (dc.current_linklist === null || currentMarkedLinklistRow.length <= 0) {
|
||||
return;
|
||||
}
|
||||
var input_id = currentMarkedLinklistRow.data('inputid');
|
||||
jQuery('input.selected_linklist_row', jQuery('#' + dc.current_formname)).val(input_id);
|
||||
}
|
||||
|
||||
var confirmtext = _confirmtext || false;
|
||||
if (confirmtext !== false && confirmtext != "") {
|
||||
if (!confirm(confirmtext)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (dc.overlay_mode === true) {
|
||||
jQuery('#overlayLoader').show();
|
||||
} else {
|
||||
jQuery('#mainContent').find('.requestLoader').show();
|
||||
}
|
||||
|
||||
jQuery('#' + dc.current_formname).attr("action", "?action=" + _action);
|
||||
jQuery('#' + dc.current_formname).submit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Karte im overlay laden
|
||||
*
|
||||
* @param _action
|
||||
* @param _load_without_check
|
||||
* @param _confirmtext
|
||||
* @param _closeOverlay
|
||||
* @param _customFormData
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
function backButton(){
|
||||
location.reload();
|
||||
}
|
||||
function loadCard_frontend(_action, _load_without_check, _confirmtext, _closeOverlay, _customFormData) {
|
||||
var confirmtext = _confirmtext || false;
|
||||
var closeOverlay = _closeOverlay || false;
|
||||
var action = _action || "";
|
||||
var currentMarkedLinklistRow = jQuery('.linklist_active', jQuery('#' + dc.current_formname));
|
||||
var customFormData = _customFormData || false;
|
||||
|
||||
// variable zum pruefen ob in einer linkliste ein element markiert wurde
|
||||
var load_without_check = _load_without_check || false;
|
||||
|
||||
// wenn ein listenelement markiert werden MUSS und keins markiert ist, dann nichts machen
|
||||
if (load_without_check === false) {
|
||||
if (dc.current_linklist === null || currentMarkedLinklistRow.length <= 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// wenn bestaetigungstext vorhanden ist user auf Abbrechen klickt, dann return
|
||||
if (confirmtext !== false && confirmtext != "") {
|
||||
if (!confirm(confirmtext)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Wenn listenelement martkiert ist, dann die inputid uebergeben
|
||||
if (currentMarkedLinklistRow.length > 0) {
|
||||
var input_id = currentMarkedLinklistRow.data('inputid');
|
||||
jQuery('input.selected_linklist_row', jQuery('#' + dc.current_formname)).val(input_id);
|
||||
}
|
||||
|
||||
// wird benoetigt damit die Inhalte des fckeditors uebertragen werden koennen
|
||||
for (instance in CKEDITOR.instances) {
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
}
|
||||
|
||||
// heller overlay ueber die ganze seite wird erstellt
|
||||
createOverlay();
|
||||
|
||||
// loader wird engezeigt
|
||||
jQuery('#overlayLoader').show();
|
||||
|
||||
// Sammeln von formulardaten
|
||||
if (customFormData !== false) {
|
||||
formData2 = customFormData;
|
||||
} else {
|
||||
var formData2 = new FormData($('#' + dc.current_formname)[0]);
|
||||
if (currentMarkedLinklistRow.length > 0) {
|
||||
$.each(currentMarkedLinklistRow.data(), function(idx, el) {
|
||||
formData2.append("data-" + idx, el);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (closeOverlay === true) {
|
||||
formData2.append("force_close", 1);
|
||||
} else {
|
||||
formData2.append("force_close", 0);
|
||||
}
|
||||
|
||||
// AJAX POST request abschicken. Formulardaten werden mit HTML5 FormData gesammelt und verschickt.
|
||||
// Dadurch ist es moeglich auch Dateien zu ubertragen (Bildupload moeglich).
|
||||
// Fuer den Dateiupload muessen die variablen processData, cache und contentType auf false gesetzt werden
|
||||
|
||||
$.ajax({
|
||||
url: "?action=" + action,
|
||||
type: 'POST',
|
||||
data: formData2,
|
||||
mimeType: "multipart/form-data",
|
||||
cache: false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success: function(output, status, xhr) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
if (closeOverlay === true && xhr.getResponseHeader('EDIT_ERROR') != 1) {
|
||||
|
||||
disableOverlay();
|
||||
} else {
|
||||
|
||||
jQuery('#overlayContent').html(output);
|
||||
jQuery('#overlayLoader').hide();
|
||||
jQuery('#overlayContent').show();
|
||||
if ($('#input_collection_id_frontend').length > 0) {
|
||||
// The input field with ID 'inputId' exists
|
||||
var inputValue = $('#input_collection_id_frontend').val();
|
||||
if (inputValue != null && inputValue != undefined && inputValue.trim() != '') {
|
||||
var currentUrl = window.location.href;
|
||||
var parameterName = 'mian_collection_id';
|
||||
|
||||
// Check if the parameter already exists in the URL
|
||||
if (currentUrl.indexOf(parameterName) !== -1) {
|
||||
// Update the value of the parameter
|
||||
var regex = new RegExp('(' + parameterName + '=)([^&]+)');
|
||||
var newUrl = currentUrl.replace(regex, '$1' + inputValue);
|
||||
} else {
|
||||
// Append the new parameter to the URL
|
||||
var newUrl = currentUrl + (currentUrl.indexOf('?') !== -1 ? '&' : '?') + parameterName + '=' + inputValue;
|
||||
}
|
||||
|
||||
// Reload the page with the updated URL
|
||||
window.location.href = newUrl;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
initForm();
|
||||
initLinklist();
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
//console.log('ERRORS: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
function loadCard(_action, _load_without_check, _confirmtext, _closeOverlay, _customFormData) {
|
||||
var confirmtext = _confirmtext || false;
|
||||
var closeOverlay = _closeOverlay || false;
|
||||
var action = _action || "";
|
||||
var currentMarkedLinklistRow = jQuery('.linklist_active', jQuery('#' + dc.current_formname));
|
||||
var customFormData = _customFormData || false;
|
||||
|
||||
// variable zum pruefen ob in einer linkliste ein element markiert wurde
|
||||
var load_without_check = _load_without_check || false;
|
||||
|
||||
// wenn ein listenelement markiert werden MUSS und keins markiert ist, dann nichts machen
|
||||
if (load_without_check === false) {
|
||||
if (dc.current_linklist === null || currentMarkedLinklistRow.length <= 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// wenn bestaetigungstext vorhanden ist user auf Abbrechen klickt, dann return
|
||||
if (confirmtext !== false && confirmtext != "") {
|
||||
if (!confirm(confirmtext)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Wenn listenelement martkiert ist, dann die inputid uebergeben
|
||||
if (currentMarkedLinklistRow.length > 0) {
|
||||
var input_id = currentMarkedLinklistRow.data('inputid');
|
||||
jQuery('input.selected_linklist_row', jQuery('#' + dc.current_formname)).val(input_id);
|
||||
}
|
||||
|
||||
// wird benoetigt damit die Inhalte des fckeditors uebertragen werden koennen
|
||||
for (instance in CKEDITOR.instances) {
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
}
|
||||
|
||||
// heller overlay ueber die ganze seite wird erstellt
|
||||
createOverlay();
|
||||
|
||||
// loader wird engezeigt
|
||||
jQuery('#overlayLoader').show();
|
||||
|
||||
// Sammeln von formulardaten
|
||||
if (customFormData !== false) {
|
||||
formData2 = customFormData;
|
||||
} else {
|
||||
var formData2 = new FormData($('#' + dc.current_formname)[0]);
|
||||
if (currentMarkedLinklistRow.length > 0) {
|
||||
$.each(currentMarkedLinklistRow.data(), function(idx, el) {
|
||||
formData2.append("data-" + idx, el);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (closeOverlay === true) {
|
||||
formData2.append("force_close", 1);
|
||||
} else {
|
||||
formData2.append("force_close", 0);
|
||||
}
|
||||
|
||||
// AJAX POST request abschicken. Formulardaten werden mit HTML5 FormData gesammelt und verschickt.
|
||||
// Dadurch ist es moeglich auch Dateien zu ubertragen (Bildupload moeglich).
|
||||
// Fuer den Dateiupload muessen die variablen processData, cache und contentType auf false gesetzt werden
|
||||
|
||||
$.ajax({
|
||||
url: "?action=" + action,
|
||||
type: 'POST',
|
||||
data: formData2,
|
||||
mimeType: "multipart/form-data",
|
||||
cache: false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success: function(output, status, xhr) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
if (closeOverlay === true && xhr.getResponseHeader('EDIT_ERROR') != 1) {
|
||||
|
||||
disableOverlay();
|
||||
} else {
|
||||
|
||||
jQuery('#overlayContent').html(output);
|
||||
jQuery('#overlayLoader').hide();
|
||||
jQuery('#overlayContent').show();
|
||||
|
||||
initForm();
|
||||
initLinklist();
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
//console.log('ERRORS: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
// custom selector
|
||||
/* When the user clicks on the button,
|
||||
toggle between hiding and showing the dropdown content */
|
||||
function myFunction(counter) {
|
||||
document.getElementById("myDropdown" + counter).classList.toggle("show");
|
||||
// $('.contentSection').hide();
|
||||
// document.getElementsByClassName('contentSection')[0].style.display = 'none';
|
||||
|
||||
console.log("myDropdown" + counter);
|
||||
}
|
||||
|
||||
function openGallery(input_id, image_id, type){
|
||||
var currentDate = new Date();
|
||||
var unixTimestamp = Math.floor(currentDate.getTime() / 1000);
|
||||
|
||||
var popupURL = '/components/files/filegallery_content.inc.php?input_id='+input_id+'&image_id='+image_id+'&type='+type+'&time='+unixTimestamp;
|
||||
var popup = window.open(popupURL, 'Popup-Fenster', 'width=1080,height=720');
|
||||
}
|
||||
|
||||
function delete_collection_image(input_id, image_id){
|
||||
document.getElementById(input_id).value = "";
|
||||
document.getElementById(image_id).src = "";
|
||||
}
|
||||
|
||||
// Close the dropdown if the user clicks outside of it
|
||||
window.onclick = function(event) {
|
||||
|
||||
if (!event.target.matches('.dropbtn')) {
|
||||
|
||||
var dropdowns = document.getElementsByClassName("dropdown-content");
|
||||
var i;
|
||||
for (i = 0; i < dropdowns.length; i++) {
|
||||
var openDropdown = dropdowns[i];
|
||||
if (openDropdown.classList.contains('show')) {
|
||||
openDropdown.classList.remove('show');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// custom selector
|
||||
|
||||
function openTab(evt, cityName) {
|
||||
var i, tabcontent, tablinks;
|
||||
tabcontent = document.getElementsByClassName("tabcontent");
|
||||
for (i = 0; i < tabcontent.length; i++) {
|
||||
tabcontent[i].style.display = "none";
|
||||
}
|
||||
tabcontentSection = document.getElementsByClassName("tabcontentSection");
|
||||
for (i = 0; i < tabcontentSection.length; i++) {
|
||||
tabcontentSection[i].style.display = "none";
|
||||
}
|
||||
tablinks = document.getElementsByClassName("tablinks");
|
||||
for (i = 0; i < tablinks.length; i++) {
|
||||
tablinks[i].className = tablinks[i].className.replace(" active", "");
|
||||
}
|
||||
document.getElementById(cityName).style.display = "block";
|
||||
evt.currentTarget.className += " active";
|
||||
}
|
||||
|
||||
function openSection(evt, cityName) {
|
||||
var i, tabcontent, tablinks;
|
||||
tabcontent = document.getElementsByClassName("tabcontentSection");
|
||||
for (i = 0; i < tabcontent.length; i++) {
|
||||
tabcontent[i].style.display = "none";
|
||||
}
|
||||
tablinks = document.getElementsByClassName("tablinksSection");
|
||||
for (i = 0; i < tablinks.length; i++) {
|
||||
tablinks[i].className = tablinks[i].className.replace(" active", "");
|
||||
}
|
||||
document.getElementById(cityName).style.display = "block";
|
||||
evt.currentTarget.className += " active";
|
||||
}
|
||||
195
mysyde/admin/admin.php
Normal file
195
mysyde/admin/admin.php
Normal file
@@ -0,0 +1,195 @@
|
||||
<?
|
||||
//Vendor Autoloader
|
||||
include(rtrim($_SERVER['DOCUMENT_ROOT'], '/') . '/vendor/autoload.php');
|
||||
|
||||
include(rtrim($_SERVER['DOCUMENT_ROOT'], '/') . '/mysyde/DcAutoloader.php');
|
||||
|
||||
require_once("mysyde_log.php");
|
||||
$dcAutoloader = new DcAutoloader();
|
||||
$dcAutoloader->register();
|
||||
|
||||
//Load environment variables from config if exists
|
||||
$envDir = rtrim(dirname(dirname(__DIR__)), '/') . '/config';
|
||||
if (is_dir($envDir)) {
|
||||
$dotenv = new \Dotenv\Dotenv($envDir);
|
||||
$dotenv->load();
|
||||
}
|
||||
|
||||
extract_site_request_uri_variables();
|
||||
|
||||
function extract_site_request_uri_variables()
|
||||
{
|
||||
$site_base_pattern = '#/mysyde/([^/]+)/([^/]+)/([^/]+/){0,1}([^/]+/){0,1}([^/]+/){0,1}([^/]+/){0,1}([^/]+/){0,1}#';
|
||||
$site_base_pattern_matches = [];
|
||||
preg_match($site_base_pattern, $_SERVER['REQUEST_URI'], $site_base_pattern_matches);
|
||||
if (
|
||||
array_key_exists(1, $site_base_pattern_matches)
|
||||
&& !empty($site_base_pattern_matches[1])
|
||||
&& array_key_exists(2, $site_base_pattern_matches)
|
||||
&& !empty($site_base_pattern_matches[2])
|
||||
) {
|
||||
$_GET['site'] = filter_var($site_base_pattern_matches[1], FILTER_SANITIZE_STRING);
|
||||
if (empty($_GET['site'])) {
|
||||
$_GET['site'] = get_site_code_from_domain();
|
||||
}
|
||||
$_GET['language'] = filter_var($site_base_pattern_matches[2], FILTER_SANITIZE_STRING);
|
||||
|
||||
|
||||
//Try to max category level 5 (index 3 to 8)
|
||||
$noOfPathSegments = count($site_base_pattern_matches);
|
||||
if ($noOfPathSegments > 6) {
|
||||
$noOfPathSegments = 6;
|
||||
}
|
||||
|
||||
for ($i = 3; $i <= $noOfPathSegments; $i++) {
|
||||
$levelindex = $i - 2;
|
||||
$matchedPattern = array_key_exists($i, $site_base_pattern_matches) ? $site_base_pattern_matches[$i] : '';
|
||||
$code = filter_var(rtrim($matchedPattern, '/'), FILTER_SANITIZE_STRING);
|
||||
$_GET['level_' . $levelindex] = $code;
|
||||
}
|
||||
}
|
||||
if (empty($_GET['site'])) {
|
||||
$_GET['site'] = get_site_code_from_domain();
|
||||
}
|
||||
}
|
||||
|
||||
function get_site_code_from_domain()
|
||||
{
|
||||
$prepStatement = 'SELECT id,code FROM main_site WHERE site_url = :domain ORDER BY id LIMIT 1';
|
||||
|
||||
$siteDomain = $_SERVER['SERVER_NAME'];
|
||||
$siteCode = '';
|
||||
$dbHost = getenv('MAIN_MYSQL_DB_HOST');
|
||||
$dbPort = (int)getenv('MAIN_MYSQL_DB_PORT');
|
||||
$dbUser = getenv('MAIN_MYSQL_DB_USER');
|
||||
$dbSchema = getenv('MAIN_MYSQL_DB_SCHEMA');
|
||||
$dbPass = getenv('MAIN_MYSQL_DB_PASS');
|
||||
|
||||
try {
|
||||
$pdo = new \DynCom\mysyde\common\classes\PDOQueryWrapper($dbHost, $dbPort, $dbSchema, $dbUser, $dbPass);
|
||||
$params = [
|
||||
[':domain', $siteDomain, PDO::PARAM_STR],
|
||||
];
|
||||
$pdo->setQuery($prepStatement);
|
||||
$pdo->prepareQuery();
|
||||
$pdo->bindParameters($params);
|
||||
$pdo->executePreparedStatement();
|
||||
$resArr = $pdo->getResultArray();
|
||||
if (array_key_exists(0, $resArr) && array_key_exists('id', $resArr[0]) && $resArr[0]['id'] > 0) {
|
||||
$siteCode = $resArr[0]['code'];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
//Do noting
|
||||
}
|
||||
return $siteCode;
|
||||
}
|
||||
|
||||
$forgetError = '';
|
||||
?>
|
||||
<? header('Content-Type: text/html; charset=UTF-8') ?>
|
||||
<? require_once("../common/common_functions.inc.php"); ?>
|
||||
<? require_once((local_environment()) ? "../dc.config.php" : "../dc-server.config.php"); ?>
|
||||
<? require_once("admin_functions.inc.php"); ?>
|
||||
<? require_once("start.inc.php"); ?>
|
||||
<? if (!$GLOBALS["visitor"]["admin_login"] && $_GET['action'] != 'forget_password' && $_GET['action'] != 'set_password') {
|
||||
die(require_once("login.inc.php"));
|
||||
}
|
||||
if($_GET['action'] == 'forget_password'){
|
||||
|
||||
die(require_once("forget_password.inc.php"));
|
||||
|
||||
}
|
||||
if($_GET['action'] == 'set_password' && isset($_SESSION['user_email']) && isset($_SESSION['code_set'])){
|
||||
|
||||
die(require_once("set_password.inc.php"));
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<? require_once("../common/version_comment.inc.php"); ?>
|
||||
|
||||
<head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title><?= admin_site_title() ?></title>
|
||||
<script type="text/javascript" src="/plugins/jquery/jquery-1.6.4.min.js"></script>
|
||||
<script type="text/javascript" src="/plugins/jquery/jquery-ui-1.8.16.custom.min.js"></script>
|
||||
<script type="text/javascript" src="/plugins/formdata/formdata.js"></script>
|
||||
<script type="text/javascript" src="/plugins/jquery/jquery.cookie.js"></script>
|
||||
<script type="text/javascript" src="/plugins/jQuery-actual/jquery.actual.min.js"></script>
|
||||
<script type="text/javascript"
|
||||
src="/mysyde/admin/admin.js?t=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/mysyde/admin/admin.js')?>"></script>
|
||||
<script type="text/javascript" src="/plugins/ckeditor/ckeditor.js"></script>
|
||||
<script type="text/javascript" src="/plugins/ckeditor/adapters/jquery.js"></script>
|
||||
<script type="text/javascript" src="/plugins/ckfinder/ckfinder.js"></script>
|
||||
<script type="text/javascript" src="/plugins/dropzone/dropzone.js"></script>
|
||||
<script type="text/javascript" src="/layout/admin/js/bc.backend.js"></script>
|
||||
<script type="text/javascript" src="/plugins/jquery-nestedSortable/jquery.mjs.nestedSortable.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/chart.js@3.8.0/dist/chart.min.js"></script>
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/layout/admin/img/favicon/favicon.ico">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/layout/admin/img/favicon/favicon.ico">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/layout/admin/img/favicon/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/layout/admin/img/favicon/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/layout/admin/img/favicon/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/layout/admin/img/favicon/favicon-16x16.png">
|
||||
<link rel="manifest" href="/layout/admin/img/favicon/site.webmanifest">
|
||||
<meta name="msapplication-TileColor" content="#fff">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css">
|
||||
<link href="/plugins/jqueryui/css/metro/jquery-ui.css" rel="stylesheet" type="text/css" />
|
||||
<link
|
||||
href="/layout/admin/css/mysyde.css?t=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/layout/admin/css/mysyde.css')?>"
|
||||
rel="stylesheet" type="text/css" />
|
||||
<link
|
||||
href="/layout/admin/css/responsive.css?t=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/layout/admin/css/responsive.css')?>"
|
||||
rel="stylesheet" type="text/css" />
|
||||
<link href="/plugins/dropzone/dropzone.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
|
||||
|
||||
<body class="<?php echo $_GET["level_1"].' '.$_GET["level_2"]?>">
|
||||
|
||||
<div id="container">
|
||||
<button class="menu-toggle"
|
||||
aria-controls="primary-navigation"
|
||||
aria-expanded="false">
|
||||
<span class="visually-hidden">Menu</span>
|
||||
<div class="hamburger" aria-hidden="true"></div>
|
||||
</button>
|
||||
<div id="header-wrapper">
|
||||
<div class="logo"><a title="MySyde Intranet" href="/mysyde"><img alt="MySyde Intranet Logo" src="/layout/admin/img/icons/MySyde_Intranet.png"></a></div>
|
||||
<div id="header">
|
||||
<div id="header_menu">
|
||||
<? require_once("header.inc.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="menu" class="<?php echo $GLOBALS["menu_opened"] === true ? 'menu_opened' : ''; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div id="content" class="site">
|
||||
<? require_once("content.inc.php"); ?>
|
||||
|
||||
</div>
|
||||
<div id="content-collection">
|
||||
<div id="overlay"></div>
|
||||
<div id="overlayWrapper">
|
||||
<div id="overlayContent"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php function loadRepeater(){?>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"
|
||||
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
||||
<script
|
||||
src="/plugins/jquery/jquery.form-repeater.js?time=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/plugins/jquery/jquery.form-repeater.js')?>"
|
||||
type="text/javascript"></script>
|
||||
|
||||
<?php } ?>
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
<? require_once("close.inc.php"); ?>
|
||||
1066
mysyde/admin/admin_functions.inc.php
Normal file
1066
mysyde/admin/admin_functions.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
4
mysyde/admin/close.inc.php
Normal file
4
mysyde/admin/close.inc.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?
|
||||
// Schlusssequenz
|
||||
mysqli_close($GLOBALS['mysql_con']);
|
||||
?>
|
||||
5163
mysyde/admin/common_functions.inc.php
Normal file
5163
mysyde/admin/common_functions.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
21
mysyde/admin/contact.inc.php
Normal file
21
mysyde/admin/contact.inc.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<br />
|
||||
<img src="/layout/admin/img/pf_logo_web" width="200" alt="breadcrumb mediasolutions GmbH" />
|
||||
<h3><br />
|
||||
<br />
|
||||
Im Rahmen Ihres Wartungsvertrags
|
||||
stehen wir Ihnen gerne <br />
|
||||
für alle Fragen
|
||||
rund um das PfCMS zur Verfügung</h3>
|
||||
<br />
|
||||
<br />
|
||||
<strong>breadcrumb mediasolutions GmbH</strong><br />
|
||||
<br />
|
||||
Kressenstein 26 <br />
|
||||
95326 Kulmbach <br />
|
||||
<br />
|
||||
<strong>Tel: </strong>09221 80246-20<br />
|
||||
<strong>Fax: </strong>09221 80246-22 <br />
|
||||
<br />
|
||||
<a href="mailto:info@breadcrumb-solutions.de">info@breadcrumb-solutions.de</a><br />
|
||||
<a href="http://www.breadcrumb-solutions.de" target="_blank">www.breadcrumb-solutions.de</a> <br />
|
||||
<br />
|
||||
48
mysyde/admin/contact_formular.inc.php
Normal file
48
mysyde/admin/contact_formular.inc.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?
|
||||
if ($_GET["action"] == "send") {
|
||||
if (($_POST["input_name"] <> '') && ($_POST["input_reply"] <> '') && ($_POST["input_subject"] <> '')) {
|
||||
$message = "<strong>Supportanfrage über das Dc-System von " . $GLOBALS["site"]["name"] . "</strong>\n\n";
|
||||
$message .= "Name: " . $_POST["input_name"] . "\n";
|
||||
$message .= "E-Mail: " . $_POST["input_reply"] . "\n\n";
|
||||
$message .= "<strong>" . $_POST["input_subject"] . "</strong>\n\n";
|
||||
$message .= $_POST["input_message"];
|
||||
if (mail_create($_POST["input_subject"], $message, "support@dc-solution.de", $GLOBALS['setup']['support_recipient_email'], "Dc-Support", "Pearson & friends Support", TRUE, 0, '')) {
|
||||
mail_send();
|
||||
echo "<div class=\"successbox\">Ihre Supportanfrage wurde angenommen</div>";
|
||||
$_POST["input_name"] = "";
|
||||
$_POST["input_reply"] = "";
|
||||
$_POST["input_subject"] = "";
|
||||
$_POST["input_message"] = "";
|
||||
} else {
|
||||
echo "<div class=\"errorbox\">Die E-Mail konnte nicht versendet werden/div>";
|
||||
}
|
||||
} else {
|
||||
echo "<div class=\"errorbox\">Bitte füllen Sie die Felder Name, Antwort-Adresse und Betreff aus</div>";
|
||||
}
|
||||
} else {
|
||||
$_POST["input_name"] = $admin_user["name"];
|
||||
$_POST["input_reply"] = $admin_user["email"];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<? $formname = "form_contact_formular"; ?>
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
|
||||
<div class="toolbar">
|
||||
<?= button("mail", "Senden", $formname, "?action=send"); ?>
|
||||
<?= button("reset", "Zurücksetzen", $formname); ?>
|
||||
</div>
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?= input("Benutzer", "input_name", "text", $_POST["input_name"], 45) ?>
|
||||
<?= input("Antwort-Adresse", "input_reply", "text", $_POST["input_reply"], 45) ?><br />
|
||||
<?= input("Betreff", "input_subject", "text", $_POST["input_subject"], 250) ?>
|
||||
<?= input("Nachricht", "input_message", "textarea", $_POST["input_message"], 250) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
55
mysyde/admin/content.inc.php
Normal file
55
mysyde/admin/content.inc.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?
|
||||
// Inhalt laden
|
||||
|
||||
$adminMenu = \DynCom\mysyde\common\classes\Adminmenu::get();
|
||||
$admin_start_parameter = "";
|
||||
|
||||
// default
|
||||
|
||||
|
||||
if ($_GET["level_1"] != "") {
|
||||
$include = $adminMenu[$_GET["level_1"]]['include'];
|
||||
if (isset($adminMenu[$_GET["level_1"]]['admin_start_parameter'])) {
|
||||
$admin_start_parameter = $adminMenu[$_GET["level_1"]]['admin_start_parameter'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET["level_2"] != "") {
|
||||
$include = $adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['include'];
|
||||
if (isset($adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['admin_start_parameter'])) {
|
||||
$admin_start_parameter = $adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['admin_start_parameter'];
|
||||
}
|
||||
}
|
||||
|
||||
// var_dump($adminMenu[$_GET["level_1"]]['subsites']);
|
||||
|
||||
// if ($_GET["level_3"] != "") {
|
||||
// $include = $adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['subsites'][$_GET["level_3"]]['include'];
|
||||
// if (isset($adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['subsites'][$_GET["level_3"]]['admin_start_parameter'])) {
|
||||
// $admin_start_parameter = $adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['subsites'][$_GET["level_3"]]['admin_start_parameter'];
|
||||
// }
|
||||
// }
|
||||
|
||||
if ($include == "") {
|
||||
$include = $adminMenu["default"]['include'];
|
||||
}
|
||||
|
||||
|
||||
if (file_exists($include)) {
|
||||
$menuclass = $GLOBALS["menu_opened"] == TRUE
|
||||
? "menu_opened"
|
||||
: "";
|
||||
if($_GET['level_1'] == 'module'){
|
||||
$menuclass = "";
|
||||
}
|
||||
echo "<div id=\"content_3\" class=\"{$menuclass}\">\n";
|
||||
require_once($include);
|
||||
|
||||
if (function_exists($admin_start_parameter)) {
|
||||
$admin_start_parameter();
|
||||
}
|
||||
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
?>
|
||||
28
mysyde/admin/content_ajax.inc.php
Normal file
28
mysyde/admin/content_ajax.inc.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?
|
||||
// Inhalt laden
|
||||
$adminMenu = \DynCom\mysyde\common\classes\Adminmenu::get();
|
||||
$admin_start_parameter = "";
|
||||
|
||||
if ($_GET["level_1"] != "") {
|
||||
$include = $adminMenu[$_GET["level_1"]]['include'];
|
||||
if (isset($adminMenu[$_GET["level_1"]]['admin_start_parameter'])) {
|
||||
$admin_start_parameter = $adminMenu[$_GET["level_1"]]['admin_start_parameter'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET["level_2"] != "") {
|
||||
$include = $adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['include'];
|
||||
if (isset($adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['admin_start_parameter'])) {
|
||||
$admin_start_parameter = $adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['admin_start_parameter'];
|
||||
}
|
||||
}
|
||||
|
||||
if (($include <> '') && (file_exists($include))) {
|
||||
require_once($include);
|
||||
|
||||
if (function_exists($admin_start_parameter)) {
|
||||
$admin_start_parameter();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
8
mysyde/admin/content_include.inc.php
Normal file
8
mysyde/admin/content_include.inc.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?
|
||||
// Inhalt laden
|
||||
|
||||
if ($admin_navigation["include"] <> '') {
|
||||
require_once("../../" . $admin_navigation["include"]);
|
||||
}
|
||||
|
||||
?>
|
||||
130
mysyde/admin/dashboard_contents.php
Normal file
130
mysyde/admin/dashboard_contents.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$pageIds = array();
|
||||
$sitepartCount = array();
|
||||
$formname = "form_edit_sitepart";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$action = (isset($_GET['action']) ? $_GET['action'] : "");
|
||||
|
||||
if ($action != "") {
|
||||
|
||||
$sitepart_id = null;
|
||||
if(isset($_POST['data-sitepartid']) && !empty($_POST['data-sitepartid'])) {
|
||||
$sitepart_id = (int) $_POST['data-sitepartid'];
|
||||
}
|
||||
|
||||
if($sitepart_id === null) {
|
||||
$subaction = substr($action, strrpos($action, '_') + 1);
|
||||
foreach($siteparts as $id => $sitepartData) {
|
||||
if($subaction == $sitepartData['code']) {
|
||||
$sitepart_id = $id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sitepartcode = $siteparts[$sitepart_id]['code'];
|
||||
$sitepartfolder = $siteparts[$sitepart_id]['folder'];
|
||||
|
||||
require_once(realpath(MODULE_PATH) . DIRECTORY_SEPARATOR . $sitepartfolder . DIRECTORY_SEPARATOR . "edit_" . $sitepartcode . ".inc.php");
|
||||
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('top_contents'); ?></h1>
|
||||
|
||||
<div class="dashboard_part_left">
|
||||
<h2><?php echo get_translation('all_contents'); ?></h2>
|
||||
|
||||
<?php foreach ($siteparts as $sitepartId => $sitepartData): ?>
|
||||
|
||||
<?php
|
||||
if (isset($sitepartData['is_shop']) || $sitepartData['is_shop'] === TRUE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// anzahl der erstellten siteparts berechnen
|
||||
$query = "SELECT count(*) AS anzahl FROM " . $sitepartData['header_table'] . " WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) AND collection_header = 0";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
$anzahl = 0;
|
||||
if (isset($row['anzahl'])) {
|
||||
$anzahl = $row['anzahl'];
|
||||
}
|
||||
?>
|
||||
|
||||
<a class="dashoard_box button_<?php echo $sitepartData['class']; ?>"
|
||||
href="<?php echo get_menu_link($_GET["level_1"] . "/" . $sitepartData['code'], $site, $language); ?>">
|
||||
<span class="dashboard_box_number"><?php echo $anzahl; ?></span>
|
||||
<span class="dashboard_box_description"><?php echo $sitepartData['description']; ?></span>
|
||||
</a>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="dashboard_part_right">
|
||||
<h2><?php echo get_translation('last_changed_contents'); ?></h2>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?php
|
||||
$query = "SELECT *, main_admin_user.name AS username FROM main_sitepart_changes left join main_admin_user ON main_sitepart_changes.modified_user = main_admin_user.id WHERE main_language_id = '" . (int)$GLOBALS["language"]['id'] . "' ORDER BY modified_date DESC LIMIT 0,20";
|
||||
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
if ($num_rows >= 1) {
|
||||
echo " <table id='contentTable' cellpadding=0 cellspacing=0 border=0 class=\"linklist\">\n";
|
||||
echo '<thead>';
|
||||
echo "<tr>";
|
||||
echo format_key($translation->get("type"), "");
|
||||
echo format_key($translation->get("description"), "");
|
||||
echo format_key($translation->get("changed_on"), "");
|
||||
echo format_key($translation->get("changed_by"), "");
|
||||
echo "</tr>";
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
echo "<tr>";
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo "</tr>";
|
||||
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$sitepartDescription = "";
|
||||
$query_description = "SELECT description FROM " . $siteparts[$row['main_sitepart_id']]['header_table'] . " WHERE id = '" . $row['main_sitepart_header_id']."'";
|
||||
$result_description = @mysqli_query($GLOBALS['mysql_con'], $query_description);
|
||||
$row_sitepart_description = @mysqli_fetch_array($result_description);
|
||||
|
||||
$sitepartType = $siteparts[$row['main_sitepart_id']]['description'];
|
||||
$sitepartCode = $siteparts[$row['main_sitepart_id']]['code'];
|
||||
|
||||
echo " <tr class=\"linklist_content\" data-sitepartid=\"{$row['main_sitepart_id']}\" data-checked=\"{$checkedRow}\" data-inputname=\"input_id\" data-action=\"edit_" . $siteparts[$row['main_sitepart_id']]['code'] . "\" data-inputid=\"{$row['main_sitepart_header_id']}\">\n";
|
||||
|
||||
echo format_value($sitepartType, "input_id");
|
||||
echo format_value($row_sitepart_description['description'], "input_id");
|
||||
echo format_value(date("d.m.Y H:i", $row['modified_date']), "input_id");
|
||||
echo format_value($row['username'], "input_id");
|
||||
|
||||
echo " </tr>\n";
|
||||
}
|
||||
echo '<thead>';
|
||||
echo " </table>\n";
|
||||
loadDataTable('contentTable');
|
||||
} else {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div>";
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
<?
|
||||
|
||||
144
mysyde/admin/dashboard_startpage.php
Normal file
144
mysyde/admin/dashboard_startpage.php
Normal file
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
function resolveUrl( $_url ) {
|
||||
//dummy function needed for ckfinder config
|
||||
}
|
||||
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$pageIds = array();
|
||||
$sitepartCount = array();
|
||||
$formname = "form_edit_sitepart";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$action = (isset($_GET['action']) ? $_GET['action'] : "");
|
||||
|
||||
if ($action != "" && $action != "admin_login") {
|
||||
require_once(CMS_PATH . "admin/edit_page.inc.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
$adminMenu = \DynCom\mysyde\common\classes\Adminmenu::get();
|
||||
|
||||
$subsites = $adminMenu[$_GET["level_1"]]['subsites'];
|
||||
$count_subsites = array();
|
||||
|
||||
function count_entrys($table){
|
||||
$query = "SELECT count(*) AS count FROM ".$table;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
return $row['count'];
|
||||
}
|
||||
|
||||
// documents_insert();
|
||||
|
||||
$GLOBALS["pdo_conn"] = new PDO("mysql:host=".$GLOBALS['myservername'].";dbname=".$GLOBALS['mydb'].';charset=utf8', $GLOBALS['mylogin'], $GLOBALS['mypass']);
|
||||
|
||||
function listUsers(){
|
||||
$query = "SELECT * FROM main_contact ORDER BY last_interaction DESC LIMIT 20";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($main_contact = @mysqli_fetch_array($result)) {
|
||||
$last_interaction = new DateTime($main_contact['last_interaction']);
|
||||
$current_datetime = new DateTime();
|
||||
$diff = $last_interaction->diff($current_datetime);
|
||||
$hours = $diff->h;
|
||||
$minutes = $diff->i;
|
||||
if($diff->d >= 1){
|
||||
$status = "Zuletzt am {$last_interaction->format('d.m.Y')} aktiv";
|
||||
$status_color = 'red';
|
||||
}else if($hours > 3){
|
||||
$status = "Zuletzt um {$last_interaction->format('H:i')} Uhr aktiv";
|
||||
$status_color = 'red';
|
||||
}else if($hours >= 1){
|
||||
$status = "Vor {$hours} Stunde(n) aktiv";
|
||||
$status_color = 'yellow';
|
||||
}else if($minutes >= 5){
|
||||
$status = "Vor {$minutes} Minuten aktiv";
|
||||
$status_color = 'yellow';
|
||||
}else{
|
||||
$status = "Jetzt aktiv";
|
||||
$status_color = 'green';
|
||||
}
|
||||
echo "<div class='user-wrapper'>";
|
||||
if($main_contact['image'] == ""){
|
||||
echo "<td><div class='img_container'><img class='img-fluid' src='/userdata/intranet/contact/platzhalter-mann-compressor.jpg'></div></td>";
|
||||
}else{
|
||||
echo "<td><div class='img_container'><img class='img-fluid' src='/userdata/intranet/contact/".$main_contact['image']."'></div></td>";
|
||||
}
|
||||
echo "<div class='user-info'>";
|
||||
echo "<p class='user-name'>".$main_contact['name']."</p>";
|
||||
echo "<p class='user-status ".$status_color."_status'>".$status."</p>";
|
||||
echo "</div>";
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
function loadNews(){
|
||||
$file_server = 'https://breadcrumb-solutions.de/news.xml';
|
||||
|
||||
$xml = simplexml_load_file($file_server);
|
||||
$temp = mb_convert_encoding( file_get_contents($file_server), 'UTF-8' );
|
||||
$array = simplexml_load_string($temp);
|
||||
|
||||
$i = 1;
|
||||
foreach ($array -> news as $news) {
|
||||
if($i <= 2){?>
|
||||
<div class='news-content'>
|
||||
<img class="xml-img"src='<?php echo $news -> image ?>'>
|
||||
<p class="xml-category"><?php echo $news -> category ?></p>
|
||||
<p class="xml-headline"><?php echo $news -> headline ?></p>
|
||||
<p class="xml-teaser"><?php echo $news -> teaser ?></p>
|
||||
<a class="xml-link" target='_blank' href="<?php echo $news -> link ?>">Mehr erfahren</a>
|
||||
</div>
|
||||
<?php }
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$GLOBALS['log_site'] = $site;
|
||||
$GLOBALS['log_language'] = $language;
|
||||
?>
|
||||
|
||||
<div id="mainContent" class="dashboard_intranet">
|
||||
|
||||
<div class="dashboard_wrapper">
|
||||
|
||||
<!-- Hero Dashboard -->
|
||||
<div class="dashboard_hero">
|
||||
<div class="dashboard_intro">
|
||||
<div class="always_white_no"><?php echo current_website_language($site, $language); ?></div>
|
||||
<h1 class="new-h1">Willkommen zurück, <?php echo $admin_user["name"]; ?></h1>
|
||||
</div>
|
||||
<div class="dashboard_shortlinks">
|
||||
<div class="small_title always_white_no">Aktionen</div>
|
||||
<div class="shortlink_group">
|
||||
<button class="go_to shortlink"><a href="<?= get_menu_link('intranet/config_contact', $site, $language); ?>">Intranet Benutzer</a></button>
|
||||
<button class="go_to shortlink"><a href="<?= get_menu_link('intranet/config_mandant', $site, $language); ?>">Intranet Mandanten</a></button>
|
||||
<button class="go_to shortlink"><a href="<?= get_menu_link('intranet/config_department', $site, $language); ?>">Intranet Abteilungen</a></button>
|
||||
<button class="add shortlink"><a href="<?= get_menu_link('intranet/config_contact', $site, $language, '?action=open_card'); ?>">Neuer Benutzer</a></button>
|
||||
<!-- <button class="add shortlink"><a href="<?= get_menu_link('infoboard', $site, $language); ?>">Infoboard Eintrag</a></button> -->
|
||||
<button class="add shortlink"><a href="<?= get_menu_link('collections/3', $site, $language, '?action=open_card_collection'); ?>">Knowledgecenter Beitrag</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Übersicht Leiste mit Linie und Kacheln -->
|
||||
<div class="dashboard_overview">
|
||||
<h2 class="line always_white_no">Übersicht</h2>
|
||||
<div class="dashboard_content">
|
||||
<div class="box_wrapper">
|
||||
<div class="small_title always_white_no">Intranet Basis</div>
|
||||
<div class="box_group">
|
||||
<button class="box"><a href="<?= get_menu_link('intranet/config_contact', $site, $language); ?>">
|
||||
<div class="box_value"><?= count_entrys('main_contact')?></div>
|
||||
<div class="box_label">Benutzer</div>
|
||||
</a></button>
|
||||
<button class="box"><a href="<?= get_menu_link('intranet/config_mandant', $site, $language); ?>">
|
||||
<div class="box_value"><?= count_entrys('main_mandant')?></div>
|
||||
<div class="box_label">Mandanten</div>
|
||||
</a></button>
|
||||
<button class="box"><a href="<?= get_menu_link('intranet/config_department', $site, $language); ?>">
|
||||
<div class="box_value"><?= count_entrys('main_department')?></div>
|
||||
<div class="box_label">Abteilungen</div>
|
||||
</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
88
mysyde/admin/dashboard_structure.php
Normal file
88
mysyde/admin/dashboard_structure.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
function resolveUrl( $_url ) {
|
||||
//dummy function needed for ckfinder config
|
||||
}
|
||||
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$pageIds = array();
|
||||
$sitepartCount = array();
|
||||
$formname = "form_edit_sitepart";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$action = (isset($_GET['action']) ? $_GET['action'] : "");
|
||||
|
||||
if ($action != "" && $action != "admin_login") {
|
||||
require_once(CMS_PATH . "admin/edit_page.inc.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
$adminMenu = \DynCom\mysyde\common\classes\Adminmenu::get();
|
||||
|
||||
$subsites = $adminMenu[$_GET["level_1"]]['subsites'];
|
||||
$count_subsites = array();
|
||||
|
||||
// seiten zaehlen
|
||||
$query = "SELECT count(*) AS anzahl FROM main_page WHERE main_language_id = '" . $GLOBALS["language"]['id']."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
$count_subsites['sites'] = $row['anzahl'];
|
||||
|
||||
// navigation zaehlen
|
||||
$query = "SELECT count(*) AS anzahl FROM main_navigation WHERE main_site_id = '" . $site["id"] . "' AND main_language_id = '" . $GLOBALS["language"]['id']."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
$count_subsites['navigation'] = $row['anzahl'];
|
||||
|
||||
// Bausteine zaehlen
|
||||
$query = "SELECT count(*) AS anzahl FROM main_component WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
$count_subsites['components'] = $row['anzahl'];
|
||||
|
||||
// dateien
|
||||
$count_subsites['files'] = count_all_files();
|
||||
?>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('top_structure'); ?></h1>
|
||||
|
||||
<div class="dashboard_part_left">
|
||||
<h2><?php echo get_translation('main_menu'); ?></h2>
|
||||
|
||||
|
||||
<?php
|
||||
foreach ($subsites as $code => $subsite) {
|
||||
?>
|
||||
<a class="dashoard_box button_inhalt_collection"
|
||||
href="<?php echo get_menu_link($_GET["level_1"] . "/" . $code, $site, $language); ?>">
|
||||
<span class="dashboard_box_number"><?php echo $count_subsites[$code]; ?></span>
|
||||
<span class="dashboard_box_description"><?php echo $subsite['name']; ?></span>
|
||||
<img src="/layout/admin/img/icons/structure/<?php echo $subsite['icon']; ?>" />
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="dashboard_part_right">
|
||||
<h2><?php echo get_translation('last_changed_sites'); ?></h2>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_page_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<div id="page_linklist">
|
||||
<?
|
||||
$query = "SELECT main_page.id, title AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from main_page left join main_admin_user ON main_page.modified_user = main_admin_user.id where main_language_id = '" . (int)$GLOBALS["language"]['id'] . "' order by modified_date desc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
$dbl_click_editing_mode = (($GLOBALS['admin_user']['edit_mode'] == 0) ? "edit_live_content_page" : "edit_content_page");
|
||||
linklist($result, $formname, $format, "input_page_id", $dbl_click_editing_mode);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
64
mysyde/admin/db_backup.inc.php
Normal file
64
mysyde/admin/db_backup.inc.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?
|
||||
switch ($_GET["action"]) {
|
||||
case 'create':
|
||||
create_backup();
|
||||
break;
|
||||
case 'delete':
|
||||
delete_backup();
|
||||
break;
|
||||
}
|
||||
|
||||
require_once("db_backup_listform.inc.php");
|
||||
|
||||
function delete_backup() {
|
||||
if ($_POST["input_filename"] <> "") {
|
||||
unlink("../../userdata/db_backup/" . $_POST["input_filename"]);
|
||||
}
|
||||
}
|
||||
|
||||
function import_backup() {
|
||||
if ($_POST["input_filename"] <> "") {
|
||||
echo $_POST["input_filename"];
|
||||
$f = fopen("../../userdata/db_backup/" . $_POST["input_filename"], "r");
|
||||
while (!feof($f)) {
|
||||
$line = fgets($f);
|
||||
mysqli_query($GLOBALS['mysql_con'], $line);
|
||||
}
|
||||
fclose($f);
|
||||
}
|
||||
}
|
||||
|
||||
function create_backup() {
|
||||
$filename = "../../userdata/db_backup/dc_backup_" . date("Ymd_His") . ".sql";
|
||||
$f = fopen($filename, "w");
|
||||
$tables = mysqli_list_tables($GLOBALS['mysql_con'], $GLOBALS["mydb"]);
|
||||
while ($cells = mysqli_fetch_array($tables)) {
|
||||
$table = $cells[0];
|
||||
fwrite($f, "DROP TABLE `$table`;\n");
|
||||
$res = mysqli_query($GLOBALS['mysql_con'], "SHOW CREATE TABLE `$table`");
|
||||
if ($res) {
|
||||
$create = @mysqli_fetch_array($res);
|
||||
$create[1] .= ";";
|
||||
$line = str_replace("\n", "", $create[1]);
|
||||
fwrite($f, $line . "\n");
|
||||
$data = mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM `$table`");
|
||||
$num = mysqli_num_fields($GLOBALS['mysql_con'], $data);
|
||||
while ($row = mysqli_fetch_array($data)) {
|
||||
$line = "INSERT INTO `$table` VALUES(";
|
||||
for ($i = 1; $i <= $num; $i++) {
|
||||
$line .= "'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $row[$i - 1]) . "', ";
|
||||
}
|
||||
$line = substr($line, 0, -2);
|
||||
fwrite($f, $line . ");\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($f);
|
||||
if (file_exists($filename)) {
|
||||
echo "<div class=\"successbox\">Datensicherung wurde erstellt</div>";
|
||||
} else {
|
||||
echo "<div class=\"errorbox\">Datensicherung konnte nicht erstellt werden</div>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
38
mysyde/admin/db_backup_listform.inc.php
Normal file
38
mysyde/admin/db_backup_listform.inc.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<? $formname = "form_backup_list"; ?>
|
||||
|
||||
<div class="toolbar">
|
||||
<?= button("new", "Erstellen", $formname, "?action=create"); ?>
|
||||
<?= button("delete", "Löschen", $formname, "?action=delete", "Wollen Sie die Datensicherung wirklich löschen?"); ?>
|
||||
</div>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="linklist">
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>Datum</td>
|
||||
<td>Dateiname</td>
|
||||
</tr>
|
||||
<?
|
||||
$path = "../../userdata/db_backup/";
|
||||
$counter = 0;
|
||||
$dir = opendir($path);
|
||||
while (FALSE !== ($file = readdir($dir))) {
|
||||
if (preg_match("/^.+\.(sql)\$/U", $file)) {
|
||||
$filetime = filemtime($path . $file);
|
||||
$checked = ($file == $_POST[$input_filename]) ? " checked=\"checked\"" : "";
|
||||
echo " <tr onclick=\"document." . $formname . ".input_filename[" . $counter . "].checked = true;\">\n";
|
||||
echo " <td style=\"width: 20px;\"><div style=\"text-align:center;\"><input style=\"width: 14px; height: 14px; padding: 0px; margin: 0px;\" id=\"input_filename\" name=\"input_filename\" type=\"radio\" value=\"" . $file . "\"" . $checked . " /></div></td>";
|
||||
echo " <td><div>vom " . date("d.m.Y", $filetime) . " um " . date("H:i", $filetime) . " Uhr</div></td>\n";
|
||||
echo " <td><div>" . $file . "</div></td>\n";
|
||||
echo " </tr>\n";
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
|
||||
closedir($dir);
|
||||
if ($counter = 0) {
|
||||
echo "<div class=\"infobox\">Keine Datensätze vorhanden</div>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</form>
|
||||
443
mysyde/admin/edit_admin_user.inc.php
Normal file
443
mysyde/admin/edit_admin_user.inc.php
Normal file
@@ -0,0 +1,443 @@
|
||||
<?
|
||||
|
||||
switch ($_GET["action"]) {
|
||||
case 'edit':
|
||||
|
||||
if (isset($_POST['input_id'])) {
|
||||
edit_admin_user($_POST['input_id']);
|
||||
}else {
|
||||
edit_admin_user();
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
|
||||
delete_admin_user($admin_user["id"]);
|
||||
break;
|
||||
case 'new':
|
||||
require_once("edit_admin_user_cardform.inc.php");
|
||||
break;
|
||||
case 'save':
|
||||
save_admin_user();
|
||||
break;
|
||||
|
||||
case 'open_card':
|
||||
|
||||
open_card();
|
||||
// edit_admin_user($_GET['input_id']);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'delete_image':
|
||||
|
||||
delete_user_image();
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
require_once("edit_admin_user_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function open_card() {
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
openCardOnStart = true;
|
||||
</script>
|
||||
<?php }
|
||||
|
||||
function edit_admin_user( $_id = "", $messages = array() ) {
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_POST["input_id"];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
|
||||
$pdoHost = getenv('MAIN_MYSQL_DB_HOST');
|
||||
$pdoPort = getenv('MAIN_MYSQL_DB_PORT');
|
||||
$pdoUser = getenv('MAIN_MYSQL_DB_USER');
|
||||
$pdoPass = getenv('MAIN_MYSQL_DB_PASS');
|
||||
$pdoSchema = getenv('MAIN_MYSQL_DB_SCHEMA');
|
||||
|
||||
$pdo = new \DynCom\mysyde\common\classes\PDOQueryWrapper($pdoHost, $pdoPort, $pdoSchema, $pdoUser, $pdoPass);
|
||||
|
||||
$prepStatement = " SELECT * FROM main_admin_user WHERE id = :id LIMIT 1 ";
|
||||
$params = [
|
||||
[':id', $input_id, PDO::PARAM_STR],
|
||||
];
|
||||
$pdo->setQuery($prepStatement);
|
||||
$pdo->prepareQuery();
|
||||
$pdo->bindParameters($params);
|
||||
$pdo->executePreparedStatement();
|
||||
$result = $pdo->getResultArray();
|
||||
if ($result !== null) {
|
||||
if (count($result) == 1) {
|
||||
$input_admin_user = $result[0];
|
||||
$input_admin_user["password"] = "nochange";
|
||||
require_once("edit_admin_user_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$input_admin_user = array();
|
||||
require_once("edit_admin_user_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_admin_user( $curr_user_id ) {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
if ($_POST["input_id"] <> '') {
|
||||
if ($_POST["input_id"] <> $curr_user_id) {
|
||||
$query = "DELETE FROM main_admin_user WHERE id = '" . $_POST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
$query = "DELETE FROM main_site_admin_user_link where main_admin_user_id = '" . $_POST["input_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
createMySydeLog('main_admin_user', $_POST["input_id"], 'DELETE');
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("user_error5") . "</div>";
|
||||
edit_admin_user($_POST["input_id"], $messages);
|
||||
}
|
||||
}
|
||||
require_once("edit_admin_user_listform.inc.php");
|
||||
}
|
||||
|
||||
function save_admin_user() {
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
$input_id = "";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$passwordOptions = get_password_options();
|
||||
$hashedPassword = password_hash(filter_input(INPUT_POST,'input_password'),PASSWORD_DEFAULT,$passwordOptions);
|
||||
|
||||
if ($_POST["input_right_create_user"] == 'on') {
|
||||
$right_create_user = 1;
|
||||
} else {
|
||||
$right_create_user = 0;
|
||||
}
|
||||
$right_website_admin = 0;
|
||||
if ($_POST["right_website_admin"] == 'on') {
|
||||
$right_website_admin = 1;
|
||||
}
|
||||
|
||||
$is_betriebsrat = 0;
|
||||
if ($_POST["is_betriebsrat"] == 'on') {
|
||||
$is_betriebsrat = 1;
|
||||
}
|
||||
|
||||
if ($_POST["input_id"] <> '') {
|
||||
$inserted = FALSE;
|
||||
$input_id = $_POST["input_id"];
|
||||
$newPassword = false;
|
||||
if ($_POST["input_old_password"] == '' && $_POST["input_password"] == '' && $_POST["input_password2"] == '') {
|
||||
$query = "UPDATE main_admin_user SET
|
||||
name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "',
|
||||
email = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_email"]) . "',
|
||||
login = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_login"]) . "',
|
||||
right_create_user = " . $right_create_user . ",
|
||||
right_website_admin = ".$right_website_admin.",
|
||||
is_betriebsrat = ".$is_betriebsrat.",
|
||||
edit_mode = '" . (int)$_POST['input_edit_mode'] . "',
|
||||
main_site_id = '" . (int)$_POST['main_site_id'] . "',
|
||||
main_language = '" . $_POST['main_language'] . "'
|
||||
WHERE id = '" . $_POST["input_id"] . "' LIMIT 1";
|
||||
} else {
|
||||
$newPassword = true;
|
||||
$query = "UPDATE main_admin_user
|
||||
SET name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "',
|
||||
email = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_email"]) . "',
|
||||
login = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_login"]) . "',
|
||||
password = '" . $hashedPassword . "',
|
||||
right_website_admin = ".$right_website_admin.",
|
||||
is_betriebsrat = ".$is_betriebsrat.",
|
||||
right_create_user = " . $right_create_user . " ,
|
||||
edit_mode = '" . (int)$_POST['input_edit_mode'] . "',
|
||||
main_site_id = '" . (int)$_POST['main_site_id'] . "',
|
||||
main_language = '" . $_POST['main_language'] . "'
|
||||
WHERE id = '" . $_POST["input_id"] . "' LIMIT 1";
|
||||
}
|
||||
createMySydeLog('main_admin_user', $_POST["input_id"], 'UPDATE');
|
||||
} else {
|
||||
$newPassword = true;
|
||||
$query = "INSERT INTO main_admin_user (id,name,email,login,password,right_create_user, right_website_admin, main_site_id, main_language,edit_mode, is_betriebsrat) VALUES (
|
||||
NULL,
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_email"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_login"]) . "',
|
||||
'" . $hashedPassword . "',
|
||||
" . $right_create_user . ",
|
||||
". $right_website_admin.",
|
||||
". $is_betriebsrat.",
|
||||
'" . (int)$_POST['main_site_id'] . "',
|
||||
'" . $_POST['main_language'] . "',
|
||||
'" . (int)$_POST['edit_mode'] . "'
|
||||
)";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
$siteQuery = "SELECT * from main_site";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $siteQuery);
|
||||
$siteAdminError = true;
|
||||
while ($siterow = @mysqli_fetch_assoc($result)) {
|
||||
$arr_ind = "input_site_admin_link_" . $siterow["id"];
|
||||
if(isset($_POST[$arr_ind]) && $_POST[$arr_ind] == "on") {
|
||||
$siteAdminError = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if($siteAdminError === true) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("site_admin_user_error") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if (($_POST["input_name"] == '') || ($_POST["input_login"] == '' || $_POST['input_email'] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("user_error1") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($newPassword)
|
||||
{
|
||||
$inputOldPassword = filter_var($_POST['input_old_password'], FILTER_SANITIZE_STRING);
|
||||
$dbPasswordHash = $GLOBALS["admin_user"]['password'];
|
||||
$verifiedPasword = password_verify($inputOldPassword, $dbPasswordHash) ;
|
||||
$validOldHash = md5($inputOldPassword) === $dbPasswordHash;
|
||||
if ($verifiedPasword || $validOldHash) {
|
||||
$verifiedPasword = true;
|
||||
} else {
|
||||
$verifiedPasword = false;
|
||||
}
|
||||
$checkOldPassword = true;
|
||||
if(!isset($_POST['input_old_password'])) // there is no old password the admin adding new password for another user
|
||||
{
|
||||
$checkOldPassword = false;
|
||||
}
|
||||
|
||||
if($checkOldPassword)
|
||||
{
|
||||
if ( ($_POST["input_old_password"] == '') || !$verifiedPasword ) {
|
||||
if(!$error)
|
||||
{
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("user_error7") . "</div>\n";
|
||||
}
|
||||
|
||||
$error = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["input_password"] <> $_POST["input_password2"]) {
|
||||
//echo "<div class=\"errorbox\">" . $GLOBALS["tc"]["error_2_shop_user"] . "</div>\n";
|
||||
if(!$error)
|
||||
{
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("user_error2") . "</div>\n";
|
||||
}
|
||||
$error = TRUE;
|
||||
|
||||
}
|
||||
|
||||
if (strlen($_POST["input_password"]) < 6) {
|
||||
//echo "<div class=\"errorbox\">" . $GLOBALS["tc"]["error_3_shop_user"] . "</div>\n";
|
||||
if(!$error)
|
||||
{
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("user_error3") . "</div>\n";
|
||||
}
|
||||
$error = TRUE;
|
||||
|
||||
}
|
||||
if($checkOldPassword)
|
||||
{
|
||||
if($verifiedPasword && ($_POST["input_password"] == $inputOldPassword) )
|
||||
{
|
||||
if(!$error)
|
||||
{
|
||||
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("user_error8") . "</div>\n";
|
||||
}
|
||||
$error = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$pdoHost = getenv('MAIN_MYSQL_DB_HOST');
|
||||
$pdoPort = getenv('MAIN_MYSQL_DB_PORT');
|
||||
$pdoUser = getenv('MAIN_MYSQL_DB_USER');
|
||||
$pdoPass = getenv('MAIN_MYSQL_DB_PASS');
|
||||
$pdoSchema = getenv('MAIN_MYSQL_DB_SCHEMA');
|
||||
|
||||
$pdo = new \DynCom\mysyde\common\classes\PDOQueryWrapper($pdoHost, $pdoPort, $pdoSchema, $pdoUser, $pdoPass);
|
||||
|
||||
$prepStatement = " SELECT * FROM main_admin_user WHERE login = :login ";
|
||||
$params = [
|
||||
[':login', $_POST["input_login"], PDO::PARAM_STR],
|
||||
];
|
||||
$pdo->setQuery($prepStatement);
|
||||
$pdo->prepareQuery();
|
||||
$pdo->bindParameters($params);
|
||||
$pdo->executePreparedStatement();
|
||||
$result = $pdo->getResultArray();
|
||||
|
||||
|
||||
if ((count($result) <> 0) && ($_POST["input_id"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("user_error4") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
createMySydeLog('main_admin_user', $input_id, 'INSERT');
|
||||
$messages[] = '<div class="successbox">' . $translation->get("user_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("user_msg_success2") . '</div>';
|
||||
}
|
||||
// saveImg
|
||||
|
||||
if(isset($_FILES) && !empty($_FILES) && $_FILES['user_image']['size'] != 0 ){
|
||||
$fileName = saveImage('user_image', $input_id);
|
||||
|
||||
$query = "UPDATE main_admin_user SET
|
||||
image = '" . $fileName. "'
|
||||
|
||||
WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
}
|
||||
|
||||
// SaveImag
|
||||
|
||||
$query = "DELETE FROM main_site_admin_user_link where main_admin_user_id = " . $input_id;
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
$query = "SELECT * from main_site";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$deleteAll = true;
|
||||
while ($siterow = @mysqli_fetch_assoc($result)) {
|
||||
$arr_ind = "input_site_admin_link_" . $siterow["id"];
|
||||
if(isset($_POST[$arr_ind]) && $_POST[$arr_ind] == "on") {
|
||||
$query = "INSERT INTO main_site_admin_user_link SET
|
||||
main_site_id = " . $siterow["id"] . ",
|
||||
main_admin_user_id = " . $input_id . ",
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
} else {
|
||||
$deleteAll = false;
|
||||
}
|
||||
}
|
||||
|
||||
// if($deleteAll === true) {
|
||||
// $query = "DELETE FROM main_site_admin_user_link where main_admin_user_id = " . $input_id;
|
||||
// @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
// }
|
||||
|
||||
// Zuordnung Benutzer zu Shop
|
||||
// $query = "DELETE FROM main_admin_user_shop_link where main_admin_user_id = '" . $input_id."'";
|
||||
// @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
// $query = "SELECT * from shop_shop";
|
||||
// $result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
// $deleteAll = true;
|
||||
// while ($siterow = @mysqli_fetch_assoc($result)) {
|
||||
// $arr_ind = "input_shop_admin_link_" . $siterow["id"];
|
||||
// if(isset($_POST[$arr_ind]) && $_POST[$arr_ind] == "on") {
|
||||
// $active = 1;
|
||||
// } else {
|
||||
// $active = 0;
|
||||
// $deleteAll = false;
|
||||
// }
|
||||
// $query = "INSERT INTO main_admin_user_shop_link SET
|
||||
// shop_code = '" . $siterow["code"] . "',
|
||||
// main_admin_user_id = " . $input_id . ",
|
||||
// active = " . $active . ",
|
||||
// modified_date = " . time() . ",
|
||||
// modified_user = " . (int)$GLOBALS["admin_user"]['id'];
|
||||
// @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
// }
|
||||
|
||||
// if($deleteAll === true) {
|
||||
// $query = "DELETE FROM main_admin_user_shop_link where main_admin_user_id = " . $input_id;
|
||||
// @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
// }
|
||||
|
||||
edit_admin_user($input_id, $messages);
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_admin_user["id"] = $_POST["input_id"];
|
||||
$input_admin_user["name"] = $_POST["input_name"];
|
||||
$input_admin_user["email"] = $_POST["input_email"];
|
||||
$input_admin_user["login"] = $_POST["input_login"];
|
||||
$input_admin_user["right_create_user"] = $right_create_user;
|
||||
if (($_POST["input_password"] == "nochange") && ($_POST["input_password2"] == "nochange")) {
|
||||
$input_admin_user["password"] = "nochange";
|
||||
$input_admin_user["password2"] = "nochange";
|
||||
} else {
|
||||
$input_admin_user["password"] = "";
|
||||
$input_admin_user["password2"] = "";
|
||||
}
|
||||
require_once("edit_admin_user_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function saveImage($filekey = 'user_image', $input_id){
|
||||
$erlaubte_endungen = array("jpg", "jpeg", "gif", "png");
|
||||
$filename = strtolower($_FILES[$filekey]['name']);
|
||||
$filename_expl = explode(".", $filename);
|
||||
if (!in_array($filename_expl[count($filename_expl) - 1], $erlaubte_endungen)) {
|
||||
$messages = "<div class='errorbox'>" . $translation->get("error_slideshow_line2") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
$saveFilename = $input_id . "_" . time() . "_" . cleanFilename($_FILES[$filekey]['name']);
|
||||
|
||||
$width = 300;
|
||||
$height = 200;
|
||||
require_once(MODULE_PATH . "collection/collection_config.inc.php");
|
||||
move_uploaded_file($_FILES[$filekey]['tmp_name'], PATH_ORIGINAL_PICTURE_COLLECTION . $saveFilename);
|
||||
image_resize(PATH_ORIGINAL_PICTURE_COLLECTION . $saveFilename, PATH_RESIZE_COLLECTION . $saveFilename, $width, $height, TRUE);
|
||||
image_resize(PATH_ORIGINAL_PICTURE_COLLECTION . $saveFilename, "../.." . PATH_ICON_COLLECTION . $saveFilename, 200, 100, TRUE);
|
||||
|
||||
return $saveFilename;
|
||||
|
||||
}
|
||||
function delete_user_image(){
|
||||
$user_id = $_POST['input_id'];
|
||||
$query = "SELECT * FROM main_admin_user WHERE id =".$user_id." LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$user = @mysqli_fetch_array($result);
|
||||
|
||||
if(!empty($user)){
|
||||
$filename = $user['image'];
|
||||
require_once(MODULE_PATH . "collection/collection_config.inc.php");
|
||||
|
||||
if (file_exists(PATH_ORIGINAL_PICTURE_COLLECTION . $filename)) {
|
||||
|
||||
unlink(PATH_ORIGINAL_PICTURE_COLLECTION . $filename);
|
||||
}
|
||||
if (file_exists("../.." . PATH_ICON_COLLECTION . $filename) && !empty($filename)) {
|
||||
unlink("../.." . PATH_ICON_COLLECTION . $filename);
|
||||
}
|
||||
if (file_exists(PATH_RESIZE_COLLECTION . $filename)) {
|
||||
|
||||
unlink(PATH_RESIZE_COLLECTION . $filename);
|
||||
|
||||
}
|
||||
$query = "UPDATE main_admin_user SET
|
||||
image = ''
|
||||
WHERE id = '" . $user_id . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
217
mysyde/admin/edit_admin_user_cardform.inc.php
Normal file
217
mysyde/admin/edit_admin_user_cardform.inc.php
Normal file
@@ -0,0 +1,217 @@
|
||||
<?php
|
||||
$formname = "form_admin_user_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
$disabled = TRUE;
|
||||
$disabledSite = TRUE;
|
||||
|
||||
$query = "SELECT id, code, name FROM main_site ORDER BY id ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$sites = array();
|
||||
$site_values = array();
|
||||
$i = 0;
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$sites[] = $row['name'];
|
||||
$site_values[$i] = $row['id'];
|
||||
$i++;
|
||||
}
|
||||
|
||||
// $query = "SELECT id, name FROM backend_settings ORDER BY id ASC";
|
||||
// $result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$settings_name = array();
|
||||
$settings_value = array();
|
||||
$i = 0;
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$settings_name[] = $row['name'];
|
||||
$settings_value[$i] = $row['id'];
|
||||
$i++;
|
||||
}
|
||||
|
||||
function create_adminuser_site_checkbox( $user_id,$disabledSite = FALSE ) {
|
||||
|
||||
if($user_id == "") {
|
||||
$siteAdminLink = false;
|
||||
} else {
|
||||
$query = "SELECT * FROM main_site_admin_user_link where main_admin_user_id = '" . $user_id."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$siteAdminAvailableSites = array();
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
$siteAdminLink = true;
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$siteAdminAvailableSites[] = $row['main_site_id'];
|
||||
}
|
||||
} else {
|
||||
$siteAdminLink = false;
|
||||
}
|
||||
}
|
||||
|
||||
$query = "SELECT * from main_site";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($siterow = @mysqli_fetch_assoc($result)) {
|
||||
if ($siteAdminAvailableSites !== null) {
|
||||
if( in_array($siterow['id'], $siteAdminAvailableSites)) {
|
||||
$ckecked = 1;
|
||||
} else {
|
||||
|
||||
$ckecked = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
input($siterow['name'], "input_site_admin_link_" . $siterow["id"], "checkbox", $ckecked, NULL, $disabledSite);
|
||||
}
|
||||
}
|
||||
|
||||
function create_adminuser_shop_checkbox( $user_id ) {
|
||||
|
||||
if($user_id == "") {
|
||||
$shopAdminLink = false;
|
||||
} else {
|
||||
$query = "SELECT * FROM main_admin_user_shop_link where main_admin_user_id = '" . $user_id."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$siteAdminAvailableShops = array();
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
$shopAdminLink = true;
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
if($row['active'] == 1) {
|
||||
$siteAdminAvailableShops[] = $row['shop_code'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$shopAdminLink = false;
|
||||
}
|
||||
}
|
||||
|
||||
$query = "SELECT * from shop_shop";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($siterow = @mysqli_fetch_assoc($result)) {
|
||||
if( in_array($siterow['code'], $siteAdminAvailableShops)) {
|
||||
$ckecked = 1;
|
||||
|
||||
} else {
|
||||
$ckecked = 0;
|
||||
echo 'hello';
|
||||
}
|
||||
|
||||
input($siterow['description'], "input_shop_admin_link_" . $siterow["id"], "checkbox", $ckecked);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_admin_user["id"] == "") {
|
||||
echo $translation->get("new_user");
|
||||
} else {
|
||||
echo $translation->get("edit_user");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<? if ($GLOBALS['admin_user']['right_create_user'] == 1 || $GLOBALS['admin_user']['is_super_user'] == 1) {
|
||||
$disabled = FALSE;
|
||||
}?>
|
||||
<? if ($GLOBALS['admin_user']['right_website_admin'] == 1 || $GLOBALS['admin_user']['is_super_user'] == 1) {
|
||||
$disabledSite = FALSE;
|
||||
}?>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save', true, '', true)"); ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
if ($input_admin_user["id"] != "" && ($GLOBALS['admin_user']['right_create_user'] == 1 || $GLOBALS['admin_user']['is_super_user'] == 1)) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete', true, '{$translation->get('delete_user_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
<? //} ?>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_admin_user["id"] ?>">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("name"), "input_name", "hidden", $input_admin_user["name"], 45) ?>
|
||||
<? input($translation->get("email"), "input_email", "hidden", $input_admin_user["email"], 100) ?>
|
||||
<? input($translation->get("login"), "input_login", "hidden", $input_admin_user["login"], 20) ?>
|
||||
<? input($translation->get("create_new_user_right"), "input_right_create_user", "hidden", $input_admin_user["right_create_user"], 45) ?>
|
||||
|
||||
|
||||
<? input($translation->get("name"), "input_name", "text", $input_admin_user["name"], 45, $disabled) ?>
|
||||
<? input($translation->get("email"), "input_email", "text", $input_admin_user["email"], 100, $disabled) ?>
|
||||
<br />
|
||||
<? input($translation->get("login"), "input_login", "code", $input_admin_user["login"], 20, $disabled) ?>
|
||||
<? if($input_admin_user['id'] == $GLOBALS['admin_user']['id']) { input($translation->get("old_password"), "input_old_password", "password","", 45, false);} ?>
|
||||
<? input($translation->get("password"), "input_password", "password","", 45, false) ?>
|
||||
<? input($translation->get("password_repeat"), "input_password2", "password","", 45, false) ?>
|
||||
<? input($translation->get("image"), "user_image", "file", $input_admin_user["image"], 45, $disabled);
|
||||
$valFile = '';
|
||||
if($input_admin_user['image'] != '' && $input_admin_user['image'] != NULL){
|
||||
$valFile = $input_admin_user['image'];
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="user_image_old" value="<?=$valFile;?>">
|
||||
<?php
|
||||
if($input_admin_user["image"] != NULL && $input_admin_user["image"] != ''){
|
||||
echo "<div class='img_container intranet_user_image'><img class='img-fluid' src='/userdata/collection/resize/".$input_admin_user["image"]."'></div>";
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_image', true, '{$translation->get('delete_user_picture')}', false)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
<? input($translation->get("create_new_user_right"), "input_right_create_user", "checkbox", $input_admin_user["right_create_user"], 45, $disabled) ?>
|
||||
<? input($translation->get("create_new_website_right"), "right_website_admin", "checkbox", $input_admin_user["right_website_admin"], 45, $disabledSite) ?>
|
||||
<? input($translation->get("is_betriebsrat"), "is_betriebsrat", "checkbox", $input_admin_user["is_betriebsrat"], 45, $disabledSite) ?>
|
||||
<div style="display:none;"> <? input_select($translation->get("edit_mode"), "input_edit_mode", array(0, 1), array($translation->get('live_edit'), $translation->get('backend_edit')), $input_admin_user["edit_mode"]); ?></div>
|
||||
</td>
|
||||
<td>
|
||||
<? input_select($translation->get("main_website"), "main_site_id", $values = $site_values, $value_names = $sites, $input_admin_user["main_site_id"], $disabledSite); ?>
|
||||
<? input_select($translation->get("backend_language"), "main_language", $values = array(0 => 'de', 1 => 'en'), $value_names = array('Deutsch', 'Englisch'), $input_admin_user["main_language"]); ?>
|
||||
</td>
|
||||
<td class="website-relation" colspan="2">
|
||||
<h3><?php echo $translation->get("admin_user_site"); ?></h3>
|
||||
<?php create_adminuser_site_checkbox($input_admin_user["id"], $disabledSite); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
<link rel="stylesheet" type="text/css" href="/components/password-strength-meter/dist/password.min.css">
|
||||
<script src="/components/password-strength-meter/dist/password.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$('#input_password').password({
|
||||
shortPass: '<?= $GLOBALS['tc']['short_password'] ?> ',
|
||||
badPass: '<?= $GLOBALS['tc']['weak_password'] ?> ',
|
||||
goodPass: '<?= $GLOBALS['tc']['good_password'] ?> ',
|
||||
strongPass: '<?= $GLOBALS['tc']['strong_password'] ?> ',
|
||||
containsUsername: '',
|
||||
enterPass: '',
|
||||
showPercent: false,
|
||||
showText: true, // shows the text tips
|
||||
animate: true, // whether or not to animate the progress bar on input blur/focus
|
||||
animateSpeed: 'fast', // the above animation speed
|
||||
username: false, // select the username field (selector or jQuery instance) for better password checks
|
||||
usernamePartialMatch: true, // whether to check for username partials
|
||||
minimumLength: 6 // minimum password length (below this threshold, the score is 0)
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
34
mysyde/admin/edit_admin_user_listform.inc.php
Normal file
34
mysyde/admin/edit_admin_user_listform.inc.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_admin_user_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
<? if ($GLOBALS['admin_user']['right_create_user'] == 1 | $GLOBALS['admin_user']['is_super_user'] == 1) { ?>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new', true)"); ?>
|
||||
</ul>
|
||||
<? } ?>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('mysyde_top_users'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT id, name AS '" . $translation->get("name") . "', email AS '" . $translation->get("email") . "', login AS " . $translation->get("backend_login_label") . " FROM main_admin_user ORDER BY name ASC";
|
||||
$format = array("option", "text", "text", "text");
|
||||
if ($result = mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
if ($GLOBALS['admin_user']['right_create_user'] == 1 | $GLOBALS['admin_user']['is_super_user'] == 1) {
|
||||
linklist($result, "form_admin_user_list", $format);
|
||||
}else {
|
||||
linklist($result, "form_admin_user_list", $format, 'input_id', 'no_edit');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
655
mysyde/admin/edit_component.inc.php
Normal file
655
mysyde/admin/edit_component.inc.php
Normal file
@@ -0,0 +1,655 @@
|
||||
<?php
|
||||
/**
|
||||
* component edit:
|
||||
* Alle actions die mit der bearbeitung der Seite zu tun haben, müssen auf _component enden.
|
||||
* z.B. edit_component.
|
||||
* Alle anderen actions werden erstmal zum verknüpfen der Subparts genommen.
|
||||
*
|
||||
* @package dc cms
|
||||
*/
|
||||
|
||||
$action = (isset($_GET['action']) ? $_GET['action'] : "");
|
||||
|
||||
$input_component_id = $_REQUEST["input_component_id"];
|
||||
$subaction = substr($action, strrpos($action, '_')+1);
|
||||
|
||||
update_visitor_data(array(
|
||||
'collection_options' => array(
|
||||
'collection_edit' => false
|
||||
)
|
||||
));
|
||||
|
||||
if(isset($_POST['update_visitor_data']) && $_POST['update_visitor_data'] == 1) {
|
||||
$input_active = ($_POST["input_active"] == "on") ? 1 : 0;
|
||||
|
||||
update_visitor_data(array(
|
||||
'component_options' => array(
|
||||
'component_option_layoutarea' => $_POST['input_layout_area_id'],
|
||||
'component_option_active' => $input_active
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
if($action == "" || $subaction == 'component' || $subaction == 'page') {
|
||||
// Wenn keine action ubergeben wurde oder es sich um eine _component action handelt
|
||||
switch($_GET["action"]) {
|
||||
case 'edit_component': case 'edit_content_page': edit_component(); break;
|
||||
case 'delete_component': delete_component(); break;
|
||||
case 'new_component': require_once("edit_component_cardform.inc.php"); break;
|
||||
case 'save_component': save_component(); break;
|
||||
case 'assoc_line_component': assoc_sitepart(); break;
|
||||
case 'delete_line_component' : delete_sitepart(); break;
|
||||
case 'edit_line_component': edit_line_component(); break;
|
||||
case 'edit_line_properties_component': edit_line_properties_component(); break;
|
||||
case 'save_line_properties_component' : save_line_properties_component(); break;
|
||||
case 'moveup_line_component': moveup_line_component(); edit_component(); break;
|
||||
case 'movedown_line_component': movedown_line_component(); edit_component(); break;
|
||||
|
||||
// Seiten filtern
|
||||
case 'filter_component': filter_component(); break;
|
||||
|
||||
// zeige Liste der zuogeordneten Inhalte an
|
||||
case 'edit_content_component': require_once("edit_component_line_listform.inc.php"); break;
|
||||
|
||||
|
||||
// Hinzufuegen eines neuen Textcontents
|
||||
case 'list_textcontent_page': require_once(MODULE_PATH . "textcontent/component_textcontent_listform.inc.php"); break;
|
||||
|
||||
// Hinzufuegen eines neuen Kontaktformulars
|
||||
case 'list_contactform_page': require_once(MODULE_PATH . "contactform/component_contactform_listform.inc.php"); break;
|
||||
|
||||
// Hinzufuegen einer neuen slideshow
|
||||
case 'list_slideshow_page': require_once(MODULE_PATH . "slideshow/component_slideshow_listform.inc.php"); break;
|
||||
|
||||
// Hinzufuegen einer neuen scrollbar
|
||||
case 'list_magicscroll_page': require_once(MODULE_PATH . "magicscroll/component_magicscroll_listform.inc.php"); break;
|
||||
|
||||
// Hinzufuegen einer neuen Gallery
|
||||
case 'list_gallery_page': require_once(MODULE_PATH . "gallery/component_gallery_listform.inc.php"); break;
|
||||
|
||||
// Hinzufuegen einer neuen dateigallery
|
||||
case 'list_filegallery_page': require_once(MODULE_PATH . "filegallery/component_filegallery_listform.inc.php"); break;
|
||||
|
||||
// Hinzufuegen einer neuen google map karte
|
||||
case 'list_googlemaps_page': require_once(MODULE_PATH . "googlemaps/component_googlemaps_listform.inc.php"); break;
|
||||
|
||||
// Hinzufuegen einer neuen facebook box
|
||||
case 'list_facebook_page': require_once(MODULE_PATH . "facebook/component_facebook_listform.inc.php"); break;
|
||||
|
||||
// Hinzufuegen einer neuen youtube box
|
||||
case 'list_youtube_page': require_once(MODULE_PATH . "youtube/component_youtube_listform.inc.php"); break;
|
||||
|
||||
// Hinzufuegen einer neuen iframe box
|
||||
case 'list_iframe_page': require_once(MODULE_PATH . "iframe/component_iframe_listform.inc.php"); break;
|
||||
|
||||
// Hinzufuegen eines neuen slidecontents
|
||||
case 'list_slidecontent_page': require_once(MODULE_PATH . "slidecontent/component_slidecontent_listform.inc.php"); break;
|
||||
|
||||
// Hinzufuegen einer neuen collection vorschau
|
||||
case 'list_collection_preview_page': $input_line = array(); require_once(MODULE_PATH . "collection/component_collection_preview_cardform.inc.php"); break;
|
||||
case 'edit_collection_preview_page': edit_collection_preview_page(); break;
|
||||
case 'save_collection_preview_page': save_collection_preview_page(); break;
|
||||
case 'load_collection_pages_page' : load_collection_pages(); break;
|
||||
case 'load_collections_page' : load_collections(); break;
|
||||
|
||||
// shop siteparts
|
||||
case 'list_shop_login_page':
|
||||
case 'list_shop_main_page':
|
||||
case 'list_shop_item_preview_page':
|
||||
new_shop_sitepart();
|
||||
break;
|
||||
|
||||
// wenn die karte direkt beim seitenaufruf geoeffnet werden soll
|
||||
case 'open_card_component': open_card_component();
|
||||
default: require_once("edit_component_listform.inc.php"); break;
|
||||
}
|
||||
} else {
|
||||
// Ansonsten ist es eine subpart action
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$sitepart_id = null;
|
||||
if(isset($_POST['sitepart_id']) && !empty($_POST['sitepart_id'])) {
|
||||
$sitepart_id = (int) $_POST['sitepart_id'];
|
||||
} elseif(isset($_POST['data-sitepartid']) && !empty($_POST['data-sitepartid'])) {
|
||||
$sitepart_id = (int) $_POST['data-sitepartid'];
|
||||
}
|
||||
|
||||
if($sitepart_id != null && $siteparts[$sitepart_id]['header_table'] == "") {
|
||||
// keine header_table, einfach direkt zuordnen
|
||||
set_component_link($sitepart_id, 0);
|
||||
edit_component();
|
||||
} else {
|
||||
|
||||
// schneller hack um das sitepart anhand des codes herauszufinden
|
||||
//@TODO Sitepart ID sollte immer uebergeben werden
|
||||
$currentSitepart = null;
|
||||
foreach($siteparts as $sitepartData) {
|
||||
if($subaction == $sitepartData['code']) {
|
||||
$currentSitepart = $sitepartData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if($sitepart_id != null) {
|
||||
$currentSitepart = $siteparts[$sitepart_id];
|
||||
}
|
||||
|
||||
$path = realpath(MODULE_PATH . $currentSitepart['folder']) . DIRECTORY_SEPARATOR . 'edit_' . $currentSitepart['code'] . ".inc.php";
|
||||
if(file_exists($path)) {
|
||||
require_once($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function new_shop_sitepart() {
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$currentSitepart = $siteparts[$_POST['sitepart_id']];
|
||||
$path = realpath(MODULE_PATH . $currentSitepart['folder']) . DIRECTORY_SEPARATOR . 'edit_' . $currentSitepart['code'] . ".inc.php";
|
||||
if(file_exists($path)) {
|
||||
require_once($path);
|
||||
}
|
||||
}
|
||||
|
||||
function save_collection_preview_page() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$error = false;
|
||||
|
||||
if($_POST['main_collection_setup_id'] == "") {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_collection_choose_setup") . "</div>\n";
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if(!isset($_POST['main_collection_page_list_id']) || $_POST['main_collection_page_list_id'] == "") {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_collection_choose_page_with_list") . "</div>\n";
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if($_POST['main_collection_view_type'] == 0 && (int)$_POST['main_collection_id'] <= 0) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_collection_choose_collection_for_preview") . "</div>\n";
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if($_POST['main_collection_view_type'] == 1 && (int)$_POST['main_collection_items'] <= 0) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_collection_choose_collection_items") . "</div>\n";
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if($error === false) {
|
||||
if($_REQUEST["input_id"] != "") {
|
||||
// update
|
||||
$query = "UPDATE main_component_link SET
|
||||
main_collection_id = '" . (int)$_POST['main_collection_id'] . "',
|
||||
main_collection_setup_id = '" . (int)$_POST['main_collection_setup_id'] . "',
|
||||
main_collection_page_list_id = '" . (int)$_POST['main_collection_page_list_id'] . "',
|
||||
main_collection_items = '" . (int)$_POST['main_collection_items'] . "',
|
||||
main_collection_view_type = '" . (int)$_POST['main_collection_view_type'] . "',
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
modified_date = " . time() . "
|
||||
|
||||
WHERE id = '" . $_REQUEST["input_id"] . "'
|
||||
";
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
|
||||
$messages = array(
|
||||
'<div class="successbox">' . $translation->get("collection_preview_edit_success") . '</div>'
|
||||
);
|
||||
|
||||
} else {
|
||||
set_component_link(0, 0, 2, (int)$_POST['main_collection_id'], (int)$_POST['main_collection_setup_id'], (int)$_POST['main_collection_view_type'], (int)$_POST['main_collection_items'], (int)$_POST['main_collection_page_list_id']);
|
||||
|
||||
$messages = array(
|
||||
'<div class="successbox">' . $translation->get("page_line_assoc_success") . '</div>'
|
||||
);
|
||||
}
|
||||
|
||||
// gruppen hinzufuegen
|
||||
mysqli_query($GLOBALS['mysql_con'],"DELETE FROM main_component_collection_group_link WHERE main_component_link_id = '" . (int)$_REQUEST["input_id"]."'");
|
||||
|
||||
$query = "SELECT * FROM main_collection_setup_group WHERE main_collection_setup_id = '" . (int)$_POST['main_collection_setup_id']."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
while ($row = @mysqli_fetch_assoc($result)) {
|
||||
$arr_ind = "input_collection_group_" . $row["id"] . "_active";
|
||||
if ($_POST[$arr_ind] != "on") {
|
||||
continue;
|
||||
}
|
||||
|
||||
$query_3 = "INSERT INTO main_component_collection_group_link SET
|
||||
main_component_link_id = '" . (int)$_REQUEST["input_id"] . "',
|
||||
main_collection_setup_group_id = " . $row["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query_3);
|
||||
|
||||
}
|
||||
|
||||
if($_REQUEST['save_and_close'] == 1) {
|
||||
edit_component("", $messages);
|
||||
} else {
|
||||
edit_collection_preview_page("", $messages);
|
||||
}
|
||||
|
||||
} else {
|
||||
$input_line = $_POST;
|
||||
require_once(MODULE_PATH . "collection/component_collection_preview_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function edit_collection_preview_page($_id = "", $messages = array()) {
|
||||
if((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
if($input_id <> '') {
|
||||
$query="SELECT * FROM main_component_link WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
if(@mysqli_num_rows($result) == 1) {
|
||||
$input_line = @mysqli_fetch_array($result);
|
||||
require_once(MODULE_PATH . "collection/component_collection_preview_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
$input_line = array();
|
||||
require_once(MODULE_PATH . "collection/component_collection_preview_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function load_collection_pages() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
ob_start();
|
||||
create_page_with_collection_select($_POST['collection_setup_id'], $translation->get("page_with_collections"), "main_collection_page_list_id", array(), false);
|
||||
$output1 = ob_get_clean();
|
||||
|
||||
$active_groups = array();
|
||||
$query = "SELECT main_collection_setup_group_id from main_component_collection_group_link where main_component_link_id = '" . $_POST['component_link_id']."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
$active_groups[] = $row['main_collection_setup_group_id'];
|
||||
}
|
||||
ob_start();
|
||||
create_collection_preview_group_select($_POST['collection_setup_id'], $_POST['component_link_id'], $active_groups);
|
||||
$output2 = ob_get_clean();
|
||||
|
||||
echo json_encode(array('page_with_collection_select' => $output1, 'collection_preview_group_select' => $output2));
|
||||
}
|
||||
|
||||
function load_collections() {
|
||||
// ajax call
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$setup_id = $_POST['main_collection_setup_id'];
|
||||
$collections = array();
|
||||
$collection_ids = array();
|
||||
if($setup_id != "") {
|
||||
$query = "SELECT * FROM main_collection WHERE main_collection_setup_id = '" . $setup_id . "' AND main_language_id = '" . $GLOBALS["language"]['id']."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
while ($row = @mysqli_fetch_array($result,1)) {
|
||||
$collections[] = $row['description'];
|
||||
$collection_ids[] = $row['id'];
|
||||
}
|
||||
}
|
||||
|
||||
input_select($translation->get("choose_collection"),"main_collection_id",$values = $collection_ids,$value_names = $collections,"", false, false);
|
||||
}
|
||||
|
||||
function filter_component() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$filter_id = $_REQUEST['filter_id'];
|
||||
$include_children = $_REQUEST['include_children'];
|
||||
|
||||
if((int)$filter_id <= 0) {
|
||||
$query = "SELECT main_component.id, title AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from main_component left join main_admin_user ON main_component.modified_user = main_admin_user.id where main_language_id = '" . (int)$GLOBALS["language"]['id']."'";
|
||||
$format = array('option', 'text','text','text');
|
||||
if($result = @mysqli_query($GLOBALS['mysql_con'],$query)) {
|
||||
linklist($result,"form_component_list",$format, "input_component_id", "edit_content_component");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$component_ids = array();
|
||||
// seiten IDs, die dem Navigationspunkt und dessen Kindern zugerodnet sind
|
||||
$query = "SELECT forward_component_id FROM main_navigation WHERE id = '" . (int)$filter_id . "' AND forward_component_id > 0";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
if(@mysqli_num_rows($result) > 0) {
|
||||
$row = @mysqli_fetch_array($result);
|
||||
if(!in_array($row['forward_component_id'], $component_ids)) {
|
||||
$component_ids[] = $row['forward_component_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if($include_children == 1) {
|
||||
filter_component_children($filter_id, $component_ids);
|
||||
}
|
||||
|
||||
if(count($component_ids) > 0) {
|
||||
$query = "SELECT main_component.id, title AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from main_component left join main_admin_user ON main_component.modified_user = main_admin_user.id where main_language_id = '" . (int)$GLOBALS["language"]['id'] . "' AND main_component.id IN (" . join(',', $component_ids) . ")";
|
||||
$format = array('option', 'text','text','text');
|
||||
if($result = @mysqli_query($GLOBALS['mysql_con'],$query)) {
|
||||
linklist($result,"form_component_list",$format, "input_component_id", "edit_content_component");
|
||||
}
|
||||
} else {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
function filter_component_children($_parentid, &$component_ids) {
|
||||
$query = "SELECT id, forward_component_id FROM main_navigation WHERE parent_id = '" . $_parentid."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
if(@mysqli_num_rows($result) > 0) {
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
if((int)$row['forward_component_id'] > 0 && !in_array($row['forward_component_id'], $component_ids)) {
|
||||
$component_ids[] = $row['forward_component_id'];
|
||||
}
|
||||
filter_component_children($row['id'], $component_ids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function filter_component_children_rek() {
|
||||
|
||||
}
|
||||
|
||||
function open_card_component() {
|
||||
echo "<script type=\"text/javascript\">";
|
||||
|
||||
echo "openCardOnStart = true; openCardAction='edit_component';";
|
||||
|
||||
echo "</script>";
|
||||
}
|
||||
|
||||
function assoc_sitepart($_sitepartId="", $_inputid = "", $_close = true) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
if($_sitepartId != "") {
|
||||
$sitepartId = $_sitepartId;
|
||||
} else {
|
||||
$sitepartId = $_REQUEST['data-sitepartid'];
|
||||
}
|
||||
|
||||
if($_inputid != "") {
|
||||
$inputid = $_inputid;
|
||||
} else {
|
||||
$inputid = $_REQUEST['input_id'];
|
||||
}
|
||||
|
||||
set_component_link($sitepartId, $inputid);
|
||||
|
||||
$messages = array(
|
||||
'<div class="successbox">' . $translation->get("component_line_assoc_success") . '</div>'
|
||||
);
|
||||
|
||||
if($_close === true) {
|
||||
edit_component("", $messages);
|
||||
}
|
||||
}
|
||||
|
||||
function delete_sitepart() {
|
||||
$query = "DELETE FROM main_component_link WHERE id = '" . $_POST['input_id'] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
|
||||
$query = "UPDATE main_component set modified_date = " . time() . ", modified_user = " . (int)$GLOBALS["admin_user"]['id'] . " where id = '" . (int)$_REQUEST["input_component_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
|
||||
$query = "DELETE FROM main_component_collection_group_link WHERE main_component_link_id = '" . $_POST['input_id']."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
|
||||
edit_component();
|
||||
}
|
||||
|
||||
function edit_line_component() {
|
||||
// anhand der input_id sitepart art auslesen
|
||||
$sitepartId = $_REQUEST['data-sitepartid'];
|
||||
$query = "SELECT * FROM main_component_link WHERE id = '" . $_POST['input_id']."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
$row = @mysqli_fetch_array($result);
|
||||
|
||||
if($row['main_collection_list'] == 2) {
|
||||
edit_collection_preview_page();
|
||||
return;
|
||||
}
|
||||
|
||||
if((int)$row['main_sitepart_header_id'] <= 0) {
|
||||
// keine header_table, also nur Seiteneinstellungen aufrufen
|
||||
edit_component();
|
||||
return;
|
||||
}
|
||||
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
|
||||
$sitepartcode = $siteparts[$row['main_sitepart_id']]['code'];
|
||||
$sitepartfolder = $siteparts[$row['main_sitepart_id']]['folder'];
|
||||
$_REQUEST['input_id'] = $row['main_sitepart_header_id'];
|
||||
|
||||
$custom_action = 'edit_' . $sitepartcode;
|
||||
require_once(MODULE_PATH . $sitepartfolder . "/edit_" . $sitepartcode . ".inc.php");
|
||||
}
|
||||
|
||||
function save_line_properties_component() {
|
||||
$messages = array();
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$input_id = $_POST['input_id'];
|
||||
$input_active = ($_POST["input_active"] == "on") ? 1 : 0;
|
||||
$layout_area_id = $_POST['input_layout_area_id'];
|
||||
|
||||
$query = "UPDATE main_component_link SET layout_area_id = '" . $layout_area_id . "' , active = " . $input_active . " WHERE id = '" . $input_id."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
|
||||
$messages[] = '<div class="successbox">' . $translation->get("component_properties_save_success") . '</div>';
|
||||
|
||||
if($_REQUEST['save_and_close'] == 1) {
|
||||
require_once("edit_component_line_listform.inc.php");
|
||||
} else {
|
||||
edit_line_properties_component($input_id, $messages);
|
||||
}
|
||||
}
|
||||
|
||||
function edit_line_properties_component($_id = "", $messages = array()) {
|
||||
if((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
if($input_id <> '') {
|
||||
$query="SELECT * FROM main_component_link WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
if(@mysqli_num_rows($result) == 1) {
|
||||
$input_line = @mysqli_fetch_array($result);
|
||||
require_once("edit_component_line_properties_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
$input_line = array();
|
||||
require_once("edit_component_line_properties_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function edit_component($_id = "", $messages = array()) {
|
||||
if((int)$_id > 0) {
|
||||
$input_component_id = $_id;
|
||||
} else {
|
||||
$input_component_id = $_REQUEST["input_component_id"];
|
||||
}
|
||||
|
||||
if($input_component_id <> '') {
|
||||
$query="SELECT * FROM main_component WHERE id = '" . $input_component_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
if(@mysqli_num_rows($result) == 1) {
|
||||
$input_component = @mysqli_fetch_array($result);
|
||||
require_once("edit_component_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
$input_component = array();
|
||||
require_once("edit_component_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_component() {
|
||||
if($_REQUEST["input_component_id"] <> '') {
|
||||
$query = "DELETE FROM main_component WHERE id = '" . $_REQUEST["input_component_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
|
||||
$query = "DELETE FROM main_component_link WHERE main_component_id = '" . $_REQUEST["input_component_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
}
|
||||
require_once("edit_component_listform.inc.php");
|
||||
}
|
||||
|
||||
function save_component() {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$messages = array();
|
||||
|
||||
$input_component_id = "";
|
||||
$input_active = ($_POST["input_active"] == "on") ? 1 : 0;
|
||||
$input_validity_from = datetosql("");
|
||||
$input_validity_to = datetosql("");
|
||||
$default_active = $_REQUEST["input_component_default_active"];
|
||||
$input_all_languages = ($_POST["input_all_languages"] == "on") ? 1 : 0;
|
||||
|
||||
if($_REQUEST["input_component_id"] <> '') {
|
||||
$query = "UPDATE main_component SET
|
||||
title = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "',
|
||||
code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"]) . "',
|
||||
layout_area_id = '" . $_REQUEST['input_layout_area_id'] . "',
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
active = " . $input_active . ",
|
||||
default_active = '" . $default_active . "',
|
||||
validity_from = " . $input_validity_from . ",
|
||||
validity_to = " . $input_validity_to . ",
|
||||
all_languages = " . $input_all_languages . "
|
||||
WHERE id = " . $_REQUEST["input_component_id"] . "
|
||||
LIMIT 1";
|
||||
$inserted = false;
|
||||
$input_component_id = $_REQUEST["input_component_id"];
|
||||
} else {
|
||||
$query = "INSERT INTO main_component
|
||||
(title, code, main_language_id, layout_area_id, active, default_active, modified_date, modified_user, validity_from, validity_to, all_languages)
|
||||
VALUES (
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_description']) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_code']) . "',
|
||||
" . (int)$GLOBALS["language"]['id'] . ",
|
||||
'" . $_REQUEST['input_layout_area_id'] . "',
|
||||
" . $input_active . ",
|
||||
'" . $default_active . "',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
" . $input_validity_from . ",
|
||||
" . $input_validity_to . ",
|
||||
" . $input_all_languages . "
|
||||
)";
|
||||
$inserted = true;
|
||||
}
|
||||
|
||||
if(($_REQUEST["input_code"] == '')|($_REQUEST["input_description"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_description") . "</div>\n";
|
||||
$error = true;
|
||||
}
|
||||
if($_REQUEST["input_code"] <> urlencode($_REQUEST["input_code"])) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_encoding") . "</div>\n";
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if(!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
if($inserted == true) {
|
||||
$input_component_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("component_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("component_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
edit_component($input_component_id, $messages);
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_component = array();
|
||||
$input_component['id'] = $input_component_id;
|
||||
$input_component["title"] = $_REQUEST["input_description"];
|
||||
$input_component["code"] = $_REQUEST["input_code"];
|
||||
$input_component['layout_area_id'] = $_REQUEST['input_layout_area_id'];
|
||||
$input_component["active"] = $input_active;
|
||||
$input_component["all_languages"] = $input_all_languages;
|
||||
require_once("edit_component_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function moveup_line_component() {
|
||||
move_line_component("<","DESC",$_REQUEST["input_id"]);
|
||||
}
|
||||
|
||||
function movedown_line_component() {
|
||||
move_line_component(">","ASC",$_REQUEST["input_id"]);
|
||||
}
|
||||
|
||||
function move_line_component($way,$order,$field_id) {
|
||||
$query = "SELECT * FROM main_component_link WHERE id = '" . $field_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
if(@mysqli_num_rows($result) == 1) {
|
||||
$curr_line = @mysqli_fetch_array($result);
|
||||
}
|
||||
$query = "SELECT * FROM main_component_link WHERE main_component_id = '" . $curr_line["main_component_id"] . "' AND sorting " . $way . " " . $curr_line["sorting"] . " ORDER BY sorting " . $order . " LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
if(@mysqli_num_rows($result) == 1) {
|
||||
$change_line = @mysqli_fetch_array($result);
|
||||
}
|
||||
if(($curr_line["id"]<>'') && ($change_line["id"]<>'')) {
|
||||
$query = "UPDATE main_component_link SET sorting = " . $change_line["sorting"] . " WHERE id = " . $curr_line["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
$query = "UPDATE main_component_link SET sorting = " . $curr_line["sorting"] . " WHERE id = " . $change_line["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
$query = "UPDATE main_component set modified_date = " . time() . ", modified_user = " . (int)$GLOBALS["admin_user"]['id'] . " where id = " . $curr_line["main_component_id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
}
|
||||
}
|
||||
|
||||
function line_already_exists($_componentid, $_sitepartid, $sitepart_headerid) {
|
||||
$query = "SELECT id FROM main_component_link WHERE main_component_id = '" . $_componentid . "' AND main_sitepart_id = '" . $_sitepartid . "' AND main_sitepart_header_id = '" . $sitepart_headerid."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
if(@mysqli_num_rows($result) >= 1) {
|
||||
$row = @mysqli_fetch_array($result);
|
||||
return $row['id'];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function get_real_component_link_id() {
|
||||
if(isset($_REQUEST['get_real_component_link_id']) && $_REQUEST['get_real_component_link_id'] == 1) {
|
||||
$_REQUEST['input_id'] = line_already_exists($_REQUEST["input_component_id"], $_REQUEST['data-sitepartid'], $_REQUEST["input_id"]);
|
||||
}
|
||||
}
|
||||
|
||||
function component_filter($site_id, $language_id, $from_level = 1, $to_level = 3) {
|
||||
echo "<div class=\"input\"><select onchange=\"filter_component();\" class=\"bigselect\" name=\"component_filter\" id=\"component_filter\">";
|
||||
echo "<option value=''>Alle anzeigen</option>";
|
||||
component_filter_rek($site_id,$language_id, 0, 1, "", $from_level, $to_level);
|
||||
echo "</select>";
|
||||
echo "<input onclick=\"filter_component();\" checked=\"checked\" type=\"checkbox\" name=\"include_children\" id=\"include_children\" /> Inkl. Unterseiten";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
function component_filter_rek($site_id, $language_id, $parent_id, $level, $navcode, $from_level, $to_level) {
|
||||
$spaces = "";
|
||||
$count = 1;
|
||||
while($count < $level) {
|
||||
$spaces .= " ";
|
||||
$count++;
|
||||
}
|
||||
$parent_id_query = ($parent_id == 0) ? " AND parent_id IS NULL" : " AND parent_id = '" . $parent_id."' ";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],"SELECT * FROM main_navigation WHERE main_site_id = '" . $site_id . "' AND main_language_id = '" . $language_id."'" . $parent_id_query . " ORDER BY sorting ASC");
|
||||
$show_level = (($level >= $from_level) && ($level <= $to_level)) ? true : false;
|
||||
if(@mysqli_num_rows($result) > 0) {
|
||||
while ($nav = @mysqli_fetch_array($result)) {
|
||||
$newnavcode = $navcode . $nav["code"] . "/";
|
||||
$active = "";
|
||||
if ($show_level) {
|
||||
echo "\n<option " . $active . "value=\"" . $nav["id"] . "\">" . $spaces . $nav["menu_name"] . "</option>";
|
||||
component_filter_rek($site_id, $language_id, $nav["id"], ($level+1),$newnavcode, $from_level, $to_level );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($level == 1) {
|
||||
echo "\n<option selected=\"selected\" value=\"0\"> - </option>";
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
95
mysyde/admin/edit_component_cardform.inc.php
Normal file
95
mysyde/admin/edit_component_cardform.inc.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_component_card";
|
||||
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
|
||||
$main_component_id = (int)$input_component["id"];
|
||||
|
||||
function create_checkboxes( $main_layout_id, $main_component_id, $type ) {
|
||||
$query = "
|
||||
SELECT id, path, default_active
|
||||
FROM main_layout_inclusions
|
||||
WHERE main_layout_id = '" . $main_layout_id . "' AND type = '" . $type . "'
|
||||
ORDER BY sorting ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$layout_inclusions = array();
|
||||
IF (@mysqli_num_rows($result) > 0) {
|
||||
WHILE ($layout_inclusions = @mysqli_fetch_assoc($result)) {
|
||||
$query2 = "SELECT active FROM main_page_layout_inclusion_link WHERE
|
||||
main_layout_includes_id = '" . $layout_inclusions["id"] . "' AND
|
||||
main_component_id = '" . $main_component_id."'";
|
||||
$result2 = mysqli_query($GLOBALS['mysql_con'], $query2);
|
||||
$boxname_array = array();
|
||||
$boxname_array = explode("/", $layout_inclusions["path"]);
|
||||
$array_index = count($boxname_array) - 1;
|
||||
$boxname = $boxname_array[$array_index];
|
||||
IF (@mysqli_num_rows($result2) == 0) {
|
||||
input($boxname, "input_script_" . $layout_inclusions["id"] . "_active", "checkbox", $layout_inclusions["default_active"]);
|
||||
} ELSE {
|
||||
input($boxname, "input_script_" . $layout_inclusions["id"] . "_active", "checkbox", @mysqli_result($result2, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_component["id"] == "") {
|
||||
echo $translation->get("new_component");
|
||||
} else {
|
||||
echo $translation->get("edit_component");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_component', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save_component', true, '', true)"); ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
if ($input_component["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_component', true, '{$translation->get('delete_component_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_component_id" type="hidden" value="<?= $input_component["id"] ?>">
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? input($translation->get("textkey"), "input_code", "code", $input_component["code"], 20) ?>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_component["title"], 255) ?>
|
||||
<? input($translation->get("active"), "input_active", "checkbox", $input_component['active']); ?>
|
||||
<? input($translation->get("show_in_all_languages"), "input_all_languages", "checkbox", $input_component["all_languages"]) ?>
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<? layout_area_select($translation->get("layout_area"), "input_layout_area_id", $input_component['layout_area_id']); ?>
|
||||
<? input_select($translation->get("default_active"), "input_component_default_active", $values = array('1', '0'), $value_names = array($translation->get("yes"), $translation->get("no")), $input_component["default_active"]); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?
|
||||
if ($input_component['id'] != "") {
|
||||
require_once("edit_component_line_listform.inc.php");
|
||||
}
|
||||
?>
|
||||
200
mysyde/admin/edit_component_line_listform.inc.php
Normal file
200
mysyde/admin/edit_component_line_listform.inc.php
Normal file
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_component_field_list";
|
||||
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$input_component_id = $input_component["id"];
|
||||
?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var clickmode = 'new';
|
||||
|
||||
function toggle_inhalte_scroller() {
|
||||
|
||||
if (contentscroller.css('display') == 'none') {
|
||||
contentscroller.show();
|
||||
} else {
|
||||
//contentscroller.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleScrollerHeadline( _headline, _clickAction ) {
|
||||
var contentscroller = $('.inhalte_toggle_container');
|
||||
$('#srollerInhalteHeadline h3').html(_headline);
|
||||
contentscroller.show();
|
||||
|
||||
clickmode = _clickAction;
|
||||
}
|
||||
|
||||
function contentmenuClick( _el, _module, _listOnly, _sitepartId ) {
|
||||
var listOnly = _listOnly || false;
|
||||
var sitepartId = _sitepartId || 0;
|
||||
setCurrentToolbarClicked(_el);
|
||||
|
||||
if (listOnly === true) {
|
||||
loadCard('list_' + _module + '_page', true);
|
||||
return;
|
||||
}
|
||||
|
||||
$('input[name="sitepart_id"]', $('#form_inhalte')).val(_sitepartId);
|
||||
|
||||
if (clickmode == 'list') {
|
||||
loadCard('list_' + _module + '_page', true);
|
||||
} else {
|
||||
loadCard('new_' + _module, true);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<h2><?php echo $translation->get("top_contents"); ?></h2>
|
||||
<ul class="toolbar_menu two-component">
|
||||
<?= button("new", $translation->get("add_content2"), $formname, "toggleScrollerHeadline('" . $translation->get("add_content2") . "', 'new');", "", FALSE); ?>
|
||||
<?= button("link", $translation->get("add_content"), $formname, "toggleScrollerHeadline('" . $translation->get("add_content") . "', 'list');", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit_content"), $formname, "loadCard('edit_line_component')", "", FALSE); ?>
|
||||
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_line_component')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_line_component')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_line_component', false, '{$translation->get('delete_assoc_component_line')}')", "", FALSE); ?>
|
||||
</ul>
|
||||
|
||||
<form id="form_inhalte" name="form_inhalte" method="post" class="inhalte_toggle_container">
|
||||
<input type="hidden" name="update_visitor_data" value="1" />
|
||||
<input type="hidden" name="sitepart_id" value="0" />
|
||||
<input name="input_component_id" type="hidden" value="<?= $input_component_id ?>">
|
||||
|
||||
<div class="inhalte_toggle_container" id="inhalte_form_headline">
|
||||
<div id="srollerInhalteHeadline"><h3><?php echo $translation->get("insert_new_field"); ?></h3></div>
|
||||
</div>
|
||||
<div id="pagecontentScroller" class="pagecontentScroller inhalte_toggle_container">
|
||||
<div class="scroller_inhalte">
|
||||
<ul class="inhalte_menu">
|
||||
<?php
|
||||
foreach ($siteparts as $sitepartId => $sitepartData) {
|
||||
// keine shop siteparts anzeigen
|
||||
if (isset($sitepartData['is_shop']) || $sitepartData['is_shop'] === TRUE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
button($sitepartData['class'], $sitepartData['description'], 'form_inhalte', "contentmenuClick(this, '{$sitepartData['code']}', false, $sitepartId)");
|
||||
}
|
||||
|
||||
button("inhalt_collection graybox", $translation->get("collection_preview"), 'form_inhalte', "contentmenuClick(this, 'collection_preview', true)");
|
||||
foreach ($siteparts as $sitepartId => $sitepartData) {
|
||||
// nur shop siteparts anzeigen
|
||||
if (!isset($sitepartData['is_shop']) || $sitepartData['is_shop'] === FALSE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
button($sitepartData['class'] . ' graybox', $sitepartData['description'], 'form_inhalte', "contentmenuClick(this, '{$sitepartData['code']}', false, $sitepartId)");
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_component_id" type="hidden" value="<?= $input_component_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<?
|
||||
// alle layoutareas
|
||||
$layoutareas = array();
|
||||
$query = "SELECT * FROM main_layout_area WHERE main_layout_id = '" . $main_layout_id."'";
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
$layoutareas[$row['id']] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
$query = "SELECT
|
||||
main_component_link.id,
|
||||
main_component_link.main_sitepart_id,
|
||||
main_component_link.main_sitepart_header_id,
|
||||
main_component_link.main_collection_id,
|
||||
main_component_link.main_collection_setup_id,
|
||||
from_unixtime(main_component_link.modified_date, '%d.%m.%Y %H:%i:%s') AS aenderungs_datum,
|
||||
main_admin_user.name AS username
|
||||
FROM
|
||||
main_component_link left join main_admin_user
|
||||
ON
|
||||
main_component_link.modified_user = main_admin_user.id
|
||||
WHERE
|
||||
main_component_link.main_component_id = " . $input_component_id . "
|
||||
ORDER BY
|
||||
sorting ASC";
|
||||
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
$num_rows = @mysqli_num_rows($result);
|
||||
if ($num_rows >= 1) {
|
||||
echo " <table cellpadding=0 cellspacing=0 border=0 class=\"linklist\">\n";
|
||||
|
||||
echo "<tr>";
|
||||
echo format_key($translation->get("type"), "");
|
||||
echo format_key($translation->get("description"), "");
|
||||
echo format_key($translation->get("changed_on"), "");
|
||||
echo format_key($translation->get("changed_by"), "");
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr>";
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo "</tr>";
|
||||
|
||||
get_real_component_link_id();
|
||||
|
||||
while ($row = @mysqli_fetch_array($result, 1)) {
|
||||
|
||||
if ($row['main_collection_id'] > 0 || $row['main_collection_setup_id'] > 0) {
|
||||
$sitepartType = "Kollektion Vorschau";
|
||||
$query_description = "SELECT description FROM main_collection_setup WHERE id = '" . $row['main_collection_setup_id']."'";
|
||||
$result_description = @mysqli_query($GLOBALS['mysql_con'], $query_description);
|
||||
$row_sitepart_description = @mysqli_fetch_array($result_description);
|
||||
$dblClickAction = "edit_collection_preview_page";
|
||||
} else {
|
||||
|
||||
if ((int)$row['main_sitepart_header_id'] <= 0) {
|
||||
|
||||
// siteparts, die keine header_table brauchen
|
||||
$sitepartType = $siteparts[$row['main_sitepart_id']]['description'];
|
||||
$row_sitepart_description['description'] = $siteparts[$row['main_sitepart_id']]['sub_description'];
|
||||
$dblClickAction = "edit_line_component";
|
||||
|
||||
} else {
|
||||
|
||||
// siteparts mit einer header_table
|
||||
$query_description = "SELECT description FROM " . $siteparts[$row['main_sitepart_id']]['header_table'] . " WHERE id = '" . $row['main_sitepart_header_id']."'";
|
||||
$result_description = @mysqli_query($GLOBALS['mysql_con'], $query_description);
|
||||
$row_sitepart_description = @mysqli_fetch_array($result_description);
|
||||
$sitepartType = $siteparts[$row['main_sitepart_id']]['description'];
|
||||
$dblClickAction = "edit_line_component";
|
||||
if (empty($row_sitepart_description['description'])) {
|
||||
$row_sitepart_description['description'] = $siteparts[$row['main_sitepart_id']]['description'];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$checkedRow = $row['id'] == $_REQUEST["input_id"] ? 'true' : 'false';
|
||||
echo " <tr class=\"linklist_content\" data-sitepartid=\"{$row['main_sitepart_id']}\" data-checked=\"{$checkedRow}\" data-inputname=\"input_id\" data-action=\"" . $dblClickAction . "\" data-inputid=\"{$row['id']}\">\n";
|
||||
|
||||
echo format_value($sitepartType, "input_id");
|
||||
echo format_value($row_sitepart_description['description'], "input_id");
|
||||
echo format_value($row['aenderungs_datum'], "input_id");
|
||||
echo format_value($row['username'], "input_id");
|
||||
|
||||
echo " </tr>\n";
|
||||
}
|
||||
|
||||
echo " </table>\n";
|
||||
} else {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div>";
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
31
mysyde/admin/edit_component_listform.inc.php
Normal file
31
mysyde/admin/edit_component_listform.inc.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_component_list";
|
||||
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_component', true)"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_components'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_component_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<div id="component_linklist">
|
||||
<?
|
||||
$query = "SELECT main_component.id, title AS '" . $translation->get("description") . "', main_component.code AS '" . $translation->get("code") . "', main_layout_area.name AS '" . $translation->get("layout_area") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from main_component left join main_admin_user ON main_component.modified_user = main_admin_user.id inner join main_layout_area ON main_component.layout_area_id = main_layout_area.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) order by id asc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_component_id", "edit_component");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
176
mysyde/admin/edit_files.inc.php
Normal file
176
mysyde/admin/edit_files.inc.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
switch ($_REQUEST["action"]) {
|
||||
case 'edit':
|
||||
edit_layout();
|
||||
break;
|
||||
case 'delete':
|
||||
delete_layout();
|
||||
break;
|
||||
case 'new':
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
break;
|
||||
case 'save':
|
||||
save_layout();
|
||||
break;
|
||||
case 'edit_area':
|
||||
edit_layout_area();
|
||||
break;
|
||||
case 'delete_area':
|
||||
delete_layout_area();
|
||||
break;
|
||||
case 'new_area':
|
||||
require_once("edit_layout_area_cardform.inc.php");
|
||||
break;
|
||||
case 'save_area':
|
||||
save_layout_area();
|
||||
break;
|
||||
case 'moveup_inclusion':
|
||||
moveup_inclusion();
|
||||
edit_layout();
|
||||
break;
|
||||
case 'movedown_inclusion':
|
||||
movedown_inclusion();
|
||||
edit_layout();
|
||||
break;
|
||||
case 'delete_inclusion':
|
||||
delete_inclusion();
|
||||
edit_layout();
|
||||
break;
|
||||
case 'edit_inclusion':
|
||||
edit_inclusion();
|
||||
break;
|
||||
case 'new_inclusion':
|
||||
require_once("edit_layout_inclusions_cardform.inc.php");
|
||||
break;
|
||||
case 'save_inclusion':
|
||||
save_inclusion($sitepart);
|
||||
break;
|
||||
case 'moveup_area':
|
||||
moveup_area();
|
||||
edit_layout();
|
||||
break;
|
||||
case 'movedown_area':
|
||||
movedown_area();
|
||||
edit_layout();
|
||||
break;
|
||||
default:
|
||||
require_once("edit_files_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function show_dir_structure( $site, $language ) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
// config des ck plugins auslesen
|
||||
$config = array();
|
||||
$not_include = TRUE;
|
||||
include CMS_PATH . '../plugins/ckfinder/config.php';
|
||||
$resources = $config['ResourceType'];
|
||||
|
||||
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"linklist\"><tr>";
|
||||
echo "<td><div>" . $translation->get("name") . "</div></td>";
|
||||
echo "<td width=\"160\" align=\"left\"><div>" . $translation->get("count_files") . "</div></td>";
|
||||
echo "<td width=\"160\" align=\"left\"><div>" . $translation->get("changed_on") . "</div></td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td class=\"linklist_seperator\"></td>";
|
||||
echo "<td class=\"linklist_seperator\"></td>";
|
||||
echo "<td class=\"linklist_seperator\"></td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "</table>";
|
||||
show_dir_structure_rek($site, $language, 0, 1, 0, $resources);
|
||||
|
||||
echo "\n";
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function resolveUrl( $_url ) {
|
||||
//dummy function needed for ckfinder config
|
||||
}
|
||||
|
||||
|
||||
function show_dir_structure_rek( $site, $language, $parent_id, $level, $input_counter, $resources, $iterator = NULL ) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
|
||||
if ($parent_id == 0) {
|
||||
echo "<ol class=\"linklist sortable\">\n";
|
||||
} else {
|
||||
echo "<ol>\n";
|
||||
}
|
||||
|
||||
$counter = 1;
|
||||
|
||||
foreach ($resources as $res) {
|
||||
$level = -1;
|
||||
$olCreated = array();
|
||||
|
||||
$folderInfo = new SplFileInfo(CMS_PATH . '../' . $res['directory']);
|
||||
echo "<li id=\"list_{$counter}\">";
|
||||
echo "<div data-function=\"open_ckfinder\" data-startresource=\"" . $res['name'] . "\" data-startfolder=\"\" data-inputid=\"" . $counter . "\" data-action=\"edit_navigation\" data-inputname=\"input_main_navigation_id\" data-checked=\"false\" class=\"linklist_content dd-handle\"><span class=\"disclose\"><span> </span></span>" . $res['name'] . "</div>\n";
|
||||
echo "<div class=\"dd-count-files\">" . count_files_in_folder(CMS_PATH . '../' . $res['directory']) . "</div>";
|
||||
echo "<div class=\"dd-gaendert-am-files\">" . date('d.m.Y H:i', $folderInfo->getMTime()) . "</div>";
|
||||
|
||||
$Directory = new RecursiveDirectoryIterator(CMS_PATH . '../' . $res['directory']);
|
||||
$Iterator = new RecursiveIteratorIterator($Directory, RecursiveIteratorIterator::SELF_FIRST);
|
||||
|
||||
$Iterator->rewind();
|
||||
|
||||
$openedOLs = 0;
|
||||
$lastDepth = 0;
|
||||
while ($Iterator->valid()) {
|
||||
$counter++;
|
||||
|
||||
if (!$Iterator->isDir() || $Iterator->isDot()) {
|
||||
$Iterator->next();
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($Iterator->getDepth() > $level) {
|
||||
$openedOLs++;
|
||||
echo "<ol>\n";
|
||||
$level = $Iterator->getDepth();
|
||||
} elseif ($Iterator->getDepth() < $level) {
|
||||
$repeat = $level - $Iterator->getDepth();
|
||||
echo str_repeat("</li></ol>\n", $repeat);
|
||||
echo "</li>\n";
|
||||
|
||||
$openedOLs = $openedOLs - $repeat;
|
||||
$level = $Iterator->getDepth();
|
||||
} elseif ($Iterator->getDepth() == $level) {
|
||||
echo "</li>\n";
|
||||
}
|
||||
|
||||
$folderInfo = new SplFileInfo($Iterator->getPathname());
|
||||
echo "<li id=\"list_" . $counter . "\">\n";
|
||||
echo "<div data-function=\"open_ckfinder\" data-startresource=\"" . $res['name'] . "\" data-startfolder=\"" . $Iterator->getSubPathname() . "\" data-inputid=\"" . $counter . "\" data-action=\"edit_navigation\" data-inputname=\"input_main_navigation_id\" data-checked=\"false\" class=\"linklist_content dd-handle\"><span class=\"disclose\"><span> </span></span>" . $Iterator->getFilename() . "</div>\n";
|
||||
echo "<div class=\"dd-count-files\">" . count_files_in_folder($Iterator->getPathname()) . "</div>";
|
||||
echo "<div class=\"dd-gaendert-am-files\">" . date('d.m.Y H:i', $folderInfo->getMTime()) . "</div>";
|
||||
|
||||
$lastDepth = $Iterator->getDepth();
|
||||
$Iterator->next();
|
||||
}
|
||||
if ($openedOLs > 0) {
|
||||
echo str_repeat("</li></ol>\n", $openedOLs);
|
||||
echo "</li>\n";
|
||||
} else {
|
||||
echo "</li>\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</ol>\n\n";
|
||||
}
|
||||
|
||||
function count_files_in_folder( $_folder ) {
|
||||
$dir = new DirectoryIterator($_folder);
|
||||
$x = 0;
|
||||
foreach ($dir as $file) {
|
||||
$x += ($file->isFile()) ? 1 : 0;
|
||||
}
|
||||
return $x;
|
||||
}
|
||||
123
mysyde/admin/edit_files_listform.inc.php
Normal file
123
mysyde/admin/edit_files_listform.inc.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_edit_main_navigation_list";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "new_ckfinder()"); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "open_ckfinder()"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_files'); ?></h1>
|
||||
|
||||
<form id="<?php echo $formname; ?>" name="<?php echo $formname; ?>" method="post">
|
||||
<div class="requestLoader"></div>
|
||||
<input type="hidden" class="selected_linklist_row" name="input_main_navigation_id" value="" />
|
||||
|
||||
<div class="dd" id="nestable">
|
||||
<?
|
||||
|
||||
show_dir_structure($site, $language);
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function new_ckfinder() {
|
||||
var finder = new CKFinder();
|
||||
finder.basePath = '/ckfinder/';
|
||||
finder.rememberLastFolder = false;
|
||||
finder.popup();
|
||||
}
|
||||
|
||||
function open_ckfinder( row ) {
|
||||
var row = row || false;
|
||||
|
||||
if (row !== false) {
|
||||
var currentMarkedLinklistRow = $(row);
|
||||
} else {
|
||||
var currentMarkedLinklistRow = jQuery('.linklist_active', jQuery('#' + dc.current_formname));
|
||||
}
|
||||
|
||||
|
||||
if (currentMarkedLinklistRow.length <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var startResource = currentMarkedLinklistRow.data('startresource');
|
||||
var startFolder = currentMarkedLinklistRow.data('startfolder');
|
||||
if (startFolder != "") {
|
||||
var startupPath = startResource + ':/' + startFolder + '/';
|
||||
} else {
|
||||
var startupPath = startResource + ':/';
|
||||
}
|
||||
|
||||
var finder = new CKFinder();
|
||||
finder.basePath = '/ckfinder/';
|
||||
finder.startupPath = startupPath;
|
||||
finder.startupFolderExpanded = true;
|
||||
finder.rememberLastFolder = false;
|
||||
|
||||
finder.popup();
|
||||
}
|
||||
|
||||
var reorderCall = null;
|
||||
var dragEnabled = false;
|
||||
|
||||
function toggleDragDrop( _aTag ) {
|
||||
if (dragEnabled === false) {
|
||||
dragEnabled = true;
|
||||
$('ol.sortable').addClass("enabled");
|
||||
$('ol.sortable').nestedSortable("option", "disabled", false);
|
||||
$(_aTag).html("<?php echo $translation->get('disable_drag_drop'); ?>");
|
||||
} else {
|
||||
dragEnabled = false;
|
||||
$('ol.sortable').removeClass("enabled");
|
||||
$('ol.sortable').nestedSortable("option", "disabled", true);
|
||||
$(_aTag).html("<?php echo $translation->get('enable_drag_drop'); ?>");
|
||||
}
|
||||
}
|
||||
|
||||
//$('.dd').nestable({ /* config options */ });
|
||||
$('ol.sortable').nestedSortable({
|
||||
forcePlaceholderSize: true,
|
||||
handle : '.dd-icon',
|
||||
helper : 'clone',
|
||||
items : 'li',
|
||||
opacity : .6,
|
||||
placeholder : 'placeholder',
|
||||
revert : 250,
|
||||
tabSize : 25,
|
||||
tolerance : 'pointer',
|
||||
toleranceElement : '> div',
|
||||
maxLevels : 5,
|
||||
isTree : true,
|
||||
expandOnHover : 1000,
|
||||
cookieIndex : 'nestedSortable_files_expanded',
|
||||
startCollapsed : true,
|
||||
stop : function ( event, ui ) {
|
||||
reorder_navigation();
|
||||
store_expanded();
|
||||
},
|
||||
disabled : true
|
||||
});
|
||||
|
||||
$('.disclose').click(function () {
|
||||
$(this).closest('li').toggleClass('mjs-nestedSortable-collapsed').toggleClass('mjs-nestedSortable-expanded');
|
||||
store_expanded();
|
||||
});
|
||||
|
||||
function store_expanded() {
|
||||
var list = [];
|
||||
$('ol.sortable').find('li.mjs-nestedSortable-expanded').each(function () {
|
||||
list.push($(this).attr("id"));
|
||||
});
|
||||
$.cookie('nestedSortable_files_expanded', list.join(','));
|
||||
}
|
||||
</script>
|
||||
2
mysyde/admin/edit_frontend_user.inc.php
Normal file
2
mysyde/admin/edit_frontend_user.inc.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<div class="infobox">Bereich nicht lizensiert
|
||||
</div>
|
||||
257
mysyde/admin/edit_language.inc.php
Normal file
257
mysyde/admin/edit_language.inc.php
Normal file
@@ -0,0 +1,257 @@
|
||||
<?
|
||||
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
switch ($_REQUEST["action"]) {
|
||||
case 'edit':
|
||||
edit_language();
|
||||
break;
|
||||
case 'delete':
|
||||
delete_language();
|
||||
break;
|
||||
case 'new':
|
||||
require_once("edit_language_cardform.inc.php");
|
||||
break;
|
||||
case 'save':
|
||||
save_language();
|
||||
break;
|
||||
case 'copy':
|
||||
copy_language();
|
||||
break;
|
||||
default:
|
||||
require_once("edit_language_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function copy_language() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
require_once("edit_language_functions.php");
|
||||
|
||||
$step = (isset($_REQUEST['next_step']) ? $_REQUEST['next_step'] : "");
|
||||
$copyError = array();
|
||||
|
||||
if($step == "copy_language") {
|
||||
// erster Schritt Tabelle leeren
|
||||
$query = "DELETE FROM copy_link WHERE session_id = '" . mysqli_real_escape_string($GLOBALS['mysql_con'],session_id()) . "'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
switch($step) {
|
||||
case 'copy_language';
|
||||
case 'copy_siteparts';
|
||||
case 'copy_collection_setup';
|
||||
case 'copy_collection';
|
||||
case 'copy_component';
|
||||
case 'copy_main_page';
|
||||
case 'copy_main_navigation';
|
||||
$LanguageFunctions = new LanguageFunctions($_REQUEST["input_id"]);
|
||||
if(!$LanguageFunctions->$step()) {
|
||||
$copyError = $LanguageFunctions->errorMessages;
|
||||
break;
|
||||
}
|
||||
|
||||
$nextStep = $LanguageFunctions->nextStep;
|
||||
if($nextStep == "") {
|
||||
break; // switch abbrechen und damit kopiervorgang beenden.
|
||||
}
|
||||
|
||||
echo json_encode(array("next_step" => $nextStep, "message" => $LanguageFunctions->message));
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if(count($copyError)) {
|
||||
$errorDivs = array();
|
||||
foreach($copyError as $error) {
|
||||
$errorDivs[] = "<div class=\"errorbox\">" . $error . "</div>\n";
|
||||
}
|
||||
echo json_encode(array("next_step" => "", "message" => $errorDivs, "error" => 1));
|
||||
} else {
|
||||
echo json_encode(array("next_step" => "", "message" => array('<div class="successbox">' . $translation->get("copy_language_success") . '</div>'), "error" => 0));
|
||||
}
|
||||
}
|
||||
|
||||
function edit_language( $_id = "", $messages = array() ) {
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
|
||||
$pdoHost = getenv('MAIN_MYSQL_DB_HOST');
|
||||
$pdoPort = getenv('MAIN_MYSQL_DB_PORT');
|
||||
$pdoUser = getenv('MAIN_MYSQL_DB_USER');
|
||||
$pdoPass = getenv('MAIN_MYSQL_DB_PASS');
|
||||
$pdoSchema = getenv('MAIN_MYSQL_DB_SCHEMA');
|
||||
|
||||
$pdo = new \DynCom\mysyde\common\classes\PDOQueryWrapper($pdoHost, $pdoPort, $pdoSchema, $pdoUser, $pdoPass);
|
||||
|
||||
$prepStatement = " SELECT *,
|
||||
(SELECT COUNT(id) FROM main_navigation WHERE
|
||||
main_language_id = main_language.id) AS 'no_of_navigation'
|
||||
FROM main_language WHERE id = :id LIMIT 1
|
||||
";
|
||||
$params = [
|
||||
[':id',$input_id, PDO::PARAM_STR],
|
||||
];
|
||||
$pdo->setQuery($prepStatement);
|
||||
$pdo->prepareQuery();
|
||||
$pdo->bindParameters($params);
|
||||
$pdo->executePreparedStatement();
|
||||
$result = $pdo->getResultArray();
|
||||
|
||||
if (count($result) == 1) {
|
||||
$input_language = $result[0];
|
||||
require_once("edit_language_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
$input_language = array();
|
||||
require_once("edit_language_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_language() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$messages = array();
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM main_language WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if($GLOBALS["language"]['id'] == $_REQUEST["input_id"]) {
|
||||
$messages[] = '<div class="infobox">' . $translation->get("language_msg_info1") . '<br><a href="/mysyde/?action=admin_logout">' . $translation->get("website_msg_tologin") . '</a></div>';
|
||||
if(IS_AJAX) {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_language = array();
|
||||
require_once("edit_language_cardform.inc.php");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
require_once("edit_language_listform.inc.php");
|
||||
}
|
||||
|
||||
function save_language() {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_id = "";
|
||||
$active = 0;
|
||||
if($_REQUEST["input_active"] == "on")
|
||||
{
|
||||
$active = 1;
|
||||
}
|
||||
|
||||
$catalogLogin = 0;
|
||||
if($_REQUEST["input_catalog_login"] == "on")
|
||||
{
|
||||
$catalogLogin = 1;
|
||||
}
|
||||
|
||||
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "UPDATE main_language
|
||||
SET
|
||||
company = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_company"]) . "',
|
||||
shop_code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_shopcode"]) . "',
|
||||
shop_language_code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_language_code"]) . "',
|
||||
code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"]) . "',
|
||||
locale_code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'],$_REQUEST['input_locale_code']) . "',
|
||||
name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "',
|
||||
site_name = '',
|
||||
std_main_navigation_id = '" . $_REQUEST["input_std_main_navigation_id"] . "',
|
||||
site_title_name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_site_title_name"]) . "',
|
||||
meta_description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_meta_description"]) . "',
|
||||
meta_keywords = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_meta_keywords"]) . "',
|
||||
main_layout_id = '" . $_REQUEST["input_main_layout_id"] . "',
|
||||
logout_site_id = '" . $_REQUEST["input_login_site"] . "',
|
||||
logout_language_id = '" . $_REQUEST["input_login_language"] . "',
|
||||
logout_navigation_id = '" . $_REQUEST["input_login_navigation"] . "',
|
||||
related_language_codes = '" . $_REQUEST["input_related_language_codes"] . "',
|
||||
active = " . $active . "
|
||||
WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
} else {
|
||||
$query = "INSERT INTO main_language (id, main_site_id, code,locale_code,name,site_name,std_main_navigation_id,site_title_name,meta_description,meta_keywords,main_layout_id,company,shop_code,shop_language_code,logout_site_id,logout_language_id,logout_navigation_id,related_language_codes, active)
|
||||
VALUES (
|
||||
NULL,
|
||||
'" . $GLOBALS["site"]["id"] . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_locale_code"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "',
|
||||
'',
|
||||
'" . $_REQUEST["input_std_main_navigation_id"] . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_site_title_name"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_meta_description"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_meta_keywords"]) . "',
|
||||
'" . $_REQUEST["input_main_layout_id"] . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_company"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_shopcode"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_language_code"]) . "',
|
||||
'" . $_REQUEST["input_login_site"] . "',
|
||||
'" . $_REQUEST["input_login_language"] . "',
|
||||
'" . $_REQUEST["input_login_navigation"] . "',
|
||||
'" . $_REQUEST["input_related_language_codes"] . "',
|
||||
" . $active . "
|
||||
)";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["input_code"] == '') | ($_REQUEST["input_name"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_description") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
if ($_REQUEST["input_code"] <> urlencode($_REQUEST["input_code"])) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_encoding") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_language WHERE code = '" . $_REQUEST["input_code"] . "' AND main_site_id = '" . $GLOBALS["site"]["id"] . "'");
|
||||
if ((@mysqli_num_rows($result) <> 0) && ($_REQUEST["input_id"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_exists") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("language_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("language_msg_success2") . '</div>';
|
||||
if($GLOBALS["language"]["code"] == $_REQUEST["input_code"]) {
|
||||
header('EDIT_ERROR: 1'); // schliessen des overlays verhindern
|
||||
$messages[] = '<div class="infobox">' . $translation->get("language_msg_info1") . '<br><a href="/mysyde/?action=admin_logout">' . $translation->get("website_msg_tologin") . '</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
edit_language($input_id, $messages);
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_language["logout_site"] = $_REQUEST["input_login_site"];
|
||||
$input_language["logout_language"] = $_REQUEST["input_login_language"];
|
||||
$input_language["logout_navigation"] = $_REQUEST["input_login_navigation"];
|
||||
$input_language["company"] = $_REQUEST["input_company"];
|
||||
$input_language["shop_code"] = $_REQUEST["input_shopcode"];
|
||||
$input_language["shop_language_code"] = $_REQUEST["input_language_code"];
|
||||
$input_language["id"] = $_REQUEST["input_id"];
|
||||
$input_language["code"] = $_REQUEST["input_code"];
|
||||
$input_language["locale_code"] = $_REQUEST["input_locale_code"];
|
||||
$input_language["name"] = $_REQUEST["input_name"];
|
||||
$input_language["std_std_main_navigation_id"] = $_REQUEST["input_std_main_navigation_id"];
|
||||
$input_language["site_title_name"] = $_REQUEST["input_site_title_name"];
|
||||
$input_language["meta_description"] = $_REQUEST["input_meta_description"];
|
||||
$input_language["meta_keywords"] = $_REQUEST["input_meta_keywords"];
|
||||
$input_language["main_navigation_id"] = $_REQUEST["input_main_layout_id"];
|
||||
$input_language["no_of_navigation"] = @mysqli_num_rows(@mysqli_query($GLOBALS['mysql_con'], "SELECT id FROM main_navigation WHERE main_language_id = '" . $_REQUEST["input_id"]."'"));
|
||||
$input_language["related_language_codes"] = $_REQUEST["input_related_language_codes"];
|
||||
$input_language["catalog_login"] = $_REQUEST["input_catalog_login"];
|
||||
$input_language["active"] = $_REQUEST["input_active"];
|
||||
require_once("edit_language_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
40
mysyde/admin/edit_language_ajax.php
Normal file
40
mysyde/admin/edit_language_ajax.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
require_once("../common/common_functions.inc.php");
|
||||
require_once((local_environment()) ? "../dc.config.php" : "../dc-server.config.php");
|
||||
/*
|
||||
$GLOBALS['mysql_con'] = mysqli_connect($GLOBALS["myservername"],$GLOBALS["mylogin"],$GLOBALS["mypass"]) or die ("Keine Verbindung hergestellt!");
|
||||
mysqli_select_db($GLOBALS['mysql_con'],dc) or die ("Keine Verbindung hergestellt!");
|
||||
@mysqli_query($GLOBALS['mysql_con'],'set character set utf8;');
|
||||
*/
|
||||
db_connect();
|
||||
$company = $_POST["company"];
|
||||
$shop = $_POST["shop"];
|
||||
|
||||
function get_shops( $company ) {
|
||||
$query = "SELECT code, description FROM shop_shop WHERE company = '" . $company . "'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$shops = "<option value=\"\"></option>";
|
||||
WHILE ($row = @mysqli_fetch_assoc($result)) {
|
||||
$shops .= "<option value=\"" . $row["code"] . "\">" . $row["description"] . "</option>";
|
||||
}
|
||||
return $shops;
|
||||
}
|
||||
|
||||
function get_languages( $shop ) {
|
||||
$query = "SELECT code, description FROM shop_language WHERE shop_code = '" . $shop . "'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$languages = "<option value=\"\"></option>";
|
||||
WHILE ($row = @mysqli_fetch_assoc($result)) {
|
||||
$languages .= "<option value=\"" . $row["code"] . "\">" . $row["description"] . "</option>";
|
||||
}
|
||||
return $languages;
|
||||
}
|
||||
|
||||
IF (isset($company)) {
|
||||
$shops = get_shops($company);
|
||||
echo $shops;
|
||||
} ELSEIF (isset($shop)) {
|
||||
$langs = get_languages($shop);
|
||||
echo $langs;
|
||||
}
|
||||
?>
|
||||
563
mysyde/admin/edit_language_cardform.inc.php
Normal file
563
mysyde/admin/edit_language_cardform.inc.php
Normal file
@@ -0,0 +1,563 @@
|
||||
<?
|
||||
$formname = "form_language_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
static $locales = [
|
||||
'af-ZA',
|
||||
'am-ET',
|
||||
'ar-AE',
|
||||
'ar-BH',
|
||||
'ar-DZ',
|
||||
'ar-EG',
|
||||
'ar-IQ',
|
||||
'ar-JO',
|
||||
'ar-KW',
|
||||
'ar-LB',
|
||||
'ar-LY',
|
||||
'ar-MA',
|
||||
'arn-CL',
|
||||
'ar-OM',
|
||||
'ar-QA',
|
||||
'ar-SA',
|
||||
'ar-SY',
|
||||
'ar-TN',
|
||||
'ar-YE',
|
||||
'as-IN',
|
||||
'az-Cyrl-AZ',
|
||||
'az-Latn-AZ',
|
||||
'ba-RU',
|
||||
'be-BY',
|
||||
'bg-BG',
|
||||
'bn-BD',
|
||||
'bn-IN',
|
||||
'bo-CN',
|
||||
'br-FR',
|
||||
'bs-Cyrl-BA',
|
||||
'bs-Latn-BA',
|
||||
'ca-ES',
|
||||
'co-FR',
|
||||
'cs-CZ',
|
||||
'cy-GB',
|
||||
'da-DK',
|
||||
'de-AT',
|
||||
'de-CH',
|
||||
'de-DE',
|
||||
'de-LI',
|
||||
'de-LU',
|
||||
'dsb-DE',
|
||||
'dv-MV',
|
||||
'el-GR',
|
||||
'en-029',
|
||||
'en-AU',
|
||||
'en-BZ',
|
||||
'en-CA',
|
||||
'en-GB',
|
||||
'en-IE',
|
||||
'en-IN',
|
||||
'en-JM',
|
||||
'en-MY',
|
||||
'en-NZ',
|
||||
'en-PH',
|
||||
'en-SG',
|
||||
'en-TT',
|
||||
'en-US',
|
||||
'en-ZA',
|
||||
'en-ZW',
|
||||
'es-AR',
|
||||
'es-BO',
|
||||
'es-CL',
|
||||
'es-CO',
|
||||
'es-CR',
|
||||
'es-DO',
|
||||
'es-EC',
|
||||
'es-ES',
|
||||
'es-GT',
|
||||
'es-HN',
|
||||
'es-MX',
|
||||
'es-NI',
|
||||
'es-PA',
|
||||
'es-PE',
|
||||
'es-PR',
|
||||
'es-PY',
|
||||
'es-SV',
|
||||
'es-US',
|
||||
'es-UY',
|
||||
'es-VE',
|
||||
'et-EE',
|
||||
'eu-ES',
|
||||
'fa-IR',
|
||||
'fi-FI',
|
||||
'fil-PH',
|
||||
'fo-FO',
|
||||
'fr-BE',
|
||||
'fr-CA',
|
||||
'fr-CH',
|
||||
'fr-FR',
|
||||
'fr-LU',
|
||||
'fr-MC',
|
||||
'fy-NL',
|
||||
'ga-IE',
|
||||
'gd-GB',
|
||||
'gl-ES',
|
||||
'gsw-FR',
|
||||
'gu-IN',
|
||||
'ha-Latn-NG',
|
||||
'he-IL',
|
||||
'hi-IN',
|
||||
'hr-BA',
|
||||
'hr-HR',
|
||||
'hsb-DE',
|
||||
'hu-HU',
|
||||
'hy-AM',
|
||||
'id-ID',
|
||||
'ig-NG',
|
||||
'ii-CN',
|
||||
'is-IS',
|
||||
'it-CH',
|
||||
'it-IT',
|
||||
'iu-Cans-CA',
|
||||
'iu-Latn-CA',
|
||||
'ja-JP',
|
||||
'ka-GE',
|
||||
'kk-KZ',
|
||||
'kl-GL',
|
||||
'km-KH',
|
||||
'kn-IN',
|
||||
'kok-IN',
|
||||
'ko-KR',
|
||||
'ky-KG',
|
||||
'lb-LU',
|
||||
'lo-LA',
|
||||
'lt-LT',
|
||||
'lv-LV',
|
||||
'mi-NZ',
|
||||
'mk-MK',
|
||||
'ml-IN',
|
||||
'mn-MN',
|
||||
'mn-Mong-CN',
|
||||
'moh-CA',
|
||||
'mr-IN',
|
||||
'ms-BN',
|
||||
'ms-MY',
|
||||
'mt-MT',
|
||||
'nb-NO',
|
||||
'ne-NP',
|
||||
'nl-BE',
|
||||
'nl-NL',
|
||||
'nn-NO',
|
||||
'nso-ZA',
|
||||
'oc-FR',
|
||||
'or-IN',
|
||||
'pa-IN',
|
||||
'pl-PL',
|
||||
'prs-AF',
|
||||
'ps-AF',
|
||||
'pt-BR',
|
||||
'pt-PT',
|
||||
'qut-GT',
|
||||
'quz-BO',
|
||||
'quz-EC',
|
||||
'quz-PE',
|
||||
'rm-CH',
|
||||
'ro-RO',
|
||||
'ru-RU',
|
||||
'rw-RW',
|
||||
'sah-RU',
|
||||
'sa-IN',
|
||||
'se-FI',
|
||||
'se-NO',
|
||||
'se-SE',
|
||||
'si-LK',
|
||||
'sk-SK',
|
||||
'sl-SI',
|
||||
'sma-NO',
|
||||
'sma-SE',
|
||||
'smj-NO',
|
||||
'smj-SE',
|
||||
'smn-FI',
|
||||
'sms-FI',
|
||||
'sq-AL',
|
||||
'sr-Cyrl-BA',
|
||||
'sr-Cyrl-CS',
|
||||
'sr-Cyrl-ME',
|
||||
'sr-Cyrl-RS',
|
||||
'sr-Latn-BA',
|
||||
'sr-Latn-CS',
|
||||
'sr-Latn-ME',
|
||||
'sr-Latn-RS',
|
||||
'sv-FI',
|
||||
'sv-SE',
|
||||
'sw-KE',
|
||||
'syr-SY',
|
||||
'ta-IN',
|
||||
'te-IN',
|
||||
'tg-Cyrl-TJ',
|
||||
'th-TH',
|
||||
'tk-TM',
|
||||
'tn-ZA',
|
||||
'tr-TR',
|
||||
'tt-RU',
|
||||
'tzm-Latn-DZ',
|
||||
'ug-CN',
|
||||
'uk-UA',
|
||||
'ur-PK',
|
||||
'uz-Cyrl-UZ',
|
||||
'uz-Latn-UZ',
|
||||
'vi-VN',
|
||||
'wo-SN',
|
||||
'xh-ZA',
|
||||
'yo-NG',
|
||||
'zh-CN',
|
||||
'zh-HK',
|
||||
'zh-MO',
|
||||
'zh-SG',
|
||||
'zh-TW',
|
||||
'zu-ZA',
|
||||
];
|
||||
|
||||
//Vorauswahl für Logout-Verweis füllen
|
||||
$query = "SELECT id, code, name FROM main_site ORDER BY id ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$sites = array();
|
||||
$i = 0;
|
||||
WHILE ($row = @mysqli_fetch_array($result)) {
|
||||
$sites[$i]["id"] = $row["id"];
|
||||
$sites[$i]["code"] = $row["code"];
|
||||
$sites[$i]["name"] = $row["name"];
|
||||
$i++;
|
||||
}
|
||||
|
||||
$query = "
|
||||
SELECT
|
||||
logout_site_id AS 'logout_site',
|
||||
logout_language_id AS 'logout_language',
|
||||
logout_navigation_id AS 'logout_navigation'
|
||||
FROM
|
||||
main_language
|
||||
WHERE
|
||||
id = '" . $GLOBALS["language"]["id"] . "'
|
||||
";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$preselect = @mysqli_fetch_assoc($result);
|
||||
extract($preselect);
|
||||
|
||||
IF (isset($logout_site)) {
|
||||
$site_preselect = site_getbycode($logout_site);
|
||||
$sitecode = $site_preselect["code"];
|
||||
}
|
||||
|
||||
IF (isset($logout_site)) {
|
||||
$query_1 = "
|
||||
SELECT
|
||||
ml.id AS 'id',
|
||||
ml.name AS 'name',
|
||||
ms.id AS 'ms_id'
|
||||
FROM
|
||||
main_language ml,
|
||||
main_site ms
|
||||
WHERE
|
||||
ms.id = '" . $logout_site . "'
|
||||
AND
|
||||
ml.main_site_id = ms.id
|
||||
";
|
||||
$result_1 = @mysqli_query($GLOBALS['mysql_con'], $query_1);
|
||||
$logout_langs = "<option value=\"\">" . $translation->get("please_choose") . "</option>";
|
||||
WHILE ($row = mysqli_fetch_assoc($result_1)) {
|
||||
IF (isset($logout_site) && $row["id"] == $logout_language) {
|
||||
$logout_langs .= "<option value=\"" . $row["id"] . "\" selected=\"selected\">" . $row["name"] . "</option>";
|
||||
} ELSE {
|
||||
$logout_langs .= "<option value=\"" . $row["id"] . "\">" . $row["name"] . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IF (isset($logout_language)) {
|
||||
$logout_navs = navigation_select_noecho($logout_navigation, $logout_site, $logout_language);
|
||||
}
|
||||
|
||||
//Vorauswahl für Mandant-Shop-Sprache füllen
|
||||
// $query = "SELECT id, company FROM shop_setup";
|
||||
// $result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
// $companies = array();
|
||||
// WHILE ($row = @mysqli_fetch_array($result)) {
|
||||
// $companies[]["company"] = $row["company"];
|
||||
// }
|
||||
// $company_pre = $input_language["company"];
|
||||
// $shop_pre = $input_language["shop_code"];
|
||||
// $lang_pre = $input_language["shop_language_code"];
|
||||
|
||||
// IF (!empty($company_pre)) {
|
||||
// $query_1 = "SELECT code, description FROM shop_shop WHERE company = '" . $company_pre . "'";
|
||||
// $result_1 = @mysqli_query($GLOBALS['mysql_con'], $query_1);
|
||||
// $shops = "<option value=\"\">" . $translation->get("please_choose") . "</option>";
|
||||
// WHILE ($row = @mysqli_fetch_assoc($result_1)) {
|
||||
// IF (isset($shop_pre) && $row["code"] == $shop_pre) {
|
||||
// $shops .= "<option value=\"" . $row["code"] . "\" selected=\"selected\">" . $row["description"] . "</option>";
|
||||
// } ELSE {
|
||||
// $shops .= "<option value=\"" . $row["code"] . "\">" . $row["description"] . "</option>";
|
||||
// }
|
||||
// }
|
||||
// IF (!empty($shop_pre)) {
|
||||
// $query_2 = "SELECT code, description FROM shop_language WHERE shop_code = '" . $shop_pre . "'";
|
||||
// $result_2 = @mysqli_query($GLOBALS['mysql_con'], $query_2);
|
||||
// $langs = "<option value=\"\">" . $translation->get("please_choose") . "</option>";
|
||||
// WHILE ($row = @mysqli_fetch_assoc($result_2)) {
|
||||
// IF (isset($lang_pre) && $row["code"] == $lang_pre) {
|
||||
// $langs .= "<option value=\"" . $row["code"] . "\" selected=\"selected\">" . $row["description"] . "</option>";
|
||||
// } ELSE {
|
||||
// $langs .= "<option value=\"" . $row["code"] . "\">" . $row["description"] . "</option>";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_language["id"] == "") {
|
||||
echo $translation->get("new_language");
|
||||
} else {
|
||||
echo $translation->get("edit_language");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save', true, '', true)"); ?>
|
||||
<?php
|
||||
if ($input_language["id"] != "") {
|
||||
echo button("copy", $translation->get("copy_language"), $formname, "copy_language()");
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
if ($input_language["id"] != "") {
|
||||
echo button(
|
||||
"delete",
|
||||
$translation->get("delete"),
|
||||
$formname,
|
||||
"loadCard('delete', true, '{$translation->get('delete_language_confirm')}', true)",
|
||||
"",
|
||||
false
|
||||
);
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit", "", false); ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
} else {
|
||||
echo '<div id="overlayMessages"></div>';
|
||||
$active = false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_language["id"] ?>">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("textkey"), "input_code", "code", $input_language["code"], 20) ?>
|
||||
<? input_select($translation->get('Locale-Code'),'input_locale_code',$locales,$locales,$input_language['locale_code'])?>
|
||||
<? input($translation->get("description"), "input_name", "text", $input_language["name"], 45) ?><br/>
|
||||
<? navigation_select(
|
||||
$translation->get("startpage"),
|
||||
"input_std_main_navigation_id",
|
||||
$input_language["std_main_navigation_id"],
|
||||
$input_language["main_site_id"],
|
||||
$input_language["id"],
|
||||
false
|
||||
); ?>
|
||||
<? layout_select(
|
||||
$translation->get("layout"),
|
||||
"input_main_layout_id",
|
||||
$input_language["main_layout_id"],
|
||||
false
|
||||
) ?>
|
||||
<br/>
|
||||
<? input(
|
||||
$translation->get("browsertitle"),
|
||||
"input_site_title_name",
|
||||
"text",
|
||||
$input_language["site_title_name"],
|
||||
45
|
||||
) ?>
|
||||
<br/>
|
||||
<? input(
|
||||
$translation->get("meta_description"),
|
||||
"input_meta_description",
|
||||
"textarea",
|
||||
$input_language["meta_description"]
|
||||
) ?>
|
||||
<? input(
|
||||
$translation->get("meta_keywords"),
|
||||
"input_meta_keywords",
|
||||
"textarea",
|
||||
$input_language["meta_keywords"]
|
||||
) ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input(
|
||||
$translation->get("number_menu_items"),
|
||||
"input_no_of_navigation",
|
||||
"decimal",
|
||||
$input_language["no_of_navigation"],
|
||||
45,
|
||||
true
|
||||
) ?>
|
||||
<br/>
|
||||
|
||||
<div class="label"><label for="input_login_site"><?php echo $translation->get("logout_page"); ?></label>
|
||||
</div>
|
||||
<div class="input"><select class="bigselect" name="input_login_site" id="site_id"
|
||||
onChange="LoginAJAXreq1();">
|
||||
<option value=""> <?php echo $translation->get("please_choose"); ?> </option>
|
||||
<? FOR ($i = 0; $i < count($sites); $i++) {
|
||||
IF (isset($logout_site) && $sites[$i]["id"] == $logout_site) {
|
||||
echo "<option value=\"" . $sites[$i]["id"] . "\" selected=\"selected\">" . $sites[$i]["name"] . "</options>";
|
||||
} ELSE {
|
||||
echo "<option value=\"" . $sites[$i]["id"] . "\">" . $sites[$i]["name"] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select></div>
|
||||
<div class="label"><label
|
||||
for="input_login_language"><?php echo $translation->get("logout_language"); ?></label></div>
|
||||
<div class="input"><select name="input_login_language" class="bigselect" id="main_language_id"
|
||||
onChange="LoginAJAXreq2();">
|
||||
<?= $logout_langs ?>
|
||||
</select></div>
|
||||
<div class="label"><label
|
||||
for="input_login_navigation"><?php echo $translation->get("logout_navigation"); ?></label>
|
||||
</div>
|
||||
<div class="input"><select class="bigselect" name="input_login_navigation" id="main_navigation_id">
|
||||
<?= $logout_navs ?>
|
||||
</select></div>
|
||||
<br/>
|
||||
|
||||
<div class="label"><label for="input_company"><?php echo $translation->get("shop_mandant"); ?></label>
|
||||
</div>
|
||||
<div class="input"><select class="bigselect" name="input_company" id="company"
|
||||
onChange="LangAJAXreq1();">
|
||||
<option value=""><?php echo $translation->get("please_choose"); ?></option>
|
||||
<? FOR ($i = 0; $i < count($companies); $i++) {
|
||||
IF (isset($company_pre) && $companies[$i]["company"] == $company_pre) {
|
||||
echo "<option value=\"" . $companies[$i]["company"] . "\" selected=\"selected\">" . $companies[$i]["company"] . "</options>";
|
||||
} ELSE {
|
||||
echo "<option value=\"" . $companies[$i]["company"] . "\">" . $companies[$i]["company"] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select></div>
|
||||
<div class="label"><label for="input_shopcode"><?php echo $translation->get("shop_code"); ?></label>
|
||||
</div>
|
||||
<div class="input"><select name="input_shopcode" class="bigselect" id="shopcode"
|
||||
onChange="LangAJAXreq2();">
|
||||
<? IF (isset($company_pre)) {
|
||||
echo $shops;
|
||||
} ?>
|
||||
</select></div>
|
||||
<div class="label"><label
|
||||
for="input_language_code"><?php echo $translation->get("shop_language"); ?></label></div>
|
||||
<div class="input"><select class="bigselect" name="input_language_code" id="language_code">
|
||||
<? IF (isset($company_pre)) {
|
||||
echo $langs;
|
||||
} ?>
|
||||
</select></div>
|
||||
<? input(
|
||||
$translation->get("related_language_codes"),
|
||||
"input_related_language_codes",
|
||||
"textarea",
|
||||
$input_language["related_language_codes"]
|
||||
) ?>
|
||||
<? /*input(
|
||||
$translation->get("catalog_login"),
|
||||
"input_catalog_login",
|
||||
"checkbox",
|
||||
$input_language["catalog_login"]
|
||||
) */ ?>
|
||||
<? input($translation->get("active"), "input_active", "checkbox", $input_language["active"]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
function copy_language() {
|
||||
|
||||
if (!confirm("<?php echo $translation->get("copy_language_confirm"); ?>")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// loader wird engezeigt
|
||||
jQuery('#overlayLoader').show();
|
||||
jQuery('body').append(jQuery('<div />').attr("id", "copyOverlay"));
|
||||
|
||||
jQuery("#copyOverlay").append("<p><?php echo $translation->get("copy_start"); ?></p>");
|
||||
|
||||
copy_ajax_call("copy_language");
|
||||
}
|
||||
|
||||
function copy_ajax_call(step) {
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("next_step", step);
|
||||
$.ajax({
|
||||
url: "?action=copy",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
cache: false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success: function (output, status, xhr) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
if (output.next_step != "") {
|
||||
jQuery("#copyOverlay").append("<p>" + output.message + "</p>");
|
||||
copy_ajax_call(output.next_step);
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
$.each(output.message, function (index, value) {
|
||||
jQuery('#overlayMessages').html(value);
|
||||
});
|
||||
|
||||
jQuery('#overlayLoader').hide();
|
||||
jQuery('#overlayContent').show();
|
||||
jQuery("#copyOverlay").remove();
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
dataType: 'json'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#copyOverlay {
|
||||
position: fixed;
|
||||
background-color: #fff;
|
||||
border: 2px solid #666;
|
||||
padding: 10px;
|
||||
width: 500px;
|
||||
left: 50%;
|
||||
top: 40px;
|
||||
margin-left: -250px;
|
||||
z-index: 2004;
|
||||
min-height: 100px;
|
||||
}
|
||||
</style>
|
||||
876
mysyde/admin/edit_language_functions.php
Normal file
876
mysyde/admin/edit_language_functions.php
Normal file
@@ -0,0 +1,876 @@
|
||||
<?php
|
||||
/**
|
||||
* Extra language function class
|
||||
*
|
||||
* User: tomaszbrniak
|
||||
* Date: 02.07.16
|
||||
* Time: 15:06
|
||||
*/
|
||||
|
||||
require_once(MODULE_PATH . "gallery/gallery.config.inc.php");
|
||||
require_once(MODULE_PATH . "filegallery/filegallery.config.inc.php");
|
||||
require_once(MODULE_PATH . "collection/collection_config.inc.php");
|
||||
|
||||
class LanguageFunctions {
|
||||
|
||||
/**
|
||||
* Error messages
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $errorMessages = array();
|
||||
|
||||
/**
|
||||
* Current language id to copy
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $languageId;
|
||||
|
||||
/**
|
||||
* New generated language id
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $newLanguageId;
|
||||
|
||||
/**
|
||||
* New generated site Id or null for current site id of $languageId
|
||||
*
|
||||
* @var null|int
|
||||
*/
|
||||
public $siteId = null;
|
||||
|
||||
/**
|
||||
* Text for all select statements
|
||||
*
|
||||
* @var int|string
|
||||
*/
|
||||
public $siteIdForInsert = null;
|
||||
|
||||
/**
|
||||
* Public message for user
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message = "";
|
||||
|
||||
/**
|
||||
* Next step to copy
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $nextStep = "";
|
||||
|
||||
/**
|
||||
* Array with sitepart Header Ids to copy
|
||||
*
|
||||
* @var null|array
|
||||
*/
|
||||
protected $sitePartHeaderIds = null;
|
||||
|
||||
/**
|
||||
* Array with sitepartIds to copy
|
||||
*
|
||||
* @var null|array
|
||||
*/
|
||||
protected $sitePartIds = null;
|
||||
|
||||
/**
|
||||
* Copy only specific siteparts
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $sitePartdIdsFromArrayOnly = false;
|
||||
|
||||
/**
|
||||
* Copy Page Component Include Link
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $copyPageComponentIcludeLink = true;
|
||||
|
||||
/**
|
||||
* Copy Page collection Group Link
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $copyPageCollectionGroupLink = true;
|
||||
|
||||
/**
|
||||
* Copy Page layout inclusion link
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $copyPageLayoutInclusionLink = true;
|
||||
|
||||
/**
|
||||
* LanguageFunctions constructor.
|
||||
*
|
||||
* @param int $languageId Language to copy
|
||||
* @param null $siteId new Website id or null for old id
|
||||
*/
|
||||
public function __construct($languageId, $siteId = null, $newLanguageId = null) {
|
||||
$this->languageId = $languageId;
|
||||
$this->siteId = $siteId;
|
||||
|
||||
$this->siteIdForInsert = "main_site_id";
|
||||
if($this->siteId != null) {
|
||||
$this->siteIdForInsert = $this->siteId;
|
||||
}
|
||||
|
||||
$this->newLanguageId = $newLanguageId;
|
||||
if($this->newLanguageId === null) {
|
||||
$this->newLanguageId = $this->get_new_id($languageId, 'main_language');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy language data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function copy_language() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$languageColumns = $this->get_column_names_to_copy("main_language");
|
||||
$languageColumns['main_site_id'] = $this->siteIdForInsert;
|
||||
|
||||
$query = "INSERT INTO main_language
|
||||
SELECT " . join(", ", $languageColumns) . "
|
||||
FROM main_language where id = " . $this->languageId;
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
$this->newLanguageId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
if((int)$this->newLanguageId <= 0) {
|
||||
$this->errorMessages[] = $translation->get("copy_failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
$query = "UPDATE main_language set name = CONCAT(name, ' (" . $translation->get("copy") . ")'), code = '" . $this->newLanguageId . "' WHERE id = " . $this->newLanguageId;
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
$this->insert_copy_link($this->languageId, $this->newLanguageId, "main_language");
|
||||
|
||||
$this->message = $translation->get("copy_language_main_finish");
|
||||
$this->nextStep = "copy_siteparts";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy all siteparts content
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function copy_siteparts() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
foreach($siteparts as $sitepartId => $sitepart) {
|
||||
|
||||
if($this->sitePartdIdsFromArrayOnly && !in_array($sitepartId, $this->sitePartIds)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Spalten sammeln
|
||||
$headerColumns = $this->get_column_names_to_copy($sitepart['header_table']);
|
||||
$lineColumns = array();
|
||||
if($sitepart['line_table'] != "") {
|
||||
$lineColumns = $this->get_column_names_to_copy($sitepart['line_table']);
|
||||
}
|
||||
|
||||
// header kopieren
|
||||
$query = "SELECT * FROM " . $sitepart['header_table'] . " WHERE main_language_id = " . $this->languageId;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = mysqli_fetch_array($result)) {
|
||||
if($this->sitePartdIdsFromArrayOnly && !in_array($row['id'], $this->sitePartHeaderIds)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$query = "INSERT INTO " . $sitepart['header_table'] . "
|
||||
SELECT " . join(", ", $headerColumns) . " FROM " . $sitepart['header_table'] . "
|
||||
WHERE id = " . $row['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newHeaderId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
// alle lines zur header_id kopieren
|
||||
if($sitepart['line_table'] != "") {
|
||||
$query = "SELECT * FROM " . $sitepart['line_table'] . " WHERE header_id = " . $row['id'];
|
||||
$lineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($lineRow = mysqli_fetch_array($lineResult)) {
|
||||
$finalLineColumns = $lineColumns;
|
||||
$finalLineColumns["header_id"] = $newHeaderId;
|
||||
|
||||
$query = "INSERT INTO " . $sitepart['line_table'] . "
|
||||
SELECT " . join(", ", $finalLineColumns) . " FROM " . $sitepart['line_table'] . "
|
||||
WHERE id = " . $lineRow['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newLineId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
if($sitepart['line_table'] == "gallery_line") {
|
||||
$this->copy_gallery_image($newLineId, $lineRow);
|
||||
}
|
||||
|
||||
if($sitepart['line_table'] == "filegallery_line") {
|
||||
$this->copy_filegallery_file($newLineId, $lineRow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// neue Id zwischenspeichern fuer spaetere Zuordnung
|
||||
$this->insert_copy_link($row['id'], $newHeaderId, $sitepart['header_table']);
|
||||
}
|
||||
}
|
||||
|
||||
$columns = $this->get_column_names_to_copy("main_sitepart_changes");
|
||||
$query = "SELECT * FROM main_sitepart_changes WHERE main_language_id = " . $this->languageId;
|
||||
$changesResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($lineRow = mysqli_fetch_array($changesResult)) {
|
||||
if($this->sitePartdIdsFromArrayOnly && !in_array($lineRow['main_sitepart_header_id'], $this->sitePartHeaderIds)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if($this->sitePartdIdsFromArrayOnly && !in_array($lineRow['main_sitepart_id'], $this->sitePartIds)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$finalLineColumns = $columns;
|
||||
$finalLineColumns["main_sitepart_header_id"] = $this->get_new_id($lineRow['main_sitepart_header_id'], $siteparts[$lineRow['main_sitepart_id']]['header_table']);
|
||||
|
||||
$query = "INSERT INTO main_sitepart_changes
|
||||
SELECT " . join(", ", $finalLineColumns) . " FROM main_sitepart_changes
|
||||
WHERE id = " . $lineRow['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
$this->message = $translation->get("copy_language_sitepart_finish");
|
||||
$this->nextStep = "copy_collection_setup";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to copy the image of a gallery_line row
|
||||
*
|
||||
* @param $newLineId
|
||||
* @param $lineRow
|
||||
*/
|
||||
protected function copy_gallery_image($newLineId, $lineRow) {
|
||||
$filename = $lineRow['filename'];
|
||||
$newFilename = str_replace($lineRow['id'] . "_", $newLineId . "_", $filename);
|
||||
|
||||
$previewImageString = "<img src=\'" . PATH_ICON_GALLERY . $newFilename . "?time=" . time() . "\'>";
|
||||
$query = "UPDATE gallery_line SET preview = '" . $previewImageString . "', filename = '" . $newFilename . "' where id = " . $newLineId;
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if(!file_exists(MODULE_PATH . "gallery/" . PATH_ORIGINAL_PICTURE_GALLERY . $filename)) {
|
||||
return;
|
||||
}
|
||||
|
||||
copy(MODULE_PATH . "gallery/" . PATH_ORIGINAL_PICTURE_GALLERY . $filename , MODULE_PATH . "gallery/" . PATH_ORIGINAL_PICTURE_GALLERY . $newFilename);
|
||||
copy(MODULE_PATH . "gallery/" . PATH_RESIZE_GALLERY . $filename , MODULE_PATH . "gallery/" . PATH_RESIZE_GALLERY . $newFilename);
|
||||
copy(MODULE_PATH . "gallery/" . PATH_THUMBNAIL_GALLERY . $filename , MODULE_PATH . "gallery/" . PATH_THUMBNAIL_GALLERY . $newFilename);
|
||||
copy(MODULE_PATH . "gallery/../.." . PATH_ICON_GALLERY . $filename , MODULE_PATH . "gallery/../.." . PATH_ICON_GALLERY . $newFilename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to copy the file of a filegallery_row
|
||||
*
|
||||
* @param $newLineId
|
||||
* @param $lineRow
|
||||
*/
|
||||
protected function copy_filegallery_file($newLineId, $lineRow) {
|
||||
$filename = $lineRow['filename'];
|
||||
$newFilename = str_replace($lineRow['id'] . "_", $newLineId . "_", $filename);
|
||||
|
||||
$query = "UPDATE filegallery_line SET filename = '" . $newFilename . "' where id = " . $newLineId;
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if(!file_exists(MODULE_PATH . "filegallery/" . PATH_ORIGINAL_FILEGALLERY . $filename)) {
|
||||
return;
|
||||
}
|
||||
|
||||
copy(MODULE_PATH . "filegallery/" . PATH_ORIGINAL_FILEGALLERY . $filename , MODULE_PATH . "filegallery/" . PATH_ORIGINAL_FILEGALLERY . $newFilename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to copy the file of a collection image row
|
||||
*
|
||||
* @param $newLineId
|
||||
* @param $lineRow
|
||||
*/
|
||||
protected function copy_collection_image($newLineId, $lineRow) {
|
||||
$filename = $lineRow['data'];
|
||||
$newFilename = $newLineId . "_" . $filename;
|
||||
|
||||
$query = "UPDATE main_collection_link SET data = '" . $newFilename . "' where id = " . $newLineId;
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if(!file_exists(MODULE_PATH . "collection/" . PATH_ORIGINAL_PICTURE_COLLECTION . $filename)) {
|
||||
return;
|
||||
}
|
||||
|
||||
copy(MODULE_PATH . "collection/" . PATH_ORIGINAL_PICTURE_COLLECTION . $filename , MODULE_PATH . "collection/" . PATH_ORIGINAL_PICTURE_COLLECTION . $newFilename);
|
||||
copy(MODULE_PATH . "collection/" . PATH_RESIZE_COLLECTION . $filename , MODULE_PATH . "collection/" . PATH_RESIZE_COLLECTION . $newFilename);
|
||||
copy(MODULE_PATH . "collection/../.." . PATH_ICON_COLLECTION . $filename , MODULE_PATH . "collection/../.." . PATH_ICON_COLLECTION . $newFilename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy main navigation
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function copy_main_navigation() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$navigationColumns = $this->get_column_names_to_copy("main_navigation");
|
||||
$navigationColumns["main_site_id"] = $this->siteIdForInsert;
|
||||
|
||||
$query = "SELECT * FROM main_navigation WHERE main_language_id = " . $this->languageId;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = mysqli_fetch_array($result)) {
|
||||
$query = "INSERT INTO main_navigation
|
||||
SELECT " . join(", ", $navigationColumns) . " FROM main_navigation
|
||||
WHERE id = " . $row['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newMainNavigationId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($row['id'], $newMainNavigationId, "main_navigation");
|
||||
}
|
||||
|
||||
$query = "SELECT * FROM main_navigation WHERE main_language_id = " . $this->newLanguageId;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = mysqli_fetch_array($result)) {
|
||||
$queryArray = array();
|
||||
if($row['parent_id'] > 0) {
|
||||
$queryArray[] = " parent_id = " . $this->get_new_id($row['parent_id'], 'main_navigation');
|
||||
}
|
||||
if($row['forward_navigation_id'] > 0) {
|
||||
$queryArray[] = " forward_navigation_id = " . $this->get_new_id($row['forward_navigation_id'], 'main_navigation');
|
||||
}
|
||||
if($row['forward_page_id'] > 0) {
|
||||
$queryArray[] = " forward_page_id = " . $this->get_new_id($row['forward_page_id'], 'main_page');
|
||||
}
|
||||
|
||||
if(count($queryArray)) {
|
||||
$query = "UPDATE main_navigation SET " . join(", ", $queryArray) . " WHERE id = " . $row['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
|
||||
$this->message = $translation->get("copy_language_navigation_finish");
|
||||
$this->nextStep = ""; // keine weiteren Schritte mehr
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy collection setup
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function copy_collection_setup($setupId = "", $addCopySuffix = false) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$table = "main_collection_setup";
|
||||
$columns = $this->get_column_names_to_copy($table);
|
||||
|
||||
$query = "SELECT * FROM $table WHERE main_language_id = " . $this->languageId;
|
||||
if($setupId != "") {
|
||||
$query .= " AND id = '" . $setupId."'";
|
||||
}
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = mysqli_fetch_array($result)) {
|
||||
if($addCopySuffix) {
|
||||
$columns['description'] = "CONCAT(description, ' (" . $translation->get("copy") . ")')";
|
||||
}
|
||||
|
||||
$query = "INSERT INTO $table
|
||||
SELECT " . join(", ", $columns) . " FROM $table
|
||||
WHERE id = " . $row['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
if($addCopySuffix) {
|
||||
$query = "UPDATE $table set code = CONCAT(code, '-$newId') WHERE id = " . $newId;
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
$this->insert_copy_link($row['id'], $newId, $table);
|
||||
|
||||
// collection setup content kopieren
|
||||
$collectionSetupContentColumns = $this->get_column_names_to_copy("main_collection_setup_content");
|
||||
$query = "SELECT * FROM main_collection_setup_content WHERE main_collection_setup_id = " . $row['id'];
|
||||
$lineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($lineRow = mysqli_fetch_array($lineResult)) {
|
||||
$finalLineColumns = $collectionSetupContentColumns;
|
||||
$finalLineColumns["main_collection_setup_id"] = $newId;
|
||||
|
||||
$query = "INSERT INTO main_collection_setup_content
|
||||
SELECT " . join(", ", $finalLineColumns) . " FROM main_collection_setup_content
|
||||
WHERE id = " . $lineRow['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newLineId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($lineRow['id'], $newLineId, "main_collection_setup_content");
|
||||
}
|
||||
|
||||
// collection setup gruppen kopieren
|
||||
$collectionSetupGroupColumns = $this->get_column_names_to_copy("main_collection_setup_group");
|
||||
$query = "SELECT * FROM main_collection_setup_group WHERE main_collection_setup_id = " . $row['id'];
|
||||
$lineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($lineRow = mysqli_fetch_array($lineResult)) {
|
||||
$finalLineColumns = $collectionSetupGroupColumns;
|
||||
$finalLineColumns["main_collection_setup_id"] = $newId;
|
||||
|
||||
$query = "INSERT INTO main_collection_setup_group
|
||||
SELECT " . join(", ", $finalLineColumns) . " FROM main_collection_setup_group
|
||||
WHERE id = " . $lineRow['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newLineId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($lineRow['id'], $newLineId, "main_collection_setup_group");
|
||||
}
|
||||
}
|
||||
|
||||
$this->message = $translation->get("copy_language_collection_setup_finish");
|
||||
$this->nextStep = "copy_collection";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy collections
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function copy_collection($setupId = "", $addCopySuffix = false) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$table = "main_collection";
|
||||
$columns = $this->get_column_names_to_copy($table);
|
||||
|
||||
$query = "SELECT * FROM $table WHERE main_language_id = " . $this->languageId;
|
||||
if($setupId != "") {
|
||||
$query .= " AND main_collection_setup_id = '" . $setupId."'";
|
||||
}
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = mysqli_fetch_array($result)) {
|
||||
$finalColumns = $columns;
|
||||
$finalColumns['main_collection_setup_id'] = $this->get_new_id($row['main_collection_setup_id'], 'main_collection_setup');
|
||||
if($row['registration_contactform_id'] > 0) {
|
||||
$finalColumns['registration_contactform_id'] = $this->get_new_id($row['registration_contactform_id'], 'contactform_header');
|
||||
}
|
||||
if($addCopySuffix) {
|
||||
$finalColumns['description'] = "CONCAT(description, ' (" . $translation->get("copy") . ")')";
|
||||
}
|
||||
|
||||
$query = "INSERT INTO $table
|
||||
SELECT " . join(", ", $finalColumns) . " FROM $table
|
||||
WHERE id = " . $row['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($row['id'], $newId, $table);
|
||||
|
||||
// collection group link kopieren
|
||||
$collectionGroupLinkColumns = $this->get_column_names_to_copy("main_collection_group_link");
|
||||
$query = "SELECT * FROM main_collection_group_link WHERE main_collection_id = " . $row['id'];
|
||||
$lineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($lineRow = mysqli_fetch_array($lineResult)) {
|
||||
$finalLineColumns = $collectionGroupLinkColumns;
|
||||
$finalLineColumns["main_collection_id"] = $newId;
|
||||
$finalLineColumns["main_collection_setup_group_id"] = $this->get_new_id($lineRow['main_collection_setup_group_id'], 'main_collection_setup_group');
|
||||
|
||||
$query = "INSERT INTO main_collection_group_link
|
||||
SELECT " . join(", ", $finalLineColumns) . " FROM main_collection_group_link
|
||||
WHERE id = " . $lineRow['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newLineId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($lineRow['id'], $newLineId, "main_collection_group_link");
|
||||
}
|
||||
|
||||
// collection link kopieren
|
||||
$collectionLinkColumns = $this->get_column_names_to_copy("main_collection_link");
|
||||
$query = "SELECT * FROM main_collection_link WHERE main_collection_id = " . $row['id'];
|
||||
$lineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($lineRow = mysqli_fetch_array($lineResult)) {
|
||||
$finalLineColumns = $collectionLinkColumns;
|
||||
$finalLineColumns["main_collection_id"] = $newId;
|
||||
$finalLineColumns["main_collection_setup_content_id"] = $this->get_new_id($lineRow['main_collection_setup_content_id'], 'main_collection_setup_content');
|
||||
if($lineRow['main_sitepart_id'] > 0) {
|
||||
$finalLineColumns['main_sitepart_header_id'] = $this->get_new_id($lineRow['main_sitepart_header_id'], $siteparts[$lineRow['main_sitepart_id']]['header_table']);
|
||||
}
|
||||
|
||||
$query = "INSERT INTO main_collection_link
|
||||
SELECT " . join(", ", $finalLineColumns) . " FROM main_collection_link
|
||||
WHERE id = " . $lineRow['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newLineId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
if($lineRow['main_sitepart_id'] == 0) {
|
||||
$query = "SELECT type_id from main_collection_setup_content where id = " . $lineRow['main_collection_setup_content_id'];
|
||||
$setupContentResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$setupContentRow = mysqli_fetch_array($setupContentResult);
|
||||
if($setupContentRow['type_id'] == 5) { // Bild
|
||||
$this->copy_collection_image($newLineId, $lineRow);
|
||||
}
|
||||
}
|
||||
|
||||
$this->insert_copy_link($lineRow['id'], $newLineId, "main_collection_link");
|
||||
}
|
||||
}
|
||||
|
||||
$this->message = $translation->get("copy_language_collection_finish");
|
||||
$this->nextStep = "copy_component";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy components
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function copy_component() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$table = "main_component";
|
||||
$columns = $this->get_column_names_to_copy($table);
|
||||
|
||||
$query = "SELECT * FROM $table WHERE main_language_id = " . $this->languageId;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = mysqli_fetch_array($result)) {
|
||||
$query = "INSERT INTO $table
|
||||
SELECT " . join(", ", $columns) . " FROM $table
|
||||
WHERE id = " . $row['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($row['id'], $newId, $table);
|
||||
|
||||
// component Link kopieren
|
||||
$componentLinkColumns = $this->get_column_names_to_copy("main_component_link");
|
||||
$query = "SELECT * FROM main_component_link WHERE main_component_id = " . $row['id'];
|
||||
$lineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($lineRow = mysqli_fetch_array($lineResult)) {
|
||||
$finalLineColumns = $componentLinkColumns;
|
||||
$finalLineColumns["main_component_id"] = $newId;
|
||||
if($lineRow['main_sitepart_header_id'] > 0) {
|
||||
$finalLineColumns['main_sitepart_header_id'] = $this->get_new_id($lineRow['main_sitepart_header_id'], $siteparts[$lineRow['main_sitepart_id']]['header_table']);
|
||||
}
|
||||
if($lineRow['main_collection_id'] > 0) {
|
||||
$finalLineColumns['main_collection_id'] = $this->get_new_id($lineRow['main_collection_id'], "main_collection");
|
||||
}
|
||||
if($lineRow['main_collection_setup_id'] > 0) {
|
||||
$finalLineColumns['main_collection_setup_id'] = $this->get_new_id($lineRow['main_collection_setup_id'], "main_collection_setup");
|
||||
}
|
||||
if($lineRow['main_collection_page_list_id'] > 0) {
|
||||
$finalLineColumns['main_collection_page_list_id'] = $this->get_new_id($lineRow['main_collection_page_list_id'], "main_navigation");
|
||||
}
|
||||
|
||||
$query = "INSERT INTO main_component_link
|
||||
SELECT " . join(", ", $finalLineColumns) . " FROM main_component_link
|
||||
WHERE id = " . $lineRow['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newLineId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($lineRow['id'], $newLineId, "main_component_link");
|
||||
|
||||
// component collection group link kopieren
|
||||
$componentCollectionGoupLinkColumns = $this->get_column_names_to_copy("main_component_collection_group_link");
|
||||
$query = "SELECT * FROM main_component_collection_group_link WHERE main_component_link_id = " . $lineRow['id'];
|
||||
$collectionGroupLinkResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($collectionGroupLinkLine = mysqli_fetch_array($collectionGroupLinkResult)) {
|
||||
$finalGroupLinkLineColumns = $componentCollectionGoupLinkColumns;
|
||||
$finalGroupLinkLineColumns['main_component_link_id'] = $newLineId;
|
||||
$finalGroupLinkLineColumns['main_collection_setup_group_id'] = $this->get_new_id($collectionGroupLinkLine['main_collection_setup_group_id'], "main_collection_setup_group");
|
||||
|
||||
$query = "INSERT INTO main_component_collection_group_link
|
||||
SELECT " . join(", ", $finalGroupLinkLineColumns) . " FROM main_component_collection_group_link
|
||||
WHERE id = " . $collectionGroupLinkLine['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newGroupLinkLineId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($collectionGroupLinkLine['id'], $newGroupLinkLineId, "main_component_collection_group_link");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->message = $translation->get("copy_language_component_finish");
|
||||
$this->nextStep = "copy_main_page";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy pages
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function copy_main_page($pageId = "", $addCopySuffix = false) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$table = "main_page";
|
||||
$columns = $this->get_column_names_to_copy($table);
|
||||
|
||||
$query = "SELECT * FROM $table WHERE main_language_id = " . $this->languageId;
|
||||
|
||||
if($pageId != "") {
|
||||
$query .= " AND id = '" . $pageId."'";
|
||||
}
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = mysqli_fetch_array($result)) {
|
||||
if($addCopySuffix) {
|
||||
$columns['title'] = "CONCAT(title, ' (" . $translation->get("copy") . ")')";
|
||||
}
|
||||
|
||||
$query = "INSERT INTO $table
|
||||
SELECT " . join(", ", $columns) . " FROM $table
|
||||
WHERE id = " . $row['id'];
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($row['id'], $newId, $table);
|
||||
|
||||
// page Link kopieren
|
||||
$pageLinkColumns = $this->get_column_names_to_copy("main_page_link");
|
||||
$query = "SELECT * FROM main_page_link WHERE main_page_id = " . $row['id'] . " AND main_page_link_parent_id = 0";
|
||||
$lineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($lineRow = mysqli_fetch_array($lineResult)) {
|
||||
$this->helper_copy_page_link($newId, $lineRow, $pageLinkColumns);
|
||||
}
|
||||
|
||||
$query = "SELECT * FROM main_page_link WHERE main_page_id = " . $row['id'] . " AND main_page_link_parent_id > 0";
|
||||
$lineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($lineRow = mysqli_fetch_array($lineResult)) {
|
||||
$this->helper_copy_page_link($newId, $lineRow, $pageLinkColumns);
|
||||
}
|
||||
|
||||
// page component include link kopieren
|
||||
if($this->copyPageComponentIcludeLink) {
|
||||
$pageComponentIncludeLinkColumns = $this->get_column_names_to_copy("main_page_component_include_link");
|
||||
$query = "SELECT * FROM main_page_component_include_link WHERE main_page_id = " . $row['id'];
|
||||
$lineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($lineRow = mysqli_fetch_array($lineResult)) {
|
||||
$finalLineColumns = $pageComponentIncludeLinkColumns;
|
||||
$finalLineColumns["main_page_id"] = $newId;
|
||||
$finalLineColumns["main_component_id"] = $this->get_new_id($lineRow['main_component_id'], 'main_component');
|
||||
|
||||
$query = "INSERT INTO main_page_component_include_link
|
||||
SELECT " . join(", ", $finalLineColumns) . " FROM main_page_component_include_link
|
||||
WHERE id = " . $lineRow['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newLineId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($lineRow['id'], $newLineId, "main_page_component_include_link");
|
||||
}
|
||||
}
|
||||
|
||||
// page layout inclusions link kopieren
|
||||
if($this->copyPageLayoutInclusionLink) {
|
||||
$pageLayoutInclusionsColumns = $this->get_column_names_to_copy("main_page_layout_inclusion_link");
|
||||
$query = "SELECT * FROM main_page_layout_inclusion_link WHERE main_page_id = " . $row['id'];
|
||||
$lineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($lineRow = mysqli_fetch_array($lineResult)) {
|
||||
$finalLineColumns = $pageLayoutInclusionsColumns;
|
||||
$finalLineColumns["main_page_id"] = $newId;
|
||||
|
||||
$query = "INSERT INTO main_page_layout_inclusion_link
|
||||
SELECT " . join(", ", $finalLineColumns) . " FROM main_page_layout_inclusion_link
|
||||
WHERE id = " . $lineRow['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newLineId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($lineRow['id'], $newLineId, "main_page_layout_inclusion_link");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->message = $translation->get("copy_language_page_finish");
|
||||
$this->nextStep = "copy_main_navigation";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to copy a page_link row
|
||||
*
|
||||
* @param $pageId
|
||||
* @param $lineRow
|
||||
* @param $columns
|
||||
*/
|
||||
protected function helper_copy_page_link($pageId, $lineRow, $columns) {
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$finalLineColumns = $columns;
|
||||
$finalLineColumns["main_page_id"] = $pageId;
|
||||
if($lineRow['main_sitepart_header_id'] > 0) {
|
||||
$finalLineColumns['main_sitepart_header_id'] = $this->get_new_id($lineRow['main_sitepart_header_id'], $siteparts[$lineRow['main_sitepart_id']]['header_table']);
|
||||
}
|
||||
if($lineRow['main_collection_id'] > 0) {
|
||||
$finalLineColumns['main_collection_id'] = $this->get_new_id($lineRow['main_collection_id'], "main_collection");
|
||||
}
|
||||
if($lineRow['main_collection_setup_id'] > 0) {
|
||||
$finalLineColumns['main_collection_setup_id'] = $this->get_new_id($lineRow['main_collection_setup_id'], "main_collection_setup");
|
||||
}
|
||||
if($lineRow['main_collection_page_list_id'] > 0) {
|
||||
$finalLineColumns['main_collection_page_list_id'] = $this->get_new_id($lineRow['main_collection_page_list_id'], "main_navigation");
|
||||
}
|
||||
if($lineRow['main_page_link_parent_id'] > 0) {
|
||||
$finalLineColumns['main_page_link_parent_id'] = $this->get_new_id($lineRow['main_page_link_parent_id'], "main_page_link");
|
||||
}
|
||||
|
||||
$query = "INSERT INTO main_page_link
|
||||
SELECT " . join(", ", $finalLineColumns) . " FROM main_page_link
|
||||
WHERE id = " . $lineRow['id'];
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newLineId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($lineRow['id'], $newLineId, "main_page_link");
|
||||
|
||||
// page collection group link kopieren
|
||||
$pageCollectionGoupLinkColumns = $this->get_column_names_to_copy("main_page_collection_group_link");
|
||||
$query = "SELECT * FROM main_page_collection_group_link WHERE main_page_link_id = " . $lineRow['id'];
|
||||
$lineResult = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($collectionGroupRow = mysqli_fetch_array($lineResult)) {
|
||||
$finalLineColumns = $pageCollectionGoupLinkColumns;
|
||||
$finalLineColumns['main_page_link_id'] = $newLineId;
|
||||
$finalLineColumns['main_collection_setup_group_id'] = $this->get_new_id($collectionGroupRow['main_collection_setup_group_id'], "main_collection_setup_group");
|
||||
|
||||
$query = "INSERT INTO main_page_collection_group_link
|
||||
SELECT " . join(", ", $finalLineColumns) . " FROM main_page_collection_group_link
|
||||
WHERE id = " . $collectionGroupRow['id'];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$newGroupLinkLineId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
|
||||
$this->insert_copy_link($collectionGroupRow['id'], $newGroupLinkLineId, "main_page_collection_group_link");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Column names for an insert statement to copy
|
||||
*
|
||||
* @param $table
|
||||
* @return array
|
||||
*/
|
||||
protected function get_column_names_to_copy($table) {
|
||||
$columns = array();
|
||||
$query = "SHOW COLUMNS FROM " . $table;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = mysqli_fetch_array($result)) {
|
||||
if($row['Field'] == "id") {
|
||||
$columns[] = 'null';
|
||||
continue;
|
||||
}
|
||||
|
||||
if($row['Field'] == "main_language_id") {
|
||||
$columns[] = $this->newLanguageId;
|
||||
continue;
|
||||
}
|
||||
|
||||
$columns[$row['Field']] = $row['Field'];
|
||||
}
|
||||
|
||||
return $columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to store a new generated id of a table
|
||||
*
|
||||
* @param $oldId
|
||||
* @param $newId
|
||||
* @param $table
|
||||
*/
|
||||
protected function insert_copy_link($oldId, $newId, $table) {
|
||||
$query = "INSERT INTO copy_link (old_id, new_id, source_table, session_id) VALUES
|
||||
(
|
||||
" . $oldId . ",
|
||||
" . $newId . ",
|
||||
'" . $table . "',
|
||||
'" . session_id() . "'
|
||||
)";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get new generated id of a table for a specific oldId
|
||||
*
|
||||
* @param $oldId
|
||||
* @param $table
|
||||
* @return array|bool|null
|
||||
*/
|
||||
public function get_new_id($oldId, $table) {
|
||||
$query = "SELECT new_id FROM copy_link WHERE old_id = '".$oldId."' AND source_table = '" . $table . "' AND session_id = '" . session_id() . "'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if(@mysqli_num_rows($result) > 0) {
|
||||
$row = mysqli_fetch_array($result);
|
||||
return $row['new_id'];
|
||||
} else {
|
||||
return $oldId;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Sitepart Id for copy
|
||||
*
|
||||
* @param $sitePartId
|
||||
*/
|
||||
public function addSitePartId($sitePartId) {
|
||||
if(!in_array($sitePartId, $this->sitePartIds)) {
|
||||
$this->sitePartIds[] = $sitePartId;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Sitepart Header Id for copy
|
||||
*
|
||||
* @param $sitePartId
|
||||
*/
|
||||
public function addSitePartHeaderId($sitePartHeaderId) {
|
||||
if(!in_array($sitePartHeaderId, $this->sitePartHeaderIds)) {
|
||||
$this->sitePartHeaderIds[] = $sitePartHeaderId;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mode to copy only specific siteparts
|
||||
*
|
||||
*/
|
||||
public function set_copyOnlySpecificSiteparts() {
|
||||
$this->sitePartdIdsFromArrayOnly = true;
|
||||
if($this->sitePartIds === null) {
|
||||
$this->sitePartIds = array();
|
||||
}
|
||||
|
||||
if($this->sitePartHeaderIds === null) {
|
||||
$this->sitePartHeaderIds = array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set no copy for page component include link
|
||||
*
|
||||
*/
|
||||
public function set_noCopyPageComponentIncludeLink() {
|
||||
$this->copyPageComponentIcludeLink = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set no copy for page collection group link
|
||||
*
|
||||
*/
|
||||
public function set_noCopyPageCollectionGroupLink() {
|
||||
$this->copyPageCollectionGroupLink = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set no copy for page layout inclusion link
|
||||
*
|
||||
*/
|
||||
public function set_noCopyPageLayoutInclusionLink() {
|
||||
$this->copyPageLayoutInclusionLink = false;
|
||||
}
|
||||
}
|
||||
37
mysyde/admin/edit_language_listform.inc.php
Normal file
37
mysyde/admin/edit_language_listform.inc.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_language_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new', true)"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('top_languages'); ?></h1>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT id, name AS '" . $translation->get("description") . "',code AS '" . $translation->get("textkey") . "', (SELECT COUNT(id) FROM main_navigation WHERE main_language_id = main_language.id) AS '" . $translation->get("number_menu_items") . "' FROM main_language WHERE main_site_id = '" . $GLOBALS["site"]["id"] . "' ORDER BY code ASC";
|
||||
$format = array('option', 'text', 'text', 'integer');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format);
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
570
mysyde/admin/edit_layout.inc.php
Normal file
570
mysyde/admin/edit_layout.inc.php
Normal file
@@ -0,0 +1,570 @@
|
||||
<?
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
switch ($_REQUEST["action"]) {
|
||||
case 'edit':
|
||||
edit_layout();
|
||||
break;
|
||||
case 'delete':
|
||||
delete_layout();
|
||||
break;
|
||||
case 'new':
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
break;
|
||||
case 'save':
|
||||
save_layout();
|
||||
break;
|
||||
|
||||
case 'edit_area':
|
||||
edit_layout_area();
|
||||
break;
|
||||
case 'delete_area':
|
||||
delete_layout_area();
|
||||
break;
|
||||
case 'new_area':
|
||||
require_once("edit_layout_area_cardform.inc.php");
|
||||
break;
|
||||
case 'save_area':
|
||||
save_layout_area();
|
||||
break;
|
||||
case 'moveup_area':
|
||||
moveup_area();
|
||||
edit_layout();
|
||||
break;
|
||||
case 'movedown_area':
|
||||
movedown_area();
|
||||
edit_layout();
|
||||
break;
|
||||
|
||||
case 'edit_class':
|
||||
edit_layout_class();
|
||||
break;
|
||||
case 'delete_class':
|
||||
delete_layout_class();
|
||||
break;
|
||||
case 'new_class':
|
||||
require_once("edit_layout_class_cardform.inc.php");
|
||||
break;
|
||||
case 'save_class':
|
||||
save_layout_class();
|
||||
break;
|
||||
case 'moveup_class':
|
||||
moveup_class();
|
||||
edit_layout();
|
||||
break;
|
||||
case 'movedown_class':
|
||||
movedown_class();
|
||||
edit_layout();
|
||||
break;
|
||||
|
||||
case 'moveup_inclusion':
|
||||
moveup_inclusion();
|
||||
edit_layout();
|
||||
break;
|
||||
case 'movedown_inclusion':
|
||||
movedown_inclusion();
|
||||
edit_layout();
|
||||
break;
|
||||
case 'delete_inclusion':
|
||||
delete_inclusion();
|
||||
edit_layout();
|
||||
break;
|
||||
case 'edit_inclusion':
|
||||
edit_inclusion();
|
||||
break;
|
||||
case 'new_inclusion':
|
||||
require_once("edit_layout_inclusions_cardform.inc.php");
|
||||
break;
|
||||
case 'save_inclusion':
|
||||
save_inclusion($sitepart);
|
||||
break;
|
||||
|
||||
case 'update_sortorder_area':
|
||||
update_sortorder_area();
|
||||
break;
|
||||
case 'update_sortorder_class':
|
||||
update_sortorder_class();
|
||||
break;
|
||||
case 'update_sortorder_inclusion':
|
||||
update_sortorder_inclusion();
|
||||
break;
|
||||
|
||||
default:
|
||||
require_once("edit_layout_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function update_sortorder_area() {
|
||||
$sorting = 1;
|
||||
foreach ($_POST['linklistid'] as $itemId) {
|
||||
$query = "UPDATE main_layout_area SET sorting = " . $sorting . " WHERE id = '" . $itemId."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$sorting++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function update_sortorder_inclusion() {
|
||||
$sorting = 1;
|
||||
foreach ($_POST['linklistid'] as $itemId) {
|
||||
$query = "UPDATE main_layout_inclusions SET sorting = " . $sorting . " WHERE id = '" . $itemId."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$sorting++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function update_sortorder_class() {
|
||||
$sorting = 1;
|
||||
foreach ($_POST['linklistid'] as $itemId) {
|
||||
$query = "UPDATE main_layout_class SET sorting = " . $sorting . " WHERE id = '" . $itemId."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$sorting++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function moveup_inclusion() {
|
||||
move_inclusion("<", "DESC", $_REQUEST["input_inclusion_id"]);
|
||||
}
|
||||
|
||||
function movedown_inclusion() {
|
||||
move_inclusion(">", "ASC", $_REQUEST["input_inclusion_id"]);
|
||||
}
|
||||
|
||||
function move_inclusion( $way, $order, $inclusion_id ) {
|
||||
|
||||
$pdoHost = getenv('MAIN_MYSQL_DB_HOST');
|
||||
$pdoPort = getenv('MAIN_MYSQL_DB_PORT');
|
||||
$pdoUser = getenv('MAIN_MYSQL_DB_USER');
|
||||
$pdoPass = getenv('MAIN_MYSQL_DB_PASS');
|
||||
$pdoSchema = getenv('MAIN_MYSQL_DB_SCHEMA');
|
||||
|
||||
$pdo = new \DynCom\mysyde\common\classes\PDOQueryWrapper($pdoHost, $pdoPort, $pdoSchema, $pdoUser, $pdoPass);
|
||||
|
||||
$prepStatement = " SELECT * FROM main_layout_inclusions WHERE id = :id LIMIT 1
|
||||
";
|
||||
$params = [
|
||||
[':id', $inclusion_id, PDO::PARAM_STR],
|
||||
];
|
||||
$pdo->setQuery($prepStatement);
|
||||
$pdo->prepareQuery();
|
||||
$pdo->bindParameters($params);
|
||||
$pdo->executePreparedStatement();
|
||||
$result = $pdo->getResultArray();
|
||||
|
||||
if (count($result) == 1) {
|
||||
$curr_inclusion = $result[0];
|
||||
}
|
||||
$query = "SELECT * FROM main_layout_inclusions WHERE main_layout_id = '" . $curr_inclusion["main_layout_id"] . "' AND sorting " . $way . " " . $curr_inclusion["sorting"] . " ORDER BY sorting " . $order . " LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$change_inclusion = @mysqli_fetch_array($result);
|
||||
}
|
||||
if (($curr_inclusion["id"] <> '') && ($change_inclusion["id"] <> '')) {
|
||||
$query = "UPDATE main_layout_inclusions SET sorting = " . $change_inclusion["sorting"] . " WHERE id = " . $curr_inclusion["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$query = "UPDATE main_layout_inclusions SET sorting = " . $curr_inclusion["sorting"] . " WHERE id = " . $change_inclusion["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
|
||||
function edit_inclusion( $_id = "" ) {
|
||||
if ((int)$_id > 0) {
|
||||
$incusion_id = $_id;
|
||||
} else {
|
||||
$incusion_id = $_REQUEST["input_inclusion_id"];
|
||||
}
|
||||
|
||||
if ($incusion_id <> '') {
|
||||
$query = "SELECT * FROM main_layout_inclusions WHERE id = '" . $incusion_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_layout_inclusion = @mysqli_fetch_array($result);
|
||||
require_once("edit_layout_inclusions_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
$main_layout_id = $_REQUEST["input_id"];
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_inclusion() {
|
||||
$id = $_REQUEST["input_inclusion_id"];
|
||||
//Delete from relation-table
|
||||
$query = "DELETE FROM main_navigation_layout_inclusions
|
||||
WHERE main_layout_inclusions_id = '" . $id."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
//Delete from layout_inclusions table
|
||||
$query = "DELETE FROM main_layout_inclusions
|
||||
WHERE id = '" . $id . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
|
||||
function save_inclusion( $sitepart ) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$id = $_REQUEST["input_inclusion_id"];
|
||||
$main_layout_id = $_REQUEST["input_id"];
|
||||
IF ($main_layout_id == NULL) {
|
||||
$main_layout_id = $GLOBALS['language']['main_layout_id'];
|
||||
}
|
||||
$type = $_REQUEST["input_inclusion_type"];
|
||||
$path = $_REQUEST["input_inclusion_path"];
|
||||
$default_active = $_REQUEST["input_inclusion_default_active"];
|
||||
IF ($id <> '') {
|
||||
$query = "UPDATE main_layout_inclusions SET
|
||||
main_layout_id = '" . $main_layout_id . "',
|
||||
type = '" . $type . "',
|
||||
path = '" . $path . "',
|
||||
default_active = '" . $default_active . "'
|
||||
WHERE id = '" . $id . "'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
} ELSE {
|
||||
$sql_1 = "SELECT MAX(sorting) AS 'sorting' FROM main_layout_inclusions WHERE main_layout_id = '" . $main_layout_id."'";
|
||||
$query_1 = mysqli_query($GLOBALS['mysql_con'], $sql_1);
|
||||
IF (mysqli_num_rows($query_1) == 0) {
|
||||
$sorting = 1;
|
||||
} ELSE {
|
||||
$sorting = mysqli_result($query_1, 0) + 1;
|
||||
}
|
||||
$sql_2 = "
|
||||
INSERT INTO main_layout_inclusions
|
||||
(main_layout_id,
|
||||
type,
|
||||
path,
|
||||
default_active,
|
||||
sorting)
|
||||
VALUES
|
||||
('" . $main_layout_id . "','" .
|
||||
$type . "','" .
|
||||
$path . "','" .
|
||||
$default_active . "','" .
|
||||
$sorting . "')";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $sql_2);
|
||||
|
||||
$id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
}
|
||||
|
||||
|
||||
$query = "SELECT * FROM main_layout WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_inclusion_id = $_REQUEST["input_id"];
|
||||
$input_layout = @mysqli_fetch_array($result);
|
||||
}
|
||||
|
||||
if ($_REQUEST['save_and_close'] == 1) {
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
} else {
|
||||
edit_inclusion($id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function edit_layout() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "SELECT * FROM main_layout WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
/*
|
||||
$input_layout = @mysqli_fetch_array($result);
|
||||
$input_layout["css_include"] = str_replace("layout/frontend/" . $input_layout["code"] . "/css/", "", $input_layout["css_include"]);
|
||||
$input_layout["css_include_2"] = str_replace("layout/frontend/" . $input_layout["code"] . "/css/", "", $input_layout["css_include_2"]);
|
||||
$input_layout["css_include_3"] = str_replace("layout/frontend/" . $input_layout["code"] . "/css/", "", $input_layout["css_include_3"]);
|
||||
$input_layout["css_include_4"] = str_replace("layout/frontend/" . $input_layout["code"] . "/css/", "", $input_layout["css_include_4"]);
|
||||
$input_layout["css_include_5"] = str_replace("layout/frontend/" . $input_layout["code"] . "/css/", "", $input_layout["css_include_5"]);
|
||||
$input_layout["fck_style_include"] = str_replace("layout/frontend/" . $input_layout["code"] . "/", "", $input_layout["fck_style_include"]);
|
||||
$input_layout["fck_layout_include"] = str_replace("layout/frontend/" . $input_layout["code"] . "/css/", "", $input_layout["fck_css_include"]);
|
||||
$input_layout["favicon_include"] = str_replace("layout/frontend/" . $input_layout["code"] . "/", "", $input_layout["favicon_include"]);
|
||||
*/
|
||||
$input_inclusion_id = $_REQUEST["input_id"];
|
||||
$input_layout = @mysqli_fetch_array($result);
|
||||
//$input_layout["frontend_include"] = str_replace("mysyde/frontend/", "", $input_layout["frontend_include"]);
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("edit_layout_listform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_layout() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM main_layout WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
require_once("edit_layout_listform.inc.php");
|
||||
}
|
||||
|
||||
function save_layout() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$fck_style_include_path = $_REQUEST["input_fck_style_include"];
|
||||
$fck_layout_include_path = $_REQUEST["input_fck_layout_include"];
|
||||
$favicon_include_path = $_REQUEST["input_favicon_include"];
|
||||
//$frontend_include_path = "mysyde/frontend/" . $_REQUEST["input_frontend_include"];
|
||||
$frontend_include_path = $_REQUEST["input_frontend_include"];
|
||||
$inserted = FALSE;
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "UPDATE main_layout SET code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"]) . "', name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "', fck_style_include = '" . $fck_style_include_path . "', fck_css_include = '" . $fck_layout_include_path . "', favicon_include = '" . $favicon_include_path . "', frontend_include = '" . $frontend_include_path . "' WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
} else {
|
||||
$query = "INSERT INTO main_layout (code, name, fck_style_include, fck_css_include, favicon_include, frontend_include) VALUES ('" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"]) . "','" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "','" . $fck_style_include_path . "','" . $fck_layout_include_path . "','" . $favicon_include_path . "', '" . $frontend_include_path . "')";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
if (($_REQUEST["input_name"] == '') | ($_REQUEST["input_code"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_name") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_layout WHERE code = '" . $_REQUEST["input_code"] . "'");
|
||||
if ((@mysqli_num_rows($result) <> 0) && ($_REQUEST["input_id"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_exists") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
$input_layout = array();
|
||||
$input_layout['id'] = $_REQUEST["input_id"];
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted === TRUE) {
|
||||
$last_insert_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$input_layout['id'] = $last_insert_id;
|
||||
createMySydeLog('main_layout', $input_layout['id'], 'INSERT');
|
||||
}else{
|
||||
createMySydeLog('main_layout', $input_layout['id'], 'UPDATE');
|
||||
}
|
||||
}
|
||||
|
||||
$input_layout["code"] = $_REQUEST["input_code"];
|
||||
$input_layout["name"] = $_REQUEST["input_name"];
|
||||
$input_layout["frontend_include"] = $_REQUEST["input_frontend_include"];
|
||||
$input_layout["fck_style_include"] = $_REQUEST["input_fck_style_include"];
|
||||
$input_layout["fck_css_include"] = $_REQUEST["input_fck_layout_include"];
|
||||
$input_layout["favicon_include"] = $_REQUEST["input_favicon_include"];
|
||||
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
|
||||
}
|
||||
|
||||
function edit_layout_area( $_id = "" ) {
|
||||
if ((int)$_id > 0) {
|
||||
$area_id = $_id;
|
||||
} else {
|
||||
$area_id = $_REQUEST["input_area_id"];
|
||||
}
|
||||
if ($area_id <> '') {
|
||||
$query = "SELECT * FROM main_layout_area WHERE id = '" . $area_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_layout_area = @mysqli_fetch_array($result);
|
||||
require_once("edit_layout_area_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_layout_area() {
|
||||
$input_layout = mysqli_fetch_array(mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_layout WHERE id = '" . $_REQUEST["input_id"] . "'"));
|
||||
if ($_REQUEST["input_area_id"] <> '') {
|
||||
$query = "DELETE FROM main_layout_area WHERE id = '" . $_REQUEST["input_area_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
}
|
||||
|
||||
function save_layout_area() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$messages = array();
|
||||
$id = $_REQUEST["input_area_id"];
|
||||
if ($_REQUEST["input_area_id"] <> '') {
|
||||
$input_layout = mysqli_fetch_array(mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_layout WHERE id = '" . $_REQUEST["input_id"] . "'"));
|
||||
$query = "UPDATE main_layout_area SET code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_area_code"]) . "', name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_area_name"]) . "' WHERE id = '" . $_REQUEST["input_area_id"] . "' LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
} else {
|
||||
$input_layout = mysqli_fetch_array(mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_layout WHERE id = '" . $_REQUEST["input_id"] . "'"));
|
||||
$newsort = mysqli_result(mysqli_query($GLOBALS['mysql_con'], "SELECT MAX(sorting) FROM main_layout_area WHERE main_layout_id = '" . $_REQUEST["input_id"]."'"), 0) + 1;
|
||||
//$messages[] = $newsort;
|
||||
$query = "INSERT INTO main_layout_area (code, name, main_layout_id, sorting) VALUES ('" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_area_code"]) . "','" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_area_name"]) . "', '" . $input_layout["id"] . "','" . $newsort . "')";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
if (($_REQUEST["input_area_name"] == '') | ($_REQUEST["input_area_code"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_name") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_layout_area WHERE main_layout_id = '" . (int)$_REQUEST["input_id"] . "' AND code = '" . $_REQUEST["input_area_code"] . "'");
|
||||
if ((@mysqli_num_rows($result) <> 0) && ($_REQUEST["input_area_id"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_exists") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// benoetigt fuer ajax calls
|
||||
if ($error === TRUE) {
|
||||
header('EDIT_ERROR: 1');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($_REQUEST['save_and_close'] == 1) {
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
} else {
|
||||
if ($inserted === TRUE) {
|
||||
$id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
}
|
||||
edit_layout_area($id);
|
||||
}
|
||||
|
||||
} else {
|
||||
$input_layout_area["id"] = $_REQUEST["input_area_id"];
|
||||
$input_layout_area["name"] = $_REQUEST["input_area_name"];
|
||||
$input_layout_area["code"] = $_REQUEST["input_area_code"];
|
||||
|
||||
require_once("edit_layout_area_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function move_layout_area( $way, $order, $layout_area_id ) {
|
||||
$query = "SELECT * FROM main_layout_area WHERE id = '" . $layout_area_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$curr_area = @mysqli_fetch_array($result);
|
||||
}
|
||||
$query = "SELECT * FROM main_layout_area WHERE main_layout_id = '" . $curr_area["main_layout_id"] . "' AND sorting " . $way . " " . $curr_area["sorting"] . " ORDER BY sorting " . $order . " LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$change_area = @mysqli_fetch_array($result);
|
||||
}
|
||||
if (($curr_area["id"] <> '') && ($change_area["id"] <> '')) {
|
||||
$query = "UPDATE main_layout_area SET sorting = " . $change_area["sorting"] . " WHERE id = " . $curr_area["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$query = "UPDATE main_layout_area SET sorting = " . $curr_area["sorting"] . " WHERE id = " . $change_area["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
|
||||
function moveup_area() {
|
||||
move_layout_area("<", "DESC", $_REQUEST["input_area_id"]);
|
||||
}
|
||||
|
||||
function movedown_area() {
|
||||
move_layout_area(">", "ASC", $_REQUEST["input_area_id"]);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* Funktionen fuer layut klassen
|
||||
* ***********************************************************
|
||||
*/
|
||||
function edit_layout_class( $_id = "", $messages = array() ) {
|
||||
if ((int)$_id > 0) {
|
||||
$area_id = $_id;
|
||||
} else {
|
||||
$area_id = $_REQUEST["input_class_id"];
|
||||
}
|
||||
if ($area_id <> '') {
|
||||
$query = "SELECT * FROM main_layout_class WHERE id = '" . $area_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_layout_class = @mysqli_fetch_array($result);
|
||||
require_once("edit_layout_class_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_layout_class() {
|
||||
$input_layout = mysqli_fetch_array(mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_layout WHERE id = '" . $_REQUEST["input_id"] . "'"));
|
||||
if ($_REQUEST["input_class_id"] <> '') {
|
||||
$query = "DELETE FROM main_layout_class WHERE id = '" . $_REQUEST["input_class_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
}
|
||||
|
||||
function save_layout_class() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$messages = array();
|
||||
$id = $_REQUEST["input_class_id"];
|
||||
if ($_REQUEST["input_class_id"] <> '') {
|
||||
$input_layout = mysqli_fetch_array(mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_layout WHERE id = '" . $_REQUEST["input_id"] . "'"));
|
||||
$query = "UPDATE main_layout_class SET code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_class_code"]) . "', name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_class_name"]) . "' WHERE id = '" . $_REQUEST["input_class_id"] . "' LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
} else {
|
||||
$input_layout = mysqli_fetch_array(mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_layout WHERE id = '" . $_REQUEST["input_id"] . "'"));
|
||||
$newsort = mysqli_result(mysqli_query($GLOBALS['mysql_con'], "SELECT MAX(sorting) FROM main_layout_class WHERE main_layout_id = '" . $_REQUEST["input_id"]."'"), 0) + 1;
|
||||
//$messages[] = $newsort;
|
||||
$query = "INSERT INTO main_layout_class (code, name, main_layout_id, sorting) VALUES ('" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_class_code"]) . "','" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_class_name"]) . "', '" . $input_layout["id"] . "','" . $newsort . "')";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
if (($_REQUEST["input_class_name"] == '') | ($_REQUEST["input_class_code"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_name") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_layout_class WHERE main_layout_id = '" . (int)$_REQUEST["input_id"] . "' AND code = '" . $_REQUEST["input_class_code"] . "'");
|
||||
if ((@mysqli_num_rows($result) <> 0) && ($_REQUEST["input_class_id"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_exists") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
// benoetigt fuer ajax calls
|
||||
if ($error === TRUE) {
|
||||
header('EDIT_ERROR: 1');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($_REQUEST['save_and_close'] == 1) {
|
||||
require_once("edit_layout_cardform.inc.php");
|
||||
} else {
|
||||
if ($inserted === TRUE) {
|
||||
$id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("layout_class_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("layout_class_success2") . '</div>';
|
||||
}
|
||||
|
||||
edit_layout_class($id, $messages);
|
||||
}
|
||||
|
||||
} else {
|
||||
$input_layout_class["id"] = $_REQUEST["input_class_id"];
|
||||
$input_layout_class["name"] = $_REQUEST["input_class_name"];
|
||||
$input_layout_class["code"] = $_REQUEST["input_class_code"];
|
||||
|
||||
require_once("edit_layout_class_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function move_layout_class( $way, $order, $layout_class_id ) {
|
||||
$query = "SELECT * FROM main_layout_class WHERE id = '" . $layout_class_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$curr_class = @mysqli_fetch_array($result);
|
||||
}
|
||||
$query = "SELECT * FROM main_layout_class WHERE main_layout_id = '" . $curr_class["main_layout_id"] . "' AND sorting " . $way . " " . $curr_class["sorting"] . " ORDER BY sorting " . $order . " LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$change_class = @mysqli_fetch_array($result);
|
||||
}
|
||||
if (($curr_class["id"] <> '') && ($change_class["id"] <> '')) {
|
||||
$query = "UPDATE main_layout_class SET sorting = " . $change_class["sorting"] . " WHERE id = " . $curr_class["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$query = "UPDATE main_layout_class SET sorting = " . $curr_class["sorting"] . " WHERE id = " . $change_class["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
|
||||
function moveup_class() {
|
||||
move_layout_class("<", "DESC", $_REQUEST["input_class_id"]);
|
||||
}
|
||||
|
||||
function movedown_class() {
|
||||
move_layout_class(">", "ASC", $_REQUEST["input_class_id"]);
|
||||
}
|
||||
57
mysyde/admin/edit_layout_area_cardform.inc.php
Normal file
57
mysyde/admin/edit_layout_area_cardform.inc.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
$formname = "form_layout_area_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
function layout_area_save_and_close() {
|
||||
jQuery('#save_and_close', jQuery('#form_layout_area_card')).val("1");
|
||||
loadCard('save_area', true);
|
||||
}
|
||||
|
||||
</script>
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_layout_inclusion["id"] == "") {
|
||||
echo $translation->get("new_layout_area");
|
||||
} else {
|
||||
echo $translation->get("edit_layout_area");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("overview"), $formname, "loadCard('edit', true)"); ?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_area', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "layout_area_save_and_close()"); ?>
|
||||
<?php
|
||||
if ($input_layout_area["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_area', true, '{$translation->get('delete_layout_area_confirm')}')");
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_area_id" type="hidden" value="<?= $input_layout_area["id"] ?>">
|
||||
<input name="input_id" type="hidden" value="<?= $_POST["input_id"] ?>">
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("textkey"), "input_area_code", "code", $input_layout_area["code"], 20) ?>
|
||||
<? input($translation->get("description"), "input_area_name", "text", $input_layout_area["name"], 45) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
27
mysyde/admin/edit_layout_area_listform.inc.php
Normal file
27
mysyde/admin/edit_layout_area_listform.inc.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_layout_area_list";
|
||||
?>
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_layout["id"] ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_area_id" value="" />
|
||||
|
||||
<h2><?php echo $translation->get("layout_areas"); ?></h2>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_area', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_area')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_area', false, '{$translation->get('delete_layout_area_confirm')}')", "", FALSE); ?>
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_area')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_area')", "", FALSE); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?
|
||||
$query = "SELECT id, name AS '" . $translation->get("description") . "', code as '" . $translation->get("textkey") . "' from main_layout_area WHERE main_layout_id = '" . $input_layout["id"] . "' ORDER by sorting ASC";
|
||||
$format = array('option', 'text', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_area_id", "edit_area", TRUE, "update_sortorder_area");
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
62
mysyde/admin/edit_layout_cardform.inc.php
Normal file
62
mysyde/admin/edit_layout_cardform.inc.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_layout_card";
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_layout["id"] == "") {
|
||||
echo $translation->get("new_layout");
|
||||
} else {
|
||||
echo sprintf($translation->get("edit_layout"), $input_layout["name"]);
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save', true, '', true)"); ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
if ($input_layout["id"] != "") {
|
||||
echo button("delete", $translation->get("delete-whole-layout"), $formname, "loadCard('delete', true, '{$translation->get('delete_layout_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_layout["id"] ?>">
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("textkey"), "input_code", "code", $input_layout["code"], 20) ?>
|
||||
<? input($translation->get("description"), "input_name", "text", $input_layout["name"], 45) ?>
|
||||
<? input($translation->get("frontend_file"), "input_frontend_include", "text", $input_layout["frontend_include"], 45) ?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<?
|
||||
if ($input_layout['id'] != "") {
|
||||
require_once("edit_layout_inclusions_listform.inc.php");
|
||||
require_once("edit_layout_area_listform.inc.php");
|
||||
require_once("edit_layout_class_listform.inc.php");
|
||||
}
|
||||
57
mysyde/admin/edit_layout_class_cardform.inc.php
Normal file
57
mysyde/admin/edit_layout_class_cardform.inc.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
$formname = "form_layout_class_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
function layout_class_save_and_close() {
|
||||
jQuery('#save_and_close', jQuery('#form_layout_class_card')).val("1");
|
||||
loadCard('save_class', true);
|
||||
}
|
||||
|
||||
</script>
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_layout_inclusion["id"] == "") {
|
||||
echo $translation->get("new_layout_class");
|
||||
} else {
|
||||
echo $translation->get("edit_layout_class");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("overview"), $formname, "loadCard('edit', true)"); ?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_class', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "layout_class_save_and_close()"); ?>
|
||||
<?php
|
||||
if ($input_layout_class["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_class', true, '{$translation->get('delete_layout_class_confirm')}')");
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_class_id" type="hidden" value="<?= $input_layout_class["id"] ?>">
|
||||
<input name="input_id" type="hidden" value="<?= $_POST["input_id"] ?>">
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("textkey"), "input_class_code", "code", $input_layout_class["code"], 80) ?>
|
||||
<? input($translation->get("description"), "input_class_name", "text", $input_layout_class["name"], 80) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
27
mysyde/admin/edit_layout_class_listform.inc.php
Normal file
27
mysyde/admin/edit_layout_class_listform.inc.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_layout_class_list";
|
||||
?>
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_layout["id"] ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_class_id" value="" />
|
||||
|
||||
<h2><?php echo $translation->get("layout_classes"); ?></h2>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_class', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_class')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_class', false, '{$translation->get('delete_layout_class_confirm')}')", "", FALSE); ?>
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_class')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_class')", "", FALSE); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?
|
||||
$query = "SELECT id, name AS '" . $translation->get("description") . "', code as '" . $translation->get("textkey") . "' from main_layout_class WHERE main_layout_id = '" . $input_layout["id"] . "' ORDER by sorting ASC";
|
||||
$format = array('option', 'text', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_class_id", "edit_class", TRUE, "update_sortorder_class");
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
95
mysyde/admin/edit_layout_inclusions_cardform.inc.php
Normal file
95
mysyde/admin/edit_layout_inclusions_cardform.inc.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
$formname = "form_layout_inclusion_card";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function inclusion_cardform_SetFileField( fileUrl ) {
|
||||
$('#input_inclusion_path').val(fileUrl);
|
||||
}
|
||||
|
||||
|
||||
function inclusion_cardform_browseScripts() {
|
||||
var finder = new CKFinder();
|
||||
finder.basePath = "/plugins/ckfinder/";
|
||||
finder.selectActionFunction = inclusion_cardform_SetFileField;
|
||||
finder.popup();
|
||||
}
|
||||
|
||||
function inclusion_cardform_getType() {
|
||||
var scriptPath = $('#input_inclusion_path', jQuery('#form_layout_inclusion_card')).val();
|
||||
var typeArray = scriptPath.split(".");
|
||||
typeArray = typeArray.reverse();
|
||||
var type = typeArray[0];
|
||||
type.toLowerCase();
|
||||
$('#input_inclusion_type', jQuery('#form_layout_inclusion_card')).val(type);
|
||||
return true;
|
||||
}
|
||||
|
||||
function save_and_close() {
|
||||
jQuery('#save_and_close', jQuery('#form_layout_inclusion_card')).val("1");
|
||||
loadCard('save_inclusion', true);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_layout_inclusion["id"] == "") {
|
||||
echo $translation->get("new_css_javascript");
|
||||
} else {
|
||||
echo $translation->get("edit_css_javascript");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("overview"), $formname, "loadCard('edit', true)"); ?>
|
||||
<?= button("save", $translation->get("save"), $formname, "inclusion_cardform_getType(); loadCard('save_inclusion', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "inclusion_cardform_getType(); save_and_close()"); ?>
|
||||
<?php
|
||||
if ($input_layout_inclusion["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_inclusion', true, '{$translation->get('delete_layout_inclusion_confirm')}')");
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_inclusion_id" type="hidden" value="<?= $input_layout_inclusion["id"] ?>" />
|
||||
<input name="input_id" type="hidden" value="<?= $_POST["input_id"] ?>" />
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
<input type="hidden" id="input_inclusion_type" class="text" type="text"
|
||||
value="<?= $input_layout_inclusion["type"] ?>" name="input_inclusion_type" />
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="label">
|
||||
<label for="input_inclusion_path"><?php echo $translation->get("path"); ?></label>
|
||||
</div>
|
||||
<div class="input">
|
||||
<input id="input_inclusion_path" class="text" type="text"
|
||||
value="<?= $input_layout_inclusion["path"] ?>" name="input_inclusion_path">
|
||||
</div>
|
||||
<div class="input">
|
||||
<div class="browse_button"
|
||||
onclick="javascript: inclusion_cardform_browseScripts();"><?php echo $translation->get("browse"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<? input_select($translation->get("default_active"), "input_inclusion_default_active", $values = array('1', '0'), $value_names = array($translation->get("yes"), $translation->get("no")), $input_layout_inclusion["default_active"]); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
26
mysyde/admin/edit_layout_inclusions_listform.inc.php
Normal file
26
mysyde/admin/edit_layout_inclusions_listform.inc.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_layout_inclusions_list";
|
||||
?>
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_layout["id"] ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_inclusion_id" value="" />
|
||||
|
||||
<h2><?php echo $translation->get("edit_css_javascript_config"); ?></h2>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_inclusion', true)", "", FALSE); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_inclusion')", "", FALSE); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "loadCard('delete_inclusion', false, '{$translation->get('delete_layout_inclusion_confirm')}')", "", FALSE); ?>
|
||||
<?= button("up", $translation->get("go_up"), $formname, "loadCard('moveup_inclusion')", "", FALSE); ?>
|
||||
<?= button("down", $translation->get("go_down"), $formname, "loadCard('movedown_inclusion')", "", FALSE); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
<?
|
||||
$query = "SELECT id, type AS '" . $translation->get("type") . "', path AS '" . $translation->get("path") . "', default_active AS '" . $translation->get("default_active") . "' FROM main_layout_inclusions WHERE main_layout_id = '" . $input_layout["id"] . "' ORDER by sorting ASC";
|
||||
$format = array('option', 'text', 'text', 'boolean');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_inclusion_id", "edit_inclusion", TRUE, "update_sortorder_inclusion");
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
36
mysyde/admin/edit_layout_listform.inc.php
Normal file
36
mysyde/admin/edit_layout_listform.inc.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?
|
||||
//if (isset($_FILES['input_layout_file']) && ! $_FILES['input_layout_file']['error']) {
|
||||
// move_uploaded_file($_FILES['input_layout_file']['tmp_name'], "../../layout/frontend/" . $_FILES['input_layout_file']['name']);
|
||||
// extract_zip_file($GLOBALS["site_server_path"] . "layout/frontend/" . $_FILES['input_layout_file']['name'],"../../layout/frontend/");
|
||||
//printf("Die Datei %s steht jetzt als " . "newfile.jpg zur Verfügung.<br />\n",$_FILES['input_layout_file']['name']);
|
||||
//printf("Sie ist %u Bytes groß und vom Typ %s.<br />\n",$_FILES['input_layout_file']['size'], $_FILES['input_layout_file']['type']);
|
||||
//}
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_layout_list";
|
||||
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new', true)"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('top_layouts'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
|
||||
<?
|
||||
$query = "SELECT id, name AS '" . $translation->get("description") . "', code as '" . $translation->get("textkey") . "' from main_layout ORDER by code ASC";
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format);
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
44
mysyde/admin/edit_login_ajax.php
Normal file
44
mysyde/admin/edit_login_ajax.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
define('CMS_PATH', dirname(__FILE__) . '/../');
|
||||
include_once('../common/common_functions.inc.php');
|
||||
require_once((local_environment()) ? "../dc.config.php" : "../dc-server.config.php");
|
||||
include_once('admin_functions.inc.php');
|
||||
|
||||
// set translation
|
||||
require_once('../common/classes/Translate.php');
|
||||
|
||||
|
||||
db_connect();
|
||||
|
||||
$site = $_POST["site"];
|
||||
$lang = $_POST["language"];
|
||||
$site_code = $_POST["site_code"];
|
||||
|
||||
|
||||
$sitearray = site_getbycode($_POST["site"]);
|
||||
$siteid = $sitearray["id"];
|
||||
|
||||
$sitearray = site_getbycode($site_code);
|
||||
$site_id = $sitearray["id"];
|
||||
|
||||
|
||||
function get_languages( $site ) {
|
||||
$translation = new \DynCom\mysyde\common\classes\Translate();
|
||||
|
||||
$query = "SELECT id, name FROM main_language WHERE main_site_id = '" . $site . "'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$langs = "<option value=\"\"> " . $translation->get("please_choose") . " </option>";
|
||||
WHILE ($row = @mysqli_fetch_assoc($result)) {
|
||||
$langs .= "<option value=\"" . $row["id"] . "\">" . $row["name"] . "</option>";
|
||||
}
|
||||
return $langs;
|
||||
}
|
||||
|
||||
IF (isset($siteid) && empty($lang)) {
|
||||
$lang = get_languages($siteid);
|
||||
echo $lang;
|
||||
} ELSEIF (isset($site_code) && isset($lang)) {
|
||||
$nav = navigation_select_noecho('', $site_id, $lang);
|
||||
echo $nav;
|
||||
}
|
||||
?>
|
||||
810
mysyde/admin/edit_main_navigation.inc.php
Normal file
810
mysyde/admin/edit_main_navigation.inc.php
Normal file
@@ -0,0 +1,810 @@
|
||||
<?
|
||||
|
||||
global $parentSort;
|
||||
$parentSort = array();
|
||||
|
||||
switch ($_GET["action"]) {
|
||||
case "moveup_navigation":
|
||||
moveup_main_navigation();
|
||||
require_once("edit_main_navigation_listform.inc.php");
|
||||
break;
|
||||
case "movedown_navigation":
|
||||
movedown_main_navigation();
|
||||
require_once("edit_main_navigation_listform.inc.php");
|
||||
break;
|
||||
case "moveleft_navigation":
|
||||
moveleft_main_navigation();
|
||||
require_once("edit_main_navigation_listform.inc.php");
|
||||
break;
|
||||
case "moveright_navigation":
|
||||
moveright_main_navigation();
|
||||
require_once("edit_main_navigation_listform.inc.php");
|
||||
break;
|
||||
case "reorder_navigation":
|
||||
reorder_navigation();
|
||||
break;
|
||||
case "delete_navigation":
|
||||
delete_main_navigation();
|
||||
require_once("edit_main_navigation_listform.inc.php");
|
||||
break;
|
||||
case "edit_navigation":
|
||||
edit_main_navigation();
|
||||
break;
|
||||
case "save_navigation":
|
||||
save_main_navigation($site, $language);
|
||||
break;
|
||||
case "new_navigation":
|
||||
require_once("edit_main_navigation_cardform.inc.php");
|
||||
break;
|
||||
case "send_sitemap":
|
||||
send_sitemap();
|
||||
require_once("edit_main_navigation_listform.inc.php");
|
||||
echo $response_output_1;
|
||||
IF ($response_output_2 <> '') {
|
||||
echo $response_output_2;
|
||||
};
|
||||
break;
|
||||
case 'delete_image':
|
||||
delete_image();
|
||||
require_once("edit_main_navigation_listform.inc.php");
|
||||
break;
|
||||
default:
|
||||
require_once("edit_main_navigation_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function update_children( $_parentId, $_list, $_level ) {
|
||||
global $parentSort;
|
||||
|
||||
foreach ($_list as $site) {
|
||||
if (!array_key_exists($_parentId, $parentSort)) {
|
||||
$parentSort[$_parentId] = 1;
|
||||
}
|
||||
$query = "UPDATE main_navigation SET parent_id = " . $_parentId . ", level = " . $_level . ", sorting = " . $parentSort[$_parentId] . " WHERE id = " . (int)$site['id'];
|
||||
mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$parentSort[$_parentId]++;
|
||||
if (isset($site['children']) && count($site['children'])) {
|
||||
update_children($site['id'], $site['children'], $_level + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reorder_navigation() {
|
||||
global $parentSort;
|
||||
$list = $_POST['list'];
|
||||
if (!is_array($list) || count($list) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$level = 1;
|
||||
foreach ($list as $site) {
|
||||
if (!array_key_exists(0, $parentSort)) {
|
||||
$parentSort[0] = 1;
|
||||
}
|
||||
$query = "UPDATE main_navigation SET parent_id = NULL, level = 1, sorting = " . $parentSort[0] . " WHERE id = " . (int)$site['id'];
|
||||
mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$parentSort[0]++;
|
||||
if (isset($site['children']) && count($site['children'])) {
|
||||
update_children($site['id'], $site['children'], $level + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function send_sitemap() {
|
||||
global $response_output_1;
|
||||
global $response_output_2;
|
||||
$company = $GLOBALS["language"]["company"];
|
||||
$shop_code = $GLOBALS["language"]["shop_code"];
|
||||
$language_code = $GLOBALS["language"]["language_code"];
|
||||
$query = "SELECT main_site_id FROM main_language WHERE company = '" . $company . "' AND shop_code = '" . $shop_code . "' AND language_code = '" . $language_code . "'";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$ms_id = mysqli_result($result, 0);
|
||||
IF ($ms_id <> '') {
|
||||
$query_2 = "SELECT login_required FROM main_site WHERE id = '" . $ms_id."'";
|
||||
$result_2 = mysqli_query($GLOBALS['mysql_con'], $query_2);
|
||||
$login_required = mysqli_result($result_2, 0);
|
||||
IF ($login_required = 0) {
|
||||
$adress = "http://" . $_SERVER["SERVER_NAME"] . "/sitemap_shop.php?company=" . $company . "&shop_code=" . $shop_code . "&language_code=" . $language_code;
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, "http://www.google.com/webmasters/tools/ping?sitemap=" . urlencode($adress));
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$response_shop = curl_exec($ch);
|
||||
$goodresponse = "Sitemap Notification Received";
|
||||
$find1 = strpos($response, $goodresponse);
|
||||
if ($find1 === FALSE) {
|
||||
$response_output_2 = "<div class=\"errorbox\">Das Senden der Sitemap für den öffentlichen Shop war nicht erfolgreich. Zur erfolgreichen Übertragung muss cURL auf dem Apache-Server aktiviert sein.</div>\n";
|
||||
} else {
|
||||
$response_output_2 = "<div class=\"successbox\">Das Senden der Sitemap für den öffentlichen Shop war erfolgreich.</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$adress = "http://" . $_SERVER["SERVER_NAME"] . "/sitemap_site.php";
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, "http://www.google.com/webmasters/tools/ping?sitemap=" . urlencode($adress));
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$response = curl_exec($ch);
|
||||
$goodresponse = "Sitemap Notification Received";
|
||||
$find1 = strpos($response, $goodresponse);
|
||||
if ($find1 === FALSE) {
|
||||
$response_output_1 = "<div class=\"errorbox\">Das Senden der Sitemap für den öffentlich zugänglichen redaktionellen Teil war nicht erfolgreich. Zur erfolgreichen Übertragung muss cURL auf dem Apache-Server aktiviert sein.</div>\n";
|
||||
} else {
|
||||
$response_output_1 = "<div class=\"successbox\">Das Senden der Sitemap für den öffentlich zugänglichen redaktionellen Teil war erfolgreich.</div>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function edit_main_navigation( $_id = "", $messages = array() ) {
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} else {
|
||||
$input_id = $_REQUEST["input_main_navigation_id"];
|
||||
}
|
||||
|
||||
if ($input_id <> '') {
|
||||
$query = "SELECT * FROM main_navigation WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_main_navigation = @mysqli_fetch_array($result);
|
||||
require_once("edit_main_navigation_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("edit_main_navigation_listform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_main_navigation() {
|
||||
if ($_POST["input_main_navigation_id"] <> '') {
|
||||
$query = "DELETE FROM main_navigation WHERE id = '" . $_POST["input_main_navigation_id"] . "' LIMIT 1";
|
||||
if (@mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
// Alle Unterkategorien eine eben nach oben setzen - 02. Dezember 2009 MH
|
||||
@mysqli_query($GLOBALS['mysql_con'], "UPDATE main_navigation SET parent_id = NULL, level = level -1 WHERE parent_id = '" . $_POST["input_main_navigation_id"] . "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigationspunkt speichern
|
||||
*
|
||||
* weiterleitungstypen:
|
||||
* 1: seite zuweisen
|
||||
* 2: interne weiterleitung auf einen anderen menupunkt
|
||||
* 3: externe weiterleitung
|
||||
*
|
||||
*/
|
||||
function save_main_navigation( $site, $language ) {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$messages = array();
|
||||
|
||||
$input_id = "";
|
||||
$input_active = ($_POST["input_active"] == "on") ? 1 : 0;
|
||||
$input_hidden = 0;
|
||||
$input_forward = ($_POST["input_forward"] == "on") ? 1 : 0;
|
||||
$input_validity_from = datetosql($_POST["input_validity_from"]);
|
||||
$input_validity_to = datetosql($_POST["input_validity_to"]);
|
||||
$input_is_landing_page = ($_POST["input_is_landing_page"] == "on") ? 1 : 0;
|
||||
$description = $_POST["input_description"];
|
||||
|
||||
$forward_page_id = 0;
|
||||
$forward_url = "";
|
||||
$forward_navigation_id = 0;
|
||||
$newSite = FALSE;
|
||||
|
||||
switch ($_POST["input_forward_type"]) {
|
||||
case 1: // seite zuweisen
|
||||
$forward_page_id = $_POST['input_forward_page_id'];
|
||||
if ($forward_page_id == "new_site") {
|
||||
$newSite = TRUE;
|
||||
$forward_page_id = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: // interne weiterleitung
|
||||
$forward_navigation_id = $_POST['input_forward_navigation_id'];
|
||||
break;
|
||||
|
||||
case 3: // externe weiterleitung
|
||||
$forward_url = addhttp($_POST['input_forward_url_external']);
|
||||
break;
|
||||
|
||||
case 5: // interne pfad weiterleitung
|
||||
$forward_url = $_POST['input_forward_url'];
|
||||
break;
|
||||
}
|
||||
|
||||
if ($_POST["input_main_navigation_id"] <> '') {
|
||||
$query = "UPDATE main_navigation SET
|
||||
code = '" . strtolower (mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"])) . "',
|
||||
menu_name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_menu_name"]) . "',
|
||||
title_name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_title_name"]) . "',
|
||||
active = '" . $input_active . "',
|
||||
validity_from = " . $input_validity_from . ",
|
||||
validity_to = " . $input_validity_to . ",
|
||||
modified_date = now(),
|
||||
modified_admin_user_id = " . $GLOBALS['admin_user']['id'] . ",
|
||||
forward_type = '" . (int)$_POST["input_forward_type"] . "',
|
||||
forward_navigation_id = '" . $forward_navigation_id . "',
|
||||
forward_page_id = " . $forward_page_id . ",
|
||||
forward_url = '" . $forward_url . "',
|
||||
navigation_icon = '" . $_POST["input_navigation_icon"] . "',
|
||||
hidden = '" . $input_hidden . "',
|
||||
is_landing_page = " . $input_is_landing_page . ",
|
||||
description = '" . $description . "'
|
||||
WHERE id = '" . $_POST["input_main_navigation_id"] . "' LIMIT 1";
|
||||
|
||||
$inserted = FALSE;
|
||||
$input_id = $_REQUEST["input_main_navigation_id"];
|
||||
} else {
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_navigation WHERE main_site_id = '" . $site["id"] . "' AND main_language_id = '" . $language["id"] . "' AND level = 1 ORDER BY sorting DESC LIMIT 1");
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$curr_main_navigation = @mysqli_fetch_array($result);
|
||||
}
|
||||
$query = "INSERT INTO main_navigation (main_site_id,main_language_id,parent_id,sorting,level,code,menu_name,title_name,active,validity_from,validity_to,modified_date,modified_admin_user_id, forward_type, forward_navigation_id, forward_page_id, forward_url, navigation_icon, hidden, is_landing_page, description)
|
||||
VALUES (
|
||||
" . $site["id"] . ",
|
||||
" . $language["id"] . ",
|
||||
NULL,
|
||||
" . ($curr_main_navigation["sorting"] + 1) . ",
|
||||
1,
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_menu_name"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_title_name"]) . "',
|
||||
" . $input_active . ",
|
||||
" . $input_validity_from . ",
|
||||
" . $input_validity_to . ",
|
||||
now(),
|
||||
" . $GLOBALS['admin_user']['id'] . ",
|
||||
'" . (int)$_POST["input_forward_type"] . "',
|
||||
'" . $forward_navigation_id . "',
|
||||
'" . $forward_page_id . "',
|
||||
'" . $forward_url . "',
|
||||
'" . $_POST["input_navigation_icon"] . "',
|
||||
'" . $input_hidden . "',
|
||||
" . $input_is_landing_page . ",
|
||||
'" . $description . "'
|
||||
)";
|
||||
|
||||
$inserted = TRUE;
|
||||
}
|
||||
if (($_POST["input_code"] == '') | ($_POST["input_menu_name"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_name") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
if ($_POST["input_code"] <> urlencode($_POST["input_code"])) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_encoding") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
if (($_POST["input_forward_type"] == 2) && ($forward_navigation_id == $_POST["input_main_navigation_id"])) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("navigation_msg_error1") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if ($_POST["input_forward_type"] == 1 && $forward_page_id == 0) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("navigation_msg_error2") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_navigation WHERE main_site_id = '" . $site["id"] . "' AND main_language_id = '" . $language["id"] . "' AND code = '" . $_POST["input_code"] . "'");
|
||||
if ((@mysqli_num_rows($result) <> 0) && ($_POST["input_main_navigation_id"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_exists") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("navigation_msg_success1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("navigation_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
// saveImg
|
||||
|
||||
if(isset($_FILES) && !empty($_FILES) && $_FILES['input_image']['size'] != 0 ){
|
||||
$fileName = saveImage('input_image', $input_id);
|
||||
|
||||
$query = "UPDATE main_navigation SET
|
||||
image = '" . $fileName. "'
|
||||
|
||||
WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
}
|
||||
|
||||
// SaveImg
|
||||
|
||||
save_navigation_permission($input_id, 'mandant');
|
||||
save_navigation_permission($input_id, 'department');
|
||||
save_navigation_permission($input_id, 'role');
|
||||
save_navigation_permission($input_id, 'fachbereich');
|
||||
save_navigation_permission($input_id, 'einricht');
|
||||
|
||||
if ($newSite === TRUE) {
|
||||
$query = "INSERT INTO main_page
|
||||
(title, subtitle, meta_keywords, meta_description, main_language_id, active, modified_date, modified_user, validity_from, validity_to)
|
||||
VALUES (
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_menu_name"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_menu_name"]) . "',
|
||||
'',
|
||||
'',
|
||||
'" . $GLOBALS["language"]['id'] . "',
|
||||
1,
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
" . $input_validity_from . ",
|
||||
" . $input_validity_to . "
|
||||
)";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$page_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$query = "UPDATE main_navigation SET forward_page_id = " . $page_id . " WHERE id = " . $input_id;
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
edit_main_navigation($input_id, $messages);
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$query = "SELECT * FROM main_navigation WHERE id = '" . $_POST["input_main_navigation_id"] . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_main_navigation = @mysqli_fetch_array($result);
|
||||
}
|
||||
$input_main_navigation["code"] = $_REQUEST["input_code"];
|
||||
$input_main_navigation["menu_name"] = $_REQUEST["input_menu_name"];
|
||||
$input_main_navigation["title_name"] = $_REQUEST["input_title_name"];
|
||||
$input_main_navigation["active"] = $input_active;
|
||||
$input_main_navigation["hidden"] = 0;
|
||||
$input_main_navigation["validity_from"] = $_REQUEST["input_validity_from"];
|
||||
$input_main_navigation["validity_to"] = $_REQUEST["validity_to"];
|
||||
|
||||
$input_main_navigation["forward_type"] = $_REQUEST["input_forward_type"];
|
||||
$input_main_navigation["forward_url"] = $_REQUEST["input_forward_url"];
|
||||
$input_main_navigation["forward_navigation_id"] = $_REQUEST["input_forward_navigation_id"];
|
||||
$input_main_navigation["forward_page_id"] = $_REQUEST["input_forward_page_id"];
|
||||
require_once("edit_main_navigation_cardform.inc.php");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function show_main_navigation( $site, $language ) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_navigation WHERE main_site_id = '" . $site["id"] . "' AND main_language_id = '" . $language["id"]."'");
|
||||
$num_rows = mysqli_num_rows($result);
|
||||
if ($num_rows > 0) {
|
||||
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"linklist\"><tr>";
|
||||
echo "<td><div>" . $translation->get("name") . "</div></td>";
|
||||
echo "<td width=\"150\" align=\"left\"><div></div></td>";
|
||||
echo "<td class=\"code\" width=\"300\" align=\"left\"><div>" . $translation->get("code") . "</div></td>";
|
||||
echo "<td class=\"status\" width=\"100\" align=\"left\"><div>" . $translation->get("state") . "</div></td>";
|
||||
echo "<td class=\"changed_on\" width=\"160\" align=\"left\"><div>" . $translation->get("changed_on") . "</div></td>";
|
||||
echo "<td class=\"changed_by\" width=\"250\" align=\"left\"><div>" . $translation->get("changed_by") . "</div></td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td class=\"linklist_seperator\"></td>";
|
||||
echo "<td class=\"linklist_seperator\"></td>";
|
||||
echo "<td class=\"linklist_seperator\"></td>";
|
||||
echo "<td class=\"linklist_seperator\"></td>";
|
||||
echo "<td class=\"changed_on linklist_seperator\"></td>";
|
||||
echo "<td class=\"changed_by linklist_seperator\"></td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "</table>";
|
||||
|
||||
show_main_navigation_rek($site, $language, 0, 1, 0, $num_rows);
|
||||
|
||||
|
||||
} else {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div>";
|
||||
}
|
||||
echo "\n";
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
function show_main_navigation_rek( $site, $language, $parent_id, $level, $input_counter, $num_rows ) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$parent_id_query = ($parent_id == 0) ? " AND parent_id IS NULL" : " AND parent_id = '" . $parent_id."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_navigation WHERE main_site_id = '" . $site["id"] . "' AND main_language_id = '" . $language["id"]."'" . $parent_id_query . " ORDER BY sorting ASC");
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
if ($parent_id == 0) {
|
||||
echo "<ol class=\"linklist sortable\">";
|
||||
} else {
|
||||
echo "<ol>";
|
||||
}
|
||||
|
||||
while ($main_navigation = @mysqli_fetch_array($result)) {
|
||||
$parentclass = "";
|
||||
if ($level > 1) {
|
||||
|
||||
$parentclass = " data-tt-parent-id=\"{$main_navigation['parent_id']}\"";
|
||||
}
|
||||
|
||||
$modified_array = explode(" ", $main_navigation["modified_date"]);
|
||||
$modified_date = $modified_array[0];
|
||||
$modified_time = $modified_array[1];
|
||||
|
||||
$checkedRow = "false";
|
||||
if (isset($_REQUEST['input_main_navigation_id']) && $_REQUEST['input_main_navigation_id'] == $main_navigation['id']) {
|
||||
$checkedRow = "true";
|
||||
}
|
||||
|
||||
echo "<li id=\"list_{$main_navigation['id']}\">";
|
||||
echo "<div data-inputid=\"" . $main_navigation['id'] . "\" data-action=\"edit_navigation\" data-inputname=\"input_main_navigation_id\" data-checked=\"" . $checkedRow . "\" class=\"linklist_content dd-handle\"><span class=\"disclose\"><span> </span></span>" . htmlentities($main_navigation["menu_name"], ENT_COMPAT, "UTF-8") . "<div class=\"dd-icon\"></div>";
|
||||
echo "<div class=\"dd-code\">" . $main_navigation["code"] . "</div>";
|
||||
echo "<div class=\"dd-status\">" . ($main_navigation["active"] == 1 ? $translation->get("active") : $translation->get("inactive")) . "</div>";
|
||||
echo "<div class=\"dd-gaendert-am\">" . datefromsql($modified_date) . " " . $modified_time . "</div>";
|
||||
echo "<div class=\"dd-gaendert-von\">" . navigation_get_modified_admin_user($main_navigation['modified_admin_user_id']) . "</div></div>";
|
||||
$input_counter++;
|
||||
$input_counter = show_main_navigation_rek($site, $language, $main_navigation["id"], ($level + 1), $input_counter, $num_rows);
|
||||
echo "</li>";
|
||||
}
|
||||
echo "</ol>";
|
||||
}
|
||||
|
||||
return $input_counter;
|
||||
}
|
||||
function create_preview_select($input_main_navigation)
|
||||
{
|
||||
require MODULE_PATH . '/forwarding/forwarding_config.inc.php';
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
echo "<div class\"icon-select-container\">";
|
||||
|
||||
echo "<div class=\"label\"><label for=\"forward_icon\">Icon auswählen</label></div>";
|
||||
|
||||
echo "<div class\"input\">";
|
||||
echo "<select style=\"float:left;\" id=\"navigation_icon\" class=\"code\" type=\"text\" name=\"input_navigation_icon\" >";
|
||||
|
||||
foreach ($forwarding_icon_images as $key => $data) {
|
||||
$selected_text = ($key == $input_main_navigation["navigation_icon"]) ? " selected=\"selected\"" : "";
|
||||
echo "<option value=\"" . $key . "\" $selected_text>" . $data["name"] . "</option>";
|
||||
$value++;
|
||||
}
|
||||
echo "</select>";
|
||||
|
||||
echo "<div class=\"dropdownPreview\" data-image=\"" . $input_main_navigation['navigation_icon'] . "\" style=\"float:left\" ></div>";
|
||||
echo "</div>";
|
||||
echo "</div>";
|
||||
}
|
||||
/*
|
||||
function show_main_navigation_tr($main_navigation, $level, $input_counter, $num_rows) {
|
||||
$count = 1;
|
||||
while($count < ($level)) {
|
||||
$spaces .= "";
|
||||
$count++;
|
||||
}
|
||||
|
||||
$parentclass="";
|
||||
if($level > 1) {
|
||||
$parentclass = " data-tt-parent-id=\"{$main_navigation['parent_id']}\"";
|
||||
}
|
||||
|
||||
$modified_array = explode(" ",$main_navigation["modified_date"]);
|
||||
$modified_date = $modified_array[0];
|
||||
$modified_time = $modified_array[1];
|
||||
$input_arr_text = ($num_rows > 1) ? "[" . $input_counter . "]" : "";
|
||||
// echo "<tr class=\"treegrid-{$main_navigation['id']}{$parentclass}\" onClick=\"document.form_edit_main_navigation_list.input_main_navigation_id" . $input_arr_text . ".checked = true;\">\n";
|
||||
// echo "<tr class=\"linklist_content\" data-sorting=\"{$main_navigation['sorting']}\" data-tt-id=\"{$main_navigation['id']}\"{$parentclass} data-checked=\"false\" data-inputname=\"input_main_navigation_id\" data-action=\"edit\" data-inputid=\"{$main_navigation['id']}\">\n";
|
||||
// $selected = ($main_navigation["id"]==$_POST["input_main_navigation_id"]) ? " checked=\"checked\"" : "";
|
||||
// //echo "<td style=\"width: 25px; text-align: center;\"><input" . $selected . " style=\"width: 14px; height: 14px; padding: 0px; margin: 0px;\" id=\"input_main_navigation_id\" name=\"input_main_navigation_id\" type=\"radio\" value=\"" . $main_navigation["id"] . "\" /></td>\n";
|
||||
// echo ($level==1) ? "<td><span class=\"folder\">" . $spaces . htmlentities($main_navigation["menu_name"], ENT_COMPAT, "UTF-8") . "</span></td>\n" : "<td><span class=\"folder\">" . $spaces . htmlentities($main_navigation["menu_name"], ENT_COMPAT, "UTF-8") . "</span></td>\n";
|
||||
// echo "<td>" . $main_navigation["code"] . "</td>\n";
|
||||
// echo "<td>"; echo ($main_navigation["active"]) ? "Aktiv" : "Inaktiv"; echo "</td>\n";
|
||||
// echo "<td>" . datefromsql($main_navigation["validity_from"]) . " - " . datefromsql($main_navigation["validity_to"]) . "</td>\n";
|
||||
// echo "<td>". datefromsql($modified_date) . ", ".$modified_time." von ".navigation_get_modified_admin_user($main_navigation['modified_admin_user_id'])."</td>\n";
|
||||
// echo "<td style=\"display:none;\">{$main_navigation['sorting']}</td>";
|
||||
// echo "</tr>";
|
||||
// echo "<tr class=\"droppableSpacer\" data-sorting=\"{$main_navigation['sorting']}\" data-tt-id=\"drop_{$main_navigation['id']}\"{$parentclass}><td></td><td></td><td></td><td></td><td></td><td style=\"display:none;\">{$main_navigation['sorting']}</td></tr>";
|
||||
|
||||
echo "<li>" . $spaces . htmlentities($main_navigation["menu_name"], ENT_COMPAT, "UTF-8") . "</li>";
|
||||
}
|
||||
*/
|
||||
|
||||
function moveup_main_navigation() {
|
||||
move_navigation_vertical("<", "DESC", $_POST["input_main_navigation_id"]);
|
||||
}
|
||||
|
||||
function movedown_main_navigation() {
|
||||
move_navigation_vertical(">", "ASC", $_POST["input_main_navigation_id"]);
|
||||
}
|
||||
|
||||
function move_navigation_vertical( $way, $order, $main_navigation_id ) {
|
||||
$query = "SELECT * FROM main_navigation WHERE id = '" . $main_navigation_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$curr_main_navigation = @mysqli_fetch_array($result);
|
||||
}
|
||||
$parent_query = ($curr_main_navigation["parent_id"] <> '') ? " parent_id = '" . $curr_main_navigation["parent_id"]."'" : " parent_id IS NULL";
|
||||
$query = "SELECT * FROM main_navigation WHERE main_site_id = '" . $curr_main_navigation["main_site_id"] . "' AND main_language_id = '" . $curr_main_navigation["main_language_id"] . "' AND" . $parent_query . " AND sorting " . $way . " " . $curr_main_navigation["sorting"] . " ORDER BY sorting " . $order . " LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$change_main_navigation = @mysqli_fetch_array($result);
|
||||
}
|
||||
if (($curr_main_navigation["id"] <> '') && ($change_main_navigation["id"] <> '')) {
|
||||
$query = "UPDATE main_navigation SET sorting = " . $change_main_navigation["sorting"] . " WHERE id = " . $curr_main_navigation["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$query = "UPDATE main_navigation SET sorting = " . $curr_main_navigation["sorting"] . " WHERE id = " . $change_main_navigation["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
|
||||
function moveleft_main_navigation() {
|
||||
$query = "SELECT * FROM main_navigation WHERE id = '" . $_POST["input_main_navigation_id"] . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$curr_main_navigation = @mysqli_fetch_array($result);
|
||||
}
|
||||
$query = "SELECT * FROM main_navigation WHERE id = '" . $curr_main_navigation["parent_id"] . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$parent_main_navigation = @mysqli_fetch_array($result);
|
||||
}
|
||||
$query = "SELECT * FROM main_navigation WHERE parent_id = '" . $curr_main_navigation["parent_id"] . "' ORDER BY sorting DESC LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$last_child_main_navigation = @mysqli_fetch_array($result);
|
||||
}
|
||||
|
||||
if (($curr_main_navigation["id"] <> '') && ($parent_main_navigation["id"] <> '')) {
|
||||
// Eigentlichen Menüeintrag aktualisieren
|
||||
if ($parent_main_navigation["parent_id"] == '') {
|
||||
$parent_main_navigation["parent_id"] = "NULL";
|
||||
}
|
||||
$query = "UPDATE main_navigation SET parent_id = " . $parent_main_navigation["parent_id"] . ", level = " . $parent_main_navigation["level"] . ", sorting = " . ($parent_main_navigation["sorting"] + 1) . " WHERE id = " . $curr_main_navigation["id"];
|
||||
if (@mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
// Level der ursprünglichen Untermenüpunkte aktualisieren
|
||||
update_main_navigation_children($curr_main_navigation["id"], "-");
|
||||
// Parent-ID und Sortierung der neuen Untermenüpunkte aktualisieren
|
||||
$parent_query = ($curr_main_navigation["parent_id"] <> '') ? " parent_id = '" . $curr_main_navigation["parent_id"]."'" : " parent_id IS NULL";
|
||||
$query = "SELECT * FROM main_navigation WHERE" . $parent_query . " AND sorting > " . $curr_main_navigation["sorting"] . " AND main_site_id = '" . $GLOBALS["site"]["id"] . "' AND main_language_id = '" . $GLOBALS["language"]["id"]."'";
|
||||
$new_sorting = 1;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
while ($main_navigation = @mysqli_fetch_array($result)) {
|
||||
$query = "UPDATE main_navigation SET parent_id = " . $curr_main_navigation["id"] . ", sorting = " . $new_sorting . " WHERE id = " . $main_navigation["id"] . " LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$new_sorting++;
|
||||
}
|
||||
}
|
||||
// Sortierung der neuen Nachfolger aktualisieren
|
||||
$new_sorting = $parent_main_navigation["sorting"] + 1;
|
||||
$parent_query = ($parent_main_navigation["parent_id"] <> 'NULL') ? " parent_id = '" . $parent_main_navigation["parent_id"]."'" : " parent_id IS NULL";
|
||||
$query = "SELECT * FROM main_navigation WHERE" . $parent_query . " AND id <> " . $curr_main_navigation["id"] . " AND sorting >= " . $new_sorting . " AND main_site_id = " . $GLOBALS["site"]["id"] . " AND main_language_id = " . $GLOBALS["language"]["id"];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
while ($main_navigation = @mysqli_fetch_array($result)) {
|
||||
$new_sorting++;
|
||||
$query = "UPDATE main_navigation SET sorting = " . $new_sorting . " WHERE id = " . $main_navigation["id"] . " LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function moveright_main_navigation() {
|
||||
$query = "SELECT * FROM main_navigation WHERE id = '" . $_POST["input_main_navigation_id"] . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$curr_main_navigation = @mysqli_fetch_array($result);
|
||||
}
|
||||
$parent_query = ($curr_main_navigation["parent_id"] <> '') ? " parent_id = '" . $curr_main_navigation["parent_id"]."'" : " parent_id IS NULL";
|
||||
$query = "SELECT * FROM main_navigation WHERE" . $parent_query . " AND sorting < " . $curr_main_navigation["sorting"] . " AND main_site_id = " . $GLOBALS["site"]["id"] . " AND main_language_id = " . $GLOBALS["language"]["id"] . " ORDER BY sorting DESC LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$pre_main_navigation = @mysqli_fetch_array($result);
|
||||
}
|
||||
$query = "SELECT * FROM main_navigation WHERE parent_id = '" . $pre_main_navigation["id"] . "' ORDER BY sorting DESC LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$lastprechild_main_navigation = @mysqli_fetch_array($result);
|
||||
}
|
||||
if (($curr_main_navigation["id"] <> '') && ($pre_main_navigation["id"] <> '')) {
|
||||
// Eigentlichen Menüeintrag aktualisieren
|
||||
if ($lastprechild_main_navigation["sorting"] == '') {
|
||||
$lastprechild_main_navigation["sorting"] = 0;
|
||||
}
|
||||
$query = "UPDATE main_navigation SET parent_id = " . $pre_main_navigation["id"] . ", level = " . ($curr_main_navigation["level"] + 1) . ", sorting = " . ($lastprechild_main_navigation["sorting"] + 1) . " WHERE id = " . $curr_main_navigation["id"] . " AND main_site_id = " . $GLOBALS["site"]["id"] . " AND main_language_id = " . $GLOBALS["language"]["id"];
|
||||
if (@mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
// Level der ursprünglichen Untermenüpunkte aktualisieren
|
||||
update_main_navigation_children($curr_main_navigation["id"], "+");
|
||||
|
||||
// Sortierung der neuen Nachfolger aktualisieren
|
||||
$new_sorting = $curr_main_navigation["sorting"];
|
||||
$parent_query = ($curr_main_navigation["parent_id"] <> '') ? " parent_id = " . $curr_main_navigation["parent_id"] : " parent_id IS NULL";
|
||||
$query = "SELECT * FROM main_navigation WHERE" . $parent_query . " AND sorting >= " . $new_sorting . " AND main_site_id = " . $GLOBALS["site"]["id"] . " AND main_language_id = " . $GLOBALS["language"]["id"];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
while ($main_navigation = @mysqli_fetch_array($result)) {
|
||||
$query = "UPDATE main_navigation SET sorting = " . $new_sorting . " WHERE id = " . $main_navigation["id"] . " LIMIT 1";
|
||||
$new_sorting++;
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function update_main_navigation_children( $main_navigation_id, $way ) {
|
||||
$query = "SELECT * FROM main_navigation WHERE parent_id = '" . $main_navigation_id."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
while ($main_navigation = @mysqli_fetch_array($result)) {
|
||||
$query = "UPDATE main_navigation SET level = level " . $way . " 1 WHERE id = " . $main_navigation["id"] . " LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
update_main_navigation_children($main_navigation["id"], $way);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function insert_main_navigation2( $site, $language ) {
|
||||
if ($_POST["input_menu_name"] <> '') {
|
||||
if ($_POST["input_main_navigation_id"] <> '') {
|
||||
$query = "SELECT * FROM main_navigation WHERE id = '" . $_POST["input_main_navigation_id"] . "' LIMIT 1";
|
||||
} else {
|
||||
$query = "SELECT * FROM main_navigation WHERE main_site_id = '" . $site["id"] . "' AND main_language_id = '" . $language["id"] . "' AND level = 1 ORDER BY sorting DESC LIMIT 1";
|
||||
}
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$curr_main_navigation = @mysqli_fetch_array($result);
|
||||
$query = "INSERT INTO main_navigation (id, main_site_id, main_language_id, parent_id, sorting, level, code, menu_name, title_name, active)
|
||||
VALUES (NULL,
|
||||
" . $curr_main_navigation["main_site_id"] . ",
|
||||
" . $curr_main_navigation["main_language_id"] . ",
|
||||
NULL,
|
||||
" . ($curr_main_navigation["sorting"] + 1) . ",
|
||||
" . $curr_main_navigation["main_site_id"] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_menu_name"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_menu_name"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_menu_name"]) . "',
|
||||
'1'
|
||||
)";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function saveImage($filekey = 'input_image', $input_id) {
|
||||
$erlaubte_endungen = array("jpg", "jpeg", "gif", "png", "svg", "webp");
|
||||
$filename = strtolower($_FILES[$filekey]['name']);
|
||||
$filename_expl = explode(".", $filename);
|
||||
if (!in_array($filename_expl[count($filename_expl) - 1], $erlaubte_endungen)) {
|
||||
$messages = "<div class='errorbox'>" . $translation->get("error_slideshow_line2") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
$saveFilename = $input_id . "_" . time() . "_" . cleanFilename($_FILES[$filekey]['name']);
|
||||
define("PATH_NAVIGATON", "../../userdata/navigation/");
|
||||
move_uploaded_file($_FILES[$filekey]['tmp_name'], PATH_NAVIGATON . $saveFilename);
|
||||
|
||||
return $saveFilename;
|
||||
|
||||
}
|
||||
function delete_image() {
|
||||
$nav_id = $_POST['input_main_navigation_id'];
|
||||
$query = "SELECT * FROM main_navigation WHERE id =".$nav_id." LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$nav = @mysqli_fetch_array($result);
|
||||
if(!empty($nav)){
|
||||
$filename = $nav['image'];
|
||||
define("PATH_NAVIGATON", "../../userdata/navigation/");
|
||||
|
||||
if (file_exists(PATH_NAVIGATON . $filename)) {
|
||||
unlink(PATH_NAVIGATON . $filename);
|
||||
}
|
||||
$query = "UPDATE main_navigation SET
|
||||
image = ''
|
||||
WHERE id = '" . $nav_id . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
|
||||
function multi_select_permission($navigation_id, $type){
|
||||
try {
|
||||
//code...
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
if ($type == "einricht") {
|
||||
$query = "SELECT * FROM organigramm_einricht";
|
||||
}elseif($type == "fachbereich"){
|
||||
$query = "SELECT * FROM organogramm_space";
|
||||
}else {
|
||||
$query = "SELECT * FROM main_".$type;
|
||||
}
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
$preselect = array();
|
||||
|
||||
$query2 = "SELECT * FROM main_navigation_".$type." WHERE main_navigation_id = '".$navigation_id . "'";
|
||||
$result2 = @mysqli_query($GLOBALS['mysql_con'], $query2);
|
||||
$allselect = array();
|
||||
while($row2 = @mysqli_fetch_array($result2)){
|
||||
array_push($preselect,$row2['main_'.$type.'_id']);
|
||||
}
|
||||
?>
|
||||
<div class="label"><?= $translation->get("top_".$type)?></div>
|
||||
<div class="websites bc-select-ui ui fluid multiple search selection dropdown type_<?= $type ?>" style="clear:both;display:inline-block;">
|
||||
<input type="hidden" name="select_permission_<?= $type ?>">
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="default text"><?= $translation->get("top_".$type)?></div>
|
||||
<div class="menu">
|
||||
<?
|
||||
while($row = @mysqli_fetch_array($result)) {
|
||||
array_push($allselect, $row['id']);
|
||||
echo "<div class=\"item\" data-value=\"{$row['id']}\">".$row["description"]."</div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="all_mandants" id="<?php echo "all_".$type; ?>"><?php echo $translation->get("all_get_".$type)?></div>
|
||||
<script type="text/javascript" src="/plugins/jquery/jquery-3.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="/plugins/Semantic-UI-master/semantic.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/plugins/Semantic-UI-master/bc-semantic.css?time=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/plugins/Semantic-UI-master/bc-semantic.css')?>">
|
||||
<script>
|
||||
var $y = jQuery.noConflict();
|
||||
$y( document ).ready(function() {
|
||||
$y('.websites.ui.fluid.multiple.dropdown.type_<?= $type ?>').dropdown('set selected', <?= json_encode($preselect) ?>);
|
||||
});
|
||||
$("<?php echo "#all_".$type;?>").click(function() {
|
||||
$y('.websites.ui.fluid.multiple.dropdown.type_<?= $type ?>').dropdown('set selected', <?= json_encode($allselect) ?>);
|
||||
});
|
||||
</script>
|
||||
<?
|
||||
} catch (\Throwable $th) {
|
||||
echo $th;
|
||||
}
|
||||
}
|
||||
|
||||
// function save_navigation_permission($navigation_id, $type){
|
||||
// $type_ids = explode(',', $_POST['select_permission_'.$type]);
|
||||
// if(!empty($type_ids) && gettype($type_ids) == 'array') {
|
||||
// $deleteQuery = @mysqli_query($GLOBALS["mysql_con"], "DELETE FROM main_navigation_permission WHERE main_navigation_id = '".$navigation_id . "' AND type = '".$type."'");
|
||||
// foreach($type_ids as $key => $permission_type_id){
|
||||
// $query = "INSERT INTO main_navigation_permission
|
||||
// (main_navigation_id, permission_type_id, type)
|
||||
// VALUES (
|
||||
// '" . $navigation_id ."',
|
||||
// '" . $permission_type_id . "',
|
||||
// '" . $type . "'
|
||||
// )";
|
||||
// @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
function save_navigation_permission($navigation_id, $type){
|
||||
$type_ids = explode(',', $_POST['select_permission_'.$type]);
|
||||
$type_array = array(
|
||||
"role" => "main_role_id",
|
||||
"mandant" => "main_mandant_id",
|
||||
"department" => "main_department_id",
|
||||
"fachbereich" => "main_fachbereich_id",
|
||||
"einricht" => "main_einricht_id"
|
||||
);
|
||||
|
||||
if(!empty($type_ids) && gettype($type_ids) == 'array') {
|
||||
$deleteQuery = @mysqli_query($GLOBALS["mysql_con"], "DELETE FROM main_navigation_".$type." WHERE main_navigation_id = '".$navigation_id . "'");
|
||||
foreach($type_ids as $key => $permission_type_id){
|
||||
// echo var_dump($permission_type_id);
|
||||
if ($permission_type_id != "") {
|
||||
$query = "INSERT INTO main_navigation_".$type."
|
||||
( ".$type_array[$type].", main_navigation_id)
|
||||
VALUES (
|
||||
'" . $permission_type_id . "',
|
||||
'" . $navigation_id ."'
|
||||
|
||||
)";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
140
mysyde/admin/edit_main_navigation_cardform.inc.php
Normal file
140
mysyde/admin/edit_main_navigation_cardform.inc.php
Normal file
@@ -0,0 +1,140 @@
|
||||
<? $formname = "form_edit_main_navigation_card";
|
||||
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
|
||||
$main_navigation_id = $input_main_navigation["id"];
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
// echo var_dump($GLOBALS);
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function select_forwardtype( value ) {
|
||||
$('#select_navigation_id, #select_page_id, #external_url, #insert_path').hide();
|
||||
value = parseInt(value);
|
||||
switch (value) {
|
||||
case 1:
|
||||
$('#select_page_id').show();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$('#select_navigation_id').show();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$('#external_url').show();
|
||||
break;
|
||||
|
||||
case 5:
|
||||
$('#insert_path').show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_main_navigation["id"] == "") {
|
||||
echo $translation->get("new_menuitem_headline");
|
||||
} else {
|
||||
echo $translation->get("edit_menuitem");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_navigation', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save_navigation', true, '', true)"); ?>
|
||||
<li>
|
||||
<ul>
|
||||
|
||||
<?php
|
||||
if ($input_main_navigation["id"] != "") {
|
||||
|
||||
if ($input_main_navigation['forward_type'] == 1 && $input_main_navigation['forward_page_id'] > 0) {
|
||||
button("edit", $translation->get("edit_site"), $formname, "gotoLocation('" . get_menu_link('structure/sites', $GLOBALS["site"], $GLOBALS["language"], "?action=open_card_page&input_page_id=" . $input_main_navigation['forward_page_id']) . "')", "", FALSE);
|
||||
}
|
||||
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_navigation', true, '{$translation->get('delete_navitem_confirm')}', true)", "", FALSE);
|
||||
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_main_navigation_id" type="hidden" value="<?= $input_main_navigation["id"] ?>">
|
||||
<input name="input_main_layout_id" type="hidden" value="<?= $main_layout_id ?>">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("textkey"), "input_code", "code", $input_main_navigation["code"], 20) ?>
|
||||
<? input($translation->get("name"), "input_menu_name", "text", $input_main_navigation["menu_name"], 100) ?>
|
||||
<br />
|
||||
<?php input_select($translation->get("use_menuitem_for"), "input_forward_type", array(0 => "1", 1 => "2", 2 => "3", 3 => "4", 4 => "5"), array(0 => $translation->get("assign_page"), 1 => $translation->get("internal_forward"), 2 => $translation->get("external_forward"), 3 => $translation->get("placeholder"), 4 => $translation->get("internal_path_forward")), $input_main_navigation['forward_type'], FALSE, FALSE, 'onchange="select_forwardtype(this.value);"') ?>
|
||||
<div
|
||||
id="select_navigation_id" <?php echo $input_main_navigation['forward_type'] != 2 ? 'style="display:none;"' : ''; ?>>
|
||||
<? navigation_select($translation->get("choose_navigation_item"), "input_forward_navigation_id", $input_main_navigation["forward_navigation_id"], $GLOBALS["site"]['id'], $GLOBALS["language"]['id'], FALSE); ?>
|
||||
</div>
|
||||
|
||||
<div
|
||||
id="select_page_id" <?php echo $input_main_navigation['forward_type'] != 1 && $input_main_navigation['forward_type'] != 0 ? 'style="display:none;"' : ''; ?>>
|
||||
<? page_select($translation->get("choose_page"), "input_forward_page_id", $input_main_navigation, FALSE); ?>
|
||||
</div>
|
||||
|
||||
<div
|
||||
id="external_url" <?php echo $input_main_navigation['forward_type'] != 3 ? 'style="display:none;"' : ''; ?>>
|
||||
<? input($translation->get("external_url"), "input_forward_url_external", "text", $input_main_navigation["forward_url"], 255) ?>
|
||||
</div>
|
||||
|
||||
<div id="insert_path" <?php echo $input_main_navigation['forward_type'] != 5 ? 'style="display:none;"' : ''; ?>>
|
||||
<? input($translation->get("internal_url"), "input_forward_url", "text", $input_main_navigation["forward_url"], 255) ?>
|
||||
</div>
|
||||
<? create_preview_select($input_main_navigation) ?>
|
||||
|
||||
<!-- <? input($translation->get("description"), "input_description", "textarea", $input_main_navigation["description"]) ?> -->
|
||||
<!-- <? input($translation->get("image"), "input_image", "file", $input_main_navigation["image"], 45, $disabled);
|
||||
$valFile = '';
|
||||
if($input_main_navigation['image'] != '' && $input_main_navigation['image'] != NULL){
|
||||
$valFile = $input_main_navigation['image'];
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="input_image_old" value="<?=$valFile;?>"> -->
|
||||
<!-- <?php
|
||||
// if($input_main_navigation["image"] != NULL && $input_main_navigation["image"] != ''){
|
||||
// echo "<div class='img_container navigation_image'><img class='img-fluid' src='/userdata/navigation/".$input_main_navigation["image"]."'></div>";
|
||||
// echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_image', true, '{$translation->get('delete_image')}', false)", "", FALSE);
|
||||
// }
|
||||
?> -->
|
||||
</td>
|
||||
<td style="display:block;">
|
||||
<? input($translation->get("active"), "input_active", "checkbox", $input_main_navigation["active"]) ?>
|
||||
<? input($translation->get("validity_from"), "input_validity_from", "date", datefromsql($input_main_navigation["validity_from"]), 10) ?>
|
||||
<? input($translation->get("validity_to"), "input_validity_to", "date", datefromsql($input_main_navigation["validity_to"]), 10) ?>
|
||||
<h3>Filtern für:</h3>
|
||||
<?php
|
||||
try {
|
||||
//code...
|
||||
|
||||
multi_select_permission($input_main_navigation['id'], 'mandant');
|
||||
multi_select_permission($input_main_navigation['id'], 'department');
|
||||
multi_select_permission($input_main_navigation['id'], 'role');
|
||||
multi_select_permission($input_main_navigation['id'], 'einricht');
|
||||
multi_select_permission($input_main_navigation['id'], 'fachbereich');
|
||||
} catch (\Throwable $th) {
|
||||
echo $th;
|
||||
}
|
||||
?>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
118
mysyde/admin/edit_main_navigation_listform.inc.php
Normal file
118
mysyde/admin/edit_main_navigation_listform.inc.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_edit_main_navigation_list";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new_menuitem"), $formname, "loadCard('new_navigation', true)"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_navigation'); ?></h1>
|
||||
|
||||
<form id="<?php echo $formname; ?>" name="<?php echo $formname; ?>" method="post">
|
||||
<div class="requestLoader"></div>
|
||||
<input type="hidden" class="selected_linklist_row" name="input_main_navigation_id" value="" />
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="requestLoader"></div>
|
||||
<div id="page_linklist">
|
||||
<?
|
||||
// $query = "SELECT id, menu_name AS '".$translation->get("name")."', code, active AS ".$translation->get("state").", modified_date as '".$translation->get("changed_on")."', modified_admin_user_id AS '".$translation->get("changed_by")."' FROM main_navigation WHERE main_site_id = '" . $site["id"] . "' AND main_language_id = '" . $language["id"]."'";
|
||||
|
||||
// $result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
// $num_rows = mysqli_num_rows($result);
|
||||
|
||||
// $format = array('option', 'text', 'text','boolean_active','text','text');
|
||||
// if($num_rows > 0) {
|
||||
// // linklist($result,"form_page_list",$format, "input_page_id", "edit_content_page");
|
||||
// linklist($result, $formname, $format, "input_main_navigation_id", "edit_navigation", TRUE, "reorder_navigation", "sendRequest('delete_navigation', false, '{$translation->get('delete_collection_confirm')}')");
|
||||
// } else {
|
||||
// echo "<div class=\"infobox\">" . $translation->get("no_rows_found") . "</div>";
|
||||
// }
|
||||
show_main_navigation($site, $language);
|
||||
?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var reorderCall = null;
|
||||
var dragEnabled = false;
|
||||
|
||||
function toggleDragDrop( _aTag ) {
|
||||
if (dragEnabled === false) {
|
||||
dragEnabled = true;
|
||||
$('ol.sortable').addClass("enabled");
|
||||
$('ol.sortable').nestedSortable("option", "disabled", false);
|
||||
$(_aTag).html("<?php echo $translation->get('disable_drag_drop'); ?>");
|
||||
} else {
|
||||
dragEnabled = false;
|
||||
$('ol.sortable').removeClass("enabled");
|
||||
$('ol.sortable').nestedSortable("option", "disabled", true);
|
||||
$(_aTag).html("<?php echo $translation->get('enable_drag_drop'); ?>");
|
||||
}
|
||||
}
|
||||
|
||||
//$('.dd').nestable({ /* config options */ });
|
||||
$('ol.sortable').nestedSortable({
|
||||
forcePlaceholderSize: true,
|
||||
handle : '.dd-icon',
|
||||
helper : 'clone',
|
||||
items : 'li',
|
||||
opacity : .6,
|
||||
placeholder : 'placeholder',
|
||||
revert : 250,
|
||||
tabSize : 25,
|
||||
tolerance : 'pointer',
|
||||
toleranceElement : '> div',
|
||||
maxLevels : 5,
|
||||
isTree : true,
|
||||
expandOnHover : 1000,
|
||||
cookieIndex : 'nestedSortable_expanded',
|
||||
startCollapsed : true,
|
||||
stop : function ( event, ui ) {
|
||||
reorder_navigation();
|
||||
store_expanded();
|
||||
},
|
||||
disabled : false
|
||||
});
|
||||
|
||||
$('.disclose').click(function () {
|
||||
$(this).closest('li').toggleClass('mjs-nestedSortable-collapsed').toggleClass('mjs-nestedSortable-expanded');
|
||||
store_expanded();
|
||||
});
|
||||
|
||||
function store_expanded() {
|
||||
var list = [];
|
||||
$('ol.sortable').find('li.mjs-nestedSortable-expanded').each(function () {
|
||||
list.push($(this).attr("id"));
|
||||
});
|
||||
$.cookie('nestedSortable_expanded', list.join(','));
|
||||
}
|
||||
|
||||
function reorder_navigation() {
|
||||
if (reorderCall !== null) {
|
||||
reorderCall.abort();
|
||||
}
|
||||
|
||||
serialized = $('ol.sortable').nestedSortable('serialize');
|
||||
arraied = $('ol.sortable').nestedSortable('toHierarchy', {startDepthCount: 0});
|
||||
var parameter = {
|
||||
list: arraied
|
||||
};
|
||||
reorderCall = jQuery.post("?action=reorder_navigation", parameter, function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/dc/");
|
||||
} else {
|
||||
console.log(output);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.dd-status:contains("Inaktiv")').parent().addClass("inactiveSitecontent");
|
||||
|
||||
|
||||
</script>
|
||||
132
mysyde/admin/edit_navigation_has_sitepart.inc.php
Normal file
132
mysyde/admin/edit_navigation_has_sitepart.inc.php
Normal file
@@ -0,0 +1,132 @@
|
||||
<?
|
||||
if ($_GET["sitepart"] <> '') {
|
||||
$_POST["input_navigation_has_sitepart_id"] = $_GET["sitepart"];
|
||||
$_GET["action"] = "edit_navigation_has_sitepart";
|
||||
}
|
||||
$query = "SELECT * FROM main_navigation WHERE id = '" . $_GET["frontend_nav"] . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$frontend_navigation = @mysqli_fetch_array($result);
|
||||
|
||||
switch ($_GET["action"]) {
|
||||
case "new_navigation_has_sitepart":
|
||||
insert_navigation_has_sitepart($frontend_navigation);
|
||||
break;
|
||||
case "edit_navigation_has_sitepart":
|
||||
edit_navigation_has_sitepart($frontend_navigation);
|
||||
break;
|
||||
case "save_navigation_has_sitepart":
|
||||
save_navigation_has_sitepart($frontend_navigation);
|
||||
break;
|
||||
case "delete_navigation_has_sitepart":
|
||||
delete_navigation_has_sitepart($frontend_navigation);
|
||||
break;
|
||||
case "moveup_navigation_has_sitepart":
|
||||
moveup_navigation_has_sitepart();
|
||||
require_once("edit_navigation_has_sitepart_listform.inc.php");
|
||||
break;
|
||||
case "movedown_navigation_has_sitepart":
|
||||
movedown_navigation_has_sitepart();
|
||||
require_once("edit_navigation_has_sitepart_listform.inc.php");
|
||||
break;
|
||||
default:
|
||||
require_once("edit_navigation_has_sitepart_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function edit_navigation_has_sitepart( $frontend_navigation ) {
|
||||
$query = "SELECT *, main_navigation_has_sitepart.id AS navigation_has_sitepart_id FROM main_navigation_has_sitepart LEFT JOIN main_sitepart ON main_navigation_has_sitepart.main_sitepart_id = main_sitepart.id WHERE main_navigation_has_sitepart.id = '" . $_POST["input_navigation_has_sitepart_id"]."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_navigation_has_sitepart = @mysqli_fetch_array($result);
|
||||
require_once("edit_navigation_has_sitepart_cardform.inc.php");
|
||||
} else {
|
||||
require_once("edit_navigation_has_sitepart_listform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function save_navigation_has_sitepart( $frontend_navigation ) {
|
||||
if ($_POST["input_navigation_has_sitepart_id"] == '') {
|
||||
$error = TRUE;
|
||||
}
|
||||
if (!$error) {
|
||||
$active = ($_POST["input_active"] == "on") ? 1 : 0;
|
||||
$query = "UPDATE main_navigation_has_sitepart SET user_description = '" . $_POST["input_user_description"] . "', active = " . $active . ", modified_date = now(), value_1 = '" . $_POST["input_value_1"] . "', value_2 = '" . $_POST["input_value_2"] . "', value_3 = '" . $_POST["input_value_3"] . "', value_4 = '" . $_POST["input_value_4"] . "', value_5 = '" . $_POST["input_value_5"] . "', layout_area_id = '" . $_POST["input_layout_area_id"] . "' WHERE id = '" . $_POST["input_navigation_has_sitepart_id"] . "' LIMIT 1";
|
||||
if (@mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
$query_navigation = "SELECT main_navigation_id FROM main_navigation_has_sitepart WHERE id = '" . $_POST["input_navigation_has_sitepart_id"] . "'";
|
||||
$result_navigation = @mysqli_query($GLOBALS['mysql_con'], $query_navigation);
|
||||
if ($result_navigation) {
|
||||
$val = @mysqli_fetch_array($result_navigation);
|
||||
$query_update_navigation = "UPDATE main_navigation SET modified_date = NOW(), modified_admin_user_id = " . $GLOBALS['admin_user']['id'] . " WHERE id = " . $val['main_navigation_id'] . "";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query_update_navigation);
|
||||
}
|
||||
}
|
||||
require_once("edit_navigation_has_sitepart_listform.inc.php");
|
||||
} else {
|
||||
$query = "SELECT *, main_navigation_has_sitepart.id AS navigation_has_sitepart_id FROM main_navigation_has_sitepart LEFT JOIN main_sitepart ON main_navigation_has_sitepart.main_sitepart_id = main_sitepart.id WHERE main_navigation_has_sitepart.id = '" . $_POST["input_navigation_has_sitepart_id"]."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_navigation_has_sitepart = @mysqli_fetch_array($result);
|
||||
$input_navigation_has_sitepart["navigation_has_sitepart_id"] = $_POST["input_navigation_has_sitepart_id"];
|
||||
$input_navigation_has_sitepart["user_description"] = $_POST["input_user_description"];
|
||||
$input_navigation_has_sitepart["active"] = $_POST["input_active"];
|
||||
for ($count = 1; $count <= 5; $count++) {
|
||||
$_POST["input_value_" . $count] = "";
|
||||
}
|
||||
require_once("edit_navigation_has_sitepart_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function insert_navigation_has_sitepart( $frontend_navigation ) {
|
||||
if (($frontend_navigation["id"] <> '') && ($_POST["input_sitepart_type"] <> '')) {
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], "SELECT MAX(sorting)+1 AS max FROM main_navigation_has_sitepart WHERE main_navigation_id = '" . $frontend_navigation["id"]."'");
|
||||
$sorting = @mysqli_fetch_array($result);
|
||||
if ($sorting["max"] == '') {
|
||||
$sorting["max"] = 1;
|
||||
}
|
||||
$query = "INSERT INTO main_navigation_has_sitepart (id,main_navigation_id,main_sitepart_id,sorting,modified_date,modified_user_id) VALUES (NULL," . $frontend_navigation["id"] . ",'" . $_POST["input_sitepart_type"] . "'," . $sorting["max"] . ",now()," . $GLOBALS['admin_user']['id'] . ")";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$_POST["input_navigation_has_sitepart_id"] = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
edit_navigation_has_sitepart($frontend_navigation);
|
||||
}
|
||||
}
|
||||
|
||||
function delete_navigation_has_sitepart( $frontend_navigation ) {
|
||||
if ($_POST["input_navigation_has_sitepart_id"] <> '') {
|
||||
$query = "DELETE FROM main_navigation_has_sitepart WHERE id = '" . $_POST["input_navigation_has_sitepart_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
require_once("edit_navigation_has_sitepart_listform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function moveup_navigation_has_sitepart() {
|
||||
move_navigation_has_sitepart("<", "DESC", $_POST["input_navigation_has_sitepart_id"]);
|
||||
}
|
||||
|
||||
function movedown_navigation_has_sitepart() {
|
||||
move_navigation_has_sitepart(">", "ASC", $_POST["input_navigation_has_sitepart_id"]);
|
||||
}
|
||||
|
||||
function move_navigation_has_sitepart( $way, $order, $sitepart_id ) {
|
||||
$query = "SELECT * FROM main_navigation_has_sitepart WHERE id = '" . $sitepart_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$curr_sitepart = @mysqli_fetch_array($result);
|
||||
}
|
||||
$query = "SELECT * FROM main_navigation_has_sitepart WHERE main_navigation_id = " . $curr_sitepart["main_navigation_id"] . " AND sorting " . $way . " " . $curr_sitepart["sorting"] . " ORDER BY sorting " . $order . " LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$change_sitepart = @mysqli_fetch_array($result);
|
||||
}
|
||||
if (($curr_sitepart["id"] <> '') && ($change_sitepart["id"] <> '')) {
|
||||
$query = "UPDATE main_navigation_has_sitepart SET sorting = " . $change_sitepart["sorting"] . " WHERE id = " . $curr_sitepart["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$query = "UPDATE main_navigation_has_sitepart SET sorting = " . $curr_sitepart["sorting"] . " WHERE id = " . $change_sitepart["id"];
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
60
mysyde/admin/edit_navigation_has_sitepart_cardform.inc.php
Normal file
60
mysyde/admin/edit_navigation_has_sitepart_cardform.inc.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<h2><?= $frontend_navigation["menu_name"] ?></h2>
|
||||
<form id="form_navigation_has_sitepart_card" name="form_navigation_has_sitepart_card" method="post">
|
||||
<input name="input_navigation_has_sitepart_id" id="input_navigation_has_sitepart_id" type="hidden"
|
||||
value="<?= $input_navigation_has_sitepart["navigation_has_sitepart_id"] ?>">
|
||||
|
||||
<div class="toolbar">
|
||||
<a class="button_edit" href="javascript:void(0);"
|
||||
onclick="document.form_navigation_has_sitepart_card.action='?frontend_nav=<?= $frontend_navigation["id"] ?>&action=list'; form_navigation_has_sitepart_card.submit(); return false;">Übersicht</a>
|
||||
<a class="button_new" href="javascript:void(0);" onclick="toggle('new_sitepart');">Neu</a>
|
||||
<a class="button_delete" href="javascript:void(0);"
|
||||
onclick="if(confirm('Wollen Sie das Sitepart mit allen Inhalten wirklich löschen?')) { document.form_navigation_has_sitepart_card.action = '?frontend_nav=<?= $frontend_navigation["id"] ?>&action=delete_navigation_has_sitepart'; document.form_navigation_has_sitepart_card.submit(); return false; }">Löschen</a>
|
||||
<a class="button_save" href="javascript:void(0);"
|
||||
onclick="document.form_navigation_has_sitepart_card.action = '?frontend_nav=<?= $frontend_navigation["id"] ?>&action=save_navigation_has_sitepart'; document.form_navigation_has_sitepart_card.submit(); return false;">Speichern</a>
|
||||
<a class="button_reset" href="javascript:void(0);"
|
||||
onclick="document.form_navigation_has_sitepart_card.reset(); return false;">Zurücksetzen</a>
|
||||
</div>
|
||||
|
||||
<div class="subtoolbar" id="new_sitepart" style="display:none;">
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td><? sitepart_select("Typ", "input_sitepart_type"); ?></td>
|
||||
<td><a class="button_new" href="javascript:void(0);"
|
||||
onclick="form_navigation_has_sitepart_list.action = '?frontend_nav=<?= $frontend_navigation["id"] ?>&action=new_navigation_has_sitepart'; document.form_navigation_has_sitepart_list.submit(); return false;">Einfügen</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? sitepart_select_dd("Typ", "input_sitepart_type", $input_navigation_has_sitepart["main_sitepart_id"], TRUE); ?>
|
||||
<? layout_area_select("Layout Area", "input_layout_area_id", $input_navigation_has_sitepart["layout_area_id"]); ?>
|
||||
<? input("Beschreibung", "input_user_description", "text", $input_navigation_has_sitepart["user_description"], 45) ?>
|
||||
<br />
|
||||
|
||||
<? for ($count = 1; $count <= 5; $count++) {
|
||||
if ($input_navigation_has_sitepart["value_" . $count . "_name"] <> '') {
|
||||
input($input_navigation_has_sitepart["value_" . $count . "_name"], "input_value_" . $count, "text", $input_navigation_has_sitepart["value_" . $count]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<? input("Aktiv", "input_active", "checkbox", $input_navigation_has_sitepart["active"]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?
|
||||
if (($input_navigation_has_sitepart["admin_include"] <> '') && (file_exists("../../" . $input_navigation_has_sitepart["admin_include"]))) {
|
||||
$sitepart = $input_navigation_has_sitepart;
|
||||
require_once("../../" . $input_navigation_has_sitepart["admin_include"]);
|
||||
if (function_exists($sitepart["admin_start_parameter"])) {
|
||||
$sitepart["admin_start_parameter"]($sitepart);
|
||||
}
|
||||
}
|
||||
?>
|
||||
39
mysyde/admin/edit_navigation_has_sitepart_listform.inc.php
Normal file
39
mysyde/admin/edit_navigation_has_sitepart_listform.inc.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<h2><?= $frontend_navigation["menu_name"] ?></h2>
|
||||
<form id="form_navigation_has_sitepart_list" name="form_navigation_has_sitepart_list" method="post">
|
||||
<input name="input_main_navigation_id" id="input_main_navigation_id" type="hidden"
|
||||
value="<?= $frontend_navigation["id"] ?>">
|
||||
|
||||
<div class="toolbar">
|
||||
<a class="button_edit" href="javascript:void(0);"
|
||||
onclick="document.form_navigation_has_sitepart_list.action = '?frontend_nav=<?= $frontend_navigation["id"] ?>&action=edit_navigation_has_sitepart'; document.form_navigation_has_sitepart_list.submit(); return false;">Karte</a>
|
||||
<a class="button_new" href="javascript:void(0);" onclick="toggle('new_sitepart');">Neu</a>
|
||||
<a class="button_delete" href="javascript:void(0);"
|
||||
onclick="if(confirm('Wollen Sie das Sitepart mit allen Inhalten wirklich löschen?')) { document.form_navigation_has_sitepart_list.action = '?frontend_nav=<?= $frontend_navigation["id"] ?>&action=delete_navigation_has_sitepart'; form_navigation_has_sitepart_list.submit(); return false; }">Löschen</a>
|
||||
<a class="button_up" href="javascript:void(0);"
|
||||
onclick="document.form_navigation_has_sitepart_list.action = '?frontend_nav=<?= $frontend_navigation["id"] ?>&action=moveup_navigation_has_sitepart'; document.form_navigation_has_sitepart_list.submit(); return false;">Nach
|
||||
oben</a>
|
||||
<a class="button_down" href="javascript:void(0);"
|
||||
onclick="document.form_navigation_has_sitepart_list.action = '?frontend_nav=<?= $frontend_navigation["id"] ?>&action=movedown_navigation_has_sitepart'; document.form_navigation_has_sitepart_list.submit(); return false;">Nach
|
||||
unten</a>
|
||||
<a class="button_edit" target="_blank"
|
||||
href="<?= get_link_to_navigation($frontend_navigation["id"]) ?>">Vorschau</a>
|
||||
<a class="button_edit" href="javascript:void(0);"
|
||||
onclick="document.form_navigation_has_sitepart_list.action = '/mysyde/<?= $_GET["site"] ?>/<?= $_GET["language"] ?>/Webseite/Navigation/?action=edit_navigation'; form_navigation_has_sitepart_list.submit(); return false;">Navigation</a>
|
||||
</div>
|
||||
|
||||
<div class="subtoolbar" id="new_sitepart" style="display:none;">
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<? sitepart_select("input_sitepart_type"); ?>
|
||||
</table>
|
||||
<br /><a class="button_new" href="javascript:void(0);"
|
||||
onclick="form_navigation_has_sitepart_list.action = '?frontend_nav=<?= $frontend_navigation["id"] ?>&action=new_navigation_has_sitepart'; document.form_navigation_has_sitepart_list.submit(); return false;">Einfügen</a>
|
||||
</div>
|
||||
|
||||
<?
|
||||
$query = "SELECT main_navigation_has_sitepart.id, main_sitepart.name as 'Typ', user_description as 'Beschreibung', active AS 'Status', CONCAT(date_format(modified_date, '%d.%m.%Y, %H:%i:%s'),' von ',(SELECT name FROM main_admin_user WHERE main_admin_user.id = main_navigation_has_sitepart.modified_user_id)) AS 'Letzte Änderung' FROM main_navigation_has_sitepart LEFT JOIN main_sitepart ON main_navigation_has_sitepart.main_sitepart_id = main_sitepart.id WHERE main_navigation_id = " . $frontend_navigation["id"] . " ORDER BY sorting ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$format = array("option", "text", "text", "boolean_active", "text");
|
||||
linklist($result, "form_navigation_has_sitepart_list", $format, "input_navigation_has_sitepart_id");
|
||||
?>
|
||||
|
||||
</form>
|
||||
1566
mysyde/admin/edit_page.inc.php
Normal file
1566
mysyde/admin/edit_page.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
139
mysyde/admin/edit_page_cardform.inc.php
Normal file
139
mysyde/admin/edit_page_cardform.inc.php
Normal file
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_page_card";
|
||||
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
|
||||
$main_page_id = (int)$input_page["id"];
|
||||
$from = isset($_REQUEST['from']) ? $_REQUEST['from'] : '';
|
||||
|
||||
function create_checkboxes( $main_layout_id, $main_page_id, $type ) {
|
||||
$query = "
|
||||
SELECT id, path, default_active
|
||||
FROM main_layout_inclusions
|
||||
WHERE main_layout_id = '" . $main_layout_id . "' AND type = '" . $type . "'
|
||||
ORDER BY sorting ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$layout_inclusions = array();
|
||||
IF (@mysqli_num_rows($result) > 0) {
|
||||
WHILE ($layout_inclusions = @mysqli_fetch_assoc($result)) {
|
||||
$query2 = "SELECT active FROM main_page_layout_inclusion_link WHERE
|
||||
main_layout_includes_id = '" . $layout_inclusions["id"] . "' AND
|
||||
main_page_id = " . $main_page_id;
|
||||
$result2 = mysqli_query($GLOBALS['mysql_con'], $query2);
|
||||
$boxname_array = array();
|
||||
$boxname_array = explode("/", $layout_inclusions["path"]);
|
||||
$array_index = count($boxname_array) - 1;
|
||||
$boxname = $boxname_array[$array_index];
|
||||
IF (@mysqli_num_rows($result2) == 0) {
|
||||
input($boxname, "input_script_" . $layout_inclusions["id"] . "_active", "checkbox", $layout_inclusions["default_active"]);
|
||||
} ELSE {
|
||||
input($boxname, "input_script_" . $layout_inclusions["id"] . "_active", "checkbox", @mysqli_result($result2, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function create_component_checkbox( $main_page_id ) {
|
||||
$query = "SELECT id, title, default_active FROM main_component WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1)";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$layout_inclusions = array();
|
||||
IF (@mysqli_num_rows($result) > 0) {
|
||||
WHILE ($layout_inclusions = @mysqli_fetch_assoc($result)) {
|
||||
$query2 = "SELECT active FROM main_page_component_include_link WHERE
|
||||
main_component_id = '" . $layout_inclusions["id"] . "' AND
|
||||
main_page_id = '" . $main_page_id."'";
|
||||
$result2 = mysqli_query($GLOBALS['mysql_con'], $query2);
|
||||
$boxname = $layout_inclusions['title'];
|
||||
IF (@mysqli_num_rows($result2) == 0) {
|
||||
input($boxname, "input_component_" . $layout_inclusions["id"] . "_active", "checkbox", $layout_inclusions["default_active"]);
|
||||
} ELSE {
|
||||
input($boxname, "input_component_" . $layout_inclusions["id"] . "_active", "checkbox", @mysqli_result($result2, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_page["id"] == "") {
|
||||
echo $translation->get("new_site");
|
||||
} else {
|
||||
echo $translation->get("edit_site");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
|
||||
<?
|
||||
if ($from == "page_line_listform") {
|
||||
button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)");
|
||||
}
|
||||
?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_page', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save_page', true, '', true)"); ?>
|
||||
<div style="display:none;">
|
||||
<?
|
||||
if ($input_page["id"] != "") {
|
||||
echo button("copy", $translation->get("copy_site"), $formname, "loadCard('copy_page', true)");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
if ($input_page["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_page', true, '{$translation->get('delete_textcontent_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_page_id" type="hidden" value="<?= $input_page["id"] ?>">
|
||||
<input name="input_main_layout_id" type="hidden" value="<?= $main_layout_id ?>">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_page_name", "text", $input_page["title"], 255) ?>
|
||||
<? input($translation->get("browsertitle"), "input_browser_title", "text", $input_page["subtitle"], 255) ?>
|
||||
<? input($translation->get("meta_description"), "input_meta_description", "textarea", $input_page["meta_description"]) ?>
|
||||
<? input($translation->get("meta_keywords"), "input_meta_keywords", "textarea", $input_page["meta_keywords"]) ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input($translation->get("active"), "input_active", "checkbox", $input_page["active"]) ?>
|
||||
<? input($translation->get("no_index"), "input_no_index", "checkbox", $input_page["no_index"]) ?>
|
||||
<? input($translation->get("validity_from"), "input_validity_from", "date", datefromsql($input_page["validity_from"]), 10) ?>
|
||||
<? input($translation->get("validity_to"), "input_validity_to", "date", datefromsql($input_page["validity_to"]), 10) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h2><?php echo $translation->get("Bausteine"); ?></h2>
|
||||
<? create_component_checkbox($main_page_id); ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<h2><?php echo $translation->get("edit_css_javascript_config"); ?></h2>
|
||||
<? create_checkboxes($main_layout_id, $main_page_id, 'js'); ?>
|
||||
<? create_checkboxes($main_layout_id, $main_page_id, 'css'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
93
mysyde/admin/edit_page_copy.inc.php
Normal file
93
mysyde/admin/edit_page_copy.inc.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_page_card";
|
||||
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
|
||||
$main_page_id = (int)$input_page["id"];
|
||||
$from = isset($_REQUEST['from']) ? $_REQUEST['from'] : '';
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadLanguages( website_id ) {
|
||||
$('#siteLanguages', $('#<?php echo $formname; ?>')).html("");
|
||||
|
||||
if (website_id == "" || website_id == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.loader', $('#<?php echo $formname; ?>')).show();
|
||||
|
||||
// ajax
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
$.ajax({
|
||||
url : "?action=copy_page_load_languages_page",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
$('.loader', $('#<?php echo $formname; ?>')).hide();
|
||||
$('#siteLanguages', $('#<?php echo $formname; ?>')).html(output.site_languages);
|
||||
}
|
||||
},
|
||||
dataType : 'json'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("copy_site"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
|
||||
<? button("left", $translation->get("back"), $formname, "loadCard('edit_page', true)"); ?>
|
||||
<?= button("save", $translation->get("copy_and_save"), $formname, "loadCard('copy_and_save_page', true)"); ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_page_id" type="hidden" value="<?= $input_page["id"] ?>">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><?php echo $translation->get("copy_page_to"); ?>:</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<? site_select($translation->get("website"), "site_id", null, false, true, 'loadLanguages(this.value);'); ?>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<img class="loader" style="display:none;" src="/layout/admin/img/2015/ajax-loader.gif" />
|
||||
<div id="siteLanguages"></div>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
57
mysyde/admin/edit_page_line_group_cardform.inc.php
Normal file
57
mysyde/admin/edit_page_line_group_cardform.inc.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_page_line_group";
|
||||
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
|
||||
$input_page_id = $_REQUEST["input_page_id"];
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function save_and_close_page_group() {
|
||||
jQuery('#save_and_close', jQuery('#<?php echo $formname; ?>')).val("1");
|
||||
loadCard('save_group_page', true);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php
|
||||
if ($input_line["id"] == "") {
|
||||
echo $translation->get("new_group");
|
||||
} else {
|
||||
echo $translation->get("edit_group");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("overview"), $formname, "loadCard('edit_content_page', true)"); ?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_group_page', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "save_and_close_page_group();"); ?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_page_id" type="hidden" value="<?= $input_page_id ?>">
|
||||
<input name="input_id" type="hidden" value="<?= $input_line["id"] ?>">
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("textkey"), "input_main_page_group_code", "code", $input_line["main_page_group_code"], 20) ?>
|
||||
<? input($translation->get("description"), "input_main_page_group_name", "text", $input_line["main_page_group_name"], 255) ?>
|
||||
<? input($translation->get("link"), "input_main_page_group_link", "text", $input_line["main_page_group_link"], 255) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
220
mysyde/admin/edit_page_line_listform.inc.php
Normal file
220
mysyde/admin/edit_page_line_listform.inc.php
Normal file
@@ -0,0 +1,220 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_field_list";
|
||||
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
|
||||
$siteparts = \DynCom\mysyde\common\classes\Siteparts::get();
|
||||
$input_page_id = $_REQUEST["input_page_id"];
|
||||
?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var clickmode = 'new';
|
||||
|
||||
function toggle_inhalte_scroller() {
|
||||
|
||||
if (contentscroller.css('display') == 'none') {
|
||||
contentscroller.show();
|
||||
} else {
|
||||
//contentscroller.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleScrollerHeadline( _headline, _clickAction ) {
|
||||
var contentscroller = $('.inhalte_toggle_container');
|
||||
$('#srollerInhalteHeadline h2').html(_headline);
|
||||
contentscroller.show();
|
||||
|
||||
clickmode = _clickAction;
|
||||
}
|
||||
|
||||
function contentmenuClick( _el, _module, _listOnly, _sitepartId ) {
|
||||
var listOnly = _listOnly || false;
|
||||
var sitepartId = _sitepartId || 0;
|
||||
setCurrentToolbarClicked(_el);
|
||||
|
||||
if (listOnly === true) {
|
||||
loadCard('list_' + _module + '_page', true);
|
||||
return;
|
||||
}
|
||||
|
||||
$('input[name="sitepart_id"]', $('#form_inhalte')).val(_sitepartId);
|
||||
|
||||
if (clickmode == 'list') {
|
||||
loadCard('list_' + _module + '_page', true);
|
||||
} else {
|
||||
loadCard('new_' + _module, true);
|
||||
}
|
||||
}
|
||||
|
||||
function preview_page_cardform() {
|
||||
var current_location = String(document.location).replace(/\?.*$/, '');
|
||||
window.open(current_location + "?preview_page=true&input_page_id=<?= $input_page_id ?>");
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<div class="title-wrapper">
|
||||
<?php echo getPageName($input_page_id) . current_website_language($site, $language);?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("add_content2"), $formname, "toggleScrollerHeadline('" . $translation->get("add_content2") . "', 'new');"); ?>
|
||||
<?= button("link", $translation->get("add_content"), $formname, "toggleScrollerHeadline('" . $translation->get("add_content") . "', 'list');"); ?>
|
||||
<?= button("preview", $translation->get("preview"), $formname, "preview_page_cardform()"); ?>
|
||||
<?= button("copy", $translation->get("copy_site"), $formname, "loadCard('copy_page', true)");?>
|
||||
<li>
|
||||
<ul>
|
||||
<?= button("properties",$translation->get("page_properties"),$formname,"loadCard('edit_page', true)", "", false); ?>
|
||||
|
||||
<?= button("properties",$translation->get("content_properties"),$formname,"loadCard('edit_line_properties_page')", "", false); ?>
|
||||
<?= button("copy", $translation->get("copy_content"), $formname, "loadCard('copy_content_page')", "", false); ?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<ul>
|
||||
<?= button("delete",$translation->get("delete_page"), $formname, "loadCard('delete_page', true, '{$translation->get('delete_page_confirm')}', true)","",false); ?>
|
||||
<?= button("delete",$translation->get("delete_content"),$formname,"loadCard('delete_line_page', false, '{$translation->get('delete_assoc_pageline')}')","", false); ?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<form id="form_inhalte" name="form_inhalte" method="post" class="inhalte_toggle_container">
|
||||
<input type="hidden" name="update_visitor_data" value="1" />
|
||||
<input type="hidden" name="sitepart_id" value="0" />
|
||||
<input name="input_page_id" type="hidden" value="<?= $input_page_id ?>">
|
||||
|
||||
<div class="inhalte_toggle_container" id="inhalte_form_headline">
|
||||
<div id="srollerInhalteHeadline"><h2></h2></div>
|
||||
<div id="scroller_inhalte_form">
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? layout_area_select($translation->get("layout_area")); ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<? input($translation->get("active"), "input_active", "checkbox", 1); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pagecontentScroller" class="pagecontentScroller inhalte_toggle_container">
|
||||
<div class="scroller_inhalte">
|
||||
|
||||
<ul class="inhalte_menu">
|
||||
<?php
|
||||
foreach ($siteparts as $sitepartId => $sitepartData) {
|
||||
// keine shop siteparts anzeigen
|
||||
if (isset($sitepartData['is_shop']) || $sitepartData['is_shop'] === TRUE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
button($sitepartData['class'], $sitepartData['description'], 'form_inhalte', "contentmenuClick(this, '{$sitepartData['code']}', false, $sitepartId)");
|
||||
}
|
||||
|
||||
button("inhalt_collection graybox", $translation->get("collection"), 'form_inhalte', "contentmenuClick(this, 'collection_list', true)");
|
||||
button("inhalt_collection graybox", $translation->get("collection_preview"), 'form_inhalte', "contentmenuClick(this, 'collection_preview', true)");
|
||||
button("inhalt_collection graybox", $translation->get("group"), 'form_inhalte', "contentmenuClick(this, 'group', true)");
|
||||
?>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_page_id" type="hidden" value="<?= $input_page_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
<input type="hidden" name="from" value="page_line_listform" />
|
||||
<?
|
||||
show_page_link_rows();
|
||||
?>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
var reorderCall = null;
|
||||
|
||||
//$('.dd').nestable({ /* config options */ });
|
||||
$('ol.sortable').nestedSortable({
|
||||
forcePlaceholderSize: true,
|
||||
handle : '.dd-icon',
|
||||
helper : 'clone',
|
||||
items : 'li',
|
||||
opacity : .6,
|
||||
placeholder : 'placeholder',
|
||||
revert : 250,
|
||||
tabSize : 25,
|
||||
tolerance : 'pointer',
|
||||
toleranceElement : '> div',
|
||||
maxLevels : 3,
|
||||
isTree : true,
|
||||
expandOnHover : 1000,
|
||||
cookieIndex : 'nestedSortable_pagecontent_expanded',
|
||||
startCollapsed : true,
|
||||
stop : function ( event, ui ) {
|
||||
reorder_navigation();
|
||||
store_expanded();
|
||||
},
|
||||
disabled : false,
|
||||
isAllowed : function ( placeholder, placeholderParent, originalItem ) {
|
||||
|
||||
// gruppe in eine gruppe hinzufuegen nicht moeglich
|
||||
if (placeholderParent !== null &&
|
||||
jQuery(originalItem).hasClass("mjs-nestedSortable-no-nesting") === false &&
|
||||
jQuery(placeholderParent).hasClass("mjs-nestedSortable-no-nesting") === false) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
$('.disclose').click(function () {
|
||||
$(this).closest('li').toggleClass('mjs-nestedSortable-collapsed').toggleClass('mjs-nestedSortable-expanded');
|
||||
store_expanded();
|
||||
});
|
||||
|
||||
function store_expanded() {
|
||||
var list = [];
|
||||
$('ol.sortable').find('li.mjs-nestedSortable-expanded').each(function () {
|
||||
list.push($(this).attr("id"));
|
||||
});
|
||||
$.cookie('nestedSortable_pagecontent_expanded', list.join(','));
|
||||
}
|
||||
|
||||
function reorder_navigation() {
|
||||
if (reorderCall !== null) {
|
||||
reorderCall.abort();
|
||||
}
|
||||
|
||||
serialized = $('ol.sortable').nestedSortable('serialize');
|
||||
arraied = $('ol.sortable').nestedSortable('toHierarchy', {startDepthCount: 0});
|
||||
var parameter = {
|
||||
list: arraied
|
||||
};
|
||||
reorderCall = jQuery.post("?action=reorder_content_page", parameter, function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
69
mysyde/admin/edit_page_line_properties_cardform.inc.php
Normal file
69
mysyde/admin/edit_page_line_properties_cardform.inc.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_page_line_properties";
|
||||
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
|
||||
$input_page_id = $_REQUEST["input_page_id"];
|
||||
|
||||
$query = "SELECT layout_class_defined FROM main_page_link WHERE id = '".$input_line["id"]."'";
|
||||
$layout_class_defined = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if(@mysqli_num_rows($layout_class_defined) > 0) {
|
||||
$defined_class = @mysqli_fetch_array($layout_class_defined);
|
||||
} else {
|
||||
$defined_class = "";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function save_and_close_page_line() {
|
||||
jQuery('#save_and_close', jQuery('#<?php echo $formname; ?>')).val("1");
|
||||
loadCard('save_line_properties_page', true);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("edit_page_content_properties"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("overview"), $formname, "loadCard('edit_content_page', true)"); ?>
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_line_properties_page', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "save_and_close_page_line();"); ?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_page_id" type="hidden" value="<?= $input_page_id ?>">
|
||||
<input name="input_id" type="hidden" value="<?= $input_line["id"] ?>">
|
||||
<input name="input_main_layout_id" type="hidden" value="<?= $main_layout_id ?>">
|
||||
<input name="save_and_close" id="save_and_close" type="hidden" value="0" />
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? layout_area_select($translation->get("layout_area"), "input_layout_area_id", $input_line['layout_area_id']); ?>
|
||||
<? layout_class_select($translation->get("layout_class"), "input_layout_class_id", $input_line['layout_class_id']); ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input($translation->get("active"), "input_active", "checkbox", $input_line["active"]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("self_definded_class"), "input_layout_class_defined", "text", $defined_class['layout_class_defined']) ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
73
mysyde/admin/edit_page_listform.inc.php
Normal file
73
mysyde/admin/edit_page_listform.inc.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_page_list";
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function filter_page() {
|
||||
jQuery('#form_page_list .requestLoader').show();
|
||||
|
||||
var filter_id = jQuery('#page_filter').val();
|
||||
var include_sub = jQuery('#include_children').is(':checked') ? 1 : 0;
|
||||
|
||||
jQuery('#form_page_list').attr("action", "?filter_id=" + filter_id + "&include_sub=" + include_sub).submit();
|
||||
|
||||
return;
|
||||
|
||||
var formData = {
|
||||
filter_id : jQuery('#page_filter').val(),
|
||||
include_children: jQuery('#include_children').is(':checked') ? 1 : 0
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url : "?action=filter_page",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
success: function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
jQuery('#form_page_list .requestLoader').hide();
|
||||
jQuery('#page_linklist').html(output);
|
||||
|
||||
initForm();
|
||||
initLinklist();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function preview_page() {
|
||||
var currentMarkedLinklistRow = jQuery('.linklist_active', jQuery('#' + dc.current_formname));
|
||||
var input_id = currentMarkedLinklistRow.data('inputid');
|
||||
var current_location = String(document.location).replace(/\?.*$/, '');
|
||||
window.open(current_location + "?preview_page=true&input_page_id=" + input_id);
|
||||
}
|
||||
</script>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_page', true)"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_sites'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
<?php
|
||||
page_filter($GLOBALS["site"]['id'],$GLOBALS["language"]['id'], (int)$_REQUEST['filter_id'], (isset($_REQUEST['include_sub']) ? (int)$_REQUEST['include_sub'] : 1));
|
||||
?>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
|
||||
<input type="hidden" class="selected_linklist_row" name="input_page_id" value="" />
|
||||
<div class="requestLoader"></div>
|
||||
<div id="page_linklist">
|
||||
<?
|
||||
filter_page();
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
153
mysyde/admin/edit_page_live.js
Normal file
153
mysyde/admin/edit_page_live.js
Normal file
@@ -0,0 +1,153 @@
|
||||
function create_live_includes() {
|
||||
if (typeof jQuery == 'undefined') {
|
||||
insert_javascript('/plugins/jquery/jquery-1.6.4.min.js');
|
||||
}
|
||||
}
|
||||
|
||||
function insert_javascript(_src) {
|
||||
var headTag = document.getElementsByTagName("head")[0];
|
||||
var jqTag = document.createElement('script');
|
||||
jqTag.type = 'text/javascript';
|
||||
jqTag.src = _src;
|
||||
jqTag.onload = load_live_edit;
|
||||
headTag.appendChild(jqTag);
|
||||
}
|
||||
|
||||
create_live_includes();
|
||||
|
||||
function load_live_edit() {
|
||||
// zu allen links den live_edit parameter hinzufuegen
|
||||
$('a:not(.textcontent a)').each(function () {
|
||||
var href = $(this).attr('href');
|
||||
|
||||
if (href) {
|
||||
href += (href.match(/\?/) ? '&' : '?') + "live_edit=1";
|
||||
$(this).attr('href', href);
|
||||
}
|
||||
});
|
||||
|
||||
// bei kollektionen die einzelnen sitepart-bearbeitungen ausschalten
|
||||
jQuery('.live_edit_collection, .live_edit_component').each(function () {
|
||||
var sitepartcontainer = $(this).find('.live_edit_container');
|
||||
sitepartcontainer.find('.live_edit_overlay').remove();
|
||||
sitepartcontainer.find("div[contenteditable='true']").removeAttr("contenteditable");
|
||||
sitepartcontainer.removeClass("live_edit_container");
|
||||
|
||||
$(this).find("div[contenteditable='true']").removeAttr("contenteditable");
|
||||
});
|
||||
|
||||
jQuery('.live_edit_container').each(function () {
|
||||
var containerWidth = jQuery(this).width();
|
||||
var containerHeight = jQuery(this).height();
|
||||
|
||||
if ($(this).parent().css("float") == "left" || $(this).parent().css("float") == 'right') {
|
||||
$(this).css("float", $(this).parent().css("float"));
|
||||
}
|
||||
|
||||
if (jQuery(this).find("span.live_edit_overlay").data("sitepartheaderid") == 0) {
|
||||
jQuery(this).removeClass("live_edit_container");
|
||||
jQuery(this).find("span.live_edit_overlay").remove();
|
||||
return;
|
||||
}
|
||||
|
||||
if (jQuery(this).find("div[contenteditable='true']").length > 0) {
|
||||
return;
|
||||
}
|
||||
jQuery(this).prepend(
|
||||
jQuery("<div>")
|
||||
.addClass("live_edit_inner_overlay")
|
||||
)
|
||||
});
|
||||
|
||||
jQuery('.live_edit_overlay').click(function () {
|
||||
|
||||
var is_collection = $(this).data("collection");
|
||||
if (is_collection === true) {
|
||||
// eine kollektion wird bearbeitet, nicht einzelne siteparts einer kollektion
|
||||
var collection_id = $(this).data("collectionid");
|
||||
var collection_setup_id = $(this).data("collection_setup_id");
|
||||
|
||||
parent.gotoLocation(parent.build_collection_edit_url(collection_setup_id, collection_id));
|
||||
return;
|
||||
}
|
||||
|
||||
var is_component = $(this).data("component");
|
||||
if (is_component === true) {
|
||||
// ein baustein wird bearbeitet, nicht einzelne siteparts eines bausteins
|
||||
var component_id = $(this).data("componentid");
|
||||
parent.gotoLocation(parent.component_url + component_id);
|
||||
return;
|
||||
}
|
||||
|
||||
var aFormData = new FormData();
|
||||
|
||||
// hier wird ein einzelnes sitepart bearbeitet
|
||||
var sitepart = $(this).data("sitepartid");
|
||||
var sitepart_header_id = $(this).data("sitepartheaderid");
|
||||
var page_id = $(this).data("pageid");
|
||||
var link_id = $(this).data("linkid");
|
||||
|
||||
aFormData.append("input_page_id", page_id);
|
||||
aFormData.append("input_id", link_id);
|
||||
aFormData.append("data-sitepartid", sitepart);
|
||||
|
||||
parent.loadCard('edit_line_page', true, '', false, aFormData);
|
||||
});
|
||||
|
||||
CKEDITOR.disableAutoInline = true;
|
||||
|
||||
var editorCounter = 1;
|
||||
$("div[contenteditable='true']").each(function (index) {
|
||||
$(this).attr('id', "live_textcontainer_" + editorCounter);
|
||||
var content_id = $(this).attr('id');
|
||||
var sitepaer_header_id = $(this).data('textcontentid');
|
||||
|
||||
editorCounter++;
|
||||
|
||||
CKEDITOR.inline(content_id, {
|
||||
customConfig: '/plugins/ckeditor/dc_config.js',
|
||||
contentsCss: '/' + parent.config_CKEDITOR_custom_config,
|
||||
filebrowserBrowseUrl: '/plugins/ckfinder/ckfinder.html',
|
||||
filebrowserImageBrowseUrl: '/plugins/ckfinder/ckfinder.html?type=Images',
|
||||
filebrowserFlashBrowseUrl: '/plugins/ckfinder/ckfinder.html?type=Flash',
|
||||
filebrowserUploadUrl:
|
||||
'/plugins/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
|
||||
filebrowserImageUploadUrl:
|
||||
'/plugins/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
|
||||
filebrowserFlashUploadUrl: '/plugins/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
|
||||
|
||||
on: {
|
||||
blur: function (event) {
|
||||
var data = event.editor.getData();
|
||||
inline_ckeditor_update(sitepaer_header_id, data);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".live_edit_inner_overlay").click(function () {
|
||||
var editableContent = $(this).next("div[contenteditable='true']");
|
||||
if (editableContent.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
//CKEDITOR.inline( editableContent.attr("id") );
|
||||
$(this).css("display", "none");
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
load_live_edit();
|
||||
});
|
||||
|
||||
function inline_ckeditor_update(sitepaer_header_id, _data) {
|
||||
var request = jQuery.ajax({
|
||||
url: String(parent.document.location).replace(/\?.*$/, '') + "?action=edit_line_sitepart_update_page",
|
||||
type: "POST",
|
||||
data: {
|
||||
content: _data,
|
||||
sitepaer_header_id: sitepaer_header_id
|
||||
},
|
||||
dataType: "html"
|
||||
});
|
||||
}
|
||||
72
mysyde/admin/edit_page_live_cardform.inc.php
Normal file
72
mysyde/admin/edit_page_live_cardform.inc.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?
|
||||
$formname = "form_live_page_edit";
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
|
||||
$page_navigation = array();
|
||||
$query = "SELECT id FROM main_navigation WHERE forward_type = 1 and forward_page_id = '" . $input_page_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
if(@mysqli_num_rows($result) == 1) {
|
||||
$page_navigation = @mysqli_fetch_array($result);
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php
|
||||
echo $translation->get("live_page_edit");
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if(count($page_navigation) == 0) {
|
||||
echo "<div class=\"infobox\">" . $translation->get("live_edit_not_possible") . "</div>";
|
||||
exit();
|
||||
}
|
||||
|
||||
$iframeUrl = "//" . $_SERVER['HTTP_HOST'] . get_link_to_navigation($page_navigation['id']) . "?live_edit=1";
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var config_CKEDITOR_custom_config = 'layout/frontend/<?php echo $GLOBALS["layout"]["code"]; ?>/dist/css/fck.css';
|
||||
|
||||
var component_url = '<?php echo get_menu_link('structure/components',$GLOBALS["site"],$GLOBALS["language"], "?action=open_card_component&input_component_id="); ?>';
|
||||
|
||||
function build_collection_edit_url(edit_collection_setup_id, collection_id) {
|
||||
var collection_url = '<?php echo get_menu_link("collections/' + edit_collection_setup_id + '",$GLOBALS["site"],$GLOBALS["language"], "?action=open_card_collection&input_collection_id="); ?>';
|
||||
collection_url += collection_id;
|
||||
return collection_url;
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
#overlayWrapper {
|
||||
overflow:hidden;
|
||||
width:80%;
|
||||
margin-left:auto;
|
||||
left:10%;
|
||||
}
|
||||
|
||||
#overlayLoader {
|
||||
width:80%;
|
||||
margin-left:auto;
|
||||
left:10%;
|
||||
}
|
||||
|
||||
#overlayContent {
|
||||
height:100%;
|
||||
position:relative;
|
||||
}
|
||||
</style>
|
||||
<div class="clearfix"></div>
|
||||
<div class="liveedit">
|
||||
<iframe id="live_edit_frame" src="<?php echo $iframeUrl; ?>"></iframe>
|
||||
<script type="text/javascript">
|
||||
var height = window.innerHeight - 180;
|
||||
$('#live_edit_frame').css('height', height);
|
||||
$(window).resize(function(){
|
||||
var height = window.innerHeight - 180;
|
||||
$('#live_edit_frame').css('height', height);
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
88
mysyde/admin/edit_page_navigation_cardform.inc.php
Normal file
88
mysyde/admin/edit_page_navigation_cardform.inc.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_page_card";
|
||||
$main_layout_id = $GLOBALS["language"]["main_layout_id"];
|
||||
$main_page_id = (int)$input_page["id"];
|
||||
|
||||
function create_checkboxes( $main_layout_id, $main_page_id, $type ) {
|
||||
$query = "
|
||||
SELECT id, path, default_active
|
||||
FROM main_layout_inclusions
|
||||
WHERE main_layout_id = '" . $main_layout_id . "' AND type = '" . $type . "'
|
||||
ORDER BY sorting ASC";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$layout_inclusions = array();
|
||||
IF (@mysqli_num_rows($result) > 0) {
|
||||
WHILE ($layout_inclusions = @mysqli_fetch_assoc($result)) {
|
||||
$query2 = "SELECT active FROM main_page_layout_inclusion_link WHERE
|
||||
main_layout_includes_id = '" . $layout_inclusions["id"] . "' AND
|
||||
main_page_id = " . $main_page_id;
|
||||
$result2 = mysqli_query($GLOBALS['mysql_con'], $query2);
|
||||
$boxname_array = array();
|
||||
$boxname_array = explode("/", $layout_inclusions["path"]);
|
||||
$array_index = count($boxname_array) - 1;
|
||||
$boxname = $boxname_array[$array_index];
|
||||
IF (@mysqli_num_rows($result2) == 0) {
|
||||
input($boxname, "input_script_" . $layout_inclusions["id"] . "_active", "checkbox", $layout_inclusions["default_active"]);
|
||||
} ELSE {
|
||||
input($boxname, "input_script_" . $layout_inclusions["id"] . "_active", "checkbox", @mysqli_result($result2, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_page["id"] == "") {
|
||||
echo $translation->get("new_site");
|
||||
} else {
|
||||
echo $translation->get("edit_site");
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save_page', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save_page', true, '', true)"); ?>
|
||||
<?= button("link", $translation->get("assign_navigation"), $formname, "loadCard('assign_navigation_page', true, '', true)"); ?>
|
||||
<?php
|
||||
if ($input_page["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_page', true, '{$translation->get('delete_textcontent_confirm')}', true)");
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit"); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_page_id" type="hidden" value="<?= $input_page["id"] ?>">
|
||||
<input name="input_main_layout_id" type="hidden" value="<?= $main_layout_id ?>">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("name"), "input_page_name", "text", $input_page["title"], 255) ?>
|
||||
<? input($translation->get("browsertitle"), "input_browser_title", "text", $input_page["subtitle"], 255) ?>
|
||||
<? input($translation->get("validity_from"), "input_validity_from", "date", datefromsql($input_page["validity_from"]), 10) ?>
|
||||
<? input($translation->get("validity_to"), "input_validity_to", "date", datefromsql($input_page["validity_to"]), 10) ?>
|
||||
<? input($translation->get("active"), "input_active", "checkbox", $input_page["active"]) ?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<? create_checkboxes($main_layout_id, $main_page_id, 'js'); ?>
|
||||
<? create_checkboxes($main_layout_id, $main_page_id, 'css'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
44
mysyde/admin/edit_setup.inc.php
Normal file
44
mysyde/admin/edit_setup.inc.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?
|
||||
|
||||
switch ($_GET["action"]) {
|
||||
case 'save':
|
||||
save_setup();
|
||||
break;
|
||||
default:
|
||||
setup_card();
|
||||
break;
|
||||
}
|
||||
|
||||
function setup_card() {
|
||||
$query = "SELECT * FROM main_setup";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_setup = @mysqli_fetch_array($result);
|
||||
require_once("edit_setup_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function save_setup() {
|
||||
if ($GLOBALS['admin_user']['is_super_user'] == 1) {
|
||||
$query = "UPDATE main_setup SET admin_name = '" . $_POST["input_admin_name"] . "', admin_link = '" . $_POST["input_admin_link"] . "', std_main_site_id = '" . $_POST["input_std_main_site_id"] . "' , support_recipient_email = '" . $_POST['input_support_recipient_email'] . "' WHERE id = '" . $_POST["input_id"] . "' LIMIT 1";
|
||||
if (($_POST["input_admin_name"] == '') | ($_POST["input_admin_link"] == '')) {
|
||||
echo "<div class=\"errorbox\">Füllen Sie die Felder Admin-Browsertitel und Admin-Webadresse aus</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
setup_card();
|
||||
} else {
|
||||
$input_setup["id"] = $_POST["input_id"];
|
||||
$input_setup["admin_name"] = $_POST["input_admin_name"];
|
||||
$input_setup["admin_link"] = $_POST["input_admin_link"];
|
||||
$input_setup["std_main_site_id"] = $_POST["input_std_main_site_id"];
|
||||
$input_setup["support_recipient_email"] = $_POST["input_support_recipient_email"];
|
||||
require_once("edit_setup_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
setup_card();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
29
mysyde/admin/edit_setup_cardform.inc.php
Normal file
29
mysyde/admin/edit_setup_cardform.inc.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<? $formname = "form_main_setup_card"; ?>
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_setup["id"] ?>">
|
||||
<?
|
||||
$disabled = TRUE;
|
||||
if ($GLOBALS['admin_user']['is_super_user'] == 1) {
|
||||
$disabled = FALSE;
|
||||
?>
|
||||
<div class="toolbar">
|
||||
<?= button("save", "Speichern", $formname, "?action=save"); ?>
|
||||
<?= button("reset", "Zurücksetzen", $formname); ?>
|
||||
</div>
|
||||
<? } ?>
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input("Admin Browser-Titel", "input_admin_name", "text", $input_setup["admin_name"], 45, $disabled) ?>
|
||||
<? input("Admin Webadresse", "input_admin_link", "text", $input_setup["admin_link"], 45, $disabled) ?>
|
||||
<? input("Empfänger Support-EMail", "input_support_recipient_email", "text", $input_setup["support_recipient_email"], 45, $disabled) ?>
|
||||
<? if (!$disabled) { ?>
|
||||
<? site_select("Hauptwebseite", "input_std_main_site_id", $input_setup["std_main_site_id"], TRUE) ?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
346
mysyde/admin/edit_site.inc.php
Normal file
346
mysyde/admin/edit_site.inc.php
Normal file
@@ -0,0 +1,346 @@
|
||||
<?
|
||||
|
||||
switch ($_REQUEST["action"]) {
|
||||
case 'edit':
|
||||
edit_site();
|
||||
break;
|
||||
case 'delete':
|
||||
delete_site();
|
||||
break;
|
||||
case 'new':
|
||||
require_once("edit_site_cardform.inc.php");
|
||||
break;
|
||||
case 'save':
|
||||
save_site();
|
||||
break;
|
||||
case 'send_sitemap':
|
||||
send_sitemap();
|
||||
break;
|
||||
case 'copy':
|
||||
copy_site();
|
||||
break;
|
||||
case 'delete_image':
|
||||
delete_image();
|
||||
require_once("edit_site_listform.inc.php");
|
||||
break;
|
||||
default:
|
||||
require_once("edit_site_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function copy_site() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
require_once("edit_site_functions.php");
|
||||
|
||||
$SiteFunctions = new SiteFunctions();
|
||||
|
||||
$step = (isset($_REQUEST['next_step']) ? $_REQUEST['next_step'] : "");
|
||||
$copyError = array();
|
||||
switch($step) {
|
||||
case 'copy_site':
|
||||
// loeschen von ID Zuordnungen
|
||||
$query = "DELETE FROM copy_link WHERE session_id = '" . session_id() . "'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if(!$SiteFunctions->copy_site($_REQUEST["input_id"])) {
|
||||
$copyError = $SiteFunctions->errorMessages;
|
||||
break;
|
||||
}
|
||||
echo json_encode(array("next_step" => "copy_language", "message" => $translation->get("copy_start_all_languages"), "copy_language_id" => 0));
|
||||
return;
|
||||
case 'copy_language':
|
||||
if(!$SiteFunctions->copy_language($_REQUEST["input_id"])) {
|
||||
$copyError = $SiteFunctions->errorMessages;
|
||||
break;
|
||||
}
|
||||
|
||||
if($SiteFunctions->copyLanguageId == 0) {
|
||||
// keine Sprachen mehr zum kopieren vorhanden.
|
||||
break;
|
||||
}
|
||||
|
||||
echo json_encode(array("next_step" => "copy_siteparts", "message" => $SiteFunctions->message, "copy_language_id" => $SiteFunctions->copyLanguageId));
|
||||
return;
|
||||
|
||||
case 'copy_siteparts';
|
||||
case 'copy_collection_setup';
|
||||
case 'copy_collection';
|
||||
case 'copy_component';
|
||||
case 'copy_main_page';
|
||||
case 'copy_main_navigation';
|
||||
$newSiteId = $SiteFunctions->get_new_id($_REQUEST["input_id"], "main_site");
|
||||
$LanguageFunctions = new LanguageFunctions($_REQUEST["copy_language_id"], $newSiteId);
|
||||
if(!$LanguageFunctions->$step()) {
|
||||
$copyError = $LanguageFunctions->errorMessages;
|
||||
break;
|
||||
}
|
||||
|
||||
$nextStep = $LanguageFunctions->nextStep;
|
||||
if($nextStep == "") {
|
||||
// naechste Sprache kopieren.
|
||||
$nextStep = "copy_language";
|
||||
}
|
||||
|
||||
echo json_encode(array("next_step" => $nextStep, "message" => $LanguageFunctions->message, "copy_language_id" => $_REQUEST["copy_language_id"]));
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if(count($copyError)) {
|
||||
$errorDivs = array();
|
||||
foreach($copyError as $error) {
|
||||
$errorDivs[] = "<div class=\"errorbox\">" . $error . "</div>\n";
|
||||
}
|
||||
echo json_encode(array("next_step" => "", "message" => $errorDivs, "error" => 1));
|
||||
} else {
|
||||
echo json_encode(array("next_step" => "", "message" => array('<div class="successbox">' . $translation->get("copy_site_success") . '</div>'), "error" => 0));
|
||||
}
|
||||
}
|
||||
|
||||
function edit_site() {
|
||||
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
|
||||
$pdoHost = getenv('MAIN_MYSQL_DB_HOST');
|
||||
$pdoPort = getenv('MAIN_MYSQL_DB_PORT');
|
||||
$pdoUser = getenv('MAIN_MYSQL_DB_USER');
|
||||
$pdoPass = getenv('MAIN_MYSQL_DB_PASS');
|
||||
$pdoSchema = getenv('MAIN_MYSQL_DB_SCHEMA');
|
||||
|
||||
$pdo = new \DynCom\mysyde\common\classes\PDOQueryWrapper($pdoHost, $pdoPort, $pdoSchema, $pdoUser, $pdoPass);
|
||||
|
||||
$prepStatement = " SELECT *,
|
||||
(SELECT COUNT(id)
|
||||
FROM main_navigation
|
||||
WHERE main_site_id = main_site.id) AS 'no_of_navigation'
|
||||
FROM main_site
|
||||
WHERE id = :id LIMIT 1
|
||||
";
|
||||
$params = [
|
||||
[':id', $_REQUEST["input_id"], PDO::PARAM_STR],
|
||||
];
|
||||
$pdo->setQuery($prepStatement);
|
||||
$pdo->prepareQuery();
|
||||
$pdo->bindParameters($params);
|
||||
$pdo->executePreparedStatement();
|
||||
$result = $pdo->getResultArray();
|
||||
|
||||
if (count($result) == 1) {
|
||||
$input_site = $result[0];
|
||||
require_once("edit_site_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("edit_site_listform.inc.php");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function delete_site() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$messages = array();
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM main_site WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$querySetup = "SELECT mcs.id FROM main_language as ml INNER JOIN main_collection_setup as mcs on ml.id = mcs.main_language_id WHERE main_site_id = '" . (int)$_REQUEST["input_id"]."'";
|
||||
$resultSetup = @mysqli_query($GLOBALS['mysql_con'], $querySetup);
|
||||
while($row = @mysqli_fetch_array($resultSetup)){
|
||||
$query = "DELETE FROM main_collection_setup_websites WHERE id = '" . (int)$row["id"]."'";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$query = "DELETE FROM main_collection_setup WHERE id = '" . (int)$row["id"]."'";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
$query = "DELETE FROM main_language WHERE main_site_id = '" . (int)$_REQUEST["input_id"]."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
if($GLOBALS["site"]['id'] == $_REQUEST["input_id"]) {
|
||||
$messages[] = '<div class="infobox">' . $translation->get("website_msg_info2") . '<br><a href="/mysyde/?action=admin_logout">' . $translation->get("website_msg_tologin") . '</a></div>';
|
||||
if(IS_AJAX) {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_site = array();
|
||||
require_once("edit_site_cardform.inc.php");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
require_once("edit_site_listform.inc.php");
|
||||
}
|
||||
|
||||
function save_site() {
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$login_required = ($_REQUEST["input_login_required"] == "on") ? '1' : '0';
|
||||
$use_session_id = ($_REQUEST["input_use_session_id"] == "on") ? '1' : '0';
|
||||
$create_xml_sitemap = ($_REQUEST["input_create_xml_sitemap"] == "on") ? '1' : '0';
|
||||
$is_standard_site = ($_REQUEST["input_is_standard_site"] == "on") ? '1' : '0';
|
||||
$use_browser_language_detection = ($_REQUEST["input_use_browser_language_detection"] == "on") ? '1' : '0';
|
||||
|
||||
$mysql_update_standard = "UPDATE main_site SET is_standard_site = 0";
|
||||
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "UPDATE main_site
|
||||
SET code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"]) . "',
|
||||
name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "',
|
||||
std_main_language_id = '" . $_REQUEST["input_std_main_language_id"] . "',
|
||||
is_standard_site = " . $is_standard_site . ",
|
||||
login_required = '" . $login_required . "',
|
||||
google_analytics_id = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_google_analytics_id"]) . "',
|
||||
facebook_pixel_id = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_facebook_pixel_id"]) . "',
|
||||
use_session_id = '" . $use_session_id . "',
|
||||
create_xml_sitemap = '" . $create_xml_sitemap . "',
|
||||
site_url = '" . $_REQUEST["input_site_url"] . "',
|
||||
use_browser_language_detection = '" . $use_browser_language_detection . "',
|
||||
default_country_codes = '" . $_REQUEST["input_default_country_codes"] . "',
|
||||
websitekey = '" . $_REQUEST["input_websitekey"] . "',
|
||||
secretkey = '" . $_REQUEST["input_secretkey"] . "'
|
||||
WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
$this_site = mysqli_fetch_array(mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_site WHERE id = '" . $_REQUEST["input_id"] . "'"));
|
||||
} else {
|
||||
$query = "INSERT INTO main_site (id,code,name,std_main_language_id, is_standard_site, login_required,google_analytics_id,use_session_id,create_xml_sitemap,site_url,use_browser_language_detection, default_country_codes, facebook_pixel_id, websitekey, secretkey)
|
||||
VALUES (
|
||||
NULL,
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "',
|
||||
NULL,
|
||||
" . $is_standard_site . ",
|
||||
'" . $login_required . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_google_analytics_id"]) . "',
|
||||
'" . $use_session_id . "',
|
||||
'" . $create_xml_sitemap . "',
|
||||
'" . $_REQUEST["input_site_url"] . "',
|
||||
'" . $use_browser_language_detection . "',
|
||||
'" . $_REQUEST["input_default_country_codes"] . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_facebook_pixel_id"]) . "',
|
||||
'" . $_REQUEST["input_websitekey"] . "',
|
||||
'" . $_REQUEST["input_secretkey"] . "'
|
||||
)";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
if (($_REQUEST["input_code"] == '') | ($_REQUEST["input_name"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_description") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
if ($_REQUEST["input_code"] <> urlencode($_REQUEST["input_code"])) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_encoding") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_site WHERE code = '" . $_REQUEST["input_code"] . "'");
|
||||
if ((@mysqli_num_rows($result) <> 0) && ($_REQUEST["input_id"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_exists") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
$input_site["id"] = $_REQUEST["input_id"];
|
||||
|
||||
// benoetigt fuer ajax calls
|
||||
if ($error === TRUE) {
|
||||
header('EDIT_ERROR: 1');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// saveImg
|
||||
|
||||
if(isset($_FILES) && !empty($_FILES) && $_FILES['input_image']['size'] != 0 ){
|
||||
$fileName = saveImage('input_image', $input_site["id"]);
|
||||
|
||||
$query = "UPDATE main_site SET
|
||||
image = '" . $fileName. "'
|
||||
|
||||
WHERE id = '" . $input_site["id"] . "' LIMIT 1";
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
}
|
||||
|
||||
// SaveImag
|
||||
|
||||
@mysqli_query($GLOBALS['mysql_con'], $mysql_update_standard);
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("website_msg_success1") . '</div>';
|
||||
$last_insert_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$new_site = mysqli_fetch_array(mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_site WHERE id = '" . $last_insert_id . "'"));
|
||||
$query_2 = "INSERT INTO main_language (main_site_id, code, name, site_name, site_title_name) VALUES ('" . $new_site["id"] . "', 'de', 'Deutsch', '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $new_site["name"]) . "', '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $new_site["name"]) . "')";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query_2);
|
||||
$last_insert_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$std_language = mysqli_fetch_array(mysqli_query($GLOBALS['mysql_con'], "SELECT id FROM main_language WHERE id = '" . $last_insert_id . "'"));
|
||||
$query_3 = "UPDATE main_site SET std_main_language_id = '" . $std_language["id"] . "' WHERE id = '" . $new_site["id"] . "'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query_3);
|
||||
$input_site["id"] = $new_site["id"];
|
||||
} else {
|
||||
|
||||
$messages[] = '<div class="successbox">' . $translation->get("website_msg_success2") . '</div>';
|
||||
}
|
||||
|
||||
|
||||
// Wenn die aktuell gewählte Seite bearbeitet wurde, wird ein Relog erbeten. - MH 02. Dezember 2009
|
||||
|
||||
|
||||
if ($this_site["code"] == $_REQUEST["site"]) {
|
||||
if ($_REQUEST["input_code"] <> $this_site["code"]) {
|
||||
$messages[] = '<div class="infobox">' . $translation->get("website_msg_info1") . '<br><a href="/mysyde/?action=admin_logout">' . $translation->get("website_msg_tologin") . '</a></div>';
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$input_site["code"] = $_REQUEST["input_code"];
|
||||
$input_site["name"] = $_REQUEST["input_name"];
|
||||
$input_site["std_main_language_id"] = $_REQUEST["input_std_main_language_id"];
|
||||
$input_site["login_required"] = $login_required;
|
||||
$input_site["is_standard_site"] = $is_standard_site;
|
||||
$input_site["no_of_navigation"] = @mysqli_num_rows(@mysqli_query($GLOBALS['mysql_con'], "SELECT id FROM main_navigation WHERE main_site_id = '" . $_REQUEST["input_id"]."'"));
|
||||
$input_site["google_analytics_id"] = $_REQUEST["input_google_analytics_id"];
|
||||
$input_site["facebook_pixel_id"] = $_REQUEST["input_facebook_pixel_id"];
|
||||
$input_site["use_session_id"] = $use_session_id;
|
||||
$input_site["create_xml_sitemap"] = $create_xml_sitemap;
|
||||
$input_site["site_url"] = $_REQUEST["input_site_url"];
|
||||
$input_site["use_browser_language_detection"] = $use_browser_language_detection;
|
||||
$input_site["default_country_codes"] = $_REQUEST["input_default_country_codes"];
|
||||
|
||||
|
||||
require_once("edit_site_cardform.inc.php");
|
||||
}
|
||||
|
||||
function saveImage($filekey = 'input_image', $input_id) {
|
||||
$erlaubte_endungen = array("ico");
|
||||
$filename = strtolower($_FILES[$filekey]['name']);
|
||||
$filename_expl = explode(".", $filename);
|
||||
if (!in_array($filename_expl[count($filename_expl) - 1], $erlaubte_endungen)) {
|
||||
$messages = "<div class='errorbox'>" . $translation->get("error_slideshow_line2") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
$saveFilename = $input_id . "_" . time() . "_" . cleanFilename($_FILES[$filekey]['name']);
|
||||
define("PATH_FAVICON", "../../layout/frontend/b2c/dist/favicons/");
|
||||
move_uploaded_file($_FILES[$filekey]['tmp_name'], PATH_FAVICON . $saveFilename);
|
||||
|
||||
return $saveFilename;
|
||||
|
||||
}
|
||||
function delete_image() {
|
||||
$nav_id = $_POST['input_id'];
|
||||
$query = "SELECT * FROM main_site WHERE id =".$nav_id." LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$nav = @mysqli_fetch_array($result);
|
||||
if(!empty($nav)){
|
||||
$filename = $nav['image'];
|
||||
define("PATH_FAVICON", "../../layout/frontend/b2c/dist/favicons/");
|
||||
|
||||
if (file_exists(PATH_FAVICON . $filename)) {
|
||||
unlink(PATH_FAVICON . $filename);
|
||||
}
|
||||
$query = "UPDATE main_site SET
|
||||
image = ''
|
||||
WHERE id = '" . $nav_id . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
}
|
||||
156
mysyde/admin/edit_site_cardform.inc.php
Normal file
156
mysyde/admin/edit_site_cardform.inc.php
Normal file
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_site_card";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_site["id"] == "") {
|
||||
echo $translation->get("new_website");
|
||||
} else {
|
||||
echo sprintf($translation->get("edit_website"), $input_site["name"]);
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save', true, '', true)"); ?>
|
||||
<?php
|
||||
if ($input_site["id"] != "") {
|
||||
echo button("copy", $translation->get("copy_site"), $formname, "copy_site()");
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
if ($input_site["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete', true, '{$translation->get('delete_website_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_site["id"] ?>">
|
||||
<input name="input_std_main_language_id" type="hidden" value="<?= $input_site["std_main_language_id"] ?>">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("textkey"), "input_code", "code", $input_site["code"], 20) ?>
|
||||
<? input($translation->get("description"), "input_name", "text", $input_site["name"], 45) ?>
|
||||
<? input($translation->get("domain"), "input_site_url", "text", $input_site["site_url"], 80) ?>
|
||||
<? language_select($translation->get("default_language"), "input_std_main_language_id", $input_site["std_main_language_id"], FALSE, $input_site["id"]) ?>
|
||||
<? input($translation->get("google_analytics_id"), "input_google_analytics_id", "code", $input_site["google_analytics_id"], 45) ?>
|
||||
<? input($translation->get("facebook_pixel_id"), "input_facebook_pixel_id", "code", $input_site["facebook_pixel_id"], 45) ?>
|
||||
<? input($translation->get("use_as_default_site"), "input_is_standard_site", "checkbox", $input_site["is_standard_site"]) ?>
|
||||
<? input($translation->get("favicon"), "input_image", "file", $input_site["image"], 45, $disabled);
|
||||
$valFile = '';
|
||||
if($input_site['image'] != '' && $input_site['image'] != NULL){
|
||||
$valFile = $input_site['image'];
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="input_image_old" value="<?=$valFile;?>">
|
||||
<?php
|
||||
if($input_site["image"] != NULL && $input_site["image"] != ''){
|
||||
echo "<div class='img_container navigation_image'><img class='img-fluid' src='/layout/frontend/b2c/dist/favicons/".$input_site["image"]."'></div>";
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_image', true, '{$translation->get('delete_image')}', false)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<? input($translation->get("login_required"), "input_login_required", "checkbox", $input_site["login_required"]) ?>
|
||||
<? input($translation->get("use_session_id"), "input_use_session_id", "checkbox", $input_site["use_session_id"]) ?>
|
||||
<? input($translation->get("create_xml_sitemap"), "input_create_xml_sitemap", "checkbox", $input_site["create_xml_sitemap"]) ?>
|
||||
<? input($translation->get("number_menu_items"), "input_no_of_navigation", "code", $input_site["no_of_navigation"], 20, TRUE) ?>
|
||||
<? input($translation->get("use_browser_language_detection"), "input_use_browser_language_detection", "checkbox", $input_site["use_browser_language_detection"]) ?>
|
||||
<? input($translation->get("default_country_codes"), "input_default_country_codes", "textarea", $input_site["default_country_codes"]) ?>
|
||||
<h3><?php echo $translation->get("recaptcha"); ?></h3>
|
||||
<? input($translation->get("websiteKey"), "input_websitekey", "text", $input_site["websitekey"], 50) ?>
|
||||
<? input($translation->get("secretKey"), "input_secretkey", "text", $input_site["secretkey"], 50) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
function copy_site() {
|
||||
|
||||
if(!confirm("<?php echo $translation->get("copy_site_confirm"); ?>")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// loader wird engezeigt
|
||||
jQuery('#overlayLoader').show();
|
||||
jQuery('body').append(jQuery('<div />').attr("id", "copyOverlay"));
|
||||
|
||||
jQuery("#copyOverlay").append("<p><?php echo $translation->get("copy_start"); ?></p>");
|
||||
|
||||
copy_ajax_call("copy_site", 0);
|
||||
}
|
||||
|
||||
function copy_ajax_call(step, languageId) {
|
||||
var formData = new FormData(jQuery('#<?php echo $formname; ?>')[0]);
|
||||
formData.append("next_step", step);
|
||||
formData.append("copy_language_id", languageId);
|
||||
$.ajax({
|
||||
url : "?action=copy",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
cache : false,
|
||||
processData: false, // Don't process the files
|
||||
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
|
||||
success : function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
if(output.next_step != "") {
|
||||
jQuery("#copyOverlay").append("<p>"+ output.message +"</p>");
|
||||
copy_ajax_call(output.next_step, output.copy_language_id);
|
||||
return;
|
||||
}
|
||||
setTimeout(function() {
|
||||
$.each(output.message, function( index, value ) {
|
||||
jQuery('#overlayMessages').html(value);
|
||||
});
|
||||
|
||||
jQuery('#overlayLoader').hide();
|
||||
jQuery('#overlayContent').show();
|
||||
jQuery("#copyOverlay").remove();
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
dataType : 'json'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#copyOverlay {
|
||||
position:fixed;
|
||||
background-color:#fff;
|
||||
border: 2px solid #666;
|
||||
padding:10px;
|
||||
width:500px;
|
||||
left:50%;
|
||||
top:40px;
|
||||
margin-left:-250px;
|
||||
z-index:2004;
|
||||
min-height:100px;
|
||||
}
|
||||
</style>
|
||||
169
mysyde/admin/edit_site_functions.php
Normal file
169
mysyde/admin/edit_site_functions.php
Normal file
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
/**
|
||||
* Extra Site functions class
|
||||
*
|
||||
* User: tomaszbrniak
|
||||
* Date: 02.07.16
|
||||
* Time: 15:04
|
||||
*/
|
||||
|
||||
require_once("edit_language_functions.php");
|
||||
|
||||
class SiteFunctions {
|
||||
|
||||
/**
|
||||
* Error messages
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $errorMessages = array();
|
||||
|
||||
/**
|
||||
* Public message for user
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message = "";
|
||||
|
||||
/**
|
||||
* current language Id for copy
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $copyLanguageId = 0;
|
||||
|
||||
/**
|
||||
* copy website, all languages and contents
|
||||
*
|
||||
* @param $siteId - id from main_site
|
||||
* @return bool
|
||||
*/
|
||||
public function copy_site($siteId) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$columns = $this->get_column_names_to_copy("main_site");
|
||||
$query = "INSERT INTO main_site SELECT " . join(", ", $columns) . " FROM main_site where id = '" . $siteId."'";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
$newSiteId = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
if((int)$newSiteId <= 0) {
|
||||
$this->errorMessages[] = $translation->get("copy_failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->insert_copy_link($siteId, $newSiteId, "main_site");
|
||||
$query = "UPDATE main_site set name = CONCAT(name, ' (" . $translation->get("copy") . ")'), code = CONCAT(code, '_$newSiteId') WHERE id = " . $newSiteId;
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a language of a site
|
||||
*
|
||||
* @param $siteId
|
||||
* @return bool
|
||||
*/
|
||||
public function copy_language($siteId) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$query = "SELECT * FROM main_language where main_site_id = '" . $siteId."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if(@mysqli_num_rows($result) == 0) {
|
||||
$this->errorMessages[] = $translation->get("copy_no_language");
|
||||
return false;
|
||||
}
|
||||
|
||||
while($row = mysqli_fetch_array($result)) {
|
||||
$newLanguageId = $this->get_new_id($row['id'], "main_language");
|
||||
if($newLanguageId === false) {
|
||||
$this->message = $translation->get("copy_start_language") . " " . $row['name'];
|
||||
$this->copyLanguageId = $row['id'];
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
$newSiteId = $this->get_new_id($siteId, "main_site");
|
||||
|
||||
$LanguageFunctions = new LanguageFunctions($row['id'], $newSiteId);
|
||||
if(!$LanguageFunctions->copy_language()) {
|
||||
$this->errorMessages = $LanguageFunctions->errorMessages;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true; // kopieren hier erstmal abbrechen
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to store a new generated id of a table
|
||||
*
|
||||
* @param $oldId
|
||||
* @param $newId
|
||||
* @param $table
|
||||
*/
|
||||
protected function insert_copy_link($oldId, $newId, $table) {
|
||||
$query = "INSERT INTO copy_link (old_id, new_id, source_table, session_id) VALUES
|
||||
(
|
||||
" . $oldId . ",
|
||||
" . $newId . ",
|
||||
'" . $table . "',
|
||||
'" . session_id() . "'
|
||||
)";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get new generated id of a table for a specific oldId
|
||||
*
|
||||
* @param $oldId
|
||||
* @param $table
|
||||
* @return array|bool|null
|
||||
*/
|
||||
public function get_new_id($oldId, $table) {
|
||||
$query = "SELECT new_id FROM copy_link WHERE old_id = $oldId AND source_table = '" . $table . "' AND session_id = '" . session_id() . "'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if(@mysqli_num_rows($result) == 0) {
|
||||
return false;
|
||||
}
|
||||
$row = mysqli_fetch_array($result);
|
||||
return $row['new_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Column names for an insert statement to copy
|
||||
*
|
||||
* @param $table
|
||||
* @return array
|
||||
*/
|
||||
protected function get_column_names_to_copy($table) {
|
||||
$columns = array();
|
||||
$query = "SHOW COLUMNS FROM " . $table;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while($row = mysqli_fetch_array($result)) {
|
||||
if($row['Field'] == "id") {
|
||||
$columns[] = 'null';
|
||||
continue;
|
||||
}
|
||||
|
||||
if($row['Field'] == "main_language_id") {
|
||||
$columns[] = $this->newLanguageId;
|
||||
continue;
|
||||
}
|
||||
|
||||
if($row['Field'] == "modified_date") {
|
||||
$columns[] = time();
|
||||
continue;
|
||||
}
|
||||
|
||||
if($row['Field'] == "modified_user") {
|
||||
$columns[] = (int)$GLOBALS["admin_user"]['id'];
|
||||
continue;
|
||||
}
|
||||
|
||||
$columns[$row['Field']] = $row['Field'];
|
||||
}
|
||||
|
||||
return $columns;
|
||||
}
|
||||
}
|
||||
11
mysyde/admin/edit_site_header.inc.php
Normal file
11
mysyde/admin/edit_site_header.inc.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<ul class="bigicons_menu">
|
||||
<li>
|
||||
<a href="#"><img src="/layout/admin/img/2015/neu_big.png" /><br />Neu</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"><img src="/layout/admin/img/2015/edit_big.png" /><br />Bearbeiten</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"><img src="/layout/admin/img/2015/delete_big.png" /><br />Löschen</a>
|
||||
</li>
|
||||
</ul>
|
||||
43
mysyde/admin/edit_site_listform.inc.php
Normal file
43
mysyde/admin/edit_site_listform.inc.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_site_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
<? if ($GLOBALS['admin_user']['right_website_admin'] == 1 || $GLOBALS['admin_user']['is_super_user'] == 1) { ?>
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new', true)"); ?>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('top_websites'); ?></h1>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT main_site.id AS 'id', main_site.name AS '" . $translation->get("description") . "', main_site.code AS '" . $translation->get("textkey") . "', main_language.name AS '" . $translation->get("default_language") . "', (SELECT Count(id) FROM main_navigation WHERE main_site_id = main_site.id) AS '" . $translation->get("number_menu_items") . "' FROM main_site LEFT JOIN main_language ON main_site.std_main_language_id = main_language.id ORDER BY main_site.code ASC";
|
||||
$format = array('option', 'text', 'text', 'text', 'integer');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
if ($GLOBALS['admin_user']['right_website_admin'] == 1 || $GLOBALS['admin_user']['is_super_user'] == 1) {
|
||||
linklist($result, "form_site_list", $format, "input_id");
|
||||
}else{
|
||||
linklist($result, "form_site_list", $format, 'input_id', 'no_edit');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
119
mysyde/admin/edit_url_management.inc.php
Normal file
119
mysyde/admin/edit_url_management.inc.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<?
|
||||
|
||||
switch ($_REQUEST["action"]) {
|
||||
case 'edit':
|
||||
edit_url_management();
|
||||
break;
|
||||
case 'delete':
|
||||
delete_url_management();
|
||||
break;
|
||||
case 'new':
|
||||
require_once("edit_url_management_cardform.inc.php");
|
||||
break;
|
||||
case 'save':
|
||||
save_url_management();
|
||||
break;
|
||||
default:
|
||||
require_once("edit_url_management_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function edit_url_management() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "SELECT * FROM main_rewrite_rules WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_url_management = @mysqli_fetch_array($result);
|
||||
require_once("edit_url_management_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("edit_url_management_listform.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
function delete_url_management() {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$messages = array();
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM main_rewrite_rules WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
}
|
||||
require_once("edit_url_management_listform.inc.php");
|
||||
}
|
||||
|
||||
function save_url_management() {
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$active = ($_REQUEST["input_active"] == "on") ? '1' : '0';
|
||||
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "UPDATE main_rewrite_rules
|
||||
SET
|
||||
old_url = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_old_url"]) . "',
|
||||
new_url = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_new_url"]) . "',
|
||||
rewrite_code = '" . $_REQUEST["input_rewrite_code"] . "',
|
||||
active = " . $active . "
|
||||
WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
$input_url_management["id"] = $_REQUEST["input_id"];
|
||||
} else {
|
||||
$query = "INSERT INTO main_rewrite_rules
|
||||
(id, old_url, new_url, rewrite_code, active)
|
||||
VALUES (
|
||||
NULL,
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_old_url"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_new_url"]) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_rewrite_code"]) . "',
|
||||
" . $active . "
|
||||
)";
|
||||
$inserted = TRUE;
|
||||
}
|
||||
if (($_REQUEST["input_old_url"] == '') | ($_REQUEST["input_new_url"] == '') | ($_REQUEST["input_rewrite_code"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_url_management_fields") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
/*if ($_REQUEST["input_old_url"] <> urlencode($_REQUEST["input_old_url"])) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_url_management_encoding") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
if ($_REQUEST["input_new_url"] <> urlencode($_REQUEST["input_new_url"])) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_url_management_encoding") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}*/
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_rewrite_rules WHERE old_url = '" . $_REQUEST["input_old_url"] . "'");
|
||||
if ((@mysqli_num_rows($result) <> 0) && ($_REQUEST["input_id"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_url_management_exists") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
$input_site["id"] = $_REQUEST["input_id"];
|
||||
|
||||
// benoetigt fuer ajax calls
|
||||
if ($error === TRUE) {
|
||||
header('EDIT_ERROR: 1');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("url_management_msg_success1") . '</div>';
|
||||
$last_insert_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$input_url_management["id"] = $last_insert_id;
|
||||
} else {
|
||||
|
||||
$messages[] = '<div class="successbox">' . $translation->get("url_management_msg_success2") . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$input_url_management["old_url"] = $_REQUEST["input_old_url"];
|
||||
$input_url_management["new_url"] = $_REQUEST["input_new_url"];
|
||||
$input_url_management["rewrite_code"] = $_REQUEST["input_rewrite_code"];
|
||||
$input_url_management["active"] = $active;
|
||||
|
||||
|
||||
require_once("edit_url_management_cardform.inc.php");
|
||||
}
|
||||
|
||||
?>
|
||||
63
mysyde/admin/edit_url_management_cardform.inc.php
Normal file
63
mysyde/admin/edit_url_management_cardform.inc.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_url_management_card";
|
||||
$inputname = "input_id";
|
||||
|
||||
static $rewrite_codes = [
|
||||
'301',
|
||||
'302',
|
||||
];
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_url_management["id"] == "") {
|
||||
echo $translation->get("new_url");
|
||||
} else {
|
||||
echo sprintf($translation->get("edit_url"), $input_url_management["name"]);
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, "loadCard('save', true)"); ?>
|
||||
<?= button("save", $translation->get("save_and_close"), $formname, "loadCard('save', true, '', true)"); ?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
if ($input_url_management["id"] != "") {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete', true, '{$translation->get('delete_url_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
?>
|
||||
<?= button("reset", $translation->get("restore"), $formname, "?action=edit", "", FALSE); ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_url_management["id"] ?>">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("old_url"), "input_old_url", "text", $input_url_management["old_url"], 255) ?>
|
||||
<? input($translation->get("active"), "input_active", "checkbox", $input_url_management["active"]) ?>
|
||||
</td>
|
||||
<td>
|
||||
<? input($translation->get("new_url"), "input_new_url", "text", $input_url_management["new_url"], 255) ?>
|
||||
<? input_select($translation->get('rewrite_code'),'input_rewrite_code',$rewrite_codes,$rewrite_codes,$input_url_management["rewrite_code"])?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
44
mysyde/admin/edit_url_management_listform.inc.php
Normal file
44
mysyde/admin/edit_url_management_listform.inc.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_url_management_list";
|
||||
$inputname = "input_id";
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new', true)"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<h1><?php echo get_translation('url_management'); ?></h1>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT main_rewrite_rules.id AS 'id', main_rewrite_rules.old_url AS '" . $translation->get("old_url") . "', main_rewrite_rules.new_url AS '" . $translation->get("new_url") . "', main_rewrite_rules.rewrite_code AS '" . $translation->get("rewrite_code") . "',
|
||||
(
|
||||
case when main_rewrite_rules.active = 1 THEN '" . $translation->get("yes") . "' ELSE '" . $translation->get("no") . "'
|
||||
END
|
||||
) AS '" . $translation->get("active") . "'
|
||||
FROM main_rewrite_rules ORDER BY main_rewrite_rules.id DESC";
|
||||
|
||||
|
||||
|
||||
$format = array('option', 'text', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, "form_site_list", $format, "input_id");
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
18
mysyde/admin/editmenu.inc.php
Normal file
18
mysyde/admin/editmenu.inc.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?
|
||||
// Inhalt laden
|
||||
|
||||
$adminMenu = \DynCom\mysyde\common\classes\Adminmenu::get();
|
||||
|
||||
if ($_GET["level_1"] != "") {
|
||||
$include = $adminMenu[$_GET["level_1"]]['editmenu'];
|
||||
}
|
||||
|
||||
if ($_GET["level_2"] != "") {
|
||||
$include = $adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['editmenu'];
|
||||
}
|
||||
|
||||
if (($include <> '') && (file_exists($include))) {
|
||||
require_once($include);
|
||||
}
|
||||
|
||||
?>
|
||||
1
mysyde/admin/filegallery.inc.php
Normal file
1
mysyde/admin/filegallery.inc.php
Normal file
@@ -0,0 +1 @@
|
||||
<iframe class='filegallery_frame' src="/components/files/filegallery_content.inc.php?time=<?= time()?>" frameborder="0"></iframe>
|
||||
9
mysyde/admin/filemanager.inc.php
Normal file
9
mysyde/admin/filemanager.inc.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
require_once '../../plugins/ckfinder/ckfinder.php';
|
||||
|
||||
// You can use the "CKFinder" class to render CKFinder in a page:
|
||||
$finder = new CKFinder();
|
||||
$finder->BasePath = '/plugins/ckfinder/'; // The path for the installation of CKFinder (default = "/ckfinder/").
|
||||
//$finder->SelectFunction = 'ShowFileInfo' ;
|
||||
$finder->Create();
|
||||
?>
|
||||
91
mysyde/admin/forget_password.inc.php
Normal file
91
mysyde/admin/forget_password.inc.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<? require_once("../common/version_comment.inc.php"); ?>
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get('translation');
|
||||
?>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<title><?php echo $translation->get('backend_forget_title'); ?></title>
|
||||
<link
|
||||
href="/layout/admin/css/mysyde.css?t=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/layout/admin/css/mysyde.css')?>"
|
||||
rel="stylesheet" type="text/css" />
|
||||
<link
|
||||
href="/layout/admin/css/responsive.css?t=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/layout/admin/css/responsive.css')?>"
|
||||
rel="stylesheet" type="text/css" />
|
||||
|
||||
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/layout/admin/img/2016/favicons/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" href="/layout/admin/img/2016/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="/layout/admin/img/2016/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="/layout/admin/img/2016/favicons/manifest.json">
|
||||
<link rel="mask-icon" href="/layout/admin/img/2016/favicons/safari-pinned-tab.svg" color="#99c137">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body class="login">
|
||||
<div id="login-container">
|
||||
|
||||
<div id="login">
|
||||
|
||||
<div class="login-wrapper">
|
||||
<div class="login-left-content">
|
||||
<div id="mysyde-logo"><img src="/layout/admin/img/icons/mysyde-icon.png" alt="MySyde Icon"></div>
|
||||
<div id="login_1"><?php echo $translation->get('backend_forget_title'); ?></div>
|
||||
|
||||
<p>
|
||||
<?php if(!isset($_SESSION['user_email'])){ ?>
|
||||
<?php echo $translation->get('backend_forget_description'); ?>
|
||||
<?php }else{
|
||||
echo $translation->get('backend_forget_code');
|
||||
} ?>
|
||||
</p>
|
||||
|
||||
<div class="forgetError"><p><?=$_SESSION['forget_error'];?></p></div>
|
||||
<div id="login_2">
|
||||
|
||||
<form name="form_admin_password" id="form_admin_password" action="?action=forget_password" method="post">
|
||||
<?php if(!isset($_SESSION['user_email'])){ ?>
|
||||
<div class="label"><label for="input_login">Email
|
||||
:</label></div>
|
||||
<div class="input"><input class="code" type="email" name="input_login" id="input_login" /></div>
|
||||
<?php } else{ ?>
|
||||
<div class="label"><label for="input_login">Code
|
||||
:</label></div>
|
||||
<div class="input"><input class="code" type="text" name="password_recovery_code" id="input_login" /></div>
|
||||
<div class="input"><input class="code" type="hidden" name="user_email" value="<?= $_SESSION['user_email'];?>" /></div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="button-wrapper">
|
||||
|
||||
<input class="button" name="" type="submit"
|
||||
value="Senden" />
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="video-wrapper">
|
||||
<video src="https://www.breadcrumb-solutions.de/mysyde-login-animation.mov"autoplay="true" height="100%" loop="true" muted="true" ></video>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
3
mysyde/admin/frontend_content_menu.inc.php
Normal file
3
mysyde/admin/frontend_content_menu.inc.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?
|
||||
navigation_treemenu($site, $language, $navigation, 1, 5);
|
||||
?>
|
||||
398
mysyde/admin/header.inc.php
Normal file
398
mysyde/admin/header.inc.php
Normal file
@@ -0,0 +1,398 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get('translation');
|
||||
$adminMenu = \DynCom\mysyde\common\classes\Adminmenu::get(0);
|
||||
|
||||
function check_if_betriebsrat_role($admin_user) {
|
||||
// Angepasste SQL-Abfrage, um nach is_betriebsrat = 1 zu filtern
|
||||
$query = "SELECT * FROM main_admin_user WHERE is_betriebsrat = 1 AND id = " . $admin_user;
|
||||
|
||||
// Führe die Abfrage aus
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
// Prüfe, ob das Ergebnis mindestens eine Zeile hat
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
// Wenn mindestens ein Eintrag gefunden wurde, gibt die Funktion 1 zurück
|
||||
return 1;
|
||||
} else {
|
||||
// Wenn kein Eintrag gefunden wurde, gibt die Funktion 0 zurück
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
$is_betriebsrat = check_if_betriebsrat_role($admin_user['id']);
|
||||
|
||||
|
||||
|
||||
function create_collections_menu($site, $language, $translation) {
|
||||
// Greife auf die globale Variable $is_betriebsrat zu
|
||||
global $is_betriebsrat;
|
||||
|
||||
// Wenn $is_betriebsrat gleich 1 ist, gib "Test" aus und beende die Funktion
|
||||
if ($is_betriebsrat == 1) {
|
||||
?>
|
||||
<li class="structure_nav">
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == $row['id']) ? 'active' : ''; ?>" href="/mysyde/awo/de/collections/17/">Aktuelles</a>
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == $row['id']) ? 'active' : ''; ?>" href="/mysyde/awo/de/knowledge/category/">Wiki Kategorien</a>
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == $row['id']) ? 'active' : ''; ?>" href="/mysyde/awo/de/collections/3/">Wiki Beiträge</a>
|
||||
|
||||
</li>
|
||||
<?php
|
||||
return; // Beende die Funktion
|
||||
}
|
||||
|
||||
// Andernfalls, führe die normale Logik zur Menüerstellung aus
|
||||
$query = "SELECT * FROM main_collection_setup WHERE (main_language_id = " . (int)$GLOBALS["language"]['id'] . " OR all_languages = 1) AND show_in_menu = 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
// Prüfe, ob das Ergebnis mindestens eine Zeile hat
|
||||
if (@mysqli_num_rows($result) == 0) {
|
||||
return; // Wenn kein Ergebnis vorhanden ist, beende die Funktion
|
||||
}
|
||||
|
||||
// Schleife durch die Ergebnisse und erstelle das Menü
|
||||
while ($row = @mysqli_fetch_assoc($result)) {
|
||||
?>
|
||||
<li class='structure_nav'>
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == $row['id']) ? 'active' : ''; ?>" href="<?php echo get_menu_link('collections/'.$row['id'], $site, $language); ?>"><?php echo $row['description'] ?></a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
// var_dump($GLOBALS);
|
||||
|
||||
|
||||
|
||||
|
||||
function create_module_menu($site, $language, $translation, $adminMenu){
|
||||
global $is_betriebsrat;
|
||||
|
||||
// Wenn $is_betriebsrat gleich 1 ist, gib "Test" aus und beende die Funktion
|
||||
if ($is_betriebsrat == 1) {
|
||||
return; // Beende die Funktion
|
||||
}
|
||||
|
||||
$query = "SELECT * FROM main_module WHERE active = 1 AND code != 'basic'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 0) {
|
||||
return;
|
||||
}
|
||||
$i = 1;
|
||||
$count = @mysqli_num_rows($result);
|
||||
|
||||
while ($i <= $count) {
|
||||
$row = @mysqli_fetch_assoc($result);
|
||||
$second_menu = FALSE;
|
||||
if(isset($adminMenu[$row['code']])){
|
||||
if(isset($adminMenu[$row['code']]['subsites'])){
|
||||
$second_menu = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
$href = '#';
|
||||
|
||||
if($second_menu == TRUE){?>
|
||||
<li class='structure_nav toggle_li parent_dropdown'>
|
||||
<a class=" <?php echo (isset($_GET["level_1"]) && $_GET["level_1"] == $row['code']) ? 'active' : ''; ?>" href="<?= $href?>"><?php echo $row['title'] ?></a>
|
||||
<ul class='site_dropdown_new'>
|
||||
<?php
|
||||
$x = 0;
|
||||
foreach ($adminMenu[$row['code']]['subsites'] as $subsite) {
|
||||
$key = array_keys($adminMenu[$row['code']]['subsites']);
|
||||
?>
|
||||
<li class=''>
|
||||
<a class=" <?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == $key[$x]) ? 'active' : ''; ?>" href="<?php echo get_menu_link($row['code']."/".$key[$x], $site, $language); ?>"><?php echo $subsite['name'] ?></a>
|
||||
</li>
|
||||
<?php
|
||||
if($adminMenu[$row['code']]['name'] == 'Firmenwiki'){?>
|
||||
<li class=''>
|
||||
<a class=" <?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == $key[$x]) ? 'active' : ''; ?>" href="<?php echo get_menu_link('collections/3', $site, $language); ?>">Beiträge</a>
|
||||
</li>
|
||||
<?php }
|
||||
$x++;
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php }else{ ?>
|
||||
<li class='structure_nav toggle_li'>
|
||||
<a class=" <?php echo (isset($_GET["level_1"]) && $_GET["level_1"] == $row['code']) ? 'active' : ''; ?>" href="<?php echo get_menu_link($row['code'], $site, $language); ?>"><?php echo $row['title'] ?></a>
|
||||
</li>
|
||||
<?php }
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
<div class='main_menu main_navigation'>
|
||||
|
||||
<!-- Kollektionen -->
|
||||
<div class="group-wrapper collections ">
|
||||
<?php
|
||||
if ($is_betriebsrat == 0) {
|
||||
?>
|
||||
<li class="structure_nav group small">
|
||||
<a href="<?= get_menu_link('collections', $site, $language);?>" class="<?= (isset($_GET["level_1"]) && $_GET["level_1"] == "collections") ? 'active' : ''; ?>"><svg
|
||||
xmlns="http://www.w3.org/2000/svg" width="14.701" height="20.582" viewBox="0 0 14.701 20.582">
|
||||
<g id="kollektion" transform="translate(2139 296)">
|
||||
<path id="Pfad_1" data-name="Pfad 1"
|
||||
d="M21.23,7.617,16.085,2.471a.667.667,0,0,0-.514-.22H8.22a1.474,1.474,0,0,0-1.47,1.47V21.363a1.474,1.474,0,0,0,1.47,1.47H19.981a1.474,1.474,0,0,0,1.47-1.47V8.131a.668.668,0,0,0-.22-.514Zm-5.66-3.6,4.116,4.116H15.571Zm4.41,17.347H8.22V3.72H14.1v4.41a1.474,1.474,0,0,0,1.47,1.47h4.41Z"
|
||||
transform="translate(-2145.75 -298.251)" fill="#fff" />
|
||||
<path id="Pfad_2" data-name="Pfad 2" d="M11.25,24.75h8.821v1.47H11.25Z"
|
||||
transform="translate(-2147.31 -306.049)" fill="#fff" />
|
||||
<path id="Pfad_3" data-name="Pfad 3" d="M11.25,18h8.821v1.47H11.25Z"
|
||||
transform="translate(-2147.31 -303.71)" fill="#fff" />
|
||||
</g>
|
||||
</svg><?php echo $translation->get("intranet_posts"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php create_collections_menu($site, $language, $translation); ?>
|
||||
</div>
|
||||
|
||||
<!-- Module -->
|
||||
<div class="group-wrapper module">
|
||||
<li class="structure_nav group small toggle_trigger">
|
||||
<a href="#" class="<?php echo (isset($_GET["level_1"]) && $_GET["level_1"] == "module") ? 'active' : ''; ?>"><svg xmlns="http://www.w3.org/2000/svg" width="36" height="35.827" viewBox="0 0 36 35.827">
|
||||
<g id="box-seam" transform="translate(0 -0.173)">
|
||||
<path id="Pfad_26" data-name="Pfad 26" d="M18.419,2.5a1.125,1.125,0,0,0-.837,0L4.154,7.875l5.409,2.162L23.409,4.5Zm8.019,3.208L12.591,11.25,18,13.412,31.846,7.875,26.437,5.713Zm7.313,3.825-14.625,5.85V33.212l14.625-5.85V9.54ZM16.875,33.215V15.386L2.25,9.538V27.365ZM16.747.414a3.375,3.375,0,0,1,2.507,0l16.04,6.417A1.125,1.125,0,0,1,36,7.875v19.49a2.25,2.25,0,0,1-1.415,2.088L18.419,35.919a1.125,1.125,0,0,1-.837,0L1.417,29.453A2.25,2.25,0,0,1,0,27.365V7.875A1.125,1.125,0,0,1,.707,6.831Z" fill-rule="evenodd"/>
|
||||
</g>
|
||||
</svg>
|
||||
<?php echo $adminMenu['module']['name']; ?></a>
|
||||
</li>
|
||||
<div class="toggle_menu">
|
||||
<li class="structure_nav toggle_li">
|
||||
<a class="<?php echo (isset($_GET["level_1"]) && $_GET["level_1"] == "contactform") ? 'active' : ''; ?>" href="<?php echo get_menu_link('contactform', $site, $language); ?>"><?php echo $translation->get('left_contactforms'); ?></a>
|
||||
</li>
|
||||
<li class="structure_nav toggle_li">
|
||||
<a class="<?php echo (isset($_GET["level_1"]) && $_GET["level_1"] == "photo_approve") ? 'active' : ''; ?>" href="<?php echo get_menu_link('photo_approve', $site, $language); ?>"><?php echo $translation->get('photo_approve'); ?></a>
|
||||
</li>
|
||||
<?php create_module_menu($site, $language, $translation, $adminMenu); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
if ($is_betriebsrat == 0) {
|
||||
?>
|
||||
<div class='group-wrapper module'>
|
||||
<li class="structure_nav group small">
|
||||
<a class='cms' href="#" class="<?php echo (isset($_GET["level_1"]) && $_GET["level_1"] == "intranet") ? 'active' : ''; ?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="31.5" height="31.5" viewBox="0 0 31.5 31.5">
|
||||
<g id="dashboard" transform="translate(-2.25 -2.25)">
|
||||
<path id="Pfad_135" data-name="Pfad 135" d="M27,23.625h2.25V29.25H27Z"/>
|
||||
<path id="Pfad_136" data-name="Pfad 136" d="M22.5,18h2.25V29.25H22.5Z"/>
|
||||
<path id="Pfad_137" data-name="Pfad 137" d="M12.375,29.25A5.632,5.632,0,0,1,6.75,23.625H9a3.375,3.375,0,1,0,3.375-3.375V18a5.625,5.625,0,0,1,0,11.25Z"/>
|
||||
<path id="Pfad_138" data-name="Pfad 138" d="M31.5,2.25H4.5A2.252,2.252,0,0,0,2.25,4.5v27A2.252,2.252,0,0,0,4.5,33.75h27a2.253,2.253,0,0,0,2.25-2.25V4.5A2.252,2.252,0,0,0,31.5,2.25Zm0,10.125H15.75V4.5H31.5ZM13.5,4.5v7.875h-9V4.5Zm-9,27V14.625h27l0,16.875Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
<?php echo $translation->get("intranet_basics") ?></a>
|
||||
</li>
|
||||
<div class="toggle_menu">
|
||||
<li class="structure_nav">
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == "config_contact") ? 'active' : ''; ?>" href="<?php echo get_menu_link('intranet/config_contact', $site, $language); ?>"><?php echo $translation->get('top_contact'); ?></a>
|
||||
</li>
|
||||
<li class="structure_nav">
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == "config_mandant") ? 'active' : ''; ?>" href="<?php echo get_menu_link('intranet/config_mandant', $site, $language); ?>"><?php echo $translation->get('top_mandant'); ?></a>
|
||||
</li>
|
||||
<li class="structure_nav">
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == "config_department") ? 'active' : ''; ?>" href="<?php echo get_menu_link('intranet/config_department', $site, $language); ?>"><?php echo $translation->get('top_department'); ?></a>
|
||||
</li>
|
||||
<li class="structure_nav">
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == "config_space") ? 'active' : ''; ?>" href="<?php echo get_menu_link('intranet/config_space', $site, $language); ?>"><?php echo $translation->get('top_space'); ?></a>
|
||||
</li>
|
||||
<li class="structure_nav">
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == "config_facility") ? 'active' : ''; ?>" href="<?php echo get_menu_link('intranet/config_facility', $site, $language); ?>"><?php echo $translation->get('Einrichtungen'); ?></a>
|
||||
</li>
|
||||
<li class="structure_nav">
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == "config_role") ? 'active' : ''; ?>" href="<?php echo get_menu_link('intranet/config_role', $site, $language); ?>"><?php echo $translation->get('top_role'); ?></a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<!-- CMS-System -->
|
||||
<li class="structure_nav group small toggle_trigger">
|
||||
<a class="cms" href="#" class="<?php echo (isset($_GET["level_1"]) && $_GET["level_1"] == "structure") ? 'active' : ''; ?>"> <svg
|
||||
xmlns="http://www.w3.org/2000/svg" width="19.548" height="19.557" viewBox="0 0 19.548 19.557">
|
||||
<g id="struktur" transform="translate(2141 225)">
|
||||
<path id="Pfad_4" data-name="Pfad 4" d="M10.4,7.448a.7.7,0,1,1-.7-.7A.7.7,0,0,1,10.4,7.448Z"
|
||||
transform="translate(-2145.811 -228.957)" fill="#fff" />
|
||||
<path id="Pfad_5" data-name="Pfad 5"
|
||||
d="M19.7,16.31V13.42a1.4,1.4,0,0,0-1.4-1.4H12.722V9.231h6.283a1.4,1.4,0,0,0,1.4-1.4V3.646a1.4,1.4,0,0,0-1.4-1.4H5.042a1.4,1.4,0,0,0-1.4,1.4V7.835a1.4,1.4,0,0,0,1.4,1.4h6.283v2.793H5.741a1.4,1.4,0,0,0-1.4,1.4v2.89a2.793,2.793,0,1,0,1.4,0V13.42h5.585v2.793H9.231V21.8h5.585V16.213H12.722V13.42h5.585v2.89a2.793,2.793,0,1,0,1.4,0Zm-13.265,2.7a1.4,1.4,0,1,1-1.4-1.4A1.4,1.4,0,0,1,6.439,19.005Zm6.981-1.4V20.4H10.627V17.609ZM5.042,7.835V3.646H19.005V7.835ZM19.005,20.4a1.4,1.4,0,1,1,1.4-1.4A1.4,1.4,0,0,1,19.005,20.4Z"
|
||||
transform="translate(-2143.25 -227.25)" fill="#fff" />
|
||||
</g>
|
||||
</svg>
|
||||
<?php echo $translation->get("cms") ?></a>
|
||||
</li>
|
||||
<div class="toggle_menu">
|
||||
<li class="structure_nav toggle_li">
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == "sites") ? 'active' : ''; ?>" href="<?php echo get_menu_link('structure/sites', $site, $language); ?>"><?php echo $translation->get('left_sites'); ?></a>
|
||||
</li>
|
||||
<?php
|
||||
if ($is_betriebsrat == 0) {
|
||||
?>
|
||||
<li class="structure_nav toggle_li">
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == "navigation") ? 'active' : ''; ?>" href="<?php echo get_menu_link('structure/navigation', $site, $language); ?>"><?php echo $translation->get('left_navigation'); ?></a>
|
||||
</li>
|
||||
<li class="structure_nav toggle_li">
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == "components") ? 'active' : ''; ?>" href="<?php echo get_menu_link('structure/components', $site, $language); ?>"><?php echo $translation->get('left_components'); ?></a>
|
||||
<li class="structure_nav toggle_li">
|
||||
<a class="<?php echo (isset($_GET['level_2']) && $_GET['level_2'] == 'files') ? 'active' : ''; ?>" href="<?php echo get_menu_link('structure/files', $site, $language); ?>"><?php echo $translation->get('left_files'); ?></a>
|
||||
</li>
|
||||
<li class="structure_nav toggle_li">
|
||||
<a class="<?php echo (isset($_GET['level_2']) && $_GET['level_2'] == 'files') ? 'active' : ''; ?>" href="<?php echo get_menu_link('structure/video_uploud', $site, $language); ?>"><?php echo $translation->get('video_uploud'); ?></a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='main_menu'>
|
||||
<div class="sitelanguage-version"><?php echo current_website_language($site, $language); ?><div class="version">v.23.1</div></div>
|
||||
<div class="theme-switch">
|
||||
<div>
|
||||
<input type="checkbox" class="checkbox" id="theme-toggle" />
|
||||
<label for="theme-toggle"></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
if ($is_betriebsrat == 0) {
|
||||
?>
|
||||
<div class="menu-wrapper">
|
||||
|
||||
<li class="topmenu gray_arrow" id="user_menu">
|
||||
<a href="#"><?php echo $translation->get("signed_user") . ": " . $admin_user["name"]; ?></i></a>
|
||||
<ul>
|
||||
<li class="menu_userdata">
|
||||
<a href="<?php echo get_menu_link('config/config_users', $site, $language, "?action=open_card&input_id=" . $admin_user['id']); ?>"><?php echo $translation->get('my_account'); ?></a>
|
||||
</li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="menu_link_logout">
|
||||
<a href="?action=admin_logout"><?php echo $translation->get('top_logout'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="topmenu" id="settings_menu">
|
||||
<a href="#"><i class="bi bi-sliders"></i></a>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="<?php echo get_menu_link('config/config_websites', $site, $language); ?>"><?php echo $translation->get('top_websites'); ?></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo get_menu_link('config/config_language', $site, $language); ?>"><?php echo $translation->get('top_languages'); ?></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo get_menu_link('config/config_users', $site, $language); ?>"><?php echo $translation->get('top_users'); ?></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo get_menu_link('config/config_layouts', $site, $language); ?>"><?php echo $translation->get('top_layouts'); ?></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo get_menu_link('config/config_collections', $site, $language); ?>"><?php echo $translation->get('top_collections_config'); ?></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo get_menu_link('config/config_url_management', $site, $language); ?>"><?php echo $translation->get('url_management'); ?></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo get_menu_link('config/sitemap', $site, $language); ?>"><?php echo $translation->get('sitemap'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="topmenu" id="site_language_menu">
|
||||
<?php echo $translation->get("top_config_websites") ?>
|
||||
<ul class="site_dropdown">
|
||||
<li>
|
||||
<?php $siteLanguage = get_site_language_menu($site, $language); ?>
|
||||
</li>
|
||||
<li>
|
||||
<?php echo $siteLanguage['siteLanguageMenu']; ?>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- <li class="topmenu stats">
|
||||
<a href="<?php echo get_menu_link('statistics', $site, $language); ?>" class="<?php echo (isset($_GET["level_1"]) && $_GET["level_1"] == "statistics") ? 'active' : ''; ?>">
|
||||
|
||||
<?php echo $adminMenu['statistics']['name']; ?></a>
|
||||
<ul class="site_dropdown statistics">
|
||||
<li>
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == "mail_stat") ? 'active' : ''; ?>" href="<?php echo get_menu_link('statistics/mail_stat', $site, $language); ?>"><?php echo $translation->get('left_mail_stat'); ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="<?php echo (isset($_GET["level_2"]) && $_GET["level_2"] == "access_stat") ? 'active' : ''; ?>" href="<?php echo get_menu_link('statistics/access_stat', $site, $language); ?>"><?php echo $translation->get('left_access_stat'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li> -->
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<script>
|
||||
//Dark Mode Light Mode Switch Header
|
||||
var toggle = document.getElementById("theme-toggle");
|
||||
|
||||
var storedTheme = localStorage.getItem('theme') || (window.matchMedia("(prefers-color-scheme: light)").matches ? "dark" : "light");
|
||||
if (storedTheme)
|
||||
document.documentElement.setAttribute('data-theme', storedTheme)
|
||||
|
||||
|
||||
toggle.onclick = function() {
|
||||
var currentTheme = document.documentElement.getAttribute("data-theme");
|
||||
var targetTheme = "light";
|
||||
|
||||
if (currentTheme === "light") {
|
||||
targetTheme = "dark";
|
||||
}
|
||||
|
||||
document.documentElement.setAttribute('data-theme', targetTheme)
|
||||
localStorage.setItem('theme', targetTheme);
|
||||
};
|
||||
|
||||
const menuToggle = document.querySelector('.menu-toggle');
|
||||
|
||||
menuToggle.addEventListener('click', () => {
|
||||
const isOpened = menuToggle.getAttribute('aria-expanded') === "true";
|
||||
isOpened ? closeMenu() : openMenu();
|
||||
});
|
||||
|
||||
function openMenu() {
|
||||
menuToggle.setAttribute('aria-expanded', "true");
|
||||
}
|
||||
function closeMenu() {
|
||||
menuToggle.setAttribute('aria-expanded', "false");
|
||||
}
|
||||
|
||||
$(".parent_dropdown").click(function(){
|
||||
$(this).children(".site_dropdown_new").toggle();
|
||||
});
|
||||
|
||||
$("li.structure_nav.group.small").click(function(){
|
||||
$(this).toggleClass("rotate_chevron");
|
||||
$(this).next().children(".toggle_li").toggle();
|
||||
});
|
||||
</script>
|
||||
44
mysyde/admin/help.php
Normal file
44
mysyde/admin/help.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
?>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('top_help'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<h2><?php echo $translation->get("support"); ?></h2>
|
||||
<p>
|
||||
Sie haben Fragen oder benötigen Support zum Mysyde-CMS? Senden Sie uns einfach eine Anfrage über das Kontaktformular.<br /><br />
|
||||
<span class="bold">Zugang zum Support-Formular</span><br />
|
||||
<a target="_blank" href="https://www.breadcrumb-solutions.de/bc/de/kontakt/">breadcrumb-solutions.de/kontakt</a>
|
||||
</p>
|
||||
<p> </p>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<h2><?php echo $translation->get("contact"); ?></h2>
|
||||
<img width="200" style="border-width: 0px; border-style: solid;" src="/userdata/images/bc_logo.svg" alt="breadcrumb mediasolutions GmbH - Ihre Multimedia-Agentur">
|
||||
<p>
|
||||
<br />
|
||||
<span class="bold">breadcrumb mediasolutions GmbH</span>
|
||||
<br />
|
||||
Kressenstein 26<br />
|
||||
95326 Kulmbach<br /><br />
|
||||
|
||||
Tel: 09221 80246-60<br />
|
||||
Fax: 09221 80246-62<br />
|
||||
<br />
|
||||
<a href="mailto:info@breadcrumb-solutions.de">info@breadcrumb-solutions.de</a><br />
|
||||
<a href="http://www.breadcrumb-solutions.de" target="_blank">www.breadcrumb-solutions.de</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
82
mysyde/admin/ip_geo_location.inc.php
Normal file
82
mysyde/admin/ip_geo_location.inc.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?
|
||||
|
||||
if ( isset($_REQUEST["update_geo_ip_files"])) {
|
||||
update_geo_ip_files();
|
||||
}
|
||||
|
||||
function update_geo_ip_files()
|
||||
{
|
||||
$baseDirectory = rtrim(dirname(dirname(__DIR__)), '/');
|
||||
$envDir = rtrim($baseDirectory, '/') . '/config/geolocation';
|
||||
if (is_dir($envDir)) {
|
||||
$dotenv = new \Dotenv\Dotenv($envDir);
|
||||
$dotenv->load();
|
||||
}
|
||||
|
||||
//file_get_contents(getenv('Geo_Lite_Country_File_URL'));
|
||||
// file_get_contents(getenv('Geo_Lite_Country_IPV6_File_URL'));
|
||||
$fileName = "GeoIP.dat.gz";
|
||||
$url = getenv('Geo_Lite_Country_File_URL');
|
||||
$destination = $envDir."/".$fileName;
|
||||
$fp = fopen ($destination, 'w+');
|
||||
$ch = curl_init();
|
||||
curl_setopt( $ch, CURLOPT_URL, $url );
|
||||
curl_setopt( $ch, CURLOPT_BINARYTRANSFER, true );
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, false );
|
||||
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
|
||||
|
||||
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 10 );
|
||||
curl_setopt( $ch, CURLOPT_FILE, $fp );
|
||||
curl_exec( $ch );
|
||||
curl_close( $ch );
|
||||
fclose( $fp );
|
||||
|
||||
exec('gunzip '.$destination);
|
||||
|
||||
$fileName = "GeoIPv6.dat.gz";
|
||||
$url = getenv('Geo_Lite_Country_IPV6_File_URL');
|
||||
$destination = $envDir."/".$fileName;
|
||||
$fp = fopen ($destination, 'w+');
|
||||
$ch = curl_init();
|
||||
curl_setopt( $ch, CURLOPT_URL, $url );
|
||||
curl_setopt( $ch, CURLOPT_BINARYTRANSFER, true );
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, false );
|
||||
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
|
||||
|
||||
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 10 );
|
||||
curl_setopt( $ch, CURLOPT_FILE, $fp );
|
||||
curl_exec( $ch );
|
||||
curl_close( $ch );
|
||||
fclose( $fp );
|
||||
|
||||
exec('gunzip '.$destination);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_geoip";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("down", $translation->get("update"), $formname, " document.getElementById('".$formname."').submit()"); ?>
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('geoip'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
|
||||
<input type="submit" style="visibility: hidden;" class="button_save" id="update_geoip_button" name="update_geo_ip_files" value = "<? echo get_translation("update_geo_ip_files") ?>"> </input>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
74
mysyde/admin/licence.inc.php
Normal file
74
mysyde/admin/licence.inc.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?
|
||||
$messages = array();
|
||||
|
||||
switch ($_GET["action"]) {
|
||||
case 'save':
|
||||
save_licence($messages);
|
||||
break;
|
||||
default:
|
||||
show_licence();
|
||||
break;
|
||||
}
|
||||
|
||||
function show_licence() {
|
||||
$query = "SELECT * FROM main_setup";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_licence_data = @mysqli_fetch_array($result);
|
||||
return $input_licence_data;
|
||||
}
|
||||
}
|
||||
|
||||
function save_licence( &$messages ) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$query = "SELECT * FROM main_setup";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) < 1) {
|
||||
$query = "INSERT INTO main_setup(licence_no, licence_licensee, licence_content, licence_extended_licences, licence_hosting, licence_activation_date ) VALUES ('" . $_POST['input_licence_no'] . "', '" . $_POST['input_licensee'] . "','" . $_POST['licence_content'] . "', '" . $_POST['input_extended_licence_no'] . "', '" . $_POST['input_licence_hosting'] . "','" . $_POST['input_licence_activation_date'] . "')";
|
||||
} else {
|
||||
$query = "UPDATE main_setup SET licence_no = '" . $_POST['input_licence_no'] . "', licence_licensee = '" . $_POST['input_licensee'] . "', licence_content = '" . $_POST['input_licence_content'] . "', licence_extended_licences = '" . $_POST['input_extended_licence_no'] . "', licence_hosting = '" . $_POST['input_licence_hosting'] . "', licence_activation_date = '" . $_POST['input_licence_activation_date'] . "' WHERE id = 1";
|
||||
}
|
||||
if (@mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
$messages[] = "<div class=\"successbox\">" . $translation->get("license_save_success") . "</div>";
|
||||
} else {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("license_save_error") . "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$disabled = TRUE;
|
||||
|
||||
?>
|
||||
<? $formname = "form_layout_list"; ?>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('top_license'); ?></h1>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
// include license
|
||||
include("licence.php");
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?= input($translation->get("licensenumber"), "input_licence_no", "text", $licence['lizenznummer'], 45, $disabled) ?>
|
||||
<?= input($translation->get("licensed_party"), "input_licensee", "smalltextarea", html_entity_decode($licence['lizenznehmer']), 250, $disabled) ?>
|
||||
|
||||
<?= input($translation->get("activation_date"), "input_licence_activation_date", "date", $licence['freischaltdatum'], 45, $disabled) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
9
mysyde/admin/licence.php
Normal file
9
mysyde/admin/licence.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
$licence = array(
|
||||
'lizenznummer' => '420-024',
|
||||
'lizenznehmer' => 'breadcrumb mediasolutions GmbH',
|
||||
'vertragsinhalt' => '2',
|
||||
'erweiterungslizenzen' => '3',
|
||||
'hosting' => '4',
|
||||
'freischaltdatum' => '01.12.2021'
|
||||
);
|
||||
138
mysyde/admin/login.inc.php
Normal file
138
mysyde/admin/login.inc.php
Normal file
@@ -0,0 +1,138 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<? require_once("../common/version_comment.inc.php"); ?>
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get('translation');
|
||||
?>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?php echo $translation->get('backend_login_title'); ?></title>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/layout/admin/img/favicon/favicon.ico">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/layout/admin/img/favicon/favicon.ico">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/layout/admin/img/favicon/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/layout/admin/img/2016/favicons/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" href="/layout/admin/img/2016/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="/layout/admin/img/2016/favicons/favicon-16x16.png" sizes="16x16">
|
||||
|
||||
<link
|
||||
href="/layout/admin/css/mysyde.css?t=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/layout/admin/css/mysyde.css')?>"
|
||||
rel="stylesheet" type="text/css" />
|
||||
<link
|
||||
href="/layout/admin/css/responsive.css?t=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/layout/admin/css/responsive.css')?>"
|
||||
rel="stylesheet" type="text/css" />
|
||||
<link rel="mask-icon" href="/layout/admin/img/2016/favicons/safari-pinned-tab.svg" color="#99c137">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
|
||||
<body class="login">
|
||||
<div id="login-container">
|
||||
|
||||
<div id="login">
|
||||
|
||||
<div class="login-wrapper">
|
||||
<div class="login-left-content">
|
||||
<div id="mysyde-logo"><img src="/layout/admin/img/icons/mysyde-icon.png" alt="MySyde Icon"></div>
|
||||
<div id="login_1"><?php echo $translation->get('backend_login_headline'); ?></div>
|
||||
<?
|
||||
|
||||
$falseLoginData = get_false_password_admin_login_counter(md5(getUserIP()),"");
|
||||
$now = time();
|
||||
$dataBaseCounter = 0;
|
||||
$blockTime = $now;
|
||||
$blockErrorCounter = 0;
|
||||
|
||||
if(count($falseLoginData) > 0)
|
||||
{
|
||||
$dataBaseCounter = $falseLoginData[0]['total_counter'];
|
||||
$blockTime = $falseLoginData[0]['next_login_time'];
|
||||
$blockErrorCounter = $falseLoginData[0]['block_counter'];;
|
||||
}
|
||||
|
||||
$counter = $dataBaseCounter / $GLOBALS['shop_setup']['allowed_false_login_times'];
|
||||
$counter = (int)$counter;
|
||||
$waitingSeconds = $counter * $GLOBALS['shop_setup']['false_login_waiting_seconds'];
|
||||
|
||||
if($counter != $blockErrorCounter)
|
||||
{
|
||||
$blockTime = $now + $waitingSeconds;
|
||||
add_false_password_admin_loign_counter(md5(getUserIP()), "", $dataBaseCounter ,$blockTime, $counter);
|
||||
}
|
||||
|
||||
|
||||
if( $blockTime > $now)
|
||||
{
|
||||
$message = str_replace('%number_of_times%',$dataBaseCounter ,$translation->get('reach_false_login_times'));
|
||||
$message = str_replace('%minutes_number%',((int)$waitingSeconds/60),$message);
|
||||
echo '<h2>'.$message.'</h2>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
|
||||
<div id="login_2">
|
||||
<div class="statusMessage">
|
||||
<p><?php echo $_SESSION['success_status'];
|
||||
unset($_SESSION['success_status']);
|
||||
?>
|
||||
<?php echo $_SESSION['status_message'];
|
||||
unset($_SESSION['status_message']);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<form name="form_admin_login" autocomplete="new-password" id="form_admin_login"
|
||||
action="?action=admin_login" method="post">
|
||||
<div class="label"><label
|
||||
for="input_login"><?php echo $translation->get('backend_login_label'); ?>
|
||||
:</label></div>
|
||||
<div class="input"><input autocomplete="new-password" placeholder=" " class="code" type="text"
|
||||
name="input_login" id="input_login_user" /></div>
|
||||
<div class="label"><label
|
||||
for="input_password"><?php echo $translation->get('backend_password_label'); ?>:</label>
|
||||
</div>
|
||||
<div class="input"><input autocomplete="new-password" placeholder=" " class="code"
|
||||
name="input_password" type="password" id="input_password" />
|
||||
</div>
|
||||
<div class="button-wrapper">
|
||||
<div class="passwort"><a href="?action=forget_password">Passwort vergessen?</a></div>
|
||||
<input class="button" name="" type="submit"
|
||||
value="<?php echo $translation->get('backend_login_button'); ?>" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="video-wrapper">
|
||||
<video src="https://www.breadcrumb-solutions.de/mysyde-login-animation.mov"autoplay="true" height="100%" loop="true" muted="true" ></video>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class=" login sitelanguage-version"><?php echo current_website_language($site, $language); ?><div class="version"><?php echo $translation->get("version")?></div></div>
|
||||
|
||||
|
||||
<script type="text/javascript" src="/plugins/jquery/jquery-3.5.1.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).on('focus', ':input', function() {
|
||||
$(this).attr('autocomplete', 'off');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
167
mysyde/admin/mail_log.inc.php
Normal file
167
mysyde/admin/mail_log.inc.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?
|
||||
|
||||
switch ($_GET["action"]) {
|
||||
case 'list':
|
||||
require_once("mail_log_listform.inc.php");
|
||||
break;
|
||||
case 'card':
|
||||
mail_log_card();
|
||||
break;
|
||||
case 'send':
|
||||
send_mail_log(TRUE);
|
||||
break;
|
||||
case 'send_list' :
|
||||
send_mail_log(FALSE);
|
||||
break;
|
||||
case 'filter' :
|
||||
require_once("mail_log_listform.inc.php");
|
||||
break;
|
||||
case 'show_survey_contactform':
|
||||
survey_card();
|
||||
break;
|
||||
case 'loadStats':
|
||||
require_once(CMS_PATH . "admin/statistic.inc.php");
|
||||
break;
|
||||
case 'load_suboption':
|
||||
load_suboption();
|
||||
break;
|
||||
case 'load_filtered_data':
|
||||
load_filtered_data();
|
||||
break;
|
||||
case 'show_person_mail':
|
||||
show_person_mail();
|
||||
break;
|
||||
default:
|
||||
require_once("mail_log_listform.inc.php");
|
||||
break;
|
||||
}
|
||||
|
||||
function mail_log_card( $messages = array() ) {
|
||||
if ($_POST["input_id"] <> '') {
|
||||
$query = "SELECT *, DATE_FORMAT(send_date,'%d.%m.%Y') AS format_send_date, DATE_FORMAT(send_date,'%H:%i') AS format_send_time FROM main_mail_log WHERE id = '" . $_POST["input_id"] . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_mail_log = @mysqli_fetch_array($result);
|
||||
require_once("mail_log_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("mail_log_listform.inc.php");
|
||||
}
|
||||
}
|
||||
function survey_card( ) {
|
||||
if ($_POST["data-inputid"] <> '') {
|
||||
$query = "SELECT * FROM contactform_header WHERE id = '" . $_POST["data-inputid"] . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$contact_header = @mysqli_fetch_array($result);
|
||||
require_once("survey_log_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once("mail_log_listform.inc.php");
|
||||
}
|
||||
}
|
||||
function show_person_mail(){
|
||||
if ($_POST["input_line_id"] <> '') {
|
||||
$query = "SELECT ml.*, DATE_FORMAT(send_date,'%d.%m.%Y') AS format_send_date, DATE_FORMAT(send_date,'%H:%i') AS format_send_time FROM main_mail_log as ml INNER JOIN survey_persons as sp on ml.spid = sp.id WHERE sp.id = '" . $_POST["input_line_id"] . "' LIMIT 1";
|
||||
print_r($_REQUEST['header_id']);
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_mail_log = @mysqli_fetch_array($result);
|
||||
require_once("mail_log_cardform.inc.php");
|
||||
}
|
||||
} else {
|
||||
require_once(CMS_PATH . "admin/statistic.inc.php");
|
||||
}
|
||||
|
||||
}
|
||||
function load_filtered_data(){
|
||||
if(isset($_POST['reportrange']) && isset($_POST['reportrange'])){
|
||||
$header_id = $_POST['header_id'];
|
||||
$range = explode("-", $_POST['reportrange']);
|
||||
$date1 = $range[0];
|
||||
$date2 = $range[1];
|
||||
$date1 = date('Y-m-d', strtotime($date1));
|
||||
$date2 = date('Y-m-d', strtotime($date2));
|
||||
$line_id = '';
|
||||
if(isset($_POST['select_option'])){
|
||||
$line_id = " AND line_id = '".$_POST['select_option']."' ";
|
||||
}
|
||||
$clo_id = '';
|
||||
if(isset($_POST['select_sub_option'])){
|
||||
$clo_id = " AND clo_id = '".$_POST['select_sub_option']."' ";
|
||||
}
|
||||
$sql = "SELECT MONTH(created_date) as month, count(*) NUM FROM survey_answers WHERE header_id = '" . $header_id . "' AND DATE(created_date) BETWEEN '".$date1."' AND '".$date2."' ".$line_id.$clo_id." GROUP BY month ";
|
||||
|
||||
$label = array();
|
||||
$dataArrayPie = array();
|
||||
$bgArray = array();
|
||||
for($i = 1;$i<=12;$i++){
|
||||
$dataArrayPie[$i] = 0;
|
||||
|
||||
}
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $sql);
|
||||
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
$dataArrayPie[$row['month']] = $row['NUM'];
|
||||
|
||||
}
|
||||
print_r(json_encode($dataArrayPie));
|
||||
}
|
||||
}
|
||||
function load_suboption(){
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$html = '';
|
||||
|
||||
?>
|
||||
<div class="label"><label><?= $translation->get('select_sub_option');?></label></div>
|
||||
<div class="input">
|
||||
<select class="bigselect" name="select_sub_option" id="select_sub_option">
|
||||
<option disabled selected>----</option>
|
||||
</div>
|
||||
<?php
|
||||
$queryOpt = "SELECT * FROM contactform_line_option WHERE line_id = '".$_POST['line_id']."'";
|
||||
$resultOpt = @mysqli_query($GLOBALS['mysql_con'], $queryOpt);
|
||||
echo $queryOpt;
|
||||
while($row = @mysqli_fetch_array($resultOpt)){
|
||||
echo '<option value="'. $row['id'].'" data-type="'. $row['type'].'" >'.$row['option_string'].'</option>';
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
<? }
|
||||
|
||||
function send_mail_log( $_card = TRUE ) {
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$messages = array();
|
||||
if ($_POST["input_id"] <> '') {
|
||||
$query = "SELECT * FROM main_mail_log WHERE id = '" . $_POST["input_id"] . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$mail = @mysqli_fetch_array($result);
|
||||
if (mail_create($mail["subject"], $mail["message"], $mail["from_adress"], $mail["to_adress"], $mail["to_name"], $mail["from_name"], $mail["html_mail"], $mail["attachment"], 0, '')) {
|
||||
mail_send();
|
||||
$messages[] = '<div class="successbox">' . $translation->get("send_again_successfull") . '</div>';
|
||||
}
|
||||
}
|
||||
if ($_card === TRUE) {
|
||||
mail_log_card($messages);
|
||||
} else {
|
||||
require_once("mail_log_listform.inc.php");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function mail_filter( $site_id, $language_id, $from_level = 1, $to_level = 3 ) {
|
||||
$current_filter = (isset($_POST['filter_days']) ? $_POST['filter_days'] : 7);
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
echo "<div class=\"input\"><select onchange=\"filter_mails(this.value);\" class=\"bigselect\" name=\"page_filter\" id=\"page_filter\">";
|
||||
echo "<option value='1 WEEK' " . ($current_filter == '1 WEEK' ? 'selected="selected"' : '') . ">" . $translation->get("last_week") . "</option>";
|
||||
echo "<option value='1 MONTH' " . ($current_filter == '1 MONTH' ? 'selected="selected"' : '') . ">" . $translation->get("last_month") . "</option>";
|
||||
echo "<option value='1 YEAR' " . ($current_filter == '1 YEAR' ? 'selected="selected"' : '') . ">" . $translation->get("last_year") . "</option>";
|
||||
echo "<option value='100 YEAR' " . ($current_filter == '100 YEAR' ? 'selected="selected"' : '') . ">" . $translation->get("show_all") . "</option>";
|
||||
echo "</select>";
|
||||
echo "</div>";
|
||||
}
|
||||
58
mysyde/admin/mail_log_cardform.inc.php
Normal file
58
mysyde/admin/mail_log_cardform.inc.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_mail_log_card";
|
||||
$header_id = '';
|
||||
if(isset($_REQUEST['header_id'])){
|
||||
$header_id = $_REQUEST['header_id'];
|
||||
}
|
||||
print_r('dataist' .$header_id );
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php
|
||||
echo $translation->get("mail_details");
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php if(isset($_REQUEST['header_id'])){
|
||||
|
||||
echo button("left", $translation->get("back"), $formname, "loadCard('show_survey_contactform', true)");
|
||||
}else{ echo button("mail", $translation->get("send_again"), $formname, "loadCard('send', true)");} ?>
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_mail_log["id"] ?>">
|
||||
<input name="data-inputid" type="hidden" value="<?=$header_id;?>">
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?= input($translation->get("recipient_name"), "input_to_name", "text", $input_mail_log["to_name"], 45, TRUE) ?>
|
||||
<?= input($translation->get("recipient_email"), "input_to_adress", "text", $input_mail_log["to_adress"], 100, TRUE) ?>
|
||||
<?= input($translation->get("sender_name"), "input_from_name", "text", $input_mail_log["from_name"], 45, TRUE) ?>
|
||||
<?= input($translation->get("sender_email"), "input_from_adress", "text", $input_mail_log["from_adress"], 100, TRUE) ?>
|
||||
<br />
|
||||
<?= input($translation->get("subject"), "input_subject", "text", $input_mail_log["subject"], 100, TRUE) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= input($translation->get("send_date"), "input_send_date", "date", $input_mail_log["format_send_date"], 45, TRUE) ?>
|
||||
<?= input($translation->get("send_time"), "input_send_time", "date", $input_mail_log["format_send_time"], 45, TRUE) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2><?php echo $translation->get("message"); ?>:</h2>
|
||||
<?= ($input_mail_log["html_mail"]) ? $input_mail_log["message"] : nl2br($input_mail_log["message"]) ?>
|
||||
|
||||
</form>
|
||||
73
mysyde/admin/mail_log_listform.inc.php
Normal file
73
mysyde/admin/mail_log_listform.inc.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_mail_log_list";
|
||||
|
||||
$zeitraum_values = array(
|
||||
"1 WEEK",
|
||||
"1 MONTH",
|
||||
"1 YEAR",
|
||||
"100 YEAR"
|
||||
);
|
||||
|
||||
$zeitraum_names = array(
|
||||
$translation->get("last_week"),
|
||||
$translation->get("last_month"),
|
||||
$translation->get("last_year"),
|
||||
$translation->get("show_all")
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function filter_mails( _days ) {
|
||||
jQuery('#filter_days').val(_days);
|
||||
jQuery('#form_mail_log_list').submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("edit", $translation->get("display"), $formname, "loadCard('card')"); ?>
|
||||
<?= button("mail", $translation->get("send_again"), $formname, "jQuery('#filter_days').val(jQuery('#page_filter').val());sendRequest('send_list')"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_mail_stat'); ?></h1>
|
||||
|
||||
<h3><?php echo $translation->get("show_mails_till"); ?>:</h3>
|
||||
<?php
|
||||
mail_filter($GLOBALS["site"]['id'], $GLOBALS["language"]['id']);
|
||||
?>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" action="?action=filter">
|
||||
<input type="hidden" value="" name="filter_days" id="filter_days" />
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
if (isset($_POST['filter_days'])) {
|
||||
$where = $_POST['filter_days'];
|
||||
} else {
|
||||
$where = '1 WEEK';
|
||||
}
|
||||
|
||||
$query = "SELECT
|
||||
id,
|
||||
subject AS '" . $translation->get("subject") . "',
|
||||
DATE_FORMAT(send_date,'%d.%m.%Y um %H:%i Uhr') AS '" . $translation->get("send_on") . "',
|
||||
to_adress AS '" . $translation->get("recipient_email") . "',
|
||||
from_adress AS '" . $translation->get("sender_email") . "'
|
||||
FROM
|
||||
main_mail_log where send_date >= DATE_SUB(NOW(),INTERVAL " . $where . ")
|
||||
ORDER BY
|
||||
send_date DESC";
|
||||
$format = array('option', 'text', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "card");
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
289
mysyde/admin/main_admin_navigation.xml
Normal file
289
mysyde/admin/main_admin_navigation.xml
Normal file
@@ -0,0 +1,289 @@
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<main_admin_navigation>
|
||||
<row>
|
||||
<id>1</id>
|
||||
<parent_id/>
|
||||
<sorting>1</sorting>
|
||||
<level>1</level>
|
||||
<code>Inhalte</code>
|
||||
<menu_name>Inhalte</menu_name>
|
||||
<title_name>Inhalte</title_name>
|
||||
<include>mysyde/admin/edit_navigation_has_sitepart.inc.php</include>
|
||||
<menu_include>mysyde/admin/frontend_content_menu.inc.php</menu_include>
|
||||
</row>
|
||||
<row>
|
||||
<id>2</id>
|
||||
<parent_id/>
|
||||
<sorting>2</sorting>
|
||||
<level>1</level>
|
||||
<code>Webseite</code>
|
||||
<menu_name>Webseite</menu_name>
|
||||
<title_name>Webseite</title_name>
|
||||
<include/>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>3</id>
|
||||
<parent_id/>
|
||||
<sorting>3</sorting>
|
||||
<level>1</level>
|
||||
<code>Zugriffsrechte</code>
|
||||
<menu_name>Zugriffsrechte</menu_name>
|
||||
<title_name>Zugriffsrechte</title_name>
|
||||
<include/>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>4</id>
|
||||
<parent_id/>
|
||||
<sorting>4</sorting>
|
||||
<level>1</level>
|
||||
<code>Statistik</code>
|
||||
<menu_name>Statistik</menu_name>
|
||||
<title_name>Statistik</title_name>
|
||||
<include/>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>5</id>
|
||||
<parent_id/>
|
||||
<sorting>5</sorting>
|
||||
<level>1</level>
|
||||
<code>Einstellungen</code>
|
||||
<menu_name>Einstellungen</menu_name>
|
||||
<title_name/>
|
||||
<include/>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>6</id>
|
||||
<parent_id/>
|
||||
<sorting>6</sorting>
|
||||
<level>1</level>
|
||||
<code>HilfeSupport</code>
|
||||
<menu_name>Hilfe & Support</menu_name>
|
||||
<title_name/>
|
||||
<include/>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>7</id>
|
||||
<parent_id>2</parent_id>
|
||||
<sorting>1</sorting>
|
||||
<level>2</level>
|
||||
<code>Navigation</code>
|
||||
<menu_name>Navigation</menu_name>
|
||||
<title_name>Navigation</title_name>
|
||||
<include>mysyde/admin/edit_main_navigation.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>8</id>
|
||||
<parent_id>5</parent_id>
|
||||
<sorting>1</sorting>
|
||||
<level>2</level>
|
||||
<code>Webseiten</code>
|
||||
<menu_name>Webseiten</menu_name>
|
||||
<title_name>Webseiten</title_name>
|
||||
<include>mysyde/admin/edit_site.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>9</id>
|
||||
<parent_id>2</parent_id>
|
||||
<sorting>3</sorting>
|
||||
<level>2</level>
|
||||
<code>Sprachen</code>
|
||||
<menu_name>Sprachen</menu_name>
|
||||
<title_name>Sprachen</title_name>
|
||||
<include>mysyde/admin/edit_language.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>10</id>
|
||||
<parent_id>3</parent_id>
|
||||
<sorting>1</sorting>
|
||||
<level>2</level>
|
||||
<code>Dc-Benutzer</code>
|
||||
<menu_name>Dc-Benutzer</menu_name>
|
||||
<title_name>Dc-Benutzer</title_name>
|
||||
<include>mysyde/admin/edit_admin_user.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>11</id>
|
||||
<parent_id>5</parent_id>
|
||||
<sorting>3</sorting>
|
||||
<level>2</level>
|
||||
<code>Module</code>
|
||||
<menu_name>Module</menu_name>
|
||||
<title_name>Module</title_name>
|
||||
<include>mysyde/admin/edit_modul.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>12</id>
|
||||
<parent_id>5</parent_id>
|
||||
<sorting>2</sorting>
|
||||
<level>2</level>
|
||||
<code>Layouts</code>
|
||||
<menu_name>Layouts</menu_name>
|
||||
<title_name>Layouts</title_name>
|
||||
<include>mysyde/admin/edit_layout.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>13</id>
|
||||
<parent_id>5</parent_id>
|
||||
<sorting>4</sorting>
|
||||
<level>2</level>
|
||||
<code>Lizenz</code>
|
||||
<menu_name>Lizenz</menu_name>
|
||||
<title_name>Lizenz</title_name>
|
||||
<include>mysyde/admin/licence.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>14</id>
|
||||
<parent_id>3</parent_id>
|
||||
<sorting>2</sorting>
|
||||
<level>2</level>
|
||||
<code>Webseiten-Benutzer</code>
|
||||
<menu_name>Webseiten-Benutzer</menu_name>
|
||||
<title_name>Webseiten-Benutzer</title_name>
|
||||
<include>mysyde/admin/edit_frontend_user.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>15</id>
|
||||
<parent_id>3</parent_id>
|
||||
<sorting>3</sorting>
|
||||
<level>2</level>
|
||||
<code>Benutzergruppen</code>
|
||||
<menu_name>Webseiten-Benutzergruppen</menu_name>
|
||||
<title_name>Webseiten-Benutzergruppen</title_name>
|
||||
<include>mysyde/admin/edit_frontend_user.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>16</id>
|
||||
<parent_id>6</parent_id>
|
||||
<sorting>1</sorting>
|
||||
<level>2</level>
|
||||
<code>Kontakt</code>
|
||||
<menu_name>Kontakt</menu_name>
|
||||
<title_name>Kontakt</title_name>
|
||||
<include>mysyde/admin/contact.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>17</id>
|
||||
<parent_id>6</parent_id>
|
||||
<sorting>2</sorting>
|
||||
<level>2</level>
|
||||
<code>Supportanfrage</code>
|
||||
<menu_name>Supportanfrage</menu_name>
|
||||
<title_name>Supportanfrage</title_name>
|
||||
<include>mysyde/admin/contact_formular.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>18</id>
|
||||
<parent_id>4</parent_id>
|
||||
<sorting>2</sorting>
|
||||
<level>2</level>
|
||||
<code>Zugriffsstatistik</code>
|
||||
<menu_name>Zugriffsstatistik</menu_name>
|
||||
<title_name>Zugriffsstatistik</title_name>
|
||||
<include>mysyde/admin/statistic.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>19</id>
|
||||
<parent_id>4</parent_id>
|
||||
<sorting>1</sorting>
|
||||
<level>2</level>
|
||||
<code>MailLog</code>
|
||||
<menu_name>Mail-Protokoll</menu_name>
|
||||
<title_name>Mail-Protokoll</title_name>
|
||||
<include>mysyde/admin/mail_log.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>20</id>
|
||||
<parent_id>5</parent_id>
|
||||
<sorting>5</sorting>
|
||||
<level>2</level>
|
||||
<code>Dc</code>
|
||||
<menu_name>Dc</menu_name>
|
||||
<title_name>Dc</title_name>
|
||||
<include>mysyde/admin/edit_setup.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>21</id>
|
||||
<parent_id>5</parent_id>
|
||||
<sorting>6</sorting>
|
||||
<level>2</level>
|
||||
<code>backup</code>
|
||||
<menu_name>Datensicherung</menu_name>
|
||||
<title_name>Datensicherung</title_name>
|
||||
<include>/mysyde/admin/db_backup.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>22</id>
|
||||
<parent_id>5</parent_id>
|
||||
<sorting>7</sorting>
|
||||
<level>2</level>
|
||||
<code>Systeminfo</code>
|
||||
<menu_name>Systeminfo</menu_name>
|
||||
<title_name>Systeminfo</title_name>
|
||||
<include>mysyde/admin/phpinfo.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>23</id>
|
||||
<parent_id>4</parent_id>
|
||||
<sorting>3</sorting>
|
||||
<level>2</level>
|
||||
<code>Suchstatistik</code>
|
||||
<menu_name>Suchstatistik</menu_name>
|
||||
<title_name>Suchstatistik</title_name>
|
||||
<include>module/dcshop/admin/search_query_statistic.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>24</id>
|
||||
<parent_id>4</parent_id>
|
||||
<sorting>4</sorting>
|
||||
<level>2</level>
|
||||
<code>order_statistic</code>
|
||||
<menu_name>Bestellstatistik</menu_name>
|
||||
<title_name>Bestellstatistik</title_name>
|
||||
<include>mysyde/admin/order_statistic.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>25</id>
|
||||
<parent_id>4</parent_id>
|
||||
<sorting>5</sorting>
|
||||
<level>2</level>
|
||||
<code>Nutzer je Kunde</code>
|
||||
<menu_name>Nutzer je Kunde</menu_name>
|
||||
<title_name>Nutzer je Kunde</title_name>
|
||||
<include>module/dcshop/admin/users_per_customer_statistic.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
<row>
|
||||
<id>26</id>
|
||||
<parent_id>2</parent_id>
|
||||
<sorting>4</sorting>
|
||||
<level>2</level>
|
||||
<code>files</code>
|
||||
<menu_name>Dateimanager</menu_name>
|
||||
<title_name>Dateimanager</title_name>
|
||||
<include>mysyde/admin/filemanager.inc.php</include>
|
||||
<menu_include/>
|
||||
</row>
|
||||
</main_admin_navigation>
|
||||
8
mysyde/admin/menu_include.inc.php
Normal file
8
mysyde/admin/menu_include.inc.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?
|
||||
// Inhalt laden
|
||||
|
||||
if (($admin_navigation["menu_include"] <> '') && (file_exists("../../" . $admin_navigation["menu_include"]))) {
|
||||
require_once("../../" . $admin_navigation["menu_include"]);
|
||||
}
|
||||
|
||||
?>
|
||||
57
mysyde/admin/module.inc.php
Normal file
57
mysyde/admin/module.inc.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?
|
||||
$messages = array();
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$action = (isset($_GET['action']) ? $_GET['action'] : "");
|
||||
function loadModule($active, $site, $language){
|
||||
$query = "SELECT * FROM main_module WHERE active = " . $active;
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
|
||||
?>
|
||||
<div class="module-card-list">
|
||||
<div class="module-card-container state_<?= $row['active'] ?>">
|
||||
<div class="module-card-image"><img src="/layout/admin/img/module/<?= $row['code'] ?>" alt=""></div>
|
||||
<div class="module-card-titel"><?= $row['title'] ?></div>
|
||||
<div class="module-card-text"><?= $row['description'] ?></div>
|
||||
<?php
|
||||
if($active == 1){ ?>
|
||||
<div class="module-card-status">bereits aktiviert</div>
|
||||
<?php if($row['code'] != "basic"){ ?>
|
||||
<div class="module-card-link"><a href="<?php echo get_menu_link('module/'.$row['code'], $site, $language); ?>"></a></div>
|
||||
<?php } ?>
|
||||
<?php }else{ ?>
|
||||
<div class="module-card-status">nicht aktiviert</div>
|
||||
<div class="module-card-status-vertrieb"><a target="_blank" href="https://www.breadcrumb-solutions.de/bc/de/kontakt/"></a>Jetzt anfragen</div>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php } } ?>
|
||||
<? $formname = "form_module"; ?>
|
||||
<div id="mainContent" class="dashboard-mysyde">
|
||||
<div class="module-wrapper dashboard-wrapper">
|
||||
<div class="module-content dashboard-left-content">
|
||||
<img class="mysyde-icon img-fluid"src="/layout/admin/img/icons/mysyde-icon.svg" alt="MySyde Icon">
|
||||
<div class="text-content">
|
||||
<div class="text-white"><?php echo current_website_language($site, $language); ?></div>
|
||||
<h1 class="new-h1 text-white"><?php echo $translation->get("top_module") ?></h1>
|
||||
<p class="text-white">Wir arbeiten stetig daran, MySyde zu einem besseren Ort zu machen.</p>
|
||||
</div>
|
||||
<img src="/layout/admin/img/icons/mysyde-bg.jpg" alt="" class="module-content-img hintergrund module-hintergrund position-absolute top-0 left-0 z-index-1">
|
||||
</div>
|
||||
<div class="module-container">
|
||||
<h2>Deine Module</h2>
|
||||
<div class="module-wrapper-list">
|
||||
<?php loadModule(1, $site, $language) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="module-container weitere">
|
||||
<h2>Verfügbare Module</h2>
|
||||
<div class="module-wrapper-list">
|
||||
<?php loadModule(0, $site, $language) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
196
mysyde/admin/mysyde_log.php
Normal file
196
mysyde/admin/mysyde_log.php
Normal file
@@ -0,0 +1,196 @@
|
||||
<?php
|
||||
function createMySydeLog($type, $type_id, $state){
|
||||
$curr_date = new DateTime();
|
||||
$insertquery = "INSERT INTO mysyde_log
|
||||
(main_admin_user_id, datetime, type, type_id, state)
|
||||
VALUES (
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
'" . $curr_date->format('Y-m-d H:i:s') . "',
|
||||
'" . $type . "',
|
||||
" . $type_id . ",
|
||||
'" . $state . "'
|
||||
)";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $insertquery);
|
||||
}
|
||||
|
||||
function loadMySydeLog($log_limit){
|
||||
$select = $GLOBALS['pdo_conn']->prepare("SELECT * FROM mysyde_log LEFT JOIN main_admin_user ON main_admin_user.id = mysyde_log.main_admin_user_id ORDER BY datetime DESC LIMIT ".$log_limit);
|
||||
$select->execute();
|
||||
$res_select = $select->fetchALL(PDO::FETCH_ASSOC);
|
||||
foreach ($res_select as $key => $value) {
|
||||
$message = '';
|
||||
$select_type = $GLOBALS['pdo_conn']->prepare("SELECT * FROM ".$value['type']." WHERE id = ".$value['type_id']);
|
||||
$select_type->execute();
|
||||
$res_type = $select_type->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if($res_type != NULL){
|
||||
if($value['type'] == 'main_admin_user'){
|
||||
$name = $res_type['name'];
|
||||
}else if($value['type'] == 'main_navigation'){
|
||||
$name = $res_type['menu_name'];
|
||||
}else if($value['type'] == 'main_page'){
|
||||
$name = $res_type['title'];
|
||||
}else{
|
||||
$name = $res_type['description'];
|
||||
}
|
||||
}else {
|
||||
$name = "mit der ID " . $value['type_id'];
|
||||
}
|
||||
|
||||
$admin = $value['login'];
|
||||
|
||||
switch ($value['type']) {
|
||||
case 'main_admin_user':
|
||||
$message = log_main_admin_user($admin, $name, $value['state'], $value['type_id']);
|
||||
break;
|
||||
case 'main_collection':
|
||||
$message = log_main_collection($admin, $name, $value['state']);
|
||||
break;
|
||||
case 'main_collection_setup':
|
||||
$message = log_main_collection_setup($admin, $name, $value['state']);
|
||||
break;
|
||||
case 'main_page':
|
||||
$message = log_main_page($admin, $name, $value['state']);
|
||||
break;
|
||||
case 'main_navigation':
|
||||
$message = log_main_navigation($admin, $name, $value['state']);
|
||||
break;
|
||||
case 'main_faq':
|
||||
$message = log_main_faq($admin, $name, $value['state']);
|
||||
break;
|
||||
case 'main_faq_setup_group':
|
||||
$message = log_main_faq_setup_group($admin, $name, $value['state']);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
$datetime = new Datetime($value['datetime']);
|
||||
echo "<p><span class='log_date'>[".$datetime->format('d.m.Y H:i')."]</span> " .$message. "</p>";
|
||||
}
|
||||
}
|
||||
|
||||
function log_main_collection($admin, $name, $state){
|
||||
switch ($state) {
|
||||
case 'INSERT':
|
||||
$message = $admin . " hat die Kollektion <span class='log_content'>".$name."</span> hinzugefügt.";
|
||||
break;
|
||||
case 'UPDATE':
|
||||
$message = $admin . " hat die Kollektion <span class='log_content'>".$name."</span> bearbeitet.";
|
||||
break;
|
||||
case 'DELETE':
|
||||
$message = $admin . " hat die Kollektion <span class='log_content'>".$name."</span> gelöscht.";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
function log_main_collection_setup($admin, $name, $state){
|
||||
switch ($state) {
|
||||
case 'INSERT':
|
||||
$message = $admin . " hat die Kollektion <span class='log_content'>".$name."</span> hinzugefügt.";
|
||||
break;
|
||||
case 'UPDATE':
|
||||
$message = $admin . " hat die Kollektion <span class='log_content'>".$name."</span> bearbeitet.";
|
||||
break;
|
||||
case 'DELETE':
|
||||
$message = $admin . " hat die Kollektion <span class='log_content'>".$name."</span> gelöscht.";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
function log_main_admin_user($admin, $name, $state, $id){
|
||||
switch ($state) {
|
||||
case 'LOGIN':
|
||||
$message = $name . " hat sich angemeldet.";
|
||||
break;
|
||||
case 'LOGOUT':
|
||||
$message = $name . " hat sich abgemeldet.";
|
||||
break;
|
||||
case 'INSERT':
|
||||
$message = $admin . " hat den Nutzer <a class='' href='". get_menu_link('config/config_users', $GLOBALS['log_site'], $GLOBALS['log_language'], '?action=open_card&input_id='.$id) ."'>".$name."</a> hinzugefügt.";
|
||||
break;
|
||||
case 'UPDATE':
|
||||
$message = $admin . " hat den Nutzer <a class='' href='". get_menu_link('config/config_users', $GLOBALS['log_site'], $GLOBALS['log_language'], '?action=open_card&input_id='.$id) ."'>".$name."</a> bearbeitet.";
|
||||
break;
|
||||
case 'DELETE':
|
||||
$message = $admin . " hat den Nutzer <a class='' href='". get_menu_link('config/config_users', $GLOBALS['log_site'], $GLOBALS['log_language'], '?action=open_card&input_id='.$id) ."'>".$name."</a> gelöscht.";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
function log_main_page($admin, $name, $state){
|
||||
switch ($state) {
|
||||
case 'INSERT':
|
||||
$message = $admin . " hat die Seite <span class='log_content'>".$name."</span> hinzugefügt.";
|
||||
break;
|
||||
case 'UPDATE':
|
||||
$message = $admin . " hat die Seite <span class='log_content'>".$name."</span> bearbeitet.";
|
||||
break;
|
||||
case 'DELETE':
|
||||
$message = $admin . " hat die Seite <span class='log_content'>".$name."</span> gelöscht.";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
function log_main_navigation($admin, $name, $state){
|
||||
switch ($state) {
|
||||
case 'INSERT':
|
||||
$message = $admin . " hat die Navigation <span class='log_content'>".$name."</span> hinzugefügt.";
|
||||
break;
|
||||
case 'UPDATE':
|
||||
$message = $admin . " hat die Navigation <span class='log_content'>".$name."</span> bearbeitet.";
|
||||
break;
|
||||
case 'DELETE':
|
||||
$message = $admin . " hat die Navigation <span class='log_content'>".$name."</span> gelöscht.";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
function log_main_faq($admin, $name, $state){
|
||||
switch ($state) {
|
||||
case 'INSERT':
|
||||
$message = $admin . " hat die FAQ Frage <span class='log_content'>".$name."</span> hinzugefügt.";
|
||||
break;
|
||||
case 'UPDATE':
|
||||
$message = $admin . " hat die FAQ Frage <span class='log_content'>".$name."</span> bearbeitet.";
|
||||
break;
|
||||
case 'DELETE':
|
||||
$message = $admin . " hat die FAQ Frage <span class='log_content'>".$name."</span> gelöscht.";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
function log_main_faq_setup_group($admin, $name, $state){
|
||||
switch ($state) {
|
||||
case 'INSERT':
|
||||
$message = $admin . " hat die FAQ Gruppe <span class='log_content'>".$name."</span> hinzugefügt.";
|
||||
break;
|
||||
case 'UPDATE':
|
||||
$message = $admin . " hat die FAQ Gruppe <span class='log_content'>".$name."</span> bearbeitet.";
|
||||
break;
|
||||
case 'DELETE':
|
||||
$message = $admin . " hat die FAQ Gruppe <span class='log_content'>".$name."</span> gelöscht.";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
226
mysyde/admin/order_statistic.inc.php
Normal file
226
mysyde/admin/order_statistic.inc.php
Normal file
@@ -0,0 +1,226 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$query = "SELECT * FROM main_admin_user_shop_link where main_admin_user_id = '" . (int)$GLOBALS["admin_user"]['id']."'";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$siteAdminAvailableShops = array();
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
$shopAdminLink = true;
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
if($row['active'] == 1) {
|
||||
$siteAdminAvailableShops[] = $row['shop_code'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$shopAdminLink = false;
|
||||
}
|
||||
|
||||
$zeitraum_values = array(
|
||||
"%d.%m.%Y",
|
||||
"KW%v-%x",
|
||||
"%m/%Y",
|
||||
"%Y"
|
||||
);
|
||||
|
||||
$zeitraum_names = array(
|
||||
$translation->get("days"),
|
||||
$translation->get("calendarweeks"),
|
||||
$translation->get("months"),
|
||||
$translation->get("years")
|
||||
);
|
||||
|
||||
$shop_values = array();
|
||||
$shop_names = array();
|
||||
|
||||
$query = "SELECT *
|
||||
FROM shop_shop";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($shop = mysqli_fetch_assoc($result)) {
|
||||
|
||||
// wenn benutzer diesen shop nicht sehen darf
|
||||
if($shopAdminLink === true && !in_array($shop['code'], $siteAdminAvailableShops)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($_POST['input_shop'] == '') {
|
||||
$_POST['input_shop'] = $shop['code'];
|
||||
}
|
||||
|
||||
$shop_values[] = $shop['code'];
|
||||
$shop_names[] = $shop['description'];
|
||||
}
|
||||
|
||||
|
||||
if(count($shop_values)) {
|
||||
$von_value = "";
|
||||
$bis_value = date("d.m.Y", time());
|
||||
|
||||
if (isset($_POST['input_from'])) {
|
||||
$von_value = $_POST['input_from'];
|
||||
$bis_value = $_POST['input_to'];
|
||||
}
|
||||
|
||||
if ($_POST['input_shop'] != $_POST['old_shop_code']) {
|
||||
$von_value = "";
|
||||
}
|
||||
|
||||
// datum der ersten bestellung aus dem aktuellen shop auslesen
|
||||
$query = "SELECT MIN(order_date) as order_date FROM shop_sales_header WHERE shop_code = '" . $_POST['input_shop'] . "' AND successful = 1";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$shop = mysqli_fetch_assoc($result);
|
||||
$mindate = $shop['order_date'];
|
||||
$mindateTs = strtotime($mindate);
|
||||
|
||||
$vor2jahren = strtotime("-2 years");
|
||||
|
||||
if ($von_value == "") {
|
||||
if ($mindateTs > $vor2jahren) {
|
||||
$von_value = datefromsql($mindate);
|
||||
} else {
|
||||
$von_value = date("d.m.Y", $vor2jahren);
|
||||
}
|
||||
}
|
||||
|
||||
if ($von_value != "" && $mindateTs > strtotime($von_value)) {
|
||||
$von_value = datefromsql($mindate);
|
||||
}
|
||||
|
||||
if ($mindateTs === false) {
|
||||
$von_value = "";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("google", $translation->get("google_analytics"), $formname, "show_google_analytics()"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_order_stat'); ?></h1>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if(count($shop_values) == 0) {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_shops_available") . "</div>";
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="order_statistic_form" name="order_statistic_form" action="<?php $PHP_SELF; ?>" method=POST>
|
||||
<input type="hidden" value="<?php echo $_POST['input_shop']; ?>" name="old_shop_code"/>
|
||||
<div class="requestLoader"></div>
|
||||
<table class="cardform" style="width:960px;" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?php input_select($translation->get("shop"), "input_shop", $shop_values, $shop_names, $_POST['input_shop'], false, true); ?>
|
||||
<?php input_select($translation->get("intervall"), "input_interval", $zeitraum_values, $zeitraum_names, $_POST['input_interval'], false, true); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php input($translation->get("from"), "input_from", "date", $von_value, 10); ?>
|
||||
<?php input($translation->get("to"), "input_to", "date", $bis_value, 10); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="submit" value="Aktualisieren" style="display:none;"/>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('#mainContent input.date').datepicker("option", "onSelect", function () {
|
||||
$('#order_statistic_form').submit();
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
<?php
|
||||
if ($_POST['input_interval'] == "") {
|
||||
$interval = "%d.%m.%Y";
|
||||
} else {
|
||||
$interval = $_POST['input_interval'];
|
||||
}
|
||||
//$query="SELECT date_format( order_date, '".$interval."' ) AS 'Zeitraum', count( id ) AS 'Bestellungen', round( sum( total ) , 2 ) AS 'Summe Rechnung', round( sum( subtotal ) , 2 ) AS 'Summe Waren', round( avg( subtotal ) , 2 ) AS 'Durchschn. Warenwert', round( min( subtotal ) , 2 ) AS 'Kleinste', round( max( subtotal ) , 2 ) AS 'Größte',
|
||||
//SUM(
|
||||
//CASE WHEN payment_terms = 'LAST'
|
||||
//THEN 1
|
||||
//ELSE 0
|
||||
//END )/COUNT(id)*100 as '% Lastschr.',
|
||||
//SUM(
|
||||
//CASE WHEN payment_terms = 'Nachnahme'
|
||||
//THEN 1
|
||||
//ELSE 0
|
||||
//END )/COUNT(id)*100 as '% Nachnahme',
|
||||
//SUM(
|
||||
//CASE WHEN payment_terms = 'PAYPAL'
|
||||
//THEN 1
|
||||
//ELSE 0
|
||||
//END )/COUNT(id)*100 as '% Paypal',
|
||||
//SUM(
|
||||
//CASE WHEN payment_terms = 'KREDITKART'
|
||||
//THEN 1
|
||||
//ELSE 0
|
||||
//END )/COUNT(id)*100 as '% Kreditk.',
|
||||
//SUM(
|
||||
//CASE WHEN payment_terms = '14N'
|
||||
//THEN 1
|
||||
//ELSE 0
|
||||
//END )/COUNT(id)*100 as '% Rechnung',
|
||||
//SUM(
|
||||
//CASE WHEN payment_terms = 'TRUFFEL'
|
||||
//THEN 1
|
||||
//ELSE 0
|
||||
//END )/COUNT(id)*100 as '% Trüffelzins'
|
||||
//FROM shop_sales_header
|
||||
//GROUP BY DATE_FORMAT( order_date, '".$interval."' )
|
||||
//ORDER BY order_date DESC
|
||||
//LIMIT 60
|
||||
//";
|
||||
//$format = array('text','integer','euro','euro','euro','euro','euro','decimal','decimal','decimal','decimal','decimal','decimal');
|
||||
$query = "SET @row_number:=0;";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
// where zeitraum
|
||||
$where_von = "";
|
||||
$where_bis = "";
|
||||
if ($von_value != "") {
|
||||
$where_von = " and order_date >= " . datetosql($von_value) . " ";
|
||||
}
|
||||
|
||||
if ($bis_value != "") {
|
||||
$where_bis = " and order_date <= " . datetosql($bis_value) . " ";
|
||||
}
|
||||
|
||||
$query = "
|
||||
SELECT
|
||||
@row_number:=@row_number+1 AS id,
|
||||
date_format( order_date, '" . $interval . "' ) AS '" . $translation->get("period") . "',
|
||||
count( id ) AS '" . $translation->get("orders") . "',
|
||||
round( sum( total ) , 2 ) AS '" . $translation->get("sum_bill") . "',
|
||||
round( sum( subtotal ) , 2 ) AS '" . $translation->get("sum_goods") . "',
|
||||
round( avg( subtotal ) , 2 ) AS '" . $translation->get("avarage_goods_sum") . "',
|
||||
round( min( subtotal ) , 2 ) AS '" . $translation->get("sum_min") . "',
|
||||
round( max( subtotal ) , 2 ) AS '" . $translation->get("sum_max") . "'
|
||||
FROM
|
||||
shop_sales_header
|
||||
WHERE
|
||||
shop_code = '" . $_POST['input_shop'] . "'
|
||||
AND
|
||||
successful = 1
|
||||
$where_von
|
||||
$where_bis
|
||||
GROUP BY
|
||||
DATE_FORMAT( order_date, '" . $interval . "' )
|
||||
ORDER BY
|
||||
order_date DESC
|
||||
LIMIT
|
||||
60
|
||||
";
|
||||
|
||||
$format = array('option', 'text', 'integer', 'euro', 'euro', 'euro', 'euro', 'euro');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, "", $format);
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
1
mysyde/admin/phpinfo.inc.php
Normal file
1
mysyde/admin/phpinfo.inc.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php phpinfo(); ?>
|
||||
113
mysyde/admin/phpinfo.php
Normal file
113
mysyde/admin/phpinfo.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
$messages = array();
|
||||
?>
|
||||
|
||||
<style type="text/css">
|
||||
/*
|
||||
#phpinfo { width:800px; }
|
||||
#phpinfo pre {margin: 0px; font-family: monospace;}
|
||||
#phpinfo a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
|
||||
#phpinfo a:hover {text-decoration: underline;}
|
||||
#phpinfo table {border-collapse: collapse;}
|
||||
#phpinfo .center {text-align: left;}
|
||||
#phpinfo .center table { text-align: left;}
|
||||
#phpinfo .center th { text-align: center !important; }
|
||||
|
||||
#phpinfo h1 {font-size: 150%;}
|
||||
#phpinfo h2 {font-size: 125%;}
|
||||
#phpinfo .p {text-align: left;}
|
||||
|
||||
|
||||
#phpinfo .v {background-color: #cccccc; color: #000000;}
|
||||
#phpinfo .vr {background-color: #cccccc; text-align: right; color: #000000;}
|
||||
#phpinfo img {float: right; border: 0px;}
|
||||
#phpinfo hr {width: 100%; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
|
||||
*/
|
||||
|
||||
#phpinfo td {
|
||||
background-color : #e0e0e0;
|
||||
}
|
||||
|
||||
#phpinfo .e {
|
||||
background-color : #e0e0e0;
|
||||
font-weight : bold;
|
||||
color : #000000;
|
||||
width : 150px;
|
||||
}
|
||||
|
||||
#phpinfo .h {
|
||||
background-color : #9999cc;
|
||||
font-weight : bold;
|
||||
color : #000000;
|
||||
}
|
||||
|
||||
#phpinfo .v {
|
||||
background-color : #fff;
|
||||
}
|
||||
|
||||
#phpinfo td, #phpinfo th {
|
||||
border : 1px solid #DEDEDE;
|
||||
vertical-align : baseline;
|
||||
max-width : 190px;
|
||||
white-space : pre-wrap; /* css-3 */
|
||||
white-space : -moz-pre-wrap; /* Mozilla, since 1999 */
|
||||
white-space : -pre-wrap; /* Opera 4-6 */
|
||||
white-space : -o-pre-wrap; /* Opera 7 */
|
||||
word-wrap : break-word; /* Internet Explorer 5.5+ */
|
||||
}
|
||||
|
||||
#phpinfo table {
|
||||
width : 800px;
|
||||
}
|
||||
|
||||
#phpinfo th {
|
||||
background-color : #99c137;
|
||||
}
|
||||
|
||||
#phpinfo hr {
|
||||
float : left;
|
||||
width : 600px;
|
||||
}
|
||||
|
||||
#phpinfo hr:after {
|
||||
content : ".";
|
||||
display : block;
|
||||
height : 0;
|
||||
clear : both;
|
||||
visibility : hidden;
|
||||
}
|
||||
|
||||
#phpinfo h1 {
|
||||
float : left;
|
||||
width : 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php //echo current_website_language($site, $language); ?>
|
||||
<h1>Systeminfo</h1>
|
||||
|
||||
<?php
|
||||
ob_start();
|
||||
phpinfo();
|
||||
$phpinfo = ob_get_clean();
|
||||
|
||||
// Body-Content rausholen
|
||||
$phpinfo = preg_replace('#^.*<body>(.*)</body>.*$#s', '$1', $phpinfo);
|
||||
|
||||
// XHTML-Fehler korrigieren
|
||||
$phpinfo = str_replace('module_Zend Optimizer', 'module_Zend_Optimizer', $phpinfo);
|
||||
# <font> durch <span> ersetzen
|
||||
$phpinfo = str_replace('<font', '<span', $phpinfo);
|
||||
$phpinfo = str_replace('</font>', '</span>', $phpinfo);
|
||||
|
||||
// Schlüsselwörter grün oder rot einfärben
|
||||
$phpinfo = preg_replace('#>(on|enabled|active)#i', '><span style="color:#090">$1</span>', $phpinfo);
|
||||
$phpinfo = preg_replace('#>(off|disabled)#i', '><span style="color:#f00">$1</span>', $phpinfo);
|
||||
|
||||
echo '<div id="phpinfo">';
|
||||
echo $phpinfo;
|
||||
echo '</div>';
|
||||
|
||||
?>
|
||||
</div>
|
||||
91
mysyde/admin/recaptcha.php
Normal file
91
mysyde/admin/recaptcha.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
if ( isset($_REQUEST["save"])) {
|
||||
save();
|
||||
}
|
||||
|
||||
function save() {
|
||||
|
||||
/*
|
||||
$passwordOptions = get_password_options();
|
||||
$hashedPasswordsWebkey = password_hash(filter_input(INPUT_POST,'input_websiteKey'),PASSWORD_DEFAULT,$passwordOptions);
|
||||
$hashedPasswordsSecretkey = password_hash(filter_input(INPUT_POST,'input_secretKey'),PASSWORD_DEFAULT,$passwordOptions);
|
||||
|
||||
$query = "UPDATE google_recaptcha SET
|
||||
websitekey = '" . $hashedPasswordsWebkey . "',
|
||||
secretkey = '" . $hashedPasswordsSecretkey . "'
|
||||
WHERE id = 0 LIMIT 1";
|
||||
*/
|
||||
|
||||
//Prüfen der Key
|
||||
$secretKey = '';
|
||||
|
||||
$query = "SELECT * FROM google_recaptcha";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$websiteKey = $_POST['websiteKey'];
|
||||
$secretKey = $_POST['secretKey'];
|
||||
|
||||
if(@mysqli_num_rows($result) > 0){
|
||||
$reCaptcha = @mysqli_fetch_array($result);
|
||||
|
||||
$query = "UPDATE google_recaptcha SET websitekey = '".$websiteKey."', secretkey = '".$secretKey."' WHERE id = ".$reCaptcha['id'];
|
||||
|
||||
}else{
|
||||
|
||||
$query = "INSERT INTO google_recaptcha (websitekey, secretkey) VALUES (
|
||||
'".$websiteKey."',".
|
||||
"'".$secretKey."')";
|
||||
}
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$responseKey = $_POST['g-recaptcha-response'];
|
||||
|
||||
|
||||
echo $responseKey;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_recaptcha";
|
||||
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("save", $translation->get("save"), $formname, " document.getElementById('".$formname."').submit()"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('recaptcha'); ?></h1>
|
||||
<?php
|
||||
$query = "SELECT * FROM google_recaptcha";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$secretkey = '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe';
|
||||
$websitekey = '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI';
|
||||
$reCaptcha = '';
|
||||
if(@mysqli_num_rows($result) > 0){
|
||||
$reCaptcha = @mysqli_fetch_array($result);
|
||||
$secretkey = $reCaptcha['secretkey'];
|
||||
$websitekey = $reCaptcha['websitekey'];
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
|
||||
<h2>GEHEIMEN SCHLÜSSEL
|
||||
|
||||
</h2>
|
||||
<input type="text" class="recaptcha" id="recaptcha" name="secretKey" value="<?= $secretkey ;?>"></input>
|
||||
|
||||
<h2>WEBSITESCHLÜSSEL</h2>
|
||||
<input type="text" class="recaptcha" id="recaptcha" name="websiteKey" value="<?= $websitekey ;?>"></input><br><br>
|
||||
|
||||
<input type="submit" class="button_save" id="save_recaptcha" name="save" value = "<? echo get_translation("save_recaptcha_data") ?>"> </input>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
167
mysyde/admin/search_query_statistic.inc.php
Normal file
167
mysyde/admin/search_query_statistic.inc.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_search_statistic";
|
||||
|
||||
$query = "SELECT * FROM main_admin_user_shop_link where main_admin_user_id = " . (int)$GLOBALS["admin_user"]['id'];
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$siteAdminAvailableShops = array();
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
$shopAdminLink = true;
|
||||
while ($row = @mysqli_fetch_array($result)) {
|
||||
if($row['active'] == 1) {
|
||||
$siteAdminAvailableShops[] = $row['shop_code'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$shopAdminLink = false;
|
||||
}
|
||||
|
||||
// statistik leeren
|
||||
if(isset($_POST['clear_search']) && $_POST['clear_search'] == 1) {
|
||||
$query = "DELETE FROM shop_search_query WHERE shop_code = '" . $_POST['input_shop_code'] . "'";
|
||||
mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
}
|
||||
|
||||
$zeitraum_values = array(
|
||||
"1 WEEK",
|
||||
"1 MONTH",
|
||||
"1 YEAR",
|
||||
"100 YEAR"
|
||||
);
|
||||
|
||||
$zeitraum_names = array(
|
||||
$translation->get("last_week"),
|
||||
$translation->get("last_month"),
|
||||
$translation->get("last_year"),
|
||||
$translation->get("show_all")
|
||||
);
|
||||
|
||||
$sort_values = array(
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4"
|
||||
);
|
||||
|
||||
$sort_names = array(
|
||||
$translation->get("frequency_desc"),
|
||||
$translation->get("frequency_asc"),
|
||||
$translation->get("result_desc"),
|
||||
$translation->get("result_asc")
|
||||
);
|
||||
|
||||
$shop_values = array();
|
||||
$shop_names = array();
|
||||
|
||||
$query = "SELECT *
|
||||
FROM shop_shop";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
while($shop=mysqli_fetch_assoc($result))
|
||||
{
|
||||
// wenn benutzer diesen shop nicht sehen darf
|
||||
if($shopAdminLink === true && !in_array($shop['code'], $siteAdminAvailableShops)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if($_POST['input_shop_code'] == '')
|
||||
{
|
||||
$_POST['input_shop_code'] = $shop['code'];
|
||||
}
|
||||
|
||||
$shop_values[] = $shop['code'];
|
||||
$shop_names[] = $shop['description'];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function clear_search_stat() {
|
||||
if(!confirm("<?php echo $translation->get("confirm_clear_search_stat"); ?>")) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#clear_search').val("1");
|
||||
$('#<?php echo $formname ?>').submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("google",$translation->get("google_analytics"),$formname,"show_google_analytics()"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('left_search_stat'); ?></h1>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if(count($shop_values) == 0) {
|
||||
echo "<div class=\"infobox\">" . $translation->get("no_shops_available") . "</div>";
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" name="clear_search" id="clear_search" value="0" />
|
||||
<div class="requestLoader"></div>
|
||||
<table class="cardform" style="width:960px;" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<?php input_select($translation->get("shop"), "input_shop_code", $shop_values, $shop_names, $_POST['input_shop_code'], false, true); ?>
|
||||
<?php input_select($translation->get("period"), "input_period", $zeitraum_values, $zeitraum_names, $_POST['input_period'], false, true); ?>
|
||||
<?php input_select($translation->get("sorting"), "input_sort_id", $sort_values, $sort_names, $_POST['input_sort_id'], false, true); ?>
|
||||
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="button" value="<?php echo $translation->get("clear_search_stat"); ?>" onclick="clear_search_stat();" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?
|
||||
if($_POST['input_shop_code'] != '')
|
||||
{
|
||||
$shop_query = "AND shop_code = '".$_POST['input_shop_code']."'";
|
||||
}
|
||||
|
||||
if(isset($_POST['input_period'])) {
|
||||
$intervall_query = $_POST['input_period'];
|
||||
} else {
|
||||
$intervall_query = "1 WEEK";
|
||||
}
|
||||
|
||||
// Es muss eine ID fuer die linklist uebergeben werden
|
||||
$query = "SET @row_number:=0;";
|
||||
@mysqli_query($GLOBALS['mysql_con'],$query);
|
||||
|
||||
$query = "SELECT
|
||||
@row_number:=@row_number+1 AS id,
|
||||
search_query AS '" . $translation->get("searchquery") . "',
|
||||
COUNT(id) AS '" . $translation->get("occurence") . "',
|
||||
MAX(no_of_results) AS '" . $translation->get("results") . "'
|
||||
FROM
|
||||
shop_search_query
|
||||
WHERE
|
||||
search_datetime >= DATE_SUB(NOW(),INTERVAL " . $intervall_query . ")
|
||||
". $shop_query ."
|
||||
GROUP BY
|
||||
search_query"
|
||||
;
|
||||
switch($_POST["input_sort_id"]) {
|
||||
case "2": $query .= " ORDER BY `" . $translation->get("occurence") . "` ASC"; break;
|
||||
case "3": $query .= " ORDER BY `" . $translation->get("results") . "` DESC"; break;
|
||||
case "4": $query .= " ORDER BY `" . $translation->get("results") . "` ASC"; break;
|
||||
default: $query .= " ORDER BY `" . $translation->get("occurence") . "` DESC"; break;
|
||||
}
|
||||
if($result = @mysqli_query($GLOBALS['mysql_con'],$query)) {
|
||||
$format = array("option", "text","integer","integer");
|
||||
linklist($result,$formname,$format);
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
69
mysyde/admin/set_password.inc.php
Normal file
69
mysyde/admin/set_password.inc.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<? require_once("../common/version_comment.inc.php"); ?>
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get('translation');
|
||||
|
||||
?>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<title><?php echo $translation->get('backend_set_password_title'); ?></title>
|
||||
<link
|
||||
href="/layout/admin/css/mysyde.css?t=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/layout/admin/css/mysyde.css')?>"
|
||||
rel="stylesheet" type="text/css" />
|
||||
<link
|
||||
href="/layout/admin/css/responsive.css?t=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/layout/admin/css/responsive.css')?>"
|
||||
rel="stylesheet" type="text/css" />
|
||||
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/layout/admin/img/2016/favicons/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" href="/layout/admin/img/2016/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="/layout/admin/img/2016/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="/layout/admin/img/2016/favicons/manifest.json">
|
||||
<link rel="mask-icon" href="/layout/admin/img/2016/favicons/safari-pinned-tab.svg" color="#99c137">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body class="login">
|
||||
<div id="login-container">
|
||||
|
||||
<div id="login">
|
||||
|
||||
<div class="login-wrapper">
|
||||
<div id="mysyde-logo"><img src="/userdata/images/mysyde-icon.png" alt=""></div>
|
||||
<div id="login_1"><?php echo $translation->get('backend_set_password_title'); ?></div>
|
||||
|
||||
|
||||
|
||||
<div id="login_2">
|
||||
<div class="forgetError"><p><?=$_SESSION['forget_error'];?></p></div>
|
||||
<form name="form_admin_login" id="form_admin_login" action="?action=set_password" method="post">
|
||||
<div class="label"><label for="input_login"><?php echo $translation->get('password'); ?>
|
||||
:</label></div>
|
||||
<div class="input"><input class="code" type="password" name="input_password" /></div>
|
||||
<div class="label"><label for="input_login"><?php echo $translation->get('password_repeat'); ?>
|
||||
:</label></div>
|
||||
<div class="input"><input class="code" type="password" name="input_password2" /></div>
|
||||
|
||||
|
||||
<div class="button-wrapper">
|
||||
|
||||
<input class="button" name="" type="submit"
|
||||
value="SENDEN" />
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
223
mysyde/admin/start.inc.php
Normal file
223
mysyde/admin/start.inc.php
Normal file
@@ -0,0 +1,223 @@
|
||||
<?
|
||||
// Startsequenz der Oberfläche
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
||||
// Verbindung mit Datenbank herstellen
|
||||
db_connect();
|
||||
define('COOKIE_DAYS_VALID', 30);
|
||||
define('CMS_PATH', dirname(__FILE__) . '/../');
|
||||
define('INTRANET_PATH', dirname(__FILE__) . '/../intranet/');
|
||||
define('MODULE_PATH', dirname(__FILE__) . '/../../module/');
|
||||
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
|
||||
|
||||
define('COLLECTION_SITEPART_ID', 99);
|
||||
|
||||
try {
|
||||
//code...
|
||||
|
||||
|
||||
/*function dc_autoloader($class) {
|
||||
require_once CMS_PATH . sprintf("common/classes/%s.php", $class);
|
||||
}
|
||||
|
||||
spl_autoload_register('dc_autoloader');*/
|
||||
|
||||
// Session-ID generieren
|
||||
ini_set("session.use_cookies", 1);
|
||||
ini_set("session.use_only_cookies", 1);
|
||||
ini_set("session.use_trans_sid", 1);
|
||||
session_name("sidcms");
|
||||
|
||||
$visitor_set = 0;
|
||||
|
||||
if (!empty($_COOKIE['sidcms'])) {
|
||||
$cookie_preset = TRUE;
|
||||
} else {
|
||||
$cookie_preset = FALSE;
|
||||
}
|
||||
if (!(strlen(session_id()) > 0)) {
|
||||
if (!empty($_GET['sidcms']) && check_sid_for_login($_GET['sidcms'])) {
|
||||
session_id($_GET['sidcms']);
|
||||
session_start();
|
||||
} elseif ($cookie_preset) {
|
||||
session_id($_COOKIE['sidcms']);
|
||||
session_start();
|
||||
} else {
|
||||
session_start();
|
||||
}
|
||||
} else {
|
||||
session_start();
|
||||
}
|
||||
|
||||
if (!empty($_GET['live_edit']) && $_GET['live_edit'] == 1) {
|
||||
$GLOBALS["insert_live_edit_js"] = TRUE;
|
||||
} elseif (!empty($_SESSION['sidcms'])) {
|
||||
$visitor = get_visitor_small($_SESSION['sidcms'], 1, 0);
|
||||
$visitor_set = 1;
|
||||
}
|
||||
if (!empty($_COOKIE['sidcms'])) {
|
||||
//cookie login
|
||||
$cookie_sid = $_COOKIE['sidcms'];
|
||||
$visitor = get_visitor_small($cookie_sid);
|
||||
$_SESSION['sidcms'] = $cookie_sid;
|
||||
|
||||
$remember_token_orig = trim((string)$visitor['remember_token']);
|
||||
$cookie_index = 'cms_remember_login';
|
||||
$remember_token_compare = trim((string)$_COOKIE[$cookie_index]);
|
||||
if (
|
||||
($GLOBALS['visitor']['admin_login'] && !(bool)$_SESSION['pass_auth'])
|
||||
&&
|
||||
(
|
||||
(
|
||||
$GLOBALS['visitor']['cookie_only']
|
||||
&&
|
||||
(
|
||||
empty($remember_token_orig)
|
||||
||
|
||||
empty($remember_token_compare)
|
||||
)
|
||||
)
|
||||
||
|
||||
(
|
||||
!empty($remember_token_orig)
|
||||
&&
|
||||
(
|
||||
empty($remember_token_compare)
|
||||
||
|
||||
!($remember_token_compare == $remember_token_orig)
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
$visitor['frontend_login'] = 0;
|
||||
$GLOBALS['visitor']['frontend_login'] = 0;
|
||||
$query = 'UPDATE main_visitor SET admin_login = 0 WHERE id=' . $GLOBALS['visitor']['id'];
|
||||
//trigger_eror("LOGOUT! PASS-AUTH: " . $_SESSION['pass_auth'] . " | COOKIE-ONLY: " . $GLOBALS['visitor']['cookie_only'] . " | TOKEN DB: " . $remember_token_orig . " | TOKEN CLIENT: " . $remember_token_compare);
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
//logQuery(date('c'), $query, __FILE__, __LINE__, $GLOBALS['querylog'], FALSE, FALSE, __FUNCTION__, TRUE, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Get session date
|
||||
$session_time = strtotime($GLOBALS['visitor']['session_date']);
|
||||
$time_diff = time() - $session_time;
|
||||
//90 Minutes
|
||||
$diff_limit = 90 * 60;
|
||||
|
||||
if (
|
||||
$visitor['admin_login']
|
||||
&&
|
||||
(!$_SESSION['pass_auth'])
|
||||
&&
|
||||
(!empty($remember_token_compare))
|
||||
&&
|
||||
$remember_token_compare == $remember_token_orig
|
||||
&&
|
||||
$cookie_preset
|
||||
&&
|
||||
($time_diff > $diff_limit)
|
||||
) {
|
||||
cookie_login_postprocessing($visitor, $_COOKIE);
|
||||
}
|
||||
$_SESSION['pass_auth'] = FALSE;
|
||||
$GLOBALS['visitor']['pass_auth'] = FALSE;
|
||||
$GLOBALS['visitor_set'] = 1;
|
||||
|
||||
if ($visitor_set !== 1) {
|
||||
$visitor = get_visitor();
|
||||
}
|
||||
|
||||
// Variablen schützen
|
||||
// $_GET = secure_array($_GET, TRUE);
|
||||
// $_POST = secure_array($_POST, FALSE);
|
||||
|
||||
check_admin_user_login();
|
||||
renew_session_dates($visitor);
|
||||
$GLOBALS["visitor"] = $visitor;
|
||||
$admin_user = get_admin_user($visitor);
|
||||
$GLOBALS["admin_user"] = $admin_user;
|
||||
|
||||
// load Translation class into registry
|
||||
$user_language = (isset($GLOBALS["admin_user"]['main_language']) ? $GLOBALS["admin_user"]['main_language'] : 'de');
|
||||
\DynCom\mysyde\common\classes\Registry::set('translation', new \DynCom\mysyde\common\classes\Translate($user_language));
|
||||
|
||||
// Setup, Webseite, Sprache, Layout und aktuelle Menüebene auslesen
|
||||
$setup = setup_get();
|
||||
$GLOBALS["setup"] = $setup;
|
||||
site_change();
|
||||
$user_site_id = get_user_site_id();
|
||||
$site = ($_GET["site"] <> '') ? site_getbycode($_GET["site"]) : site_getbyid($user_site_id);
|
||||
|
||||
// wenn die website nicht erlaubt ist dann die erste erlaubte website auslesen.
|
||||
// Passiert nur wenn der User direkt die URL der website weiss
|
||||
if(!is_site_allowed($site['id'])) {
|
||||
$setup = setup_get_allowed_site();
|
||||
$GLOBALS["setup"] = $setup;
|
||||
$site = site_getbyid($setup['std_main_site_id']);
|
||||
}
|
||||
|
||||
$GLOBALS["site"] = $site;
|
||||
language_change();
|
||||
$GLOBALS["language"] = $language;
|
||||
$language = ($_GET["language"] <> '') ? language_getbycode($_GET["language"], $GLOBALS["site"]["id"]) : language_getbyid($site["std_main_language_id"]);
|
||||
$admin_navigation = admin_navigation_get();
|
||||
$GLOBALS["admin_navigation"] = $admin_navigation;
|
||||
$GLOBALS["layout"] = layout_getbyid($language["main_layout_id"]);
|
||||
|
||||
// Startseite setzen
|
||||
if (!isset($_GET['level_1']) || empty($_GET['level_1'])) {
|
||||
$_GET['level_1'] = 'dashboard';
|
||||
|
||||
}
|
||||
|
||||
// pruefen ob das menu oben offen ist um class zu setzen
|
||||
$adminMenu = \DynCom\mysyde\common\classes\Adminmenu::get();
|
||||
|
||||
$linklistmenu = TRUE;
|
||||
if (isset($_GET["level_1"]) && $_GET["level_1"] != "" && isset($adminMenu[$_GET["level_1"]]['linklistmenu'])) {
|
||||
$linklistmenu = $adminMenu[$_GET["level_1"]]['linklistmenu'];
|
||||
}
|
||||
if (isset($_GET["level_2"]) && $_GET["level_2"] != "" && isset($adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['linklistmenu'])) {
|
||||
$linklistmenu = $adminMenu[$_GET["level_1"]]['subsites'][$_GET["level_2"]]['linklistmenu'];
|
||||
}
|
||||
|
||||
if ($linklistmenu === TRUE) {
|
||||
$GLOBALS["menu_opened"] = TRUE;
|
||||
} else {
|
||||
$GLOBALS["menu_opened"] = FALSE;
|
||||
}
|
||||
|
||||
update_visitor_data(array(
|
||||
'collection_options' => array(
|
||||
'collection_edit' => FALSE
|
||||
)
|
||||
));
|
||||
|
||||
// benoetigt fuer ckfinder
|
||||
if ($GLOBALS["visitor"]["admin_login"]) {
|
||||
$_SESSION['IsAuthorized'] = TRUE;
|
||||
} else {
|
||||
$_SESSION['IsAuthorized'] = FALSE;
|
||||
}
|
||||
|
||||
before_header();
|
||||
|
||||
// check for ajax call
|
||||
if (IS_AJAX) {
|
||||
if (!$GLOBALS["visitor"]["admin_login"]) {
|
||||
header('REQUIRES_AUTH: 1');
|
||||
exit(); // send redirect header ans exit
|
||||
}
|
||||
|
||||
require_once("content_ajax.inc.php");
|
||||
require_once("close.inc.php");
|
||||
|
||||
exit(); // exit script, no need to load the whole content
|
||||
}
|
||||
|
||||
$GLOBALS['shop_setup']['allowed_false_login_times'] = 3;
|
||||
$GLOBALS['shop_setup']['false_login_waiting_seconds'] = 60;
|
||||
} catch (\Throwable $th) {
|
||||
echo $th;
|
||||
}
|
||||
?>
|
||||
482
mysyde/admin/statistic.inc.php
Normal file
482
mysyde/admin/statistic.inc.php
Normal file
@@ -0,0 +1,482 @@
|
||||
<?
|
||||
$messages = array();
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$filter = (isset($_REQUEST['filter']) ? $_REQUEST['filter'] : "");
|
||||
|
||||
$action = (isset($_GET['action']) ? $_GET['action'] : "");
|
||||
|
||||
if ($action != "" && $action != "admin_login") {
|
||||
require_once(CMS_PATH . "admin/mail_log.inc.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
<? $formname = "form_stat"; ?>
|
||||
<script type="text/javascript">
|
||||
function filter_collection() {
|
||||
var formname = '#<?=$formname."response";?>';
|
||||
jQuery(formname + ' .requestLoader').show();
|
||||
|
||||
var filter = jQuery('#collection_filter').val();
|
||||
|
||||
jQuery(formname).attr("action", "?filter=" + filter).submit();
|
||||
|
||||
return;
|
||||
|
||||
var formData = {
|
||||
filter_id: jQuery('#collection_filter').val(),
|
||||
};
|
||||
|
||||
jQuery('#spid').val(jQuery('#collection_filter').val());
|
||||
$.ajax({
|
||||
url : "?action=filter_collection",
|
||||
type : 'POST',
|
||||
data : formData,
|
||||
success: function ( output, status, xhr ) {
|
||||
if (xhr.getResponseHeader('REQUIRES_AUTH') == 1) {
|
||||
window.location.replace("/mysyde/");
|
||||
} else {
|
||||
jQuery(formname + ' .requestLoader').hide();
|
||||
jQuery('#page_linklist').html(output);
|
||||
|
||||
initForm();
|
||||
initLinklist();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('top_statistic'); ?></h1>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<!-- <form id="<?= $formname ?>" name="<?= $formname ?>" method="post" action="?action=filter">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
|
||||
$where = 'where send_date >= DATE_SUB(NOW(),INTERVAL 7 DAY)';
|
||||
|
||||
$query = "SELECT id, subject AS '" . $translation->get("subject") . "', DATE_FORMAT(send_date,'%d.%m.%Y um %H:%i Uhr') AS '" . $translation->get("send_on") . "', to_adress AS '" . $translation->get("recipient_email") . "', from_adress AS '" . $translation->get("sender_email") . "' FROM main_mail_log " . $where . " ORDER BY send_date DESC";
|
||||
$format = array('option', 'text', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "card");
|
||||
}
|
||||
?>
|
||||
|
||||
</form> -->
|
||||
<!-- content -->
|
||||
<div class="dashboard-wrapper">
|
||||
<div class="dashboard_left">
|
||||
<div class="dashboad-left-wrapper">
|
||||
<div class="dashboard-padding">
|
||||
<div class="dashboard-100 teaser border position-relative" style="height:160px;">
|
||||
<div class="dashboard-left-content-statistics">
|
||||
<div class="link-wrapper" >
|
||||
<div class="dashboard-100 shortlink link-collection position-relative">
|
||||
<div class="card-wrapper dashboard-100 " style="margin-top:40px;">
|
||||
<div class="card-content dashboard-100">
|
||||
<div class="log-title"><?php echo get_translation('left_survey_contactforms_last'); ?> </div>
|
||||
<form id="<?= $formname.'response' ?>" name="<?= $formname .'response'?>" method="post" action="?action=filter">
|
||||
<div class="input">
|
||||
<select id="collection_filter" name="collection_filter" class="bigselect" onchange="filter_collection();">
|
||||
<option value=""> ----</option>
|
||||
<?php $query = "SELECT * FROM contactform_header WHERE is_survey = 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if(@mysqli_num_rows($result) > 0){
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
?>
|
||||
<option value="<?=$row['id']?>" <?php echo ($filter == $row['id'] ? 'selected="selected"' : ""); ?>><?php echo $row['description'] ?></option>
|
||||
<?php } } ?>
|
||||
</select>
|
||||
</div>
|
||||
<input id="spid" name="input_id" type="hidden" value="">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div id="page_linklist">
|
||||
<?
|
||||
$where = " WHERE cf.is_survey = 1 ";
|
||||
if($filter != ""){
|
||||
$where = " AND cf.id =".$filter;
|
||||
}
|
||||
|
||||
$query = "SELECT DISTINCT sp.id, cf.description AS '" . $translation->get("type") . "', sp.name AS 'Name', sp.email FROM contactform_header as cf INNER JOIN survey_persons as sp on sp.header_id = cf.id INNER JOIN survey_answers as sa on sp.id = sa.spid " .$where." ORDER BY sp.id DESC";
|
||||
|
||||
$format = array('option', 'text', 'text', 'text', 'boolean');
|
||||
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname.'response', $format, "input_line_id", "edit_line_contactform", FALSE, "update_sortorder_contactform");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Mail protocol -->
|
||||
<!-- Mail protocol end -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dashboard_right">
|
||||
<div class="dashboard-right-wrapper dashboard-100">
|
||||
<div class="dashboard-padding dashboard-100">
|
||||
|
||||
<div class="dashboard-100">
|
||||
<div class="log-wrapper dashboard-100">
|
||||
<div class="log-content-wrapper">
|
||||
<div class="log-title"><?php echo get_translation('left_survey_contactforms'); ?> </div>
|
||||
<div class="log-content-statistics">
|
||||
|
||||
<?php
|
||||
$bgArray = array();
|
||||
$queryRow = '';
|
||||
$cfid = '';
|
||||
$dataset = array();
|
||||
if($filter != ''){
|
||||
?>
|
||||
<canvas id="myChart"></canvas>
|
||||
<?
|
||||
$cfid = $filter;
|
||||
$queryRow = "SELECT cl.id, cl.header_id,cl.name FROM contactform_line as cl INNER JOIN contactform_header as ch on cl.header_id = ch.id WHERE ch.is_survey = 1 AND header_id = '" . $filter . "' ORDER BY cl.sorting ASC";
|
||||
$label = array();
|
||||
$dataArray = array();
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $queryRow);
|
||||
if(@mysqli_num_rows($result) > 0){
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
$cfid = $row['header_id'];
|
||||
array_push($label, substr($row['name'], 0, 10).'...');
|
||||
$first = rand(0, 255);
|
||||
$second = rand(0, 255);
|
||||
$third = rand(0, 255);
|
||||
$color = 'rgb('.$first.', '.$second.', '.$third.')';
|
||||
array_push($bgArray, $color);
|
||||
$queryData = 'SELECT line_id, count(*) as NUMCOUNT FROM survey_answers WHERE header_id = '.$row['header_id'].' AND line_id = "'.$row['id'].'" ORDER BY option_string';
|
||||
$resultData = @mysqli_query($GLOBALS['mysql_con'], $queryData);
|
||||
//
|
||||
if(@mysqli_num_rows($resultData)){
|
||||
$rowData = @mysqli_fetch_array($resultData);
|
||||
$dataArray[$row['id']] = $rowData['NUMCOUNT'];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
$querySet = "SELECT * FROM contactform_header WHERE is_survey = 1 ORDER BY ID ASC";
|
||||
$resultSet = @mysqli_query($GLOBALS['mysql_con'], $querySet);
|
||||
if(@mysqli_num_rows($resultSet) > 0){
|
||||
$date1 = date('Y').'-01-01';
|
||||
$date2 = date('Y').'-'.date('m-d');
|
||||
while($rowSet = @mysqli_fetch_array($resultSet)){
|
||||
// $dataset[$rowSet['id']]['name'] = $rowSet['description'];
|
||||
for($i = 1;$i<=12;$i++){
|
||||
$dataset[$rowSet['id']][$i] = 0;
|
||||
|
||||
}
|
||||
$queryPerson = "SELECT MONTH(created_date) as month, count(*) NUM FROM survey_persons WHERE DATE(created_date) BETWEEN '".$date1."' AND '".$date2."' AND header_id = '".$rowSet['id']."' GROUP BY month ";
|
||||
$resultPerson = @mysqli_query($GLOBALS['mysql_con'], $queryPerson);
|
||||
while($rowPerson = @mysqli_fetch_array($resultPerson)){
|
||||
$dataset[$rowSet['id']][$row['month']] = $row['NUM'];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if(!empty($dataset)){?>
|
||||
<canvas id="myChartLine"></canvas>
|
||||
<?php }
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Show Surveys list -->
|
||||
<div class="dashboard-right-wrapper dashboard-100">
|
||||
<div class="dashboard-padding dashboard-100">
|
||||
|
||||
<div class="dashboard-100">
|
||||
<div class="log-wrapper dashboard-100">
|
||||
<div class="log-content-wrapper">
|
||||
<div class="log-title"><?php echo get_translation('left_survey_contactforms'); ?> </div>
|
||||
<div class="log-content" style="height:auto;">
|
||||
<!-- table -->
|
||||
<form id="<?= $formname.'surveys' ?>" name="<?= $formname .'surveys'?>" method="post" action="?action=filter">
|
||||
|
||||
<input id="spid" name="input_id" type="hidden" value="">
|
||||
<input type="hidde" name="header_id" id="header_id" value="">
|
||||
<div class="requestLoader"></div>
|
||||
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div id="page_linklist_surveys">
|
||||
<?
|
||||
|
||||
$query = "SELECT
|
||||
id,
|
||||
description AS '" . $translation->get("description") . "',
|
||||
from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "'
|
||||
FROM contactform_header WHERE is_survey = 1";
|
||||
|
||||
$format = array('option', 'text', 'text', 'text', 'boolean');
|
||||
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname.'survey', $format, "header_id", "show_survey_contactform", FALSE, "update_sortorder_contactform");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
||||
<!-- table end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Survey list end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Content end -->
|
||||
<div class="clearfix"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
const ctx = document.getElementById('myChart');
|
||||
var labelArray = [
|
||||
<?php echo '"'.implode('","', $label).'"' ?>
|
||||
];
|
||||
var dataArray = [
|
||||
<?php echo '"'.implode('","', $dataArray).'"' ?>
|
||||
];
|
||||
var bgArray = [
|
||||
<?php echo '"'.implode('","', $bgArray).'"' ?>
|
||||
];
|
||||
console.log('dataArray are' + "<?= implode('","', $dataArray);?>");
|
||||
const myChart = new Chart(ctx, {
|
||||
type: 'pie',
|
||||
data: {
|
||||
labels: labelArray,
|
||||
datasets: [{
|
||||
label: 'My First Dataset',
|
||||
data: dataArray,
|
||||
backgroundColor: bgArray,
|
||||
hoverOffset: 4
|
||||
}]
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
const MONTHS = [
|
||||
'January',
|
||||
'February',
|
||||
'March',
|
||||
'April',
|
||||
'May',
|
||||
'June',
|
||||
'July',
|
||||
'August',
|
||||
'September',
|
||||
'October',
|
||||
'November',
|
||||
'December'
|
||||
];
|
||||
|
||||
function getMonths(config) {
|
||||
var cfg = config || {};
|
||||
var count = cfg.count || 12;
|
||||
var section = cfg.section;
|
||||
var values = [];
|
||||
var i, value;
|
||||
|
||||
for (i = 0; i < count; ++i) {
|
||||
value = MONTHS[Math.ceil(i) % 12];
|
||||
values.push(value.substring(0, section));
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
const DATA_COUNT = 7;
|
||||
const NUMBER_CFG = {count: DATA_COUNT, min: -100, max: 100};
|
||||
function getnumbers(config) {
|
||||
var cfg = config || {};
|
||||
var min = valueOrDefault(cfg.min, 0);
|
||||
var max = valueOrDefault(cfg.max, 100);
|
||||
var from = valueOrDefault(cfg.from, []);
|
||||
var count = valueOrDefault(cfg.count, 8);
|
||||
var decimals = valueOrDefault(cfg.decimals, 8);
|
||||
var continuity = valueOrDefault(cfg.continuity, 1);
|
||||
var dfactor = Math.pow(10, decimals) || 0;
|
||||
var data = [];
|
||||
var i, value;
|
||||
|
||||
for (i = 0; i < count; ++i) {
|
||||
value = (from[i] || 0) + this.rand(min, max);
|
||||
if (this.rand() <= continuity) {
|
||||
data.push(Math.round(dfactor * value) / dfactor);
|
||||
} else {
|
||||
data.push(null);
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
var CHART_COLORSS = {
|
||||
red: 'rgb(255, 99, 132)',
|
||||
orange: 'rgb(255, 159, 64)',
|
||||
yellow: 'rgb(255, 205, 86)',
|
||||
green: 'rgb(75, 192, 192)',
|
||||
blue: 'rgb(54, 162, 235)',
|
||||
purple: 'rgb(153, 102, 255)',
|
||||
grey: 'rgb(201, 203, 207)'
|
||||
};
|
||||
var dataArraySet = [
|
||||
<?php echo '"'.implode('","', $dataset[30]).'"' ?>
|
||||
];
|
||||
function transparentize(value, opacity) {
|
||||
var alpha = opacity === undefined ? 0.5 : 1 - opacity;
|
||||
return colorLib(value).alpha(alpha).rgbString();
|
||||
}
|
||||
aDatasets1 = [0,0,0,0,0,0,15, 1,0,0,0,0];
|
||||
aDatasets2 = [20,30,40,50,60,20,25, 1,2,3,4, 5];
|
||||
aDatasets3 = [30,20,25,65,90,34,20, 5,4,3,2,1];
|
||||
var ctxLine = document.getElementById("myChartLine");
|
||||
var myChartLine = new Chart(ctxLine, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: getMonths({count: 12}),
|
||||
|
||||
datasets: [ {
|
||||
label: 'Result',
|
||||
fill:false,
|
||||
data: aDatasets1,
|
||||
backgroundColor: '#E91E63',
|
||||
borderColor: [
|
||||
'rgba(255,99,132,1)',
|
||||
'rgba(255,99,132,1)',
|
||||
'rgba(255,99,132,1)',
|
||||
'rgba(255,99,132,1)',
|
||||
'rgba(255,99,132,1)',
|
||||
'rgba(255,99,132,1)',
|
||||
],
|
||||
borderWidth: 1
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero:true
|
||||
}
|
||||
}]
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Nishi IT Institute'
|
||||
},
|
||||
responsive: true,
|
||||
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
labelColor: function(tooltipItem, chart) {
|
||||
return {
|
||||
borderColor: 'rgb(255, 0, 20)',
|
||||
backgroundColor: 'rgb(255,20, 0)'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
labels: {
|
||||
// This more specific font property overrides the global property
|
||||
fontColor: 'red',
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// const labels = getMonths({count: 12});
|
||||
// var ctxLine = document.getElementById('myChartLine').getContext("2d");;
|
||||
// const data = {
|
||||
// labels: labels,
|
||||
// datasets: [
|
||||
// {
|
||||
// label: 'Dataset 1',
|
||||
// data: dataArraySet,
|
||||
// borderColor: CHART_COLORSS.red,
|
||||
// backgroundColor: [
|
||||
// 'rgba(255, 99, 132, 0.2)',
|
||||
// 'rgba(255, 159, 64, 0.2)',
|
||||
// 'rgba(255, 205, 86, 0.2)',
|
||||
// 'rgba(75, 192, 192, 0.2)',
|
||||
// 'rgba(54, 162, 235, 0.2)',
|
||||
// 'rgba(153, 102, 255, 0.2)',
|
||||
// 'rgba(221, 203, 207, 0.2)',
|
||||
// 'rgba(231, 203, 207, 0.2)',
|
||||
// 'rgba(201, 203, 207, 0.2)',
|
||||
// 'rgba(21, 203, 207, 0.2)',
|
||||
// 'rgba(23, 203, 207, 0.2)',
|
||||
// 'rgba(233, 203, 207, 0.2)',
|
||||
|
||||
// ],
|
||||
// }
|
||||
// ]
|
||||
// };
|
||||
// var myChartLine = new Chart(ctxLine, {
|
||||
// type: 'bar',
|
||||
// data: data,
|
||||
// options: {
|
||||
// responsive: true,
|
||||
// plugins: {
|
||||
// legend: {
|
||||
// position: 'top',
|
||||
// },
|
||||
// title: {
|
||||
// display: true,
|
||||
// text: 'Chart.js Bar Chart'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// });
|
||||
|
||||
$('.dashboard-100').css('display', 'contents');
|
||||
</script>
|
||||
341
mysyde/admin/statistic_access.inc.php
Normal file
341
mysyde/admin/statistic_access.inc.php
Normal file
@@ -0,0 +1,341 @@
|
||||
<?
|
||||
setlocale(LC_TIME, "de_DE");
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
// Variablen definieren
|
||||
$local_file = CMS_PATH . 'common/logparser/access.log';
|
||||
$server_file = 'logs/access.log';
|
||||
|
||||
if(isset($_GET['action'])) {
|
||||
|
||||
$jsonresult = array(
|
||||
'error'=> false,
|
||||
'message' => ''
|
||||
);
|
||||
|
||||
switch($_GET['action']) {
|
||||
case 'start_update':
|
||||
|
||||
if (isset($GLOBALS["ftp_host"]) && isset($GLOBALS["ftp_login"]) && isset($GLOBALS["ftp_password"])) {
|
||||
// Verbindung aufbauen
|
||||
$conn_id = ftp_connect($GLOBALS["ftp_host"]);
|
||||
|
||||
// Login mit Benutzername und Passwort
|
||||
$login_result = ftp_login($conn_id, $GLOBALS["ftp_login"], $GLOBALS["ftp_password"]);
|
||||
ftp_pasv($conn_id, TRUE);
|
||||
// Versuche $server_file herunterzuladen und in $local_file zu speichern
|
||||
|
||||
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
|
||||
// Alles OK
|
||||
$jsonresult['message'] = $translation->get("stat_file_download_step2");
|
||||
|
||||
$file = new SplFileObject($local_file);
|
||||
$file->seek($file->getSize());
|
||||
$linesTotal = $file->key();
|
||||
|
||||
$jsonresult['lines'] = $linesTotal;
|
||||
} else {
|
||||
$jsonresult['error'] = true;
|
||||
$jsonresult['message'] = $translation->get("stat_file_download_error");
|
||||
}
|
||||
|
||||
// Verbindung schließen
|
||||
ftp_close($conn_id);
|
||||
}
|
||||
echo json_encode($jsonresult);
|
||||
exit();
|
||||
break;
|
||||
|
||||
case 'update':
|
||||
// letztes update timestamp ermitteln
|
||||
$query = "SELECT MAX(timestamp) AS letztes FROM main_log";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$maxTimestamp = 0;
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$row = @mysqli_fetch_array($result);
|
||||
$maxTimestamp = $row['letztes'];
|
||||
}
|
||||
|
||||
ini_set('max_execution_time', '0');
|
||||
|
||||
// include all the classes
|
||||
require_once(CMS_PATH . 'common/logparser/class.log.php');
|
||||
require_once(CMS_PATH . 'common/logparser/class.log.mysql.php');
|
||||
require_once(CMS_PATH . 'common/logparser/class.log.output.php');
|
||||
|
||||
// see class.log.mysql.php for example table setup
|
||||
//
|
||||
log::$parser = new log_mysql(array(
|
||||
'table' => 'main_log',
|
||||
'fields' => array(
|
||||
'ip' => 'ip',
|
||||
'identd' => 'identd',
|
||||
'auth' => 'auth',
|
||||
'day' => 'day',
|
||||
'month' => 'month',
|
||||
'year' => 'year',
|
||||
'time' => 'time',
|
||||
'request' => 'request',
|
||||
'http_version' => 'http_version',
|
||||
'response_code' => 'response_code',
|
||||
'size' => 'size',
|
||||
'referrer' => 'referrer',
|
||||
'navigator' => 'navigator',
|
||||
'timestamp' => 'timestamp',
|
||||
'insertdate' => 'insertdate'
|
||||
),
|
||||
'maxTimestamp' => $maxTimestamp,
|
||||
'start' => $_POST['start'],
|
||||
'end' => $_POST['end']
|
||||
));
|
||||
|
||||
log::parse($local_file);
|
||||
echo json_encode($jsonresult);
|
||||
exit();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function stat_filter( $site_id, $language_id, $from_level = 1, $to_level = 3 ) {
|
||||
$current_filter = (isset($_POST['filter_days']) ? $_POST['filter_days'] : 7);
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
echo "<div class=\"input\"><select onchange=\"filter_mails(this.value);\" class=\"bigselect\" name=\"page_filter\" id=\"page_filter\">";
|
||||
echo "<option value='WEEKOFYEAR' " . ($current_filter == "WEEKOFYEAR" ? 'selected="selected"' : '') . ">" . $translation->get("weekofyear") . "</option>";
|
||||
echo "<option value='MONTH' " . ($current_filter == "MONTH" ? 'selected="selected"' : '') . ">" . $translation->get("month") . "</option>";
|
||||
echo "<option value='YEAR' " . ($current_filter == "YEAR" ? 'selected="selected"' : '') . ">" . $translation->get("year") . "</option>";
|
||||
echo "</select>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$messages = array();
|
||||
?>
|
||||
<?
|
||||
|
||||
if (isset($_POST['filter_days'])) {
|
||||
$where = $_POST['filter_days'];
|
||||
} else {
|
||||
$where = 'WEEKOFYEAR';
|
||||
}
|
||||
|
||||
// where zum filtern der aktuellen seite.
|
||||
// hits von /layout /plugins /userdata usw. werden nicht mitgezaehlt
|
||||
$siteOnlyWhere = " (request = 'GET /' OR request LIKE 'GET /" . $GLOBALS["site"]["code"] . "/" . $GLOBALS["language"]["code"] . "%' ) ";
|
||||
|
||||
$formname = "form_stat";
|
||||
|
||||
$hits = array();
|
||||
$query = "
|
||||
SELECT
|
||||
" . $where . "( from_unixtime( `timestamp` , '%Y-%m-%d' ) ) AS datum,
|
||||
YEAR(from_unixtime( `timestamp` , '%Y-%m-%d' )) AS jahr,
|
||||
ip,
|
||||
COUNT( * ) as anzahl
|
||||
FROM
|
||||
`main_log`
|
||||
where
|
||||
" . $siteOnlyWhere . "
|
||||
GROUP BY
|
||||
datum,jahr
|
||||
ORDER BY
|
||||
timestamp DESC"; // hits
|
||||
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = mysqli_fetch_array($result)) {
|
||||
if (!isset($hits[$row['jahr']])) {
|
||||
$hits[$row['jahr']] = array();
|
||||
}
|
||||
$hits[$row['jahr']][$row['datum']] = $row['anzahl'];
|
||||
}
|
||||
|
||||
$besucher = array();
|
||||
$query = "
|
||||
SELECT
|
||||
COUNT(*) AS anzahl,
|
||||
temptable.datum AS datum,
|
||||
temptable.jahr AS jahr
|
||||
FROM
|
||||
(SELECT
|
||||
" . $where . "( from_unixtime( `timestamp` , '%Y-%m-%d' ) ) AS datum,
|
||||
YEAR(from_unixtime( `timestamp` , '%Y-%m-%d' )) AS jahr
|
||||
FROM
|
||||
`main_log`
|
||||
WHERE
|
||||
" . $siteOnlyWhere . "
|
||||
GROUP BY
|
||||
datum,jahr,ip
|
||||
ORDER BY
|
||||
timestamp DESC
|
||||
) AS temptable
|
||||
GROUP BY
|
||||
temptable.datum, temptable.jahr"; // besucher
|
||||
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
while ($row = mysqli_fetch_array($result)) {
|
||||
if (!isset($besucher[$row['jahr']])) {
|
||||
$besucher[$row['jahr']] = array();
|
||||
}
|
||||
$besucher[$row['jahr']][$row['datum']] = $row['anzahl'];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var _update_step = 5000;
|
||||
|
||||
function show_google_analytics() {
|
||||
window.open("https://accounts.google.com/Login?hl=de&service=analytics");
|
||||
}
|
||||
|
||||
function filter_mails( _days ) {
|
||||
jQuery('#filter_days').val(_days);
|
||||
jQuery('#form_stat').submit();
|
||||
}
|
||||
|
||||
function voidFunction() {
|
||||
|
||||
}
|
||||
|
||||
function refresh_stat() {
|
||||
if(!confirm("<?php echo $translation->get("refresh_stat_confirm"); ?>")) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#refresh_stat').hide();
|
||||
$('#stat_info').show();
|
||||
|
||||
$.ajax({
|
||||
url: "?action=start_update",
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
success: function(output, status, xhr) {
|
||||
$('#stat_text').html(output.message);
|
||||
intervall_stat_update(0,_update_step,output.lines);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function intervall_stat_update(_start, _end, _maxLines) {
|
||||
$.ajax({
|
||||
url: "?action=update",
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
start: _start,
|
||||
end: _end,
|
||||
max: _maxLines
|
||||
},
|
||||
success: function(output, status, xhr) {
|
||||
var nextStart = _start+_update_step;
|
||||
if(nextStart >= _maxLines) {
|
||||
$('#stat_text').html("<?php echo $translation->get("stat_file_download_step3"); ?>");
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
|
||||
$('#stat_text').html(nextStart + " <?php echo $translation->get("of"); ?> " + _maxLines + " <?php echo $translation->get("lines_finished"); ?>");
|
||||
intervall_stat_update(nextStart, _update_step, _maxLines);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("google", $translation->get("google_analytics"), $formname, "show_google_analytics()"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('top_statistic'); ?></h1>
|
||||
|
||||
<h3><?php echo $translation->get("filter"); ?>:</h3>
|
||||
<?php
|
||||
stat_filter($GLOBALS["site"]['id'], $GLOBALS["language"]['id']);
|
||||
?>
|
||||
<div class="clearfix"></div>
|
||||
<br />
|
||||
<input type="button" id="refresh_stat" value="<?php echo $translation->get("button_refresh_stat"); ?>" onclick="refresh_stat();" />
|
||||
<div id="stat_info" style="display:none"><?php echo $translation->get("state"); ?>: <span id="stat_text"><?php echo $translation->get("stat_file_download_step1"); ?></span></div>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" action="?action=filter">
|
||||
<input type="hidden" value="" name="filter_days" id="filter_days" />
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?php
|
||||
?>
|
||||
<table cellpadding=0 cellspacing=0 border=0 class="linklist">
|
||||
<?php
|
||||
switch ($where) {
|
||||
case 'YEAR':
|
||||
$headline = $translation->get("year");
|
||||
break;
|
||||
|
||||
case 'MONTH':
|
||||
$headline = $translation->get("month");
|
||||
break;
|
||||
case 'WEEKOFYEAR':
|
||||
default:
|
||||
$headline = $translation->get("weekofyear");
|
||||
break;
|
||||
}
|
||||
|
||||
echo "<tr>";
|
||||
echo format_key($headline, "");
|
||||
echo format_key($translation->get("hits"), "");
|
||||
echo format_key($translation->get("unique_users"), "");
|
||||
echo "</tr>";
|
||||
|
||||
echo "<tr>";
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo format_seperator("");
|
||||
echo "</tr>";
|
||||
|
||||
foreach ($hits as $year => $hitData) {
|
||||
foreach ($hitData as $date => $count) {
|
||||
switch ($where) {
|
||||
case 'YEAR':
|
||||
$datestring = $year;
|
||||
break;
|
||||
|
||||
case 'MONTH':
|
||||
$monthDate = mktime(0, 0, 0, $date, 10);
|
||||
$datestring = utf8_encode(strftime("%B", $monthDate)) . " " . $year;
|
||||
break;
|
||||
case 'WEEKOFYEAR':
|
||||
default:
|
||||
$realKW = sprintf('%02d', $date);
|
||||
$timestamp_montag = strtotime("{$year}-W{$realKW}");
|
||||
$timestamp_sonntag = strtotime("{$year}-W{$realKW}-7");
|
||||
$datestring = $date . " (" . date('d.m.Y', $timestamp_montag) . " - " . date("d.m.Y", $timestamp_sonntag) . ") ";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
echo " <tr class=\"linklist_content\" data-function=\"voidFunction\" \">\n";
|
||||
|
||||
echo format_value($datestring, "input_id");
|
||||
echo format_value($count, "input_id");
|
||||
echo format_value($besucher[$year][$date], "input_id");
|
||||
|
||||
echo " </tr>\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
45
mysyde/admin/submenu.inc.php
Normal file
45
mysyde/admin/submenu.inc.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
$adminMenu = \DynCom\mysyde\common\classes\Adminmenu::get();
|
||||
|
||||
$subsites = array();
|
||||
if ($_GET["level_1"] != "") {
|
||||
$subsites = $adminMenu[$_GET["level_1"]]['subsites'];
|
||||
}
|
||||
$subsites_2 = array();
|
||||
if ($_GET["level_2"] != "") {
|
||||
$subsites_2 = $adminMenu[$_GET["level_2"]]['subsites'];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php if (count($subsites)): ?>
|
||||
<ul>
|
||||
<?php foreach ($subsites as $code => $subsite): ?>
|
||||
<li>
|
||||
<?php
|
||||
$active = '';
|
||||
if ($_GET["level_2"] != "" && $_GET["level_2"] == $code) {
|
||||
$active = 'class="active"';
|
||||
}
|
||||
?>
|
||||
<a <?php echo $active; ?> href="<?php echo get_menu_link($_GET["level_1"] . "/" . $code, $site, $language); ?>"><?php echo $subsite['name']; ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (count($subsites_2)): ?>
|
||||
<ul>
|
||||
<?php foreach ($subsites_2 as $code => $subsite): ?>
|
||||
<li>
|
||||
<?php
|
||||
$active = '';
|
||||
if ($_GET["level_3"] != "" && $_GET["level_3"] == $code) {
|
||||
$active = 'class="active"';
|
||||
}
|
||||
?>
|
||||
<a <?php echo $active; ?> href="<?php echo get_menu_link($_GET["level_1"] . "/" . $_GET["level_2"] . "/" . $code, $site, $language); ?>"><?php echo $subsite['name']; ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
410
mysyde/admin/survey_log_cardform.inc.php
Normal file
410
mysyde/admin/survey_log_cardform.inc.php
Normal file
@@ -0,0 +1,410 @@
|
||||
|
||||
<script>
|
||||
function loadPieChart(el_id, labelArray, dataArray, bgArray, nameChart){
|
||||
|
||||
console.log('elem' + el_id);
|
||||
var elemName = el_id + '_var'
|
||||
elemName = document.getElementById(el_id);
|
||||
|
||||
var myChartPie = new Chart(elemName, {
|
||||
type: 'pie',
|
||||
data: {
|
||||
labels: labelArray,
|
||||
datasets: [{
|
||||
label: nameChart,
|
||||
data: dataArray,
|
||||
backgroundColor: bgArray,
|
||||
hoverOffset: 4
|
||||
}]
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_mail_log_card";
|
||||
$header_id = $contact_header['id'];
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php
|
||||
echo $translation->get("survey_details");
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("back", $translation->get("back"), $formname, "loadCard('loadStats', true, '', true)"); ?>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if ($messages !== null) {
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php $formname = $formname.'survey_persons' ?>
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="header_id" id="header_id" type="hidden" value="<?= $header_id ?>">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_line_id" value="" />
|
||||
|
||||
|
||||
<h2><?php echo $translation->get("survey_response"); ?></h2>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
|
||||
<?
|
||||
$query = "SELECT DISTINCT sp.id, sp.name AS 'Name', sp.email FROM survey_persons as sp INNER JOIN survey_answers as sa on sp.id = sa.spid WHERE sp.header_id = '" . $header_id . "' ORDER BY sp.id DESC";
|
||||
$format = array('option', 'text', 'text', 'text', 'boolean');
|
||||
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_line_id", "show_person_mail", FALSE, "update_sortorder_contactform");
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
<div>
|
||||
<?php $formname = 'survey_persons_filter' ?>
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post" >
|
||||
<input name="header_id" id="input_id" type="hidden" value="<?= $header_id ?>">
|
||||
<input name="input_form" id="input_form" type="hidden" value="<?= $formname ?>">
|
||||
<div class="dashboard-right dashboard-100">
|
||||
<h2><?php echo $translation->get("filter"); ?></h2>
|
||||
<? input($translation->get("select_date"), "reportrange", "text", '', 200) ?>
|
||||
<div class="label"><label><?= $translation->get('select_option');?></label></div>
|
||||
<div class="input">
|
||||
<select class="bigselect" name="select_option" id="select_option">
|
||||
<option disabled selected>----</option>
|
||||
</div>
|
||||
<?php
|
||||
$queryOpt = "SELECT * FROM contactform_line WHERE header_id = '".$header_id."'";
|
||||
$resultOpt = @mysqli_query($GLOBALS['mysql_con'], $queryOpt);
|
||||
while($row = @mysqli_fetch_array($resultOpt)){
|
||||
echo '<option value="'. $row['id'].'" data-type="'. $row['typ'].'" >'.$row['name'].'</option>';
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
<div id="suboption"></div>
|
||||
<div>
|
||||
<?= button("submit", $translation->get("apply_filter"), $formname, ""); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $sql = "SELECT MONTH(created_date) as month, count(*) NUM FROM survey_answers WHERE header_id = '" . $header_id . "' GROUP BY month ";
|
||||
$label = array();
|
||||
$dataArrayPie = array();
|
||||
$bgArray = array();
|
||||
for($i = 1;$i<=12;$i++){
|
||||
$dataArrayPie[$i] = 0;
|
||||
$first = rand(0, 255);
|
||||
$second = rand(0, 255);
|
||||
$third = rand(0, 255);
|
||||
$color = 'rgb('.$first.', '.$second.', '.$third.')';
|
||||
array_push($bgArray, $color);
|
||||
}
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $sql);
|
||||
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
$dataArrayPie[$row['month']] = $row['NUM'];
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="lineChart">
|
||||
<canvas id="pieCharts"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="dashboard-100">
|
||||
<div class="log-wrapper dashboard-100">
|
||||
<div class="log-content-wrapper">
|
||||
<div class="log-title"><?php echo $translation->get('question_chart'); ?> </div>
|
||||
<div class="log-content charts">
|
||||
<?php
|
||||
$bgArray = array();
|
||||
$queryRow = '';
|
||||
$cfid = $header_id;
|
||||
$queryRow = "SELECT cl.id, cl.header_id,cl.name FROM contactform_line as cl INNER JOIN contactform_header as ch on cl.header_id = ch.id WHERE ch.is_survey = 1 AND header_id = '" . $header_id . "' ORDER BY cl.sorting ASC";
|
||||
|
||||
$label = array();
|
||||
$dataArray = array();
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $queryRow);
|
||||
if(@mysqli_num_rows($result) > 0){
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
$cfid = $row['header_id'];
|
||||
array_push($label, (strlen($row['name']) >20 ) ? substr($row['name'], 0, 30).'...' : $row['name']);
|
||||
$first = rand(0, 255);
|
||||
$second = rand(0, 255);
|
||||
$third = rand(0, 255);
|
||||
$dataArray[$row['id']] = 0;
|
||||
$color = 'rgb('.$first.', '.$second.', '.$third.')';
|
||||
array_push($bgArray, $color);
|
||||
$queryData = 'SELECT line_id, count(*) as NUMCOUNT FROM survey_answers WHERE header_id = '.$row['header_id'].' AND line_id = "'.$row['id'].'" ORDER BY option_string';
|
||||
$resultData = @mysqli_query($GLOBALS['mysql_con'], $queryData);
|
||||
//
|
||||
if(@mysqli_num_rows($resultData)){
|
||||
$rowData = @mysqli_fetch_array($resultData);
|
||||
$dataArray[$row['id']] = $rowData['NUMCOUNT'];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<canvas class="custom_form" id="ccChart" width="400" height="400"></canvas>
|
||||
<script>
|
||||
var labelArray = [
|
||||
<?php echo '"'.implode('","', $label).'"' ?>
|
||||
];
|
||||
var dataArray = [
|
||||
<?php echo '"'.implode('","', $dataArray).'"' ?>
|
||||
];
|
||||
var bgArray = [
|
||||
<?php echo '"'.implode('","', $bgArray).'"' ?>
|
||||
];
|
||||
loadPieChart("ccChart", labelArray, dataArray, bgArray, '<?= $translation->get('question_chart');?>')
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-100">
|
||||
<div class="log-wrapper dashboard-100">
|
||||
<div class="log-content-wrapper">
|
||||
<div class="log-title"><?php echo $translation->get('option_chart'); ?> </div>
|
||||
<div class="log-content charts">
|
||||
<?php
|
||||
|
||||
$queryRow = "SELECT cl.id, cl.header_id,cl.name FROM contactform_line as cl INNER JOIN contactform_header as ch on cl.header_id = ch.id WHERE ch.is_survey = 1 AND header_id = '" . $header_id . "' AND (cl.typ = 10 or cl.typ = 4) ORDER BY cl.sorting ASC";
|
||||
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $queryRow);
|
||||
|
||||
if(@mysqli_num_rows($result) > 0){
|
||||
while($row = @mysqli_fetch_array($result)){
|
||||
?>
|
||||
<div class="log-title"><?php echo $row['name']; ?> </div>
|
||||
<?
|
||||
$bgArrayIN = array();
|
||||
$queryRow = '';
|
||||
$cfid = $header_id;
|
||||
$labelIN = array();
|
||||
$dataArrayIN = array();
|
||||
|
||||
$queryOpt = "SELECT * FROM contactform_line_option WHERE line_id = '".$row['id']."' ORDER BY id ASC";
|
||||
|
||||
$resultOpt = @mysqli_query($GLOBALS['mysql_con'], $queryOpt);
|
||||
|
||||
while($rowOpt = @mysqli_fetch_array($resultOpt)){
|
||||
|
||||
|
||||
$cfid = $row['header_id'];
|
||||
array_push($labelIN, (strlen($rowOpt['option_string']) >20 ) ? substr($rowOpt['option_string'], 0, 30).'...' : $rowOpt['option_string']);
|
||||
$dataArrayIN[$rowOpt['id']] = 0;
|
||||
$first = rand(0, 255);
|
||||
$second = rand(0, 255);
|
||||
$third = rand(0, 255);
|
||||
$color = 'rgb('.$first.', '.$second.', '.$third.')';
|
||||
array_push($bgArrayIN, $color);
|
||||
$queryData = 'SELECT line_id, count(*) as NUMCOUNT FROM survey_answers WHERE header_id = '.$row['header_id'].' AND line_id = "'.$row['id'].'" AND clo_id = "'.$rowOpt['id'].'" ORDER BY line_id';
|
||||
|
||||
$resultData = @mysqli_query($GLOBALS['mysql_con'], $queryData);
|
||||
//
|
||||
if(@mysqli_num_rows($resultData) > 0){
|
||||
$rowData = @mysqli_fetch_array($resultData);
|
||||
$dataArrayIN[$rowOpt['id']] = $rowData['NUMCOUNT'];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<canvas class="custom_form" id="ccChart2<?= $row['id']?>" width="400" height="400"></canvas>
|
||||
<script>
|
||||
var labelArray = [
|
||||
<?php echo '"'.implode('","', $labelIN).'"' ?>
|
||||
];
|
||||
var dataArray = [
|
||||
<?php echo '"'.implode('","', $dataArrayIN).'"' ?>
|
||||
];
|
||||
var bgArray = [
|
||||
<?php echo '"'.implode('","', $bgArrayIN).'"' ?>
|
||||
];
|
||||
console.log('label ezut' + labelArray);
|
||||
console.log('arr ezut' + dataArray);
|
||||
console.log('bg ezut' + bgArray);
|
||||
loadPieChart("ccChart2<?= $row['id']?>", labelArray, dataArray, bgArray, '<?= $translation->get('option_chart');?>')
|
||||
</script>
|
||||
|
||||
|
||||
<? $dataArrayIN = array(); $labelIN = array(); $bgArrayIN = array();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
||||
const MONTHS = [
|
||||
'January',
|
||||
'February',
|
||||
'March',
|
||||
'April',
|
||||
'May',
|
||||
'June',
|
||||
'July',
|
||||
'August',
|
||||
'September',
|
||||
'October',
|
||||
'November',
|
||||
'December'
|
||||
];
|
||||
|
||||
function getMonths(config) {
|
||||
var cfg = config || {};
|
||||
var count = cfg.count || 12;
|
||||
var section = cfg.section;
|
||||
var values = [];
|
||||
var i, value;
|
||||
|
||||
for (i = 0; i < count; ++i) {
|
||||
value = MONTHS[Math.ceil(i) % 12];
|
||||
values.push(value.substring(0, section));
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
const ctxs = document.getElementById('pieCharts');
|
||||
var labelArray = getMonths({count: 12});
|
||||
|
||||
var dataArray = [
|
||||
<?php echo '"'.implode('","', $dataArrayPie).'"' ?>
|
||||
];
|
||||
var bgArray = [
|
||||
<?php echo '"'.implode('","', $bgArray).'"' ?>
|
||||
];
|
||||
console.log('dataArray pie' + "<?= implode('","', $dataArrayPie);?>");
|
||||
var data = {
|
||||
labels: labelArray,
|
||||
datasets: [{
|
||||
label: '<?= $translation->get('survey_monthly')?>',
|
||||
data: dataArray,
|
||||
backgroundColor: bgArray,
|
||||
fill: false,
|
||||
borderColor: 'rgb(75, 192, 192)',
|
||||
tension: 0.1
|
||||
}]
|
||||
};
|
||||
var myChartBar = new Chart(ctxs, {
|
||||
type: 'line',
|
||||
data: data,
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready( function () {
|
||||
|
||||
const picker = new easepick.create({
|
||||
element: "#reportrange",
|
||||
css: [
|
||||
"https://cdn.jsdelivr.net/npm/@easepick/bundle@1.2.0/dist/index.css"
|
||||
],
|
||||
zIndex: 10,
|
||||
lang: "de-DE",
|
||||
locale:"DE",
|
||||
readonly: false,
|
||||
autoApply: false,
|
||||
format: "MM/DD/YY",
|
||||
PresetPlugin: {
|
||||
position: "right"
|
||||
},
|
||||
plugins: [
|
||||
"RangePlugin",
|
||||
"PresetPlugin"
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
$('body').on('change', '#select_option', function(){
|
||||
var line_id = $(this).children('option:selected').val();
|
||||
var type = $(this).children('option:selected').attr('data-type');
|
||||
var header_id = $('#input_id').val();
|
||||
if(type == 4 || type == 9 || type == 10){
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url:'?action=load_suboption',
|
||||
data: {line_id:line_id,header_id:header_id},
|
||||
success:function(result){
|
||||
|
||||
$('#suboption').html(result);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('#suboption').html('');
|
||||
}
|
||||
});
|
||||
$('body').on('click', '.button_submit', function(){
|
||||
var formName = $(this).attr('data-formname');
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url:'?action=load_filtered_data',
|
||||
|
||||
data: $('form#'+formName).serialize(),
|
||||
success:function(result){
|
||||
var obj = JSON.parse(result);
|
||||
|
||||
var dataArray = [];
|
||||
|
||||
for(var i in obj)
|
||||
dataArray.push(obj[i]);
|
||||
|
||||
console.log(dataArray);
|
||||
myChartBar.destroy();
|
||||
|
||||
console.log();
|
||||
var data = {
|
||||
labels: labelArray,
|
||||
datasets: [{
|
||||
label: '<?= $translation->get('survey_monthly')?>',
|
||||
data: dataArray,
|
||||
backgroundColor: bgArray,
|
||||
fill: false,
|
||||
borderColor: 'rgb(75, 192, 192)',
|
||||
tension: 0.1
|
||||
}]
|
||||
};
|
||||
myChartBar = new Chart(ctxs, {
|
||||
type: 'line',
|
||||
data: data,
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
// Date Range End]
|
||||
</script>
|
||||
3271
mysyde/admin/text_constants.inc.php
Normal file
3271
mysyde/admin/text_constants.inc.php
Normal file
File diff suppressed because it is too large
Load Diff
200
mysyde/admin/video_uploud/video_uploud.inc.php
Normal file
200
mysyde/admin/video_uploud/video_uploud.inc.php
Normal file
@@ -0,0 +1,200 @@
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
.upload-container {
|
||||
border: 2px dashed #ccc;
|
||||
padding: 20px;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.progress-container {
|
||||
margin-top: 20px;
|
||||
padding: 10px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 5px;
|
||||
display: none;
|
||||
}
|
||||
.progress-bar {
|
||||
height: 20px;
|
||||
background-color: #012402ff;
|
||||
width: 0%;
|
||||
border-radius: 5px;
|
||||
transition: width 0.3s;
|
||||
}
|
||||
.progress-text {
|
||||
margin-top: 10px;
|
||||
}
|
||||
#drop-area {
|
||||
border: 2px dashed #ccc;
|
||||
border-radius: 5px;
|
||||
padding: 25px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
#drop-area.highlight {
|
||||
border-color: #4CAF50;
|
||||
background-color: #f0f9f0;
|
||||
}
|
||||
#content_3 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1>Video-Upload</h1>
|
||||
|
||||
<div class="upload-container">
|
||||
<div id="drop-area">
|
||||
<h2>Ziehen Sie die Datei hierher oder klicken Sie, um eine Datei auszuwählen</h2>
|
||||
<input type="file" id="fileInput" style="display: none;">
|
||||
</div>
|
||||
<p>Die Datei wird automatisch in Teile aufgeteilt und hochgeladen</p>
|
||||
</div>
|
||||
|
||||
<div class="progress-container" id="progressContainer">
|
||||
<h3>Upload-Fortschritt</h3>
|
||||
<div class="progress-bar" id="progressBar"></div>
|
||||
<div class="progress-text" id="progress">Warten auf Upload...</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Generierung einer eindeutigen ID
|
||||
function generateUUID() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
// Haupt-DOM-Elemente
|
||||
const dropArea = document.getElementById('drop-area');
|
||||
const fileInput = document.getElementById('fileInput');
|
||||
const progressContainer = document.getElementById('progressContainer');
|
||||
const progressBar = document.getElementById('progressBar');
|
||||
const progressText = document.getElementById('progress');
|
||||
|
||||
// Chunk-Größe in Bytes (25MB)
|
||||
const chunkSize = 25 * 1024 * 1024;
|
||||
|
||||
// Verhindern des Standardverhaltens des Browsers beim Ziehen
|
||||
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|
||||
dropArea.addEventListener(eventName, preventDefaults, false);
|
||||
document.body.addEventListener(eventName, preventDefaults, false);
|
||||
});
|
||||
|
||||
function preventDefaults(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
// Hervorheben des Bereichs beim Ziehen
|
||||
['dragenter', 'dragover'].forEach(eventName => {
|
||||
dropArea.addEventListener(eventName, highlight, false);
|
||||
});
|
||||
|
||||
['dragleave', 'drop'].forEach(eventName => {
|
||||
dropArea.addEventListener(eventName, unhighlight, false);
|
||||
});
|
||||
|
||||
function highlight() {
|
||||
dropArea.classList.add('highlight');
|
||||
}
|
||||
|
||||
function unhighlight() {
|
||||
dropArea.classList.remove('highlight');
|
||||
}
|
||||
|
||||
// Verarbeitung von Datei-Auswahl- und Zieh-Ereignissen
|
||||
dropArea.addEventListener('drop', handleDrop, false);
|
||||
dropArea.addEventListener('click', () => fileInput.click());
|
||||
fileInput.addEventListener('change', handleFiles);
|
||||
|
||||
function handleDrop(e) {
|
||||
const dt = e.dataTransfer;
|
||||
const files = dt.files;
|
||||
handleFiles({ target: { files } });
|
||||
}
|
||||
|
||||
function handleFiles(e) {
|
||||
const file = e.target.files[0];
|
||||
if (file) {
|
||||
uploadFile(file);
|
||||
}
|
||||
}
|
||||
|
||||
function uploadFile(file) {
|
||||
const uuid = generateUUID();
|
||||
const fileName = file.name;
|
||||
const totalChunks = Math.ceil(file.size / chunkSize);
|
||||
let uploadedChunks = 0;
|
||||
|
||||
progressContainer.style.display = 'block';
|
||||
progressText.textContent = `Vorbereitung zum Hochladen...`;
|
||||
|
||||
// Funktion zum Hochladen eines Chunks
|
||||
function uploadChunk(start) {
|
||||
const end = Math.min(start + chunkSize, file.size);
|
||||
const chunk = file.slice(start, end);
|
||||
const chunkIndex = Math.floor(start / chunkSize);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('file', chunk);
|
||||
formData.append('dzuuid', uuid);
|
||||
formData.append('dzchunkindex', chunkIndex);
|
||||
formData.append('dztotalchunkcount', totalChunks);
|
||||
formData.append('dzdestinationfile', fileName);
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', 'https://intranet.awo-hamburg.de/mysyde/admin/video_uploud/video_uploud_server.php', true);
|
||||
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
try {
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
|
||||
if (response.success) {
|
||||
uploadedChunks++;
|
||||
|
||||
// Fortschritt aktualisieren
|
||||
const progressPercent = Math.round((uploadedChunks / totalChunks) * 100);
|
||||
progressBar.style.width = progressPercent + '%';
|
||||
progressText.textContent = `Hochladen: ${progressPercent}% (Teil ${uploadedChunks}/${totalChunks})`;
|
||||
|
||||
// Wenn noch weitere Chunks hochgeladen werden müssen
|
||||
if (start + chunkSize < file.size) {
|
||||
uploadChunk(start + chunkSize);
|
||||
} else if (uploadedChunks === totalChunks) {
|
||||
// Alle Chunks hochgeladen
|
||||
progressText.textContent = `Alle Teile hochgeladen, Verarbeitung auf dem Server...`;
|
||||
|
||||
if (response.file) {
|
||||
progressText.textContent = `Datei "${response.file}" erfolgreich hochgeladen!`;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
progressText.textContent = `Fehler: ${response.message || 'Unbekannter Fehler'}`;
|
||||
}
|
||||
} catch (e) {
|
||||
progressText.textContent = `Fehler beim Parsen der Serverantwort: ${e.message}`;
|
||||
}
|
||||
} else {
|
||||
progressText.textContent = `HTTP-Fehler: ${xhr.status}`;
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onerror = function() {
|
||||
progressText.textContent = `Netzwerkfehler beim Hochladen von Teil ${chunkIndex + 1}`;
|
||||
};
|
||||
|
||||
xhr.send(formData);
|
||||
}
|
||||
|
||||
// Beginnen Sie mit dem Hochladen des ersten Chunks
|
||||
uploadChunk(0);
|
||||
}
|
||||
</script>
|
||||
113
mysyde/admin/video_uploud/video_uploud_server.php
Normal file
113
mysyde/admin/video_uploud/video_uploud_server.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
// Настройки загрузки
|
||||
$uploadDir = '../../../userdata/Videos/';
|
||||
|
||||
// Убедимся, что директория существует
|
||||
if (!is_dir($uploadDir)) {
|
||||
mkdir($uploadDir, 0755, true);
|
||||
}
|
||||
|
||||
// Получение параметров из запроса
|
||||
$chunkIndex = isset($_POST['dzchunkindex']) ? (int)$_POST['dzchunkindex'] : 0;
|
||||
$totalChunks = isset($_POST['dztotalchunkcount']) ? (int)$_POST['dztotalchunkcount'] : 1;
|
||||
$fileName = isset($_POST['dzdestinationfile']) ? $_POST['dzdestinationfile'] : '';
|
||||
$uuid = isset($_POST['dzuuid']) ? $_POST['dzuuid'] : '';
|
||||
|
||||
// Проверка входных данных
|
||||
if (empty($fileName)) {
|
||||
die(json_encode(['success' => false, 'message' => 'Имя файла не указано']));
|
||||
}
|
||||
|
||||
// Создадим подпапку для временных чанков, чтобы избежать конфликтов
|
||||
$tempDir = $uploadDir . 'temp_' . $uuid . '/';
|
||||
if (!is_dir($tempDir)) {
|
||||
mkdir($tempDir, 0755, true);
|
||||
}
|
||||
|
||||
// Путь к временному файлу
|
||||
$tempFilePath = $tempDir . $chunkIndex;
|
||||
|
||||
// Проверка загружаемого файла
|
||||
if (!isset($_FILES['file']) || $_FILES['file']['error'] != UPLOAD_ERR_OK) {
|
||||
die(json_encode([
|
||||
'success' => false,
|
||||
'message' => 'Ошибка загрузки файла: ' .
|
||||
(isset($_FILES['file']) ? $_FILES['file']['error'] : 'Файл не был отправлен')
|
||||
]));
|
||||
}
|
||||
|
||||
// Сохраняем загруженный чанк
|
||||
if (move_uploaded_file($_FILES['file']['tmp_name'], $tempFilePath)) {
|
||||
// Проверяем, все ли чанки загружены
|
||||
$allChunksUploaded = true;
|
||||
|
||||
for ($i = 0; $i < $totalChunks; $i++) {
|
||||
if (!file_exists($tempDir . $i)) {
|
||||
$allChunksUploaded = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Если загружены все части, объединяем их
|
||||
if ($allChunksUploaded) {
|
||||
$finalFilePath = $uploadDir . $fileName;
|
||||
$finalFile = fopen($finalFilePath, 'wb');
|
||||
|
||||
if (!$finalFile) {
|
||||
die(json_encode([
|
||||
'success' => false,
|
||||
'message' => 'Не удалось создать итоговый файл'
|
||||
]));
|
||||
}
|
||||
|
||||
// Объединяем все куски в один
|
||||
for ($i = 0; $i < $totalChunks; $i++) {
|
||||
$chunkPath = $tempDir . $i;
|
||||
$chunkFile = fopen($chunkPath, 'rb');
|
||||
|
||||
if (!$chunkFile) {
|
||||
fclose($finalFile);
|
||||
die(json_encode([
|
||||
'success' => false,
|
||||
'message' => 'Не удалось открыть чанк ' . $i
|
||||
]));
|
||||
}
|
||||
|
||||
// Потоковое копирование для экономии памяти
|
||||
while (!feof($chunkFile)) {
|
||||
fwrite($finalFile, fread($chunkFile, 8192)); // Чтение и запись блоками по 8KB
|
||||
}
|
||||
|
||||
fclose($chunkFile);
|
||||
unlink($chunkPath); // Удаляем временный кусок
|
||||
}
|
||||
|
||||
fclose($finalFile);
|
||||
|
||||
// Удаляем временную директорию
|
||||
rmdir($tempDir);
|
||||
|
||||
// Возвращаем успешный результат
|
||||
echo json_encode([
|
||||
'success' => true,
|
||||
'message' => 'Файл успешно загружен',
|
||||
'file' => $fileName,
|
||||
'path' => $finalFilePath
|
||||
]);
|
||||
} else {
|
||||
// Не все чанки загружены, сообщаем о частичной загрузке
|
||||
echo json_encode([
|
||||
'success' => true,
|
||||
'message' => 'Часть ' . ($chunkIndex + 1) . ' из ' . $totalChunks . ' успешно загружена'
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => 'Ошибка при сохранении файла'
|
||||
]);
|
||||
}
|
||||
?>
|
||||
35
mysyde/common/abstracts/TemplateInserterBase.php
Normal file
35
mysyde/common/abstracts/TemplateInserterBase.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace DynCom\mysyde\common\abstracts;
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Bauer
|
||||
* Date: 18.06.2015
|
||||
* Time: 10:09
|
||||
*/
|
||||
|
||||
abstract class TemplateInserterBase {
|
||||
|
||||
protected $template;
|
||||
protected $fieldData;
|
||||
protected $allowTags = false;
|
||||
|
||||
/**
|
||||
* TemplateInserterBase constructor.
|
||||
* @param GenericTemplateInterface $template
|
||||
* @param array $fieldData
|
||||
* @param bool $allowTags
|
||||
*/
|
||||
public function __construct(GenericTemplateInterface $template, array $fieldData, $allowTags = false) {
|
||||
$this->template = $template;
|
||||
$this->fieldData = (($this->_validateFieldData($fieldData)) ? $fieldData : array());
|
||||
$this->allowTags = (bool)$allowTags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $fieldData
|
||||
* @return mixed
|
||||
*/
|
||||
abstract protected function _validateFieldData(array $fieldData);
|
||||
|
||||
abstract public function insertData();
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user