<?php /** * @package HybridAuth * @category modules * @author HybridAuth authors * @author Nazar Mokrynskyi <*****@*****.**> (integration with CleverStyle CMS) * @copyright HybridAuth authors * @license MIT License, see license.txt */ namespace cs; Trigger::instance()->register('System/Config/pre_routing_replace', function () { switch (Config::instance()->components['modules']['HybridAuth']['active']) { case 1: require __DIR__ . '/trigger/enabled.php'; } }); Trigger::instance()->register('System/Index/construct', function () { if (!ADMIN) { return; } switch (Config::instance()->components['modules']['HybridAuth']['active']) { case -1: require __DIR__ . '/trigger/uninstalled.php'; break; } });
$a->save(); } } break; case 'enable': $module_data['active'] = 1; $a->save(); clean_pcache(); Trigger::instance()->run('admin/System/components/modules/enable', ['name' => $module_name]); unset($Cache->functionality, $Cache->languages); break; case 'disable': $module_data['active'] = 0; $a->save(); clean_pcache(); Trigger::instance()->run('admin/System/components/modules/disable', ['name' => $module_name]); unset($Cache->functionality, $Cache->languages); break; case 'remove': if ($module_name == 'System' || $module_data['active'] != '-1') { break; } $ok = true; get_files_list(MODULES . "/{$module_name}", false, 'fd', true, true, false, false, true, function ($item) use(&$ok) { if (is_writable($item)) { is_dir($item) ? @rmdir($item) : @unlink($item); } else { $ok = false; } }); if ($ok && @rmdir(MODULES . "/{$module_name}")) {
<?php /** * @package Plupload * @category modules * @author Moxiecode Systems AB * @author Nazar Mokrynskyi <*****@*****.**> (integration with CleverStyle CMS) * @copyright Moxiecode Systems AB * @license GNU GPL v2, see license.txt */ namespace cs; Trigger::instance()->register('admin/System/components/modules/install/process', function ($data) { if ($data['name'] == 'Plupload') { $Config = Config::instance(); $Config->module('Plupload')->max_file_size = '5mb'; $Config->module('Plupload')->confirmation_time = '900'; } });
<?php /** * @package Metrics * @category plugins * @author Nazar Mokrynskyi <*****@*****.**> * @copyright Copyright (c) 2011-2013, Nazar Mokrynskyi * @license MIT License, see license.txt */ namespace cs; Trigger::instance()->register('System/Page/pre_display', function () { if (User::instance()->user() || !in_array('Metrics', Config::instance()->components['plugins'])) { return; } //Yandex Page::instance()->post_Body .= '<!-- Yandex.Metrika counter --><script type="text/javascript">(function (d, w, c) { (w[c] = w[c] || []).push(function() { try { w.yaCounter24106597 = new Ya.Metrika({id:24106597, ut:"noindex"}); } catch(e) { } }); var n = d.getElementsByTagName("script")[0], s = d.createElement("script"), f = function () { n.parentNode.insertBefore(s, n); }; s.type = "text/javascript"; s.async = true; s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js"; if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); } })(document, window, "yandex_metrika_callbacks");</script><noscript><div><img src="//mc.yandex.ru/watch/24106597?ut=noindex" style="position:absolute; left:-9999px;" alt="" /></div></noscript><!-- /Yandex.Metrika counter -->'; });
<?php /** * @package Plupload * @category modules * @author Moxiecode Systems AB * @author Nazar Mokrynskyi <*****@*****.**> (integration with CleverStyle CMS) * @copyright Moxiecode Systems AB * @license GNU GPL v2, see license.txt */ namespace cs; Trigger::instance()->register('System/Config/pre_routing_replace', function () { switch (Config::instance()->components['modules']['Plupload']['active']) { case 1: require __DIR__ . '/trigger/enabled.php'; } })->register('System/Index/construct', function () { if (!ADMIN) { return; } switch (Config::instance()->components['modules']['Plupload']['active']) { case -1: require __DIR__ . '/trigger/uninstalled.php'; break; case 0: case 1: require __DIR__ . '/trigger/installed.php'; } });
<?php /** * @package Home * @category modules * @author Nazar Mokrynskyi <*****@*****.**> * @copyright Copyright (c) 2014, Nazar Mokrynskyi * @license MIT License, see license.txt */ namespace cs; Trigger::instance()->register('System/Config/routing_replace', function ($data) { $rc = explode('/', $data['rc']); if (isset($rc[0]) && !isset($rc[1]) && is_numeric($rc[0])) { $data['rc'] = "Home/{$rc['0']}"; } });
*/ _include("{$plugin_dir}/meta/update/{$version}.php", true, false); } } unset($old_version); } unlink("{$plugin_dir}/fs_old.json"); unlink("{$plugin_dir}/meta_old.json"); /** * Restore previous plugin state */ if ($active) { $Config->components['plugins'][] = $plugin; $Config->save(); clean_pcache(); Trigger::instance()->run('admin/System/components/plugins/enable', ['name' => $plugin]); } $Index->save(); unset($Cache->functionality); break; case 'remove': if (in_array($plugin, $Config->components['plugins'])) { break; } $ok = true; get_files_list(PLUGINS . "/{$plugin}", false, 'fd', true, true, false, false, true, function ($item) use(&$ok) { if (is_writable($item)) { is_dir($item) ? @rmdir($item) : @unlink($item); } else { $ok = false; }
<?php /** * @package CleverStyle CMS * @subpackage System module * @category modules * @author Nazar Mokrynskyi <*****@*****.**> * @copyright Copyright (c) 2011-2014, Nazar Mokrynskyi * @license MIT License, see license.txt */ /** * Provides next triggers:<br> * System/robots.txt<br> * ['text' => <i>&$text</i>]<br> */ namespace cs; Index::instance()->stop = true; interface_off(); $text = file_get_contents(MFOLDER . '/robots.txt'); Trigger::instance()->run('System/robots.txt', ['text' => &$text]); $text .= 'Host: ' . explode('/', explode('//', Config::instance()->core_url(), 2)[1], 2)[0]; Page::instance()->Content = $text;