Skip to content

Commit

Permalink
Frontend editor block highlight\nModule config overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyJ4ck committed May 21, 2014
1 parent 790dd03 commit eb96a81
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 97 deletions.
4 changes: 2 additions & 2 deletions app.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

$application = new Application();

$root = loader::get_public() . loader::DIR_MODULES . '*/commands';
$root = __DIR__ . '/src/Modules/*/Commands';

$finder = new Finder();
$finder->files()->in($root)->name('*.php')->depth('== 0');
Expand All @@ -30,7 +30,7 @@
/** @var \SplFileInfo $file */
foreach ($finder as $file) {
// ... do something
preg_match('@(?<mod>\w+)[\\\/]commands[\\\/](?<cmd>\w+)\.php$@', $file->getPathname(), $matches);
preg_match('@(?<mod>\w+)[\\\/]Commands[\\\/](?<cmd>\w+)\.php$@', $file->getPathname(), $matches);
$commands []= 'SatCMS\\Modules\\' . ucfirst($matches['mod'])
. '\\Commands\\' . ucfirst($matches['cmd']); // . 'Command';
}
Expand Down
26 changes: 17 additions & 9 deletions public/modules/core/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function __construct($params = array()) {

self::time_check('core-boot');

// fix loop with get_instance
// bogus: fix loop with get_instance
if (!self::$_instance) self::$_instance = $this;

$initilize_after_load = ($params === true);
Expand All @@ -162,18 +162,24 @@ public function __construct($params = array()) {
$this->init_config(parse_ini_file($cfg_file, true));
}

// multiconfig
if ($this->cfg('multidomain_config', false) && ($host = @$_SERVER['HTTP_HOST'])) {
// multiconfig config/domain.engine.cfg

$host = @$_SERVER['HTTP_HOST'];
$host = strpos($host, 'www.') === 0 ? substr($host, 4) : $host;

if ($this->cfg('multidomain_config', false) && $host) {

$host = str_replace(':', '.', $host); // localhost:8002

$host_confg = loader::get_docs() . ((strpos($host, 'www.') === 0) ? substr($host, 4) : $host) . '.engine.cfg';
$host_config = loader::get_docs() . $host . '.engine.cfg';

if (fs::file_exists($host_confg)) {
$this->init_config(parse_ini_file($host_confg, true), abs_config::INIT_APPEND);
if (fs::file_exists($host_config)) {
$this->init_config(parse_ini_file($host_config, true), abs_config::INIT_APPEND);
}
}



setlocale(LC_ALL, ($locale = $this->cfg('locale', 'ru_RU.UTF8')));

if (loader::is_windows()) {
Expand All @@ -192,7 +198,7 @@ public function __construct($params = array()) {

$duagent = $this->cfg('debugger_agent', 'iamdebugger');

// compare only lside of agent, cause firephp or something adds its stuff to end
// compare only lside of agent, because firephp or something add its stuff to end
if (isset($_SERVER['HTTP_USER_AGENT']) && substr($_SERVER['HTTP_USER_AGENT'], 0, strlen($duagent)) === $duagent
|| !empty($params['debug'])
) {
Expand Down Expand Up @@ -643,7 +649,8 @@ public function init0() {
}
}

// site config %domain%
// site init %domain%
// config/%domain%/init.php
$site_config = array();
$site_config_path = $this->cfg('site_config');
if (!empty($site_config_path)) {
Expand All @@ -652,7 +659,8 @@ public function init0() {
$site_config_path = ((strpos($host, 'www.') === 0) ? substr($host, 4) : $host);
}

$mod_config_file = loader::get_docs() . $site_config_path . '/config.php';
$mod_config_file = loader::get_docs() . $site_config_path . '/init.php';

if ($site_config_path && file_exists($mod_config_file)) {
$site_config = include($mod_config_file);
}
Expand Down
8 changes: 0 additions & 8 deletions public/templates/bs/assets/css/lada-omg.ru/app.css

This file was deleted.

9 changes: 9 additions & 0 deletions public/templates/bs/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,15 @@ Editable
bottom:-10px;
}

/*
editor
*/

body[data-editable] .editable-wysiwyg,
body[data-editable] .editable-inline {
border:1px dotted rgba(207, 64, 64, 0.5);
}

/**
* paddings
*/
Expand Down
4 changes: 4 additions & 0 deletions public/templates/bs/assets/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
}

undebugSatBlocks();

$('body').attr('data-editable', null);
}

/**
Expand All @@ -113,6 +115,8 @@

editorBinded = true;

$('body').attr('data-editable', 'yes');

tinymce.init({
selector: ".editable-inline",
inline: true,
Expand Down
78 changes: 0 additions & 78 deletions src/Modules/Core/Commands/DoCommand.php

This file was deleted.

0 comments on commit eb96a81

Please sign in to comment.