This file contains hidden or 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; | |
| use EvolutionCMS\Main\Services\Util; | |
| use EvolutionCMS\ServiceProvider; | |
| use Illuminate\Support\Facades\Route; | |
| use Illuminate\Support\Facades\Blade; | |
| class MainServiceProvider extends ServiceProvider | |
| { | |
This file contains hidden or 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\Odkb\Controllers; | |
| class NewsController extends BaseController { | |
| public function render() { | |
| $this->data['newsmenu'] = json_decode($this->evo->runSnippet('DLMenu', ['parents' => 69, 'maxDepth' => 1, 'api' => 1]), true)[0]; | |
| $this->data['newsitems'] = $this->DocLister([ | |
| 'depth'=>2, |
This file contains hidden or 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
| PageBilder | |
| container.pbcontent.php | |
| <?php | |
| return [ | |
| 'title' => 'Контент', | |
| // 'show_in_templates' => [ 3 ], | |
| // 'show_in_docs' => [ 2 ], | |
| // 'hide_in_docs' => [ 10, 63 ], | |
| // 'addType' => 'images', |
This file contains hidden or 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
| public static function prepare(array $data = array(), DocumentParser $modx, $_DocLister, prepare_DL_Extender $_extDocLister){ | |
| return $data; | |
| } | |
| //FormLister preare нельзять анонимно только название функции или метода | |
| function setSubject(DocumentParser $modx,array $data,\FormLister\Form $Fl,string $name) | |
| { | |
| } | |
This file contains hidden or 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 | |
| if (!defined('MODX_BASE_PATH')) die('HACK???'); | |
| /** | |
| * RedirectFriendly | |
| * | |
| * 301 Редирект с вложенных и наоборот ссылок (полезен при переключении настройки <b>Использовать вложенные URL</b>) | |
| * | |
| * @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html | |
| * @author MrSwed <webmaster@sdcollection.com> |
This file contains hidden or 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
| {foreach $_modx->resource['adv.Index'] | fromJSON as $item} | |
| <div class="col-xs-12 col-sm-6 col-md-4"> | |
| <div class="icon-box left media p-0 mb-40"> | |
| <div class="media-left pull-left"><i class="{$item['icon']} text-theme-colored"></i></div> | |
| <div class="media-body"> | |
| <p class="media-heading heading h5">{$item['title']}</p> | |
| <p>{$item['desc']}</p> | |
| </div> | |
| </div> | |
| </div> |
This file contains hidden or 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
| В этой статье я покажу как с помощью библиотеки modHelpers защитить форму от CSRF атаки при использовании дополнения FormIt. Механизм защиты сайта был подробно описан в этой статье. | |
| Мы знаем, что подключить свою логику к FormIt можно через хуки. Хук — это сниппет. Поэтому создаём сниппет и даем ему название «csrf». Он содержит всего несколько строчек: | |
| if (request()->checkCsrfToken('post') === false) { | |
| // Выставляем плейсхолдер ошибки | |
| $hook->addError('csrf','Ошибка! Указан некорректный токен.'); | |
| return false; | |
| } | |
| return true; |
This file contains hidden or 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 ($modx->event->name == 'OnLoadWebDocument') { | |
| $uri = $_SERVER['REQUEST_URI']; | |
| if ($modx->resource->isfolder && substr($uri, -1) != '/' && !strpos($uri, '?')) { | |
| $modx->sendRedirect($modx->makeUrl($modx->resource->id),array('responseCode' => 'HTTP/1.1 301 Moved Permanently')); | |
| } | |
| } |
This file contains hidden or 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
| Собственно все можете проверять в консоли modx. | |
| $where = array( | |
| array( | |
| "available:="=>"0" | |
| ,"AND:toOrder:="=>"1" | |
| ) | |
| ,"OR:available:="=>"1" | |
| ); | |
| $c = $modx->newQuery('modResource'); |
This file contains hidden or 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
| /***************************************************************** | |
| * | |
| * Copy Layer text 1.0 - by Praveen Vijayan! - http://www.decodize.com/ | |
| * | |
| * Compatibility above Photoshop CS6 | |
| * | |
| * Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/ | |
| * | |
| *****************************************************************/ | |
NewerOlder