This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostsController extends BaseController{ | |
public function render() | |
{ | |
$this->data['posts'] = $this->getPosts(); | |
} | |
public function getPosts() | |
{ | |
$result = SiteContent:: | |
where('parent',641) | |
->withTVs(['post_image','post_anytext']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assets | |
/assets/.thumbs/* | |
!/assets/.thumbs/index.html | |
!/assets/.thumbs/.htaccess | |
/assets/backup/* | |
!/assets/backup/index.html | |
!/assets/backup/.htaccess | |
/assets/cache/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* replace system settings | |
* $modx->getConfig('site_name'); | |
*/ | |
return [ | |
'site_name' => 'dev', | |
'ControllerNamespace' => 'EvolutionCMS\\Main\\Controllers\\', | |
'which_editor' => 'TinyMCE5', | |
'filemanager_path' => env('MODX_BASE_PATH'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace EvolutionCMS\Main\Controllers; | |
use Illuminate\Support\Facades\Cache; | |
class BaseController{ | |
public $data = []; | |
public function __construct() | |
{ | |
$this->evo = EvolutionCMS(); | |
ksort($_GET); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prepare($data, $modx, $_DocLister, $_extDocLister){ | |
return $data; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[!CommerceGetDiscounts? | |
&id=`[*id*]` | |
&action=`item` | |
&itemTpl=`@CODE: [+originalPrice+] <div class="disc item_disc">Скидка "[+name+]" [+discount_summ+] руб</div>` | |
!] | |
[!CommerceGetDiscounts? | |
&id=`[*id*]` | |
&action=`groups` | |
&itemTpl=`@CODE: [+originalPrice+] <div class="disc grp_disc">Скидка "[+name+]" [+discount+]%</div>` | |
!] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use App\Models; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use serhatozles\compressio\CompressorIO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function(){ | |
jQuery('#contacts_form').on('submit',function(){ | |
form_id = $(this); | |
jQuery.ajax({ | |
type: 'POST', | |
url: '/ajax/contacts', | |
data: new FormData($(this)[0]), | |
dataType: 'json', | |
cache: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($uid && $files && isset($files['photo_file']) && $files['photo_file']['error'] === 0) { | |
$dir = 'assets/images/' . $uid . '/'; | |
$filename = $FormLister->fs->takeFileName($files['photo_file']['name']); | |
$ext = $FormLister->fs->takeFileExt($files['photo_file']['name']); | |
$filename = $modx->stripAlias($filename).'.'.$ext; | |
$filename = $FormLister->fs->getInexistantFilename($dir.$filename,true); | |
if ($FormLister->fs->makeDir($dir) && move_uploaded_file($files['photo_file']['tmp_name'],$filename)) { | |
$data['photo'] = $FormLister->fs->relativePath($filename); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace EvolutionCMS\Main\Controllers; | |
class ContactsFormController { | |
public function send() | |
{ | |
$form = evo()->runSnippet('FormLister',[ | |
'formid' => 'myform', |