Esempio n. 1
0
 public static function checkSession()
 {
     $session = type::session('community-login', 'int', 0);
     if (!$session) {
         return false;
     }
     dyn::add('community_user', new community_user($session));
     return true;
 }
Esempio n. 2
0
 public static function loadAllConfig()
 {
     $addons = [];
     foreach (self::getAll() as $name) {
         $addons[$name] = self::getConfig($name);
     }
     dyn::add('addons', $addons);
     return true;
 }
Esempio n. 3
0
 public function getTemplate()
 {
     ob_start();
     $content = self::generateArticle($this->get('id'));
     $content = extension::get('FRONTEND_OUTPUT', $content);
     dyn::add('content', $content);
     include dir::template(dyn::get('template'), $this->get('template'));
     $content = ob_get_contents();
     ob_end_clean();
     return $content;
 }
Esempio n. 4
0
 public function getTemplate()
 {
     ob_start();
     if (!pageCache::exist($this->get('id'))) {
         pageCache::generateArticle($this->get('id'));
     }
     $content = pageCache::read($this->get('id'));
     $content = pageArea::getEval($content);
     $content = extension::get('FRONTEND_OUTPUT', $content);
     dyn::add('content', $content);
     include dir::template(dyn::get('template'), $this->get('template'));
     $content = ob_get_contents();
     ob_end_clean();
     return $content;
 }
Esempio n. 5
0
 public static function generateArticle($id, $block = false)
 {
     $return = [];
     $type = $block ? 'block' : 'article';
     $backend = dyn::get('backend');
     dyn::add('backend', false);
     $page = new page($id, true, $block);
     $blocks = $page->getBlocks();
     foreach ($blocks as $block) {
         $block->setEval(false);
         $return[] = $block->getContent();
     }
     if (self::exist($id, false, $type)) {
         self::deleteFile($id, $type);
     }
     self::write(implode(PHP_EOL, $return), $id, $type);
     dyn::add('backend', $backend);
 }
Esempio n. 6
0
$handle = opendir(dir::backend('lib' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR));
while ($file = readdir($handle)) {
    if (in_array($file, ['.', '..'])) {
        continue;
    }
    $field->add($file, $file);
}
if ($form->isSubmit()) {
    $url = 'http://' . str_replace('http://', '', $form->get('hp_url'));
    $endSlash = substr($url, -1, 1);
    if ($endSlash != '/') {
        $url .= '/';
    }
    dyn::add('hp_name', $form->get('hp_name'), true);
    dyn::add('hp_url', $url, true);
    dyn::add('lang', $form->get('lang'), true);
    dyn::save();
    if ($error) {
        echo message::danger('error');
    } else {
        $form->addParam('page', 'database');
    }
}
echo $form->show();
?>
                
                </div>        
        </div>    
    </div>	
    <div class="col-lg-4">    
        <div class="panel panel-default">        
Esempio n. 7
0
autoload::addDir(dir::classes('utils'));
new dyn();
if (dyn::get('setup') == true) {
    header('Location: install/');
    exit;
}
if (isset($DYN['backend'])) {
    dyn::add('backend', $DYN['backend']);
} else {
    dyn::add('backend', true);
}
unset($DYN);
include dir::functions('html_stuff.php');
include dir::functions('url_stuff.php');
lang::setDefault();
lang::setLang(dyn::get('lang'));
$DB = dyn::get('DB');
sql::connect($DB['host'], $DB['user'], $DB['password'], $DB['database']);
ob_start();
date_default_timezone_set(dyn::get('timezone', 'Europe/Berlin'));
new userLogin();
dyn::add('user', new user(userLogin::getUser()));
cache::setCache(dyn::get('cache'));
addonConfig::loadAllConfig();
addonConfig::includeAllLangFiles();
addonConfig::includeAllLibs();
if (dyn::get('backend')) {
    include dir::backend('backend.php');
} else {
    include dir::backend('frontend.php');
}
Esempio n. 8
0
$field = $form->addTextField('name', '');
$field->addValidator('notEmpty', lang::get('validator_not_empty'));
$field->fieldName(lang::get('name'));
$field = $form->addTextField('email', '');
$field->fieldName(lang::get('email'));
$field->addValidator('notEmpty', lang::get('validator_not_empty'));
$field->addValidator('email', lang::get('user_wrong_email'));
$field = $form->addTextField('password', '');
$field->addValidator('notEmpty', lang::get('validator_not_empty'));
$field->fieldName(lang::get('password'));
if ($form->isSubmit()) {
    $sql = sql::connect($form->get('db_host'), $form->get('db_user'), $form->get('db_password'), $form->get('db_database'));
    if (is_null($sql)) {
        $DB = ['host' => $form->get('db_host'), 'user' => $form->get('db_user'), 'password' => $form->get('db_password'), 'database' => $form->get('db_database'), 'prefix' => $form->get('db_prefix')];
        dyn::add('DB', $DB, true);
        dyn::add('setup', false, true);
        dyn::save();
        install::newInstall();
        install::insertDemoContent();
        $template = new template(dyn::get('template'));
        if ($template->install() !== true) {
            $form->setSuccessMessage(null);
            $error = true;
        }
        $form->addParam('page', 'finish');
    } else {
        echo message::danger($sql);
    }
}
echo $form->show();
?>
Esempio n. 9
0
$successMsg = type::get('success_msg', 'string');
$errorMsg = type::get('error_msg', 'string');
if (!is_null($errorMsg)) {
    echo message::danger($errorMsg);
} elseif (!is_null($successMsg)) {
    echo message::success($successMsg);
}
if (userLogin::isLogged()) {
    if ($file = backend::getNaviInclude()) {
        include $file;
    }
}
$content = ob_get_contents();
ob_end_clean();
$content = extension::get('BACKEND_OUTPUT', $content);
dyn::add('content', $content);
if (ajax::is()) {
    $deleteAction = type::get('deleteAction', 'bool', false);
    if ($deleteAction) {
        $title = type::get('title', 'string');
        $message = type::get('message', 'string');
        getDeleteModal($title, $message);
    }
    echo ajax::getReturn();
    die;
}
if (userLogin::isLogged()) {
    include dir::backend('layout/index.php');
} else {
    include dir::backend('layout/login.php');
}
Esempio n. 10
0
    if ($endSlash != '/') {
        $url .= '/';
    }
    if (dyn::get('template') != $form->get('template')) {
        $template = new template($form->get('template'));
        if ($template->install() !== true) {
            $form->setSuccessMessage(null);
        } else {
            dyn::add('template', $form->get('template'), true);
        }
    }
    dyn::add('hp_name', $form->get('hp_name'), true);
    dyn::add('hp_url', $url, true);
    dyn::add('lang', $form->get('lang'), true);
    dyn::add('start_page', $form->get('start_page_id'), true);
    dyn::add('error_page', $form->get('error_page_id'), true);
    dyn::save();
}
$field = $form->addTextField('hp_name', dyn::get('hp_name'));
$field->fieldName(lang::get('settings_name_of_site'));
$field = $form->addTextField('hp_url', dyn::get('hp_url'));
$field->fieldName(lang::get('settings_url_of_site'));
$field = $form->addSelectField('lang', dyn::get('lang'));
$field->fieldName(lang::get('settings_backend_lang'));
$handle = opendir(dir::backend('lib' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR));
while ($file = readdir($handle)) {
    if (in_array($file, ['.', '..'])) {
        continue;
    }
    $field->add($file, $file);
}
Esempio n. 11
0
<?php

ob_end_clean();
foreach (addonConfig::includeAllConfig() as $file) {
    if (file_exists($file)) {
        require_once $file;
    }
}
$page = type::super('page_id', 'int', dyn::get('start_page'));
$page = extension::get('SET_PAGE_ID', $page);
dyn::add('page_id', $page);
if (page::isValid($page)) {
    $page = new page($page);
} else {
    header('HTTP/1.0 404 Not Found');
    $page = new page(dyn::get('error_page'));
}
echo $page->getTemplate();
Esempio n. 12
0
 public static function insertDemoContent()
 {
     $sql = sql::factory();
     $input = file_get_contents(self::getModulCode('1_input.txt'));
     $output = file_get_contents(self::getModulCode('1_output.txt'));
     $sql->setTable('module');
     $sql->addPost('name', 'Überschrift');
     $sql->addPost('sort', 1);
     $sql->addPost('input', $input);
     $sql->addPost('output', $output);
     $sql->save();
     $input = file_get_contents(self::getModulCode('2_input.txt'));
     $output = file_get_contents(self::getModulCode('2_output.txt'));
     $sql->addPost('name', 'Editor');
     $sql->addPost('sort', 2);
     $sql->addPost('input', $input);
     $sql->addPost('output', $output);
     $sql->save();
     $sql = sql::factory();
     $sql->setTable('structure');
     $sql->addPost('name', 'Home');
     $sql->addPost('template', 'template.php');
     $sql->addPost('sort', 1);
     $sql->addPost('online', 1);
     $sql->save();
     $sql->addPost('name', '404 Error');
     $sql->addPost('sort', 2);
     $sql->addPost('online', 0);
     $sql->save();
     dyn::add('start_page', 1, true);
     dyn::add('error_page', 2, true);
     dyn::save();
 }