-
get('general_website_title');?>
+
get('general_website_title'); ?>
@@ -18,86 +18,85 @@ tinymce();
-
get('general_construction_mode');?>
+
get('general_construction_mode'); ?>
'.$lang->get('general_end_construction_mode').'';
+ echo '' . $lang->get('general_end_construction_mode') . '';
} else
{
- echo ''.$lang->get('general_start_construction_mode').'';
+ echo '' . $lang->get('general_start_construction_mode') . '';
}
- ?> get('general_edit_message');?>
+ ?> get('general_edit_message'); ?>
-
-
get('general_version');?>
-
get('general_version_current');?>:
-
-
-
- versionNum > $MCONF['version_num'])
- {
- echo $lang->get('general_new_version').' ' . $version_remote->version . ' '.$lang->get('general_update').'';
- }
- else
- {
- echo $lang->get('general_version_current_new');
- }
- ?>
-
-
-
get('general_database');?>
+
get('general_version'); ?>
+
get('general_version_current'); ?>:
+
+
- get('general_create_backup');?>
-
- get('general_go_phpmyadmin');?>
+ versionNum > $MCONF['version_num'])
+ {
+ echo $lang->get('general_new_version') . ' ' . $version_remote->version . ' ' . $lang->get('general_update') . '';
+ } else
+ {
+ echo $lang->get('general_version_current_new');
+ }
+ ?>
+
+
get('general_database'); ?>
+
+ get('general_create_backup'); ?>
+
+ get('general_go_phpmyadmin'); ?>
+
+ getApps() as $app => $appconf)
+ {
+
+ require $appUri . $app . '/config.php';
+ if (isset($_CONF['general_conf']) && $_CONF['general_conf'] != '' && file_exists($appUri . $app . '/' . $_CONF['general_conf']))
{
- if ($mod != "." && $mod != ".." && is_dir($moduluri.$mod))
- {
- require $moduluri.$mod.'/config.php';
- if(isset($_CONF['general_conf']) && $_CONF['general_conf']!='' && file_exists($moduluri.$mod.'/'.$_CONF['general_conf']))
- {
- echo '
';
- require $moduluri.$mod.'/'.$_CONF['general_conf'];
- }
- }
+ echo '
';
+ require $appUri . $app . '/' . $_CONF['general_conf'];
}
- closedir($handle);
+
}
?>
-
+
- ';
require_once '../inc/footer.php';
?>
\ No newline at end of file
diff --git a/admin/index.php b/admin/index.php
index 1771c75..84eb28e 100755
--- a/admin/index.php
+++ b/admin/index.php
@@ -13,47 +13,48 @@ if (file_exists('install.php'))
if (hasPerm('view_dashboard'))
{
- echo '
' . substr(php_uname(), 0, strpos(php_uname(), ' ')) . ''.$lang->get('os').'
';
- echo '
' . $_SERVER['SERVER_SOFTWARE'] . ''.$lang->get('server_software').'
';
- echo '
' . str_replace(substr(PHP_VERSION, strpos(PHP_VERSION, '-')), '', PHP_VERSION) . ''.$lang->get('php_version').'
';
- echo '
' . str_replace(substr($db->version(), strpos($db->version(), '-')), '', $db->version()) . ''.$lang->get('mysql_version').'
';
- echo '
' . date('H:i:s') . ''.$lang->get('system_time').'
';
+ echo '
' . substr(php_uname(), 0, strpos(php_uname(), ' ')) . '' . $lang->get('os') . '
';
+ echo '
' . $_SERVER['SERVER_SOFTWARE'] . '' . $lang->get('server_software') . '
';
+ echo '
' . str_replace(substr(PHP_VERSION, strpos(PHP_VERSION, '-')), '', PHP_VERSION) . '' . $lang->get('php_version') . '
';
+ echo '
' . str_replace(substr($db->version(), strpos($db->version(), '-')), '', $db->version()) . '' . $lang->get('mysql_version') . '
';
+ echo '
' . date('H:i:s') . '' . $lang->get('system_time') . '
';
?>
- get('general_config');?>
-
get('logfiles');?>
+ get('general_config'); ?>
+
get('logfiles'); ?>
';
//Find Dashboard files
-$moduluri = '../apps/';
-if ($handle = opendir($moduluri))
+
+$apps = new apps();
+$appUri = '../apps/';
+foreach ($apps->getApps() as $app => $appconf)
{
- while (false !== ($mod = readdir($handle)))
+
+ require $appUri . $app . '/config.php';
+ if (isset($_CONF['dashboard']) && $_CONF['dashboard'] != '')
{
- if ($mod != "." && $mod != ".." && is_dir($moduluri . $mod))
+ if (file_exists($appUri . $app . '/' . $_CONF['dashboard']))
{
- require $moduluri . $mod . '/config.php';
- if(isset($_CONF['dashboard']) && $_CONF['dashboard'] != '')
- {
- if (file_exists($moduluri . $mod . '/' . $_CONF['dashboard']))
- {
- echo '
';
- require $moduluri . $mod . '/' . $_CONF['dashboard'];
- echo '
';
- }
- }
- $_CONF['dashboard'] = '';
+ echo '
';
+ require $appUri . $app . '/' . $_CONF['dashboard'];
+ echo '
';
}
}
- closedir($handle);
+ $_CONF['dashboard'] = '';
+
}
echo '
';
require_once '../inc/footer.php';
diff --git a/admin/install-dev.php b/admin/install-dev.php
index 260a22b..e1c221b 100644
--- a/admin/install-dev.php
+++ b/admin/install-dev.php
@@ -11,38 +11,39 @@ require_once '../inc/libs/lang.class.php';
require_once '../inc/libs/db-mysql.php';
require_once '../inc/libs/YAML/autoload.php';
use Symfony\Component\Yaml\Yaml;
+
$lang = new lang();
$lang->setLangFolder('lang/');
?>
Installation
-
+
Installation
query('SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+ if ($db->query('SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
-CREATE TABLE `'.$_POST['db_prefix'].'meta_meta` (
+CREATE TABLE `' . $_POST['db_prefix'] . 'meta_meta` (
`name` text NOT NULL,
`content` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE `'.$_POST['db_prefix'].'sidebar_sidebar` (
+CREATE TABLE `' . $_POST['db_prefix'] . 'sidebar_sidebar` (
`active` tinyint(1) NOT NULL,
`content` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-INSERT INTO `'.$_POST['db_prefix'].'sidebar_sidebar` (`active`, `content`) VALUES
+INSERT INTO `' . $_POST['db_prefix'] . 'sidebar_sidebar` (`active`, `content`) VALUES
(0, \'\');
-CREATE TABLE `'.$_POST['db_prefix'].'simplePages_pages` (
+CREATE TABLE `' . $_POST['db_prefix'] . 'simplePages_pages` (
`id` int(11) NOT NULL,
`title` text CHARACTER SET utf8 NOT NULL,
`alias` longtext CHARACTER SET utf8 NOT NULL,
@@ -125,7 +125,7 @@ CREATE TABLE `'.$_POST['db_prefix'].'simplePages_pages` (
`created` int(11) NOT NULL,
`lastedit` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE `'.$_POST['db_prefix'].'simplePages_pages_confirm` (
+CREATE TABLE `' . $_POST['db_prefix'] . 'simplePages_pages_confirm` (
`id` int(11) NOT NULL,
`page_id` int(11) NOT NULL,
`title` text CHARACTER SET utf8 NOT NULL,
@@ -138,13 +138,13 @@ CREATE TABLE `'.$_POST['db_prefix'].'simplePages_pages_confirm` (
`created` int(11) NOT NULL,
`lastedit` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE `'.$_POST['db_prefix'].'simplePages_permissions` (
+CREATE TABLE `' . $_POST['db_prefix'] . 'simplePages_permissions` (
`id` int(11) NOT NULL,
`page` int(11) NOT NULL,
`user` int(11) NOT NULL,
`lastedit` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-CREATE TABLE `'.$_POST['db_prefix'].'system_admins` (
+CREATE TABLE `' . $_POST['db_prefix'] . 'system_admins` (
`id` int(11) NOT NULL,
`username` text NOT NULL,
`pass` text NOT NULL,
@@ -152,7 +152,7 @@ CREATE TABLE `'.$_POST['db_prefix'].'system_admins` (
`mail` text NOT NULL,
`secret` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE `'.$_POST['db_prefix'].'system_loggedin` (
+CREATE TABLE `' . $_POST['db_prefix'] . 'system_loggedin` (
`id` int(11) NOT NULL,
`user` int(11) NOT NULL,
`user_agent` longtext NOT NULL,
@@ -160,42 +160,42 @@ CREATE TABLE `'.$_POST['db_prefix'].'system_loggedin` (
`time` int(11) NOT NULL,
`token` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE TABLE `'.$_POST['db_prefix'].'system_roles` (
+CREATE TABLE `' . $_POST['db_prefix'] . 'system_roles` (
`id` int(11) NOT NULL,
`name` text COLLATE utf8_unicode_ci NOT NULL,
`permissions` longtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages`
+ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_pages`
ADD PRIMARY KEY (`id`);
-ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages_confirm`
+ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_pages_confirm`
ADD PRIMARY KEY (`id`);
-ALTER TABLE `'.$_POST['db_prefix'].'simplePages_permissions`
+ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_permissions`
ADD PRIMARY KEY (`id`);
-ALTER TABLE `'.$_POST['db_prefix'].'system_admins`
+ALTER TABLE `' . $_POST['db_prefix'] . 'system_admins`
ADD PRIMARY KEY (`id`);
-ALTER TABLE `'.$_POST['db_prefix'].'system_loggedin`
+ALTER TABLE `' . $_POST['db_prefix'] . 'system_loggedin`
ADD PRIMARY KEY (`id`);
-ALTER TABLE `'.$_POST['db_prefix'].'system_roles`
+ALTER TABLE `' . $_POST['db_prefix'] . 'system_roles`
ADD PRIMARY KEY (`id`);
-ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages`
+ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_pages`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
-ALTER TABLE `'.$_POST['db_prefix'].'simplePages_pages_confirm`
+ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_pages_confirm`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
-ALTER TABLE `'.$_POST['db_prefix'].'simplePages_permissions`
+ALTER TABLE `' . $_POST['db_prefix'] . 'simplePages_permissions`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
-ALTER TABLE `'.$_POST['db_prefix'].'system_admins`
+ALTER TABLE `' . $_POST['db_prefix'] . 'system_admins`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
-ALTER TABLE `'.$_POST['db_prefix'].'system_loggedin`
+ALTER TABLE `' . $_POST['db_prefix'] . 'system_loggedin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
-ALTER TABLE `'.$_POST['db_prefix'].'system_roles`
+ALTER TABLE `' . $_POST['db_prefix'] . 'system_roles`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
-'))
+')
+ )
{
echo msg('success', 'Created Tables successfully.');
- }
- else
+ } else
{
echo msg('fail', 'Failed Creating Tables');
exit;
@@ -203,11 +203,10 @@ ALTER TABLE `'.$_POST['db_prefix'].'system_roles`
//Admin group
$db->setCol('system_roles');
$db->data['name'] = 'Admins';
- if($db->insert())
+ if ($db->insert())
{
echo msg('success', 'Successfully created admin group.');
- }
- else
+ } else
{
echo msg('fail', 'Error creating admin group.');
exit;
@@ -218,94 +217,82 @@ ALTER TABLE `'.$_POST['db_prefix'].'system_roles`
$db->data['pass'] = password_hash($_POST['admin_pw1'], PASSWORD_DEFAULT);
$db->data['lvl'] = 1;
$db->data['mail'] = $_POST['admin_mail'];
- if($db->insert())
+ if ($db->insert())
{
echo msg('success', 'Successfully created admin user.');
- }
- else
+ } else
{
echo msg('fail', 'Error creating admin user.');
exit;
}
//Page title
- if(file_put_contents('../inc/System/page_title.txt', $_POST['general_page_title']))
+ if (file_put_contents('../inc/System/page_title.txt', $_POST['general_page_title']))
{
echo msg('succes', 'Page Title was successfully set.
');
- }
- else
+ } else
{
echo msg('fail', 'Error setting page title.');
exit;
}
//htacces
- $htacces = 'ErrorDocument 404 '.$_POST['general_home_url'].'index.php
+ $htacces = 'ErrorDocument 404 ' . $_POST['general_home_url'] . 'index.php
SetEnv gp_rewrite U9sL2S2
RewriteEngine On
-RewriteBase "'.$_POST['general_home_url'].'"
+RewriteBase "' . $_POST['general_home_url'] . '"
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
-RewriteRule /?(.*) "'.$_POST['general_home_url'].'index.php?$1" [qsa,L]
+RewriteRule /?(.*) "' . $_POST['general_home_url'] . 'index.php?$1" [qsa,L]
-RewriteRule . "'.$_POST['general_home_url'].'index.php" [L]
+RewriteRule . "' . $_POST['general_home_url'] . 'index.php" [L]
';
- if(file_put_contents('../.htaccess', $htacces))
+ if (file_put_contents('../.htaccess', $htacces))
{
echo msg('succes', '.htaccess was successfully set.
');
- }
- else
+ } else
{
echo msg('fail', 'Error setting up .htaccess.
');
exit;
}
//Apps
- $modulurl = '../apps/';
- if ($handle = opendir($modulurl))
+ $apps = new apps();
+ $appUri = '../apps/';
+ foreach ($apps->getApps() as $app => $appconf)
{
- while (false !== ($mod = readdir($handle)))
+ require $appUri . $app . '/config.php';
+ if (isset($_CONF['install']) && $_CONF['install'] != '' && file_exists($appUri . $app . '/' . $_CONF['install']))
{
- if ($mod != "." && $mod != ".." && is_dir($modulurl.$mod))
- {
- require $modulurl.$mod.'/config.php';
- if(isset($_CONF['install']) && $_CONF['install']!='' && file_exists($modulurl.$mod.'/'.$_CONF['install']))
- {
- require $modulurl.$mod.'/'.$_CONF['install'];
- }
- }
+ require $appUri . $app . '/' . $_CONF['install'];
}
- closedir($handle);
}
//Write Config
$configfile = Yaml::dump($CONFIG);
- if(file_put_contents('../inc/config.yml', $configfile))
+ if (file_put_contents('../inc/config.yml', $configfile))
{
echo msg('succes', 'Configfile was successfully created.');
- }
- else
+ } else
{
echo msg('fail', 'Error creating configfile.');
exit;
}
- echo msg('info', 'Installation successfully completed.
Login');
- }
- else
+ echo msg('info', 'Installation successfully completed.
Login');
+ } else
{
echo msg('info', 'Please fill in all fields!');
}
-}
-else
+} else
{
?>