@@ -5,30 +5,30 @@ |
||
5 | 5 | |
6 | 6 | class CreateCategoriesTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('categories', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->integer('id', true); |
|
18 | - $table->string('category', 45)->default(''); |
|
19 | - $table->integer('rank')->unsigned()->default(0); |
|
20 | - }); |
|
21 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('categories', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->integer('id', true); |
|
18 | + $table->string('category', 45)->default(''); |
|
19 | + $table->integer('rank')->unsigned()->default(0); |
|
20 | + }); |
|
21 | + } |
|
22 | 22 | |
23 | 23 | |
24 | - /** |
|
25 | - * Reverse the migrations. |
|
26 | - * |
|
27 | - * @return void |
|
28 | - */ |
|
29 | - public function down() |
|
30 | - { |
|
31 | - Schema::drop('categories'); |
|
32 | - } |
|
24 | + /** |
|
25 | + * Reverse the migrations. |
|
26 | + * |
|
27 | + * @return void |
|
28 | + */ |
|
29 | + public function down() |
|
30 | + { |
|
31 | + Schema::drop('categories'); |
|
32 | + } |
|
33 | 33 | |
34 | 34 | } |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Illuminate\Database\Migrations\Migration; |
4 | 4 | use Illuminate\Database\Schema\Blueprint; |
5 | 5 | |
6 | -class CreateCategoriesTable extends Migration { |
|
6 | +class CreateCategoriesTable extends Migration{ |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * Run the migrations. |
@@ -3,7 +3,8 @@ discard block |
||
3 | 3 | use Illuminate\Database\Migrations\Migration; |
4 | 4 | use Illuminate\Database\Schema\Blueprint; |
5 | 5 | |
6 | -class CreateCategoriesTable extends Migration { |
|
6 | +class CreateCategoriesTable extends Migration |
|
7 | +{ |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * Run the migrations. |
@@ -12,8 +13,7 @@ discard block |
||
12 | 13 | */ |
13 | 14 | public function up() |
14 | 15 | { |
15 | - Schema::create('categories', function(Blueprint $table) |
|
16 | - { |
|
16 | + Schema::create('categories', function(Blueprint $table){ |
|
17 | 17 | $table->integer('id', true); |
18 | 18 | $table->string('category', 45)->default(''); |
19 | 19 | $table->integer('rank')->unsigned()->default(0); |
@@ -5,29 +5,29 @@ |
||
5 | 5 | |
6 | 6 | class CreateWebgroupNamesTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('webgroup_names', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->integer('id', true); |
|
18 | - $table->string('name', 245)->default('')->unique('name'); |
|
19 | - }); |
|
20 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('webgroup_names', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->integer('id', true); |
|
18 | + $table->string('name', 245)->default('')->unique('name'); |
|
19 | + }); |
|
20 | + } |
|
21 | 21 | |
22 | 22 | |
23 | - /** |
|
24 | - * Reverse the migrations. |
|
25 | - * |
|
26 | - * @return void |
|
27 | - */ |
|
28 | - public function down() |
|
29 | - { |
|
30 | - Schema::drop('webgroup_names'); |
|
31 | - } |
|
23 | + /** |
|
24 | + * Reverse the migrations. |
|
25 | + * |
|
26 | + * @return void |
|
27 | + */ |
|
28 | + public function down() |
|
29 | + { |
|
30 | + Schema::drop('webgroup_names'); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | } |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Illuminate\Database\Migrations\Migration; |
4 | 4 | use Illuminate\Database\Schema\Blueprint; |
5 | 5 | |
6 | -class CreateWebgroupNamesTable extends Migration { |
|
6 | +class CreateWebgroupNamesTable extends Migration{ |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * Run the migrations. |
@@ -3,7 +3,8 @@ discard block |
||
3 | 3 | use Illuminate\Database\Migrations\Migration; |
4 | 4 | use Illuminate\Database\Schema\Blueprint; |
5 | 5 | |
6 | -class CreateWebgroupNamesTable extends Migration { |
|
6 | +class CreateWebgroupNamesTable extends Migration |
|
7 | +{ |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * Run the migrations. |
@@ -12,8 +13,7 @@ discard block |
||
12 | 13 | */ |
13 | 14 | public function up() |
14 | 15 | { |
15 | - Schema::create('webgroup_names', function(Blueprint $table) |
|
16 | - { |
|
16 | + Schema::create('webgroup_names', function(Blueprint $table){ |
|
17 | 17 | $table->integer('id', true); |
18 | 18 | $table->string('name', 245)->default('')->unique('name'); |
19 | 19 | }); |
@@ -5,30 +5,30 @@ |
||
5 | 5 | |
6 | 6 | class CreateWebgroupAccessTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('webgroup_access', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->integer('id', true); |
|
18 | - $table->integer('webgroup')->default(0); |
|
19 | - $table->integer('documentgroup')->default(0); |
|
20 | - }); |
|
21 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('webgroup_access', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->integer('id', true); |
|
18 | + $table->integer('webgroup')->default(0); |
|
19 | + $table->integer('documentgroup')->default(0); |
|
20 | + }); |
|
21 | + } |
|
22 | 22 | |
23 | 23 | |
24 | - /** |
|
25 | - * Reverse the migrations. |
|
26 | - * |
|
27 | - * @return void |
|
28 | - */ |
|
29 | - public function down() |
|
30 | - { |
|
31 | - Schema::drop('webgroup_access'); |
|
32 | - } |
|
24 | + /** |
|
25 | + * Reverse the migrations. |
|
26 | + * |
|
27 | + * @return void |
|
28 | + */ |
|
29 | + public function down() |
|
30 | + { |
|
31 | + Schema::drop('webgroup_access'); |
|
32 | + } |
|
33 | 33 | |
34 | 34 | } |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Illuminate\Database\Migrations\Migration; |
4 | 4 | use Illuminate\Database\Schema\Blueprint; |
5 | 5 | |
6 | -class CreateWebgroupAccessTable extends Migration { |
|
6 | +class CreateWebgroupAccessTable extends Migration{ |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * Run the migrations. |
@@ -3,7 +3,8 @@ discard block |
||
3 | 3 | use Illuminate\Database\Migrations\Migration; |
4 | 4 | use Illuminate\Database\Schema\Blueprint; |
5 | 5 | |
6 | -class CreateWebgroupAccessTable extends Migration { |
|
6 | +class CreateWebgroupAccessTable extends Migration |
|
7 | +{ |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * Run the migrations. |
@@ -12,8 +13,7 @@ discard block |
||
12 | 13 | */ |
13 | 14 | public function up() |
14 | 15 | { |
15 | - Schema::create('webgroup_access', function(Blueprint $table) |
|
16 | - { |
|
16 | + Schema::create('webgroup_access', function(Blueprint $table){ |
|
17 | 17 | $table->integer('id', true); |
18 | 18 | $table->integer('webgroup')->default(0); |
19 | 19 | $table->integer('documentgroup')->default(0); |
@@ -5,39 +5,39 @@ |
||
5 | 5 | |
6 | 6 | class CreateSiteTemplatesTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('site_templates', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->integer('id', true); |
|
18 | - $table->string('templatename', 100)->default(''); |
|
19 | - $table->string('description')->default('Template'); |
|
20 | - $table->integer('editor_type')->default(0)->comment('0-plain text,1-rich text,2-code editor'); |
|
21 | - $table->integer('category')->default(0)->comment('category id'); |
|
22 | - $table->string('icon')->default('')->comment('url to icon file'); |
|
23 | - $table->integer('template_type')->default(0)->comment('0-page,1-content'); |
|
24 | - $table->text('content', 16777215)->nullable(); |
|
25 | - $table->boolean('locked')->default(0); |
|
26 | - $table->boolean('selectable')->default(1); |
|
27 | - $table->integer('createdon')->default(0); |
|
28 | - $table->integer('editedon')->default(0); |
|
29 | - }); |
|
30 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('site_templates', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->integer('id', true); |
|
18 | + $table->string('templatename', 100)->default(''); |
|
19 | + $table->string('description')->default('Template'); |
|
20 | + $table->integer('editor_type')->default(0)->comment('0-plain text,1-rich text,2-code editor'); |
|
21 | + $table->integer('category')->default(0)->comment('category id'); |
|
22 | + $table->string('icon')->default('')->comment('url to icon file'); |
|
23 | + $table->integer('template_type')->default(0)->comment('0-page,1-content'); |
|
24 | + $table->text('content', 16777215)->nullable(); |
|
25 | + $table->boolean('locked')->default(0); |
|
26 | + $table->boolean('selectable')->default(1); |
|
27 | + $table->integer('createdon')->default(0); |
|
28 | + $table->integer('editedon')->default(0); |
|
29 | + }); |
|
30 | + } |
|
31 | 31 | |
32 | 32 | |
33 | - /** |
|
34 | - * Reverse the migrations. |
|
35 | - * |
|
36 | - * @return void |
|
37 | - */ |
|
38 | - public function down() |
|
39 | - { |
|
40 | - Schema::drop('site_templates'); |
|
41 | - } |
|
33 | + /** |
|
34 | + * Reverse the migrations. |
|
35 | + * |
|
36 | + * @return void |
|
37 | + */ |
|
38 | + public function down() |
|
39 | + { |
|
40 | + Schema::drop('site_templates'); |
|
41 | + } |
|
42 | 42 | |
43 | 43 | } |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Illuminate\Database\Migrations\Migration; |
4 | 4 | use Illuminate\Database\Schema\Blueprint; |
5 | 5 | |
6 | -class CreateSiteTemplatesTable extends Migration { |
|
6 | +class CreateSiteTemplatesTable extends Migration{ |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * Run the migrations. |
@@ -3,7 +3,8 @@ discard block |
||
3 | 3 | use Illuminate\Database\Migrations\Migration; |
4 | 4 | use Illuminate\Database\Schema\Blueprint; |
5 | 5 | |
6 | -class CreateSiteTemplatesTable extends Migration { |
|
6 | +class CreateSiteTemplatesTable extends Migration |
|
7 | +{ |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * Run the migrations. |
@@ -12,8 +13,7 @@ discard block |
||
12 | 13 | */ |
13 | 14 | public function up() |
14 | 15 | { |
15 | - Schema::create('site_templates', function(Blueprint $table) |
|
16 | - { |
|
16 | + Schema::create('site_templates', function(Blueprint $table){ |
|
17 | 17 | $table->integer('id', true); |
18 | 18 | $table->string('templatename', 100)->default(''); |
19 | 19 | $table->string('description')->default('Template'); |
@@ -5,33 +5,33 @@ |
||
5 | 5 | |
6 | 6 | class CreateActiveUsersTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('active_users', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->string('sid', 32)->default('')->primary(); |
|
18 | - $table->integer('internalKey')->default(0); |
|
19 | - $table->string('username', 50)->default(''); |
|
20 | - $table->integer('lasthit')->default(0); |
|
21 | - $table->string('action', 10)->default(''); |
|
22 | - $table->integer('id')->nullable(); |
|
23 | - }); |
|
24 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('active_users', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->string('sid', 32)->default('')->primary(); |
|
18 | + $table->integer('internalKey')->default(0); |
|
19 | + $table->string('username', 50)->default(''); |
|
20 | + $table->integer('lasthit')->default(0); |
|
21 | + $table->string('action', 10)->default(''); |
|
22 | + $table->integer('id')->nullable(); |
|
23 | + }); |
|
24 | + } |
|
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * Reverse the migrations. |
|
29 | - * |
|
30 | - * @return void |
|
31 | - */ |
|
32 | - public function down() |
|
33 | - { |
|
34 | - Schema::drop('active_users'); |
|
35 | - } |
|
27 | + /** |
|
28 | + * Reverse the migrations. |
|
29 | + * |
|
30 | + * @return void |
|
31 | + */ |
|
32 | + public function down() |
|
33 | + { |
|
34 | + Schema::drop('active_users'); |
|
35 | + } |
|
36 | 36 | |
37 | 37 | } |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Illuminate\Database\Migrations\Migration; |
4 | 4 | use Illuminate\Database\Schema\Blueprint; |
5 | 5 | |
6 | -class CreateActiveUsersTable extends Migration { |
|
6 | +class CreateActiveUsersTable extends Migration{ |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * Run the migrations. |
@@ -3,7 +3,8 @@ discard block |
||
3 | 3 | use Illuminate\Database\Migrations\Migration; |
4 | 4 | use Illuminate\Database\Schema\Blueprint; |
5 | 5 | |
6 | -class CreateActiveUsersTable extends Migration { |
|
6 | +class CreateActiveUsersTable extends Migration |
|
7 | +{ |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * Run the migrations. |
@@ -12,8 +13,7 @@ discard block |
||
12 | 13 | */ |
13 | 14 | public function up() |
14 | 15 | { |
15 | - Schema::create('active_users', function(Blueprint $table) |
|
16 | - { |
|
16 | + Schema::create('active_users', function(Blueprint $table){ |
|
17 | 17 | $table->string('sid', 32)->default('')->primary(); |
18 | 18 | $table->integer('internalKey')->default(0); |
19 | 19 | $table->string('username', 50)->default(''); |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | //:: EVO Installer Setup file |
3 | 3 | //::::::::::::::::::::::::::::::::::::::::: |
4 | -if (is_file($base_path . 'assets/cache/siteManager.php')) { |
|
5 | - include_once($base_path . 'assets/cache/siteManager.php'); |
|
4 | +if (is_file($base_path.'assets/cache/siteManager.php')) { |
|
5 | + include_once($base_path.'assets/cache/siteManager.php'); |
|
6 | 6 | } |
7 | 7 | if (!defined('MGR_DIR')) { |
8 | 8 | define('MGR_DIR', 'manager'); |
9 | 9 | } |
10 | 10 | |
11 | -require_once dirname(__DIR__, 3) . '/' . MGR_DIR . '/includes/version.inc.php'; |
|
11 | +require_once dirname(__DIR__, 3).'/'.MGR_DIR.'/includes/version.inc.php'; |
|
12 | 12 | |
13 | -$chunkPath = $base_path . 'install/assets/chunks'; |
|
14 | -$snippetPath = $base_path . 'install/assets/snippets'; |
|
15 | -$pluginPath = $base_path . 'install/assets/plugins'; |
|
16 | -$modulePath = $base_path . 'install/assets/modules'; |
|
17 | -$templatePath = $base_path . 'install/assets/templates'; |
|
18 | -$tvPath = $base_path . 'install/assets/tvs'; |
|
13 | +$chunkPath = $base_path.'install/assets/chunks'; |
|
14 | +$snippetPath = $base_path.'install/assets/snippets'; |
|
15 | +$pluginPath = $base_path.'install/assets/plugins'; |
|
16 | +$modulePath = $base_path.'install/assets/modules'; |
|
17 | +$templatePath = $base_path.'install/assets/templates'; |
|
18 | +$tvPath = $base_path.'install/assets/tvs'; |
|
19 | 19 | |
20 | 20 | // setup Template template files - array : name, description, type - 0:file or 1:content, parameters, category |
21 | 21 | $mt = &$moduleTemplates; |
@@ -28,8 +28,7 @@ discard block |
||
28 | 28 | $params = parse_docblock($templatePath, $tplfile); |
29 | 29 | if (is_array($params) && (count($params) > 0)) { |
30 | 30 | $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}"; |
31 | - $mt[] = array |
|
32 | - ( |
|
31 | + $mt[] = array( |
|
33 | 32 | $params['name'], |
34 | 33 | $description, |
35 | 34 | // Don't think this is gonna be used ... but adding it just in case 'type' |
@@ -69,8 +68,7 @@ discard block |
||
69 | 68 | "$templatePath/{$params['filename']}", |
70 | 69 | /* not currently used */ |
71 | 70 | $params['template_assignments'] !== "*" ? |
72 | - $params['template_assignments'] : |
|
73 | - implode(',', array_map(function($value){return isset($value[0]) && is_scalar($value[0]);},$mt)), |
|
71 | + $params['template_assignments'] : implode(',', array_map(function($value){return isset($value[0]) && is_scalar($value[0]); },$mt)), |
|
74 | 72 | /* comma-separated list of template names */ |
75 | 73 | $params['modx_category'], |
76 | 74 | $params['lock_tv'], |
@@ -150,7 +148,7 @@ discard block |
||
150 | 148 | $params['modx_category'], |
151 | 149 | $params['legacy_names'], |
152 | 150 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false, |
153 | - (int)$params['disabled'] |
|
151 | + (int) $params['disabled'] |
|
154 | 152 | ); |
155 | 153 | } |
156 | 154 | } |
@@ -175,12 +173,12 @@ discard block |
||
175 | 173 | "$modulePath/{$params['filename']}", |
176 | 174 | $params['properties'], |
177 | 175 | $params['guid'], |
178 | - (int)$params['shareparams'], |
|
176 | + (int) $params['shareparams'], |
|
179 | 177 | $params['modx_category'], |
180 | 178 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false |
181 | 179 | ); |
182 | 180 | } |
183 | - if ((int)$params['shareparams'] || !empty($params['dependencies'])) { |
|
181 | + if ((int) $params['shareparams'] || !empty($params['dependencies'])) { |
|
184 | 182 | $dependencies = explode(',', $params['dependencies']); |
185 | 183 | foreach ($dependencies as $dependency) { |
186 | 184 | $dependency = explode(':', $dependency); |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // Determine upgradeability |
3 | 3 | $upgradeable = 0; |
4 | -if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { // Include the file so we can test its validity |
|
5 | - include_once $base_path . MGR_DIR . '/includes/config.inc.php'; |
|
4 | +if (is_file($base_path.MGR_DIR.'/includes/config.inc.php')) { // Include the file so we can test its validity |
|
5 | + include_once $base_path.MGR_DIR.'/includes/config.inc.php'; |
|
6 | 6 | // We need to have all connection settings - tho prefix may be empty so we have to ignore it |
7 | 7 | if (isset($dbase)) { |
8 | 8 | $host = explode(':', $database_server, 2); |
9 | - if (!$conn = @mysqli_connect($host[0], $database_user, $database_password,'', isset($host[1]) ? $host[1] : null)) |
|
9 | + if (!$conn = @mysqli_connect($host[0], $database_user, $database_password, '', isset($host[1]) ? $host[1] : null)) |
|
10 | 10 | $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
11 | 11 | elseif (!@mysqli_select_db($conn, trim($dbase, '`'))) |
12 | 12 | $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | $ph['moduleName'] = $moduleName; |
21 | -$ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
|
22 | -$ph['displayUpg'] = ($upgradeable==0) ? 'display:none;' : ''; |
|
21 | +$ph['displayNew'] = ($upgradeable != 0) ? 'display:none;' : ''; |
|
22 | +$ph['displayUpg'] = ($upgradeable == 0) ? 'display:none;' : ''; |
|
23 | 23 | $ph['displayAdvUpg'] = $ph['displayUpg']; |
24 | -$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
25 | -$ph['checkedUpg'] = ($_POST['installmode']==1 || $upgradeable==1) ? 'checked' : ''; |
|
26 | -$ph['checkedAdvUpg'] = ($_POST['installmode']==2 || $upgradeable==2) ? 'checked' : ''; |
|
24 | +$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
25 | +$ph['checkedUpg'] = ($_POST['installmode'] == 1 || $upgradeable == 1) ? 'checked' : ''; |
|
26 | +$ph['checkedAdvUpg'] = ($_POST['installmode'] == 2 || $upgradeable == 2) ? 'checked' : ''; |
|
27 | 27 | $ph['install_language'] = $install_language; |
28 | -$ph['disabledUpg'] = ($upgradeable!=1) ? 'disabled' : ''; |
|
29 | -$ph['disabledAdvUpg'] = ($upgradeable==0) ? 'disabled' : ''; |
|
28 | +$ph['disabledUpg'] = ($upgradeable != 1) ? 'disabled' : ''; |
|
29 | +$ph['disabledAdvUpg'] = ($upgradeable == 0) ? 'disabled' : ''; |
|
30 | 30 | |
31 | -$tpl = file_get_contents(dirname(__DIR__) . '/template/actions/mode.tpl'); |
|
31 | +$tpl = file_get_contents(dirname(__DIR__).'/template/actions/mode.tpl'); |
|
32 | 32 | $content = parse($tpl, $ph); |
33 | -echo parse($content, $_lang,'[%','%]'); |
|
33 | +echo parse($content, $_lang, '[%', '%]'); |
@@ -1,21 +1,23 @@ |
||
1 | 1 | <?php |
2 | 2 | // Determine upgradeability |
3 | 3 | $upgradeable = 0; |
4 | -if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { // Include the file so we can test its validity |
|
4 | +if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { |
|
5 | +// Include the file so we can test its validity |
|
5 | 6 | include_once $base_path . MGR_DIR . '/includes/config.inc.php'; |
6 | 7 | // We need to have all connection settings - tho prefix may be empty so we have to ignore it |
7 | 8 | if (isset($dbase)) { |
8 | 9 | $host = explode(':', $database_server, 2); |
9 | - if (!$conn = @mysqli_connect($host[0], $database_user, $database_password,'', isset($host[1]) ? $host[1] : null)) |
|
10 | - $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
11 | - elseif (!@mysqli_select_db($conn, trim($dbase, '`'))) |
|
12 | - $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
13 | - else |
|
14 | - $upgradeable = 1; |
|
10 | + if (!$conn = @mysqli_connect($host[0], $database_user, $database_password,'', isset($host[1]) ? $host[1] : null)) { |
|
11 | + $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
12 | + } elseif (!@mysqli_select_db($conn, trim($dbase, '`'))) { |
|
13 | + $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
14 | + } else { |
|
15 | + $upgradeable = 1; |
|
16 | + } |
|
17 | + } else { |
|
18 | + $upgradeable = 2; |
|
19 | + } |
|
15 | 20 | } |
16 | - else |
|
17 | - $upgradeable = 2; |
|
18 | -} |
|
19 | 21 | |
20 | 22 | $ph['moduleName'] = $moduleName; |
21 | 23 | $ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
@@ -1,28 +1,28 @@ discard block |
||
1 | 1 | <?php |
2 | -$installMode = isset($_POST['installmode']) ? (int)$_POST['installmode'] : 0; |
|
2 | +$installMode = isset($_POST['installmode']) ? (int) $_POST['installmode'] : 0; |
|
3 | 3 | |
4 | 4 | // Determine upgradeability |
5 | 5 | $upgradeable = 0; |
6 | 6 | if ($installMode === 0) { |
7 | 7 | $database_name = ''; |
8 | 8 | $database_server = 'localhost'; |
9 | - $table_prefix = base_convert(mt_rand(10, 20), 10, 36) . |
|
10 | - substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz'), mt_rand(0, 33), 3) . |
|
9 | + $table_prefix = base_convert(mt_rand(10, 20), 10, 36). |
|
10 | + substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz'), mt_rand(0, 33), 3). |
|
11 | 11 | '_'; |
12 | 12 | } else { |
13 | 13 | $database_name = ''; |
14 | - if (! is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { |
|
14 | + if (!is_file($base_path.MGR_DIR.'/includes/config.inc.php')) { |
|
15 | 15 | $upgradeable = 0; |
16 | 16 | } else { |
17 | 17 | // Include the file so we can test its validity |
18 | - include $base_path . MGR_DIR . '/includes/config.inc.php'; |
|
18 | + include $base_path.MGR_DIR.'/includes/config.inc.php'; |
|
19 | 19 | // We need to have all connection settings - but prefix may be empty so we have to ignore it |
20 | 20 | if ($dbase) { |
21 | 21 | $database_name = trim($dbase, '`'); |
22 | 22 | $host = explode(':', $database_server, 2); |
23 | - if (!$conn = mysqli_connect($host[0], $database_user, $database_password,'', isset($host[1]) ? $host[1] : null)) { |
|
23 | + if (!$conn = mysqli_connect($host[0], $database_user, $database_password, '', isset($host[1]) ? $host[1] : null)) { |
|
24 | 24 | $upgradeable = (isset($_POST['installmode']) && $_POST['installmode'] === 'new') ? 0 : 2; |
25 | - } elseif (! mysqli_select_db($conn, trim($dbase, '`'))) { |
|
25 | + } elseif (!mysqli_select_db($conn, trim($dbase, '`'))) { |
|
26 | 26 | $upgradeable = (isset($_POST['installmode']) && $_POST['installmode'] === 'new') ? 0 : 2; |
27 | 27 | } else { |
28 | 28 | $upgradeable = 1; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | // check the database collation if not specified in the configuration |
37 | -if ($upgradeable && (! isset($database_connection_charset) || empty($database_connection_charset))) { |
|
37 | +if ($upgradeable && (!isset($database_connection_charset) || empty($database_connection_charset))) { |
|
38 | 38 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
39 | 39 | $rs = mysqli_query($conn, "show session variables like 'collation_server'"); |
40 | 40 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $ph['databaseloginpassword'] = isset($_SESSION['databaseloginpassword']) ? $_SESSION['databaseloginpassword'] : ""; |
79 | 79 | $ph['MGR_DIR'] = MGR_DIR; |
80 | 80 | |
81 | -$content = file_get_contents(dirname(__DIR__) . '/template/actions/connection.tpl'); |
|
81 | +$content = file_get_contents(dirname(__DIR__).'/template/actions/connection.tpl'); |
|
82 | 82 | $content = parse($content, $_lang, '[%', '%]'); |
83 | 83 | $content = parse($content, $ph); |
84 | 84 |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | if (function_exists('mysqli_connect')) { |
8 | 8 | $h = explode(':', $host, 2); |
9 | - $conn = mysqli_connect($h[0], $uid, $pwd,'', isset($h[1]) ? $h[1] : null); |
|
9 | + $conn = mysqli_connect($h[0], $uid, $pwd, '', isset($h[1]) ? $h[1] : null); |
|
10 | 10 | if (!$conn) { |
11 | 11 | exit('can not connect'); |
12 | 12 | } |