示例#1
0
 public static function save()
 {
     if (!self::$isChange) {
         return true;
     }
     $newEntrys = array_merge(self::$params, self::$newEntrys);
     return file_put_contents(dir::backend('lib' . DIRECTORY_SEPARATOR . 'config.json'), json_encode($newEntrys, JSON_PRETTY_PRINT));
 }
示例#2
0
                    <h3 class="panel-title"><?php 
echo lang::get('general');
?>
</h3>
                </div>
                <div class="panel-body">                
                    <?php 
$form = form_install::factory('', '', 'index.php');
$form->addParam('page', $page);
$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);
}
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);
示例#3
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');
}
示例#4
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');
}
示例#5
0
        echo markdown::parse(file_get_contents($file));
    } else {
        echo lang::get('addon_no_readme');
    }
    ?>
                </div>
			</div>
		</div>
	</div>
<?php 
} else {
    $table = table::factory();
    $table->addCollsLayout('20,*,215');
    $table->addRow()->addCell('')->addCell(lang::get('name'))->addCell(lang::get('actions'));
    $table->addSection('tbody');
    $addons = scandir(dir::backend('addons' . DIRECTORY_SEPARATOR));
    if (count($addons)) {
        foreach ($addons as $dir) {
            if (in_array($dir, ['.', '..', '.htaccess'])) {
                continue;
            }
            $curAddon = new addon($dir);
            $install_url = url::backend('addons', ['subpage' => 'overview', 'addon' => $dir, 'action' => 'install']);
            $active_url = url::backend('addons', ['subpage' => 'overview', 'addon' => $dir, 'action' => 'active']);
            $delete_url = url::backend('addons', ['subpage' => 'overview', 'addon' => $dir, 'action' => 'delete']);
            $help_url = url::backend('addons', ['subpage' => 'overview', 'addon' => $dir, 'action' => 'help']);
            if ($curAddon->isInstall()) {
                $install = '<a href="' . $install_url . '" class="btn btn-sm dyn-online">' . lang::get('addon_installed') . '</a>';
            } else {
                $install = '<a href="' . $install_url . '" class="btn btn-sm dyn-offline">' . lang::get('addon_not_installed') . '</a>';
            }
示例#6
0
 /**
  * Gibt alle Sprachen als ARRAY aus, wobei immer KURZ:lang als Array generiert wird
  *
  */
 public static function ListLang()
 {
     $lang = [];
     $handle = opendir(dir::backend('lib' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR));
     while ($file = readdir($handle)) {
         if (in_array($file, ['.', '..'])) {
             continue;
         }
         $array = json_decode(file_get_contents(dir::backend('lib' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR) . '/' . $file . '/about.json'), true);
         $lang[] = ['short' => $array['short'], 'readable' => $array['readable']];
     }
     return $lang;
 }