Skip to content

Commit

Permalink
adopted code for client-app dir name changed from 'admin' to 'client'
Browse files Browse the repository at this point in the history
  • Loading branch information
perminov committed Feb 14, 2022
1 parent 2fd9c2d commit c2dc6f5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
6 changes: 3 additions & 3 deletions application/controllers/admin/SectionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class Admin_SectionsController extends Indi_Controller_Admin_Exportable {

/**
* Contents of admin/classic/app.js for checking js-controllers files presence
* Contents of client/classic/app.js for checking js-controllers files presence
*
* @var string
*/
Expand All @@ -17,7 +17,7 @@ public function jsAction() {
// 'often' - in '/public', 'project' - in '/www', but beware that js-controller files
// created for system sections should be moved from /system/js/admin/app/controller
// to Indi Engine system app source code into app/controller folder, and then should be
// compiled by 'sencha app build --production' command, so that admin/classic/app.js bundle to be refreshed
// compiled by 'sencha app build --production' command, so that client/classic/app.js bundle to be refreshed
$repoDirA = ['s' => 'system', 'o' => 'public', 'p' => 'www'];

// If current section has a type, that is (for some reason) not in the list of known types
Expand Down Expand Up @@ -225,7 +225,7 @@ public function adjustGridData(&$data) {
} else {

// If system app js is not yet set up - do it
if (!self::$systemAppJs) self::$systemAppJs = file_get_contents(DOC . STD . '/admin/classic/app.js');
if (!self::$systemAppJs) self::$systemAppJs = file_get_contents(DOC . STD . '/client/classic/app.js');

// If js-controller file exists
if (preg_match('~Ext\.cmd\.derive\(\'Indi\.controller\.' . $item['alias'] . '\',([^,]+),~', self::$systemAppJs, $m)) {
Expand Down
11 changes: 11 additions & 0 deletions js/admin/app/controller/{controller}.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Ext.define('Indi.controller.{controller}', {
extend: '{extends}',
actionsConfig: {
index: {

},
form: {

}
}
});
8 changes: 4 additions & 4 deletions library/Indi/Controller/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2190,8 +2190,8 @@ public function auth() {
'logo' => ini('general')->logo
]);

// Else if '/admin' folder exists and contains Indi standalone client app
} else if (file_exists($client = DOC . STD . '/admin/index.html') && !isset(Indi::get()->classic)) {
// Else if '/client' folder exists and contains Indi standalone client app
} else if (file_exists($client = DOC . STD . '/client/index.html') && !isset(Indi::get()->classic)) {

// Flush client app's bootstrap file
iexit(readfile($client));
Expand Down Expand Up @@ -2369,8 +2369,8 @@ public function postDispatch($return = false) {
// If request was made via Indi Engine client app - flush info right now
if (APP) jflush(true, $info);

// Else if '/admin' folder exists and contains Indi standalone client app
else if (file_exists($client = DOC . STD . '/admin/index.html') && !isset(Indi::get()->classic))
// Else if '/client' folder exists and contains Indi standalone client app
else if (file_exists($client = DOC . STD . '/client/index.html') && !isset(Indi::get()->classic))

// Flush client app's bootstrap file
iexit(readfile($client));
Expand Down
2 changes: 1 addition & 1 deletion library/Indi/Controller/Auxiliary.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function appjsAction($exit = true) {

// Check whether `lang` uri-param is given
$dirs = Indi::rexm('~^[a-zA-Z_]{2,5}$~', $lang = str_replace('-', '_', uri()->lang))
? '/../admin/classic/resources/locale/' . $lang
? '/../client/classic/resources/locale/' . $lang
: '/js/admin/app/proxy,/js/admin/app/data,/js/admin/app/lib,/js/admin/app/controller';

// Flush
Expand Down

0 comments on commit c2dc6f5

Please sign in to comment.