예제 #1
0
 public static function Backend($name, $pagename, $tablename, $action, $id)
 {
     if ($action == 'delete' && dyn::get('user')->hasPerm('metainfos[delete]')) {
         self::delete($tablename, $id);
         echo message::success(lang::get('entry_deleted'));
         $action = '';
     }
     if (dyn::get('user')->hasPerm('metainfos[edit]')) {
         if (ajax::is()) {
             self::BackendAjax();
         }
         if ($action == 'add' || $action == 'edit' || $action == 'delete') {
             self::BackendFormular($name, $tablename, $action, $id);
         }
     }
     if ($action == '') {
         self::BackendShow($name, $pagename);
     }
 }
예제 #2
0
<?php

if (type::get('checkversion', 'int', 0) == 1) {
    $cacheFile = cache::getFileName(0, 'dynaoVersion');
    cache::exist($cacheFile, 0);
    echo message::success(lang::get('connection_again'), true);
}
if (ajax::is()) {
    if (type::super('text')) {
        $mail = mail('*****@*****.**', 'Neue Idee', type::super('text'), 'From: ' . dyn::get('user')->get('firstname') . ' ' . dyn::get('user')->get('name') . '<' . dyn::get('user')->get('email') . '>');
        if ($mail) {
            ajax::addReturn(message::success(lang::get('idea_send')));
        } else {
            ajax::addReturn(message::danger(lang::get('idea_error')));
        }
    } else {
        ajax::addReturn(message::danger(lang::get('idea_empty')));
    }
}
$versionCheck = dyn::checkDynVersion();
if ($versionCheck === lang::get('version_fail_connect')) {
    $message = lang::get('version_fail_connect');
    $message .= '<br /><a href="' . url::backend('dashboard', ['subpage' => 'overview', 'checkversion' => 1]) . '">' . lang::get('try_again') . '</a>';
    echo message::danger($message, true);
} elseif ($versionCheck) {
    echo message::danger($versionCheck, true);
}
$stats = [];
$sql = sql::factory();
$numPages = $sql->num('SELECT * FROM ' . sql::table('structure'));
$sql = sql::factory();
예제 #3
0
    $subpage = type::super('subpage', 'string');
    $action = type::super('action', 'string');
    $structure_id = type::super('structure_id', 'int', 0);
    $id = type::super('id', 'int', 0);
    // Falls was an der Page geändert worden ist
    if ($page == 'structure' && $subpage == 'pages' && in_array($action, ['add', 'edit', 'seo']) && !$structure_id) {
        extension::add('FORM_AFTER_SAVE', function ($form) {
            seo_rewrite::generatePathlist();
            return $form;
        });
    }
    // Wenn SEO Button geklickt worden ist
    if ($page == 'structure' && $subpage == 'pages' && $action == 'seo') {
        seoPage::generateForm($id);
        layout::addJsCode("\n\t\tvar default_url = \$('#seo-costum-url').text();\n\t\t\n\t\t\$('#seo-costum-url-text').keyup(function() {\n\t\t\tvar val = \$(this).val();\n\t\t\t\n\t\t\tif(val == '')\n\t\t\t\tval = default_url;\n\t\t\t\t\t\t\t\n\t\t\t\$('#seo-costum-url').text(val);\n\t\t});\n\t\t\n\t\tvar default_title = \$('#seo-default-title').text();\n\t\t\$('#seo-title-text').keyup(function() {\n\t\t\tvar val = \$(this).val();\n\t\t\t\n\t\t\tif(val == '')\n\t\t\t\tval = default_title;\n\t\t\t\n\t\t\t\$('#seo-title').text(val);\n\t\t});\n\t\t");
    }
    // Wenn Sortiert worden ist
    if ($page == 'structure' && $subpage == 'pages' && (ajax::is() || $action == 'delete' && !$structure_id)) {
        extension::add('BACKEND_OUTPUT', function ($output) {
            seo_rewrite::generatePathlist();
            return $output;
        });
    }
    // Inhaltsseite der page
    if ($page == 'structure' && $subpage == 'pages' && ($structure_id || $action == 'edit' && $id)) {
        $id = $structure_id ? $structure_id : $id;
        extension::add('BACKEND_OUTPUT', function ($output) use($id) {
            return seoPage::generateButton($output, $id);
        });
    }
}
예제 #4
0
        $form = pageAreaHtml::formBlock(new pageArea(0));
        echo pageAreaHtml::formOut($form);
    } else {
        echo pageAreaHtml::selectBlock($structure_id, $sql->num() + 1);
    }
    ?>
                    
    			</div>
            </div>
        </div>
    </div>

<?php 
    //Wenn action
} else {
    if (ajax::is() && dyn::get('user')->hasPerm('page[edit]')) {
        $post = type::super('array');
        $sort = json_decode($post, true);
        pageMisc::sortStructure($sort, 0);
        ajax::addReturn(message::success(lang::get('save_sorting'), true));
    }
    if (in_array($action, ['edit', 'add']) && dyn::get('user')->hasPerm('page[edit]')) {
        $form = form::factory('structure', 'id=' . $id, 'index.php');
        $field = $form->addTextField('name', $form->get('name'));
        $field->fieldName(lang::get('name'));
        $field->autofocus();
        $template = template::factory(dyn::get('template'));
        $field = $form->addElement('template', $template->getTemplates('template', $form->get('template')));
        $field->fieldName(lang::get('template'));
        $field = $form->addRadioField('online', $form->get('online'));
        $field->fieldName(lang::get('status'));